Patchwork [libffi] Build with sun studio compiler

login
register
mail settings
Submitter Anthony Green
Date Aug. 6, 2010, 4:55 a.m.
Message ID <m339us2vcq.fsf@redhat.com>
Download mbox | patch
Permalink /patch/61064/
State New
Headers show

Comments

Anthony Green - Aug. 6, 2010, 4:55 a.m.
I'm checking in the following libffi patch.

This patch from Oliver Kiddle lets us build libffi with the sun studio
compiler.  Obviously this is a non-goal for GCC, but I'm checking it in
from upstream.


2010-01-15  Oliver Kiddle  <okiddle@yahoo.co.uk>

	* src/x86/ffitarget.h (ffi_abi): Check for __i386 and __amd64 for
	Sun Studio compiler compatibility.

Patch

Index: libffi/src/x86/ffitarget.h
===================================================================
--- libffi.orig/src/x86/ffitarget.h
+++ libffi/src/x86/ffitarget.h
@@ -1,5 +1,5 @@ 
 /* -----------------------------------------------------------------*-C-*-
-   ffitarget.h - Copyright (c) 1996-2003  Red Hat, Inc.
+   ffitarget.h - Copyright (c) 1996-2003, 2010  Red Hat, Inc.
    Copyright (C) 2008  Free Software Foundation, Inc.
 
    Target configuration macros for x86 and x86-64.
@@ -74,10 +74,10 @@  typedef enum ffi_abi {
 #else
 
   /* ---- Intel x86 and AMD x86-64 - */
-#if !defined(X86_WIN32) && (defined(__i386__) || defined(__x86_64__))
+#if !defined(X86_WIN32) && (defined(__i386__) || defined(__x86_64__) || defined(__i386) || defined(__amd64))
   FFI_SYSV,
   FFI_UNIX64,   /* Unix variants all use the same ABI for x86-64  */
-#ifdef __i386__
+#if defined(__i386__) || defined(__i386)
   FFI_DEFAULT_ABI = FFI_SYSV,
 #else
   FFI_DEFAULT_ABI = FFI_UNIX64,