diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2008-06-02 04:51:29 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2008-06-02 04:51:29 +0000 |
commit | b8e653bfbfeee7797e631d6d47cd9cddb7658e4b (patch) | |
tree | 7a0553a4184856af422e57dabbaec68bbe271502 | |
parent | cd2663f15e74274619dd97dc382bb858ac255872 (diff) | |
download | busybox-w32-b8e653bfbfeee7797e631d6d47cd9cddb7658e4b.tar.gz busybox-w32-b8e653bfbfeee7797e631d6d47cd9cddb7658e4b.tar.bz2 busybox-w32-b8e653bfbfeee7797e631d6d47cd9cddb7658e4b.zip |
Reinstate CONFIG_CROSS_COMPILE_PREFIX
-rw-r--r-- | Config.in | 10 | ||||
-rw-r--r-- | Makefile | 38 | ||||
-rw-r--r-- | modutils/insmod.c | 8 | ||||
-rw-r--r-- | scripts/Makefile.IMA | 29 |
4 files changed, 61 insertions, 24 deletions
@@ -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 | ||
366 | config 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 | |||
366 | endmenu | 376 | endmenu |
367 | 377 | ||
368 | menu 'Debugging Options' | 378 | menu 'Debugging Options' |
@@ -142,17 +142,6 @@ VPATH := $(srctree)$(if $(KBUILD_EXTMOD),:$(KBUILD_EXTMOD)) | |||
142 | export srctree objtree VPATH TOPDIR | 142 | export 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 | |||
151 | SUBARCH := $(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 | ||
175 | ARCH ?= $(SUBARCH) | ||
176 | CROSS_COMPILE ?= | 164 | CROSS_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. | ||
167 | ifeq ($(CROSS_COMPILE),) | ||
168 | CROSS_COMPILE := $(shell grep ^CONFIG_CROSS_COMPILER_PREFIX .config 2>/dev/null) | ||
169 | CROSS_COMPILE := $(subst CONFIG_CROSS_COMPILER_PREFIX=,,$(CROSS_COMPILE)) | ||
170 | CROSS_COMPILE := $(subst ",,$(CROSS_COMPILE)) | ||
171 | endif | ||
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 | |||
179 | ifneq ($(CROSS_COMPILE),) | ||
180 | SUBARCH := $(shell echo $(CROSS_COMPILE) | cut -d- -f1) | ||
181 | else | ||
182 | SUBARCH := $(shell uname -m) | ||
183 | endif | ||
184 | SUBARCH := $(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 | |||
189 | ARCH ?= $(SUBARCH) | ||
190 | $(warning ARCH=$(ARCH) SUBARCH=$(SUBARCH)) | ||
177 | 191 | ||
178 | # Architecture as present in compile.h | 192 | # Architecture as present in compile.h |
179 | UTS_MACHINE := $(ARCH) | 193 | UTS_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 | ||
454 | unsigned long create_module(const char *, size_t); | 454 | unsigned long create_module(const char *, size_t); |
455 | int delete_module(const char *); | 455 | int 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 |
4 | srctree := $(if $(KBUILD_SRC),$(KBUILD_SRC),$(CURDIR)) | 7 | srctree := $(if $(KBUILD_SRC),$(KBUILD_SRC),$(CURDIR)) |
@@ -11,6 +14,24 @@ MAKEFLAGS += --include-dir=$(srctree) | |||
11 | 14 | ||
12 | default: busybox | 15 | default: busybox |
13 | 16 | ||
17 | include .config | ||
18 | |||
19 | # Cross compiling and selecting different set of gcc/bin-utils | ||
20 | ifeq ($(CROSS_COMPILE),) | ||
21 | CROSS_COMPILE := $(subst ",,$(CONFIG_CROSS_COMPILER_PREFIX)) | ||
22 | endif | ||
23 | |||
24 | ifneq ($(CROSS_COMPILE),) | ||
25 | SUBARCH := $(shell echo $(CROSS_COMPILE) | cut -d- -f1) | ||
26 | else | ||
27 | SUBARCH := $(shell uname -m) | ||
28 | endif | ||
29 | SUBARCH := $(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/ ) | ||
33 | ARCH ?= $(SUBARCH) | ||
34 | |||
14 | ifndef HOSTCC | 35 | ifndef HOSTCC |
15 | HOSTCC = cc | 36 | HOSTCC = cc |
16 | endif | 37 | endif |
@@ -27,19 +48,11 @@ OBJDUMP = $(CROSS_COMPILE)objdump | |||
27 | CFLAGS := $(CFLAGS) | 48 | CFLAGS := $(CFLAGS) |
28 | CPPFLAGS+= -D"KBUILD_STR(s)=\#s" #-Q | 49 | CPPFLAGS+= -D"KBUILD_STR(s)=\#s" #-Q |
29 | 50 | ||
30 | include .config | ||
31 | # We need some generic definitions | 51 | # We need some generic definitions |
32 | include $(srctree)/scripts/Kbuild.include | 52 | include $(srctree)/scripts/Kbuild.include |
33 | 53 | ||
34 | include Makefile.flags | 54 | include Makefile.flags |
35 | 55 | ||
36 | SUBARCH := $(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/ ) | ||
40 | ARCH ?= $(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 |
44 | ifdef CONFIG_FEATURE_COMPRESS_USAGE | 57 | ifdef CONFIG_FEATURE_COMPRESS_USAGE |
45 | usage_stuff = include/usage_compressed.h | 58 | usage_stuff = include/usage_compressed.h |