libffi unwind test fails

Riccardo Mottola rmottola at opencsw.org
Fri Mar 13 17:16:05 CET 2015


Hi,

the other thread reached a too deep reply level and got a bit out of 
topic :) The summary is: the toolchain supports unwind section type 
returns no even if it should return yes. This makes solaris-x86-64 fail. 
The test is executed only if target is X86_64, this is why we weren't 
seeing the test in the 32bit build.

The full test check in configure.ac is:
if test x$TARGET = xX86_64; then
     AC_CACHE_CHECK([toolchain supports unwind section type],
         libffi_cv_as_x86_64_unwind_section_type, [
         cat  > conftest1.s << EOF
.text
.globl foo
foo:
jmp bar
.section .eh_frame,"a", at unwind
bar:
EOF

         cat > conftest2.c  << EOF
extern void foo();
int main(){foo();}
EOF

         libffi_cv_as_x86_64_unwind_section_type=no
         # we ensure that we can compile _and_ link an assembly file 
containing an @unwind section
         # since the compiler can support it and not the linker (ie old 
binutils)
         if $CC -Wa,--fatal-warnings $CFLAGS -c conftest1.s > /dev/null 
2>&1 && \
            $CC conftest2.c conftest1.o > /dev/null 2>&1 ; then
             libffi_cv_as_x86_64_unwind_section_type=yes
         fi
         ])
     if test "x$libffi_cv_as_x86_64_unwind_section_type" = xyes; then
         AC_DEFINE(HAVE_AS_X86_64_UNWIND_SECTION_TYPE, 1,
                   [Define if your assembler supports unwind section type.])
     fi
fi

it links with $CC a small piece with assembler and tries to see if there 
are warnings.

I created the two files manually, I tried:
gcc -Wa,--fatal-warnings -m64 -c conftest1.s

and got no error. (without -m64, I would get an unrecognized section type)

then I do:
cc -m64 conftest2.c conftest1.o


and get no errors, so the test should pass.

What's wrong?

Riccardo


More information about the maintainers mailing list