From a429affe7d92a52d5923cb398a2f2f10a12891b7 Mon Sep 17 00:00:00 2001 From: Benjamin Kosnik Date: Thu, 12 Jan 2006 00:17:38 +0000 Subject: acinclude.m4: Use -Wl,-z,relro if possible. 2006-01-11 Benjamin Kosnik * acinclude.m4: Use -Wl,-z,relro if possible. * configure: Regenerate. From-SVN: r109618 --- libstdc++-v3/ChangeLog | 5 ++ libstdc++-v3/acinclude.m4 | 15 ++++- libstdc++-v3/configure | 150 ++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 169 insertions(+), 1 deletion(-) (limited to 'libstdc++-v3') diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 9f5713e..a1e662c 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,8 @@ +2006-01-11 Benjamin Kosnik + + * acinclude.m4: Use -Wl,-z,relro if possible. + * configure: Regenerate. + 2006-01-10 Paolo Carlini * include/tr1/complex: New file, hosts the additions to header diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4 index 716dab5..6c84ca7 100644 --- a/libstdc++-v3/acinclude.m4 +++ b/libstdc++-v3/acinclude.m4 @@ -187,7 +187,7 @@ dnl safe (like an empty string). dnl dnl Defines: dnl SECTION_LDFLAGS='-Wl,--gc-sections' if possible -dnl OPT_LDFLAGS='-Wl,-O1' if possible +dnl OPT_LDFLAGS='-Wl,-O1' and '-z,relro' if possible dnl LD (as a side effect of testing) dnl Sets: dnl with_gnu_ld @@ -267,6 +267,19 @@ AC_DEFUN([GLIBCXX_CHECK_LINKER_FEATURES], [ AC_MSG_RESULT($ac_sectionLDflags) fi + # Set -z,relro. + # Note this is only for shared objects + ac_ld_relro=no + if test x"$with_gnu_ld" = x"yes"; then + AC_MSG_CHECKING([for ld that supports -Wl,-z,relro]) + cxx_z_relo=`$LD -v --help 2>/dev/null | grep "z relro"` + if test -n "$cxx_z_relo"; then + OPT_LDFLAGS="-Wl,-z,relro" + ac_ld_relro=yes + fi + AC_MSG_RESULT($ac_ld_relro) + fi + # Set linker optimization flags. if test x"$with_gnu_ld" = x"yes"; then OPT_LDFLAGS="-Wl,-O1 $OPT_LDFLAGS" diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure index b5fbb5b..bcd04af 100755 --- a/libstdc++-v3/configure +++ b/libstdc++-v3/configure @@ -8279,6 +8279,21 @@ fi echo "${ECHO_T}$ac_sectionLDflags" >&6 fi + # Set -z,relro. + # Note this is only for shared objects + ac_ld_relro=no + if test x"$with_gnu_ld" = x"yes"; then + echo "$as_me:$LINENO: checking for ld that supports -Wl,-z,relro" >&5 +echo $ECHO_N "checking for ld that supports -Wl,-z,relro... $ECHO_C" >&6 + cxx_z_relo=`$LD -v --help 2>/dev/null | grep "z relro"` + if test -n "$cxx_z_relo"; then + OPT_LDFLAGS="-Wl,-z,relro" + ac_ld_relro=yes + fi + echo "$as_me:$LINENO: result: $ac_ld_relro" >&5 +echo "${ECHO_T}$ac_ld_relro" >&6 + fi + # Set linker optimization flags. if test x"$with_gnu_ld" = x"yes"; then OPT_LDFLAGS="-Wl,-O1 $OPT_LDFLAGS" @@ -53103,6 +53118,21 @@ fi echo "${ECHO_T}$ac_sectionLDflags" >&6 fi + # Set -z,relro. + # Note this is only for shared objects + ac_ld_relro=no + if test x"$with_gnu_ld" = x"yes"; then + echo "$as_me:$LINENO: checking for ld that supports -Wl,-z,relro" >&5 +echo $ECHO_N "checking for ld that supports -Wl,-z,relro... $ECHO_C" >&6 + cxx_z_relo=`$LD -v --help 2>/dev/null | grep "z relro"` + if test -n "$cxx_z_relo"; then + OPT_LDFLAGS="-Wl,-z,relro" + ac_ld_relro=yes + fi + echo "$as_me:$LINENO: result: $ac_ld_relro" >&5 +echo "${ECHO_T}$ac_ld_relro" >&6 + fi + # Set linker optimization flags. if test x"$with_gnu_ld" = x"yes"; then OPT_LDFLAGS="-Wl,-O1 $OPT_LDFLAGS" @@ -74420,6 +74450,21 @@ fi echo "${ECHO_T}$ac_sectionLDflags" >&6 fi + # Set -z,relro. + # Note this is only for shared objects + ac_ld_relro=no + if test x"$with_gnu_ld" = x"yes"; then + echo "$as_me:$LINENO: checking for ld that supports -Wl,-z,relro" >&5 +echo $ECHO_N "checking for ld that supports -Wl,-z,relro... $ECHO_C" >&6 + cxx_z_relo=`$LD -v --help 2>/dev/null | grep "z relro"` + if test -n "$cxx_z_relo"; then + OPT_LDFLAGS="-Wl,-z,relro" + ac_ld_relro=yes + fi + echo "$as_me:$LINENO: result: $ac_ld_relro" >&5 +echo "${ECHO_T}$ac_ld_relro" >&6 + fi + # Set linker optimization flags. if test x"$with_gnu_ld" = x"yes"; then OPT_LDFLAGS="-Wl,-O1 $OPT_LDFLAGS" @@ -75900,6 +75945,21 @@ fi echo "${ECHO_T}$ac_sectionLDflags" >&6 fi + # Set -z,relro. + # Note this is only for shared objects + ac_ld_relro=no + if test x"$with_gnu_ld" = x"yes"; then + echo "$as_me:$LINENO: checking for ld that supports -Wl,-z,relro" >&5 +echo $ECHO_N "checking for ld that supports -Wl,-z,relro... $ECHO_C" >&6 + cxx_z_relo=`$LD -v --help 2>/dev/null | grep "z relro"` + if test -n "$cxx_z_relo"; then + OPT_LDFLAGS="-Wl,-z,relro" + ac_ld_relro=yes + fi + echo "$as_me:$LINENO: result: $ac_ld_relro" >&5 +echo "${ECHO_T}$ac_ld_relro" >&6 + fi + # Set linker optimization flags. if test x"$with_gnu_ld" = x"yes"; then OPT_LDFLAGS="-Wl,-O1 $OPT_LDFLAGS" @@ -77256,6 +77316,21 @@ fi echo "${ECHO_T}$ac_sectionLDflags" >&6 fi + # Set -z,relro. + # Note this is only for shared objects + ac_ld_relro=no + if test x"$with_gnu_ld" = x"yes"; then + echo "$as_me:$LINENO: checking for ld that supports -Wl,-z,relro" >&5 +echo $ECHO_N "checking for ld that supports -Wl,-z,relro... $ECHO_C" >&6 + cxx_z_relo=`$LD -v --help 2>/dev/null | grep "z relro"` + if test -n "$cxx_z_relo"; then + OPT_LDFLAGS="-Wl,-z,relro" + ac_ld_relro=yes + fi + echo "$as_me:$LINENO: result: $ac_ld_relro" >&5 +echo "${ECHO_T}$ac_ld_relro" >&6 + fi + # Set linker optimization flags. if test x"$with_gnu_ld" = x"yes"; then OPT_LDFLAGS="-Wl,-O1 $OPT_LDFLAGS" @@ -79399,6 +79474,21 @@ fi echo "${ECHO_T}$ac_sectionLDflags" >&6 fi + # Set -z,relro. + # Note this is only for shared objects + ac_ld_relro=no + if test x"$with_gnu_ld" = x"yes"; then + echo "$as_me:$LINENO: checking for ld that supports -Wl,-z,relro" >&5 +echo $ECHO_N "checking for ld that supports -Wl,-z,relro... $ECHO_C" >&6 + cxx_z_relo=`$LD -v --help 2>/dev/null | grep "z relro"` + if test -n "$cxx_z_relo"; then + OPT_LDFLAGS="-Wl,-z,relro" + ac_ld_relro=yes + fi + echo "$as_me:$LINENO: result: $ac_ld_relro" >&5 +echo "${ECHO_T}$ac_ld_relro" >&6 + fi + # Set linker optimization flags. if test x"$with_gnu_ld" = x"yes"; then OPT_LDFLAGS="-Wl,-O1 $OPT_LDFLAGS" @@ -80708,6 +80798,21 @@ fi echo "${ECHO_T}$ac_sectionLDflags" >&6 fi + # Set -z,relro. + # Note this is only for shared objects + ac_ld_relro=no + if test x"$with_gnu_ld" = x"yes"; then + echo "$as_me:$LINENO: checking for ld that supports -Wl,-z,relro" >&5 +echo $ECHO_N "checking for ld that supports -Wl,-z,relro... $ECHO_C" >&6 + cxx_z_relo=`$LD -v --help 2>/dev/null | grep "z relro"` + if test -n "$cxx_z_relo"; then + OPT_LDFLAGS="-Wl,-z,relro" + ac_ld_relro=yes + fi + echo "$as_me:$LINENO: result: $ac_ld_relro" >&5 +echo "${ECHO_T}$ac_ld_relro" >&6 + fi + # Set linker optimization flags. if test x"$with_gnu_ld" = x"yes"; then OPT_LDFLAGS="-Wl,-O1 $OPT_LDFLAGS" @@ -82066,6 +82171,21 @@ fi echo "${ECHO_T}$ac_sectionLDflags" >&6 fi + # Set -z,relro. + # Note this is only for shared objects + ac_ld_relro=no + if test x"$with_gnu_ld" = x"yes"; then + echo "$as_me:$LINENO: checking for ld that supports -Wl,-z,relro" >&5 +echo $ECHO_N "checking for ld that supports -Wl,-z,relro... $ECHO_C" >&6 + cxx_z_relo=`$LD -v --help 2>/dev/null | grep "z relro"` + if test -n "$cxx_z_relo"; then + OPT_LDFLAGS="-Wl,-z,relro" + ac_ld_relro=yes + fi + echo "$as_me:$LINENO: result: $ac_ld_relro" >&5 +echo "${ECHO_T}$ac_ld_relro" >&6 + fi + # Set linker optimization flags. if test x"$with_gnu_ld" = x"yes"; then OPT_LDFLAGS="-Wl,-O1 $OPT_LDFLAGS" @@ -83804,6 +83924,21 @@ fi echo "${ECHO_T}$ac_sectionLDflags" >&6 fi + # Set -z,relro. + # Note this is only for shared objects + ac_ld_relro=no + if test x"$with_gnu_ld" = x"yes"; then + echo "$as_me:$LINENO: checking for ld that supports -Wl,-z,relro" >&5 +echo $ECHO_N "checking for ld that supports -Wl,-z,relro... $ECHO_C" >&6 + cxx_z_relo=`$LD -v --help 2>/dev/null | grep "z relro"` + if test -n "$cxx_z_relo"; then + OPT_LDFLAGS="-Wl,-z,relro" + ac_ld_relro=yes + fi + echo "$as_me:$LINENO: result: $ac_ld_relro" >&5 +echo "${ECHO_T}$ac_ld_relro" >&6 + fi + # Set linker optimization flags. if test x"$with_gnu_ld" = x"yes"; then OPT_LDFLAGS="-Wl,-O1 $OPT_LDFLAGS" @@ -85875,6 +86010,21 @@ fi echo "${ECHO_T}$ac_sectionLDflags" >&6 fi + # Set -z,relro. + # Note this is only for shared objects + ac_ld_relro=no + if test x"$with_gnu_ld" = x"yes"; then + echo "$as_me:$LINENO: checking for ld that supports -Wl,-z,relro" >&5 +echo $ECHO_N "checking for ld that supports -Wl,-z,relro... $ECHO_C" >&6 + cxx_z_relo=`$LD -v --help 2>/dev/null | grep "z relro"` + if test -n "$cxx_z_relo"; then + OPT_LDFLAGS="-Wl,-z,relro" + ac_ld_relro=yes + fi + echo "$as_me:$LINENO: result: $ac_ld_relro" >&5 +echo "${ECHO_T}$ac_ld_relro" >&6 + fi + # Set linker optimization flags. if test x"$with_gnu_ld" = x"yes"; then OPT_LDFLAGS="-Wl,-O1 $OPT_LDFLAGS" -- cgit v1.1