mirror of
https://git.savannah.gnu.org/git/grub.git
synced 2026-10-25 08:39:28 +00:00
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.
This commit is contained in:
1 parent
130234bc78
commit
a3e9da054d
2 files changed
+24
-1
No files matched your search
+6
-1
@@ -1185,13 +1185,18 @@ CFLAGS="$TARGET_CFLAGS"
|
||||
|
||||
# Position independent executable.
|
||||
grub_CHECK_PIE
|
||||
grub_CHECK_NO_PIE
|
||||
[# Need that, because some distributions ship compilers that include
|
||||
# `-fPIE' or '-fpie' in the default specs.
|
||||
# `-fPIE' or '-fpie' and '-pie' in the default specs.
|
||||
if [ x"$pie_possible" = xyes ]; then
|
||||
TARGET_CFLAGS="$TARGET_CFLAGS -fno-PIE -fno-pie"
|
||||
fi
|
||||
if [ x"$nopie_possible" = xyes ] && [ x"$pie_possible" = xyes ]; then
|
||||
TARGET_LDFLAGS="$TARGET_LDFLAGS -no-pie"
|
||||
fi]
|
||||
|
||||
CFLAGS="$TARGET_CFLAGS"
|
||||
LDFLAGS="$TARGET_LDFLAGS"
|
||||
|
||||
# Position independent executable.
|
||||
grub_CHECK_PIC
|
||||
|
||||
Reference in new issue
Block a user