Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion pkgs/build-support/setup-hooks/strip.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ stripDirs() {

local d
for d in ${dirs}; do
if [ -d "$prefix/$d" ]; then
if [ -e "$prefix/$d" ]; then
dirsNew="${dirsNew} $prefix/$d "
fi
done
Expand Down
37 changes: 26 additions & 11 deletions pkgs/development/compilers/gcc/common/strip-attributes.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
# Example ARM breakage by x86_64 strip: https://bugs.gentoo.org/697428
#
# Let's recap the file layout for directories with object files for a
# cross-compiler (host != target):
# cross-compiler:
#
# $out (host != target)
# `- bin: HOST
# lib/*.{a,o}: HOST
# `- gcc/<TARGET>/<VERSION>/*.{a,o}: TARGET
Expand All @@ -17,10 +19,16 @@
# `- libexec/: HOST
# `- <TARGET>/: TARGET
#
# (host == target) has identical directory layout.
# $out (host == target) has identical directory layout.
#
# $lib (host != target):
# `- <TARGET>/lib/*.{la,so}: TARGET
#
# $lib (host == target):
# `- lib/*.{la,so}: HOST

# The rest of stripDebugList{Host,Target} will be populated in
# postInstall.
# postInstall to disambiguate lib/ object files.
stripDebugList = [ "bin" "libexec" ];
stripDebugListTarget = [ stdenv.targetPlatform.config ];

Expand All @@ -32,21 +40,28 @@
shopt -s nullglob

pushd $out

local -ar hostFiles=(
lib{,32,64}/*.{a.o}
local -ar outHostFiles=(
lib{,32,64}/*.{a,o,so*}
lib{,32,64}/gcc/${stdenv.targetPlatform.config}/*/plugin
)
local -ar targetFiles=(
lib{,32,64}/gcc/${stdenv.targetPlatform.config}/*/*.{a.o}
local -ar outTargetFiles=(
lib{,32,64}/gcc/${stdenv.targetPlatform.config}/*/*.{a,o,so*}
)
popd

stripDebugList="$stripDebugList ''${hostFiles[*]}"
stripDebugListTarget="$stripDebugListTarget ''${targetFiles[*]}"

pushd $lib
local -ar libHostFiles=(
lib{,32,64}/*.{a,o,so*}
)
local -ar libTargetFiles=(
lib{,32,64}/${stdenv.targetPlatform.config}/*.{a,o,so*}
)
popd

eval "$oldOpts"

stripDebugList="$stripDebugList ''${outHostFiles[*]} ''${libHostFiles[*]}"
stripDebugListTarget="$stripDebugListTarget ''${outTargetFiles[*]} ''${libTargetFiles[*]}"
}
updateDebugListPaths
'';
Expand Down