Source: clamav
Version: 0.97.8+dfsg-1
Severity: wishlist
Tags: patch
User: [email protected]
Usertags: powerpcspe

Hi,

clamav FTBFS on powerpcspe like this:

...
  CXX    libllvmpowerpccodegen_la-PPCISelLowering.lo
llvm/lib/Target/PowerPC/PPCISelLowering.cpp: In function 'unsigned int 
CalculateParameterAndLinkageAreaSize(llvm::SelectionDAG&, bool, bool, unsigned 
int, const llvm::SmallVectorImpl<llvm::ISD::OutputArg>&, const 
llvm::SmallVectorImpl<llvm::SDValue>&, unsigned int&)':
llvm/lib/Target/PowerPC/PPCISelLowering.cpp:2156:13: warning: variable 'Arg' 
set but not used [-Wunused-but-set-variable]
  CXX    libllvmpowerpccodegen_la-PPCInstrInfo.lo
  CXX    libllvmpowerpccodegen_la-PPCJITInfo.lo
/tmp/ccKI8gPe.s: Assembler messages:
/tmp/ccKI8gPe.s:23: Error: unrecognized opcode: `stfd'
/tmp/ccKI8gPe.s:24: Error: unrecognized opcode: `stfd'
/tmp/ccKI8gPe.s:25: Error: unrecognized opcode: `stfd'
/tmp/ccKI8gPe.s:26: Error: unrecognized opcode: `stfd'
/tmp/ccKI8gPe.s:27: Error: unrecognized opcode: `stfd'
/tmp/ccKI8gPe.s:28: Error: unrecognized opcode: `stfd'
/tmp/ccKI8gPe.s:29: Error: unrecognized opcode: `stfd'
/tmp/ccKI8gPe.s:30: Error: unrecognized opcode: `stfd'
/tmp/ccKI8gPe.s:45: Error: unrecognized opcode: `lfd'
/tmp/ccKI8gPe.s:46: Error: unrecognized opcode: `lfd'
/tmp/ccKI8gPe.s:47: Error: unrecognized opcode: `lfd'
/tmp/ccKI8gPe.s:48: Error: unrecognized opcode: `lfd'
/tmp/ccKI8gPe.s:49: Error: unrecognized opcode: `lfd'
/tmp/ccKI8gPe.s:50: Error: unrecognized opcode: `lfd'
/tmp/ccKI8gPe.s:51: Error: unrecognized opcode: `lfd'
/tmp/ccKI8gPe.s:52: Error: unrecognized opcode: `lfd'
make[6]: *** [libllvmpowerpccodegen_la-PPCJITInfo.lo] Error 1
...

The attached patch fixes this by only conditionally assembling the stfd/lfd
instructions when they are available. On powerpcspe, there are no FP registers,
hence they simply don't need to be saved/restored.

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
--- libclamav/c++/llvm/lib/Target/PowerPC/PPCJITInfo.cpp.orig	2013-12-24 11:10:08.709115796 +0100
+++ libclamav/c++/llvm/lib/Target/PowerPC/PPCJITInfo.cpp	2013-12-24 11:19:23.056944034 +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"
_______________________________________________
Pkg-clamav-devel mailing list
[email protected]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-clamav-devel

Reply via email to