Community maintained packages for OpenWrt. Documentation for submitting pull requests is in CONTRIBUTING.md
GNU General Public License v2.0
3.93k
stars
3.44k
forks
source link
nfs-kernel-server: Fails to build with fortify source due to `-Werror=format-nonliteral`; [FIX] workaround is `PKG_FORTIFY_SOURCE:=0`, in 22.03. #19004
Git branch openwrt-22.03 from git://git.openwrt.org/openwrt/openwrt.git,
initially checked out on 2022-07-05,
latest git pull and ./scripts/feeds update -a && ./scripts/feeds update -a on 2022-07-20, ca. 08:15 UTC (I give up on posting latest commit date and hash, since git log gives me some old dates, and I don't know how I can make git log printing out the last operation. I don't know much about git.)
Building on GNU/Linux on x86_64-architecture (Distribution: Artix Linux).
CONFIG_PACKAGE_nfs-kernel-server=m
# Select nfs-kernel-server configuration options
CONFIG_NFS_KERNEL_SERVER_V4=y
# end of Select nfs-kernel-server configuration options
CONFIG_PACKAGE_nfs-kernel-server-utils=m
grep -i fortify .config:
# CONFIG_PKG_FORTIFY_SOURCE_NONE is not set
CONFIG_PKG_FORTIFY_SOURCE_1=y
# CONFIG_PKG_FORTIFY_SOURCE_2 is not set
Description:
After a make clean, a make -j6 fails in above configuration on package/feeds/packages/nfs-kernel-server when fortify source is selected.
An explicit run of make -j1 V=sc package/feeds/packages/nfs-kernel-server/compile
fails with staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-11.2.0_musl_eabi/include/fortify/stdio.h:101:9: error: format not a string literal, argument types not checked [-Werror=format-nonliteral]:
[...]
ccache_cc -DHAVE_CONFIG_H -I. -I../../support/include -I/[...]/openwrt-22.03/staging_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/usr/include/tirpc -I/[...]/openwrt-22.03/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-11.2.0_musl_eabi/usr/include -I/[...]/openwrt-22.03/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-11.2.0_musl_eabi/include/fortify -I/[...]/openwrt-22.03/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-11.2.0_musl_eabi/include -pipe -Wall -Wextra -Wstrict-prototypes -Werror=missing-prototypes -Werror=missing-declarations -Werror=format=2 -Werror=undef -Werror=missing-include-dirs -Werror=strict-aliasing=2 -Werror=init-self -Werror=implicit-function-declaration -Werror=return-type -Werror=switch -Werror=overflow -Werror=parentheses -Werror=aggregate-return -Werror=unused-result -fno-strict-aliasing -Werror=format-overflow=2 -Werror=int-conversion -Werror=incompatible-pointer-types -Werror=misleading-indentation -Wno-cast-function-type -O3 -pipe -g0 -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -mfloat-abi=hard -ffile-prefix-map=/[...]/openwrt-22.03/build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/nfs-utils-2.5.4=nfs-utils-2.5.4 -DPIC -fpic -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -Wno-error=implicit-function-declaration -Wno-error=strict-prototypes -Wno-error=incompatible-pointer-types -Wno-error=format-security -Wno-error=undef -Wno-error=missing-include-dirs -MT client.o -MD -MP -MF .deps/client.Tpo -c -o client.o client.c
In file included from ../../support/include/sockaddr.h:27,
from client.c:22:
../../../../../staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-11.2.0_musl_eabi/include/fortify/stdio.h: In function 'snprintf':
../../../../../staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-11.2.0_musl_eabi/include/fortify/stdio.h:101:9: error: format not a string literal, argument types not checked [-Werror=format-nonliteral]
101 | return __orig_snprintf(__s, __n, __f, __builtin_va_arg_pack());
| ^~~~~~
../../../../../staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-11.2.0_musl_eabi/include/fortify/stdio.h: In function 'sprintf':
../../../../../staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-11.2.0_musl_eabi/include/fortify/stdio.h:110:17: error: format not a string literal, argument types not checked [-Werror=format-nonliteral]
110 | __r = __orig_snprintf(__s, __b, __f, __builtin_va_arg_pack());
| ^~~
../../../../../staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-11.2.0_musl_eabi/include/fortify/stdio.h:114:17: error: format not a string literal, argument types not checked [-Werror=format-nonliteral]
114 | __r = __orig_sprintf(__s, __f, __builtin_va_arg_pack());
| ^~~
cc1: some warnings being treated as errors
make[6]: *** [Makefile:476: client.o] Error 1
make[6]: Leaving directory '/[...]/openwrt-22.03/build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/nfs-utils-2.5.4/support/export'
make[5]: *** [Makefile:409: all] Error 2
make[5]: Leaving directory '/[...]/openwrt-22.03/build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/nfs-utils-2.5.4/support/export'
make[4]: *** [Makefile:435: all-recursive] Error 1
make[4]: Leaving directory '/[...]/openwrt-22.03/build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/nfs-utils-2.5.4/support'
make[3]: *** [Makefile:474: all-recursive] Error 1
make[3]: Leaving directory '/[...]/openwrt-22.03/build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/nfs-utils-2.5.4'
make[2]: *** [Makefile:210: /[...]/openwrt-22.03/build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/nfs-utils-2.5.4/.built] Error 2
make[2]: Leaving directory '/[...]/openwrt-22.03/feeds/packages/net/nfs-kernel-server'
time: package/feeds/packages/nfs-kernel-server/compile#1.22#0.27#10.44
ERROR: package/feeds/packages/nfs-kernel-server failed to build.
[...]
Inspired by issue #18884 I tried to add PKG_FORTIFY_SOURCE:=0 to package/feeds/packages/nfs-kernel-server/Makefile, and having done so nfs-kernel-server builds. Patch.
I think the cleaner solution would be to switch off that the warning triggers an error, but I don't know how to do that specifically for that package.
Maintainer:
@tripolar
Environment:
Building for Xunlog OrangePi Plus (sun8i):
grep ^CONFIG_TARGET .config
:OpenWrt version:
openwrt-22.03
fromgit://git.openwrt.org/openwrt/openwrt.git
,git pull
and./scripts/feeds update -a && ./scripts/feeds update -a
on 2022-07-20, ca. 08:15 UTC(I give up on posting latest commit date and hash, since
git log
gives me some old dates, and I don't know how I can makegit log
printing out the last operation. I don't know much aboutgit
.)Building on GNU/Linux on x86_64-architecture (Distribution: Artix Linux).
OpenWrt configuration:
.config
.grep -i nfs[_-]kernel[_-]server .config
:grep -i fortify .config
:Description:
After a
make clean
, amake -j6
fails in above configuration onpackage/feeds/packages/nfs-kernel-server
when fortify source is selected. An explicit run ofmake -j1 V=sc package/feeds/packages/nfs-kernel-server/compile
fails with
staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-11.2.0_musl_eabi/include/fortify/stdio.h:101:9: error: format not a string literal, argument types not checked [-Werror=format-nonliteral]
:Inspired by issue #18884 I tried to add
PKG_FORTIFY_SOURCE:=0
topackage/feeds/packages/nfs-kernel-server/Makefile
, and having done sonfs-kernel-server
builds. Patch.I think the cleaner solution would be to switch off that the warning triggers an error, but I don't know how to do that specifically for that package.