aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2008-06-02 04:51:29 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2008-06-02 04:51:29 +0000
commitb8e653bfbfeee7797e631d6d47cd9cddb7658e4b (patch)
tree7a0553a4184856af422e57dabbaec68bbe271502
parentcd2663f15e74274619dd97dc382bb858ac255872 (diff)
downloadbusybox-w32-b8e653bfbfeee7797e631d6d47cd9cddb7658e4b.tar.gz
busybox-w32-b8e653bfbfeee7797e631d6d47cd9cddb7658e4b.tar.bz2
busybox-w32-b8e653bfbfeee7797e631d6d47cd9cddb7658e4b.zip
Reinstate CONFIG_CROSS_COMPILE_PREFIX
-rw-r--r--Config.in10
-rw-r--r--Makefile38
-rw-r--r--modutils/insmod.c8
-rw-r--r--scripts/Makefile.IMA29
4 files changed, 61 insertions, 24 deletions
diff --git a/Config.in b/Config.in
index 5ce642ff3..a991b8a81 100644
--- a/Config.in
+++ b/Config.in
@@ -363,6 +363,16 @@ config LFS
363 cp, mount, tar, and many others. If you want to access files larger 363 cp, mount, tar, and many others. If you want to access files larger
364 than 2 Gigabytes, enable this option. Otherwise, leave it set to 'N'. 364 than 2 Gigabytes, enable this option. Otherwise, leave it set to 'N'.
365 365
366config CROSS_COMPILER_PREFIX
367 string "Cross Compiler prefix"
368 default ""
369 help
370 If you want to build BusyBox with a cross compiler, then you
371 will need to set this to the cross-compiler prefix, for example,
372 "i386-uclibc-". Note that CROSS_COMPILE environment variable
373 or "make CROSS_COMPILE=xxx ..." will override this selection.
374 For native build leave it empty.
375
366endmenu 376endmenu
367 377
368menu 'Debugging Options' 378menu 'Debugging Options'
diff --git a/Makefile b/Makefile
index 9c1b49611..78c701ec0 100644
--- a/Makefile
+++ b/Makefile
@@ -142,17 +142,6 @@ VPATH := $(srctree)$(if $(KBUILD_EXTMOD),:$(KBUILD_EXTMOD))
142export srctree objtree VPATH TOPDIR 142export srctree objtree VPATH TOPDIR
143 143
144 144
145# SUBARCH tells the usermode build what the underlying arch is. That is set
146# first, and if a usermode build is happening, the "ARCH=um" on the command
147# line overrides the setting of ARCH below. If a native build is happening,
148# then ARCH is assigned, getting whatever value it gets normally, and
149# SUBARCH is subsequently ignored.
150
151SUBARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ \
152 -e s/arm.*/arm/ -e s/sa110/arm/ \
153 -e s/s390x/s390/ -e s/parisc64/parisc/ \
154 -e s/ppc.*/powerpc/ -e s/mips.*/mips/ )
155
156# Cross compiling and selecting different set of gcc/bin-utils 145# Cross compiling and selecting different set of gcc/bin-utils
157# --------------------------------------------------------------------------- 146# ---------------------------------------------------------------------------
158# 147#
@@ -172,8 +161,33 @@ SUBARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ \
172# Default value for CROSS_COMPILE is not to prefix executables 161# Default value for CROSS_COMPILE is not to prefix executables
173# Note: Some architectures assign CROSS_COMPILE in their arch/*/Makefile 162# Note: Some architectures assign CROSS_COMPILE in their arch/*/Makefile
174 163
175ARCH ?= $(SUBARCH)
176CROSS_COMPILE ?= 164CROSS_COMPILE ?=
165# bbox: we may have CONFIG_CROSS_COMPILER_PREFIX in .config,
166# and it has not been included yet... thus using an awkward syntax.
167ifeq ($(CROSS_COMPILE),)
168CROSS_COMPILE := $(shell grep ^CONFIG_CROSS_COMPILER_PREFIX .config 2>/dev/null)
169CROSS_COMPILE := $(subst CONFIG_CROSS_COMPILER_PREFIX=,,$(CROSS_COMPILE))
170CROSS_COMPILE := $(subst ",,$(CROSS_COMPILE))
171endif
172
173# SUBARCH tells the usermode build what the underlying arch is. That is set
174# first, and if a usermode build is happening, the "ARCH=um" on the command
175# line overrides the setting of ARCH below. If a native build is happening,
176# then ARCH is assigned, getting whatever value it gets normally, and
177# SUBARCH is subsequently ignored.
178
179ifneq ($(CROSS_COMPILE),)
180SUBARCH := $(shell echo $(CROSS_COMPILE) | cut -d- -f1)
181else
182SUBARCH := $(shell uname -m)
183endif
184SUBARCH := $(shell echo $(SUBARCH) | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ \
185 -e s/arm.*/arm/ -e s/sa110/arm/ \
186 -e s/s390x/s390/ -e s/parisc64/parisc/ \
187 -e s/ppc.*/powerpc/ -e s/mips.*/mips/ )
188
189ARCH ?= $(SUBARCH)
190$(warning ARCH=$(ARCH) SUBARCH=$(SUBARCH))
177 191
178# Architecture as present in compile.h 192# Architecture as present in compile.h
179UTS_MACHINE := $(ARCH) 193UTS_MACHINE := $(ARCH)
diff --git a/modutils/insmod.c b/modutils/insmod.c
index 3a8201feb..f45a59465 100644
--- a/modutils/insmod.c
+++ b/modutils/insmod.c
@@ -452,7 +452,7 @@ enum {
452/* The system calls unchanged between 2.0 and 2.1. */ 452/* The system calls unchanged between 2.0 and 2.1. */
453 453
454unsigned long create_module(const char *, size_t); 454unsigned long create_module(const char *, size_t);
455int delete_module(const char *); 455int delete_module(const char *module, unsigned int flags);
456 456
457 457
458#endif /* module.h */ 458#endif /* module.h */
@@ -4141,18 +4141,18 @@ int insmod_main(int argc, char **argv)
4141 * now we can load them directly into the kernel memory 4141 * now we can load them directly into the kernel memory
4142 */ 4142 */
4143 if (!obj_load_progbits(fp, f, (char*)m_addr)) { 4143 if (!obj_load_progbits(fp, f, (char*)m_addr)) {
4144 delete_module(m_name); 4144 delete_module(m_name, 0);
4145 goto out; 4145 goto out;
4146 } 4146 }
4147#endif 4147#endif
4148 4148
4149 if (!obj_relocate(f, m_addr)) { 4149 if (!obj_relocate(f, m_addr)) {
4150 delete_module(m_name); 4150 delete_module(m_name, 0);
4151 goto out; 4151 goto out;
4152 } 4152 }
4153 4153
4154 if (!new_init_module(m_name, f, m_size)) { 4154 if (!new_init_module(m_name, f, m_size)) {
4155 delete_module(m_name); 4155 delete_module(m_name, 0);
4156 goto out; 4156 goto out;
4157 } 4157 }
4158 4158
diff --git a/scripts/Makefile.IMA b/scripts/Makefile.IMA
index 353a4ac1b..988c6a6d1 100644
--- a/scripts/Makefile.IMA
+++ b/scripts/Makefile.IMA
@@ -1,4 +1,7 @@
1# This is completely unsupported. 1# This is completely unsupported.
2#
3# Uasge: make -f scripts/Makefile.IMA
4#
2# Fix COMBINED_COMPILE upstream (in the Kbuild) and propagate 5# Fix COMBINED_COMPILE upstream (in the Kbuild) and propagate
3# the changes back 6# the changes back
4srctree := $(if $(KBUILD_SRC),$(KBUILD_SRC),$(CURDIR)) 7srctree := $(if $(KBUILD_SRC),$(KBUILD_SRC),$(CURDIR))
@@ -11,6 +14,24 @@ MAKEFLAGS += --include-dir=$(srctree)
11 14
12default: busybox 15default: busybox
13 16
17include .config
18
19# Cross compiling and selecting different set of gcc/bin-utils
20ifeq ($(CROSS_COMPILE),)
21CROSS_COMPILE := $(subst ",,$(CONFIG_CROSS_COMPILER_PREFIX))
22endif
23
24ifneq ($(CROSS_COMPILE),)
25SUBARCH := $(shell echo $(CROSS_COMPILE) | cut -d- -f1)
26else
27SUBARCH := $(shell uname -m)
28endif
29SUBARCH := $(shell echo $(SUBARCH) | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ \
30 -e s/arm.*/arm/ -e s/sa110/arm/ \
31 -e s/s390x/s390/ -e s/parisc64/parisc/ \
32 -e s/ppc.*/powerpc/ -e s/mips.*/mips/ )
33ARCH ?= $(SUBARCH)
34
14ifndef HOSTCC 35ifndef HOSTCC
15HOSTCC = cc 36HOSTCC = cc
16endif 37endif
@@ -27,19 +48,11 @@ OBJDUMP = $(CROSS_COMPILE)objdump
27CFLAGS := $(CFLAGS) 48CFLAGS := $(CFLAGS)
28CPPFLAGS+= -D"KBUILD_STR(s)=\#s" #-Q 49CPPFLAGS+= -D"KBUILD_STR(s)=\#s" #-Q
29 50
30include .config
31# We need some generic definitions 51# We need some generic definitions
32include $(srctree)/scripts/Kbuild.include 52include $(srctree)/scripts/Kbuild.include
33 53
34include Makefile.flags 54include Makefile.flags
35 55
36SUBARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ \
37 -e s/arm.*/arm/ -e s/sa110/arm/ \
38 -e s/s390x/s390/ -e s/parisc64/parisc/ \
39 -e s/ppc.*/powerpc/ -e s/mips.*/mips/ )
40ARCH ?= $(SUBARCH)
41
42# Cross compiling and selecting different set of gcc/bin-utils
43-include $(srctree)/arch/$(ARCH)/Makefile 56-include $(srctree)/arch/$(ARCH)/Makefile
44ifdef CONFIG_FEATURE_COMPRESS_USAGE 57ifdef CONFIG_FEATURE_COMPRESS_USAGE
45usage_stuff = include/usage_compressed.h 58usage_stuff = include/usage_compressed.h