summaryrefslogtreecommitdiffstats
path: root/Makefile.libcompat
diff options
context:
space:
mode:
authorbdrewery <bdrewery@FreeBSD.org>2016-03-25 19:12:38 +0000
committerbdrewery <bdrewery@FreeBSD.org>2016-03-25 19:12:38 +0000
commit64d40c9f8c1b4d9a3355f6fa6fcace1dd40c9f3d (patch)
treea8747b02baee17e61327716df846db917940d857 /Makefile.libcompat
parent54f229f3df34dbfde09737a4cfadb5a0ac95854e (diff)
downloadFreeBSD-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 'Makefile.libcompat')
-rw-r--r--Makefile.libcompat22
1 files changed, 13 insertions, 9 deletions
diff --git a/Makefile.libcompat b/Makefile.libcompat
index cf5ea3b..d8845f9 100644
--- a/Makefile.libcompat
+++ b/Makefile.libcompat
@@ -64,13 +64,17 @@ LIBCOMPAT_OBJTREE?= ${OBJTREE}${.CURDIR}/world${libcompat}
LIBCOMPATTMP?= ${OBJTREE}${.CURDIR}/lib${libcompat}
LIBCOMPATCFLAGS+= ${LIBCOMPATCPUFLAGS} \
- -isystem ${LIBCOMPATTMP}/usr/include/ \
-L${LIBCOMPATTMP}/usr/lib${libcompat} \
- -B${LIBCOMPATTMP}/usr/lib${libcompat}
+ --sysroot=${LIBCOMPATTMP}
+
+# -B is needed to find /usr/lib32/crti.o for GCC and /usr/libsoft/crti.o for
+# Clang/GCC.
+LIBCOMPATCFLAGS+= -B${LIBCOMPATTMP}/usr/lib${libcompat}
+# GCC requires -isystem when using a cross-compiler.
+LIBCOMPATCFLAGS+= -isystem ${LIBCOMPATTMP}/usr/include
# Yes, the flags are redundant.
LIBCOMPATWMAKEENV+= MAKEOBJDIRPREFIX=${LIBCOMPAT_OBJTREE} \
- _LDSCRIPTROOT=${LIBCOMPATTMP} \
INSTALL="sh ${.CURDIR}/tools/install.sh" \
PATH=${TMPPATH} \
LIBDIR=/usr/lib${libcompat} \
@@ -89,15 +93,16 @@ LIBCOMPATIMAKE+= ${LIBCOMPATWMAKE:NINSTALL=*:NDESTDIR=*:N_LDSCRIPTROOT=*} \
MK_TOOLCHAIN=no ${IMAKE_INSTALL} \
-DLIBRARIES_ONLY
-.if ${XCC:N${CCACHE_BIN}:M/*}
-LIBCOMPATCFLAGS+= --sysroot=${WORLDTMP}
-.endif
-
_LC_LIBDIRS.yes= lib gnu/lib
_LC_LIBDIRS.${MK_CDDL:tl}+= cddl/lib
_LC_LIBDIRS.${MK_CRYPT:tl}+= secure/lib
_LC_LIBDIRS.${MK_KERBEROS:tl}+= kerberos5/lib
+_LC_INCDIRS= \
+ include \
+ lib/ncurses/ncursesw \
+ ${_LC_LIBDIRS.yes}
+
# Shared logic
build${libcompat}: .PHONY
@echo
@@ -120,8 +125,7 @@ build${libcompat}: .PHONY
mkdir -p ${WORLDTMP}
ln -sf ${.CURDIR}/sys ${WORLDTMP}
.for _t in obj includes
- ${_+_}cd ${.CURDIR}/include; ${LIBCOMPATWMAKE} DIRPRFX=include/ ${_t}
-.for _dir in ${_LC_LIBDIRS.yes}
+.for _dir in ${_LC_INCDIRS}
${_+_}cd ${.CURDIR}/${_dir}; ${LIBCOMPATWMAKE} DIRPRFX=${_dir}/ ${_t}
.endfor
.endfor
OpenPOWER on IntegriCloud