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
building
++ gcc -c -o src.o /nix/store/cskqhvkcmclg60r5vh9wf594q52c0qa3-src.c
++ /nix/store/68v7fk0rfjmvizfs0y3sz1abcpz6k0gc-lld-wrapper-14.0.1/bin/ld.lld @/nix/store/w4lrhm8si8cihrqdcr1j1myrimq4irvl-responsefile src.o
ld.lld: error: -shared and -pie may not be used together
Additional context
Given NIX_HARDENING_ENABLE=pie, the bintools wrapper attemps to pass -pie even though -shared is specified. The binutils linker accepts this silently, but lld explodes with an error.
The trace (included in above nix build script) shows that add-hardening inserts this -pie flag, even though it's trying not to do so if -shared is passed. The reason is that the test is against the params via $* [0], rather than the expanded response parameters. In my build setup, clang is using a response file to pass parameters to the linker, so this test fails.
Steps To Reproduce
Steps to reproduce the behavior:
nix-build <the below>
.ld.lld: error: -shared and -pie may not be used together
.Build log
Additional context
Given
NIX_HARDENING_ENABLE=pie
, the bintools wrapper attemps to pass-pie
even though-shared
is specified. The binutils linker accepts this silently, but lld explodes with an error.The trace (included in above nix build script) shows that add-hardening inserts this
-pie
flag, even though it's trying not to do so if-shared
is passed. The reason is that the test is against the params via$*
[0], rather than the expanded response parameters. In my build setup, clang is using a response file to pass parameters to the linker, so this test fails.Here is the relevant bit in add-hardening.sh:
nixpkgs/pkgs/build-support/bintools-wrapper/add-hardening.sh
Lines 40 to 44 in cc83d35
I believe this should be referring to the response-expanded
$params
variable instead.Notify maintainers
cc @Ericson2314 @matthewbauer
Metadata
The text was updated successfully, but these errors were encountered: