configure: add check for -no-pie if the compiler default to -fPIE
authorMagnus Granberg <zorry@gentoo.org>
Wed, 14 Dec 2016 17:44:41 +0000 (20:44 +0300)
committerAndrei Borzenkov <arvidjaar@gmail.com>
Wed, 14 Dec 2016 17:44:41 +0000 (20:44 +0300)
commita3e9da054d00260f274cfd9d1b9611c32ecd437c
treea6fdeedeefbd4707a7ca44b13890d775466ee154
parent130234bc782e1b36a6c55fcac31ff3208cc8807b
configure: add check for -no-pie if the compiler default to -fPIE

When Grub is compile with gcc 6.1 that have --enable-defult-pie set.
It fail with.
-ffreestanding   -m32 -Wl,-melf_i386 -Wl,--build-id=none  -nostdlib -Wl,-N -Wl,-r,-d   -
o trig.module  trig_module-trigtables.o
grep 'MARKER' gcry_whirlpool.marker.new > gcry_whirlpool.marker; rm -f
gcry_whirlpool.marker.new
/usr/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../x86_64-pc-linux-gnu/bin/ld: -r and -
shared may not be used together
collect2: error: ld returned 1 exit status
Makefile:26993: recipe for target 'trig.module' failed

Check that compiler supports -no-pie and add it to linker flags.
acinclude.m4
configure.ac