[PATCH] uml: fix compilation options for USER_OBJS

From: Jeff Dike <jdike@addtoit.com>, Paolo Giarrusso <blaisorblade@yahoo.it>

Make sure that when compiling USER_OBJS the correct compilation options are
passed; since they are compiled with USER_CFLAGS which is derived from
CFLAGS, make sure it is a recursively evaluated variable, so that changes
to CFLAGS done afterwards the inclusion of arch/$(ARCH)/Makefile are
reflected in USER_CFLAGS.

For instance, without this patch userspace objects are never compiled with
debug info active.

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>

authored by akpm@osdl.org and committed by Linus Torvalds d45e44d4 b428b51e

+14 -15
+11 -10
arch/um/Makefile
··· 64 64 65 65 AFLAGS += $(ARCH_INCLUDE) 66 66 67 - USER_CFLAGS := $(patsubst -I%,,$(CFLAGS)) 68 - USER_CFLAGS := $(patsubst -D__KERNEL__,,$(USER_CFLAGS)) $(ARCH_INCLUDE) \ 69 - $(MODE_INCLUDE) -D_FILE_OFFSET_BITS=64 67 + USER_CFLAGS = $(patsubst $(KERNEL_DEFINES),,$(patsubst -D__KERNEL__,,\ 68 + $(patsubst -I%,,$(CFLAGS)))) $(ARCH_INCLUDE) $(MODE_INCLUDE) \ 69 + -D_FILE_OFFSET_BITS=64 70 + 71 + include $(srctree)/$(ARCH_DIR)/Makefile-$(SUBARCH) 72 + 73 + #This will adjust *FLAGS accordingly to the platform. 74 + include $(srctree)/$(ARCH_DIR)/Makefile-os-$(OS) 70 75 71 76 # -Derrno=kernel_errno - This turns all kernel references to errno into 72 77 # kernel_errno to separate them from the libc errno. This allows -fno-common ··· 79 74 # errnos. 80 75 # These apply to kernelspace only. 81 76 82 - CFLAGS += -Derrno=kernel_errno -Dsigprocmask=kernel_sigprocmask \ 83 - -Dmktime=kernel_mktime 77 + KERNEL_DEFINES = -Derrno=kernel_errno -Dsigprocmask=kernel_sigprocmask \ 78 + -Dmktime=kernel_mktime $(ARCH_KERNEL_DEFINES) 79 + CFLAGS += $(KERNEL_DEFINES) 84 80 CFLAGS += $(call cc-option,-fno-unit-at-a-time,) 85 - 86 - include $(srctree)/$(ARCH_DIR)/Makefile-$(SUBARCH) 87 - 88 - #This will adjust *FLAGS accordingly to the platform. 89 - include $(srctree)/$(ARCH_DIR)/Makefile-os-$(OS) 90 81 91 82 # These are needed for clean and mrproper, since in that case .config is not 92 83 # included; the values here are meaningless
+1 -3
arch/um/Makefile-i386
··· 16 16 ifeq ("$(origin SUBARCH)", "command line") 17 17 ifneq ("$(shell uname -m | sed -e s/i.86/i386/)", "$(SUBARCH)") 18 18 CFLAGS += $(call cc-option,-m32) 19 - USER_CFLAGS += $(call cc-option,-m32) 20 19 AFLAGS += $(call cc-option,-m32) 21 20 LINK-y += $(call cc-option,-m32) 22 21 UML_OBJCOPYFLAGS += -F $(ELF_FORMAT) ··· 24 25 endif 25 26 endif 26 27 27 - CFLAGS += -U__$(SUBARCH)__ -U$(SUBARCH) 28 + ARCH_KERNEL_DEFINES += -U__$(SUBARCH)__ -U$(SUBARCH) 28 29 29 30 # First of all, tune CFLAGS for the specific CPU. This actually sets cflags-y. 30 31 include $(srctree)/arch/i386/Makefile.cpu ··· 37 38 cflags-y += -ffreestanding 38 39 39 40 CFLAGS += $(cflags-y) 40 - USER_CFLAGS += $(cflags-y)
+2 -2
arch/um/Makefile-x86_64
··· 8 8 9 9 #We #undef __x86_64__ for kernelspace, not for userspace where 10 10 #it's needed for headers to work! 11 - CFLAGS += -U__$(SUBARCH)__ $(_extra_flags_) 12 - USER_CFLAGS += $(_extra_flags_) 11 + ARCH_KERNEL_DEFINES = -U__$(SUBARCH)__ 12 + CFLAGS += $(_extra_flags_) 13 13 14 14 CHECKFLAGS += -m64 15 15 AFLAGS += -m64