svn commit: r260096 - in stable: 10/gnu/lib/csu 10/gnu/lib/libgcc 10/gnu/lib/libstdc++ 10/gnu/lib/libsupc++ 10/lib/atf/libatf-c/tests 10/lib/libstand 10/share/mk 10/sys/boot/ficl 10/sys/boot/i386 1...
Dimitry Andric
dim at FreeBSD.org
Mon Dec 30 20:15:55 UTC 2013
Author: dim
Date: Mon Dec 30 20:15:46 2013
New Revision: 260096
URL: http://svnweb.freebsd.org/changeset/base/260096
Log:
MFC r257532 (by adrian):
Fix this build for clang.
MFC r259730:
To avoid having to explicitly test COMPILER_TYPE for setting
clang-specific or gcc-specific flags, introduce the following new
variables for use in Makefiles:
CFLAGS.clang
CFLAGS.gcc
CXXFLAGS.clang
CXXFLAGS.gcc
In bsd.sys.mk, these get appended to the regular CFLAGS or CXXFLAGS for
the right compiler.
MFC r259913:
For libstand and sys/boot, split off gcc-only flags into CFLAGS.gcc.
MFC r259927:
Fix pc98 build, by also forcing COMPILER_TYPE in sys/boot/pc98/boot2's
Makefile.
Pointy hat to: dim
Modified:
stable/10/gnu/lib/csu/Makefile
stable/10/gnu/lib/libgcc/Makefile
stable/10/gnu/lib/libstdc++/Makefile
stable/10/gnu/lib/libsupc++/Makefile
stable/10/lib/atf/libatf-c/tests/Makefile
stable/10/lib/libstand/Makefile
stable/10/share/mk/bsd.sys.mk
stable/10/sys/boot/ficl/Makefile
stable/10/sys/boot/i386/Makefile.inc
stable/10/sys/boot/i386/boot2/Makefile
stable/10/sys/boot/pc98/Makefile.inc
stable/10/sys/boot/pc98/boot2/Makefile
stable/10/sys/boot/usb/Makefile
stable/10/sys/boot/usb/Makefile.test
stable/10/sys/boot/userboot/ficl/Makefile
stable/10/sys/boot/userboot/libstand/Makefile
stable/10/sys/boot/zfs/Makefile
stable/10/sys/conf/Makefile.arm
stable/10/tools/tools/ath/athstats/Makefile
stable/10/tools/tools/net80211/wlanstats/Makefile
stable/10/usr.bin/mkcsmapper/Makefile.inc
Directory Properties:
stable/10/ (props changed)
Changes in other areas also in this revision:
Modified:
stable/9/gnu/lib/csu/Makefile
stable/9/lib/libstand/Makefile
stable/9/share/mk/bsd.sys.mk (contents, props changed)
stable/9/sys/boot/ficl/Makefile
stable/9/sys/boot/i386/Makefile.inc
stable/9/sys/boot/i386/boot2/Makefile
stable/9/sys/boot/pc98/Makefile.inc
stable/9/sys/boot/pc98/boot2/Makefile
stable/9/sys/boot/userboot/ficl/Makefile
stable/9/sys/boot/userboot/libstand/Makefile
stable/9/sys/boot/zfs/Makefile
stable/9/tools/tools/ath/athstats/Makefile
stable/9/tools/tools/net80211/wlanstats/Makefile
stable/9/usr.bin/mkcsmapper/Makefile.inc
Directory Properties:
stable/9/gnu/lib/csu/ (props changed)
stable/9/lib/libstand/ (props changed)
stable/9/share/mk/ (props changed)
stable/9/sys/ (props changed)
stable/9/usr.bin/mkcsmapper/ (props changed)
Modified: stable/10/gnu/lib/csu/Makefile
==============================================================================
--- stable/10/gnu/lib/csu/Makefile Mon Dec 30 19:05:50 2013 (r260095)
+++ stable/10/gnu/lib/csu/Makefile Mon Dec 30 20:15:46 2013 (r260096)
@@ -15,9 +15,7 @@ OBJS= crtbegin.o crtend.o crtbeginT.o
SOBJS= crtbeginS.o crtendS.o
CSTD?= gnu89
CFLAGS+= -DIN_GCC -DHAVE_LD_EH_FRAME_HDR -DDT_CONFIG -D__GLIBC__=3
-.if ${COMPILER_TYPE} == "gcc"
-CFLAGS+= -finhibit-size-directive -fno-toplevel-reorder
-.endif
+CFLAGS.gcc+= -finhibit-size-directive -fno-toplevel-reorder
CFLAGS+= -fno-inline-functions -fno-exceptions \
-fno-zero-initialized-in-bss -fno-asynchronous-unwind-tables \
-fno-omit-frame-pointer
Modified: stable/10/gnu/lib/libgcc/Makefile
==============================================================================
--- stable/10/gnu/lib/libgcc/Makefile Mon Dec 30 19:05:50 2013 (r260095)
+++ stable/10/gnu/lib/libgcc/Makefile Mon Dec 30 20:15:46 2013 (r260096)
@@ -112,9 +112,7 @@ LIB2_DIVMOD_FUNCS = _divdi3 _moddi3 _udi
.if ${TARGET_CPUARCH} == "arm"
# from config/arm/t-strongarm-elf
CFLAGS+= -Dinhibit_libc -fno-inline
-.if ${COMPILER_TYPE} == "clang"
-CFLAGS+= -fheinous-gnu-extensions
-.endif
+CFLAGS.clang+= -fheinous-gnu-extensions
LIB1ASMSRC = lib1funcs.asm
LIB1ASMFUNCS = _dvmd_tls _bb_init_func
Modified: stable/10/gnu/lib/libstdc++/Makefile
==============================================================================
--- stable/10/gnu/lib/libstdc++/Makefile Mon Dec 30 19:05:50 2013 (r260095)
+++ stable/10/gnu/lib/libstdc++/Makefile Mon Dec 30 20:15:46 2013 (r260096)
@@ -637,6 +637,4 @@ CLEANFILES+= ${VERSION_MAP}
# Filter out libc++-specific flags, and -std= flags above c++98 or gnu++98.
CXXFLAGS:= ${CXXFLAGS:N-stdlib=libc++:N-std=c++[01][13x]:N-std=gnu++[01][13x]}
-.if ${COMPILER_TYPE} == "clang"
-CXXFLAGS+= -stdlib=libstdc++
-.endif
+CXXFLAGS.clang+= -stdlib=libstdc++
Modified: stable/10/gnu/lib/libsupc++/Makefile
==============================================================================
--- stable/10/gnu/lib/libsupc++/Makefile Mon Dec 30 19:05:50 2013 (r260095)
+++ stable/10/gnu/lib/libsupc++/Makefile Mon Dec 30 20:15:46 2013 (r260096)
@@ -57,6 +57,4 @@ VERSION_MAP= ${.CURDIR}/Version.map
# Filter out libc++-specific flags, and -std= flags above c++98 or gnu++98.
CXXFLAGS:= ${CXXFLAGS:N-stdlib=libc++:N-std=c++[01][13x]:N-std=gnu++[01][13x]}
-.if ${COMPILER_TYPE} == "clang"
-CXXFLAGS+= -stdlib=libstdc++
-.endif
+CXXFLAGS.clang+= -stdlib=libstdc++
Modified: stable/10/lib/atf/libatf-c/tests/Makefile
==============================================================================
--- stable/10/lib/atf/libatf-c/tests/Makefile Mon Dec 30 19:05:50 2013 (r260095)
+++ stable/10/lib/atf/libatf-c/tests/Makefile Mon Dec 30 20:15:46 2013 (r260096)
@@ -10,12 +10,10 @@ ATF= ${.CURDIR:H:H:H:H}/contrib/atf
CFLAGS+= -I${ATF}
-.if ${COMPILER_TYPE} == "clang"
# macros_test.c contains a double 'const const' which will be gone with
# the import of atf-0.18.
# TODO(jmmv): Remove this workaround once we do that update.
-CFLAGS+= -Wno-duplicate-decl-specifier
-.endif
+CFLAGS.clang+= -Wno-duplicate-decl-specifier
FILESDIR= ${TESTSDIR}
FILES= macros_h_test.c
Modified: stable/10/lib/libstand/Makefile
==============================================================================
--- stable/10/lib/libstand/Makefile Mon Dec 30 19:05:50 2013 (r260095)
+++ stable/10/lib/libstand/Makefile Mon Dec 30 20:15:46 2013 (r260096)
@@ -21,7 +21,7 @@ CFLAGS+= -ffreestanding -Wformat
CFLAGS+= -I${.CURDIR}
.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"
-CFLAGS+= -mpreferred-stack-boundary=2
+CFLAGS.gcc+= -mpreferred-stack-boundary=2
CFLAGS+= -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -msoft-float
.endif
.if ${MACHINE} == "pc98"
Modified: stable/10/share/mk/bsd.sys.mk
==============================================================================
--- stable/10/share/mk/bsd.sys.mk Mon Dec 30 19:05:50 2013 (r260095)
+++ stable/10/share/mk/bsd.sys.mk Mon Dec 30 20:15:46 2013 (r260096)
@@ -114,12 +114,19 @@ CWARNFLAGS+= -Wno-format
CWARNFLAGS+= -Wno-unknown-pragmas
.endif # IGNORE_PRAGMA
-.if ${COMPILER_TYPE} == "clang" && !defined(EARLY_BUILD)
+.if !defined(EARLY_BUILD)
+.if ${COMPILER_TYPE} == "clang"
CLANG_NO_IAS= -no-integrated-as
CLANG_OPT_SMALL= -mstack-alignment=8 -mllvm -inline-threshold=3\
-mllvm -enable-load-pre=false -mllvm -simplifycfg-dup-ret
CFLAGS+= -Qunused-arguments
+CFLAGS+= ${CFLAGS.clang}
+CXXFLAGS+= ${CXXFLAGS.clang}
+.else # !CLANG
+CFLAGS+= ${CFLAGS.gcc}
+CXXFLAGS+= ${CXXFLAGS.gcc}
.endif # CLANG
+.endif # !EARLY_BUILD
.if ${MK_SSP} != "no" && ${MACHINE_CPUARCH} != "ia64" && \
${MACHINE_CPUARCH} != "arm" && ${MACHINE_CPUARCH} != "mips"
Modified: stable/10/sys/boot/ficl/Makefile
==============================================================================
--- stable/10/sys/boot/ficl/Makefile Mon Dec 30 19:05:50 2013 (r260095)
+++ stable/10/sys/boot/ficl/Makefile Mon Dec 30 20:15:46 2013 (r260096)
@@ -17,7 +17,7 @@ CFLAGS+= -ffreestanding
.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"
.if !defined(FICL64)
CFLAGS+= -march=i386
-CFLAGS+= -mpreferred-stack-boundary=2
+CFLAGS.gcc+= -mpreferred-stack-boundary=2
.endif
CFLAGS+= -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -msoft-float
.endif
Modified: stable/10/sys/boot/i386/Makefile.inc
==============================================================================
--- stable/10/sys/boot/i386/Makefile.inc Mon Dec 30 19:05:50 2013 (r260095)
+++ stable/10/sys/boot/i386/Makefile.inc Mon Dec 30 20:15:46 2013 (r260096)
@@ -5,8 +5,9 @@
BINDIR?= /boot
LOADER_ADDRESS?=0x200000
-CFLAGS+= -march=i386 -ffreestanding -mpreferred-stack-boundary=2 \
- -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -msoft-float
+CFLAGS+= -march=i386 -ffreestanding
+CFLAGS.gcc+= -mpreferred-stack-boundary=2
+CFLAGS+= -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -msoft-float
LDFLAGS+= -nostdlib
.if ${MACHINE_CPUARCH} == "amd64"
Modified: stable/10/sys/boot/i386/boot2/Makefile
==============================================================================
--- stable/10/sys/boot/i386/boot2/Makefile Mon Dec 30 19:05:50 2013 (r260095)
+++ stable/10/sys/boot/i386/boot2/Makefile Mon Dec 30 20:15:46 2013 (r260096)
@@ -23,10 +23,7 @@ BOOT2_UFS?= UFS1_AND_UFS2
#BOOT2_UFS?= UFS1_ONLY
CFLAGS= -Os \
- -fno-guess-branch-probability \
-fomit-frame-pointer \
- -fno-unit-at-a-time \
- -mno-align-long-strings \
-mrtd \
-mregparm=3 \
-DUSE_XREAD \
@@ -43,6 +40,10 @@ CFLAGS= -Os \
-Winline --param max-inline-insns-single=100 \
${CLANG_OPT_SMALL}
+CFLAGS.gcc+= -fno-guess-branch-probability \
+ -fno-unit-at-a-time \
+ -mno-align-long-strings \
+
LDFLAGS=-static -N --gc-sections
# Pick up ../Makefile.inc early.
Modified: stable/10/sys/boot/pc98/Makefile.inc
==============================================================================
--- stable/10/sys/boot/pc98/Makefile.inc Mon Dec 30 19:05:50 2013 (r260095)
+++ stable/10/sys/boot/pc98/Makefile.inc Mon Dec 30 20:15:46 2013 (r260096)
@@ -5,8 +5,9 @@
BINDIR?= /boot
LOADER_ADDRESS?=0x200000
-CFLAGS+= -march=i386 -ffreestanding -mpreferred-stack-boundary=2 \
- -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -msoft-float
+CFLAGS+= -march=i386 -ffreestanding
+CFLAGS.gcc+= -mpreferred-stack-boundary=2
+CFLAGS+= -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -msoft-float
CFLAGS+= -Os -DPC98
LDFLAGS+= -nostdlib
Modified: stable/10/sys/boot/pc98/boot2/Makefile
==============================================================================
--- stable/10/sys/boot/pc98/boot2/Makefile Mon Dec 30 19:05:50 2013 (r260095)
+++ stable/10/sys/boot/pc98/boot2/Makefile Mon Dec 30 20:15:46 2013 (r260096)
@@ -4,6 +4,7 @@
# XXX: clang can compile the boot code just fine, but boot2 gets too big
CC:= gcc
+COMPILER_TYPE:= gcc
FILES= boot boot1 boot2
Modified: stable/10/sys/boot/usb/Makefile
==============================================================================
--- stable/10/sys/boot/usb/Makefile Mon Dec 30 19:05:50 2013 (r260095)
+++ stable/10/sys/boot/usb/Makefile Mon Dec 30 20:15:46 2013 (r260096)
@@ -53,7 +53,7 @@ CFLAGS+= -g
.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"
CFLAGS+= -march=i386
-CFLAGS+= -mpreferred-stack-boundary=2
+CFLAGS.gcc+= -mpreferred-stack-boundary=2
.endif
.if ${MACHINE_CPUARCH} == "amd64"
CFLAGS+= -m32
Modified: stable/10/sys/boot/usb/Makefile.test
==============================================================================
--- stable/10/sys/boot/usb/Makefile.test Mon Dec 30 19:05:50 2013 (r260095)
+++ stable/10/sys/boot/usb/Makefile.test Mon Dec 30 20:15:46 2013 (r260096)
@@ -40,7 +40,7 @@ CFLAGS+= -g
.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"
CFLAGS+= -march=i386
-CFLAGS+= -mpreferred-stack-boundary=2
+CFLAGS.gcc+= -mpreferred-stack-boundary=2
.endif
.if ${MACHINE_CPUARCH} == "amd64"
CFLAGS+= -m32
Modified: stable/10/sys/boot/userboot/ficl/Makefile
==============================================================================
--- stable/10/sys/boot/userboot/ficl/Makefile Mon Dec 30 19:05:50 2013 (r260095)
+++ stable/10/sys/boot/userboot/ficl/Makefile Mon Dec 30 20:15:46 2013 (r260096)
@@ -16,7 +16,7 @@ CFLAGS+= -ffreestanding -fPIC
CFLAGS+= -mno-mmx -mno-3dnow -mno-sse -mno-sse2
.endif
.if ${MACHINE_CPUARCH} == "i386"
-CFLAGS+= -mpreferred-stack-boundary=2
+CFLAGS.gcc+= -mpreferred-stack-boundary=2
CFLAGS+= -mno-sse3
.endif
.if ${MACHINE_CPUARCH} == "powerpc" || ${MACHINE_CPUARCH} == "arm"
Modified: stable/10/sys/boot/userboot/libstand/Makefile
==============================================================================
--- stable/10/sys/boot/userboot/libstand/Makefile Mon Dec 30 19:05:50 2013 (r260095)
+++ stable/10/sys/boot/userboot/libstand/Makefile Mon Dec 30 20:15:46 2013 (r260096)
@@ -28,7 +28,7 @@ CFLAGS+= -I${.CURDIR}/../../../../lib/li
CFLAGS+= -mno-mmx -mno-3dnow -mno-sse -mno-sse2
.endif
.if ${MACHINE_CPUARCH} == "i386"
-CFLAGS+= -mpreferred-stack-boundary=2
+CFLAGS.gcc+= -mpreferred-stack-boundary=2
CFLAGS+= -mno-sse3
.endif
.if ${MACHINE} == "pc98"
Modified: stable/10/sys/boot/zfs/Makefile
==============================================================================
--- stable/10/sys/boot/zfs/Makefile Mon Dec 30 19:05:50 2013 (r260095)
+++ stable/10/sys/boot/zfs/Makefile Mon Dec 30 20:15:46 2013 (r260096)
@@ -13,7 +13,7 @@ CFLAGS+= -I${.CURDIR}/../../cddl/boot/zf
CFLAGS+= -ffreestanding
.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"
CFLAGS+= -march=i386
-CFLAGS+= -mpreferred-stack-boundary=2
+CFLAGS.gcc+= -mpreferred-stack-boundary=2
CFLAGS+= -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -msoft-float
.endif
.if ${MACHINE_CPUARCH} == "powerpc" || ${MACHINE_CPUARCH} == "arm"
Modified: stable/10/sys/conf/Makefile.arm
==============================================================================
--- stable/10/sys/conf/Makefile.arm Mon Dec 30 19:05:50 2013 (r260095)
+++ stable/10/sys/conf/Makefile.arm Mon Dec 30 20:15:46 2013 (r260096)
@@ -39,20 +39,16 @@ SYSTEM_DEP:= ${SYSTEM_DEP:$S/conf/ldscri
STRIP_FLAGS = -S
.endif
-.if ${COMPILER_TYPE} != "clang"
-CFLAGS += -mno-thumb-interwork
-.endif
+CFLAGS.gcc += -mno-thumb-interwork
.if empty(DDB_ENABLED)
-.if defined(WITHOUT_ARM_EABI) && ${COMPILER_TYPE} != "clang"
-CFLAGS += -mno-apcs-frame
+.if defined(WITHOUT_ARM_EABI)
+CFLAGS.gcc += -mno-apcs-frame
.endif
.elif !defined(WITHOUT_ARM_EABI)
CFLAGS += -funwind-tables
-.if ${COMPILER_TYPE} == "clang"
# clang requires us to tell it to emit assembly with unwind information
-CFLAGS += -mllvm -arm-enable-ehabi
-.endif
+CFLAGS.clang += -mllvm -arm-enable-ehabi
.endif
SYSTEM_LD_ = ${LD} -Bdynamic -T ldscript.$M.noheader ${LDFLAGS} \
Modified: stable/10/tools/tools/ath/athstats/Makefile
==============================================================================
--- stable/10/tools/tools/ath/athstats/Makefile Mon Dec 30 19:05:50 2013 (r260095)
+++ stable/10/tools/tools/ath/athstats/Makefile Mon Dec 30 20:15:46 2013 (r260096)
@@ -1,12 +1,16 @@
# $FreeBSD$
+NO_MAN=1
+
+.include <bsd.own.mk>
+
.PATH: ${.CURDIR}/../../../../sys/dev/ath/ath_hal
PROG= athstats
# Because of a clang preprocessor parser limitation causing this
# to not compile, use gcc for now.
-CC= gcc
+#CC= gcc
SRCS= main.c statfoo.c athstats.c opt_ah.h ah_osdep.h
@@ -17,6 +21,8 @@ CLEANFILES+= opt_ah.h
CFLAGS+=-DATH_SUPPORT_ANI
CFLAGS+=-DATH_SUPPORT_TDMA
+CFLAGS.clang+= -fbracket-depth=512
+
opt_ah.h:
echo "#define AH_DEBUG 1" > opt_ah.h
echo "#define AH_DEBUG_COUNTRY 1" >> opt_ah.h
Modified: stable/10/tools/tools/net80211/wlanstats/Makefile
==============================================================================
--- stable/10/tools/tools/net80211/wlanstats/Makefile Mon Dec 30 19:05:50 2013 (r260095)
+++ stable/10/tools/tools/net80211/wlanstats/Makefile Mon Dec 30 20:15:46 2013 (r260096)
@@ -7,8 +7,6 @@ BINDIR= /usr/local/bin
NO_MAN=
SRCS= statfoo.c wlanstats.c main.c
-.if ${COMPILER_TYPE} == "clang"
-CFLAGS+= -fbracket-depth=512
-.endif
+CFLAGS.clang+= -fbracket-depth=512
.include <bsd.prog.mk>
Modified: stable/10/usr.bin/mkcsmapper/Makefile.inc
==============================================================================
--- stable/10/usr.bin/mkcsmapper/Makefile.inc Mon Dec 30 19:05:50 2013 (r260095)
+++ stable/10/usr.bin/mkcsmapper/Makefile.inc Mon Dec 30 20:15:46 2013 (r260096)
@@ -6,6 +6,4 @@ SRCS+= lex.l yacc.y
CFLAGS+= -I${.CURDIR} -I${.CURDIR}/../mkcsmapper \
-I${.CURDIR}/../../lib/libc/iconv \
-I${.CURDIR}/../../lib/libiconv_modules/mapper_std
-.if ${COMPILER_TYPE} == "gcc"
-CFLAGS+= --param max-inline-insns-single=64
-.endif
+CFLAGS.gcc+= --param max-inline-insns-single=64
More information about the svn-src-stable-10
mailing list