aboutsummaryrefslogtreecommitdiffstats
path: root/arch/um/Makefile
diff options
context:
space:
mode:
authorPaolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>2005-07-14 03:33:43 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2005-07-14 12:00:25 -0400
commit20d0021394c1b070bf04b22c5bc8fdb437edd4c5 (patch)
tree283d0cd3bfdaec49ed2b29d568f5ceca5e3f1d2a /arch/um/Makefile
parentecc354a90af90a80dcaccc750f5f3e5e7c83112d (diff)
[PATCH] uml: allow building as 32-bit binary on 64bit host
This patch makes the command: make ARCH=um SUBARCH=i386 work on x86_64 hosts (with support for building 32-bit binaries). This is especially needed since 64-bit UMLs don't support 32-bit emulation for guest binaries, currently. This has been tested in all possible cases and works. Only exception is that I've built but not tested a 64-bit binary, because I hadn't a 64-bit filesystem available. Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> Cc: Jeff Dike <jdike@addtoit.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/um/Makefile')
-rw-r--r--arch/um/Makefile11
1 files changed, 4 insertions, 7 deletions
diff --git a/arch/um/Makefile b/arch/um/Makefile
index 6a7a9f43cdef..eb4ac403bd93 100644
--- a/arch/um/Makefile
+++ b/arch/um/Makefile
@@ -51,11 +51,6 @@ MRPROPER_DIRS += $(ARCH_DIR)/include2
51endif 51endif
52SYS_DIR := $(ARCH_DIR)/include/sysdep-$(SUBARCH) 52SYS_DIR := $(ARCH_DIR)/include/sysdep-$(SUBARCH)
53 53
54include $(srctree)/$(ARCH_DIR)/Makefile-$(SUBARCH)
55
56core-y += $(SUBARCH_CORE)
57libs-y += $(SUBARCH_LIBS)
58
59# -Dvmap=kernel_vmap affects everything, and prevents anything from 54# -Dvmap=kernel_vmap affects everything, and prevents anything from
60# referencing the libpcap.o symbol so named. 55# referencing the libpcap.o symbol so named.
61 56
@@ -64,7 +59,7 @@ CFLAGS += $(CFLAGS-y) -D__arch_um__ -DSUBARCH=\"$(SUBARCH)\" \
64 59
65USER_CFLAGS := $(patsubst -I%,,$(CFLAGS)) 60USER_CFLAGS := $(patsubst -I%,,$(CFLAGS))
66USER_CFLAGS := $(patsubst -D__KERNEL__,,$(USER_CFLAGS)) $(ARCH_INCLUDE) \ 61USER_CFLAGS := $(patsubst -D__KERNEL__,,$(USER_CFLAGS)) $(ARCH_INCLUDE) \
67 $(MODE_INCLUDE) $(ARCH_USER_CFLAGS) 62 $(MODE_INCLUDE)
68 63
69# -Derrno=kernel_errno - This turns all kernel references to errno into 64# -Derrno=kernel_errno - This turns all kernel references to errno into
70# kernel_errno to separate them from the libc errno. This allows -fno-common 65# kernel_errno to separate them from the libc errno. This allows -fno-common
@@ -74,6 +69,8 @@ USER_CFLAGS := $(patsubst -D__KERNEL__,,$(USER_CFLAGS)) $(ARCH_INCLUDE) \
74CFLAGS += -Derrno=kernel_errno -Dsigprocmask=kernel_sigprocmask 69CFLAGS += -Derrno=kernel_errno -Dsigprocmask=kernel_sigprocmask
75CFLAGS += $(call cc-option,-fno-unit-at-a-time,) 70CFLAGS += $(call cc-option,-fno-unit-at-a-time,)
76 71
72include $(srctree)/$(ARCH_DIR)/Makefile-$(SUBARCH)
73
77#This will adjust *FLAGS accordingly to the platform. 74#This will adjust *FLAGS accordingly to the platform.
78include $(srctree)/$(ARCH_DIR)/Makefile-os-$(OS) 75include $(srctree)/$(ARCH_DIR)/Makefile-os-$(OS)
79 76
@@ -132,7 +129,7 @@ CPPFLAGS_vmlinux.lds = -U$(SUBARCH) \
132#The wrappers will select whether using "malloc" or the kernel allocator. 129#The wrappers will select whether using "malloc" or the kernel allocator.
133LINK_WRAPS = -Wl,--wrap,malloc -Wl,--wrap,free -Wl,--wrap,calloc 130LINK_WRAPS = -Wl,--wrap,malloc -Wl,--wrap,free -Wl,--wrap,calloc
134 131
135CFLAGS_vmlinux = $(LINK-y) $(LINK_WRAPS) 132CFLAGS_vmlinux := $(LINK-y) $(LINK_WRAPS)
136define cmd_vmlinux__ 133define cmd_vmlinux__
137 $(CC) $(CFLAGS_vmlinux) -o $@ \ 134 $(CC) $(CFLAGS_vmlinux) -o $@ \
138 -Wl,-T,$(vmlinux-lds) $(vmlinux-init) \ 135 -Wl,-T,$(vmlinux-lds) $(vmlinux-init) \