summaryrefslogtreecommitdiffstats
path: root/recipes-bsp/u-boot
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2018-10-18 11:49:46 +0000
committerDenys Dmytriyenko <denys@ti.com>2018-10-18 22:53:23 +0000
commit469d9b24d7265d5e9663a1b022b678bd79a3e3b8 (patch)
tree670e0e269bdc3beb6361eeb6125fb1623313c65d /recipes-bsp/u-boot
parente3e20300d40e0d3577d0d25af151c9d4b69cf44b (diff)
downloadmeta-ti-469d9b24d7265d5e9663a1b022b678bd79a3e3b8.tar.gz
u-boot: Always build with disabled PIE
some OE distros can default to hardened toolchains which means PIE is added implicitly to compiler cmdline, here this options makes sure that whattever the default toolchain are, u-boot is not impacted Fixes errors e.g. | arm-yoe-linux-gnueabi-ld.bfd: u-boot-spl section `.rodata' will not fit in region `.sram' | arm-yoe-linux-gnueabi-ld.bfd: region `.sram' overflowed by 5772 bytes Signed-off-by: Khem Raj <raj.khem@gmail.com> Cc: Tom Rini <trini@konsulko.com> Cc: Denys Dmytriyenko <denys@ti.com> Signed-off-by: Denys Dmytriyenko <denys@ti.com>
Diffstat (limited to 'recipes-bsp/u-boot')
-rw-r--r--recipes-bsp/u-boot/files/0001-Always-build-with-fno-PIE.patch35
-rw-r--r--recipes-bsp/u-boot/u-boot-ti-staging_2018.01.bb2
2 files changed, 37 insertions, 0 deletions
diff --git a/recipes-bsp/u-boot/files/0001-Always-build-with-fno-PIE.patch b/recipes-bsp/u-boot/files/0001-Always-build-with-fno-PIE.patch
new file mode 100644
index 00000000..dfd99c66
--- /dev/null
+++ b/recipes-bsp/u-boot/files/0001-Always-build-with-fno-PIE.patch
@@ -0,0 +1,35 @@
1From ec81bbe3ea7e077512f4b9d2b4aa87e7f1494bcc Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Wed, 17 Oct 2018 22:32:57 -0700
4Subject: [PATCH] Always build with -fno-PIE
5
6GNU Toolchains can be configured to generate PIE by default
7while PIE could be ok, it is known that u-boot/SPL on ARM starts to
8generate bigger code and starts to overflow the SRAM size, therefore
9disabling PIE explcitly insulates against toolchain intrinsic defaults
10
11Fixes errors like
12| arm-yoe-linux-gnueabi-ld.bfd: u-boot-spl section `.rodata' will not fit in region `.sram'
13| arm-yoe-linux-gnueabi-ld.bfd: region `.sram' overflowed by 5772 bytes
14
15Signed-off-by: Khem Raj <raj.khem@gmail.com>
16Cc: Tom Rini <trini@konsulko.com>
17---
18 Makefile | 1 +
19 1 file changed, 1 insertion(+)
20
21diff --git a/Makefile b/Makefile
22index 45cd751ba3..9eb8ac564e 100644
23--- a/Makefile
24+++ b/Makefile
25@@ -592,6 +592,7 @@ KBUILD_CFLAGS += -O2
26 endif
27
28 KBUILD_CFLAGS += $(call cc-option,-fno-stack-protector)
29+KBUILD_CFLAGS += $(call cc-option,-fno-PIE)
30 KBUILD_CFLAGS += $(call cc-option,-fno-delete-null-pointer-checks)
31
32 KBUILD_CFLAGS += -g
33--
342.19.1
35
diff --git a/recipes-bsp/u-boot/u-boot-ti-staging_2018.01.bb b/recipes-bsp/u-boot/u-boot-ti-staging_2018.01.bb
index cbb8857a..c9c97111 100644
--- a/recipes-bsp/u-boot/u-boot-ti-staging_2018.01.bb
+++ b/recipes-bsp/u-boot/u-boot-ti-staging_2018.01.bb
@@ -5,3 +5,5 @@ PR = "r24"
5BRANCH = "ti-u-boot-2018.01" 5BRANCH = "ti-u-boot-2018.01"
6 6
7SRCREV = "2cc52408bf1357f11b96548e78223a1df321c1ae" 7SRCREV = "2cc52408bf1357f11b96548e78223a1df321c1ae"
8
9SRC_URI += "file://0001-Always-build-with-fno-PIE.patch"