summary refs log tree commit diff
path: root/pkgs/build-support/writers
diff options
context:
space:
mode:
authorsternenseemann <sternenseemann@systemli.org>2021-10-29 12:12:58 +0200
committersternenseemann <sternenseemann@systemli.org>2021-10-29 12:18:58 +0200
commit3090ed3f403cae8ec297aa8cbe8f7f7114c4dc75 (patch)
treed3c68f7d22abdf8d285a7b11d9ccc1a897603f28 /pkgs/build-support/writers
parent837ebb5ac9fce1c8315dcf540877b243f84080ba (diff)
downloadnixpkgs-3090ed3f403cae8ec297aa8cbe8f7f7114c4dc75.tar
nixpkgs-3090ed3f403cae8ec297aa8cbe8f7f7114c4dc75.tar.gz
nixpkgs-3090ed3f403cae8ec297aa8cbe8f7f7114c4dc75.tar.bz2
nixpkgs-3090ed3f403cae8ec297aa8cbe8f7f7114c4dc75.tar.lz
nixpkgs-3090ed3f403cae8ec297aa8cbe8f7f7114c4dc75.tar.xz
nixpkgs-3090ed3f403cae8ec297aa8cbe8f7f7114c4dc75.tar.zst
nixpkgs-3090ed3f403cae8ec297aa8cbe8f7f7114c4dc75.zip
writers: use platform's default strip
bintools points to the default bintools (e. g. cctools, binutils,
llvmPackages.bintools) for the next stage. So instead of using GNU
binutils' strip which may not support the current platform, we need to
use buildPackages.bintools-unwrapped.

Additionally we need to use `-S` over `--strip-unneeded` as the latter
is a GNU binutils-specific flag and not supported by cctools.

Also add the correct targetPrefix in order to support cross-compilation
correctly here at least.
Diffstat (limited to 'pkgs/build-support/writers')
-rw-r--r--pkgs/build-support/writers/default.nix4
1 files changed, 2 insertions, 2 deletions
diff --git a/pkgs/build-support/writers/default.nix b/pkgs/build-support/writers/default.nix
index 111ec68a602..09ee7d73865 100644
--- a/pkgs/build-support/writers/default.nix
+++ b/pkgs/build-support/writers/default.nix
@@ -1,4 +1,4 @@
-{ pkgs, lib, gawk, gnused, gixy }:
+{ pkgs, buildPackages, lib, gawk, gnused, gixy }:
 
 with lib;
 rec {
@@ -77,7 +77,7 @@ rec {
     }) ''
       ${compileScript}
       ${lib.optionalString strip
-         "${pkgs.binutils-unwrapped}/bin/strip --strip-unneeded $out"}
+          "${lib.getBin buildPackages.bintools-unwrapped}/bin/${buildPackages.bintools-unwrapped.targetPrefix}strip -S $out"}
       ${optionalString (types.path.check nameOrPath) ''
         mv $out tmp
         mkdir -p $out/$(dirname "${nameOrPath}")