diff options
author | Andrew Robbins <contact@andrewrobbins.info> | 2019-09-27 09:40:12 -0500 |
---|---|---|
committer | Andrew Robbins <contact@andrewrobbins.info> | 2019-09-27 09:40:12 -0500 |
commit | f2c648593a094b8f28af633fd2bc145d5c97d039 (patch) | |
tree | f03a2c2863e19120b21b81f644319fa6919ccf34 /resources/libreboot/patch/crossgcc/looking_for_pie.patch | |
parent | 9797d4119d5de6cb4db1aec928a79038dc3f066b (diff) | |
download | librebootfr-f2c648593a094b8f28af633fd2bc145d5c97d039.tar.gz librebootfr-f2c648593a094b8f28af633fd2bc145d5c97d039.zip |
Use '--with-pic' if building gmp with '-pie'
The updated regex catches more instances where '-pie' would be
enabled. Parabola's gcc is built with a spec string which causes
issues when building gmp (as part of the crossgcc build process)
using the old build system.
Diffstat (limited to 'resources/libreboot/patch/crossgcc/looking_for_pie.patch')
-rw-r--r-- | resources/libreboot/patch/crossgcc/looking_for_pie.patch | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/resources/libreboot/patch/crossgcc/looking_for_pie.patch b/resources/libreboot/patch/crossgcc/looking_for_pie.patch new file mode 100644 index 00000000..942edac2 --- /dev/null +++ b/resources/libreboot/patch/crossgcc/looking_for_pie.patch @@ -0,0 +1,32 @@ +From e64fb0ce10d01d99154fb4bd95529e5cd8dfd4be Mon Sep 17 00:00:00 2001 +From: Andrew Robbins <contact@andrewrobbins.info> +Date: Fri, 27 Sep 2019 09:38:09 -0500 +Subject: [PATCH] buildgcc: Check for '-pie' when building gmp + +The regex formerly used was not flexible enough to catch some +instances where the '-pie' flag would be enabled. +--- + util/crossgcc/buildgcc | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/util/crossgcc/buildgcc b/util/crossgcc/buildgcc +index 97c38b8d95..a6e4728514 100755 +--- a/util/crossgcc/buildgcc ++++ b/util/crossgcc/buildgcc +@@ -515,6 +515,13 @@ set_hostcflags_from_gmp() { + } + + build_GMP() { ++ # Check if GCC enables `-pie` by default (possible since GCC 6). ++ # We need PIC in all static libraries then. ++ if $CC -dumpspecs 2>/dev/null | grep -q '[{;][[:space:]]*\(!no-pie\)\?:-pie\>' ++ then ++ OPTIONS="$OPTIONS --with-pic" ++ fi ++ + CC="$CC" ../${GMP_DIR}/configure --disable-shared --enable-fat \ + --prefix=$TARGETDIR $OPTIONS \ + || touch .failed +-- +2.23.0 + |