Skip to content

Commit 7bbe720

Browse files
Al Virorichardweinberger
authored andcommitted
um: merge Makefile-{i386,x86_64}
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Richard Weinberger <richard@nod.at>
1 parent a6e77d6 commit 7bbe720

3 files changed

Lines changed: 35 additions & 28 deletions

File tree

‎arch/um/Makefile‎

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,18 @@ core-y += $(ARCH_DIR)/kernel/ \
2020

2121
MODE_INCLUDE += -I$(srctree)/$(ARCH_DIR)/include/shared/skas
2222

23+
HEADER_ARCH := $(SUBARCH)
24+
25+
# Additional ARCH settings for x86
26+
ifeq ($(SUBARCH),i386)
27+
HEADER_ARCH := x86
28+
endif
29+
ifeq ($(SUBARCH),x86_64)
30+
HEADER_ARCH := x86
31+
endif
32+
2333
include $(srctree)/$(ARCH_DIR)/Makefile-skas
24-
include $(srctree)/$(ARCH_DIR)/Makefile-$(SUBARCH)
34+
include $(srctree)/$(ARCH_DIR)/Makefile-$(HEADER_ARCH)
2535

2636
SHARED_HEADERS := $(ARCH_DIR)/include/shared
2737
ARCH_INCLUDE := -I$(srctree)/$(SHARED_HEADERS)
Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
core-y += arch/um/sys-x86/ arch/x86/crypto/
22

3+
ifeq ($(CONFIG_X86_32),y)
34
START := 0x8048000
45

56
LDFLAGS += -m elf_i386
67
ELF_ARCH := i386
78
ELF_FORMAT := elf32-i386
8-
HEADER_ARCH := x86
99
CHECKFLAGS += -D__i386__
1010

1111
ifeq ("$(origin SUBARCH)", "command line")
@@ -36,3 +36,26 @@ KBUILD_CFLAGS += $(shell if [ $(call cc-version) -lt 0400 ] ; then \
3636
else echo $(call cc-option,-funit-at-a-time); fi ;)
3737

3838
KBUILD_CFLAGS += $(cflags-y)
39+
40+
else
41+
42+
START := 0x60000000
43+
44+
KBUILD_CFLAGS += -fno-builtin -m64
45+
46+
CHECKFLAGS += -m64 -D__x86_64__
47+
KBUILD_AFLAGS += -m64
48+
LDFLAGS += -m elf_x86_64
49+
KBUILD_CPPFLAGS += -m64
50+
51+
ELF_ARCH := i386:x86-64
52+
ELF_FORMAT := elf64-x86-64
53+
54+
# Not on all 64-bit distros /lib is a symlink to /lib64. PLD is an example.
55+
56+
LINK-$(CONFIG_LD_SCRIPT_DYN) += -Wl,-rpath,/lib64
57+
LINK-y += -m64
58+
59+
# Do unit-at-a-time unconditionally on x86_64, following the host
60+
KBUILD_CFLAGS += $(call cc-option,-funit-at-a-time)
61+
endif

‎arch/um/Makefile-x86_64‎

Lines changed: 0 additions & 26 deletions
This file was deleted.

0 commit comments

Comments
 (0)