Remove tests for obsolete compilers in the build system

Assume gcc is at least 6.4, the oldest xtoolchain in the ports tree.
Assume clang is at least 6, which was in 11.2-RELEASE.  Drop conditions
for older compilers.

Reviewed by:	imp (earlier version), emaste, jhb
MFC after:	2 weeks
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D24802
This commit is contained in:
Eric van Gyzen 2020-05-12 15:22:40 +00:00
parent d7452d89ad
commit fac6dee9eb
25 changed files with 32 additions and 156 deletions

View file

@ -32,7 +32,7 @@ CFLAGS+= ${PICFLAG}
CFLAGS+= -fno-builtin CFLAGS+= -fno-builtin
CFLAGS+= -fno-exceptions CFLAGS+= -fno-exceptions
CXXFLAGS+= -fno-rtti CXXFLAGS+= -fno-rtti
.if ${COMPILER_TYPE} == clang && ${COMPILER_VERSION} >= 30700 .if ${COMPILER_TYPE} == clang
CFLAGS+= -fno-sanitize=safe-stack CFLAGS+= -fno-sanitize=safe-stack
.endif .endif
CFLAGS+= -fno-stack-protector CFLAGS+= -fno-stack-protector

View file

@ -29,10 +29,7 @@ CFLAGS+=-Winline
CFLAGS.thr_stack.c+= -Wno-cast-align CFLAGS.thr_stack.c+= -Wno-cast-align
CFLAGS.rtld_malloc.c+= -Wno-cast-align CFLAGS.rtld_malloc.c+= -Wno-cast-align
.include <bsd.compiler.mk>
.if !(${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} < 40300)
CFLAGS.thr_symbols.c+= -Wno-missing-variable-declarations CFLAGS.thr_symbols.c+= -Wno-missing-variable-declarations
.endif
.ifndef NO_THREAD_UNWIND_STACK .ifndef NO_THREAD_UNWIND_STACK
CFLAGS+=-fexceptions CFLAGS+=-fexceptions

View file

@ -108,13 +108,13 @@ COMMON_SRCS+= catrigl.c \
s_nextafterl.c s_nexttoward.c s_remquol.c s_rintl.c s_roundl.c \ s_nextafterl.c s_nexttoward.c s_remquol.c s_rintl.c s_roundl.c \
s_scalbnl.c s_sinl.c s_sincosl.c \ s_scalbnl.c s_sinl.c s_sincosl.c \
s_tanhl.c s_tanl.c s_truncl.c w_cabsl.c s_tanhl.c s_tanl.c s_truncl.c w_cabsl.c
# Work around this warning from gcc 6: # Work around this warning from gcc:
# lib/msun/ld80/e_powl.c:275:1: error: floating constant exceeds range of # lib/msun/ld80/e_powl.c:275:1: error: floating constant exceeds range of
# 'long double' [-Werror=overflow] # 'long double' [-Werror=overflow]
# if( y >= LDBL_MAX ) # if( y >= LDBL_MAX )
# See also: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=130067 # See also: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=130067
.include <bsd.compiler.mk> .include <bsd.compiler.mk>
.if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} >= 60000 .if ${COMPILER_TYPE} == "gcc"
CFLAGS.e_powl.c+= -Wno-error=overflow CFLAGS.e_powl.c+= -Wno-error=overflow
.endif .endif
.endif .endif

View file

@ -90,8 +90,4 @@ ${PROG_FULL}: ${VERSION_MAP}
# GCC warns about redeclarations even though they have __exported # GCC warns about redeclarations even though they have __exported
# and are therefore not identical to the ones from the system headers. # and are therefore not identical to the ones from the system headers.
CFLAGS+= -Wno-redundant-decls CFLAGS+= -Wno-redundant-decls
.if ${COMPILER_VERSION} < 40300
# Silence -Wshadow false positives in ancient GCC
CFLAGS+= -Wno-shadow
.endif
.endif .endif

View file

@ -2,11 +2,8 @@
.include <bsd.own.mk> .include <bsd.own.mk>
# Skip on GCC 4.2, because it lacks __COUNTER__
.if ${COMPILER_TYPE} != "gcc" || ${COMPILER_VERSION} >= 40300
ATF_TESTS_C= functional ATF_TESTS_C= functional
TEST_METADATA.functional+= timeout=15 TEST_METADATA.functional+= timeout=15
.endif
LIBADD= util LIBADD= util
WARNS?= 6 WARNS?= 6

