Skip to content

Commit

Permalink
gcc: put target-specific libs in lib output
Browse files Browse the repository at this point in the history
  • Loading branch information
illegalprime committed Apr 19, 2019
1 parent 6891bb5 commit 44d32d5
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
3 changes: 3 additions & 0 deletions pkgs/development/compilers/gcc/7/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,9 @@ stdenv.mkDerivation ({

libc_dev = stdenv.cc.libc_dev;

# set this var to use in builder.sh
target_triple = targetPlatform.config;

hardeningDisable = [ "format" "pie" ];

# This should kill all the stdinc frameworks that gcc and friends like to
Expand Down
21 changes: 18 additions & 3 deletions pkgs/development/compilers/gcc/builder.sh
Original file line number Diff line number Diff line change
Expand Up @@ -213,9 +213,24 @@ preInstall() {

postInstall() {
# Move runtime libraries to $lib.
moveToOutput "lib/lib*.so*" "$lib"
moveToOutput "lib/lib*.la" "$lib"
moveToOutput "lib/lib*.dylib" "$lib"
if [[ -d "$out/$target_triple/lib" && -n "$(ls -A $out/$target_triple/lib)" ]]; then
moveToOutput "$target_triple/lib/lib*.so*" "$lib"
moveToOutput "$target_triple/lib/lib*.la" "$lib"
moveToOutput "$target_triple/lib/lib*.dylib" "$lib"
mv "$lib/$target_triple"/lib/* "$lib/lib/"
rmdir -p --ignore-fail-on-non-empty "$lib/$target_triple/lib" || :
elif [[ -d "$out/$target_triple/lib64" && -n "$(ls -A $out/$target_triple/lib64)" ]]; then
moveToOutput "$target_triple/lib64/lib*.so*" "$lib"
moveToOutput "$target_triple/lib64/lib*.la" "$lib"
moveToOutput "$target_triple/lib64/lib*.dylib" "$lib"
mv "$lib/$target_triple"/lib64/* "$lib/lib/"
rmdir -p --ignore-fail-on-non-empty "$lib/$target_triple/lib64" || :
else
moveToOutput "lib/lib*.so*" "$lib"
moveToOutput "lib/lib*.la" "$lib"
moveToOutput "lib/lib*.dylib" "$lib"
fi

moveToOutput "share/gcc-*/python" "$lib"

for i in "$lib"/lib/*.{la,py}; do
Expand Down

0 comments on commit 44d32d5

Please sign in to comment.