From: John Marino Date: Mon, 21 Mar 2016 17:56:50 +0000 (+0100) Subject: Add -march support for CCVER=clang* (new bsd.cpu.clang.mk) X-Git-Tag: v4.6.0rc~663 X-Git-Url: https://gitweb.dragonflybsd.org/dragonfly.git/commitdiff_plain/e3c44cf9512eaeefc854f1301b03c687a682a5b4 Add -march support for CCVER=clang* (new bsd.cpu.clang.mk) --- diff --git a/share/mk/bsd.cpu.clang.mk b/share/mk/bsd.cpu.clang.mk new file mode 100644 index 0000000000..f8359e3bbf --- /dev/null +++ b/share/mk/bsd.cpu.clang.mk @@ -0,0 +1,45 @@ +# Set default CPU compile flags and baseline CPUTYPE for each arch. The +# compile flags must support the minimum CPU type for each architecture but +# may tune support for more advanced processors. + +generic_x86_64= x86_64 mmx sse sse2 +generic_i386= i386 + +.if !defined(CPUTYPE) || empty(CPUTYPE) || ${CPUTYPE} == "native" + +. if defined(CPUTYPE) && ${CPUTYPE:Mnative} +_CPUCFLAGS= -march=native +. else +_CPUCFLAGS= +. endif + +MACHINE_CPU= ${generic_${MACHINE_ARCH}} + +.else + +known_x86_64= x86_64 i386 +known_i386= i386 + +. if defined(known_${MACHINE_ARCH}) && \ + !empty(known_${MACHINE_ARCH}:M${CPUTYPE}) # CID: Check CPUTYPE + +# i386 used for 32-bit BIOS-based boot loaders + +C_x86_64= ${generic_x86_64} +C_i386= ${generic_i386} + +_CPUCFLAGS= -march=${CPUTYPE} +MACHINE_CPU= ${C_${CPUTYPE:S|-||}} + +. else # CID: Check CPUTYPE + +# CPUTYPE was defined and was not empty, but the value does not match known +# CPU types of the defined MACHINE_ARCH. Set -march to native and define +# generic features based on MACHINE_ARCH + +_CPUCFLAGS= -march=native +MACHINE_CPU= ${generic_${MACHINE_ARCH}} + +. endif # CID: Check CPUTYPE + +.endif diff --git a/share/mk/bsd.cpu.mk b/share/mk/bsd.cpu.mk index 651c69cb6d..2902691a92 100644 --- a/share/mk/bsd.cpu.mk +++ b/share/mk/bsd.cpu.mk @@ -43,6 +43,8 @@ CPUTYPE= ${FORCE_CPUTYPE} . include .elif ${CCVER} == gcc50 . include +.elif ${CCVER:Mclang*} +. include .else . include .endif