diff options
author | bdrewery <bdrewery@FreeBSD.org> | 2016-03-25 19:12:38 +0000 |
---|---|---|
committer | bdrewery <bdrewery@FreeBSD.org> | 2016-03-25 19:12:38 +0000 |
commit | 64d40c9f8c1b4d9a3355f6fa6fcace1dd40c9f3d (patch) | |
tree | a8747b02baee17e61327716df846db917940d857 /share | |
parent | 54f229f3df34dbfde09737a4cfadb5a0ac95854e (diff) | |
download | FreeBSD-src-64d40c9f8c1b4d9a3355f6fa6fcace1dd40c9f3d.zip FreeBSD-src-64d40c9f8c1b4d9a3355f6fa6fcace1dd40c9f3d.tar.gz |
Build libcompat (lib32) with a --sysroot pointing into its stage directory.
This overrides the cross-compiler's default sysroot to use the WORLD32's
sysroot for building the lib32 libraries. Previously the cross-compiler
would default the sysroot to the 64bit WORLDTMP and -B/-L/-isystem flags
were used to build using the lib32 files. This leads to multiple issues
discussed later. Some extra headers are now needed to be staged since the
64bit WORLDTMP is not referenced at all for headers. The 64bit WORLDTMP
is still used via PATH for build tools. Overriding the default
target/arch is retained in the CC/CXX overrides.
This allows reverting the LDSCRIPT rewriting in installworld from r296921 and
r235122, thus allowing read-only objdirs to work for installing again.
This removes the need for _LDSCRIPTROOT.
This allows progressing the change to always use --sysroot for the build
rather than only relying on the cross-compiler's default sysroot. The
work for that is in D3970 and needed to resolve WITHOUT_CROSS_COMPILER
not using a --sysroot [1].
PR: 196193 [1]
Sponsored by: EMC / Isilon Storage Division
Diffstat (limited to 'share')
-rw-r--r-- | share/mk/bsd.lib.mk | 24 | ||||
-rw-r--r-- | share/mk/bsd.sys.mk | 1 |
2 files changed, 2 insertions, 23 deletions
diff --git a/share/mk/bsd.lib.mk b/share/mk/bsd.lib.mk index 4a8fe89..3339ae2 100644 --- a/share/mk/bsd.lib.mk +++ b/share/mk/bsd.lib.mk @@ -215,26 +215,10 @@ ${SHLIB_NAME_FULL}: beforelinking .endif .if defined(SHLIB_LINK) -# ${_LDSCRIPTROOT} is needed when cross-building -# and when building 32 bits library shims. -# -# ${_LDSCRIPTROOT} is the directory prefix that will be used when generating -# ld(1) scripts. The crosstools' ld is configured to lookup libraries in an -# alternative directory which is called "sysroot", so during buildworld binaries -# won't be linked against the running system libraries but against the ones of -# the current source tree. ${_LDSCRIPTROOT} behavior is twisted because of -# the location where we store them: -# - 64 bits libs are located under sysroot, so ${_LDSCRIPTROOT} must be empty -# because ld(1) will manage to find them from sysroot; -# - 32 bits shims are not, so ${_LDSCRIPTROOT} is used to specify their full -# path, outside of sysroot. -# Note that ld(1) scripts are generated both during buildworld and -# installworld; in the later case ${_LDSCRIPTROOT} must be obviously empty -# because on the target system, libraries are meant to be looked up from /. .if defined(SHLIB_LDSCRIPT) && !empty(SHLIB_LDSCRIPT) && exists(${.CURDIR}/${SHLIB_LDSCRIPT}) ${SHLIB_LINK:R}.ld: ${.CURDIR}/${SHLIB_LDSCRIPT} - sed -e 's,@@SHLIB@@,${_LDSCRIPTROOT}${_SHLIBDIR}/${SHLIB_NAME},g' \ - -e 's,@@LIBDIR@@,${_LDSCRIPTROOT}${_LIBDIR},g' \ + sed -e 's,@@SHLIB@@,${_SHLIBDIR}/${SHLIB_NAME},g' \ + -e 's,@@LIBDIR@@,${_LIBDIR},g' \ ${.ALLSRC} > ${.TARGET} ${SHLIB_NAME_FULL}: ${SHLIB_LINK:R}.ld @@ -338,9 +322,6 @@ _SHLINSTALLFLAGS:= ${_SHLINSTALLFLAGS${ie}} .if !defined(INTERNALLIB) realinstall: _libinstall .ORDER: beforeinstall _libinstall -.if target(${SHLIB_LINK:R}.ld) -_libinstall: ${SHLIB_LINK:R}.ld -.endif _libinstall: .if defined(LIB) && !empty(LIB) && ${MK_INSTALLLIB} != "no" ${INSTALL} -C -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ @@ -367,7 +348,6 @@ _libinstall: ${INSTALL} -S -C -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ ${_INSTALLFLAGS} ${SHLIB_LINK:R}.ld \ ${DESTDIR}${_LIBDIR}/${SHLIB_LINK} - rm -f ${SHLIB_LINK:R}.ld .for _SHLIB_LINK_LINK in ${SHLIB_LDSCRIPT_LINKS} ${INSTALL_SYMLINK} ${SHLIB_LINK} ${DESTDIR}${_LIBDIR}/${_SHLIB_LINK_LINK} .endfor diff --git a/share/mk/bsd.sys.mk b/share/mk/bsd.sys.mk index 0e6a07ee..d3893d2 100644 --- a/share/mk/bsd.sys.mk +++ b/share/mk/bsd.sys.mk @@ -231,7 +231,6 @@ stage_files.shlib: ${_LIBS:M*.so.*} .endif .if defined(SHLIB_LINK) && commands(${SHLIB_LINK:R}.ld) -#_LDSCRIPTROOT?= ${STAGE_OBJTOP} STAGE_AS_SETS+= ldscript STAGE_AS.ldscript+= ${SHLIB_LINK:R}.ld stage_as.ldscript: ${SHLIB_LINK:R}.ld |