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

Bug#693328: gcc-4.7: Please support arch powerpcspe



On 16/11/12 20:43, Roland Stigge wrote:
> 2) powerpcspe patching, omitting certain asm that isn't available on
> powerpcspe
> 
> This fixes build errors like
> 
> /«PKGBUILDDIR»/build/./gcc/xgcc -B/«PKGBUILDDIR»/build/./gcc/
> -B/usr/powerpc-linux-gnuspe/bin/ -B/usr/powerpc-linux-gnuspe/lib/
> -isystem /usr/powerpc-linux-gnuspe/include -isystem
> /usr/powerpc-linux-gnuspe/sys-include    -g -O2 -O2  -g -O2 -DIN_GCC
> -W -Wall -Wwrite-strings -Wcast-qual -Wstrict-prototypes
> -Wmissing-prototypes -Wold-style-definition  -isystem ./include   -fPIC
> -mlong-double-128 -mno-minimal-toc -g -DIN_LIBGCC2 -fbuilding-libgcc
> -fno-stack-protector   -fPIC -mlong-double-128 -mno-minimal-toc -I. -I.
> -I../.././gcc -I../../../src/libgcc -I../../../src/libgcc/.
> -I../../../src/libgcc/../gcc -I../../../src/libgcc/../include
> -I../../../src/libgcc/../libdecnumber/dpd
> -I../../../src/libgcc/../libdecnumber -DHAVE_CC_TLS  -o
> e500crtres32gpr_s.o -MT e500crtres32gpr_s.o -MD -MP -MF
> e500crtres32gpr_s.dep -DSHARED -c -xassembler-with-cpp
> ../../../src/libgcc/config/rs6000/e500crtres32gpr.S
> ../../../src/libgcc/config/rs6000/crtresxfpr.S: Assembler messages:
> ../../../src/libgcc/config/rs6000/crtresxfpr.S:64: Error: Unrecognized
> opcode: `lfd'
> 
>> Also, afaics, the port wasn't built with multilibs enabled yet. If you do so,
>> then don't just update the generated control file. Also you should get some
>> consensus which multiarch triplets to use for the multilibs.
> 
> I thought I have seen multilib stuff in
> /usr/lib/powerpc-linux-gnuspe/ on debian-ports.org but currently can't
> remember which package. So enabled it for other packages also since
> powerpc also has this layout.
> 
> However, powerpcspe hardware isn't able to run code from powerpc or
> powerpc64, and vice versa. What would be the right strategy here?
> Staying away from multilib for powerpcspe and putting everything
> directly in /usr/lib/?

Sorry, I was confusing multiarch and multilib.

Attaching a reduced patch that fixes the above compile error by
preventing floating point register handling when there are none available.

Thanks,

Roland
diff -ruN gcc-4.7-4.7.2.backup/debian/patches/powerpc_nofprs.diff gcc-4.7-4.7.2/debian/patches/powerpc_nofprs.diff
--- gcc-4.7-4.7.2.backup/debian/patches/powerpc_nofprs.diff	1970-01-01 01:00:00.000000000 +0100
+++ gcc-4.7-4.7.2/debian/patches/powerpc_nofprs.diff	2012-11-10 07:53:10.724792401 +0100
@@ -0,0 +1,45 @@
+--- gcc-4.7-4.7.2/src/libgcc/config/rs6000/crtsavfpr.S.orig	2012-11-09 21:11:13.923320372 +0100
++++ gcc-4.7-4.7.2/src/libgcc/config/rs6000/crtsavfpr.S	2012-11-09 21:12:06.083333334 +0100
+@@ -33,6 +33,7 @@
+ 
+ /* On PowerPC64 Linux, these functions are provided by the linker.  */
+ #ifndef __powerpc64__
++#ifndef __NO_FPRS__
+ 
+ /* Routines for saving floating point registers, called by the compiler.  */
+ /* Called with r11 pointing to the stack header word of the caller of the */
+@@ -79,3 +80,4 @@
+ CFI_ENDPROC
+ 
+ #endif
++#endif
+--- gcc-4.7-4.7.2/src/libgcc/config/rs6000/crtresfpr.S.orig	2012-11-10 00:18:44.590113135 +0100
++++ gcc-4.7-4.7.2/src/libgcc/config/rs6000/crtresfpr.S	2012-11-10 00:19:15.414120795 +0100
+@@ -33,6 +33,7 @@
+ 
+ /* On PowerPC64 Linux, these functions are provided by the linker.  */
+ #ifndef __powerpc64__
++#ifndef __NO_FPRS__
+ 
+ /* Routines for restoring floating point registers, called by the compiler.  */
+ /* Called with r11 pointing to the stack header word of the caller of the */
+@@ -79,3 +80,4 @@
+ CFI_ENDPROC
+ 
+ #endif
++#endif
+--- gcc-4.7-4.7.2/src/libgcc/config/rs6000/crtresxfpr.S.orig	2012-11-10 07:48:47.768732506 +0100
++++ gcc-4.7-4.7.2/src/libgcc/config/rs6000/crtresxfpr.S	2012-11-10 07:51:31.584768060 +0100
+@@ -33,6 +33,7 @@
+ 
+ /* On PowerPC64 Linux, these functions are provided by the linker.  */
+ #ifndef __powerpc64__
++#ifndef __NO_FPRS__
+ 
+ /* Routines for restoring floating point registers, called by the compiler.  */
+ /* Called with r11 pointing to the stack header word of the caller of the */
+@@ -124,3 +125,4 @@
+ CFI_ENDPROC
+ 
+ #endif
++#endif
diff -ruN gcc-4.7-4.7.2.backup/debian/rules.patch gcc-4.7-4.7.2/debian/rules.patch
--- gcc-4.7-4.7.2.backup/debian/rules.patch	2012-11-11 12:13:52.000000000 +0100
+++ gcc-4.7-4.7.2/debian/rules.patch	2012-11-09 21:15:28.415383574 +0100
@@ -200,6 +200,7 @@
 
 ifeq ($(DEB_TARGET_ARCH),powerpcspe)
   debian_patches += powerpc_remove_many
+  debian_patches += powerpc_nofprs
 endif
 
 ifeq ($(DEB_TARGET_ARCH),ppc64)

Reply to: