aboutsummaryrefslogtreecommitdiff
path: root/Makefile.inc1
diff options
context:
space:
mode:
authorBryan Drewery <bdrewery@FreeBSD.org>2016-08-23 19:29:37 +0000
committerBryan Drewery <bdrewery@FreeBSD.org>2016-08-23 19:29:37 +0000
commit4d611b2b2d8ef0a80823853e26868f7c6d816d74 (patch)
treed02cd4dd968a04817554b98a24fed17579d4fc4b /Makefile.inc1
parentde7b37e61892b3134a7bcf86f402af987671a575 (diff)
Notes
Diffstat (limited to 'Makefile.inc1')
-rw-r--r--Makefile.inc19
1 files changed, 7 insertions, 2 deletions
diff --git a/Makefile.inc1 b/Makefile.inc1
index 310c26edaf42..d87a6dbdb963 100644
--- a/Makefile.inc1
+++ b/Makefile.inc1
@@ -572,18 +572,23 @@ TARGET_ABI= gnueabihf
TARGET_ABI= gnueabi
.endif
.endif
-.if defined(X_COMPILER_TYPE) && ${X_COMPILER_TYPE} == gcc
+.if ${WANT_COMPILER_TYPE} == gcc || \
+ (defined(X_COMPILER_TYPE) && ${X_COMPILER_TYPE} == gcc)
# GCC requires -isystem and -L when using a cross-compiler. --sysroot
# won't set header path and -L is used to ensure the base library path
# is added before the port PREFIX library path.
XCFLAGS+= -isystem ${WORLDTMP}/usr/include -L${WORLDTMP}/usr/lib
+# GCC requires -B to find /usr/lib/crti.o when using a cross-compiler
+# combined with --sysroot.
+XCFLAGS+= -B${WORLDTMP}/usr/lib
# Force using libc++ for external GCC.
# XXX: This should be checking MK_GNUCXX == no
.if ${X_COMPILER_VERSION} >= 40800
XCXXFLAGS+= -isystem ${WORLDTMP}/usr/include/c++/v1 -std=c++11 \
-nostdinc++ -L${WORLDTMP}/../lib/libc++
.endif
-.else
+.elif ${WANT_COMPILER_TYPE} == clang || \
+ (defined(X_COMPILER_TYPE) && ${X_COMPILER_TYPE} == clang)
TARGET_ABI?= unknown
TARGET_TRIPLE?= ${TARGET_ARCH:C/amd64/x86_64/}-${TARGET_ABI}-freebsd12.0
XCFLAGS+= -target ${TARGET_TRIPLE}