Skip to content

Instantly share code, notes, and snippets.

@lheckemann
Forked from cleverca22/32bit-simple-test.nix
Last active August 7, 2017 21:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lheckemann/927fe3b741ee89e54ad7ae2f64a5e2a8 to your computer and use it in GitHub Desktop.
Save lheckemann/927fe3b741ee89e54ad7ae2f64a5e2a8 to your computer and use it in GitHub Desktop.
patchelf util
with import <nixpkgs> { system = "i686-linux"; };
writeScript "do-patchelf" ''
#!${stdenv.shell}
patchelf --interpreter "$(cat ${gcc}/nix-support/dynamic-linker)" --set-rpath ${lib.makeLibraryPath [ zlib ]} \$1
''
with import <nixpkgs> {};
writeScript "do-patchelf" ''
#!${stdenv.shell}
patchelf --interpreter "$(cat ${gcc}/nix-support/dynamic-linker)" --set-rpath ${lib.makeLibraryPath [ zlib ]} \$1
''
% nix-shell -p gcc --run 'echo $NIX_CC'
/nix/store/j1yn1np5g2vgm5yp8qmqg67x8riwy2kr-gcc-wrapper-5.4.0
% nix-build --no-out-link '<nixpkgs>' -A gcc
/nix/store/j1yn1np5g2vgm5yp8qmqg67x8riwy2kr-gcc-wrapper-5.4.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment