diff options
author | Benjamin Kosnik <bkoz@redhat.com> | 2006-01-12 00:17:38 +0000 |
---|---|---|
committer | Benjamin Kosnik <bkoz@gcc.gnu.org> | 2006-01-12 00:17:38 +0000 |
commit | a429affe7d92a52d5923cb398a2f2f10a12891b7 (patch) | |
tree | 9db6d28a1313c7946304f0fd8536ac7cbacfecd1 /libstdc++-v3 | |
parent | 257c8aec25c3109bccae22147a234e51499bb4da (diff) | |
download | gcc-a429affe7d92a52d5923cb398a2f2f10a12891b7.zip gcc-a429affe7d92a52d5923cb398a2f2f10a12891b7.tar.gz gcc-a429affe7d92a52d5923cb398a2f2f10a12891b7.tar.bz2 |
acinclude.m4: Use -Wl,-z,relro if possible.
2006-01-11 Benjamin Kosnik <bkoz@redhat.com>
* acinclude.m4: Use -Wl,-z,relro if possible.
* configure: Regenerate.
From-SVN: r109618
Diffstat (limited to 'libstdc++-v3')
-rw-r--r-- | libstdc++-v3/ChangeLog | 5 | ||||
-rw-r--r-- | libstdc++-v3/acinclude.m4 | 15 | ||||
-rwxr-xr-x | libstdc++-v3/configure | 150 |
3 files changed, 169 insertions, 1 deletions
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 <bkoz@redhat.com> + + * acinclude.m4: Use -Wl,-z,relro if possible. + * configure: Regenerate. + 2006-01-10 Paolo Carlini <pcarlini@suse.de> * 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" |