summary refs log tree commit diff
path: root/pkgs/os-specific/linux/busybox
diff options
context:
space:
mode:
authorMatthew Bauer <mjbauer95@gmail.com>2019-04-14 22:03:33 -0400
committerMatthew Bauer <mjbauer95@gmail.com>2019-04-14 22:03:33 -0400
commit3bf69b1e4090671e54f039760366efdc2226262c (patch)
tree07ec236f097acfa60f3548934ce68d91b09656e8 /pkgs/os-specific/linux/busybox
parentef54604ce473400f866ec5d415271226706f113b (diff)
downloadnixpkgs-3bf69b1e4090671e54f039760366efdc2226262c.tar
nixpkgs-3bf69b1e4090671e54f039760366efdc2226262c.tar.gz
nixpkgs-3bf69b1e4090671e54f039760366efdc2226262c.tar.bz2
nixpkgs-3bf69b1e4090671e54f039760366efdc2226262c.tar.lz
nixpkgs-3bf69b1e4090671e54f039760366efdc2226262c.tar.xz
nixpkgs-3bf69b1e4090671e54f039760366efdc2226262c.tar.zst
nixpkgs-3bf69b1e4090671e54f039760366efdc2226262c.zip
busybox: add patch to allow cross in llvm
Fixes #57670

$ nix build -f. --arg crossSystem '{ config = "aarch64-unknown-linux-musl"; useLLVM = true; }' busybox
Diffstat (limited to 'pkgs/os-specific/linux/busybox')
-rw-r--r--pkgs/os-specific/linux/busybox/clang-cross.patch37
-rw-r--r--pkgs/os-specific/linux/busybox/default.nix2
2 files changed, 38 insertions, 1 deletions
diff --git a/pkgs/os-specific/linux/busybox/clang-cross.patch b/pkgs/os-specific/linux/busybox/clang-cross.patch
new file mode 100644
index 00000000000..b2d696bfd73
--- /dev/null
+++ b/pkgs/os-specific/linux/busybox/clang-cross.patch
@@ -0,0 +1,37 @@
+diff --git a/Makefile b/Makefile
+index 6fedcffba..3385836c4 100644
+--- a/Makefile
++++ b/Makefile
+@@ -271,8 +271,8 @@ export quiet Q KBUILD_VERBOSE
+ # Look for make include files relative to root of kernel src
+ MAKEFLAGS += --include-dir=$(srctree)
+ 
+-HOSTCC  	= gcc
+-HOSTCXX  	= g++
++HOSTCC		= cc
++HOSTCXX	= c++
+ HOSTCFLAGS	:=
+ HOSTCXXFLAGS	:=
+ # We need some generic definitions
+@@ -289,7 +289,7 @@ MAKEFLAGS += -rR
+ # Make variables (CC, etc...)
+ 
+ AS		= $(CROSS_COMPILE)as
+-CC		= $(CROSS_COMPILE)gcc
++CC		= $(CROSS_COMPILE)cc
+ LD		= $(CC) -nostdlib
+ CPP		= $(CC) -E
+ AR		= $(CROSS_COMPILE)ar
+diff --git a/scripts/Makefile.IMA b/scripts/Makefile.IMA
+index f155108d7..185257064 100644
+--- a/scripts/Makefile.IMA
++++ b/scripts/Makefile.IMA
+@@ -39,7 +39,7 @@ ifndef HOSTCC
+ HOSTCC = cc
+ endif
+ AS              = $(CROSS_COMPILE)as
+-CC              = $(CROSS_COMPILE)gcc
++CC              = $(CROSS_COMPILE)cc
+ LD              = $(CC) -nostdlib
+ CPP             = $(CC) -E
+ AR              = $(CROSS_COMPILE)ar
diff --git a/pkgs/os-specific/linux/busybox/default.nix b/pkgs/os-specific/linux/busybox/default.nix
index 4b287725082..a0f0a4c47e3 100644
--- a/pkgs/os-specific/linux/busybox/default.nix
+++ b/pkgs/os-specific/linux/busybox/default.nix
@@ -47,7 +47,7 @@ stdenv.mkDerivation rec {
 
   patches = [
     ./busybox-in-store.patch
-  ];
+  ] ++ stdenv.lib.optional (stdenv.hostPlatform != stdenv.targetPlatform) ./clang-cross.patch;
 
   postPatch = "patchShebangs .";