diff options
author | Rainer Orth <ro@TechFak.Uni-Bielefeld.DE> | 2008-11-03 19:03:28 +0000 |
---|---|---|
committer | Rainer Orth <ro@gcc.gnu.org> | 2008-11-03 19:03:28 +0000 |
commit | e73da78efc08838680dee919a4eb060d2f8c78dd (patch) | |
tree | e1c7db8e560673c1ec98021fc00dd8b80706e68c /gcc/configure | |
parent | e1ece9f1f2035e4315bf8a79d0fa7fe6cab60343 (diff) | |
download | gcc-e73da78efc08838680dee919a4eb060d2f8c78dd.tar.gz |
re PR other/37463 (All Solaris/x86 eh tests fail)
PR other/37463
* configure.ac (gcc_cv_ld_ro_rw_mix): Move before
gcc_cv_as_cfi_directive.
(gcc_cv_as_cfi_directive) [*-*-solaris*]: Check if linker supports
merging read-only and read-write sections or assembler emits
read-write .eh_frame sections.
* configure: Regenerate.
From-SVN: r141555
Diffstat (limited to 'gcc/configure')
-rwxr-xr-x | gcc/configure | 108 |
1 files changed, 66 insertions, 42 deletions
diff --git a/gcc/configure b/gcc/configure index 007ee7335f9..649039d4e03 100755 --- a/gcc/configure +++ b/gcc/configure @@ -21471,6 +21471,47 @@ _ACEOF fi +echo "$as_me:$LINENO: checking linker read-only and read-write section mixing" >&5 +echo $ECHO_N "checking linker read-only and read-write section mixing... $ECHO_C" >&6 +gcc_cv_ld_ro_rw_mix=unknown +if test $in_tree_ld = yes ; then + if test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 10 -o "$gcc_cv_gld_major_version" -gt 2 \ + && test $in_tree_ld_is_elf = yes; then + gcc_cv_ld_ro_rw_mix=read-write + fi +elif test x$gcc_cv_as != x -a x$gcc_cv_ld != x -a x$gcc_cv_objdump != x ; then + echo '.section myfoosect, "a"' > conftest1.s + echo '.section myfoosect, "aw"' > conftest2.s + echo '.byte 1' >> conftest2.s + echo '.section myfoosect, "a"' > conftest3.s + echo '.byte 0' >> conftest3.s + if $gcc_cv_as -o conftest1.o conftest1.s > /dev/null 2>&1 \ + && $gcc_cv_as -o conftest2.o conftest2.s > /dev/null 2>&1 \ + && $gcc_cv_as -o conftest3.o conftest3.s > /dev/null 2>&1 \ + && $gcc_cv_ld -shared -o conftest1.so conftest1.o \ + conftest2.o conftest3.o > /dev/null 2>&1; then + gcc_cv_ld_ro_rw_mix=`$gcc_cv_objdump -h conftest1.so \ + | sed -e '/myfoosect/!d' -e N` + if echo "$gcc_cv_ld_ro_rw_mix" | grep CONTENTS > /dev/null; then + if echo "$gcc_cv_ld_ro_rw_mix" | grep READONLY > /dev/null; then + gcc_cv_ld_ro_rw_mix=read-only + else + gcc_cv_ld_ro_rw_mix=read-write + fi + fi + fi + rm -f conftest.* conftest[123].* +fi +if test x$gcc_cv_ld_ro_rw_mix = xread-write; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_LD_RO_RW_SECTION_MIXING 1 +_ACEOF + +fi +echo "$as_me:$LINENO: result: $gcc_cv_ld_ro_rw_mix" >&5 +echo "${ECHO_T}$gcc_cv_ld_ro_rw_mix" >&6 + # Check if we have .[us]leb128, and support symbol arithmetic with it. echo "$as_me:$LINENO: checking assembler for .sleb128 and .uleb128" >&5 echo $ECHO_N "checking assembler for .sleb128 and .uleb128... $ECHO_C" >&6 @@ -21552,7 +21593,31 @@ else echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } then - gcc_cv_as_cfi_directive=yes + case "$target" in + *-*-solaris*) + # If the linker used on Solaris (like Sun ld) isn't capable of merging + # read-only and read-write sections, we need to make sure that the + # assembler used emits read-write .eh_frame sections. + if test "x$gcc_cv_ld_ro_rw_mix" != xread-write; then + if test "x$gcc_cv_objdump" != x; then + if $gcc_cv_objdump -h conftest.o 2>/dev/null | \ + sed -e /.eh_frame/!d -e N | grep READONLY > /dev/null; then + gcc_cv_as_cfi_directive=no + else + gcc_cv_as_cfi_directive=yes + fi + else + # no objdump, err on the side of caution + gcc_cv_as_cfi_directive=no + fi + else + gcc_cv_as_cfi_directive=yes + fi + ;; + *-*-*) + gcc_cv_as_cfi_directive=yes + ;; +esac else echo "configure: failed program was" >&5 cat conftest.s >&5 @@ -23876,47 +23941,6 @@ _ACEOF fi -echo "$as_me:$LINENO: checking linker read-only and read-write section mixing" >&5 -echo $ECHO_N "checking linker read-only and read-write section mixing... $ECHO_C" >&6 -gcc_cv_ld_ro_rw_mix=unknown -if test $in_tree_ld = yes ; then - if test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 10 -o "$gcc_cv_gld_major_version" -gt 2 \ - && test $in_tree_ld_is_elf = yes; then - gcc_cv_ld_ro_rw_mix=read-write - fi -elif test x$gcc_cv_as != x -a x$gcc_cv_ld != x -a x$gcc_cv_objdump != x ; then - echo '.section myfoosect, "a"' > conftest1.s - echo '.section myfoosect, "aw"' > conftest2.s - echo '.byte 1' >> conftest2.s - echo '.section myfoosect, "a"' > conftest3.s - echo '.byte 0' >> conftest3.s - if $gcc_cv_as -o conftest1.o conftest1.s > /dev/null 2>&1 \ - && $gcc_cv_as -o conftest2.o conftest2.s > /dev/null 2>&1 \ - && $gcc_cv_as -o conftest3.o conftest3.s > /dev/null 2>&1 \ - && $gcc_cv_ld -shared -o conftest1.so conftest1.o \ - conftest2.o conftest3.o > /dev/null 2>&1; then - gcc_cv_ld_ro_rw_mix=`$gcc_cv_objdump -h conftest1.so \ - | sed -e '/myfoosect/!d' -e N` - if echo "$gcc_cv_ld_ro_rw_mix" | grep CONTENTS > /dev/null; then - if echo "$gcc_cv_ld_ro_rw_mix" | grep READONLY > /dev/null; then - gcc_cv_ld_ro_rw_mix=read-only - else - gcc_cv_ld_ro_rw_mix=read-write - fi - fi - fi - rm -f conftest.* conftest[123].* -fi -if test x$gcc_cv_ld_ro_rw_mix = xread-write; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_LD_RO_RW_SECTION_MIXING 1 -_ACEOF - -fi -echo "$as_me:$LINENO: result: $gcc_cv_ld_ro_rw_mix" >&5 -echo "${ECHO_T}$gcc_cv_ld_ro_rw_mix" >&6 - echo "$as_me:$LINENO: checking linker PT_GNU_EH_FRAME support" >&5 echo $ECHO_N "checking linker PT_GNU_EH_FRAME support... $ECHO_C" >&6 gcc_cv_ld_eh_frame_hdr=no |