Fedora kernel-2.6.17-1.2142_FC4 patched with stable patch-2.6.17.4-vs2.0.2-rc26.diff
[linux-2.6.git] / arch / um / Makefile-i386
index 3bd90fb..b65ca11 100644 (file)
@@ -1,37 +1,41 @@
-ifeq ($(CONFIG_HOST_2G_2G), y)
-TOP_ADDR = 0x80000000
-else
-TOP_ADDR = 0xc0000000
-endif
-
-CFLAGS += -U__$(SUBARCH)__ -U$(SUBARCH)
-ELF_ARCH = $(SUBARCH)
-ELF_FORMAT = elf32-$(SUBARCH)
+core-y += arch/um/sys-i386/ arch/i386/crypto/
 
-OBJCOPYFLAGS  := -O binary -R .note -R .comment -S
-LDFLAGS_BLOB   := --format binary --oformat elf32-i386
+TOP_ADDR := $(CONFIG_TOP_ADDR)
 
-SYS_DIR                := $(ARCH_DIR)/include/sysdep-i386
-SYS_UTIL_DIR   := $(ARCH_DIR)/sys-i386/util
+ifeq ($(CONFIG_MODE_SKAS),y)
+  ifneq ($(CONFIG_MODE_TT),y)
+     START := 0x8048000
+  endif
+endif
 
-SYS_HEADERS = $(SYS_DIR)/sc.h $(SYS_DIR)/thread.h
+LDFLAGS                        += -m elf_i386
+ELF_ARCH               := $(SUBARCH)
+ELF_FORMAT             := elf32-$(SUBARCH)
+OBJCOPYFLAGS           := -O binary -R .note -R .comment -S
 
-prepare: $(SYS_HEADERS)
+ifeq ("$(origin SUBARCH)", "command line")
+ifneq ("$(shell uname -m | sed -e s/i.86/i386/)", "$(SUBARCH)")
+CFLAGS                 += $(call cc-option,-m32)
+USER_CFLAGS            += $(call cc-option,-m32)
+AFLAGS                 += $(call cc-option,-m32)
+LINK-y                 += $(call cc-option,-m32)
+UML_OBJCOPYFLAGS       += -F $(ELF_FORMAT)
 
-$(SYS_DIR)/sc.h: $(SYS_UTIL_DIR)/mk_sc
-       $< > $@
+export LDFLAGS HOSTCFLAGS HOSTLDFLAGS UML_OBJCOPYFLAGS
+endif
+endif
 
-$(SYS_DIR)/thread.h: $(SYS_UTIL_DIR)/mk_thread 
-       $< > $@
+CFLAGS += -U__$(SUBARCH)__ -U$(SUBARCH)
 
-$(SYS_UTIL_DIR)/mk_sc: FORCE ; 
-       @$(call descend,$(SYS_UTIL_DIR),$@)
+# First of all, tune CFLAGS for the specific CPU. This actually sets cflags-y.
+include $(srctree)/arch/i386/Makefile.cpu
 
-$(SYS_UTIL_DIR)/mk_thread: $(ARCH_SYMLINKS) $(GEN_HEADERS) FORCE ; 
-       @$(call descend,$(SYS_UTIL_DIR),$@)
+# prevent gcc from keeping the stack 16 byte aligned. Taken from i386.
+cflags-y += $(call cc-option,-mpreferred-stack-boundary=2)
 
-$(SYS_UTIL_DIR): include/asm FORCE
-       @$(call descend,$@,)
+# Prevent sprintf in nfsd from being converted to strcpy and resulting in
+# an unresolved reference.
+cflags-y += -ffreestanding
 
-sysclean :
-       rm -f $(SYS_HEADERS)
+CFLAGS += $(cflags-y)
+USER_CFLAGS += $(cflags-y)