busybox: add patch to allow cross in llvm

Fixes #57670

$ nix build -f. --arg crossSystem '{ config = "aarch64-unknown-linux-musl"; useLLVM = true; }' busybox

+38 -1
+37
pkgs/os-specific/linux/busybox/clang-cross.patch
···
··· 1 + diff --git a/Makefile b/Makefile 2 + index 6fedcffba..3385836c4 100644 3 + --- a/Makefile 4 + +++ b/Makefile 5 + @@ -271,8 +271,8 @@ export quiet Q KBUILD_VERBOSE 6 + # Look for make include files relative to root of kernel src 7 + MAKEFLAGS += --include-dir=$(srctree) 8 + 9 + -HOSTCC = gcc 10 + -HOSTCXX = g++ 11 + +HOSTCC = cc 12 + +HOSTCXX = c++ 13 + HOSTCFLAGS := 14 + HOSTCXXFLAGS := 15 + # We need some generic definitions 16 + @@ -289,7 +289,7 @@ MAKEFLAGS += -rR 17 + # Make variables (CC, etc...) 18 + 19 + AS = $(CROSS_COMPILE)as 20 + -CC = $(CROSS_COMPILE)gcc 21 + +CC = $(CROSS_COMPILE)cc 22 + LD = $(CC) -nostdlib 23 + CPP = $(CC) -E 24 + AR = $(CROSS_COMPILE)ar 25 + diff --git a/scripts/Makefile.IMA b/scripts/Makefile.IMA 26 + index f155108d7..185257064 100644 27 + --- a/scripts/Makefile.IMA 28 + +++ b/scripts/Makefile.IMA 29 + @@ -39,7 +39,7 @@ ifndef HOSTCC 30 + HOSTCC = cc 31 + endif 32 + AS = $(CROSS_COMPILE)as 33 + -CC = $(CROSS_COMPILE)gcc 34 + +CC = $(CROSS_COMPILE)cc 35 + LD = $(CC) -nostdlib 36 + CPP = $(CC) -E 37 + AR = $(CROSS_COMPILE)ar
+1 -1
pkgs/os-specific/linux/busybox/default.nix
··· 47 48 patches = [ 49 ./busybox-in-store.patch 50 - ]; 51 52 postPatch = "patchShebangs ."; 53
··· 47 48 patches = [ 49 ./busybox-in-store.patch 50 + ] ++ stdenv.lib.optional (stdenv.hostPlatform != stdenv.targetPlatform) ./clang-cross.patch; 51 52 postPatch = "patchShebangs ."; 53