Kbuild: arch: look for generated headers in obtree
authorArnd Bergmann <arnd@arndb.de>
Wed, 15 Jun 2016 15:45:46 +0000 (17:45 +0200)
committerMichal Marek <mmarek@suse.com>
Mon, 18 Jul 2016 19:31:35 +0000 (21:31 +0200)
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>
arch/alpha/boot/Makefile
arch/powerpc/boot/Makefile
arch/powerpc/kvm/Makefile
arch/s390/boot/compressed/Makefile
arch/um/Makefile
arch/x86/boot/Makefile
arch/x86/realmode/rm/Makefile

index 8399bd0e68e8e5cb7aba078cd40864d89b971eed..0cbe4c59d3ce61901417e877060473ae99a6f8f8 100644 (file)
@@ -15,7 +15,7 @@ targets               := vmlinux.gz vmlinux \
 OBJSTRIP       := $(obj)/tools/objstrip
 
 HOSTCFLAGS     := -Wall -I$(objtree)/usr/include
-BOOTCFLAGS     += -I$(obj) -I$(srctree)/$(obj)
+BOOTCFLAGS     += -I$(objtree)/$(obj) -I$(srctree)/$(obj)
 
 # SRM bootable image.  Copy to offset 512 of a partition.
 $(obj)/bootimage: $(addprefix $(obj)/tools/,mkbb lxboot bootlx) $(obj)/vmlinux.nh
index 8fe78a3efc92e2767e090f0e8b2b1509ff17cb20..ad3782610cf19a2cdf62aa9529681eb2f1550c6b 100644 (file)
@@ -43,7 +43,7 @@ ifeq ($(call cc-option-yn, -fstack-protector),y)
 BOOTCFLAGS     += -fno-stack-protector
 endif
 
-BOOTCFLAGS     += -I$(obj) -I$(srctree)/$(obj)
+BOOTCFLAGS     += -I$(objtree)/$(obj) -I$(srctree)/$(obj)
 
 DTC_FLAGS      ?= -p 1024
 
index eba0bea6e032b67968771341dcaa1c0eb9624863..1f9e5529e692555a5d76f3519fb8c87875a73793 100644 (file)
@@ -20,7 +20,7 @@ common-objs-y += powerpc.o emulate.o emulate_loadstore.o
 obj-$(CONFIG_KVM_EXIT_TIMING) += timing.o
 obj-$(CONFIG_KVM_BOOK3S_HANDLER) += book3s_exports.o
 
-AFLAGS_booke_interrupts.o := -I$(obj)
+AFLAGS_booke_interrupts.o := -I$(objtree)/$(obj)
 
 kvm-e500-objs := \
        $(common-objs-y) \
index 1dd210347e1243ddf01cc8761aabb157c6d7cec1..2657a29a2026f228f85f61c737cd34da436886f1 100644 (file)
@@ -31,10 +31,10 @@ quiet_cmd_sizes = GEN $@
 $(obj)/sizes.h: vmlinux
        $(call if_changed,sizes)
 
-AFLAGS_head.o += -I$(obj)
+AFLAGS_head.o += -I$(objtree)/$(obj)
 $(obj)/head.o: $(obj)/sizes.h
 
-CFLAGS_misc.o += -I$(obj)
+CFLAGS_misc.o += -I$(objtree)/$(obj)
 $(obj)/misc.o: $(obj)/sizes.h
 
 OBJCOPYFLAGS_vmlinux.bin :=  -R .comment -S
index e3abe6f3156d3fbacca4003c072954619c7e1bb1..0ca46ededfc73ce742c4075e2cc08bdb1e93cd0e 100644 (file)
@@ -78,8 +78,8 @@ include $(ARCH_DIR)/Makefile-os-$(OS)
 
 KBUILD_CPPFLAGS += -I$(srctree)/$(HOST_DIR)/include \
                   -I$(srctree)/$(HOST_DIR)/include/uapi \
-                  -I$(HOST_DIR)/include/generated \
-                  -I$(HOST_DIR)/include/generated/uapi
+                  -I$(objtree)/$(HOST_DIR)/include/generated \
+                  -I$(objtree)/$(HOST_DIR)/include/generated/uapi
 
 # -Derrno=kernel_errno - This turns all kernel references to errno into
 # kernel_errno to separate them from the libc errno.  This allows -fno-common
index 700a9c6e6159362d9b62631d124d6703a6554ba5..f3784c35fda2ce16ba861884bf623584a7642451 100644 (file)
@@ -96,7 +96,7 @@ $(obj)/zoffset.h: $(obj)/compressed/vmlinux FORCE
        $(call if_changed,zoffset)
 
 
-AFLAGS_header.o += -I$(obj)
+AFLAGS_header.o += -I$(objtree)/$(obj)
 $(obj)/header.o: $(obj)/zoffset.h
 
 LDFLAGS_setup.elf      := -T
index c556c5ae8de5973852dd7da7517c65fe04fb00e1..25012abc34097ef483d32b6d8d2d1c78492a6850 100644 (file)
@@ -48,7 +48,7 @@ targets += realmode.lds
 $(obj)/realmode.lds: $(obj)/pasyms.h
 
 LDFLAGS_realmode.elf := --emit-relocs -T
-CPPFLAGS_realmode.lds += -P -C -I$(obj)
+CPPFLAGS_realmode.lds += -P -C -I$(objtree)/$(obj)
 
 targets += realmode.elf
 $(obj)/realmode.elf: $(obj)/realmode.lds $(REALMODE_OBJS) FORCE