View file

@ -205,20 +205,12 @@ ${X_}COMPILER_FREEBSD_VERSION= unknown
${X_}COMPILER_RESOURCE_DIR!= ${${cc}:N${CCACHE_BIN}} -print-resource-dir 2>/dev/null || echo unknown ${X_}COMPILER_RESOURCE_DIR!= ${${cc}:N${CCACHE_BIN}} -print-resource-dir 2>/dev/null || echo unknown
.endif .endif
${X_}COMPILER_FEATURES= ${X_}COMPILER_FEATURES= c++11 c++14
.if (${${X_}COMPILER_TYPE} == "clang" && ${${X_}COMPILER_VERSION} >= 30300) || \ .if ${${X_}COMPILER_TYPE} == "clang" || \
(${${X_}COMPILER_TYPE} == "gcc" && ${${X_}COMPILER_VERSION} >= 40800)
${X_}COMPILER_FEATURES+= c++11
.endif
.if (${${X_}COMPILER_TYPE} == "clang" && ${${X_}COMPILER_VERSION} >= 30400) || \
(${${X_}COMPILER_TYPE} == "gcc" && ${${X_}COMPILER_VERSION} >= 50000)
${X_}COMPILER_FEATURES+= c++14
.endif
.if (${${X_}COMPILER_TYPE} == "clang" && ${${X_}COMPILER_VERSION} >= 50000) || \
(${${X_}COMPILER_TYPE} == "gcc" && ${${X_}COMPILER_VERSION} >= 70000) (${${X_}COMPILER_TYPE} == "gcc" && ${${X_}COMPILER_VERSION} >= 70000)
${X_}COMPILER_FEATURES+= c++17 ${X_}COMPILER_FEATURES+= c++17
.endif .endif
.if ${${X_}COMPILER_TYPE} == "clang" && ${${X_}COMPILER_VERSION} >= 60000 .if ${${X_}COMPILER_TYPE} == "clang"
${X_}COMPILER_FEATURES+= retpoline ${X_}COMPILER_FEATURES+= retpoline
.endif .endif

View file

