git: 58b9432c405b - stable/13 - zfs: Fix build with GCC 12.
Date: Wed, 03 May 2023 00:30:04 UTC
The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=58b9432c405b6542cf33e1b57ff87365180b4da7 commit 58b9432c405b6542cf33e1b57ff87365180b4da7 Author: John Baldwin <jhb@FreeBSD.org> AuthorDate: 2022-12-21 18:49:23 +0000 Commit: John Baldwin <jhb@FreeBSD.org> CommitDate: 2023-05-03 00:25:48 +0000 zfs: Fix build with GCC 12. Silence -Winfinite-recursion for ldo.c in lua and -Wstringop-overread for nvpair.c. Reviewed by: mm Differential Revision: https://reviews.freebsd.org/D37631 (cherry picked from commit 2e08e4b75ea1080c224a33baf62199d893dc322d) --- sys/conf/files | 4 ++-- sys/conf/kern.mk | 2 ++ sys/modules/zfs/Makefile | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/sys/conf/files b/sys/conf/files index 5546925bccd8..7c90279a261f 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -177,7 +177,7 @@ contrib/openzfs/module/lua/lcompat.c optional zfs compile-with "${ZFS_C}" contrib/openzfs/module/lua/lcorolib.c optional zfs compile-with "${ZFS_C}" contrib/openzfs/module/lua/lctype.c optional zfs compile-with "${ZFS_C}" contrib/openzfs/module/lua/ldebug.c optional zfs compile-with "${ZFS_C}" -contrib/openzfs/module/lua/ldo.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/lua/ldo.c optional zfs compile-with "${ZFS_C} ${NO_WINFINTE_RECURSION}" contrib/openzfs/module/lua/lfunc.c optional zfs compile-with "${ZFS_C}" contrib/openzfs/module/lua/lgc.c optional zfs compile-with "${ZFS_C}" contrib/openzfs/module/lua/llex.c optional zfs compile-with "${ZFS_C}" @@ -196,7 +196,7 @@ contrib/openzfs/module/lua/lzio.c optional zfs compile-with "${ZFS_C}" # zfs nvpair support contrib/openzfs/module/nvpair/fnvpair.c optional zfs compile-with "${ZFS_C}" -contrib/openzfs/module/nvpair/nvpair.c optional zfs compile-with "${ZFS_RPC_C}" +contrib/openzfs/module/nvpair/nvpair.c optional zfs compile-with "${ZFS_RPC_C} ${NO_WSTRINGOP_OVERREAD}" contrib/openzfs/module/nvpair/nvpair_alloc_fixed.c optional zfs compile-with "${ZFS_C}" contrib/openzfs/module/nvpair/nvpair_alloc_spl.c optional zfs compile-with "${ZFS_C}" diff --git a/sys/conf/kern.mk b/sys/conf/kern.mk index d37d80793929..47f4b5c48243 100644 --- a/sys/conf/kern.mk +++ b/sys/conf/kern.mk @@ -94,6 +94,8 @@ CWARNEXTRA+= -Wno-address-of-packed-member \ CWARNEXTRA+= -Wno-error=nonnull \ -Wno-dangling-pointer \ -Wno-zero-length-bounds +NO_WINFINTE_RECURSION= -Wno-infinite-recursion +NO_WSTRINGOP_OVERREAD= -Wno-stringop-overread .endif .endif diff --git a/sys/modules/zfs/Makefile b/sys/modules/zfs/Makefile index 6321db2381d8..9259a5f7e182 100644 --- a/sys/modules/zfs/Makefile +++ b/sys/modules/zfs/Makefile @@ -292,10 +292,11 @@ CFLAGS.gcc+= -Wno-pointer-to-int-cast CFLAGS.lapi.c= -Wno-cast-qual CFLAGS.lcompat.c= -Wno-cast-qual +CFLAGS.ldo.c= ${NO_WINFINTE_RECURSION} CFLAGS.lobject.c= -Wno-cast-qual CFLAGS.ltable.c= -Wno-cast-qual CFLAGS.lvm.c= -Wno-cast-qual -CFLAGS.nvpair.c= -Wno-cast-qual -DHAVE_RPC_TYPES +CFLAGS.nvpair.c= -Wno-cast-qual -DHAVE_RPC_TYPES ${NO_WSTRINGOP_OVERREAD} CFLAGS.spl_string.c= -Wno-cast-qual CFLAGS.spl_vm.c= -Wno-cast-qual CFLAGS.spl_zlib.c= -Wno-cast-qual