From cc4a90c445aa04be36c3ef745cbe67fa339b94b5 Mon Sep 17 00:00:00 2001 From: Gleb Smirnoff Date: Tue, 17 Feb 2015 19:27:14 +0000 Subject: Globally enable -fms-extensions when building kernel with gcc, and remove this option from all modules that enable it theirselves. In C mode -fms-extensions option enables anonymous structs and unions, allowing us to use this C11 feature in kernel. Of course, clang supports it without any extra options. Reviewed by: dim --- sys/conf/files | 2 +- sys/conf/kern.mk | 1 - sys/conf/kern.pre.mk | 4 ++-- sys/conf/kmod.mk | 1 + sys/modules/cxgbe/if_cxgbe/Makefile | 1 - sys/modules/drm2/radeonkms/Makefile | 2 +- sys/modules/ibcore/Makefile | 2 +- sys/modules/ipoib/Makefile | 2 +- sys/modules/mlx4/Makefile | 3 +-- sys/modules/mlx4ib/Makefile | 3 +-- sys/modules/mlxen/Makefile | 3 +-- sys/modules/mthca/Makefile | 2 +- sys/ofed/drivers/net/mlx4/Makefile | 2 +- 13 files changed, 12 insertions(+), 16 deletions(-) (limited to 'sys') diff --git a/sys/conf/files b/sys/conf/files index 6c0373eec3db..c08e40c469ba 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -1141,7 +1141,7 @@ dev/cxgb/sys/uipc_mvec.c optional cxgb pci \ dev/cxgb/cxgb_t3fw.c optional cxgb cxgb_t3fw \ compile-with "${NORMAL_C} -I$S/dev/cxgb" dev/cxgbe/t4_mp_ring.c optional cxgbe pci \ - compile-with "${NORMAL_C} -I$S/dev/cxgbe ${GCC_MS_EXTENSIONS}" + compile-with "${NORMAL_C} -I$S/dev/cxgbe" dev/cxgbe/t4_main.c optional cxgbe pci \ compile-with "${NORMAL_C} -I$S/dev/cxgbe" dev/cxgbe/t4_netmap.c optional cxgbe pci \ diff --git a/sys/conf/kern.mk b/sys/conf/kern.mk index 4317de56c65e..340da8c83fa0 100644 --- a/sys/conf/kern.mk +++ b/sys/conf/kern.mk @@ -39,7 +39,6 @@ CLANG_NO_IAS34= -no-integrated-as .endif .if ${COMPILER_TYPE} == "gcc" -GCC_MS_EXTENSIONS= -fms-extensions .if ${COMPILER_VERSION} >= 40300 # Catch-all for all the things that are in our tree, but for which we're # not yet ready for this compiler. Note: we likely only really "support" diff --git a/sys/conf/kern.pre.mk b/sys/conf/kern.pre.mk index 232d88b69e82..ede4ae852cf8 100644 --- a/sys/conf/kern.pre.mk +++ b/sys/conf/kern.pre.mk @@ -97,7 +97,7 @@ CFLAGS_PARAM_LARGE_FUNCTION_GROWTH?=1000 .if ${MACHINE_CPUARCH} == "mips" CFLAGS_ARCH_PARAMS?=--param max-inline-insns-single=1000 .endif -CFLAGS.gcc+= -fno-common -finline-limit=${INLINE_LIMIT} +CFLAGS.gcc+= -fno-common -fms-extensions -finline-limit=${INLINE_LIMIT} CFLAGS.gcc+= --param inline-unit-growth=${CFLAGS_PARAM_INLINE_UNIT_GROWTH} CFLAGS.gcc+= --param large-function-growth=${CFLAGS_PARAM_LARGE_FUNCTION_GROWTH} .if defined(CFLAGS_ARCH_PARAMS) @@ -162,7 +162,7 @@ NORMAL_LINT= ${LINT} ${LINTFLAGS} ${CFLAGS:M-[DIU]*} ${.IMPSRC} # Infiniband C flags. Correct include paths and omit errors that linux # does not honor. OFEDINCLUDES= -I$S/ofed/include/ -OFEDNOERR= -Wno-cast-qual -Wno-pointer-arith ${GCC_MS_EXTENSIONS} +OFEDNOERR= -Wno-cast-qual -Wno-pointer-arith OFEDCFLAGS= ${CFLAGS:N-I*} ${OFEDINCLUDES} ${CFLAGS:M-I*} ${OFEDNOERR} OFED_C_NOIMP= ${CC} -c -o ${.TARGET} ${OFEDCFLAGS} ${WERROR} ${PROF} OFED_C= ${OFED_C_NOIMP} ${.IMPSRC} diff --git a/sys/conf/kmod.mk b/sys/conf/kmod.mk index 8e00aa48e100..91d4f494d3c1 100644 --- a/sys/conf/kmod.mk +++ b/sys/conf/kmod.mk @@ -105,6 +105,7 @@ CFLAGS+= -I. -I${SYSDIR} CFLAGS+= -I${SYSDIR}/contrib/altq CFLAGS.gcc+= -finline-limit=${INLINE_LIMIT} +CFLAGS.gcc+= -fms-extensions CFLAGS.gcc+= --param inline-unit-growth=100 CFLAGS.gcc+= --param large-function-growth=1000 diff --git a/sys/modules/cxgbe/if_cxgbe/Makefile b/sys/modules/cxgbe/if_cxgbe/Makefile index 32347f468b1e..a66e45a045f4 100644 --- a/sys/modules/cxgbe/if_cxgbe/Makefile +++ b/sys/modules/cxgbe/if_cxgbe/Makefile @@ -26,4 +26,3 @@ SRCS+= t4_tracer.c CFLAGS+= -I${CXGBE} .include -CFLAGS+= ${GCC_MS_EXTENSIONS} diff --git a/sys/modules/drm2/radeonkms/Makefile b/sys/modules/drm2/radeonkms/Makefile index 076b8256e936..1e674a748e96 100644 --- a/sys/modules/drm2/radeonkms/Makefile +++ b/sys/modules/drm2/radeonkms/Makefile @@ -106,6 +106,6 @@ SRCS += \ iicbus_if.h \ pci_if.h -CFLAGS += -I${.CURDIR}/../../../dev/drm2/radeon ${GCC_MS_EXTENSIONS} +CFLAGS += -I${.CURDIR}/../../../dev/drm2/radeon .include diff --git a/sys/modules/ibcore/Makefile b/sys/modules/ibcore/Makefile index 6a471d254747..60ec8dd3cace 100644 --- a/sys/modules/ibcore/Makefile +++ b/sys/modules/ibcore/Makefile @@ -18,6 +18,6 @@ CFLAGS+= -DINET6 -DINET .include -CFLAGS+= -Wno-cast-qual -Wno-pointer-arith ${GCC_MS_EXTENSIONS} +CFLAGS+= -Wno-cast-qual -Wno-pointer-arith CWARNFLAGS.cm.c= -Wno-unused-function diff --git a/sys/modules/ipoib/Makefile b/sys/modules/ipoib/Makefile index d634e375899a..ba8c6d35a6ac 100644 --- a/sys/modules/ipoib/Makefile +++ b/sys/modules/ipoib/Makefile @@ -15,4 +15,4 @@ CFLAGS+= -DINET6 -DINET .include -CFLAGS+= -Wno-cast-qual -Wno-pointer-arith ${GCC_MS_EXTENSIONS} +CFLAGS+= -Wno-cast-qual -Wno-pointer-arith diff --git a/sys/modules/mlx4/Makefile b/sys/modules/mlx4/Makefile index d989ff05ae78..cd2b177f13b4 100644 --- a/sys/modules/mlx4/Makefile +++ b/sys/modules/mlx4/Makefile @@ -15,7 +15,6 @@ CFLAGS+= -I${.CURDIR}/../../ofed/include/ .include -CFLAGS+= -Wno-cast-qual -Wno-pointer-arith ${GCC_MS_EXTENSIONS} -CFLAGS+= -fms-extensions +CFLAGS+= -Wno-cast-qual -Wno-pointer-arith CWARNFLAGS.mcg.c= -Wno-unused diff --git a/sys/modules/mlx4ib/Makefile b/sys/modules/mlx4ib/Makefile index 4ab7a4e7f338..7bfcb4a61a5a 100644 --- a/sys/modules/mlx4ib/Makefile +++ b/sys/modules/mlx4ib/Makefile @@ -13,8 +13,7 @@ CFLAGS+= -I${.CURDIR}/../../ofed/drivers/infiniband/hw/mlx4 CFLAGS+= -I${.CURDIR}/../../ofed/include/ CFLAGS+= -DCONFIG_INFINIBAND_USER_MEM CFLAGS+= -DINET6 -DINET -CFLAGS+= -fms-extensions .include -CFLAGS+= -Wno-cast-qual -Wno-pointer-arith ${GCC_MS_EXTENSIONS} +CFLAGS+= -Wno-cast-qual -Wno-pointer-arith diff --git a/sys/modules/mlxen/Makefile b/sys/modules/mlxen/Makefile index 258cf7e7bf98..02f777659fcb 100644 --- a/sys/modules/mlxen/Makefile +++ b/sys/modules/mlxen/Makefile @@ -8,8 +8,7 @@ SRCS += en_rx.c en_tx.c utils.c SRCS += opt_inet.h opt_inet6.h CFLAGS+= -I${.CURDIR}/../../ofed/drivers/net/mlx4 CFLAGS+= -I${.CURDIR}/../../ofed/include/ -CFLAGS+= -fms-extensions .include -CFLAGS+= -Wno-cast-qual -Wno-pointer-arith ${GCC_MS_EXTENSIONS} +CFLAGS+= -Wno-cast-qual -Wno-pointer-arith diff --git a/sys/modules/mthca/Makefile b/sys/modules/mthca/Makefile index 25daedb0e3d3..31fcebd1828e 100644 --- a/sys/modules/mthca/Makefile +++ b/sys/modules/mthca/Makefile @@ -14,4 +14,4 @@ CFLAGS+= -I${.CURDIR}/../../ofed/include .include -CFLAGS+= -Wno-cast-qual -Wno-pointer-arith ${GCC_MS_EXTENSIONS} +CFLAGS+= -Wno-cast-qual -Wno-pointer-arith diff --git a/sys/ofed/drivers/net/mlx4/Makefile b/sys/ofed/drivers/net/mlx4/Makefile index dc0e2a374112..05338e804fa2 100644 --- a/sys/ofed/drivers/net/mlx4/Makefile +++ b/sys/ofed/drivers/net/mlx4/Makefile @@ -30,4 +30,4 @@ opt_inet6.h: .include -CFLAGS+= -Wno-cast-qual -Wno-pointer-arith ${GCC_MS_EXTENSIONS} +CFLAGS+= -Wno-cast-qual -Wno-pointer-arith -- cgit v1.2.3