diff options
author | Magnus Granberg <zorry@gentoo.org> | 2012-10-07 18:46:30 +0200 |
---|---|---|
committer | Magnus Granberg <zorry@gentoo.org> | 2012-10-07 18:46:30 +0200 |
commit | a82e19b9017f887c1b04d39c1e75f15e66242d73 (patch) | |
tree | 955b2c5d0bdc574e8e5a658dbf5b99a27073fab9 /gcc-4.7.0/piepatch/01_all_gcc47_configure.ac.patch | |
parent | Add configure.ac patches (diff) | |
download | hardened-gccpatchset-a82e19b9017f887c1b04d39c1e75f15e66242d73.tar.gz hardened-gccpatchset-a82e19b9017f887c1b04d39c1e75f15e66242d73.tar.bz2 hardened-gccpatchset-a82e19b9017f887c1b04d39c1e75f15e66242d73.zip |
Update with some cross-compile fixes
Diffstat (limited to 'gcc-4.7.0/piepatch/01_all_gcc47_configure.ac.patch')
-rw-r--r-- | gcc-4.7.0/piepatch/01_all_gcc47_configure.ac.patch | 63 |
1 files changed, 30 insertions, 33 deletions
diff --git a/gcc-4.7.0/piepatch/01_all_gcc47_configure.ac.patch b/gcc-4.7.0/piepatch/01_all_gcc47_configure.ac.patch index ed49cd9..8b4c72e 100644 --- a/gcc-4.7.0/piepatch/01_all_gcc47_configure.ac.patch +++ b/gcc-4.7.0/piepatch/01_all_gcc47_configure.ac.patch @@ -1,4 +1,4 @@ -2011-04-27 Magnus Granberg <zorry@gentoo.org> +2012-10-04 Magnus Granberg <zorry@gentoo.org> * configure.ac Add --enable-esp. Add -fno-stack-protector to stage1_cflags. @@ -15,14 +15,14 @@ +# Check whether --enable-esp was given and target have the support. +AC_ARG_ENABLE([esp], +[AS_HELP_STRING([--enable-esp], -+ [Enable Stack protector, Position independent executable as -+ default if we have suppot for it when compiling -+ and link with -z relro and -z now as default. -+ Linux targets supported i*86, x86_64, x86_x32, powerpc, powerpc64, ia64 and arm.])], ++ [Enable Stack protector and Position independent executable as ++ default if we have suppot for it when compiling ++ and link with -z relro and -z now as default. ++ Linux targets supported i*86, x86_64, x32, powerpc, powerpc64, ia64 and arm.])], +[ + case $target in -+ i?86*-*-linux* | x86_??*-*-linux* | powerpc-*-linux* | powerpc64-*-linux* | arm*-*-linux* | ia64-*-linux*) -+ enable_espf=yes ++ i?86*-*-linux* | x86_64-*-linux* | powerpc-*-linux* | powerpc64-*-linux* | arm*-*-linux* | ia64-*-linux*) ++ enable_esp=yes + ;; + *) + AC_MSG_WARN([*** --enable-esp is not supported on this $target target.]) @@ -48,7 +48,7 @@ # Enable --enable-checking in stage1 of the compiler. --- a/gcc/configure.ac 2011-11-18 11:52:32.000000000 +0100 +++ b/gcc/configure.ac 2012-10-02 17:39:15.649526241 +0200 -@@ -5130,6 +5237,88 @@ if test x"${LINKER_HASH_STYLE}" != x; th +@@ -5130,6 +5237,85 @@ if test x"${LINKER_HASH_STYLE}" != x; th [The linker hash style]) fi @@ -59,17 +59,16 @@ +# Check whether --enable-esp was given and target have the support. +AC_ARG_ENABLE([esp], +[AS_HELP_STRING([--enable-esp], -+ [Enable Stack protector, Position independent executable and -+ Fortify_sources as default if we have suppot for it when compiling -+ and link -z now as default. -+ Linux targets supported i*86, x86_64, x86_x32, powerpc, powerpc64, ia64 and arm])], -+ set_enable_espf=$enableval, -+ set_enable_espf=no) -+if test $set_enable_esp = yes ; then ++ [Enable Stack protector and Position independent executable as ++ default if we have suppot for it when compiling ++ and link with -z relro and -z now as default. ++ Linux targets supported i*86, x86_64, x32, powerpc, powerpc64, ia64 and arm.])], ++ enable_esp=$enableval, ++ enable_esp=no) ++if test $enable_esp = yes ; then + AC_MSG_CHECKING(if $target support esp) -+if test $set_enable_esp = yes ; then + case "$target" in -+ i?86*-*-linux* | x86_??*-*-linux* | powerpc-*-linux* | powerpc64-*-linux* | arm*-*-linux* | ia64-*-linux*) ++ i?86*-*-linux* | x86_64-*-linux* | powerpc-*-linux* | powerpc64-*-linux* | arm*-*-linux* | ia64-*-linux*) + enable_esp=yes + AC_DEFINE(ENABLE_ESP, 1, + [Define if your target support esp and you have enable it.]) @@ -78,26 +77,22 @@ + enable_esp=no + ;; + esac -+else -+ enable_esp=no -+fi +AC_MSG_RESULT($enable_esp) +fi +AC_SUBST([enable_esp]) +if test $enable_esp = yes ; then -+ + AC_MSG_CHECKING(if we can default to use -fstack-protector-all) + ssp_link_test=no + if test x$gcc_cv_libc_provides_ssp = xyes && test x$set_have_as_tls = xyes; then + if $EGREP '^ *#[ ]*define[ ]+__UCLIBC__[ ]+1' \ -+ $target_header_dir/features.h > /dev/null; then -+ if test -f $target_header_dir/bits/uClibc_config.h && \ -+ $EGREP '^ *#[ ]*define[ ]+__UCLIBC_SUBLEVEL__[ ]+([3-9][2-9]|[4-9][0-9])' \ -+ $target_header_dir/bits/uClibc_config.h > /dev/null && \ -+ $EGREP '^ *#[ ]*define[ ]+__UCLIBC_HAS_TLS__[ ]+1' \ -+ $target_header_dir/bits/uClibc_config.h > /dev/null; then -+ ssp_link_test=yes -+ fi ++ $target_header_dir/features.h > /dev/null; then ++ if test -f $target_header_dir/bits/uClibc_config.h && \ ++ $EGREP '^ *#[ ]*define[ ]+__UCLIBC_SUBLEVEL__[ ]+([3-9][2-9]|[4-9][0-9])' \ ++ $target_header_dir/bits/uClibc_config.h > /dev/null && \ ++ $EGREP '^ *#[ ]*define[ ]+__UCLIBC_HAS_TLS__[ ]+1' \ ++ $target_header_dir/bits/uClibc_config.h > /dev/null; then ++ ssp_link_test=yes ++ fi + else + ssp_link_test=yes + fi @@ -110,7 +105,8 @@ + [AC_MSG_RESULT([no]); enable_esp_ssp=no]) + CFLAGS="$saved_CFLAGS" + else -+ [AC_MSG_RESULT([no]); enable_esp_ssp=no] ++ enable_esp_ssp=no ++ AC_MSG_RESULT($enable_esp_ssp) + fi + if test $enable_esp_ssp = yes ; then + AC_DEFINE(ENABLE_ESP_SSP, 1, @@ -119,20 +115,21 @@ + AC_MSG_CHECKING(checking for crtbeginP.o support) + if test x$enable_esp = xyes ; then + case "$target" in -+ ia64*-*-linux*) ++ ia64*-*-linux*) + enable_crtbeginP=no ;; + *-*-linux*) + if test x$gcc_cv_ld_pie = xyes && test x$lt_cv_prog_compiler_static_works = xyes; then + enable_crtbeginP=yes + AC_DEFINE(ENABLE_CRTBEGINP, 1, + [Define if your compiler will support crtbeginP.]) -+ fi ++ fi + ;; -+ *) enable_crtbeginP=no ;; ++ *) enable_crtbeginP=no ;; + esac + fi + AC_MSG_RESULT($enable_crtbeginP) +fi ++AC_SUBST([enable_crtbeginP]) + # Configure the subdirectories # AC_CONFIG_SUBDIRS($subdirs) |