build: provide a default WARNS for all in-tree builds
The current default is provided in various Makefile.inc in some top-level directories and covers a good portion of the tree, but doesn't cover parts of the build a little deeper (e.g. libcasper). Provide a default in src.sys.mk and set WARNS to it in bsd.sys.mk if that variable is defined. This lets us relatively cleanly provide a default WARNS no matter where you're building in the src tree without breaking things outside of the tree. Crunchgen has been updated as a bootstrap tool to work on this change because it needs r365605 at a minimum to succeed. The cleanup necessary to successfully walk over this change on WITHOUT_CLEAN builds has been added. There is a supplemental project to this to list all of the warnings that are encountered when the environment has WARNS=6 NO_WERROR=yes: https://warns.kevans.dev -- this project will hopefully eventually go away in favor of CI doing a much better job than it. Reviewed by: emaste, brooks, ngie (all earlier version) Reviewed by: emaste, arichardson (depend-cleanup.sh change) Differential Revision: https://reviews.freebsd.org/D26455
This commit is contained in:
parent
f948cb3c88
commit
10826e2c75
@ -2226,12 +2226,9 @@ _crunchide= usr.sbin/crunch/crunchide
|
||||
_bootstrap_tools_links+=crunchide
|
||||
.endif
|
||||
|
||||
# r285986 crunchen: use STRIPBIN rather than STRIP
|
||||
# 1100113: Support MK_AUTO_OBJ
|
||||
# 1200006: META_MODE fixes
|
||||
.if ${BOOTSTRAPPING} < 1100078 || \
|
||||
(${MK_AUTO_OBJ} == "yes" && ${BOOTSTRAPPING} < 1100114) || \
|
||||
(${MK_META_MODE} == "yes" && ${BOOTSTRAPPING} < 1200006)
|
||||
# 1300115: Higher WARNS fixes
|
||||
.if ${BOOTSTRAPPING} < 1202502 || \
|
||||
(${BOOTSTRAPPING} > 1300000 && ${BOOTSTRAPPING} < 1300115)
|
||||
_crunchgen= usr.sbin/crunch/crunchgen
|
||||
.else
|
||||
_bootstrap_tools_links+=crunchgen
|
||||
|
@ -4,7 +4,6 @@
|
||||
.include <src.opts.mk>
|
||||
|
||||
BINDIR?= /bin
|
||||
WARNS?= 6
|
||||
|
||||
.if ${MK_DYNAMICROOT} == "no"
|
||||
NO_SHARED?= YES
|
||||
|
@ -6,6 +6,8 @@ SHLIB_MAJOR= 5
|
||||
REGEXDIR= ${SRCTOP}/contrib/libgnuregex
|
||||
.PATH: ${REGEXDIR}
|
||||
|
||||
WARNS?= 1
|
||||
|
||||
SRCS= gnuregex.c
|
||||
INCSGROUPS= INCS WRINCS PXINCS
|
||||
INCS= regex.h.patched
|
||||
|
@ -18,6 +18,8 @@ CFLAGS+=-I${SRCTOP}/contrib/diff/lib
|
||||
CFLAGS+=-DHAVE_CONFIG_H
|
||||
CFLAGS+=-DDEFAULT_DIFF_PROGRAM=\"/usr/bin/diff\"
|
||||
|
||||
WARNS?= 0
|
||||
|
||||
.for f in diff3.c
|
||||
${f}: ${DIFFSRC}/${f} ${.CURDIR}/${f}.diff
|
||||
patch -s -o ${.TARGET} < ${.CURDIR}/${f}.diff ${DIFFSRC}/${f}
|
||||
|
@ -2,6 +2,8 @@
|
||||
|
||||
.include <src.opts.mk>
|
||||
|
||||
WARNS?= 0
|
||||
|
||||
VERSION= "6.1.1 [FreeBSD]"
|
||||
VENDOR= marcel
|
||||
|
||||
|
@ -14,6 +14,8 @@ SRCS= closeout.c dfa.c error.c exclude.c grep.c grepmat.c hard-locale.c \
|
||||
xstrtoumax.c
|
||||
CLEANFILES+= gnugrep.1
|
||||
|
||||
WARNS?= 0
|
||||
|
||||
CFLAGS+=-I${.CURDIR} -I${SYSROOT:U${DESTDIR}}/usr/include/gnu -DHAVE_CONFIG_H
|
||||
|
||||
.if ${MK_BSD_GREP} != "yes"
|
||||
|
@ -1,5 +1,3 @@
|
||||
# $FreeBSD$
|
||||
# Default version for system libs (override in <lib>/Makefile if necessary)
|
||||
SHLIB_MAJOR?= 5
|
||||
|
||||
WARNS?= 6
|
||||
|
@ -9,3 +9,5 @@ DEBUG_FILES_CFLAGS= -gline-tables-only
|
||||
.else
|
||||
DEBUG_FILES_CFLAGS= -g1
|
||||
.endif
|
||||
|
||||
WARNS?= 0
|
||||
|
@ -3,6 +3,8 @@
|
||||
|
||||
PACKAGE= tests
|
||||
|
||||
WARNS?= 3
|
||||
|
||||
_LIBARCHIVEDIR= ${SRCTOP}/contrib/libarchive
|
||||
|
||||
ATF_TESTS_SH+= functional_test
|
||||
|
@ -3,6 +3,7 @@
|
||||
.include <bsd.own.mk>
|
||||
|
||||
BINDIR?= ${TESTSDIR}
|
||||
WARNS?= 3
|
||||
|
||||
# SKIP_LEFTASSOC -> these testcases fail on FreeBSD.
|
||||
IMPLEMENTATION?= -DREGEX_SPENCER -DSKIP_LEFTASSOC
|
||||
|
@ -11,6 +11,4 @@ CFLAGS+=-DWITH_CASPER
|
||||
.endif
|
||||
LIBADD+= nv
|
||||
|
||||
WARNS?= 3
|
||||
|
||||
.include <bsd.test.mk>
|
||||
|
@ -11,6 +11,4 @@ CFLAGS+=-DWITH_CASPER
|
||||
.endif
|
||||
LIBADD+= nv
|
||||
|
||||
WARNS?= 3
|
||||
|
||||
.include <bsd.test.mk>
|
||||
|
@ -11,6 +11,4 @@ CFLAGS+=-DWITH_CASPER
|
||||
.endif
|
||||
LIBADD+= nv
|
||||
|
||||
WARNS?= 3
|
||||
|
||||
.include <bsd.test.mk>
|
||||
|
@ -11,8 +11,6 @@ CFLAGS+=-DWITH_CASPER
|
||||
.endif
|
||||
LIBADD+= nv
|
||||
|
||||
WARNS?= 3
|
||||
|
||||
TEST_METADATA.sysctl_test+= required_user="root"
|
||||
|
||||
.include <bsd.test.mk>
|
||||
|
@ -2,6 +2,8 @@
|
||||
|
||||
PACKAGE= tests
|
||||
|
||||
WARNS?= 3
|
||||
|
||||
TESTSRC= ${SRCTOP}/contrib/netbsd-tests/lib/libpthread
|
||||
|
||||
# TODO: t_name (missing pthread_getname_np support in FreeBSD)
|
||||
|
@ -2,6 +2,8 @@
|
||||
|
||||
TESTSRC= ${SRCTOP}/contrib/netbsd-tests/lib/libpthread/dlopen
|
||||
|
||||
WARNS?= 2
|
||||
|
||||
.include <bsd.own.mk>
|
||||
|
||||
TESTSDIR= ${TESTSBASE}/lib/libthr/dlopen
|
||||
|
@ -1,6 +1,7 @@
|
||||
# $FreeBSD$
|
||||
|
||||
TESTSRC= ${SRCTOP}/contrib/netbsd-tests/lib/libpthread/dlopen/dso
|
||||
WARNS?= 3
|
||||
|
||||
SHLIB= h_pthread_dlopen
|
||||
SHLIB_MAJOR= 1
|
||||
|
@ -4,6 +4,8 @@
|
||||
|
||||
PACKAGE= tests
|
||||
|
||||
WARNS?= 1
|
||||
|
||||
LIBXOSRC= ${SRCTOP}/contrib/libxo
|
||||
|
||||
# Override the default suffix transformation rules for .c/.o -> .out
|
||||
|
@ -1 +1,3 @@
|
||||
# $FreeBSD$
|
||||
|
||||
WARNS?= 0
|
||||
|
@ -23,6 +23,8 @@ INTERNALLIB= # Don't install this library
|
||||
SRCS= exec.c getusershell.c login_class.c popen.c rcmdsh.c \
|
||||
sysctl.c system.c
|
||||
|
||||
WARNS?= 3
|
||||
|
||||
CFLAGS+= -DRESCUE
|
||||
# Flags copied from src/lib/libc and src/lib/libutil
|
||||
# libc/db/Makefile.inc
|
||||
|
@ -4,7 +4,6 @@
|
||||
.include <src.opts.mk>
|
||||
|
||||
BINDIR?= /sbin
|
||||
WARNS?= 6
|
||||
|
||||
.if ${MK_DYNAMICROOT} == "no"
|
||||
NO_SHARED?= YES
|
||||
|
@ -18,3 +18,5 @@ CFLAGS+= -DB_ENDIAN
|
||||
CFLAGS+= -DNDEBUG
|
||||
|
||||
.PATH: ${LCRYPTO_SRC}/engines
|
||||
|
||||
WARNS?= 0
|
||||
|
@ -28,6 +28,14 @@ CFLAGS+= -std=${CSTD}
|
||||
CXXFLAGS+= -std=${CXXSTD}
|
||||
.endif
|
||||
|
||||
# This gives the Makefile we're evaluating at the top-level a chance to set
|
||||
# WARNS. If it doesn't do so, we may freely pull a DEFAULTWARNS if it's set
|
||||
# and use that. This allows us to default WARNS to 6 for src builds without
|
||||
# needing to set the default in various Makefile.inc.
|
||||
.if !defined(WARNS) && defined(DEFAULTWARNS)
|
||||
WARNS= ${DEFAULTWARNS}
|
||||
.endif
|
||||
|
||||
# -pedantic is problematic because it also imposes namespace restrictions
|
||||
#CFLAGS+= -pedantic
|
||||
.if defined(WARNS)
|
||||
|
@ -40,6 +40,8 @@ __postrcconf_${var}:= ${MK_${var}:U-}${WITHOUT_${var}:Uno:Dyes}${WITH_${var}:Uno
|
||||
CFCOMMONFLAG?= -fno-common
|
||||
CFLAGS+= ${CFCOMMONFLAG}
|
||||
|
||||
DEFAULTWARNS= 6
|
||||
|
||||
# tempting, but bsd.compiler.mk causes problems this early
|
||||
# probably need to remove dependence on bsd.own.mk
|
||||
#.include "src.opts.mk"
|
||||
|
@ -7,6 +7,8 @@ MAN=
|
||||
BINDIR= ${TESTSBASE}/sys/cddl/zfs/bin
|
||||
SCRIPTSDIR= ${TESTSBASE}/sys/cddl/zfs/bin
|
||||
|
||||
WARNS?= 0
|
||||
|
||||
SCRIPTS+= bsddisks.ksh
|
||||
SCRIPTS+= dircmp.ksh
|
||||
SCRIPTS+= dumpadm.ksh
|
||||
|
3
tests/sys/cddl/zfs/tests/Makefile.inc
Normal file
3
tests/sys/cddl/zfs/tests/Makefile.inc
Normal file
@ -0,0 +1,3 @@
|
||||
# $FreeBSD$
|
||||
|
||||
WARNS?= 0
|
@ -4,6 +4,8 @@
|
||||
|
||||
PACKAGE= tests
|
||||
|
||||
WARNS?= 3
|
||||
|
||||
TESTSDIR= ${TESTSBASE}/sys/geom/class/${.CURDIR:T}
|
||||
|
||||
ATF_TESTS_C= pbkdf2_test
|
||||
|
@ -1,6 +1,7 @@
|
||||
# $FreeBSD$
|
||||
|
||||
PACKAGE= tests
|
||||
WARNS?= 1
|
||||
|
||||
TESTSDIR= ${TESTSBASE}/sys/net/routing
|
||||
|
||||
|
@ -49,3 +49,10 @@ if [ -e "$OBJTOP"/cddl/lib/libzfs/.depend.libzfs_changelist.o ] && \
|
||||
echo "Removing old ZFS tree"
|
||||
rm -rf "$OBJTOP"/cddl "$OBJTOP"/obj-lib32/cddl
|
||||
fi
|
||||
|
||||
# 20200916 WARNS bumped, need bootstrapped crunchgen stubs
|
||||
if [ -e "$OBJTOP"/rescue/rescue/rescue.c ] && \
|
||||
! grep -q 'crunched_stub_t' "$OBJTOP"/rescue/rescue/rescue.c; then
|
||||
echo "Removing old rescue(8) tree"
|
||||
rm -rf "$OBJTOP"/rescue/rescue
|
||||
fi
|
||||
|
@ -2,5 +2,3 @@
|
||||
# $FreeBSD$
|
||||
|
||||
BINDIR?= /usr/bin
|
||||
|
||||
WARNS?= 6
|
||||
|
@ -10,3 +10,4 @@ CFLAGS+= -DHAVE_CONFIG_H=1
|
||||
CFLAGS+= -I${_spath} -I${_spath}/src
|
||||
LIBADD+= osmcomp ibmad ibumad
|
||||
|
||||
WARNS?= 0
|
||||
|
@ -7,3 +7,4 @@ BINDIR?= /usr/bin
|
||||
CFLAGS+= -I${_spath}
|
||||
LIBADD+= ibverbs mlx4 mlx5 cxgb4 pthread
|
||||
|
||||
WARNS?= 2
|
||||
|
@ -6,3 +6,5 @@ _spath=${SRCTOP}/contrib/ofed/librdmacm
|
||||
BINDIR?= /usr/bin
|
||||
CFLAGS+= -I${SRCTOP}/contrib/ofed
|
||||
LIBADD+= ibverbs rdmacm mlx4 mlx5 cxgb4 pthread
|
||||
|
||||
WARNS?= 0
|
||||
|
@ -2,6 +2,8 @@
|
||||
|
||||
PACKAGE= tests
|
||||
|
||||
WARNS?= 3
|
||||
|
||||
_LIBARCHIVEDIR= ${SRCTOP}/contrib/libarchive
|
||||
|
||||
ATF_TESTS_SH+= functional_test
|
||||
|
@ -2,5 +2,3 @@
|
||||
# $FreeBSD$
|
||||
|
||||
BINDIR?= /usr/sbin
|
||||
|
||||
WARNS?= 6
|
||||
|
@ -2,6 +2,8 @@
|
||||
|
||||
BINDIR?= /usr/sbin
|
||||
|
||||
WARNS?= 0
|
||||
|
||||
WPA_DISTDIR?= ${SRCTOP}/contrib/wpa/
|
||||
WPA_SUPPLICANT_DISTDIR?=${WPA_DISTDIR}/wpa_supplicant
|
||||
HOSTAPD_DISTDIR?= ${WPA_DISTDIR}/hostapd
|
||||
|
Loading…
Reference in New Issue
Block a user