On Fri, Sep 28, 2007 at 12:17:56PM +0200, Martin Michlmayr wrote:
> Are you sure about that?  I believe I've built my toolchain correctly
> for powerpc soft-float, but binutils doesn't complain at all about
> this code.  As a result, liboil builds for FPU but then later on GCC
> fails to compile some source file in liboil because of assembler
> constraints that cannot be met.

Here's a patch that is completely untested.  If you happen to have a
gcc with FP enabled, please test it.  Otherwise, it will get tested
whenever I do another release.



dave...

Index: m4/as-gcc-inline-assembly.m4
===================================================================
RCS file: /cvs/liboil/liboil/m4/as-gcc-inline-assembly.m4,v
retrieving revision 1.4
diff -u -u -r1.4 as-gcc-inline-assembly.m4
--- m4/as-gcc-inline-assembly.m4	17 Mar 2007 02:03:30 -0000	1.4
+++ m4/as-gcc-inline-assembly.m4	28 Sep 2007 21:19:10 -0000
@@ -38,7 +38,7 @@
 [
   AC_MSG_CHECKING([if compiler supports FPU instructions on PowerPC])
 
-  AC_TRY_COMPILE([], [__asm__ ("fadd 0,0,0"::) ], [flag_ok=yes], [flag_ok=no])
+  AC_TRY_COMPILE([], [double x = 0; __asm__ ("fadd 0,0,0"::"f" (x):"32") ], [flag_ok=yes], [flag_ok=no])
 
   if test "X$flag_ok" = Xyes ; then
     $1

Reply via email to