From: jca Date: Fri, 30 Dec 2022 06:44:35 +0000 (+0000) Subject: Neuter zlib fatal warnings when building kernels and bootloaders with clang 15 X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=0d5d409d7a44f666524a908315193a724530b826;p=openbsd Neuter zlib fatal warnings when building kernels and bootloaders with clang 15 Disable -Wdeprecated-non-prototype instead of patching zlib. Upstream plans to drop the pre-ANSI syntax soon. ok tb@ millert@ --- diff --git a/sys/arch/amd64/conf/Makefile.amd64 b/sys/arch/amd64/conf/Makefile.amd64 index d2704424f34..9e82ed33e91 100644 --- a/sys/arch/amd64/conf/Makefile.amd64 +++ b/sys/arch/amd64/conf/Makefile.amd64 @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile.amd64,v 1.127 2022/04/07 07:30:54 jsg Exp $ +# $OpenBSD: Makefile.amd64,v 1.128 2022/12/30 06:44:35 jca Exp $ # For instructions on building kernels consult the config(8) and options(4) # manual pages. @@ -72,6 +72,9 @@ CMACHFLAGS+= -mno-retpoline NO_INTEGR_AS= -no-integrated-as CWARNFLAGS+= -Wno-address-of-packed-member -Wno-constant-conversion \ -Wno-unused-but-set-variable -Wno-gnu-folding-constant +# XXX Workaround for zlib + clang 15 +# https://github.com/madler/zlib/issues/633 +CWARNFLAGS+= -Wno-deprecated-non-prototype -Wno-unknown-warning-option .endif DEBUG?= -g diff --git a/sys/arch/amd64/stand/Makefile.inc b/sys/arch/amd64/stand/Makefile.inc index 7e45fedcc49..e022e19942b 100644 --- a/sys/arch/amd64/stand/Makefile.inc +++ b/sys/arch/amd64/stand/Makefile.inc @@ -1,6 +1,9 @@ -# $OpenBSD: Makefile.inc,v 1.18 2017/07/25 13:32:14 robert Exp $ +# $OpenBSD: Makefile.inc,v 1.19 2022/12/30 06:44:35 jca Exp $ CFLAGS=${DEBUG} ${COPTS} -Oz -Wall -Werror +# XXX Workaround for zlib + clang 15 +# https://github.com/madler/zlib/issues/633 +CFLAGS+= -Wno-deprecated-non-prototype -Wno-unknown-warning-option CFLAGS+= -ffreestanding -fno-stack-protector -DMDRANDOM CPPFLAGS+=-I${S} -I${SADIR}/libsa -I. -I${.CURDIR} SACFLAGS=-D_STANDALONE diff --git a/sys/arch/arm64/conf/Makefile.arm64 b/sys/arch/arm64/conf/Makefile.arm64 index 47227b8d425..2970cebfc4e 100644 --- a/sys/arch/arm64/conf/Makefile.arm64 +++ b/sys/arch/arm64/conf/Makefile.arm64 @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile.arm64,v 1.42 2022/01/14 06:53:16 jsg Exp $ +# $OpenBSD: Makefile.arm64,v 1.43 2022/12/30 06:44:35 jca Exp $ # For instructions on building kernels consult the config(8) and options(4) # manual pages. @@ -51,6 +51,9 @@ CWARNFLAGS= -Werror -Wall -Wimplicit-function-declaration \ -Wno-constant-conversion -Wno-address-of-packed-member \ -Wno-unused-but-set-variable -Wno-gnu-folding-constant \ -Wframe-larger-than=2047 +# XXX Workaround for zlib + clang 15 +# https://github.com/madler/zlib/issues/633 +CWARNFLAGS+= -Wno-deprecated-non-prototype -Wno-unknown-warning-option CMACHFLAGS= -march=armv8-a+nofp+nosimd \ -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer \ diff --git a/sys/arch/arm64/stand/efiboot/Makefile b/sys/arch/arm64/stand/efiboot/Makefile index 6cbb987af65..9c41afa2a51 100644 --- a/sys/arch/arm64/stand/efiboot/Makefile +++ b/sys/arch/arm64/stand/efiboot/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.17 2022/12/07 23:04:26 patrick Exp $ +# $OpenBSD: Makefile,v 1.18 2022/12/30 06:44:35 jca Exp $ NOMAN= # @@ -53,6 +53,9 @@ COPTS+= -Wno-attributes -Wno-format COPTS+= -ffreestanding -fno-stack-protector COPTS+= -fshort-wchar -fPIC -fno-builtin COPTS+= -Wall -Werror +# XXX Workaround for zlib + clang 15 +# https://github.com/madler/zlib/issues/633 +COPTS+= -Wno-deprecated-non-prototype -Wno-unknown-warning-option PROG.elf= ${PROG:S/.EFI/.elf/} CLEANFILES+= ${PROG.elf} ${PROG.elf}.tmp diff --git a/sys/arch/armv7/conf/Makefile.armv7 b/sys/arch/armv7/conf/Makefile.armv7 index d8fc7710cd6..78944a7d74d 100644 --- a/sys/arch/armv7/conf/Makefile.armv7 +++ b/sys/arch/armv7/conf/Makefile.armv7 @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile.armv7,v 1.52 2021/12/17 14:59:22 patrick Exp $ +# $OpenBSD: Makefile.armv7,v 1.53 2022/12/30 06:44:35 jca Exp $ # For instructions on building kernels consult the config(8) and options(4) # manual pages. @@ -28,6 +28,9 @@ CWARNFLAGS= -Werror -Wall -Wimplicit-function-declaration \ -Wno-constant-conversion -Wno-address-of-packed-member \ -Wno-unused-but-set-variable -Wno-gnu-folding-constant \ -Wframe-larger-than=2047 +# XXX Workaround for zlib + clang 15 +# https://github.com/madler/zlib/issues/633 +CWARNFLAGS+= -Wno-deprecated-non-prototype -Wno-unknown-warning-option CMACHFLAGS= -msoft-float -march=armv7a CMACHFLAGS+= -ffreestanding ${NOPIE_FLAGS} diff --git a/sys/arch/armv7/stand/efiboot/Makefile b/sys/arch/armv7/stand/efiboot/Makefile index d6ffc41bf38..0fe490f04a7 100644 --- a/sys/arch/armv7/stand/efiboot/Makefile +++ b/sys/arch/armv7/stand/efiboot/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.17 2021/11/14 21:51:48 guenther Exp $ +# $OpenBSD: Makefile,v 1.18 2022/12/30 06:44:35 jca Exp $ NOMAN= # @@ -51,6 +51,9 @@ COPTS+= -ffreestanding -fno-stack-protector COPTS+= -fshort-wchar -fPIC -fno-builtin COPTS+= -Wall -Werror COPTS+= -mfloat-abi=soft +# XXX Workaround for zlib + clang 15 +# https://github.com/madler/zlib/issues/633 +COPTS+= -Wno-deprecated-non-prototype -Wno-unknown-warning-option PROG.elf= ${PROG:S/.EFI/.elf/} CLEANFILES+= ${PROG.elf} ${PROG.elf}.tmp diff --git a/sys/arch/i386/conf/Makefile.i386 b/sys/arch/i386/conf/Makefile.i386 index 4dbf184eff0..77b2bb5540e 100644 --- a/sys/arch/i386/conf/Makefile.i386 +++ b/sys/arch/i386/conf/Makefile.i386 @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile.i386,v 1.142 2021/12/17 14:59:22 patrick Exp $ +# $OpenBSD: Makefile.i386,v 1.143 2022/12/30 06:44:36 jca Exp $ # For instructions on building kernels consult the config(8) and options(4) # manual pages. @@ -46,6 +46,9 @@ CMACHFLAGS+= -mretpoline NO_INTEGR_AS= -no-integrated-as CWARNFLAGS+= -Wno-address-of-packed-member -Wno-constant-conversion \ -Wno-unused-but-set-variable -Wno-gnu-folding-constant +# XXX Workaround for zlib + clang 15 +# https://github.com/madler/zlib/issues/633 +CWARNFLAGS+= -Wno-deprecated-non-prototype -Wno-unknown-warning-option .endif DEBUG?= -g diff --git a/sys/arch/i386/stand/Makefile.inc b/sys/arch/i386/stand/Makefile.inc index cd14f5b8954..3c58a9c1a3e 100644 --- a/sys/arch/i386/stand/Makefile.inc +++ b/sys/arch/i386/stand/Makefile.inc @@ -1,7 +1,10 @@ -# $OpenBSD: Makefile.inc,v 1.51 2017/07/25 13:32:14 robert Exp $ +# $OpenBSD: Makefile.inc,v 1.52 2022/12/30 06:44:35 jca Exp $ CFLAGS=${DEBUG} ${COPTS} -Oz -Wall -Werror CFLAGS+= -ffreestanding -fno-stack-protector -DMDRANDOM +# XXX Workaround for zlib + clang 15 +# https://github.com/madler/zlib/issues/633 +CFLAGS+= -Wno-deprecated-non-prototype -Wno-unknown-warning-option CPPFLAGS+=-I${S} -I${SADIR}/libsa -I. -I${.CURDIR} SACFLAGS=-D_STANDALONE DEBUGFLAGS= diff --git a/sys/arch/loongson/conf/Makefile.loongson b/sys/arch/loongson/conf/Makefile.loongson index c34f616551f..043476631f0 100644 --- a/sys/arch/loongson/conf/Makefile.loongson +++ b/sys/arch/loongson/conf/Makefile.loongson @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile.loongson,v 1.82 2021/12/17 14:59:22 patrick Exp $ +# $OpenBSD: Makefile.loongson,v 1.83 2022/12/30 06:44:36 jca Exp $ # For instructions on building kernels consult the config(8) and options(4) # manual pages. @@ -51,6 +51,9 @@ NO_INTEGR_AS= -no-integrated-as CMACHFLAGS+= -fomit-frame-pointer CWARNFLAGS+= -Wno-address-of-packed-member -Wno-constant-conversion \ -Wno-unused-but-set-variable -Wno-gnu-folding-constant +# XXX Workaround for zlib + clang 15 +# https://github.com/madler/zlib/issues/633 +CWARNFLAGS+= -Wno-deprecated-non-prototype -Wno-unknown-warning-option .endif DEBUG?= -g diff --git a/sys/arch/macppc/conf/Makefile.macppc b/sys/arch/macppc/conf/Makefile.macppc index bd233e2fdac..597f4a9963b 100644 --- a/sys/arch/macppc/conf/Makefile.macppc +++ b/sys/arch/macppc/conf/Makefile.macppc @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile.macppc,v 1.104 2021/12/17 14:59:22 patrick Exp $ +# $OpenBSD: Makefile.macppc,v 1.105 2022/12/30 06:44:36 jca Exp $ # For instructions on building kernels consult the config(8) and options(4) # manual pages. @@ -46,6 +46,9 @@ COPTIMIZE?= -Oz NO_INTEGR_AS= -no-integrated-as CWARNFLAGS+= -Wno-address-of-packed-member -Wno-constant-conversion \ -Wno-unused-but-set-variable -Wno-gnu-folding-constant +# XXX Workaround for zlib + clang 15 +# https://github.com/madler/zlib/issues/633 +CWARNFLAGS+= -Wno-deprecated-non-prototype -Wno-unknown-warning-option .endif DEBUG?= -g diff --git a/sys/arch/octeon/conf/Makefile.octeon b/sys/arch/octeon/conf/Makefile.octeon index 2af14224682..e43afc0b67e 100644 --- a/sys/arch/octeon/conf/Makefile.octeon +++ b/sys/arch/octeon/conf/Makefile.octeon @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile.octeon,v 1.61 2022/07/18 12:48:35 visa Exp $ +# $OpenBSD: Makefile.octeon,v 1.62 2022/12/30 06:44:36 jca Exp $ # For instructions on building kernels consult the config(8) and options(4) # manual pages. @@ -49,6 +49,9 @@ NO_INTEGR_AS= -no-integrated-as CMACHFLAGS+= -fomit-frame-pointer CWARNFLAGS+= -Wno-address-of-packed-member -Wno-constant-conversion \ -Wno-unused-but-set-variable -Wno-gnu-folding-constant +# XXX Workaround for zlib + clang 15 +# https://github.com/madler/zlib/issues/633 +CWARNFLAGS+= -Wno-deprecated-non-prototype -Wno-unknown-warning-option .endif DEBUG?= -g diff --git a/sys/arch/powerpc64/conf/Makefile.powerpc64 b/sys/arch/powerpc64/conf/Makefile.powerpc64 index 8e1d768b591..79bac67fa4c 100644 --- a/sys/arch/powerpc64/conf/Makefile.powerpc64 +++ b/sys/arch/powerpc64/conf/Makefile.powerpc64 @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile.powerpc64,v 1.13 2022/01/14 06:53:17 jsg Exp $ +# $OpenBSD: Makefile.powerpc64,v 1.14 2022/12/30 06:44:36 jca Exp $ # For instructions on building kernels consult the config(8) and options(4) # manual pages. @@ -51,6 +51,9 @@ CWARNFLAGS= -Werror -Wall -Wimplicit-function-declaration \ -Wno-constant-conversion -Wno-address-of-packed-member \ -Wno-unused-but-set-variable -Wno-gnu-folding-constant \ -Wframe-larger-than=2047 +# XXX Workaround for zlib + clang 15 +# https://github.com/madler/zlib/issues/633 +CWARNFLAGS+= -Wno-deprecated-non-prototype -Wno-unknown-warning-option CMACHFLAGS= -mabi=elfv2 -msoft-float -mno-altivec -mno-vsx CMACHFLAGS+= -ffreestanding diff --git a/sys/arch/riscv64/conf/Makefile.riscv64 b/sys/arch/riscv64/conf/Makefile.riscv64 index 3f3336d0559..5534eefb72f 100644 --- a/sys/arch/riscv64/conf/Makefile.riscv64 +++ b/sys/arch/riscv64/conf/Makefile.riscv64 @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile.riscv64,v 1.15 2022/01/12 00:58:48 kevlo Exp $ +# $OpenBSD: Makefile.riscv64,v 1.16 2022/12/30 06:44:36 jca Exp $ # For instructions on building kernels consult the config(8) and options(4) # manual pages. @@ -30,6 +30,9 @@ CWARNFLAGS= -Werror -Wall -Wimplicit-function-declaration \ -Wno-constant-conversion -Wno-address-of-packed-member \ -Wno-unused-but-set-variable -Wno-gnu-folding-constant \ -Wframe-larger-than=2047 +# XXX Workaround for zlib + clang 15 +# https://github.com/madler/zlib/issues/633 +CWARNFLAGS+= -Wno-deprecated-non-prototype -Wno-unknown-warning-option CMACHFLAGS= -march=rv64gc -mcmodel=medany -mno-relax \ -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer diff --git a/sys/arch/riscv64/stand/efiboot/Makefile b/sys/arch/riscv64/stand/efiboot/Makefile index a9906d58a01..85b3f9c2db8 100644 --- a/sys/arch/riscv64/stand/efiboot/Makefile +++ b/sys/arch/riscv64/stand/efiboot/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.2 2021/11/14 21:51:48 guenther Exp $ +# $OpenBSD: Makefile,v 1.3 2022/12/30 06:44:35 jca Exp $ NOMAN= # @@ -54,6 +54,9 @@ COPTS+= -Wno-attributes -Wno-format COPTS+= -ffreestanding -fno-stack-protector COPTS+= -fshort-wchar -fPIC -fno-builtin COPTS+= -Wall -Werror +# XXX Workaround for zlib + clang 15 +# https://github.com/madler/zlib/issues/633 +COPTS+= -Wno-deprecated-non-prototype -Wno-unknown-warning-option PROG.elf= ${PROG:S/.EFI/.elf/} CLEANFILES+= ${PROG.elf} ${PROG.elf}.tmp diff --git a/sys/arch/sparc64/conf/Makefile.sparc64 b/sys/arch/sparc64/conf/Makefile.sparc64 index 90913acf125..ade1835350f 100644 --- a/sys/arch/sparc64/conf/Makefile.sparc64 +++ b/sys/arch/sparc64/conf/Makefile.sparc64 @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile.sparc64,v 1.104 2021/12/17 14:59:22 patrick Exp $ +# $OpenBSD: Makefile.sparc64,v 1.105 2022/12/30 06:44:36 jca Exp $ # For instructions on building kernels consult the config(8) and options(4) # manual pages. @@ -47,6 +47,9 @@ COPTIMIZE?= -Oz CWARNFLAGS+= -Wno-unused-command-line-argument CWARNFLAGS+= -Wno-address-of-packed-member -Wno-constant-conversion \ -Wno-unused-but-set-variable -Wno-gnu-folding-constant +# XXX Workaround for zlib + clang 15 +# https://github.com/madler/zlib/issues/633 +CWARNFLAGS+= -Wno-deprecated-non-prototype -Wno-unknown-warning-option .endif DEBUG?= -g