Describe the bug
lib64 directories are added to linker rpath flags for cross-compilation to platforms that don't need them.
Steps To Reproduce
Steps to reproduce the behavior:
nix build -L github:eliasnaur/nix-lib64-rpath on a x86_64-linux system
output:
...
demonstrate-lib64-rpath-armv6l-unknown-linux-gnueabihf> CC armv6l-unknown-linux-gnueabihf-gcc
demonstrate-lib64-rpath-armv6l-unknown-linux-gnueabihf> NIX_LDFLAGS: -rpath /nix/store/lskdn4fvvjlz53dxkbkgb1x2dy4zkf7k-demonstrate-lib64-rpath-armv6l-unknown-linux-gnueabihf/lib64 -rpath /nix/store/lskdn4fvvjlz53dxkbkgb1x2dy4zkf7k-demonstrate-lib64-rpath-armv6l-unknown-linux-gnueabihf/lib
...
Note the lib64 directory added to NIX_LDFLAGS.
See full build log at https://github.com/eliasnaur/nix-lib64-rpath/actions/runs/4428890865/jobs/7768605092.
Running the same command on a aarch64-darwin configuration (with a aarch64-linux builder configured):
% nix build -L
...
demonstrate-lib64-rpath-armv6l-unknown-linux-gnueabihf> CC armv6l-unknown-linux-gnueabihf-gcc
demonstrate-lib64-rpath-armv6l-unknown-linux-gnueabihf> NIX_LDFLAGS: -rpath /nix/store/sw8ymyqpavw0v4hl01q0xb9c9wr50v9z-demonstrate-lib64-rpath-armv6l-unknown-linux-gnueabihf/lib
...
Note that NIX_LDFLAGS doesn't contain a lib64 directory.
Expected behavior
NIX_LDFLAGS should not contain lib64 directories when cross-compiling for non-x86_64-linux platforms.
Additional context
Adding lib64 to NIX_LDFLAGS is generally benign, except that I'm trying to achieve bit-for-bit reproducible builds. The extra lib64 entries end up in slightly larger ELF sections that can't be saved by careful use of patchelf.
Describe the bug
lib64directories are added to linker rpath flags for cross-compilation to platforms that don't need them.Steps To Reproduce
Steps to reproduce the behavior:
nix build -L github:eliasnaur/nix-lib64-rpathon a x86_64-linux systemoutput:
Note the
lib64directory added toNIX_LDFLAGS.See full build log at https://github.com/eliasnaur/nix-lib64-rpath/actions/runs/4428890865/jobs/7768605092.
Running the same command on a aarch64-darwin configuration (with a aarch64-linux builder configured):
Note that
NIX_LDFLAGSdoesn't contain alib64directory.Expected behavior
NIX_LDFLAGSshould not containlib64directories when cross-compiling for non-x86_64-linux platforms.Additional context
Adding
lib64to NIX_LDFLAGS is generally benign, except that I'm trying to achieve bit-for-bit reproducible builds. The extralib64entries end up in slightly larger ELF sections that can't be saved by careful use ofpatchelf.