Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion pkgs/build-support/setup-hooks/strip.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,13 @@ stripDirs() {
if [ -n "${paths}" ]; then
echo "stripping (with command $cmd and flags $stripFlags) in $paths"
# Do not strip lib/debug. This is a directory used by setup-hooks/separate-debug-info.sh.
find $paths -type f -a '!' -wholename "$prefix/lib/debug/*" -exec $cmd $stripFlags '{}' \; 2>/dev/null
find $paths -type f -a '!' -path "$prefix/lib/debug/*" -print0 |
xargs -r -0 -n1 -P "$NIX_BUILD_CORES" $cmd $stripFlags || [[ $? -eq 123 ]]
# ^
# xargs exits with status code 123 if some but not all of the
# processes fail. We don't care if some of the files couldn't
# be stripped, so ignore specifically this code.

# 'strip' does not normally preserve archive index in .a files.
# This usually causes linking failures against static libs like:
# ld: ...-i686-w64-mingw32-stage-final-gcc-13.0.0-lib/i686-w64-mingw32/lib/libstdc++.dll.a:
Expand Down