aboutsummaryrefslogtreecommitdiff
path: root/lib/clang/llvm.build.mk
diff options
context:
space:
mode:
Diffstat (limited to 'lib/clang/llvm.build.mk')
-rw-r--r--lib/clang/llvm.build.mk32
1 files changed, 14 insertions, 18 deletions
diff --git a/lib/clang/llvm.build.mk b/lib/clang/llvm.build.mk
index dd54bf7312d9..7b16f4485340 100644
--- a/lib/clang/llvm.build.mk
+++ b/lib/clang/llvm.build.mk
@@ -1,4 +1,3 @@
-# $FreeBSD$
.include <src.opts.mk>
@@ -30,23 +29,28 @@ CFLAGS+= -DHAVE_VCS_VERSION_INC
CFLAGS+= -DNDEBUG
.endif
+# Note that using TARGET_ARCH here is essential for a functional native-xtools
+# build! For native-xtools, we're building binaries that will work on the
+# *host* machine (MACHINE_ARCH), but they should default to producing binaries
+# for the *target* machine (TARGET_ARCH).
TARGET_ARCH?= ${MACHINE_ARCH}
BUILD_ARCH?= ${MACHINE_ARCH}
# Armv6 and armv7 uses hard float abi, unless the CPUTYPE has soft in it.
-# arm (for armv4 and armv5 CPUs) always uses the soft float ABI.
# For all other targets, we stick with 'unknown'.
-.if ${TARGET_ARCH:Marmv[67]*} && (!defined(CPUTYPE) || ${CPUTYPE:M*soft*} == "")
-TARGET_ABI= -gnueabihf
-.elif ${TARGET_ARCH:Marm*}
-TARGET_ABI= -gnueabi
+.if ${TARGET_ARCH:Marm*}
+.if !defined(CPUTYPE) || ${CPUTYPE:M*soft*} == ""
+TARGET_TRIPLE_ABI=-gnueabihf
.else
-TARGET_ABI=
+TARGET_TRIPLE_ABI=-gnueabi
+.endif
+.else
+TARGET_TRIPLE_ABI=
.endif
VENDOR= unknown
-LLVM_TARGET_TRIPLE?= ${TARGET_ARCH:C/amd64/x86_64/:C/[hs]f$//:S/mipsn32/mips64/}-${VENDOR}-freebsd${OS_REVISION}${TARGET_ABI}
-LLVM_BUILD_TRIPLE?= ${BUILD_ARCH:C/amd64/x86_64/:C/[hs]f$//:S/mipsn32/mips64/}-${VENDOR}-freebsd${OS_REVISION}
+LLVM_TARGET_TRIPLE?= ${TARGET_ARCH:C/amd64/x86_64/}-${VENDOR}-freebsd${OS_REVISION}${TARGET_TRIPLE_ABI}
+LLVM_BUILD_TRIPLE?= ${BUILD_ARCH:C/amd64/x86_64/}-${VENDOR}-freebsd${OS_REVISION}
CFLAGS+= -DLLVM_DEFAULT_TARGET_TRIPLE=\"${LLVM_TARGET_TRIPLE}\"
CFLAGS+= -DLLVM_HOST_TRIPLE=\"${LLVM_BUILD_TRIPLE}\"
@@ -69,9 +73,6 @@ CFLAGS+= -DLLVM_TARGET_ENABLE_BPF
.endif
.if ${MK_LLVM_TARGET_MIPS} != "no"
CFLAGS+= -DLLVM_TARGET_ENABLE_MIPS
-. if ${MACHINE_CPUARCH} == "mips"
-LLVM_NATIVE_ARCH= Mips
-. endif
.endif
.if ${MK_LLVM_TARGET_POWERPC} != "no"
CFLAGS+= -DLLVM_TARGET_ENABLE_POWERPC
@@ -110,7 +111,7 @@ LDFLAGS+= -Wl,-dead_strip
LDFLAGS+= -Wl,--gc-sections
.endif
-CXXSTD?= c++14
+CXXSTD?= c++17
CXXFLAGS+= -fno-exceptions
CXXFLAGS+= -fno-rtti
.if ${.MAKE.OS} == "FreeBSD" || !defined(BOOTSTRAPPING)
@@ -122,8 +123,3 @@ CFLAGS+= -DBOOTSTRAPPING_WANT_NATIVE_SYSCTL
.if defined(BOOTSTRAPPING) && ${.MAKE.OS} == "Linux"
LIBADD+= dl
.endif
-
-.if ${MACHINE_ARCH:Mmips64}
-STATIC_CFLAGS+= -mxgot
-STATIC_CXXFLAGS+= -mxgot
-.endif