configure.ac (libffi_cv_as_x86_pcrel): Check for illegal in as output, too.

* configure.ac (libffi_cv_as_x86_pcrel): Check for illegal in as
	output, too.
	(libffi_cv_as_ascii_pseudo_op): Check for .ascii.
	(libffi_cv_as_string_pseudo_op): Check for .string.
	* configure: Regenerate.
	* fficonfig.h.in: Regenerate.
	* src/x86/sysv.S (.eh_frame): Use .ascii, .string or error.

From-SVN: r159583
This commit is contained in:
Rainer Orth 2010-05-19 15:57:18 +00:00 committed by Rainer Orth
parent eddd960d04
commit b134b9f37b
5 changed files with 125 additions and 3 deletions

View File

@ -1,3 +1,13 @@
2010-05-19 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
* configure.ac (libffi_cv_as_x86_pcrel): Check for illegal in as
output, too.
(libffi_cv_as_ascii_pseudo_op): Check for .ascii.
(libffi_cv_as_string_pseudo_op): Check for .string.
* configure: Regenerate.
* fficonfig.h.in: Regenerate.
* src/x86/sysv.S (.eh_frame): Use .ascii, .string or error.
2010-05-19 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
Backport from mainline:

72
libffi/configure vendored
View File

@ -13272,7 +13272,7 @@ else
libffi_cv_as_x86_pcrel=yes
echo '.text; foo: nop; .data; .long foo-.; .text' > conftest.s
if $CC $CFLAGS -c conftest.s 2>&1 | grep -i warning > /dev/null; then
if $CC $CFLAGS -c conftest.s 2>&1 | $EGREP -i 'illegal|warning' > /dev/null; then
libffi_cv_as_x86_pcrel=no
fi
@ -13286,6 +13286,76 @@ cat >>confdefs.h <<\_ACEOF
_ACEOF
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler .ascii pseudo-op support" >&5
$as_echo_n "checking assembler .ascii pseudo-op support... " >&6; }
if test "${libffi_cv_as_ascii_pseudo_op+set}" = set; then :
$as_echo_n "(cached) " >&6
else
libffi_cv_as_ascii_pseudo_op=unknown
# Check if we have .ascii
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
asm (".ascii \"string\"");
int
main ()
{
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
libffi_cv_as_ascii_pseudo_op=yes
else
libffi_cv_as_ascii_pseudo_op=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libffi_cv_as_ascii_pseudo_op" >&5
$as_echo "$libffi_cv_as_ascii_pseudo_op" >&6; }
if test "x$libffi_cv_as_ascii_pseudo_op" = xyes; then
$as_echo "#define HAVE_AS_ASCII_PSEUDO_OP 1" >>confdefs.h
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler .string pseudo-op support" >&5
$as_echo_n "checking assembler .string pseudo-op support... " >&6; }
if test "${libffi_cv_as_string_pseudo_op+set}" = set; then :
$as_echo_n "(cached) " >&6
else
libffi_cv_as_string_pseudo_op=unknown
# Check if we have .string
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
asm (".string \"string\"");
int
main ()
{
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
libffi_cv_as_string_pseudo_op=yes
else
libffi_cv_as_string_pseudo_op=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libffi_cv_as_string_pseudo_op" >&5
$as_echo "$libffi_cv_as_string_pseudo_op" >&6; }
if test "x$libffi_cv_as_string_pseudo_op" = xyes; then
$as_echo "#define HAVE_AS_STRING_PSEUDO_OP 1" >>confdefs.h
fi
fi
if test x$TARGET = xX86_64; then

View File

@ -245,7 +245,7 @@ if test x$TARGET = xX86 || test x$TARGET = xX86_64; then
libffi_cv_as_x86_pcrel, [
libffi_cv_as_x86_pcrel=yes
echo '.text; foo: nop; .data; .long foo-.; .text' > conftest.s
if $CC $CFLAGS -c conftest.s 2>&1 | grep -i warning > /dev/null; then
if $CC $CFLAGS -c conftest.s 2>&1 | $EGREP -i 'illegal|warning' > /dev/null; then
libffi_cv_as_x86_pcrel=no
fi
])
@ -253,6 +253,32 @@ if test x$TARGET = xX86 || test x$TARGET = xX86_64; then
AC_DEFINE(HAVE_AS_X86_PCREL, 1,
[Define if your assembler supports PC relative relocs.])
fi
AC_CACHE_CHECK([assembler .ascii pseudo-op support],
libffi_cv_as_ascii_pseudo_op, [
libffi_cv_as_ascii_pseudo_op=unknown
# Check if we have .ascii
AC_TRY_COMPILE([asm (".ascii \"string\"");],,
[libffi_cv_as_ascii_pseudo_op=yes],
[libffi_cv_as_ascii_pseudo_op=no])
])
if test "x$libffi_cv_as_ascii_pseudo_op" = xyes; then
AC_DEFINE(HAVE_AS_ASCII_PSEUDO_OP, 1,
[Define if your assembler supports .ascii.])
fi
AC_CACHE_CHECK([assembler .string pseudo-op support],
libffi_cv_as_string_pseudo_op, [
libffi_cv_as_string_pseudo_op=unknown
# Check if we have .string
AC_TRY_COMPILE([asm (".string \"string\"");],,
[libffi_cv_as_string_pseudo_op=yes],
[libffi_cv_as_string_pseudo_op=no])
])
if test "x$libffi_cv_as_string_pseudo_op" = xyes; then
AC_DEFINE(HAVE_AS_STRING_PSEUDO_OP, 1,
[Define if your assembler supports .string.])
fi
fi
if test x$TARGET = xX86_64; then

View File

@ -27,6 +27,9 @@
*/
#undef HAVE_ALLOCA_H
/* Define if your assembler supports .ascii. */
#undef HAVE_AS_ASCII_PSEUDO_OP
/* Define if your assembler supports .cfi_* directives. */
#undef HAVE_AS_CFI_PSEUDO_OP
@ -37,6 +40,9 @@
*/
#undef HAVE_AS_SPARC_UA_PCREL
/* Define if your assembler supports .string. */
#undef HAVE_AS_STRING_PSEUDO_OP
/* Define if your assembler supports unwind section type. */
#undef HAVE_AS_X86_64_UNWIND_SECTION_TYPE

View File

@ -1,5 +1,5 @@
/* -----------------------------------------------------------------------
sysv.S - Copyright (c) 1996, 1998, 2001, 2002, 2003, 2005, 2008
sysv.S - Copyright (c) 1996, 1998, 2001, 2002, 2003, 2005, 2008, 2010
Red Hat, Inc.
X86 Foreign Function Interface
@ -331,10 +331,20 @@ ffi_closure_raw_SYSV:
.LSCIE1:
.long 0x0 /* CIE Identifier Tag */
.byte 0x1 /* CIE Version */
#ifdef HAVE_AS_ASCII_PSEUDO_OP
#ifdef __PIC__
.ascii "zR\0" /* CIE Augmentation */
#else
.ascii "\0" /* CIE Augmentation */
#endif
#elif defined HAVE_AS_STRING_PSEUDO_OP
#ifdef __PIC__
.string "zR" /* CIE Augmentation */
#else
.string "" /* CIE Augmentation */
#endif
#else
#error missing .ascii/.string
#endif
.byte 0x1 /* .uleb128 0x1; CIE Code Alignment Factor */
.byte 0x7c /* .sleb128 -4; CIE Data Alignment Factor */