[LLVMdev] [PATCH] fix for FreeBSD/powerpc build breakage

Marcel Moolenaar xcllnt at mac.com
Thu May 22 11:47:11 PDT 2008


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






More information about the llvm-dev mailing list