mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-21 13:10:33 +00:00
Merge pull request #138289 from sternenseemann/fix-non-gnu-strip
stdenv: move --enable-deterministic-archives flag into GNU wrapper
This commit is contained in:
commit
5d0972c63b
|
@ -324,6 +324,16 @@ stdenv.mkDerivation {
|
|||
echo "-arch ${targetPlatform.darwinArch}" >> $out/nix-support/libc-ldflags
|
||||
''
|
||||
|
||||
##
|
||||
## GNU specific extra strip flags
|
||||
##
|
||||
|
||||
# TODO(@sternenseemann): make a generic strip wrapper?
|
||||
+ optionalString (bintools.isGNU or false) ''
|
||||
wrap ${targetPrefix}strip ${./gnu-binutils-strip-wrapper.sh} \
|
||||
"${bintools_bin}/bin/${targetPrefix}strip"
|
||||
''
|
||||
|
||||
###
|
||||
### Remove LC_UUID
|
||||
###
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
#! @shell@
|
||||
# shellcheck shell=bash
|
||||
|
||||
exec @prog@ --enable-deterministic-archives "$@"
|
|
@ -51,7 +51,7 @@ stripDirs() {
|
|||
|
||||
if [ -n "${dirs}" ]; then
|
||||
header "stripping (with command $cmd and flags $stripFlags) in$dirs"
|
||||
find $dirs -type f -exec $cmd $commonStripFlags $stripFlags '{}' \; 2>/dev/null
|
||||
find $dirs -type f -exec $cmd $stripFlags '{}' \; 2>/dev/null
|
||||
stopNest
|
||||
fi
|
||||
}
|
||||
|
|
|
@ -284,7 +284,10 @@ in with passthru; stdenv.mkDerivation {
|
|||
CPPFLAGS = concatStringsSep " " (map (p: "-I${getDev p}/include") buildInputs);
|
||||
LDFLAGS = concatStringsSep " " (map (p: "-L${getLib p}/lib") buildInputs);
|
||||
LIBS = "${optionalString (!stdenv.isDarwin) "-lcrypt"} ${optionalString (ncurses != null) "-lncurses"}";
|
||||
NIX_LDFLAGS = optionalString (stdenv.isLinux && !stdenv.hostPlatform.isMusl) "-lgcc_s" + optionalString stdenv.hostPlatform.isMusl "-lgcc_eh";
|
||||
NIX_LDFLAGS = lib.optionalString stdenv.cc.isGNU ({
|
||||
"glibc" = "-lgcc_s";
|
||||
"musl" = "-lgcc_eh";
|
||||
}."${stdenv.hostPlatform.libc}" or "");
|
||||
# Determinism: We fix the hashes of str, bytes and datetime objects.
|
||||
PYTHONHASHSEED=0;
|
||||
|
||||
|
|
|
@ -375,12 +375,7 @@ in
|
|||
targetPlatform = localSystem;
|
||||
inherit config;
|
||||
|
||||
preHook = ''
|
||||
# Make "strip" produce deterministic output, by setting
|
||||
# timestamps etc. to a fixed value.
|
||||
commonStripFlags="--enable-deterministic-archives"
|
||||
${commonPreHook}
|
||||
'';
|
||||
preHook = commonPreHook;
|
||||
|
||||
initialPath =
|
||||
((import ../common-path.nix) {pkgs = prevStage;});
|
||||
|
|
Loading…
Reference in a new issue