]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
configure: set -fno-pie together with -fno-PIE
authorAndrei Borzenkov <arvidjaar@gmail.com>
Tue, 22 Mar 2016 17:12:22 +0000 (20:12 +0300)
committerAndrei Borzenkov <arvidjaar@gmail.com>
Tue, 22 Mar 2016 17:12:22 +0000 (20:12 +0300)
OpenBSD 5.9 apparently defaults to -fpie. We use -fno-PIE when appropriate
already, but that is not enough - it does not turn off -fpie.

Actually check for -fPIE is not precise enough. __PIE__ is set for both
-fpie and -fPIE but with different values. As far as I can tell, both
options were introduced at the same time, so both should always be supported.

This fixes compilation on OpenBSD 5.9 which otherwise created insanely big
lzma_decompress.img.

Reported, suggested and tested by: Jiri B <jirib@devio.us>

configure.ac

index a85b134ec58296e4f128b116918cb1c64ee17ecc..57e17138eb72aa4d4f985c525998d300f7121ccd 100644 (file)
@@ -1185,9 +1185,9 @@ CFLAGS="$TARGET_CFLAGS"
 # Position independent executable.
 grub_CHECK_PIE
 [# Need that, because some distributions ship compilers that include
-# `-fPIE' in the default specs.
+# `-fPIE' or '-fpie' in the default specs.
 if [ x"$pie_possible" = xyes ]; then
-  TARGET_CFLAGS="$TARGET_CFLAGS -fno-PIE"
+  TARGET_CFLAGS="$TARGET_CFLAGS -fno-PIE -fno-pie"
 fi]
 
 CFLAGS="$TARGET_CFLAGS"