From 425cac96bf81ac536b844a57b669c9d8c0adbb55 Mon Sep 17 00:00:00 2001 From: Adam Joseph Date: Mon, 23 Oct 2023 01:48:18 -0700 Subject: [PATCH] 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: Artturi --- .../development/compilers/gcc/common/libgcc-buildstuff.nix | 7 ++++--- pkgs/test/cross/default.nix | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/pkgs/development/compilers/gcc/common/libgcc-buildstuff.nix b/pkgs/development/compilers/gcc/common/libgcc-buildstuff.nix index fc88e61c6560e82..239d60268007e86 100644 --- a/pkgs/development/compilers/gcc/common/libgcc-buildstuff.nix +++ b/pkgs/development/compilers/gcc/common/libgcc-buildstuff.nix @@ -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 '' diff --git a/pkgs/test/cross/default.nix b/pkgs/test/cross/default.nix index ff83aedca123142..8daa03c5622237c 100644 --- a/pkgs/test/cross/default.nix +++ b/pkgs/test/cross/default.nix @@ -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