Skip to content
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

zig cc does not respect -Wl,--whole-archive -l<lib> -Wl,--no-whole-archive #21971

Open
tmm1 opened this issue Nov 12, 2024 · 1 comment · May be fixed by #21973
Open

zig cc does not respect -Wl,--whole-archive -l<lib> -Wl,--no-whole-archive #21971

tmm1 opened this issue Nov 12, 2024 · 1 comment · May be fixed by #21973
Labels
bug Observed behavior contradicts documented or intended behavior

Comments

@tmm1
Copy link

tmm1 commented Nov 12, 2024

Zig Version

0.13.0

Steps to Reproduce and Observed Behavior

echo 'int main(){}' > test.c
touch libtest.a
ZIG_VERBOSE_LINK=1 zig cc -target x86_64-linux-gnu.2.19 -o test test.c -L. -Wl,--whole-archive -ltest -Wl,--no-whole-archive |& grep whole

Expected Behavior

expected ld.lld invocation w/ ZIG_VERBOSE_LINK=1 to reflect --whole-archive.

@tmm1 tmm1 added the bug Observed behavior contradicts documented or intended behavior label Nov 12, 2024
@tmm1 tmm1 changed the title zig cc does not respect -Wl,--whole-archive -l<lib> -Wl,--no-whole-archive zig cc does not respect -Wl,--whole-archive -l<lib> -Wl,--no-whole-archive Nov 12, 2024
@tmm1
Copy link
Author

tmm1 commented Nov 12, 2024

as a workaround you can use --Wl,--whole-archive /path/to/libxxx.a --Wl,--no-whole-archive

the bug is specific to -lxxx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Observed behavior contradicts documented or intended behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant