[FFmpeg-devel] [PATCH] more reliable ebx_available check

Reimar Döffinger Reimar.Doeffinger
Wed Sep 30 18:32:34 CEST 2009


On Wed, Sep 30, 2009 at 05:21:51PM +0100, M?ns Rullg?rd wrote:
> Reimar D?ffinger <Reimar.Doeffinger at gmx.de> writes:
> 
> > Hello,
> > possibly a compiler bug, but still...
> > For at least Haiku and OpenBSD, but maybe all target that have PIE
> > enabled by default ebx is incorrectly detected as available.
> > This is because compiling with an ebx clobber succeeds, only when
> > using "b" constraint there is "no register in class BREG" error.
> > This patch fixes it:
> > Index: configure
> > ===================================================================
> > --- configure   (revision 20097)
> > +++ configure   (working copy)
> > @@ -573,7 +573,7 @@
> >      asm="$2"
> >      shift 2
> >      check_as "$@" <<EOF && enable $name || disable $name
> > -void foo(void){ __asm__ volatile($asm); }
> > +void foo(void){ int x; __asm__ volatile($asm); }
> >  EOF
> >  }
> >
> > @@ -2162,7 +2162,7 @@
> >  EOF
> >
> >      # check whether EBX is available on x86
> > -    check_asm ebx_available '"":::"%ebx"'
> > +    check_asm ebx_available '"":"=b"(x)::'
> 
> Drop the trailing colons.  Does it work if you make that register
> constraint "b"(0) instead?  Not that it's really important.

Yes, this one seems to work, too:
Index: configure
===================================================================
--- configure   (revision 20097)
+++ configure   (working copy)
@@ -2162,7 +2162,7 @@
 EOF
 
     # check whether EBX is available on x86
-    check_asm ebx_available '"":::"%ebx"'
+    check_asm ebx_available '""::"b"(0)'
 
     # check whether more than 10 operands are supported
     check_cc <<EOF && enable ten_operands



More information about the ffmpeg-devel mailing list