[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#730020: libffi: FTBFS on powerpcspe: New code breaks port



Source: libffi
Version: 3.0.13-5
Severity: wishlist
Tags: patch sid
User: debian-powerpcspe@breakpoint.cc
Usertags: powerpcspe

Hi,

libffi currently FTBFS on powerpcspe like this:

...
libtool: compile:  powerpc-linux-gnuspe-gcc -DHAVE_CONFIG_H -I. -I.. -I. -I../include -Iinclude -I../src -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -Wall -fexceptions -MT src/powerpc/ffi.lo -MD -MP -MF src/powerpc/.deps/ffi.Tpo -c ../src/powerpc/ffi.c  -fPIC -DPIC -o src/powerpc/.libs/ffi.o
../src/powerpc/ffi.c: In function 'ffi_prep_cif_machdep_core':
../src/powerpc/ffi.c:981:24: error: 'NUM_FPR_ARG_REGISTERS' undeclared (first use in this function)
../src/powerpc/ffi.c:981:24: note: each undeclared identifier is reported only once for each function it appears in
../src/powerpc/ffi.c: In function 'ffi_closure_helper_LINUX64':
../src/powerpc/ffi.c:1797:25: error: 'FLAG_RETURNS_FP' undeclared (first use in this function)
make[3]: *** [src/powerpc/ffi.lo] Error 1
make[3]: Leaving directory `/«PKGBUILDDIR»/build'
make[2]: *** [all-recursive] Error 1
make[1]: *** [all] Error 2
make: *** [stamp-build] Error 2
...

The codebase supports powerpcspe already, but some recent changes broke it.
Attaching a patch that fixes it via the __NO_FPRS__ conditionals already used
in all the other powerpcspe specific places.

Roland


-- System Information:
Debian Release: 7.0
  APT prefers unreleased
  APT policy: (500, 'unreleased'), (500, 'unstable')
Architecture: powerpcspe (ppc)

Kernel: Linux 3.9.0-dirty (SMP w/2 CPU cores)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8) (ignored: LC_ALL set to en_GB.UTF-8)
Shell: /bin/sh linked to /bin/dash
Index: libffi-3.0.13/src/powerpc/ffi.c
===================================================================
--- libffi-3.0.13.orig/src/powerpc/ffi.c	2013-11-20 07:24:56.000000000 +0100
+++ libffi-3.0.13/src/powerpc/ffi.c	2013-11-20 07:32:16.639021999 +0100
@@ -974,6 +974,7 @@
 
 	switch ((*ptr)->type)
 	  {
+#ifndef __NO_FPRS__
 #if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
 	  case FFI_TYPE_LONGDOUBLE:
 	    fparg_count += 2;
@@ -989,7 +990,7 @@
 	    if (fparg_count > NUM_FPR_ARG_REGISTERS)
 	      flags |= FLAG_ARG_NEEDS_PSAVE;
 	    break;
-
+#endif
 	  case FFI_TYPE_STRUCT:
 #ifdef __STRUCT_PARM_ALIGN__
 	    align = (*ptr)->alignment;
@@ -1004,6 +1005,7 @@
 #if _CALL_ELF == 2
 	    elt = discover_homogeneous_aggregate (*ptr, &elnum);
 #endif
+#ifndef __NO_FPRS__
 	    if (elt)
 	      {
 		fparg_count += elnum;
@@ -1011,6 +1013,7 @@
 		  flags |= FLAG_ARG_NEEDS_PSAVE;
 	      }
 	    else
+#endif
 	      {
 		if (intarg_count > NUM_GPR_ARG_REGISTERS)
 		  flags |= FLAG_ARG_NEEDS_PSAVE;
@@ -1794,9 +1797,12 @@
   /* Tell ffi_closure_LINUX64 how to perform return type promotions.  */
   if ((cif->flags & FLAG_RETURNS_SMST) != 0)
     {
+#ifndef __NO_FPRS__
       if ((cif->flags & FLAG_RETURNS_FP) == 0)
 	return FFI_V2_TYPE_SMALL_STRUCT + cif->rtype->size - 1;
-      else if ((cif->flags & FLAG_RETURNS_64BITS) != 0)
+      else
+#endif
+      if ((cif->flags & FLAG_RETURNS_64BITS) != 0)
 	return FFI_V2_TYPE_DOUBLE_HOMOG;
       else
 	return FFI_V2_TYPE_FLOAT_HOMOG;

Reply to: