Marcel Moolenaar
2008-May-22 18:47 UTC
[LLVMdev] [PATCH] fix for FreeBSD/powerpc build breakage
All, The following patch fixes the build breakage on FreeBSD/powerpc: Index: lib/Target/PowerPC/PPCJITInfo.cpp ==================================================================--- lib/Target/PowerPC/PPCJITInfo.cpp (revision 51432) +++ lib/Target/PowerPC/PPCJITInfo.cpp (working copy) @@ -72,7 +72,7 @@ extern "C" void PPC64CompilationCallback(); #if (defined(__POWERPC__) || defined (__ppc__) || defined(_POWER)) && \ - !defined(__ppc64__) + !(defined(__ppc64__) || defined(__FreeBSD__)) // CompilationCallback stub - We can't use a C function with inline assembly in // it, because we the prolog/epilog inserted by GCC won't work for us. Instead, // write our own wrapper, which does things our way, so we have complete control The patch is a bit of a kluge, but I don't know which of the preprocessor defines are used on Darwin and/or Linux. FreeBSD has all of the following: #define __ppc__ 1 #define __PPC__ 1 #define _ARCH_PPC 1 #define __PowerPC__ 1 #define __powerpc__ 1 A related define that could also be used to select the right inline assembly statement is: #define __GNUCLIKE_ASM 3 In any case, register naming in inline assembly on FreeBSD is the same as the Linux version, so maybe the condition can be simplified and based on the OS? FYI, -- Marcel Moolenaar xcllnt at mac.com
Chris Lattner
2008-May-24 04:59 UTC
[LLVMdev] [PATCH] fix for FreeBSD/powerpc build breakage
On May 22, 2008, at 11:47 AM, Marcel Moolenaar wrote:> All, > > The following patch fixes the build breakage on FreeBSD/powerpc:Thanks, applied! http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20080519/062896.html> The patch is a bit of a kluge, but I don't know which of the > preprocessor defines are used on Darwin and/or Linux. FreeBSD > has all of the following:Yeah, that code is gross. I'm not sure what it is trying to figure out. If it just wants darwin/ppc for abi reasons, we could just test PPC & darwin. I'm not sure exactly what it is trying to do though. -Chris