aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.4.3/gcc/configure.ac
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.4.3/gcc/configure.ac')
-rw-r--r--gcc-4.4.3/gcc/configure.ac65
1 files changed, 65 insertions, 0 deletions
diff --git a/gcc-4.4.3/gcc/configure.ac b/gcc-4.4.3/gcc/configure.ac
index 1b8fcf614..1ee190a76 100644
--- a/gcc-4.4.3/gcc/configure.ac
+++ b/gcc-4.4.3/gcc/configure.ac
@@ -3651,6 +3651,38 @@ if test x"$enable_linker_build_id" = xyes; then
fi
fi
+AC_CACHE_CHECK(linker -z now support,
+gcc_cv_ld_now,
+[gcc_cv_ld_now=no
+if test $in_tree_ld = yes ; then
+ if test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 16 -o "$gcc_cv_gld_major_version" -gt 2 \
+ && test $in_tree_ld_is_elf = yes; then
+ gcc_cv_ld_now=yes
+ fi
+elif test x$gcc_cv_ld != x; then
+ # Check if linker supports -z now options
+ if $gcc_cv_ld --help 2>/dev/null | grep now > /dev/null; then
+ gcc_cv_ld_now=yes
+ fi
+fi
+])
+
+AC_CACHE_CHECK(linker -z relro support,
+gcc_cv_ld_relro,
+[gcc_cv_ld_relro=no
+if test $in_tree_ld = yes ; then
+ if test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 16 -o "$gcc_cv_gld_major_version" -gt 2 \
+ && test $in_tree_ld_is_elf = yes; then
+ gcc_cv_ld_relro=yes
+ fi
+elif test x$gcc_cv_ld != x; then
+ # Check if linker supports -z relro and -z norelro options
+ if $gcc_cv_ld --help 2>/dev/null | grep relro > /dev/null; then
+ gcc_cv_ld_relro=yes
+ fi
+fi
+])
+
AC_CACHE_CHECK(linker --sysroot support,
gcc_cv_ld_sysroot,
[gcc_cv_ld_sysroot=no
@@ -3734,6 +3766,32 @@ if test x$gcc_cv_libc_provides_ssp = xyes; then
[Define if your target C library provides stack protector support])
fi
+if test x$enable_esp = xyes ; then
+ if test x$gcc_cv_ld_relro = xyes && test x$gcc_cv_ld_now = xyes; then
+ AC_DEFINE(ENABLE_ESP, 1,
+ [Define if your target support esp and you have enable it.])
+ else
+ AC_MSG_ERROR([*** --enable-esp Need a linker that support -z now and -z relro.])
+ fi
+fi
+AC_SUBST([enable_esp])
+
+if test x$enable_esp = xyes ; then
+ case "$target" in
+ *-*-linux*)
+ if test x$gcc_cv_ld_pie = xyes && test x$lt_cv_prog_compiler_static_works = xyes; then
+ enable_crtbeginTS=yes
+ fi
+ ;;
+ *) enable_crtbeginTS=no ;;
+ esac
+fi
+AC_SUBST([enable_crtbeginTS])
+if test x$enable_crtbeginTS = xyes; then
+ AC_DEFINE(ENABLE_CRTBEGINTS, 1,
+ [Define if your target crtbeginTS support])
+fi
+
# Check if TFmode long double should be used by default or not.
# Some glibc targets used DFmode long double, but with glibc 2.4
# and later they can use TFmode.
@@ -4038,6 +4096,13 @@ htmldir="\${prefix}/$with_htmldir",
htmldir='$(docdir)')
AC_SUBST(htmldir)
+# Google-local http://b/2739909
+AC_ARG_WITH([rpath-spec],
+[ --with-rpath-spec=SPEC Use rpath spec as part of default link specs],
+[link_rpath_spec="$withval"],
+[link_rpath_spec=])
+AC_SUBST(link_rpath_spec)
+
# Substitute configuration variables
AC_SUBST(subdirs)
AC_SUBST(srcdir)