aboutsummaryrefslogtreecommitdiff
path: root/resources
diff options
context:
space:
mode:
author4 of 7 (Leah Rowe) <info@minifree.org>2016-12-23 11:24:48 +0000
committer4 of 7 (Leah Rowe) info@minifree.org <info@minifree.org>2017-01-22 02:12:26 +0000
commit5079de279988b12b5653d6ed229367ef1c08b8c8 (patch)
tree23bc340da616393b96383debadbc819f934178d2 /resources
parent70fa7f5750134b080814a9f44d1a78028aa4e4e0 (diff)
downloadlibrebootfr-5079de279988b12b5653d6ed229367ef1c08b8c8.tar.gz
librebootfr-5079de279988b12b5653d6ed229367ef1c08b8c8.zip
Fix build error on latest GCC in Debian Stretch, when building GCC
Diffstat (limited to 'resources')
-rw-r--r--resources/libreboot/patch/crossgcc/gccfix.diff27
-rwxr-xr-xresources/scripts/helpers/download/crossgcc5
2 files changed, 31 insertions, 1 deletions
diff --git a/resources/libreboot/patch/crossgcc/gccfix.diff b/resources/libreboot/patch/crossgcc/gccfix.diff
new file mode 100644
index 00000000..49e6227b
--- /dev/null
+++ b/resources/libreboot/patch/crossgcc/gccfix.diff
@@ -0,0 +1,27 @@
+From ea0c2d76c4f16eccaafcb2c0741f76825505bafc Mon Sep 17 00:00:00 2001
+From: Nico Huber <nico.huber@secunet.com>
+Date: Thu, 22 Dec 2016 16:05:54 +0100
+Subject: [PATCH] DONOTMERGE buildgcc: Build GMP `--with-pic` if GCC defaults to `-pie`
+
+Change-Id: I5f3185af9c8d599379a628e18724b217b88be974
+Signed-off-by: Nico Huber <nico.huber@secunet.com>
+---
+
+diff --git a/util/crossgcc/buildgcc b/util/crossgcc/buildgcc
+index 97c38b8..4eefd43 100755
+--- a/util/crossgcc/buildgcc
++++ b/util/crossgcc/buildgcc
+@@ -515,6 +515,13 @@
+ }
+
+ build_GMP() {
++ # Check if GCC enables `-pie` by default (likely on Debian Stretch).
++ # We have to use `--with-pic` then.
++ if "${CC}" -dumpspecs 2>/dev/null | grep -q '[{;][[:space:]]*:-pie\>'
++ then
++ OPTIONS="$OPTIONS --with-pic"
++ fi
++
+ CC="$CC" ../${GMP_DIR}/configure --disable-shared --enable-fat \
+ --prefix=$TARGETDIR $OPTIONS \
+ || touch .failed
diff --git a/resources/scripts/helpers/download/crossgcc b/resources/scripts/helpers/download/crossgcc
index 6b77917c..68cd6414 100755
--- a/resources/scripts/helpers/download/crossgcc
+++ b/resources/scripts/helpers/download/crossgcc
@@ -33,7 +33,7 @@ else
fi
# coreboot revisios used for crossgcc
-crossgccrevision="00aa45391ddb22b5ac24151d54615ca1d89eb745"
+crossgccrevision="35562d8b6477058e6bca31b5cedd9d4897124fc7"
vbootrevision="d187cd3fc792f8bcefbee4587c83eafbd08441fc"
rm -Rf "crossgcc/"
@@ -46,6 +46,9 @@ rm -Rf "crossgcc/"
cd 3rdparty/vboot/
git reset --hard ${vbootrevision}
)
+ # workaround to fix the error on debian stretch and later, when building
+ # GMP. If -pie is enabled in GCC, then --with-pic must be used when compiling
+ git am ../resources/libreboot/patch/crossgcc/gccfix.diff
rm -Rf .git* */*/.git*
)