Skip to content

Commit

Permalink
gcc: create dummy crtstuff on S390 as well
Browse files Browse the repository at this point in the history
This commit replicates the fix in
#258032 for S390 as well.

Co-authored-by: Artturi <Artturin@artturin.com>
  • Loading branch information
2 people authored and Adam Joseph committed Oct 25, 2023
1 parent a3ba049 commit 425cac9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pkgs/development/compilers/gcc/common/libgcc-buildstuff.nix
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,12 @@ in
#
# No rule to make target '../../../gcc-xx.x.x/libgcc/config/loongarch/crti.S', needed by 'crti.o'. Stop.
#
# For LoongArch64, a hacky workaround is to simply touch them,
# For LoongArch64 and S390, a hacky workaround is to simply touch them,
# as the platform forces .init_array support.
#
# https://www.openwall.com/lists/musl/2022/11/09/3
#
+ lib.optionalString stdenv.targetPlatform.isLoongArch64 ''
touch libgcc/config/loongarch/crt{i,n}.S
# 'parsed.cpu.family' won't be correct for every platform.
+ lib.optionalString (stdenv.targetPlatform.isLoongArch64 || stdenv.targetPlatform.isS390) ''
touch libgcc/config/${stdenv.targetPlatform.parsed.cpu.family}/crt{i,n}.S
''
1 change: 1 addition & 0 deletions pkgs/test/cross/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ let
pkgs.pkgsCross.m68k.stdenv
pkgs.pkgsCross.aarch64-multiplatform.pkgsBuildTarget.gcc
pkgs.pkgsCross.powernv.pkgsBuildTarget.gcc
pkgs.pkgsCross.s390.stdenv
pkgs.pkgsCross.mips64el-linux-gnuabi64.stdenv
pkgs.pkgsCross.mips64el-linux-gnuabin32.stdenv
pkgs.pkgsCross.mingwW64.stdenv
Expand Down

0 comments on commit 425cac9

Please sign in to comment.