summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2018-08-06 19:00:22 +0300
committerBin Meng <bmeng.cn@gmail.com>2018-08-20 13:52:06 +0800
commit6ace36e19a8cfdd16ce7c02625edf36864897bf5 (patch)
treece7e5190adde0574c52884da50b549c34e4fa308 /Makefile
parent9f8cf76be256a83643ee05de6cffaeb452ed0931 (diff)
downloadu-boot-6ace36e19a8cfdd16ce7c02625edf36864897bf5.tar.gz
u-boot-6ace36e19a8cfdd16ce7c02625edf36864897bf5.tar.xz
u-boot-6ace36e19a8cfdd16ce7c02625edf36864897bf5.zip
Makefile: Don't generate position independent code
Since gcc-8 the --enable-default-pie starts producing code which assembler can't translate in case of U-Boot. The build fails with {standard input}: Assembler messages: {standard input}:21100: Error: junk at end of line, first unrecognized character is `@' {standard input}:21120: Error: junk at end of line, first unrecognized character is `@' and so on. This is usually the case for x86 platform because in many cases it uses host compiler from the Linux distributions, where PIE is enabled by default. Previously (gcc-7 and earlier) that was a potential issue due to absence of constructions like .long end.5561@gotoff-start.5558@gotoff which are a cause of above error messages in gcc-8. Fix all these by disabling PIE on Makefile level. Reported-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Suggested-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Tested-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Tested-by: Bin Meng <bmeng.cn@gmail.com>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile4
1 files changed, 4 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 2f79204b23..b5bf8abc1f 100644
--- a/Makefile
+++ b/Makefile
@@ -375,6 +375,10 @@ KBUILD_CFLAGS := -Wall -Wstrict-prototypes \
KBUILD_CFLAGS += -fshort-wchar
KBUILD_AFLAGS := -D__ASSEMBLY__
+# Don't generate position independent code
+KBUILD_CFLAGS += $(call cc-option,-fno-PIE)
+KBUILD_AFLAGS += $(call cc-option,-fno-PIE)
+
# Read UBOOTRELEASE from include/config/uboot.release (if it exists)
UBOOTRELEASE = $(shell cat include/config/uboot.release 2> /dev/null)
UBOOTVERSION = $(VERSION)$(if $(PATCHLEVEL),.$(PATCHLEVEL)$(if $(SUBLEVEL),.$(SUBLEVEL)))$(EXTRAVERSION)