--- ./arch/um/kernel/Makefile.user_obj 2003-12-02 17:20:43.000000000 +0100 +++ ./arch/um/kernel/Makefile 2003-12-17 18:42:37.000000000 +0100 @@ -26,7 +26,8 @@ user-objs-$(CONFIG_TTY_LOG) += tty_log.o USER_OBJS := $(filter %_user.o,$(obj-y)) $(user-objs-y) config.o helper.o \ - process.o tempfile.o time.o tty_log.o umid.o user_util.o user_syms.o + process.o tempfile.o time.o tty_log.o umid.o user_util.o user_syms.o \ + frame.o USER_OBJS := $(foreach file,$(USER_OBJS),$(obj)/$(file)) DMODULES-$(CONFIG_MODULES) = -D__CONFIG_MODULES__ @@ -36,16 +37,16 @@ CFLAGS_user_syms.o = -D__AUTOCONF_INCLUDED__ $(DMODULES-y) $(DMODVERSIONS-y) \ -I/usr/include -I../include -CFLAGS_frame.o := $(patsubst -fomit-frame-pointer,,$(USER_CFLAGS)) +CFLAGS_frame.o := $(patsubst -fomit-frame-pointer,,$(USER_CFLAGS)) -fno-omit-frame-pointer $(USER_OBJS) : %.o: %.c $(CC) $(CFLAGS_$(notdir $@)) $(USER_CFLAGS) -c -o $@ $< -# This has to be separate because it needs be compiled with frame pointers -# regardless of how the rest of the kernel is built. - -$(obj)/frame.o: $(src)/frame.c - $(CC) $(CFLAGS_$(notdir $@)) -c -o $@ $< +## This has to be separate because it needs be compiled with frame pointers +## regardless of how the rest of the kernel is built. +# +#$(obj)/frame.o: $(src)/frame.c +# $(CC) $(CFLAGS_$(notdir $@)) -c -o $@ $< QUOTE = 'my $$config=`cat $(TOPDIR)/.config`; $$config =~ s/"/\\"/g ; $$config =~ s/\n/\\n"\n"/g ; while() { $$_ =~ s/CONFIG/$$config/; print $$_ }' --- ./arch/um/Makefile.user_obj 2003-12-13 18:36:36.000000000 +0100 +++ ./arch/um/Makefile 2003-12-17 18:46:34.000000000 +0100 @@ -129,6 +129,17 @@ USER_CFLAGS := $(patsubst -D__KERNEL__,,$(USER_CFLAGS)) $(ARCH_INCLUDE) \ $(MODE_INCLUDE) +USER_SINGLE_OBJS = $(foreach f,$(patsubst %.o,%,$(obj-y) \ $(obj-m)),$($(f)-objs)) +user-objs = $(filter %_user.o,$(obj-y) $(obj-m) $(USER_SINGLE_OBJS)) + +#define __set_user_cflag +# $(1)_cflags = $$(USER_CFLAGS) +#endef +# +#define set_user_cflags +# $(foreach f, $(user-objs), $(eval $(call __set_user_cflag, $(f)))) +#endef + # To get a definition of F_SETSIG USER_CFLAGS += -D_GNU_SOURCE --- ./scripts/Makefile.lib.user_obj 2003-10-01 21:25:17.000000000 +0200 +++ ./scripts/Makefile.lib 2003-12-17 18:33:19.000000000 +0100 @@ -136,8 +136,12 @@ basename_flags = -DKBUILD_BASENAME=$(subst $(comma),_,$(subst -,_,$(*F))) modname_flags = $(if $(filter 1,$(words $(modname))),-DKBUILD_MODNAME=$(subst $(comma),_,$(subst -,_,$(modname)))) +#For UML +is_user_obj = $(find $(@F),$(user-objs)) + +_c_flags = $(if $(is_user_obj),$(USER_CFLAGS),$(CFLAGS) $(EXTRA_CFLAGS)) \ + $(CFLAGS_$(*F).o) -_c_flags = $(CFLAGS) $(EXTRA_CFLAGS) $(CFLAGS_$(*F).o) _a_flags = $(AFLAGS) $(EXTRA_AFLAGS) $(AFLAGS_$(*F).o) _hostc_flags = $(HOSTCFLAGS) $(HOST_EXTRACFLAGS) $(HOSTCFLAGS_$(*F).o) _hostcxx_flags = $(HOSTCXXFLAGS) $(HOST_EXTRACXXFLAGS) $(HOSTCXXFLAGS_$(*F).o) @@ -165,10 +169,12 @@ __hostcxx_flags = $(call flags,_hostcxx_flags) endif -c_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(CPPFLAGS) \ +kernelized_c_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(CPPFLAGS) \ $(__c_flags) $(modkern_cflags) \ $(basename_flags) $(modname_flags) +c_flags = $(if $(is_user_obj), __c_flags, kernelized_c_flags) + a_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(CPPFLAGS) \ $(__a_flags) $(modkern_aflags)