public inbox for libffi-discuss@sourceware.org
 help / color / mirror / Atom feed
* [patch] Check for libffi_cv_as_x86_pcrel should not look for just "warning"
@ 2011-02-04 20:36 Rafael Avila de Espindola
  2011-03-27  3:55 ` Rafael Ávila de Espíndola
  0 siblings, 1 reply; 2+ messages in thread
From: Rafael Avila de Espindola @ 2011-02-04 20:36 UTC (permalink / raw)
  To: libffi-discuss

[-- Attachment #1: Type: text/plain, Size: 420 bytes --]

The check that sets libffi_cv_as_x86_pcrel currently check for "warning" 
or "illegal". The problem is that when trying to build libffi with LTO 
clang will produce the warning

clang: warning: argument unused during compilation: '-emit-llvm'

The attached patch just uses the $CC error code instead. Is that OK or 
is there some strange assembler out there that rejects the assembly bug 
exists with 0?

Cheers,
Rafael

[-- Attachment #2: pcrel.patch --]
[-- Type: text/x-patch, Size: 1237 bytes --]

diff --git a/configure b/configure
index e086c65..a1c5ec8 100755
--- a/configure
+++ b/configure
@@ -14506,10 +14506,10 @@ if test "${libffi_cv_as_x86_pcrel+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
 
-	libffi_cv_as_x86_pcrel=yes
+	libffi_cv_as_x86_pcrel=no
 	echo '.text; foo: nop; .data; .long foo-.; .text' > conftest.s
-	if $CC $CFLAGS -c conftest.s 2>&1 | $EGREP -i 'illegal|warning' > /dev/null; then
-	    libffi_cv_as_x86_pcrel=no
+	if $CC $CFLAGS -c conftest.s > /dev/null; then
+	    libffi_cv_as_x86_pcrel=yes
 	fi
 
 fi
diff --git a/configure.ac b/configure.ac
index c7cead8..c12c858 100644
--- a/configure.ac
+++ b/configure.ac
@@ -276,10 +276,10 @@ fi
 if test x$TARGET = xX86 || test x$TARGET = xX86_WIN32 || test x$TARGET = xX86_64; then
     AC_CACHE_CHECK([assembler supports pc related relocs],
 	libffi_cv_as_x86_pcrel, [
-	libffi_cv_as_x86_pcrel=yes
+	libffi_cv_as_x86_pcrel=no
 	echo '.text; foo: nop; .data; .long foo-.; .text' > conftest.s
-	if $CC $CFLAGS -c conftest.s 2>&1 | $EGREP -i 'illegal|warning' > /dev/null; then
-	    libffi_cv_as_x86_pcrel=no
+	if $CC $CFLAGS -c conftest.s > /dev/null; then
+	    libffi_cv_as_x86_pcrel=yes
 	fi
 	])
     if test "x$libffi_cv_as_x86_pcrel" = xyes; then

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [patch] Check for libffi_cv_as_x86_pcrel should not look for just "warning"
  2011-02-04 20:36 [patch] Check for libffi_cv_as_x86_pcrel should not look for just "warning" Rafael Avila de Espindola
@ 2011-03-27  3:55 ` Rafael Ávila de Espíndola
  0 siblings, 0 replies; 2+ messages in thread
From: Rafael Ávila de Espíndola @ 2011-03-27  3:55 UTC (permalink / raw)
  To: libffi-discuss

Ping.

FYI, this is https://bugzilla.mozilla.org/show_bug.cgi?id=631928

On 11-02-04 3:35 PM, Rafael Avila de Espindola wrote:
> The check that sets libffi_cv_as_x86_pcrel currently check for "warning"
> or "illegal". The problem is that when trying to build libffi with LTO
> clang will produce the warning
>
> clang: warning: argument unused during compilation: '-emit-llvm'
>
> The attached patch just uses the $CC error code instead. Is that OK or
> is there some strange assembler out there that rejects the assembly bug
> exists with 0?

Cheers,
Rafael

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-03-27  3:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-04 20:36 [patch] Check for libffi_cv_as_x86_pcrel should not look for just "warning" Rafael Avila de Espindola
2011-03-27  3:55 ` Rafael Ávila de Espíndola

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).