-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
-Wdeprecated-non-prototype
warning in musl's dlstart.c
with zig cc main.c -target aarch64-linux-musl
#13385
Comments
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 |
Got the same thing using zig as CC for a golang crossbuild:
Reproducing steps:
|
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 |
For whatever reason, I'm just completely unable to reproduce this outside the context of Zig's own musl build logic: $ zig cc --version
clang version 18.1.6
$ ./configure --target=aarch64-linux-gnu CC="zig cc" CFLAGS="-target aarch64-linux -Wall -Wextra -Werror"
$ make -j
$ make clean
$ clang --version
Ubuntu clang version 16.0.6
$ ./configure --target=aarch64-linux-gnu CC=clang CFLAGS="--target=aarch64-linux-gnu -Wall -Wextra -Werror"
$ make -j
$ make clean
$ /opt/llvm/bin/clang --version
clang version 18.1.8
$ ./configure --target=aarch64-linux-gnu CC=/opt/llvm/bin/clang CFLAGS="--target=aarch64-linux-gnu -Wall -Wextra -Werror"
$ make -j They all build successfully. At this point, I strongly suspect the bug is actually on the Zig side somehow. |
This is might be because musl Try the diff below and run something like $ git diff
diff --git a/configure b/configure
index bc9fbe48..c0fdeffe 100755
--- a/configure
+++ b/configure
@@ -534,7 +534,7 @@ fi
# to start from a clean slate. So use -w if building with clang. Also
# turn off a common on-by-default cast warning regardless of compiler.
#
-test "$cc_family" = clang && tryflag CFLAGS_AUTO -w
+#### test "$cc_family" = clang && tryflag CFLAGS_AUTO -w
tryflag CFLAGS_AUTO -Wno-pointer-to-int-cast |
@markus-oberhumer thank you, that's super helpful! I hadn't spotted that. This means we just need to adjust our |
This is what upstream's configure does. Previously, we only disabled warnings in some musl compilations, with `rcrt1.o` notably being one for which we didn't. This resulted in a warning in `dlstart.c` which is included in `rcrt1.c`. So let's just be consistent and disable warnings for all musl code. Closes ziglang#13385.
This is what upstream's configure does. Previously, we only disabled warnings in some musl compilations, with `rcrt1.o` notably being one for which we didn't. This resulted in a warning in `dlstart.c` which is included in `rcrt1.c`. So let's just be consistent and disable warnings for all musl code. Closes ziglang#13385.
This is what upstream's configure does. Previously, we only disabled warnings in some musl compilations, with `rcrt1.o` notably being one for which we didn't. This resulted in a warning in `dlstart.c` which is included in `rcrt1.c`. So let's just be consistent and disable warnings for all musl code. Closes ziglang#13385.
This is what upstream's configure does. Previously, we only disabled warnings in some musl compilations, with `rcrt1.o` notably being one for which we didn't. This resulted in a warning in `dlstart.c` which is included in `rcrt1.c`. So let's just be consistent and disable warnings for all musl code. Closes ziglang#13385.
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.
The text was updated successfully, but these errors were encountered: