You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
build flags: -j80 SHELL=/nix/store/1fzg4cl3k2n9yq80vg6y1vcmvx3qm682-bash-5.2p26/bin/bash SKIP_STRIP=y
applets/usage.c: In function 'main':
applets/usage.c:52:17: warning: ignoring return value of 'write' declared with attribute 'warn_unused_result' [-Wunused-result]
52 | write(STDOUT_FILENO, usage_array[i].usage, strlen(usage_array[i].usage) + 1);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
clang: warning: optimization flag '-finline-limit=0' is not supported [-Wignored-optimization-argument]
clang: warning: optimization flag '-falign-jumps=1' is not supported [-Wignored-optimization-argument]
clang: warning: optimization flag '-falign-labels=1' is not supported [-Wignored-optimization-argument]
aarch64-unknown-linux-gnu-ld: error: attempted static link of dynamic object /nix/store/2aqakjqjfj5kw644kkmyf3l30hk0x0rf-libunwind-aarch64-unknown-linux-gnu-17.0.6/lib/libunwind.so
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [scripts/Makefile.build:264: applets/built-in.o] Error 1
make: *** [Makefile:372: applets_dir] Error 2
This looks to me like the compiler wrapper isn't respecting -r and/or -nostdlib, and it's inappropriately passing the libunwind shared object. I don't have immediate time to investigate further but did discover this minimal reproducer:
$ nix shell nixpkgs/57d6973abba7ea108bac64ae7629e7431e0199b6#pkgsLLVM.stdenv.cc
$ touch test.c
$ x86_64-unknown-linux-gnu-cc -nostdlib -r -o test.o test.c
x86_64-unknown-linux-gnu-ld: error: attempted static link of dynamic object /nix/store/k3l71w9p5wcbzh0fqcjg0svbap8xla4g-libunwind-x86_64-unknown-linux-gnu-17.0.6/lib/libunwind.so
clang: error: linker command failed with exit code 1 (use -v to see invocation)
looks the same as #317526 which is due to llvm/llvm-project#94958 (search path prefers .so files with -r). i agree that passing in libunwind unconditionally seems not good.
if one builds libcxx with LLVM_ENABLE_RUNTIMES=libcxx;libcxxabi;libunwind the linker script at libc++.so will result in INPUT(libc++.so.1 -lc++abi -lunwind) but we don't so we add -lunwind unconditionally. it is not clear to me why c code needs libunwind.
Steps To Reproduce
Steps to reproduce the behavior:
pkgsLLVM.busybox
Build log
Additional context
Add any other context about the problem here.
Notify maintainers
@TethysSvensson @alyssais
Metadata
Please run
nix-shell -p nix-info --run "nix-info -m"
and paste the result.Add a 👍 reaction to issues you find important.
The text was updated successfully, but these errors were encountered: