summaryrefslogtreecommitdiff
path: root/Makefile.libcompat
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2018-01-11 19:24:44 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2018-01-11 19:24:44 +0000
commit8d286bb9922fda299d997af01a336dfdf47aa305 (patch)
tree48d9847c781a3a90b696b8acc46b6791779918c4 /Makefile.libcompat
parentd162bbc1d3c466c2a4fea77fe780587064470723 (diff)
downloadsrc-test2-8d286bb9922fda299d997af01a336dfdf47aa305.tar.gz
src-test2-8d286bb9922fda299d997af01a336dfdf47aa305.zip
Allow MIPS lib32 to build with clang.
Don't try to set -march as clang doesn't permit use of the O32 ABI with newer CPU microarchitectures like 'mips3'. In addition, clang doesn't permit the O32 ABI with the default N64 target, so use an explicit O32 -target for clang. Sponsored by: DARPA / AFRL
Notes
Notes: svn path=/head/; revision=327841
Diffstat (limited to 'Makefile.libcompat')
-rw-r--r--Makefile.libcompat9
1 files changed, 9 insertions, 0 deletions
diff --git a/Makefile.libcompat b/Makefile.libcompat
index b8fc76c4e152..afc1be1df065 100644
--- a/Makefile.libcompat
+++ b/Makefile.libcompat
@@ -35,11 +35,20 @@ LIB32WMAKEFLAGS= \
OBJCOPY="${XOBJCOPY}"
.elif ${TARGET_ARCH:Mmips64*} != ""
+.if ${WANT_COMPILER_TYPE} == clang || \
+ (defined(X_COMPILER_TYPE) && ${X_COMPILER_TYPE} == clang)
+.if ${TARGET_ARCH:Mmips64el*} != ""
+LIB32CPUFLAGS= -target mipsel-unknown-freebsd12.0
+.else
+LIB32CPUFLAGS= -target mips-unknown-freebsd12.0
+.endif
+.else
.if empty(TARGET_CPUTYPE)
LIB32CPUFLAGS= -march=mips3
.else
LIB32CPUFLAGS= -march=${TARGET_CPUTYPE}
.endif
+.endif
LIB32CPUFLAGS+= -mabi=32
LIB32WMAKEENV= MACHINE=mips MACHINE_ARCH=mips
.if ${TARGET_ARCH:Mmips64el*} != ""