Commit 93a81088 authored by robertmh's avatar robertmh

2009-09-03 Magnus Granberg <zorry@ume.nu>

        * aclocal.m4: Add grub_CHECK_PIE. It check if the compiler
        include -fPIE in the default specs.
        * configure.ac: Check if pie_possible is yes and add -fno-PIE
        to TARGET_CFLAGS.
parent 160034b2
2009-09-03 Magnus Granberg <zorry@ume.nu>
* aclocal.m4: Add grub_CHECK_PIE. It check if the compiler
include -fPIE in the default specs.
* configure.ac: Check if pie_possible is yes and add -fno-PIE
to TARGET_CFLAGS.
2009-09-03 Felix Zielcke <fzielcke@z-51.de>
* INSTALL: Note that GNU Bison 2.3 or later is required.
......
......@@ -413,3 +413,31 @@ else
[fi
rm -rf testdir]
])
dnl Check if the C compiler supports `-fPIE'.
AC_DEFUN(grub_CHECK_PIE,[
[# Position independent executable.
pie_possible=yes]
AC_MSG_CHECKING([whether `$CC' has `-fPIE' as default])
# Is this a reliable test case?
AC_LANG_CONFTEST([[
#ifdef __PIE__
int main() {
return 0;
}
#else
#error NO __PIE__ DEFINED
#endif
]])
[# `$CC -c -o ...' might not be portable. But, oh, well... Is calling
# `ac_compile' like this correct, after all?
if eval "$ac_compile -S -o conftest.s" 2> /dev/null; then]
AC_MSG_RESULT([yes])
[# Should we clear up other files as well, having called `AC_LANG_CONFTEST'?
rm -f conftest.s
else
pie_possible=no]
AC_MSG_RESULT([no])
[fi]
])
......@@ -346,6 +346,14 @@ fi
# Need __enable_execute_stack() for nested function trampolines?
grub_CHECK_ENABLE_EXECUTE_STACK
# Position independent executable.
grub_CHECK_PIE
[# Need that, because some distributions ship compilers that include
# `-fPIE' in the default specs.
if [ x"$pie_possible" = xyes ]; then
TARGET_CFLAGS="$TARGET_CFLAGS -fno-PIE"
fi]
# Smashing stack protector.
grub_CHECK_STACK_PROTECTOR
# Need that, because some distributions ship compilers that include
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment