Skip to content

Commit 58ab5e0

Browse files
arndbMichal Marek
authored andcommitted
Kbuild: arch: look for generated headers in obtree
There are very few files that need add an -I$(obj) gcc for the preprocessor or the assembler. For C files, we add always these for both the objtree and srctree, but for the other ones we require the Makefile to add them, and Kbuild then adds it for both trees. As a preparation for changing the meaning of the -I$(obj) directive to only refer to the srctree, this changes the two instances in arch/x86 to use an explictit $(objtree) prefix where needed, otherwise we won't find the headers any more, as reported by the kbuild 0day builder. arch/x86/realmode/rm/realmode.lds.S:75:20: fatal error: pasyms.h: No such file or directory Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Michal Marek <mmarek@suse.com>
1 parent 3308b28 commit 58ab5e0

File tree

7 files changed

+9
-9
lines changed

7 files changed

+9
-9
lines changed

arch/alpha/boot/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ targets := vmlinux.gz vmlinux \
1515
OBJSTRIP := $(obj)/tools/objstrip
1616

1717
HOSTCFLAGS := -Wall -I$(objtree)/usr/include
18-
BOOTCFLAGS += -I$(obj) -I$(srctree)/$(obj)
18+
BOOTCFLAGS += -I$(objtree)/$(obj) -I$(srctree)/$(obj)
1919

2020
# SRM bootable image. Copy to offset 512 of a partition.
2121
$(obj)/bootimage: $(addprefix $(obj)/tools/,mkbb lxboot bootlx) $(obj)/vmlinux.nh

arch/powerpc/boot/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ ifeq ($(call cc-option-yn, -fstack-protector),y)
4343
BOOTCFLAGS += -fno-stack-protector
4444
endif
4545

46-
BOOTCFLAGS += -I$(obj) -I$(srctree)/$(obj)
46+
BOOTCFLAGS += -I$(objtree)/$(obj) -I$(srctree)/$(obj)
4747

4848
DTC_FLAGS ?= -p 1024
4949

arch/powerpc/kvm/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ common-objs-y += powerpc.o emulate.o emulate_loadstore.o
2020
obj-$(CONFIG_KVM_EXIT_TIMING) += timing.o
2121
obj-$(CONFIG_KVM_BOOK3S_HANDLER) += book3s_exports.o
2222

23-
AFLAGS_booke_interrupts.o := -I$(obj)
23+
AFLAGS_booke_interrupts.o := -I$(objtree)/$(obj)
2424

2525
kvm-e500-objs := \
2626
$(common-objs-y) \

arch/s390/boot/compressed/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ quiet_cmd_sizes = GEN $@
3131
$(obj)/sizes.h: vmlinux
3232
$(call if_changed,sizes)
3333

34-
AFLAGS_head.o += -I$(obj)
34+
AFLAGS_head.o += -I$(objtree)/$(obj)
3535
$(obj)/head.o: $(obj)/sizes.h
3636

37-
CFLAGS_misc.o += -I$(obj)
37+
CFLAGS_misc.o += -I$(objtree)/$(obj)
3838
$(obj)/misc.o: $(obj)/sizes.h
3939

4040
OBJCOPYFLAGS_vmlinux.bin := -R .comment -S

arch/um/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ include $(ARCH_DIR)/Makefile-os-$(OS)
7878

7979
KBUILD_CPPFLAGS += -I$(srctree)/$(HOST_DIR)/include \
8080
-I$(srctree)/$(HOST_DIR)/include/uapi \
81-
-I$(HOST_DIR)/include/generated \
82-
-I$(HOST_DIR)/include/generated/uapi
81+
-I$(objtree)/$(HOST_DIR)/include/generated \
82+
-I$(objtree)/$(HOST_DIR)/include/generated/uapi
8383

8484
# -Derrno=kernel_errno - This turns all kernel references to errno into
8585
# kernel_errno to separate them from the libc errno. This allows -fno-common

arch/x86/boot/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ $(obj)/zoffset.h: $(obj)/compressed/vmlinux FORCE
9696
$(call if_changed,zoffset)
9797

9898

99-
AFLAGS_header.o += -I$(obj)
99+
AFLAGS_header.o += -I$(objtree)/$(obj)
100100
$(obj)/header.o: $(obj)/zoffset.h
101101

102102
LDFLAGS_setup.elf := -T

arch/x86/realmode/rm/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ targets += realmode.lds
4848
$(obj)/realmode.lds: $(obj)/pasyms.h
4949

5050
LDFLAGS_realmode.elf := --emit-relocs -T
51-
CPPFLAGS_realmode.lds += -P -C -I$(obj)
51+
CPPFLAGS_realmode.lds += -P -C -I$(objtree)/$(obj)
5252

5353
targets += realmode.elf
5454
$(obj)/realmode.elf: $(obj)/realmode.lds $(REALMODE_OBJS) FORCE

0 commit comments

Comments
 (0)