diff options
| author | Sergei Trofimovich <slyich@gmail.com> | 2023-08-21 07:37:01 +0100 |
|---|---|---|
| committer | Sergei Trofimovich <slyich@gmail.com> | 2023-08-21 07:50:37 +0100 |
| commit | 2da03072206223ed6ee968bdd654a4d82da33001 (patch) | |
| tree | 8dce735de05a0825276ea6bdcecfa79e08802b03 /pkgs/development/python-modules/rangehttpserver | |
| parent | f03d4e0eec54bd1b344977bfc172446c56c95987 (diff) | |
buildFHSEnv: fix `NIX_LDFLAGS` propagation to `ld` wrapper
Before the change the following command did not work:
$ nix develop -i --impure --expr 'with import <nixpkgs> { system = "i686-linux"; }; (buildFHSUserEnv { name = "t"; targetPkgs = ps: with ps; [ libmpc stdenv.cc ]; }).env'
$ ld -lmpc -o a
ld: cannot find -lmpc: No such file or directory
It is expected to work as `NIX_LDFLAGS` does contain valid values:
$ echo $NIX_LDFLAGS
-L/usr/lib -L/usr/lib32
Note that for `gcc` it does work:
$ printf "int main(){}" | gcc -x c - -lmpc -o a
It happens because `HOST` role is enabled for `cc`:
$ echo $NIX_CC_WRAPPER_TARGET_HOST_i686_unknown_linux_gnu
1
But not for `BINTOOLS`:
$ echo $NIX_BINTOOLS_WRAPPER_TARGET_HOST_i686_unknown_linux_gnu
<empty>
The change adds BINTOOLS role and fixes linking:
$ nix develop -i --impure --expr 'with import ~/nm { system = "i686-linux"; }; (buildFHSUserEnv { name = "t"; targetPkgs = ps: with ps; [ libmpc stdenv.cc ]; }).env'
$ printf "int main(){}" | gcc -x c - -lmpc -o a
$ ld -lmpc -o a
ld: warning: cannot find entry symbol _start; not setting start address
Diffstat (limited to 'pkgs/development/python-modules/rangehttpserver')
0 files changed, 0 insertions, 0 deletions