@ -6,8 +6,7 @@
# Enable various levels of compiler warning checks. These may be # Enable various levels of compiler warning checks. These may be
# overridden (e.g. if using a non-gcc compiler) by defining MK_WARNS=no. # overridden (e.g. if using a non-gcc compiler) by defining MK_WARNS=no.
# for 4.2.1 GCC: http://gcc.gnu.org/onlinedocs/gcc-4.2.1/gcc/Warning-Options.html # for GCC: https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
# for current GCC: https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
# for clang: https://clang.llvm.org/docs/DiagnosticsReference.html # for clang: https://clang.llvm.org/docs/DiagnosticsReference.html
.include <bsd.compiler.mk> .include <bsd.compiler.mk>
@ -29,15 +28,6 @@ CFLAGS+= -std=${CSTD}
CXXFLAGS+= -std=${CXXSTD} CXXFLAGS+= -std=${CXXSTD}
.endif .endif
#
# Turn off -Werror for gcc 4.2.1. The compiler is on the glide path out of the
# system, and any warnings specific to it are no longer relevant as there are
# too many false positives.
#
.if ${COMPILER_VERSION} < 50000
NO_WERROR.gcc= yes
.endif
# -pedantic is problematic because it also imposes namespace restrictions # -pedantic is problematic because it also imposes namespace restrictions
#CFLAGS+= -pedantic #CFLAGS+= -pedantic
.if defined(WARNS) .if defined(WARNS)
@ -81,19 +71,13 @@ CWARNFLAGS+= -Wno-pointer-sign
# is set to low values, these have to be disabled explicitly. # is set to low values, these have to be disabled explicitly.
.if ${WARNS} <= 6 .if ${WARNS} <= 6
CWARNFLAGS.clang+= -Wno-empty-body -Wno-string-plus-int CWARNFLAGS.clang+= -Wno-empty-body -Wno-string-plus-int
.if ${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} >= 30400
CWARNFLAGS.clang+= -Wno-unused-const-variable CWARNFLAGS.clang+= -Wno-unused-const-variable
.endif
.endif # WARNS <= 6 .endif # WARNS <= 6
.if ${WARNS} <= 3 .if ${WARNS} <= 3
CWARNFLAGS.clang+= -Wno-tautological-compare -Wno-unused-value\ CWARNFLAGS.clang+= -Wno-tautological-compare -Wno-unused-value\
-Wno-parentheses-equality -Wno-unused-function -Wno-enum-conversion -Wno-parentheses-equality -Wno-unused-function -Wno-enum-conversion
.if ${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} >= 30600
CWARNFLAGS.clang+= -Wno-unused-local-typedef CWARNFLAGS.clang+= -Wno-unused-local-typedef
.endif
.if ${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} >= 40000
CWARNFLAGS.clang+= -Wno-address-of-packed-member CWARNFLAGS.clang+= -Wno-address-of-packed-member
.endif
.if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} >= 90100 .if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} >= 90100
CWARNFLAGS.gcc+= -Wno-address-of-packed-member CWARNFLAGS.gcc+= -Wno-address-of-packed-member
.endif .endif
@ -113,7 +97,7 @@ CWARNFLAGS.clang+= -Wno-array-bounds
.endif # NO_WARRAY_BOUNDS .endif # NO_WARRAY_BOUNDS
.if defined(NO_WMISLEADING_INDENTATION) && \ .if defined(NO_WMISLEADING_INDENTATION) && \
((${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} >= 100000) || \ ((${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} >= 100000) || \
(${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} >= 60100)) ${COMPILER_TYPE} == "gcc")
CWARNFLAGS+= -Wno-misleading-indentation CWARNFLAGS+= -Wno-misleading-indentation
.endif # NO_WMISLEADING_INDENTATION .endif # NO_WMISLEADING_INDENTATION
.endif # WARNS .endif # WARNS
@ -137,8 +121,10 @@ CWARNFLAGS+= -Werror
CWARNFLAGS+= -Wno-format CWARNFLAGS+= -Wno-format
.endif # NO_WFORMAT || NO_WFORMAT.${COMPILER_TYPE} .endif # NO_WFORMAT || NO_WFORMAT.${COMPILER_TYPE}
# GCC 5.2.0 # GCC
.if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} >= 50200 # We should clean up warnings produced with these flags.
# They were originally added as a quick hack to enable gcc5/6.
.if ${COMPILER_TYPE} == "gcc"
CWARNFLAGS+= -Wno-error=address \ CWARNFLAGS+= -Wno-error=address \
-Wno-error=array-bounds \ -Wno-error=array-bounds \
-Wno-error=attributes \ -Wno-error=attributes \
@ -150,23 +136,18 @@ CWARNFLAGS+= -Wno-error=address \
-Wno-error=extra \ -Wno-error=extra \
-Wno-error=inline \ -Wno-error=inline \
-Wno-error=logical-not-parentheses \ -Wno-error=logical-not-parentheses \
-Wno-error=nonnull-compare \
-Wno-error=shift-negative-value \
-Wno-error=strict-aliasing \ -Wno-error=strict-aliasing \
-Wno-error=tautological-compare \
-Wno-error=uninitialized \ -Wno-error=uninitialized \
-Wno-error=unused-but-set-variable \ -Wno-error=unused-but-set-variable \
-Wno-error=unused-const-variable \
-Wno-error=unused-function \ -Wno-error=unused-function \
-Wno-error=unused-value -Wno-error=unused-value
.endif
# GCC 6.1.0
.if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} >= 60100
CWARNFLAGS+= -Wno-error=nonnull-compare \
-Wno-error=shift-negative-value \
-Wno-error=tautological-compare \
-Wno-error=unused-const-variable
.endif
# GCC 7.1.0 # GCC 7.1.0
.if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} >= 70100 .if ${COMPILER_VERSION} >= 70100
CWARNFLAGS+= -Wno-error=bool-operation \ CWARNFLAGS+= -Wno-error=bool-operation \
-Wno-error=deprecated \ -Wno-error=deprecated \
-Wno-error=expansion-to-defined \ -Wno-error=expansion-to-defined \
@ -182,7 +163,7 @@ CWARNFLAGS+= -Wno-error=bool-operation \
.endif .endif
# GCC 8.1.0 # GCC 8.1.0
.if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} >= 80100 .if ${COMPILER_VERSION} >= 80100
CWARNFLAGS+= -Wno-error=aggressive-loop-optimizations \ CWARNFLAGS+= -Wno-error=aggressive-loop-optimizations \
-Wno-error=cast-function-type \ -Wno-error=cast-function-type \
-Wno-error=catch-value \ -Wno-error=catch-value \
@ -191,9 +172,10 @@ CWARNFLAGS+= -Wno-error=aggressive-loop-optimizations \
-Wno-error=sizeof-pointer-memaccess \ -Wno-error=sizeof-pointer-memaccess \
-Wno-error=stringop-truncation -Wno-error=stringop-truncation
.endif .endif
.endif # gcc
# How to handle FreeBSD custom printf format specifiers. # How to handle FreeBSD custom printf format specifiers.
.if ${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} >= 30600 .if ${COMPILER_TYPE} == "clang"
FORMAT_EXTENSIONS= -D__printf__=__freebsd_kprintf__ FORMAT_EXTENSIONS= -D__printf__=__freebsd_kprintf__
.else .else
FORMAT_EXTENSIONS= -fformat-extensions FORMAT_EXTENSIONS= -fformat-extensions
@ -223,11 +205,7 @@ CFLAGS+=-nobuiltininc -idirafter ${COMPILER_RESOURCE_DIR}/include
CLANG_OPT_SMALL= -mstack-alignment=8 -mllvm -inline-threshold=3\ CLANG_OPT_SMALL= -mstack-alignment=8 -mllvm -inline-threshold=3\
-mllvm -simplifycfg-dup-ret -mllvm -simplifycfg-dup-ret
.if ${COMPILER_VERSION} >= 30500 && ${COMPILER_VERSION} < 30700
CLANG_OPT_SMALL+= -mllvm -enable-gvn=false
.else
CLANG_OPT_SMALL+= -mllvm -enable-load-pre=false CLANG_OPT_SMALL+= -mllvm -enable-load-pre=false
.endif
CFLAGS.clang+= -Qunused-arguments CFLAGS.clang+= -Qunused-arguments
# The libc++ headers use c++11 extensions. These are normally silenced because # The libc++ headers use c++11 extensions. These are normally silenced because
# they are treated as system headers, but we explicitly disable that warning # they are treated as system headers, but we explicitly disable that warning
@ -238,14 +216,8 @@ CXXFLAGS.clang+= -Wno-c++11-extensions
.if ${MK_SSP} != "no" && \ .if ${MK_SSP} != "no" && \
${MACHINE_CPUARCH} != "arm" && ${MACHINE_CPUARCH} != "mips" ${MACHINE_CPUARCH} != "arm" && ${MACHINE_CPUARCH} != "mips"
.if (${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} >= 30500) || \
(${COMPILER_TYPE} == "gcc" && \
(${COMPILER_VERSION} == 40201 || ${COMPILER_VERSION} >= 40900))
# Don't use -Wstack-protector as it breaks world with -Werror. # Don't use -Wstack-protector as it breaks world with -Werror.
SSP_CFLAGS?= -fstack-protector-strong SSP_CFLAGS?= -fstack-protector-strong
.else
SSP_CFLAGS?= -fstack-protector
.endif
CFLAGS+= ${SSP_CFLAGS} CFLAGS+= ${SSP_CFLAGS}
.endif # SSP && !ARM && !MIPS .endif # SSP && !ARM && !MIPS

View file

@ -24,7 +24,7 @@ UBLDR_LOADADDR?= 0x1000000
# Architecture-specific loader code # Architecture-specific loader code
SRCS= start.S conf.c self_reloc.c vers.c SRCS= start.S conf.c self_reloc.c vers.c
.if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} > 40201 .if ${COMPILER_TYPE} == "gcc"
CWARNFLAGS.self_reloc.c+= -Wno-error=maybe-uninitialized CWARNFLAGS.self_reloc.c+= -Wno-error=maybe-uninitialized
.endif .endif

View file

@ -143,11 +143,7 @@ CFLAGS+= -fPIC -mno-red-zone
# Do not generate movt/movw, because the relocation fixup for them does not # Do not generate movt/movw, because the relocation fixup for them does not
# translate to the -Bsymbolic -pie format required by self_reloc() in loader(8). # translate to the -Bsymbolic -pie format required by self_reloc() in loader(8).
# Also, the fpu is not available in a standalone environment. # Also, the fpu is not available in a standalone environment.
.if ${COMPILER_VERSION} < 30800
CFLAGS.clang+= -mllvm -arm-use-movt=0
.else
CFLAGS.clang+= -mno-movt CFLAGS.clang+= -mno-movt
.endif
CFLAGS.clang+= -mfpu=none CFLAGS.clang+= -mfpu=none
CFLAGS+= -fPIC CFLAGS+= -fPIC
.endif .endif

View file

@ -4,16 +4,10 @@ NO_OBJ=t
.include <bsd.init.mk> .include <bsd.init.mk>
# In-tree GCC does not support __attribute__((ms_abi)), but gcc newer
# than 4.5 supports it.
.if ${COMPILER_TYPE} != "gcc" || ${COMPILER_VERSION} >= 40500
SUBDIR.${MK_FDT}+= fdt SUBDIR.${MK_FDT}+= fdt
SUBDIR.yes+= libefi boot1 gptboot SUBDIR.yes+= libefi boot1 gptboot
SUBDIR.${MK_FORTH}+= loader_4th SUBDIR.${MK_FORTH}+= loader_4th
SUBDIR.${MK_LOADER_LUA}+= loader_lua SUBDIR.${MK_LOADER_LUA}+= loader_lua
SUBDIR.yes+= loader_simp SUBDIR.yes+= loader_simp
.endif # ${COMPILER_TYPE} != "gcc" || ${COMPILER_VERSION} >= 40500
.include <bsd.subdir.mk> .include <bsd.subdir.mk>

View file

@ -42,10 +42,6 @@ CFLAGS.zfs_module.c+= -I${SYSDIR}/cddl/contrib/opensolaris/common/lz4
CFLAGS+= -DEFI_ZFS_BOOT CFLAGS+= -DEFI_ZFS_BOOT
.endif .endif
.if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} > 40201
CWARNFLAGS.self_reloc.c+= -Wno-error=maybe-uninitialized
.endif
CFLAGS+= -I${EFIINC} CFLAGS+= -I${EFIINC}
CFLAGS+= -I${EFIINCMD} CFLAGS+= -I${EFIINCMD}
CFLAGS+= -I${SYSDIR}/contrib/dev/acpica/include CFLAGS+= -I${SYSDIR}/contrib/dev/acpica/include

View file

@ -31,10 +31,6 @@ CFLAGS+= -DEFI_ZFS_BOOT
HAVE_ZFS= yes HAVE_ZFS= yes
.endif .endif
.if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} > 40201
CWARNFLAGS.self_reloc.c+= -Wno-error=maybe-uninitialized
.endif
# We implement a slightly non-standard %S in that it always takes a # We implement a slightly non-standard %S in that it always takes a
# CHAR16 that's common in UEFI-land instead of a wchar_t. This only # CHAR16 that's common in UEFI-land instead of a wchar_t. This only
# seems to matter on arm64 where wchar_t defaults to an int instead # seems to matter on arm64 where wchar_t defaults to an int instead

View file

@ -37,9 +37,6 @@ CFLAGS+=-fomit-frame-pointer \
CFLAGS.gcc+= -Os \ CFLAGS.gcc+= -Os \
-fno-asynchronous-unwind-tables \ -fno-asynchronous-unwind-tables \
--param max-inline-insns-single=100 --param max-inline-insns-single=100
.if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} <= 40201
CFLAGS.gcc+= -mno-align-long-strings
.endif
CFLAGS.clang+= -Oz ${CLANG_OPT_SMALL} CFLAGS.clang+= -Oz ${CLANG_OPT_SMALL}

View file

@ -32,9 +32,6 @@ CFLAGS+=-DBOOTPROG=\"isoboot\" \
-Winline -Wno-pointer-sign -Winline -Wno-pointer-sign
CFLAGS.gcc+= --param max-inline-insns-single=100 CFLAGS.gcc+= --param max-inline-insns-single=100
.if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} <= 40201
CFLAGS.gcc+= -Wno-uninitialized
.endif
CFLAGS.clang+= -Oz ${CLANG_OPT_SMALL} CFLAGS.clang+= -Oz ${CLANG_OPT_SMALL}
LD_FLAGS+=${LD_FLAGS_BIN} LD_FLAGS+=${LD_FLAGS_BIN}

View file

@ -46,11 +46,7 @@ SRCS+= subr_boot.c
# Do not generate movt/movw, because the relocation fixup for them does not # Do not generate movt/movw, because the relocation fixup for them does not
# translate to the -Bsymbolic -pie format required by self_reloc() in loader(8). # translate to the -Bsymbolic -pie format required by self_reloc() in loader(8).
# Also, the fpu is not available in a standalone environment. # Also, the fpu is not available in a standalone environment.
.if ${COMPILER_VERSION} < 30800
CFLAGS.clang+= -mllvm -arm-use-movt=0
.else
CFLAGS.clang+= -mno-movt CFLAGS.clang+= -mno-movt
.endif
CFLAGS.clang+= -mfpu=none CFLAGS.clang+= -mfpu=none
.PATH: ${SRCTOP}/contrib/llvm-project/compiler-rt/lib/builtins/arm/ .PATH: ${SRCTOP}/contrib/llvm-project/compiler-rt/lib/builtins/arm/

