956182489d4b2662b6b09078b4ff0264f00c5cd1
[openwrt.git] / target / linux / uml / patches / 005-fix_bash4_builds.patch
1 commit 67dac695a1f33716f3e35c2292e7391410d58751
2 Author: Paul Bolle <pebolle@tiscali.nl>
3 Date:   Sun Sep 6 14:36:01 2009 +0200
4
5     um: add work around for build problems with bash 4
6     
7     Building User Mode Linux fails with bash 4. The UML Makefiles use an
8     environment variable called CPPFLAGS_vmlinux.lds but bash 4 does not
9     export environment variables with a dot in their name. Add a hack to
10     allow building UML with bash 4 (which should not affect other shells).
11     
12     Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
13
14 diff --git a/arch/um/Makefile b/arch/um/Makefile
15 index 0728def..dc1ea7d 100644
16 --- a/arch/um/Makefile
17 +++ b/arch/um/Makefile
18 @@ -99,9 +99,6 @@ CFLAGS_NO_HARDENING := $(call cc-option, -fno-PIC,) $(call cc-option, -fno-pic,)
19  CONFIG_KERNEL_STACK_ORDER ?= 2
20  STACK_SIZE := $(shell echo $$[ 4096 * (1 << $(CONFIG_KERNEL_STACK_ORDER)) ] )
21  
22 -CPPFLAGS_vmlinux.lds = -U$(SUBARCH) -DSTART=$(START) -DELF_ARCH=$(ELF_ARCH) \
23 -       -DELF_FORMAT="$(ELF_FORMAT)" -DKERNEL_STACK_SIZE=$(STACK_SIZE)
24 -
25  # The wrappers will select whether using "malloc" or the kernel allocator.
26  LINK_WRAPS = -Wl,--wrap,malloc -Wl,--wrap,free -Wl,--wrap,calloc
27  
28 @@ -152,4 +149,5 @@ $(SHARED_HEADERS)/kern_constants.h:
29         $(Q)mkdir -p $(dir $@)
30         $(Q)echo '#include "../../../../include/asm/asm-offsets.h"' >$@
31  
32 -export SUBARCH USER_CFLAGS CFLAGS_NO_HARDENING OS HEADER_ARCH DEV_NULL_PATH
33 +export SUBARCH USER_CFLAGS CFLAGS_NO_HARDENING OS HEADER_ARCH DEV_NULL_PATH \
34 +       ELF_ARCH ELF_FORMAT STACK_SIZE START
35 diff --git a/arch/um/kernel/Makefile b/arch/um/kernel/Makefile
36 index 388ec0a..2907436 100644
37 --- a/arch/um/kernel/Makefile
38 +++ b/arch/um/kernel/Makefile
39 @@ -3,6 +3,10 @@
40  # Licensed under the GPL
41  #
42  
43 +CPPFLAGS_vmlinux.lds = -P -C -U$(ARCH) -U$(SUBARCH) -DSTART=$(START) \
44 +       -DELF_ARCH=$(ELF_ARCH) -DELF_FORMAT="$(ELF_FORMAT)" \
45 +       -DKERNEL_STACK_SIZE=$(STACK_SIZE)
46 +
47  extra-y := vmlinux.lds
48  clean-files :=
49