[78538] trunk/dports/devel/libsdl

jmr at macports.org jmr at macports.org
Tue May 10 19:47:05 PDT 2011


Revision: 78538
          http://trac.macports.org/changeset/78538
Author:   jmr at macports.org
Date:     2011-05-10 19:47:04 -0700 (Tue, 10 May 2011)
Log Message:
-----------
libsdl: apply upstream cpuinfo patches, fixes bulding for x86_64 on 10.5 (#22754)

Modified Paths:
--------------
    trunk/dports/devel/libsdl/Portfile

Added Paths:
-----------
    trunk/dports/devel/libsdl/files/cpuinfo.diff

Modified: trunk/dports/devel/libsdl/Portfile
===================================================================
--- trunk/dports/devel/libsdl/Portfile	2011-05-11 01:20:20 UTC (rev 78537)
+++ trunk/dports/devel/libsdl/Portfile	2011-05-11 02:47:04 UTC (rev 78538)
@@ -39,7 +39,7 @@
 
 minimum_xcodeversions {8 2.4.1}
 
-patchfiles      patch-SDL_x11gl_c.h.diff
+patchfiles      cpuinfo.diff patch-SDL_x11gl_c.h.diff
 
 configure.args  --enable-shared \
                 --mandir=${prefix}/share/man \

Added: trunk/dports/devel/libsdl/files/cpuinfo.diff
===================================================================
--- trunk/dports/devel/libsdl/files/cpuinfo.diff	                        (rev 0)
+++ trunk/dports/devel/libsdl/files/cpuinfo.diff	2011-05-11 02:47:04 UTC (rev 78538)
@@ -0,0 +1,193 @@
+Upstream changesets:
+ca91f36ef3def70a02eefd8d3920439409fee3d0
+dcb26ac38e6bb206589d711916ab02701223c651
+72d3b4fd918b661a06e237b1b9e2dcb2b72e9ed4
+
+--- src/cpuinfo/SDL_cpuinfo.c.orig	2009-10-13 10:07:14.000000000 +1100
++++ src/cpuinfo/SDL_cpuinfo.c	2011-05-11 12:36:25.000000000 +1000
+@@ -26,7 +26,7 @@
+ #include "SDL.h"
+ #include "SDL_cpuinfo.h"
+ 
+-#if defined(__MACOSX__) && defined(__ppc__)
++#if defined(__MACOSX__) && (defined(__ppc__) || defined(__ppc64__))
+ #include <sys/sysctl.h> /* For AltiVec check */
+ #elif SDL_ALTIVEC_BLITTERS && HAVE_SETJMP
+ #include <signal.h>
+@@ -148,67 +148,77 @@ static __inline__ int CPU_getCPUIDFeatur
+ 	int features = 0;
+ #if defined(__GNUC__) && defined(i386)
+ 	__asm__ (
+-"        movl    %%ebx,%%edi\n"
+ "        xorl    %%eax,%%eax         # Set up for CPUID instruction    \n"
++"        pushl   %%ebx                                                 \n"
+ "        cpuid                       # Get and save vendor ID          \n"
++"        popl    %%ebx                                                 \n"
+ "        cmpl    $1,%%eax            # Make sure 1 is valid input for CPUID\n"
+ "        jl      1f                  # We dont have the CPUID instruction\n"
+ "        xorl    %%eax,%%eax                                           \n"
+ "        incl    %%eax                                                 \n"
++"        pushl   %%ebx                                                 \n"
+ "        cpuid                       # Get family/model/stepping/features\n"
++"        popl    %%ebx                                                 \n"
+ "        movl    %%edx,%0                                              \n"
+ "1:                                                                    \n"
+-"        movl    %%edi,%%ebx\n"
+ 	: "=m" (features)
+ 	:
+-	: "%eax", "%ecx", "%edx", "%edi"
++	: "%eax", "%ecx", "%edx"
+ 	);
+ #elif defined(__GNUC__) && defined(__x86_64__)
+ 	__asm__ (
+-"        movq    %%rbx,%%rdi\n"
+ "        xorl    %%eax,%%eax         # Set up for CPUID instruction    \n"
++"        pushq   %%rbx                                                 \n"
+ "        cpuid                       # Get and save vendor ID          \n"
++"        popq    %%rbx                                                 \n"
+ "        cmpl    $1,%%eax            # Make sure 1 is valid input for CPUID\n"
+ "        jl      1f                  # We dont have the CPUID instruction\n"
+ "        xorl    %%eax,%%eax                                           \n"
+ "        incl    %%eax                                                 \n"
++"        pushq   %%rbx                                                 \n"
+ "        cpuid                       # Get family/model/stepping/features\n"
++"        popq    %%rbx                                                 \n"
+ "        movl    %%edx,%0                                              \n"
+ "1:                                                                    \n"
+-"        movq    %%rdi,%%rbx\n"
+ 	: "=m" (features)
+ 	:
+-	: "%rax", "%rbx", "%rcx", "%rdx", "%rdi"
++	: "%rax", "%rcx", "%rdx"
+ 	);
+ #elif (defined(_MSC_VER) && defined(_M_IX86)) || defined(__WATCOMC__)
+ 	__asm {
+         xor     eax, eax            ; Set up for CPUID instruction
++        push    ebx
+         cpuid                       ; Get and save vendor ID
++        pop     ebx
+         cmp     eax, 1              ; Make sure 1 is valid input for CPUID
+         jl      done                ; We dont have the CPUID instruction
+         xor     eax, eax
+         inc     eax
++        push    ebx
+         cpuid                       ; Get family/model/stepping/features
++        pop     ebx
+         mov     features, edx
+ done:
+ 	}
+ #elif defined(__sun) && (defined(__i386) || defined(__amd64))
+ 	    __asm(
+-"        movl    %ebx,%edi\n"
+ "        xorl    %eax,%eax         \n"
++"        pushl   %ebx              \n"
+ "        cpuid                     \n"
++"        popl    %ebx              \n"
+ "        cmpl    $1,%eax           \n"
+ "        jl      1f                \n"
+ "        xorl    %eax,%eax         \n"
+ "        incl    %eax              \n"
++"        pushl   %ebx              \n"
+ "        cpuid                     \n"
++"        popl    %ebx              \n"
+ #ifdef __i386
+ "        movl    %edx,-8(%ebp)     \n"
+ #else
+ "        movl    %edx,-8(%rbp)     \n"
+ #endif
+ "1:                                \n"
+-"        movl    %edi,%ebx\n" );
+ #endif
+ 	return features;
+ }
+@@ -218,63 +228,73 @@ static __inline__ int CPU_getCPUIDFeatur
+ 	int features = 0;
+ #if defined(__GNUC__) && defined(i386)
+ 	__asm__ (
+-"        movl    %%ebx,%%edi\n"
+ "        movl    $0x80000000,%%eax   # Query for extended functions    \n"
++"        pushl   %%ebx                                                 \n"
+ "        cpuid                       # Get extended function limit     \n"
++"        popl    %%ebx                                                 \n"
+ "        cmpl    $0x80000001,%%eax                                     \n"
+ "        jl      1f                  # Nope, we dont have function 800000001h\n"
+ "        movl    $0x80000001,%%eax   # Setup extended function 800000001h\n"
++"        pushl   %%ebx                                                 \n"
+ "        cpuid                       # and get the information         \n"
++"        popl    %%ebx                                                 \n"
+ "        movl    %%edx,%0                                              \n"
+ "1:                                                                    \n"
+-"        movl    %%edi,%%ebx\n"
+ 	: "=m" (features)
+ 	:
+-	: "%eax", "%ecx", "%edx", "%edi"
++	: "%eax", "%ecx", "%edx"
+ 	);
+ #elif defined(__GNUC__) && defined (__x86_64__)
+ 	__asm__ (
+-"        movq    %%rbx,%%rdi\n"
+ "        movl    $0x80000000,%%eax   # Query for extended functions    \n"
++"        pushq   %%rbx                                                 \n"
+ "        cpuid                       # Get extended function limit     \n"
++"        popq    %%rbx                                                 \n"
+ "        cmpl    $0x80000001,%%eax                                     \n"
+ "        jl      1f                  # Nope, we dont have function 800000001h\n"
+ "        movl    $0x80000001,%%eax   # Setup extended function 800000001h\n"
++"        pushq   %%rbx                                                 \n"
+ "        cpuid                       # and get the information         \n"
++"        popq    %%rbx                                                 \n"
+ "        movl    %%edx,%0                                              \n"
+ "1:                                                                    \n"
+-"        movq    %%rdi,%%rbx\n"
+ 	: "=m" (features)
+ 	:
+-	: "%rax", "%rbx", "%rcx", "%rdx", "%rdi"
++	: "%rax", "%rcx", "%rdx"
+ 	);
+ #elif (defined(_MSC_VER) && defined(_M_IX86)) || defined(__WATCOMC__)
+ 	__asm {
+         mov     eax,80000000h       ; Query for extended functions
++        push    ebx
+         cpuid                       ; Get extended function limit
++        pop     ebx
+         cmp     eax,80000001h
+         jl      done                ; Nope, we dont have function 800000001h
+         mov     eax,80000001h       ; Setup extended function 800000001h
++        push    ebx
+         cpuid                       ; and get the information
++        pop     ebx
+         mov     features,edx
+ done:
+ 	}
+ #elif defined(__sun) && ( defined(__i386) || defined(__amd64) )
+ 	    __asm (
+-"        movl    %ebx,%edi\n"
+ "        movl    $0x80000000,%eax \n"
++"        pushl   %ebx             \n"
+ "        cpuid                    \n"
++"        popl    %ebx             \n"
+ "        cmpl    $0x80000001,%eax \n"
+ "        jl      1f               \n"
+ "        movl    $0x80000001,%eax \n"
++"        pushl   %ebx             \n"
+ "        cpuid                    \n"
++"        popl    %ebx             \n"
+ #ifdef __i386
+ "        movl    %edx,-8(%ebp)   \n"
+ #else
+ "        movl    %edx,-8(%rbp)   \n"
+ #endif
+ "1:                               \n"
+-"        movl    %edi,%ebx\n"
+ 	    );
+ #endif
+ 	return features;
+@@ -339,7 +359,7 @@ static __inline__ int CPU_haveSSE2(void)
+ static __inline__ int CPU_haveAltiVec(void)
+ {
+ 	volatile int altivec = 0;
+-#if defined(__MACOSX__) && defined(__ppc__)
++#if defined(__MACOSX__) && (defined(__ppc__) || defined(__ppc64__))
+ 	int selectors[2] = { CTL_HW, HW_VECTORUNIT }; 
+ 	int hasVectorUnit = 0; 
+ 	size_t length = sizeof(hasVectorUnit); 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20110510/819de850/attachment.html>


More information about the macports-changes mailing list