Commit 425cac96 authored by Adam Joseph's avatar Adam Joseph Committed by Adam Joseph
Browse files

gcc: create dummy crtstuff on S390 as well

This commit replicates the fix in
https://github.com/NixOS/nixpkgs/pull/258032

 for S390 as well.

Co-authored-by: default avatarArtturi <Artturin@artturin.com>
parent a3ba0495
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -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 −0
Original line number Diff line number Diff line
@@ -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