View file

@ -44,10 +44,6 @@ CFLAGS.clang += -mfpu=none
.if !empty(DDB_ENABLED) .if !empty(DDB_ENABLED)
CFLAGS += -funwind-tables CFLAGS += -funwind-tables
.if ${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} < 30500
# clang < 3.5.0 requires us to tell it to emit assembly with unwind information
CFLAGS += -mllvm -arm-enable-ehabi
.endif
.endif .endif
# "makeoptions KERNVIRTADDR=" is now optional, supply the default value. # "makeoptions KERNVIRTADDR=" is now optional, supply the default value.

View file

@ -51,7 +51,7 @@ DPAAWARNFLAGS += \
-Wno-error=incompatible-pointer-types-discards-qualifiers \ -Wno-error=incompatible-pointer-types-discards-qualifiers \
-Wno-error=non-literal-null-conversion \ -Wno-error=non-literal-null-conversion \
-Wno-error=enum-conversion -Wno-error=enum-conversion
.elif "${COMPILER_TYPE}" == "gcc" && ${COMPILER_VERSION} >= 50200 .elif "${COMPILER_TYPE}" == "gcc"
DPAAWARNFLAGS += \ DPAAWARNFLAGS += \
-Wno-error=redundant-decls \ -Wno-error=redundant-decls \
-Wno-error=int-in-bool-context -Wno-error=int-in-bool-context

View file

