diff options
Diffstat (limited to 'arch/um/Makefile')
-rw-r--r-- | arch/um/Makefile | 30 |
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 | |||
51 | endif | 51 | endif |
52 | SYS_DIR := $(ARCH_DIR)/include/sysdep-$(SUBARCH) | 52 | SYS_DIR := $(ARCH_DIR)/include/sysdep-$(SUBARCH) |
53 | 53 | ||
54 | include $(srctree)/$(ARCH_DIR)/Makefile-$(SUBARCH) | 54 | # -Dvmap=kernel_vmap affects everything, and prevents anything from |
55 | # referencing the libpcap.o symbol so named. | ||
56 | |||
57 | CFLAGS += $(CFLAGS-y) -D__arch_um__ -DSUBARCH=\"$(SUBARCH)\" \ | ||
58 | $(ARCH_INCLUDE) $(MODE_INCLUDE) -Dvmap=kernel_vmap | ||
55 | 59 | ||
56 | core-y += $(SUBARCH_CORE) | 60 | USER_CFLAGS := $(patsubst -I%,,$(CFLAGS)) |
57 | libs-y += $(SUBARCH_LIBS) | 61 | USER_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 | ||
64 | CFLAGS += $(CFLAGS-y) -D__arch_um__ -DSUBARCH=\"$(SUBARCH)\" \ | ||
65 | $(ARCH_INCLUDE) $(MODE_INCLUDE) | ||
66 | |||
67 | USER_CFLAGS := $(patsubst -I%,,$(CFLAGS)) | ||
68 | USER_CFLAGS := $(patsubst -D__KERNEL__,,$(USER_CFLAGS)) $(ARCH_INCLUDE) \ | ||
69 | $(MODE_INCLUDE) $(ARCH_USER_CFLAGS) | ||
70 | CFLAGS += -Derrno=kernel_errno -Dsigprocmask=kernel_sigprocmask | 69 | CFLAGS += -Derrno=kernel_errno -Dsigprocmask=kernel_sigprocmask |
71 | CFLAGS += $(call cc-option,-fno-unit-at-a-time,) | 70 | CFLAGS += $(call cc-option,-fno-unit-at-a-time,) |
72 | 71 | ||
72 | include $(srctree)/$(ARCH_DIR)/Makefile-$(SUBARCH) | ||
73 | |||
73 | #This will adjust *FLAGS accordingly to the platform. | 74 | #This will adjust *FLAGS accordingly to the platform. |
74 | include $(srctree)/$(ARCH_DIR)/Makefile-os-$(OS) | 75 | include $(srctree)/$(ARCH_DIR)/Makefile-os-$(OS) |
75 | 76 | ||
@@ -116,18 +117,19 @@ CONFIG_KERNEL_STACK_ORDER ?= 2 | |||
116 | STACK_SIZE := $(shell echo $$[ 4096 * (1 << $(CONFIG_KERNEL_STACK_ORDER)) ] ) | 117 | STACK_SIZE := $(shell echo $$[ 4096 * (1 << $(CONFIG_KERNEL_STACK_ORDER)) ] ) |
117 | 118 | ||
118 | ifndef START | 119 | ifndef START |
119 | START = $$(($(TOP_ADDR) - $(SIZE))) | 120 | START = $(shell echo $$[ $(TOP_ADDR) - $(SIZE) ] ) |
120 | endif | 121 | endif |
121 | 122 | ||
122 | CPPFLAGS_vmlinux.lds = $(shell echo -U$(SUBARCH) \ | 123 | CPPFLAGS_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. |
128 | LINK_WRAPS = -Wl,--wrap,malloc -Wl,--wrap,free -Wl,--wrap,calloc | 130 | LINK_WRAPS = -Wl,--wrap,malloc -Wl,--wrap,free -Wl,--wrap,calloc |
129 | 131 | ||
130 | CFLAGS_vmlinux = $(LINK-y) $(LINK_WRAPS) | 132 | CFLAGS_vmlinux := $(LINK-y) $(LINK_WRAPS) |
131 | define cmd_vmlinux__ | 133 | define 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) \ |