summaryrefslogtreecommitdiff
path: root/Makefile.inc1
diff options
context:
space:
mode:
authorBryan Drewery <bdrewery@FreeBSD.org>2016-08-23 15:20:32 +0000
committerBryan Drewery <bdrewery@FreeBSD.org>2016-08-23 15:20:32 +0000
commitbb0cd1b5145d1b94d2617d7e49be28ffba053186 (patch)
tree030f96f8352e79fae039c415c39ea6fa7c65d174 /Makefile.inc1
parentadd3a4c20d0b74825c24205d215cf420c88ae778 (diff)
downloadsrc-test2-bb0cd1b5145d1b94d2617d7e49be28ffba053186.tar.gz
src-test2-bb0cd1b5145d1b94d2617d7e49be28ffba053186.zip
Always pass in -target and --sysroot flags for the build.
The internal bootstrap compiler has a default sysroot set by TOOLS_PREFIX and target set by TARGET/TARGET_ARCH. However, there are several needs to always pass an explicit --sysroot and -target. - External compiler needs sysroot and target flags. - External ld needs sysroot. - To be clear about the use of a sysroot when using the internal compiler. - Easier debugging. - Allowing WITH_SYSTEM_COMPILER+WITH_META_MODE to work together due to the flip-flopping build command when sometimes using external and sometimes using internal. - Allow using no lld which has support for default paths. The default sysroot in the bootstrap compiler is not changed. The buildenv compiler will still work with its default and will also include -target/--sysroot from CC in the environment. MFC after: 3 days Discussed with: emaste, brooks (BSDCam) Reviewed by: emaste Sponsored by: EMC / Isilon Storage Division
Notes
Notes: svn path=/head/; revision=304681
Diffstat (limited to 'Makefile.inc1')
-rw-r--r--Makefile.inc115
1 files changed, 12 insertions, 3 deletions
diff --git a/Makefile.inc1 b/Makefile.inc1
index 1d858d2cf5bc..310c26edaf42 100644
--- a/Makefile.inc1
+++ b/Makefile.inc1
@@ -550,8 +550,18 @@ CROSSENV+= CC="${XCC} ${XCFLAGS}" CXX="${XCXX} ${XCXXFLAGS} ${XCFLAGS}" \
BFLAGS+= -B${CROSS_BINUTILS_PREFIX}
.endif
-# External compiler needs sysroot and target flags.
-.if ${MK_CLANG_BOOTSTRAP} == "no" && ${MK_GCC_BOOTSTRAP} == "no"
+
+# The internal bootstrap compiler has a default sysroot set by TOOLS_PREFIX
+# and target set by TARGET/TARGET_ARCH. However, there are several needs to
+# always pass an explicit --sysroot and -target.
+# - External compiler needs sysroot and target flags.
+# - External ld needs sysroot.
+# - To be clear about the use of a sysroot when using the internal compiler.
+# - Easier debugging.
+# - Allowing WITH_SYSTEM_COMPILER+WITH_META_MODE to work together due to
+# the flip-flopping build command when sometimes using external and
+# sometimes using internal.
+# - Allow using lld which has no support for default paths.
.if !defined(CROSS_BINUTILS_PREFIX) || !exists(${CROSS_BINUTILS_PREFIX})
BFLAGS+= -B${WORLDTMP}/usr/bin
.endif
@@ -579,7 +589,6 @@ TARGET_TRIPLE?= ${TARGET_ARCH:C/amd64/x86_64/}-${TARGET_ABI}-freebsd12.0
XCFLAGS+= -target ${TARGET_TRIPLE}
.endif
XCFLAGS+= --sysroot=${WORLDTMP}
-.endif # ${MK_CLANG_BOOTSTRAP} == "no" && ${MK_GCC_BOOTSTRAP} == "no"
.if !empty(BFLAGS)
XCFLAGS+= ${BFLAGS}