Package: llvm-3.2
Version: 3.2-1
Severity: wishlist
Tags: patch sid
User: [email protected]
Usertags: powerpcspe
Hi,
building llvm-3.2 on powerpcspe [1] currently results in:
[...]
if powerpc-linux-gnuspe-g++ -I/«PKGBUILDDIR»/build-llvm/include
-I/«PKGBUILDDIR»/build-llvm/lib/Target/PowerPC -I/«PKGBUILDDIR»/include
-I/«PKGBUILDDIR»/lib/Target/PowerPC -DNDEBUG -D_GNU_SOURCE
-D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -g -O2
-fomit-frame-pointer -fvisibility-inlines-hidden -fno-exceptions -fPIC
-Woverloaded-virtual -Wcast-qual -pedantic -Wno-long-long -Wall -W
-Wno-unused-parameter -Wwrite-strings -c -MMD -MP -MF
"/«PKGBUILDDIR»/build-llvm/lib/Target/PowerPC/Release/PPCJITInfo.d.tmp" -MT
"/«PKGBUILDDIR»/build-llvm/lib/Target/PowerPC/Release/PPCJITInfo.o" -MT
"/«PKGBUILDDIR»/build-llvm/lib/Target/PowerPC/Release/PPCJITInfo.d"
/«PKGBUILDDIR»/lib/Target/PowerPC/PPCJITInfo.cpp -o
/«PKGBUILDDIR»/build-llvm/lib/Target/PowerPC/Release/PPCJITInfo.o ; \
then /bin/mv -f
"/«PKGBUILDDIR»/build-llvm/lib/Target/PowerPC/Release/PPCJITInfo.d.tmp"
"/«PKGBUILDDIR»/build-llvm/lib/Target/PowerPC/Release/PPCJITInfo.d"; else
/bin/rm
"/«PKGBUILDDIR»/build-llvm/lib/Target/PowerPC/Release/PPCJITInfo.d.tmp"; exit
1; fi
/tmp/ccZzzlPj.s: Assembler messages:
/tmp/ccZzzlPj.s:23: Error: Unrecognized opcode: `stfd'
/tmp/ccZzzlPj.s:24: Error: Unrecognized opcode: `stfd'
/tmp/ccZzzlPj.s:25: Error: Unrecognized opcode: `stfd'
/tmp/ccZzzlPj.s:26: Error: Unrecognized opcode: `stfd'
/tmp/ccZzzlPj.s:27: Error: Unrecognized opcode: `stfd'
/tmp/ccZzzlPj.s:28: Error: Unrecognized opcode: `stfd'
/tmp/ccZzzlPj.s:29: Error: Unrecognized opcode: `stfd'
/tmp/ccZzzlPj.s:30: Error: Unrecognized opcode: `stfd'
/tmp/ccZzzlPj.s:45: Error: Unrecognized opcode: `lfd'
/tmp/ccZzzlPj.s:46: Error: Unrecognized opcode: `lfd'
/tmp/ccZzzlPj.s:47: Error: Unrecognized opcode: `lfd'
/tmp/ccZzzlPj.s:48: Error: Unrecognized opcode: `lfd'
/tmp/ccZzzlPj.s:49: Error: Unrecognized opcode: `lfd'
/tmp/ccZzzlPj.s:50: Error: Unrecognized opcode: `lfd'
/tmp/ccZzzlPj.s:51: Error: Unrecognized opcode: `lfd'
/tmp/ccZzzlPj.s:52: Error: Unrecognized opcode: `lfd'
make[4]: ***
[/«PKGBUILDDIR»/build-llvm/lib/Target/PowerPC/Release/PPCJITInfo.o] Error 1
make[4]: Leaving directory `/«PKGBUILDDIR»/build-llvm/lib/Target/PowerPC'
make[3]: *** [PowerPC/.makeall] Error 2
make[3]: *** Waiting for unfinished jobs....
[...]
I'm attaching a patch that fixes this by excluding powerpc floating point
register save/restore asm on powerpcspe where those registers don't exist.
The patch also fixes the same issue in llvm-2.9, llvm-3.0 and llvm-3.1. Please
include it there, also. I can file separate bugs there, if necessary.
Thanks,
Roland
[1] http://wiki.debian.org/PowerPCSPEPort
-- System Information:
Debian Release: 7.0
APT prefers unstable
APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)
Kernel: Linux 3.5.0 (SMP w/4 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: llvm-3.0-3.0/lib/Target/PowerPC/PPCJITInfo.cpp
===================================================================
--- llvm-3.0-3.0.orig/lib/Target/PowerPC/PPCJITInfo.cpp 2011-06-15 17:29:47.000000000 +0200
+++ llvm-3.0-3.0/lib/Target/PowerPC/PPCJITInfo.cpp 2012-12-20 14:19:57.370553113 +0100
@@ -164,12 +164,14 @@
"stw 8, 92(1)\n" "stw 7, 88(1)\n"
"stw 6, 84(1)\n" "stw 5, 80(1)\n"
"stw 4, 76(1)\n" "stw 3, 72(1)\n"
+#ifndef __NO_FPRS__
// Save all call-clobbered FP regs.
"stfd 8, 64(1)\n"
"stfd 7, 56(1)\n" "stfd 6, 48(1)\n"
"stfd 5, 40(1)\n" "stfd 4, 32(1)\n"
"stfd 3, 24(1)\n" "stfd 2, 16(1)\n"
"stfd 1, 8(1)\n"
+#endif
// Arguments to Compilation Callback:
// r3 - our lr (address of the call instruction in stub plus 4)
// r4 - stub's lr (address of instruction that called the stub plus 4)
@@ -185,12 +187,14 @@
"lwz 8, 92(1)\n" "lwz 7, 88(1)\n"
"lwz 6, 84(1)\n" "lwz 5, 80(1)\n"
"lwz 4, 76(1)\n" "lwz 3, 72(1)\n"
+#ifndef __NO_FPRS__
// Restore all FP arg registers
"lfd 8, 64(1)\n"
"lfd 7, 56(1)\n" "lfd 6, 48(1)\n"
"lfd 5, 40(1)\n" "lfd 4, 32(1)\n"
"lfd 3, 24(1)\n" "lfd 2, 16(1)\n"
"lfd 1, 8(1)\n"
+#endif
// Pop 3 frames off the stack and branch to target
"lwz 1, 104(1)\n"
"lwz 0, 4(1)\n"