@ -31,19 +31,14 @@ NO_WTAUTOLOGICAL_POINTER_COMPARE= -Wno-tautological-pointer-compare
CWARNEXTRA?= -Wno-error-tautological-compare -Wno-error-empty-body \ CWARNEXTRA?= -Wno-error-tautological-compare -Wno-error-empty-body \
-Wno-error-parentheses-equality -Wno-error-unused-function \ -Wno-error-parentheses-equality -Wno-error-unused-function \
-Wno-error-pointer-sign -Wno-error-pointer-sign
.if ${COMPILER_VERSION} >= 30700
CWARNEXTRA+= -Wno-error-shift-negative-value CWARNEXTRA+= -Wno-error-shift-negative-value
.endif
.if ${COMPILER_VERSION} >= 40000
CWARNEXTRA+= -Wno-address-of-packed-member CWARNEXTRA+= -Wno-address-of-packed-member
.endif
.if ${COMPILER_VERSION} >= 100000 .if ${COMPILER_VERSION} >= 100000
NO_WMISLEADING_INDENTATION= -Wno-misleading-indentation NO_WMISLEADING_INDENTATION= -Wno-misleading-indentation
.endif .endif
.endif .endif # clang
.if ${COMPILER_TYPE} == "gcc" .if ${COMPILER_TYPE} == "gcc"
.if ${COMPILER_VERSION} >= 40800
# Catch-all for all the things that are in our tree, but for which we're # Catch-all for all the things that are in our tree, but for which we're
# not yet ready for this compiler. # not yet ready for this compiler.
NO_WUNUSED_BUT_SET_VARIABLE = -Wno-unused-but-set-variable NO_WUNUSED_BUT_SET_VARIABLE = -Wno-unused-but-set-variable
@ -55,15 +50,13 @@ CWARNEXTRA?= -Wno-error=address \
-Wno-error=enum-compare \ -Wno-error=enum-compare \
-Wno-error=inline \ -Wno-error=inline \
-Wno-error=maybe-uninitialized \ -Wno-error=maybe-uninitialized \
-Wno-error=misleading-indentation \
-Wno-error=nonnull-compare \
-Wno-error=overflow \ -Wno-error=overflow \
-Wno-error=sequence-point \ -Wno-error=sequence-point \
-Wno-unused-but-set-variable
.if ${COMPILER_VERSION} >= 60100
CWARNEXTRA+= -Wno-error=misleading-indentation \
-Wno-error=nonnull-compare \
-Wno-error=shift-overflow \ -Wno-error=shift-overflow \
-Wno-error=tautological-compare -Wno-error=tautological-compare \
.endif -Wno-unused-but-set-variable
.if ${COMPILER_VERSION} >= 70100 .if ${COMPILER_VERSION} >= 70100
CWARNEXTRA+= -Wno-error=stringop-overflow CWARNEXTRA+= -Wno-error=stringop-overflow
.endif .endif
@ -76,15 +69,7 @@ CWARNEXTRA+= -Wno-error=packed-not-aligned
.if ${COMPILER_VERSION} >= 90100 .if ${COMPILER_VERSION} >= 90100
CWARNEXTRA+= -Wno-address-of-packed-member CWARNEXTRA+= -Wno-address-of-packed-member
.endif .endif
.else .endif # gcc
# For gcc 4.2, eliminate the too-often-wrong warnings about uninitialized vars.
CWARNEXTRA?= -Wno-uninitialized
# GCC 4.2 doesn't have -Wno-error=cast-qual, so just disable the warning for
# the few files that are already known to generate cast-qual warnings.
NO_WCAST_QUAL= -Wno-cast-qual
NO_WNONNULL= -Wno-nonnull
.endif
.endif
# This warning is utter nonsense # This warning is utter nonsense
CWARNFLAGS+= -Wno-format-zero-length CWARNFLAGS+= -Wno-format-zero-length
@ -93,7 +78,7 @@ CWARNFLAGS+= -Wno-format-zero-length
# to be disabled. WARNING: format checking is disabled in this case. # to be disabled. WARNING: format checking is disabled in this case.
.if ${MK_FORMAT_EXTENSIONS} == "no" .if ${MK_FORMAT_EXTENSIONS} == "no"
FORMAT_EXTENSIONS= -Wno-format FORMAT_EXTENSIONS= -Wno-format
.elif ${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} >= 30600 .elif ${COMPILER_TYPE} == "clang"
FORMAT_EXTENSIONS= -D__printf__=__freebsd_kprintf__ FORMAT_EXTENSIONS= -D__printf__=__freebsd_kprintf__
.else .else
FORMAT_EXTENSIONS= -fformat-extensions FORMAT_EXTENSIONS= -fformat-extensions
@ -201,12 +186,7 @@ CFLAGS.gcc+= -mno-spe
# DDB happy. ELFv2, if available, has some other efficiency benefits. # DDB happy. ELFv2, if available, has some other efficiency benefits.
# #
.if ${MACHINE_ARCH} == "powerpc64" .if ${MACHINE_ARCH} == "powerpc64"
.if ${COMPILER_VERSION} >= 40900 CFLAGS+= -mabi=elfv2
CFLAGS.gcc+= -mabi=elfv2
.else
CFLAGS.gcc+= -mcall-aixdesc
.endif
CFLAGS.clang+= -mabi=elfv2
.endif .endif
# #

View file

@ -345,10 +345,7 @@ ${__obj}: ${OBJS_DEPEND_GUESS.${__obj}}
.depend: .PRECIOUS ${SRCS} .depend: .PRECIOUS ${SRCS}
.if ${COMPILER_TYPE} == "clang" || \
(${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} >= 60000)
_MAP_DEBUG_PREFIX= yes _MAP_DEBUG_PREFIX= yes
.endif
_ILINKS= machine _ILINKS= machine
.if ${MACHINE} != ${MACHINE_CPUARCH} && ${MACHINE} != "arm64" .if ${MACHINE} != ${MACHINE_CPUARCH} && ${MACHINE} != "arm64"

View file

@ -93,11 +93,7 @@ CFLAGS.gcc+= -fms-extensions
.if defined(CFLAGS_ARCH_PARAMS) .if defined(CFLAGS_ARCH_PARAMS)
CFLAGS.gcc+=${CFLAGS_ARCH_PARAMS} CFLAGS.gcc+=${CFLAGS_ARCH_PARAMS}
.endif .endif
.if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} < 50000
WERROR?= -Wno-error
.else
WERROR?= -Werror WERROR?= -Werror
.endif
# The following should be removed no earlier than LLVM11 being imported into the # The following should be removed no earlier than LLVM11 being imported into the
# tree, to ensure we don't regress the build. LLVM11 and GCC10 will switch the # tree, to ensure we don't regress the build. LLVM11 and GCC10 will switch the
# default over to -fno-common, making this redundant. # default over to -fno-common, making this redundant.

View file

