aboutsummaryrefslogtreecommitdiffstats
path: root/arch/um/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'arch/um/Makefile')
-rw-r--r--arch/um/Makefile30
1 files changed, 16 insertions, 14 deletions
diff --git a/arch/um/Makefile b/arch/um/Makefile
index 4a375bbac109..eb4ac403bd93 100644
--- a/arch/um/Makefile
+++ b/arch/um/Makefile
@@ -51,25 +51,26 @@ 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) 54# -Dvmap=kernel_vmap affects everything, and prevents anything from
55# referencing the libpcap.o symbol so named.
56
57CFLAGS += $(CFLAGS-y) -D__arch_um__ -DSUBARCH=\"$(SUBARCH)\" \
58 $(ARCH_INCLUDE) $(MODE_INCLUDE) -Dvmap=kernel_vmap
55 59
56core-y += $(SUBARCH_CORE) 60USER_CFLAGS := $(patsubst -I%,,$(CFLAGS))
57libs-y += $(SUBARCH_LIBS) 61USER_CFLAGS := $(patsubst -D__KERNEL__,,$(USER_CFLAGS)) $(ARCH_INCLUDE) \
62 $(MODE_INCLUDE)
58 63
59# -Derrno=kernel_errno - This turns all kernel references to errno into 64# -Derrno=kernel_errno - This turns all kernel references to errno into
60# 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
61# in CFLAGS. Otherwise, it would cause ld to complain about the two different 66# in CFLAGS. Otherwise, it would cause ld to complain about the two different
62# errnos. 67# errnos.
63 68
64CFLAGS += $(CFLAGS-y) -D__arch_um__ -DSUBARCH=\"$(SUBARCH)\" \
65 $(ARCH_INCLUDE) $(MODE_INCLUDE)
66
67USER_CFLAGS := $(patsubst -I%,,$(CFLAGS))
68USER_CFLAGS := $(patsubst -D__KERNEL__,,$(USER_CFLAGS)) $(ARCH_INCLUDE) \
69 $(MODE_INCLUDE) $(ARCH_USER_CFLAGS)
70CFLAGS += -Derrno=kernel_errno -Dsigprocmask=kernel_sigprocmask 69CFLAGS += -Derrno=kernel_errno -Dsigprocmask=kernel_sigprocmask
71CFLAGS += $(call cc-option,-fno-unit-at-a-time,) 70CFLAGS += $(call cc-option,-fno-unit-at-a-time,)
72 71
72include $(srctree)/$(ARCH_DIR)/Makefile-$(SUBARCH)
73
73#This will adjust *FLAGS accordingly to the platform. 74#This will adjust *FLAGS accordingly to the platform.
74include $(srctree)/$(ARCH_DIR)/Makefile-os-$(OS) 75include $(srctree)/$(ARCH_DIR)/Makefile-os-$(OS)
75 76
@@ -116,18 +117,19 @@ CONFIG_KERNEL_STACK_ORDER ?= 2
116STACK_SIZE := $(shell echo $$[ 4096 * (1 << $(CONFIG_KERNEL_STACK_ORDER)) ] ) 117STACK_SIZE := $(shell echo $$[ 4096 * (1 << $(CONFIG_KERNEL_STACK_ORDER)) ] )
117 118
118ifndef START 119ifndef START
119 START = $$(($(TOP_ADDR) - $(SIZE))) 120 START = $(shell echo $$[ $(TOP_ADDR) - $(SIZE) ] )
120endif 121endif
121 122
122CPPFLAGS_vmlinux.lds = $(shell echo -U$(SUBARCH) \ 123CPPFLAGS_vmlinux.lds = -U$(SUBARCH) \
123 -DSTART=$(START) -DELF_ARCH=$(ELF_ARCH) \ 124 -DSTART=$(START) -DELF_ARCH=$(ELF_ARCH) \
124 -DELF_FORMAT=\"$(ELF_FORMAT)\" $(CPP_MODE-y) \ 125 -DELF_FORMAT="$(ELF_FORMAT)" $(CPP_MODE-y) \
125 -DKERNEL_STACK_SIZE=$(STACK_SIZE) -DSUBARCH=$(SUBARCH)) 126 -DKERNEL_STACK_SIZE=$(STACK_SIZE) \
127 -DUNMAP_PATH=arch/um/sys-$(SUBARCH)/unmap_fin.o
126 128
127#The wrappers will select whether using "malloc" or the kernel allocator. 129#The wrappers will select whether using "malloc" or the kernel allocator.
128LINK_WRAPS = -Wl,--wrap,malloc -Wl,--wrap,free -Wl,--wrap,calloc 130LINK_WRAPS = -Wl,--wrap,malloc -Wl,--wrap,free -Wl,--wrap,calloc
129 131
130CFLAGS_vmlinux = $(LINK-y) $(LINK_WRAPS) 132CFLAGS_vmlinux := $(LINK-y) $(LINK_WRAPS)
131define cmd_vmlinux__ 133define cmd_vmlinux__
132 $(CC) $(CFLAGS_vmlinux) -o $@ \ 134 $(CC) $(CFLAGS_vmlinux) -o $@ \
133 -Wl,-T,$(vmlinux-lds) $(vmlinux-init) \ 135 -Wl,-T,$(vmlinux-lds) $(vmlinux-init) \