Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Arnd Bergmann and committed by
Michal Marek
58ab5e0c 3308b285

+9 -9
+1 -1
arch/alpha/boot/Makefile
··· 15 15 OBJSTRIP := $(obj)/tools/objstrip 16 16 17 17 HOSTCFLAGS := -Wall -I$(objtree)/usr/include 18 - BOOTCFLAGS += -I$(obj) -I$(srctree)/$(obj) 18 + BOOTCFLAGS += -I$(objtree)/$(obj) -I$(srctree)/$(obj) 19 19 20 20 # SRM bootable image. Copy to offset 512 of a partition. 21 21 $(obj)/bootimage: $(addprefix $(obj)/tools/,mkbb lxboot bootlx) $(obj)/vmlinux.nh
+1 -1
arch/powerpc/boot/Makefile
··· 43 43 BOOTCFLAGS += -fno-stack-protector 44 44 endif 45 45 46 - BOOTCFLAGS += -I$(obj) -I$(srctree)/$(obj) 46 + BOOTCFLAGS += -I$(objtree)/$(obj) -I$(srctree)/$(obj) 47 47 48 48 DTC_FLAGS ?= -p 1024 49 49
+1 -1
arch/powerpc/kvm/Makefile
··· 20 20 obj-$(CONFIG_KVM_EXIT_TIMING) += timing.o 21 21 obj-$(CONFIG_KVM_BOOK3S_HANDLER) += book3s_exports.o 22 22 23 - AFLAGS_booke_interrupts.o := -I$(obj) 23 + AFLAGS_booke_interrupts.o := -I$(objtree)/$(obj) 24 24 25 25 kvm-e500-objs := \ 26 26 $(common-objs-y) \
+2 -2
arch/s390/boot/compressed/Makefile
··· 31 31 $(obj)/sizes.h: vmlinux 32 32 $(call if_changed,sizes) 33 33 34 - AFLAGS_head.o += -I$(obj) 34 + AFLAGS_head.o += -I$(objtree)/$(obj) 35 35 $(obj)/head.o: $(obj)/sizes.h 36 36 37 - CFLAGS_misc.o += -I$(obj) 37 + CFLAGS_misc.o += -I$(objtree)/$(obj) 38 38 $(obj)/misc.o: $(obj)/sizes.h 39 39 40 40 OBJCOPYFLAGS_vmlinux.bin := -R .comment -S
+2 -2
arch/um/Makefile
··· 78 78 79 79 KBUILD_CPPFLAGS += -I$(srctree)/$(HOST_DIR)/include \ 80 80 -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 83 83 84 84 # -Derrno=kernel_errno - This turns all kernel references to errno into 85 85 # kernel_errno to separate them from the libc errno. This allows -fno-common
+1 -1
arch/x86/boot/Makefile
··· 96 96 $(call if_changed,zoffset) 97 97 98 98 99 - AFLAGS_header.o += -I$(obj) 99 + AFLAGS_header.o += -I$(objtree)/$(obj) 100 100 $(obj)/header.o: $(obj)/zoffset.h 101 101 102 102 LDFLAGS_setup.elf := -T
+1 -1
arch/x86/realmode/rm/Makefile
··· 48 48 $(obj)/realmode.lds: $(obj)/pasyms.h 49 49 50 50 LDFLAGS_realmode.elf := --emit-relocs -T 51 - CPPFLAGS_realmode.lds += -P -C -I$(obj) 51 + CPPFLAGS_realmode.lds += -P -C -I$(objtree)/$(obj) 52 52 53 53 targets += realmode.elf 54 54 $(obj)/realmode.elf: $(obj)/realmode.lds $(REALMODE_OBJS) FORCE