From 5bbabb3e647d38fbd7408b88a649fea288ace4e6 Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Sat, 19 Oct 2013 21:37:09 +0000 Subject: [PATCH] kbuild: Use -nostdinc in compile tests (workaround for #717557) svn path=/dists/sid/linux/; revision=20729 --- debian/changelog | 3 + ...kbuild-use-nostdinc-in-compile-tests.patch | 81 +++++++++++++++++++ debian/patches/series | 1 + 3 files changed, 85 insertions(+) create mode 100644 debian/patches/bugfix/all/kbuild-use-nostdinc-in-compile-tests.patch diff --git a/debian/changelog b/debian/changelog index 3b8fea068..5c5106136 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,6 +4,9 @@ linux (3.11.5-2) UNRELEASED; urgency=low * [armhf] Enable Xen and virtio for armmp and armmp-lpae as well as KVM for armmp-lpae only. + [ Ben Hutchings ] + * kbuild: Use -nostdinc in compile tests (workaround for #717557) + -- Ian Campbell Sat, 19 Oct 2013 10:34:53 +0100 linux (3.11.5-1) unstable; urgency=low diff --git a/debian/patches/bugfix/all/kbuild-use-nostdinc-in-compile-tests.patch b/debian/patches/bugfix/all/kbuild-use-nostdinc-in-compile-tests.patch new file mode 100644 index 000000000..773efe262 --- /dev/null +++ b/debian/patches/bugfix/all/kbuild-use-nostdinc-in-compile-tests.patch @@ -0,0 +1,81 @@ +From: Ben Hutchings +Date: Sat, 19 Oct 2013 19:43:35 +0100 +Subject: kbuild: Use -nostdinc in compile tests +Bug-Debian: http://bugs.debian.org/717557 +Forwarded: no + +Debian's gcc 4.8 pre-includes by default, which in +turn includes . This fails when building a 64-bit +kernel and only 32-bit C library headers installed. + +The -nostdinc option disables this, though it isn't explicitly +documented. This option is already used when actually building +the kernel. + +--- a/scripts/Kbuild.include ++++ b/scripts/Kbuild.include +@@ -110,12 +110,12 @@ as-instr = $(call try-run,\ + # Usage: cflags-y += $(call cc-option,-march=winchip-c6,-march=i586) + + cc-option = $(call try-run,\ +- $(CC) $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) $(1) -c -x c /dev/null -o "$$TMP",$(1),$(2)) ++ $(CC) $(NOSTDINC_FLAGS) $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) $(1) -c -x c /dev/null -o "$$TMP",$(1),$(2)) + + # cc-option-yn + # Usage: flag := $(call cc-option-yn,-march=winchip-c6) + cc-option-yn = $(call try-run,\ +- $(CC) $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) $(1) -c -x c /dev/null -o "$$TMP",y,n) ++ $(CC) $(NOSTDINC_FLAGS) $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) $(1) -c -x c /dev/null -o "$$TMP",y,n) + + # cc-option-align + # Prefix align with either -falign or -malign +@@ -125,16 +125,17 @@ cc-option-align = $(subst -functions=0,, + # cc-disable-warning + # Usage: cflags-y += $(call cc-disable-warning,unused-but-set-variable) + cc-disable-warning = $(call try-run,\ +- $(CC) $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) -W$(strip $(1)) -c -x c /dev/null -o "$$TMP",-Wno-$(strip $(1))) ++ $(CC) $(NOSTDINC_FLAGS) $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) -W$(strip $(1)) -c -x c /dev/null -o "$$TMP",-Wno-$(strip $(1))) + + # cc-version + # Usage gcc-ver := $(call cc-version) +-cc-version = $(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-version.sh $(CC)) ++cc-version = $(shell $(CONFIG_SHELL) \ ++ $(srctree)/scripts/gcc-version.sh $(CC) $(NOSTDINC_FLAGS)) + + # cc-fullversion + # Usage gcc-ver := $(call cc-fullversion) + cc-fullversion = $(shell $(CONFIG_SHELL) \ +- $(srctree)/scripts/gcc-version.sh -p $(CC)) ++ $(srctree)/scripts/gcc-version.sh -p $(CC) $(NOSTDINC_FLAGS)) + + # cc-ifversion + # Usage: EXTRA_CFLAGS += $(call cc-ifversion, -lt, 0402, -O1) +@@ -148,7 +149,7 @@ cc-ldoption = $(call try-run,\ + # ld-option + # Usage: LDFLAGS += $(call ld-option, -X) + ld-option = $(call try-run,\ +- $(CC) -x c /dev/null -c -o "$$TMPO" ; $(LD) $(1) "$$TMPO" -o "$$TMP",$(1),$(2)) ++ $(CC) $(NOSTDINC_FLAGS) -x c /dev/null -c -o "$$TMPO" ; $(LD) $(1) "$$TMPO" -o "$$TMP",$(1),$(2)) + + # ar-option + # Usage: KBUILD_ARFLAGS := $(call ar-option,D) +--- a/Makefile ++++ b/Makefile +@@ -578,6 +578,8 @@ else + KBUILD_CFLAGS += -O2 + endif + ++NOSTDINC_FLAGS += -nostdinc ++ + include $(srctree)/arch/$(SRCARCH)/Makefile + + ifdef CONFIG_READABLE_ASM +@@ -646,7 +648,7 @@ KBUILD_CFLAGS += $(call cc-option, -fno- + endif + + # arch Makefile may override CC so keep this after arch Makefile is included +-NOSTDINC_FLAGS += -nostdinc -isystem $(shell $(CC) -print-file-name=include) ++NOSTDINC_FLAGS += -isystem $(shell $(CC) -print-file-name=include) + CHECKFLAGS += $(NOSTDINC_FLAGS) + + # warn about C99 declaration after statement diff --git a/debian/patches/series b/debian/patches/series index 387edfc33..ce67e8928 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -79,3 +79,4 @@ bugfix/m68k/atari-irqs.patch bugfix/all/compiler-gcc-4-add-quirk-for-asm-goto-miscompilation-bug.patch bugfix/all/crypto-ansi_cprng-Fix-off-by-one-error-in-non-block-.patch features/all/mvsas-Recognise-device-subsystem-9485-9485-as-88SE94.patch +bugfix/all/kbuild-use-nostdinc-in-compile-tests.patch