Open alexrp opened 1 year ago
This is due to the switch to clang 15 for Zig 0.10.0, since support for old-style (K&R) function declarations is being removed: https://discourse.llvm.org/t/rfc-enabling-wstrict-prototypes-by-default-in-c/60521
You can manually disable it with -Wno-deprecated-non-prototype
, otherwise it will have to be fixed upstream in musl.
Got the same thing using zig as CC for a golang crossbuild:
CGO_ENABLED=1 GOOS=linux GOARCH=arm64 CC="zig cc -target aarch64-linux" CXX="zig c++ -target aarch64-linux" /opt/homebrew/bin/go build -tags ,crossbuild -trimpath -ldflags '-s -w -X sylr.dev/fix/cmd.Version=c3ca56c-dirty -extldflags ""' -o dist/fix-c3ca56c-dirty-linux-arm64
# sylr.dev/fix
In file included from /opt/homebrew/Cellar/zig/0.10.0/lib/zig/libc/musl/crt/rcrt1.c:3:
/opt/homebrew/Cellar/zig/0.10.0/lib/zig/libc/musl/crt/../ldso/dlstart.c:146:20: warning: a function declaration without a prototype is deprecated in all versions of C and is treated as a zero-parameter prototype in C2x, conflicting with a subsequent definition [-Wdeprecated-non-prototype]
GETFUNCSYM(&dls2, __dls2, base+dyn[DT_PLTGOT]);
^
/opt/homebrew/Cellar/zig/0.10.0/lib/zig/libc/musl/crt/rcrt1.c:11:13: note: conflicting prototype is here
hidden void __dls2(unsigned char *base, size_t *sp)
^
1 warning generated.
Reproducing steps:
mkdir -p ~/git && (cd ~/git && git clone https://github.com/sylr/fix)
cd git/fix
make crossbuild
Would this issue get fixed by upgrading to musl 1.2.5 ?
Would this issue get fixed by upgrading to musl 1.2.5 ?
Doesn't seem to be the case. This will need an upstream patch.
That said, it's not actually obvious to me what the patch should be.
This GETFUNCSYM
definition is a fallback for when an architecture doesn't provide a definition with inline assembly. Short of passing the whole function signature into the macro, I'm not sure how else it could be written to avoid that warning. Suppressing the warning is probably not desirable (there seems to be no precedent for this in musl).
Zig Version
0.10.0
Steps to Reproduce and Observed Behavior
Also happens for
arm-linux-musleabihf
.This did not occur in 0.9.1.
Expected Behavior
No warning.