]> git.sesse.net Git - x264/commitdiff
add support for x86_64 on Darwin9.0 (Mac OS X 10.5, aka Leopard)
authorGuillaume Poirier <gpoirier@mplayerhq.hu>
Wed, 21 Nov 2007 18:30:49 +0000 (18:30 +0000)
committerGuillaume Poirier <gpoirier@mplayerhq.hu>
Wed, 21 Nov 2007 18:30:49 +0000 (18:30 +0000)
Patch by Antoine Gerschenfeld %gerschen A clipper P ens P fr%

git-svn-id: svn://svn.videolan.org/x264/trunk@700 df754926-b1dd-0310-bc7b-ec298dee348c

common/amd64/amd64inc.asm
common/amd64/dct-a.asm
common/amd64/deblock-a.asm
common/amd64/mc-a.asm
common/amd64/mc-a2.asm
common/amd64/pixel-sse2.asm
common/amd64/predict-a.asm
common/amd64/quant-a.asm
configure

index b928652bbaac514969f0eec5cd7dfa7b0ac88efe..819bbdb970abbf4dc8ca5c58f80251d8ac141cf5 100644 (file)
@@ -50,6 +50,17 @@ BITS 64
     %endif
 %endmacro
 
+; Name of the .rodata section. On OS X we cannot use .rodata because YASM
+; is unable to compute address offsets outside of .text so we use the .text
+; section instead until YASM is fixed.
+%macro SECTION_RODATA 0
+    %ifidn __OUTPUT_FORMAT__,macho64
+      SECTION .text align=16
+    %else
+      SECTION .rodata align=16
+    %endif
+%endmacro
+
 %macro pad 1
     %undef %1
     %ifdef PREFIX
index 5c859d2c8509a430f70d985a3a7c8e0e4bf59c26..805afea93fdfee401d43d1e98029f3beec988221 100644 (file)
@@ -148,7 +148,7 @@ BITS 64
 ; Constants
 ;=============================================================================
 
-SECTION .rodata align=16
+SECTION_RODATA
 pw_1:  times 8 dw 1
 pw_32: times 8 dw 32
 
index 8af8cd0c038e92461dff3ae8d5eb2bc4ab14acad..3e9d5938f858814457193a858ac1b74faca52f6f 100644 (file)
@@ -24,7 +24,7 @@ BITS 64
 
 %include "amd64inc.asm"
 
-SECTION .rodata align=16
+SECTION_RODATA
 pb_01: times 16 db 0x01
 pb_03: times 16 db 0x03
 pb_a1: times 16 db 0xa1
index bd53329121d4c3cbd194ac961ef25086b29b61e3..4a66c81a689fb3eb19078bcc4930e46d49a9472f 100644 (file)
@@ -42,9 +42,8 @@ BITS 64
 ; Constants
 ;=============================================================================
 
-SECTION .rodata
+SECTION_RODATA
 
-ALIGN 16
 pw_4:  times 4 dw  4
 pw_8:  times 4 dw  8
 pw_32: times 4 dw 32
index 1152f5b855985c889c0c260179122a0e9c892285..5851eb3a6568546ffa3559c402d9c624a7e00195 100644 (file)
@@ -30,9 +30,8 @@ BITS 64
 ; Read only data
 ;=============================================================================
 
-SECTION .rodata align=16
+SECTION_RODATA
 
-ALIGN 16
 pw_1:  times 4 dw 1
 pw_16: times 4 dw 16
 pw_32: times 4 dw 32
index 21dd10b488daad5bdb4f942f4f3c5a31c2b4714b..7b8173867513e5303f8fa43a7b4e9cb895eedfb7 100644 (file)
@@ -29,7 +29,7 @@ BITS 64
 
 %include "amd64inc.asm"
 
-SECTION .rodata align=16
+SECTION_RODATA
 
 pw_1:    times 8 dw 1
 ssim_c1: times 4 dd 416    ; .01*.01*255*255*64
index 96751a1ea3d68cc68263bf550eec08571b2e35ac..91e6b8bccba5dc6b8ea9b95951f1e13954316f18 100644 (file)
@@ -58,9 +58,8 @@ ALIGN 4
 %endmacro
 
 
-SECTION .rodata align=16
+SECTION_RODATA
 
-ALIGN 16
 pw_2: times 4 dw 2
 pw_4: times 4 dw 4
 pw_8: times 4 dw 8
index 4077742b9d9cd0240b7377510b3180afdcc718ee..162c70a419017dbd5e688e2e48ae4021e0181012 100644 (file)
@@ -24,7 +24,7 @@ BITS 64
 
 %include "amd64inc.asm"
 
-SECTION .rodata
+SECTION_RODATA
 pd_1:  times 2 dd 1
 
 SECTION .text
index dc4e411f5aaac1bdf439d2bd96a0dcce2aab48bd..8d30b82858520f4fff823ca574e5e24c03f0d645 100755 (executable)
--- a/configure
+++ b/configure
@@ -255,7 +255,13 @@ case $host_cpu in
   x86_64)
     ARCH="X86_64"
     AS="yasm"
-    ASFLAGS="-f elf -m amd64"
+    if [ "$SYS" = MACOSX ];then
+      ASFLAGS="-f macho64 -m amd64 -D__PIC__ -DPREFIX"
+      CFLAGS="$CFLAGS -arch x86_64"
+      LDFLAGS="$LDFLAGS -arch x86_64"
+    else
+      ASFLAGS="-f elf -m amd64"
+    fi
     ;;
   powerpc|powerpc64)
     ARCH="PPC"