From: Anthony Green Date: Tue, 8 Jan 2013 17:22:24 +0000 (-0500) Subject: Fix read-only eh_frame test X-Git-Tag: v3.0.12~49 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8962c8c8d06803e310bac0ffc8e84ea15daeff3f;p=platform%2Fupstream%2Flibffi.git Fix read-only eh_frame test --- diff --git a/ChangeLog b/ChangeLog index 464dbe8..88e3659 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2013-01-08 Anthony Green + + * configure.ac: Fix test for read-only eh_frame. + * configure: Rebuilt. + 2013-01-08 Anthony Green * src/x86/sysv.S, src/x86/unix64.S: Only emit DWARF unwind info diff --git a/configure b/configure index c4d1e8d..142bb86 100755 --- a/configure +++ b/configure @@ -14635,11 +14635,12 @@ else libffi_cv_ro_eh_frame=no echo 'extern void foo (void); void bar (void) { foo (); foo (); }' > conftest.c - if $CC $CFLAGS -S -fpic -fexceptions -o conftest.s conftest.c > /dev/null 2>&1; then - if grep '.section.*eh_frame.*"a"' conftest.s > /dev/null; then - libffi_cv_ro_eh_frame=yes - elif grep '.section.*eh_frame.*#alloc' conftest.c \ - | grep -v '#write' > /dev/null; then + if $CC $CFLAGS -c -fpic -fexceptions -o conftest.o conftest.c > /dev/null 2>&1; then + objdump -h conftest.o > conftest.dump 2>&1 + libffi_eh_frame_line=`grep -n eh_frame conftest.dump | cut -d: -f 1` + libffi_test_line=`expr $libffi_eh_frame_line + 1`p + sed -n $libffi_test_line conftest.dump > conftest.line + if grep READONLY conftest.line > /dev/null; then libffi_cv_ro_eh_frame=yes fi fi diff --git a/configure.ac b/configure.ac index 78f54af..b62dd6f 100644 --- a/configure.ac +++ b/configure.ac @@ -402,11 +402,12 @@ if test "x$GCC" = "xyes"; then libffi_cv_ro_eh_frame, [ libffi_cv_ro_eh_frame=no echo 'extern void foo (void); void bar (void) { foo (); foo (); }' > conftest.c - if $CC $CFLAGS -S -fpic -fexceptions -o conftest.s conftest.c > /dev/null 2>&1; then - if grep '.section.*eh_frame.*"a"' conftest.s > /dev/null; then - libffi_cv_ro_eh_frame=yes - elif grep '.section.*eh_frame.*#alloc' conftest.c \ - | grep -v '#write' > /dev/null; then + if $CC $CFLAGS -c -fpic -fexceptions -o conftest.o conftest.c > /dev/null 2>&1; then + objdump -h conftest.o > conftest.dump 2>&1 + libffi_eh_frame_line=`grep -n eh_frame conftest.dump | cut -d: -f 1` + libffi_test_line=`expr $libffi_eh_frame_line + 1`p + sed -n $libffi_test_line conftest.dump > conftest.line + if grep READONLY conftest.line > /dev/null; then libffi_cv_ro_eh_frame=yes fi fi