@ -88,11 +88,7 @@ __KLD_SHARED=no
.if !empty(CFLAGS:M-O[23s]) && empty(CFLAGS:M-fno-strict-aliasing) .if !empty(CFLAGS:M-O[23s]) && empty(CFLAGS:M-fno-strict-aliasing)
CFLAGS+= -fno-strict-aliasing CFLAGS+= -fno-strict-aliasing
.endif .endif
.if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} < 50000
WERROR?= -Wno-error
.else
WERROR?= -Werror WERROR?= -Werror
.endif
LINUXKPI_GENSRCS+= \ LINUXKPI_GENSRCS+= \
bus_if.h \ bus_if.h \
@ -160,11 +156,7 @@ CFLAGS+= -fPIC
# Temporary workaround for PR 196407, which contains the fascinating details. # Temporary workaround for PR 196407, which contains the fascinating details.
# Don't allow clang to use fpu instructions or registers in kernel modules. # Don't allow clang to use fpu instructions or registers in kernel modules.
.if ${MACHINE_CPUARCH} == arm .if ${MACHINE_CPUARCH} == arm
.if ${COMPILER_VERSION} < 30800
CFLAGS.clang+= -mllvm -arm-use-movt=0
.else
CFLAGS.clang+= -mno-movt CFLAGS.clang+= -mno-movt
.endif
CFLAGS.clang+= -mfpu=none CFLAGS.clang+= -mfpu=none
CFLAGS+= -funwind-tables CFLAGS+= -funwind-tables
.endif .endif
@ -283,10 +275,7 @@ ${FULLPROG}: ${OBJS}
${OBJCOPY} --strip-debug ${.TARGET} ${OBJCOPY} --strip-debug ${.TARGET}
.endif .endif
.if ${COMPILER_TYPE} == "clang" || \
(${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} >= 60000)
_MAP_DEBUG_PREFIX= yes _MAP_DEBUG_PREFIX= yes
.endif
_ILINKS=machine _ILINKS=machine
.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" .if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"

View file

@ -620,10 +620,8 @@ _aac= aac
_aacraid= aacraid _aacraid= aacraid
_acpi= acpi _acpi= acpi
.if ${MK_CRYPT} != "no" || defined(ALL_MODULES) .if ${MK_CRYPT} != "no" || defined(ALL_MODULES)
.if ${COMPILER_TYPE} != "gcc" || ${COMPILER_VERSION} > 40201
_aesni= aesni _aesni= aesni
.endif .endif
.endif
_amd_ecc_inject=amd_ecc_inject _amd_ecc_inject=amd_ecc_inject
_amdsbwd= amdsbwd _amdsbwd= amdsbwd
_amdsmn= amdsmn _amdsmn= amdsmn

View file

@ -87,6 +87,6 @@ LIBADD= pthread
# integer to pointer, which is a GNU extension. # integer to pointer, which is a GNU extension.
# #
# Turn off the warning, because this is in contributed code. # Turn off the warning, because this is in contributed code.
.if ${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} >= 60000 .if ${COMPILER_TYPE} == "clang"
CWARNFLAGS+= -Wno-null-pointer-arithmetic CWARNFLAGS+= -Wno-null-pointer-arithmetic
.endif .endif

View file

@ -8,18 +8,12 @@ MAN= trpt.8
BINGRP= kmem BINGRP= kmem
BINMODE= 2555 BINMODE= 2555
.if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} < 50000
WARNS?= 4
.endif
.if ${MK_INET6_SUPPORT} != "no" .if ${MK_INET6_SUPPORT} != "no"
CFLAGS+= -DINET6 CFLAGS+= -DINET6
.endif .endif
.include <bsd.prog.mk> .include <bsd.prog.mk>
.if ${COMPILER_TYPE} != "gcc" || ${COMPILER_VERSION} >= 50000
# Several included system headers tickle this warning in ways that are # Several included system headers tickle this warning in ways that are
# difficult to work around in this program. # difficult to work around in this program.
CFLAGS+= -Wno-missing-variable-declarations CFLAGS+= -Wno-missing-variable-declarations
.endif

View file

@ -15,7 +15,7 @@ CFLAGS+= -I${.CURDIR:H} -I${SRCTOP}/contrib/tzcode/stdtime
WARNS?= 2 WARNS?= 2
.if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} >= 50300 .if ${COMPILER_TYPE} == "gcc"
CWARNFLAGS+= -Wno-error=strict-overflow CWARNFLAGS+= -Wno-error=strict-overflow
.endif .endif