From e7570bb9cffdabb080c60c8fda67a0061ce44421 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 21 Feb 2008 16:20:51 +0000 Subject: [PATCH] * Don't strip all symbols from $out/bin by default, since it makes stack traces impossible. * When stripping all symbols on Darwin, don't use the "-s" flag since it has a completely different meaning (it takes an argument specifying a file containing a list of symbols). svn path=/nixpkgs/branches/stdenv-updates-merge/; revision=10809 --- pkgs/stdenv/darwin/prehook.sh | 3 ++- pkgs/stdenv/generic/setup.sh | 17 ++++++++++------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/pkgs/stdenv/darwin/prehook.sh b/pkgs/stdenv/darwin/prehook.sh index d2f00c59257..0232ee2bb6f 100644 --- a/pkgs/stdenv/darwin/prehook.sh +++ b/pkgs/stdenv/darwin/prehook.sh @@ -2,4 +2,5 @@ export NIX_ENFORCE_PURITY= export NIX_DONT_SET_RPATH=1 export NIX_NO_SELF_RPATH=1 dontFixLibtool=1 -NIX_STRIP_DEBUG=0 \ No newline at end of file +NIX_STRIP_DEBUG=0 +stripAllFlags=" " # the Darwin "strip" command doesn't know "-s" diff --git a/pkgs/stdenv/generic/setup.sh b/pkgs/stdenv/generic/setup.sh index 395de988e4c..9f4bfc635d0 100644 --- a/pkgs/stdenv/generic/setup.sh +++ b/pkgs/stdenv/generic/setup.sh @@ -232,7 +232,7 @@ stripDirs() { dirs=${dirsNew} if test -n "${dirs}"; then - echo $dirs + echo "stripping (with flags $stripFlags) in $dirs" find $dirs -type f -print0 | xargs -0 strip $stripFlags || true fi } @@ -715,12 +715,15 @@ fixupPhase() { # TODO: strip _only_ ELF executables, and return || fail here... if test -z "$dontStrip"; then - stripDebugList=${stripDebugList:-lib} - echo "stripping debuging symbols from files in $stripDebugList" - stripDirs "$stripDebugList" -S - stripAllList=${stripAllList:-bin sbin} - echo "stripping all symbols from files in $stripAllList" - stripDirs "$stripAllList" -s + stripDebugList=${stripDebugList:-lib bin sbin} + if test -n "$stripDebugList"; then + stripDirs "$stripDebugList" "${stripDebugFlags:--S}" + fi + + stripAllList=${stripAllList:-} + if test -n "$stripAllList"; then + stripDirs "$stripAllList" "${stripAllFlags:--s}" + fi fi if test "$havePatchELF" = 1 -a -z "$dontPatchELF"; then