Skip to content

Commit 6752ed9

Browse files
committed
Kbuild: allow arch/xxx to use a different source path
Preparatory patch for the source merge of arch/i386 and arch/x86_64 into arch/x86. This allows to keep the original arch directories as stubs for the main Makefiles, Kconfigs et. al during the transition phase while having the code in the new arch/x86 directory. Signed-off-by: Thomas Gleixner <[email protected]>
1 parent d7394fe commit 6752ed9

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

Kbuild

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ offsets-file := include/asm-$(ARCH)/asm-offsets.h
1212

1313
always := $(offsets-file)
1414
targets := $(offsets-file)
15-
targets += arch/$(ARCH)/kernel/asm-offsets.s
15+
targets += arch/$(SRCARCH)/kernel/asm-offsets.s
1616
clean-files := $(addprefix $(objtree)/,$(targets))
1717

1818
# Default sed regexp - multiline due to syntax constraints
@@ -40,11 +40,11 @@ define cmd_offsets
4040
endef
4141

4242
# We use internal kbuild rules to avoid the "is up to date" message from make
43-
arch/$(ARCH)/kernel/asm-offsets.s: arch/$(ARCH)/kernel/asm-offsets.c FORCE
43+
arch/$(SRCARCH)/kernel/asm-offsets.s: arch/$(SRCARCH)/kernel/asm-offsets.c FORCE
4444
$(Q)mkdir -p $(dir $@)
4545
$(call if_changed_dep,cc_s_c)
4646

47-
$(obj)/$(offsets-file): arch/$(ARCH)/kernel/asm-offsets.s Kbuild
47+
$(obj)/$(offsets-file): arch/$(SRCARCH)/kernel/asm-offsets.s Kbuild
4848
$(Q)mkdir -p $(dir $@)
4949
$(call cmd,offsets)
5050

Makefile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,8 @@ ARCH ?= $(SUBARCH)
186186
CROSS_COMPILE ?=
187187

188188
# Architecture as present in compile.h
189-
UTS_MACHINE := $(ARCH)
189+
UTS_MACHINE := $(ARCH)
190+
SRCARCH := $(ARCH)
190191

191192
KCONFIG_CONFIG ?= .config
192193

@@ -322,7 +323,7 @@ KERNELRELEASE = $(shell cat include/config/kernel.release 2> /dev/null)
322323
KERNELVERSION = $(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
323324

324325
export VERSION PATCHLEVEL SUBLEVEL KERNELRELEASE KERNELVERSION
325-
export ARCH CONFIG_SHELL HOSTCC HOSTCFLAGS CROSS_COMPILE AS LD CC
326+
export ARCH SRCARCH CONFIG_SHELL HOSTCC HOSTCFLAGS CROSS_COMPILE AS LD CC
326327
export CPP AR NM STRIP OBJCOPY OBJDUMP MAKE AWK GENKSYMS PERL UTS_MACHINE
327328
export HOSTCXX HOSTCXXFLAGS LDFLAGS_MODULE CHECK CHECKFLAGS
328329

@@ -609,7 +610,7 @@ libs-y := $(libs-y1) $(libs-y2)
609610
vmlinux-init := $(head-y) $(init-y)
610611
vmlinux-main := $(core-y) $(libs-y) $(drivers-y) $(net-y)
611612
vmlinux-all := $(vmlinux-init) $(vmlinux-main)
612-
vmlinux-lds := arch/$(ARCH)/kernel/vmlinux.lds
613+
vmlinux-lds := arch/$(SRCARCH)/kernel/vmlinux.lds
613614
export KBUILD_VMLINUX_OBJS := $(vmlinux-all)
614615

615616
# Rule to link vmlinux - also used during CONFIG_KALLSYMS

0 commit comments

Comments
 (0)