omion
28th November 2006, 19:19
I have a Core 2 Duo Mac, and I have been trying to compile x264 as a 64-bit binary. I've made simple 64-bit programs on it, so I know it's possible.
Here's what I do:
./configure
This returns the info for 32-bit mode, as OS-X defaults to 32-bit.
Platform: X64
System: MACOSX
I change config.mak to say
ARCH=X86_64
...
CFLAGS=-m64 ...
to tell the make file to use 64-bit assembly and tell GCC to make 64-bit binaries (on OS-X it defaults to 32-bit) When I make it, the error is:
common/amd64/dct-a.asm:40: error: `64' is not a valid segment size; must be 16 or 32
Oops. I remembered that NASM doesn't do 64-bit, so I change the assembly options to be the same as my 64-bit Linux box (which I have successfully compiled):
AS=yasm
ASFLAGS=-f elf -m amd64
A whole bunch of errors like this pop up:
yasm -f elf -m amd64 -Icommon/amd64 -o common/amd64/dct-a.o common/amd64/dct-a.asm
strip: can't process non-object and non-archive file: /Users/omion/x264x64/common/amd64/dct-a.o
Then it finally dies with:
gcc -o x264 x264.o matroska.o muxers.o libx264.a -lm -lmx -lpthread -s
/usr/bin/ld: truncated or malformed archive: libx264.a (ranlib structures in table of contents extends past the end of the table of contents, can't load from it)
Well, it's odd that it called gcc without the -m64 switch, so I change the config.mak file to:
CC=gcc -m64
CFLAGS=-O4 ... (default)
Now it says:
gcc -m64 -o x264 x264.o matroska.o muxers.o libx264.a -lm -lmx -lpthread -s
ld64 warning: in /usr/lib/libmx.dylib, missing required architecture x86_64 in file
Undefined symbols:
_x264_pixel_sad_x3_4x8_mmxext, referenced from:
_x264_pixel_init in libx264.a(pixel.o)
[A bunch more of this]
ld64-59.2 failed: symbol(s) not found
It looks a bit like the library "libmx.dylib" is not compiled for 64-bit. I've been told that there are a few Apple libraries that are only 32-bit and full support is coming with 10.5, so I assume that's it.
Does anybody know a way around this? I'm out of ideas.
akupenguin
28th November 2006, 19:55
Well, it's odd that it called gcc without the -m64 switch, so I change the config.mak file to:
The linker uses LDFLAGS, the compiler uses CFLAGS. Even if both are gcc.
What's in libmx? i.e. what symbols are missing if you remove -lmx from a 32bit build? It isn't needed on the other OSes.
omion
28th November 2006, 20:12
Then linker uses LDFLAGS, the compiler uses CFLAGS. Even if both are gcc.
That makes sense. I'm still guessing my way around with C code.
What's in libmx? i.e. what symbols are missing if you remove -lmx from a 32bit build? It isn't needed on the other OSes.
Looks like... nothing. 32-bit compiles just fine without -lmx.
Now I tried the 64-bit build without -lmx, but it still gives the same "missing symbols" errors, just without the "ld64" warning in the middle.
Here's the full error from make:
yasm -f elf -m amd64 -Icommon/amd64 -o common/amd64/dct-a.o common/amd64/dct-a.asm
strip: can't process non-object and non-archive file: /Users/omion/x264x64/common/amd64/dct-a.o
yasm -f elf -m amd64 -Icommon/amd64 -o common/amd64/cpu-a.o common/amd64/cpu-a.asm
strip: can't process non-object and non-archive file: /Users/omion/x264x64/common/amd64/cpu-a.o
yasm -f elf -m amd64 -Icommon/amd64 -o common/amd64/pixel-a.o common/amd64/pixel-a.asm
strip: can't process non-object and non-archive file: /Users/omion/x264x64/common/amd64/pixel-a.o
yasm -f elf -m amd64 -Icommon/amd64 -o common/amd64/mc-a.o common/amd64/mc-a.asm
strip: can't process non-object and non-archive file: /Users/omion/x264x64/common/amd64/mc-a.o
yasm -f elf -m amd64 -Icommon/amd64 -o common/amd64/mc-a2.o common/amd64/mc-a2.asm
strip: can't process non-object and non-archive file: /Users/omion/x264x64/common/amd64/mc-a2.o
yasm -f elf -m amd64 -Icommon/amd64 -o common/amd64/predict-a.o common/amd64/predict-a.asm
strip: can't process non-object and non-archive file: /Users/omion/x264x64/common/amd64/predict-a.o
yasm -f elf -m amd64 -Icommon/amd64 -o common/amd64/pixel-sse2.o common/amd64/pixel-sse2.asm
strip: can't process non-object and non-archive file: /Users/omion/x264x64/common/amd64/pixel-sse2.o
yasm -f elf -m amd64 -Icommon/amd64 -o common/amd64/quant-a.o common/amd64/quant-a.asm
strip: can't process non-object and non-archive file: /Users/omion/x264x64/common/amd64/quant-a.o
yasm -f elf -m amd64 -Icommon/amd64 -o common/amd64/deblock-a.o common/amd64/deblock-a.asm
strip: can't process non-object and non-archive file: /Users/omion/x264x64/common/amd64/deblock-a.o
[ deleted... ]
ranlib libx264.a
gcc -o x264 x264.o matroska.o muxers.o libx264.a -m64 -lm -lpthread -s
Undefined symbols:
_x264_pixel_sad_x3_4x8_mmxext, referenced from:
_x264_pixel_init in libx264.a(pixel.o)
_x264_pixel_satd_16x8_sse2, referenced from:
_x264_pixel_init in libx264.a(pixel.o)
_x264_mc_copy_w4_mmx, referenced from:
_x264_mc_mmxext_init in libx264.a(mc-c.o)
_x264_mc_copy_wtab_mmx in libx264.a(mc-c.o)
_x264_pixel_sad_16x8_sse2, referenced from:
_x264_pixel_init in libx264.a(pixel.o)
_x264_quant_4x4_core15_mmx, referenced from:
_x264_quant_init in libx264.a(quant.o)
_x264_pixel_ads4_mmxext, referenced from:
_x264_pixel_init in libx264.a(pixel.o)
_x264_pixel_sad_16x16_sse2, referenced from:
_x264_pixel_init in libx264.a(pixel.o)
_predict_8x8_dc_left_mmxext, referenced from:
_x264_predict_8x8_init_mmxext in libx264.a(predict-c.o)
_x264_pixel_sad_16x16_mmxext, referenced from:
_x264_pixel_init in libx264.a(pixel.o)
_predict_8x8_ddr_mmxext, referenced from:
_x264_predict_8x8_init_mmxext in libx264.a(predict-c.o)
_x264_hpel_filter_mmxext, referenced from:
_x264_frame_filter in libx264.a(mc.o)
_x264_sub8x8_dct_mmx, referenced from:
_x264_dct_init in libx264.a(dct.o)
_x264_pixel_satd_16x16_sse2, referenced from:
_x264_pixel_init in libx264.a(pixel.o)
_x264_pixel_sad_x3_16x8_mmxext, referenced from:
_x264_pixel_init in libx264.a(pixel.o)
_x264_intra_satd_x3_4x4_mmxext, referenced from:
_x264_pixel_init in libx264.a(pixel.o)
_x264_pixel_avg_weight_4x4_mmxext, referenced from:
_x264_mc_mmxext_init in libx264.a(mc-c.o)
_x264_cpu_cpuid, referenced from:
_x264_cpu_detect in libx264.a(cpu.o)
_x264_cpu_detect in libx264.a(cpu.o)
_x264_cpu_detect in libx264.a(cpu.o)
_x264_cpu_detect in libx264.a(cpu.o)
_x264_pixel_sad_x4_8x8_mmxext, referenced from:
_x264_pixel_init in libx264.a(pixel.o)
_x264_deblock_h_chroma_intra_mmxext, referenced from:
_x264_deblock_init in libx264.a(frame.o)
_x264_pixel_sad_x3_16x16_mmxext, referenced from:
_x264_pixel_init in libx264.a(pixel.o)
_x264_pixel_sad_4x4_mmxext, referenced from:
_x264_pixel_init in libx264.a(pixel.o)
_x264_pixel_ads1_mmxext, referenced from:
_x264_pixel_init in libx264.a(pixel.o)
_x264_dequant_4x4_mmx, referenced from:
_x264_quant_init in libx264.a(quant.o)
_x264_quant_init in libx264.a(quant.o)
_x264_deblock_v_chroma_mmxext, referenced from:
_x264_deblock_init in libx264.a(frame.o)
_x264_pixel_sad_pde_8x16_mmxext, referenced from:
_x264_pixel_init in libx264.a(pixel.o)
_x264_pixel_ssd_16x8_mmx, referenced from:
_x264_pixel_init in libx264.a(pixel.o)
_x264_pixel_satd_4x4_mmxext, referenced from:
_x264_pixel_init in libx264.a(pixel.o)
_x264_pixel_sad_x3_8x8_mmxext, referenced from:
_x264_pixel_init in libx264.a(pixel.o)
_x264_add8x8_idct8_mmx, referenced from:
_x264_dct_init in libx264.a(dct.o)
_x264_prefetch_ref_mmxext, referenced from:
_x264_mc_mmxext_init in libx264.a(mc-c.o)
_x264_deblock_h_chroma_mmxext, referenced from:
_x264_deblock_init in libx264.a(frame.o)
_x264_pixel_ssd_16x16_sse2, referenced from:
_x264_pixel_init in libx264.a(pixel.o)
_x264_pixel_sad_pde_16x8_mmxext, referenced from:
_x264_pixel_init in libx264.a(pixel.o)
_predict_8x8_dc_mmxext, referenced from:
_x264_predict_8x8_init_mmxext in libx264.a(predict-c.o)
_x264_dequant_8x8_mmx, referenced from:
_x264_quant_init in libx264.a(quant.o)
_x264_quant_init in libx264.a(quant.o)
_x264_pixel_satd_8x4_sse2, referenced from:
_x264_pixel_init in libx264.a(pixel.o)
_predict_8x8_ddl_mmxext, referenced from:
_x264_predict_8x8_init_mmxext in libx264.a(predict-c.o)
_x264_sub16x16_dct8_mmx, referenced from:
_x264_dct_init in libx264.a(dct.o)
_predict_16x16_dc_top_mmxext, referenced from:
_x264_predict_16x16_init_mmxext in libx264.a(predict-c.o)
_x264_pixel_sad_x4_16x16_sse2, referenced from:
_x264_pixel_init in libx264.a(pixel.o)
_x264_sub16x16_dct_mmx, referenced from:
_x264_dct_init in libx264.a(dct.o)
_x264_pixel_sad_x4_8x16_mmxext, referenced from:
_x264_pixel_init in libx264.a(pixel.o)
_x264_add16x16_idct_mmx, referenced from:
_x264_dct_init in libx264.a(dct.o)
_x264_pixel_sad_8x4_mmxext, referenced from:
_x264_pixel_init in libx264.a(pixel.o)
_x264_pixel_sad_8x16_mmxext, referenced from:
_x264_pixel_init in libx264.a(pixel.o)
_x264_pixel_avg_w16_mmxext, referenced from:
_x264_pixel_avg_16x16_mmxext in libx264.a(mc-c.o)
_x264_pixel_avg_16x8_mmxext in libx264.a(mc-c.o)
_x264_pixel_avg_wtab_mmxext in libx264.a(mc-c.o)
_x264_pixel_ssd_4x4_mmx, referenced from:
_x264_pixel_init in libx264.a(pixel.o)
_x264_pixel_ssd_8x16_mmx, referenced from:
_x264_pixel_init in libx264.a(pixel.o)
_x264_pixel_ssd_16x8_sse2, referenced from:
_x264_pixel_init in libx264.a(pixel.o)
_x264_pixel_sad_x3_16x16_sse2, referenced from:
_x264_pixel_init in libx264.a(pixel.o)
_x264_pixel_satd_8x8_sse2, referenced from:
_x264_pixel_init in libx264.a(pixel.o)
_predict_8x8c_p_core_mmxext, referenced from:
_predict_8x8c_p in libx264.a(predict-c.o)
_x264_pixel_satd_8x4_mmxext, referenced from:
_x264_pixel_init in libx264.a(pixel.o)
_x264_pixel_sad_x4_16x8_mmxext, referenced from:
_x264_pixel_init in libx264.a(pixel.o)
_predict_8x8_v_mmxext, referenced from:
_x264_predict_8x8_init_mmxext in libx264.a(predict-c.o)
_x264_pixel_sad_16x8_mmxext, referenced from:
_x264_pixel_init in libx264.a(pixel.o)
_x264_pixel_sad_x4_4x4_mmxext, referenced from:
_x264_pixel_init in libx264.a(pixel.o)
_x264_mc_chroma_mmxext, referenced from:
_x264_mc_init in libx264.a(mc.o)
_x264_emms, referenced from:
_x264_cpu_restore in libx264.a(cpu.o)
_x264_pixel_avg_w8_mmxext, referenced from:
_x264_pixel_avg_8x16_mmxext in libx264.a(mc-c.o)
_x264_pixel_avg_8x8_mmxext in libx264.a(mc-c.o)
_x264_pixel_avg_8x4_mmxext in libx264.a(mc-c.o)
_x264_pixel_avg_wtab_mmxext in libx264.a(mc-c.o)
_x264_pixel_ssd_8x8_mmx, referenced from:
_x264_pixel_init in libx264.a(pixel.o)
_x264_pixel_avg_weight_w16_mmxext, referenced from:
_x264_pixel_avg_weight_16x16_mmxext in libx264.a(mc-c.o)
_x264_pixel_avg_weight_16x8_mmxext in libx264.a(mc-c.o)
_x264_pixel_sad_x3_4x4_mmxext, referenced from:
_x264_pixel_init in libx264.a(pixel.o)
_x264_deblock_h_luma_mmxext, referenced from:
_x264_deblock_init in libx264.a(frame.o)
_predict_8x8c_dc_core_mmxext, referenced from:
_predict_8x8c_dc in libx264.a(predict-c.o)
_x264_sub4x4_dct_mmx, referenced from:
_x264_dct_init in libx264.a(dct.o)
_x264_quant_4x4_dc_core15_mmx, referenced from:
_x264_quant_init in libx264.a(quant.o)
_x264_zigzag_scan_4x4_field_mmx, referenced from:
_x264_zigzag_init in libx264.a(dct.o)
_x264_pixel_sa8d_16x16_mmxext, referenced from:
_x264_pixel_init in libx264.a(pixel.o)
_x264_quant_4x4_dc_core32_mmxext, referenced from:
_x264_quant_init in libx264.a(quant.o)
_x264_idct4x4dc_mmx, referenced from:
_x264_dct_init in libx264.a(dct.o)
_predict_16x16_v_mmx, referenced from:
_x264_predict_16x16_init_mmxext in libx264.a(predict-c.o)
_x264_pixel_sad_x4_16x8_sse2, referenced from:
_x264_pixel_init in libx264.a(pixel.o)
_x264_intra_satd_x3_16x16_mmxext, referenced from:
_x264_pixel_init in libx264.a(pixel.o)
_x264_pixel_sad_x4_8x4_mmxext, referenced from:
_x264_pixel_init in libx264.a(pixel.o)
_x264_pixel_sad_x3_16x8_sse2, referenced from:
_x264_pixel_init in libx264.a(pixel.o)
_predict_8x8c_v_mmx, referenced from:
_x264_predict_8x8c_init_mmxext in libx264.a(predict-c.o)
_x264_pixel_satd_8x16_mmxext, referenced from:
_x264_pixel_init in libx264.a(pixel.o)
_x264_mc_copy_w8_mmx, referenced from:
_x264_mc_mmxext_init in libx264.a(mc-c.o)
_x264_mc_copy_wtab_mmx in libx264.a(mc-c.o)
_predict_8x8_dc_top_mmxext, referenced from:
_x264_predict_8x8_init_mmxext in libx264.a(predict-c.o)
_x264_pixel_sad_4x8_mmxext, referenced from:
_x264_pixel_init in libx264.a(pixel.o)
_x264_pixel_sad_x3_8x4_mmxext, referenced from:
_x264_pixel_init in libx264.a(pixel.o)
_x264_pixel_sad_x3_8x16_mmxext, referenced from:
_x264_pixel_init in libx264.a(pixel.o)
_x264_intra_satd_x3_8x8c_mmxext, referenced from:
_x264_pixel_init in libx264.a(pixel.o)
_x264_pixel_satd_16x8_mmxext, referenced from:
_x264_pixel_init in libx264.a(pixel.o)
_x264_add16x16_idct8_mmx, referenced from:
_x264_dct_init in libx264.a(dct.o)
_x264_quant_4x4_core32_mmxext, referenced from:
_x264_quant_init in libx264.a(quant.o)
_x264_quant_2x2_dc_core32_mmxext, referenced from:
_x264_quant_init in libx264.a(quant.o)
_x264_pixel_satd_4x8_mmxext, referenced from:
_x264_pixel_init in libx264.a(pixel.o)
_x264_pixel_satd_16x16_mmxext, referenced from:
_x264_pixel_init in libx264.a(pixel.o)
_x264_quant_8x8_core32_mmxext, referenced from:
_x264_quant_init in libx264.a(quant.o)
_x264_quant_4x4_dc_core16_mmxext, referenced from:
_x264_quant_init in libx264.a(quant.o)
_x264_prefetch_fenc_mmxext, referenced from:
_x264_mc_mmxext_init in libx264.a(mc-c.o)
_x264_intra_sa8d_x3_8x8_core_mmxext, referenced from:
_x264_intra_sa8d_x3_8x8_mmxext in libx264.a(predict-c.o)
_x264_cpu_cpuid_test, referenced from:
_x264_cpu_detect in libx264.a(cpu.o)
_x264_pixel_sa8d_8x8_mmxext, referenced from:
_x264_pixel_init in libx264.a(pixel.o)
_x264_sub8x8_dct8_mmx, referenced from:
_x264_dct_init in libx264.a(dct.o)
_x264_pixel_ads2_mmxext, referenced from:
_x264_pixel_init in libx264.a(pixel.o)
_predict_16x16_p_core_mmxext, referenced from:
_predict_16x16_p in libx264.a(predict-c.o)
_x264_pixel_satd_8x16_sse2, referenced from:
_x264_pixel_init in libx264.a(pixel.o)
_x264_pixel_ssd_8x4_mmx, referenced from:
_x264_pixel_init in libx264.a(pixel.o)
_x264_pixel_sad_8x8_mmxext, referenced from:
_x264_pixel_init in libx264.a(pixel.o)
_x264_mc_copy_w16_mmx, referenced from:
_x264_mc_mmxext_init in libx264.a(mc-c.o)
_x264_mc_copy_wtab_mmx in libx264.a(mc-c.o)
_x264_deblock_v8_luma_mmxext, referenced from:
_x264_deblock_v_luma_mmxext in libx264.a(frame.o)
_x264_deblock_v_luma_mmxext in libx264.a(frame.o)
_x264_pixel_ssim_4x4x2_core_mmxext, referenced from:
_x264_pixel_init in libx264.a(pixel.o)
_x264_deblock_v_chroma_intra_mmxext, referenced from:
_x264_deblock_init in libx264.a(frame.o)
_x264_quant_8x8_core15_mmx, referenced from:
_x264_quant_init in libx264.a(quant.o)
_x264_add8x8_idct_mmx, referenced from:
_x264_dct_init in libx264.a(dct.o)
_x264_quant_4x4_core16_mmxext, referenced from:
_x264_quant_init in libx264.a(quant.o)
_x264_pixel_satd_8x8_mmxext, referenced from:
_x264_pixel_init in libx264.a(pixel.o)
_predict_16x16_dc_core_mmxext, referenced from:
_predict_16x16_dc in libx264.a(predict-c.o)
_x264_quant_2x2_dc_core16_mmxext, referenced from:
_x264_quant_init in libx264.a(quant.o)
_x264_pixel_avg_w4_mmxext, referenced from:
_x264_pixel_avg_4x8_mmxext in libx264.a(mc-c.o)
_x264_pixel_avg_4x4_mmxext in libx264.a(mc-c.o)
_x264_pixel_avg_4x2_mmxext in libx264.a(mc-c.o)
_x264_pixel_avg_wtab_mmxext in libx264.a(mc-c.o)
_x264_pixel_ssim_end4_sse2, referenced from:
_x264_pixel_init in libx264.a(pixel.o)
_x264_plane_copy_mmxext, referenced from:
_x264_mc_mmxext_init in libx264.a(mc-c.o)
_x264_pixel_sad_x4_4x8_mmxext, referenced from:
_x264_pixel_init in libx264.a(pixel.o)
_x264_quant_8x8_core16_mmxext, referenced from:
_x264_quant_init in libx264.a(quant.o)
_x264_pixel_ssd_16x16_mmx, referenced from:
_x264_pixel_init in libx264.a(pixel.o)
_predict_8x8_vr_core_mmxext, referenced from:
_predict_8x8_vr_mmxext in libx264.a(predict-c.o)
_x264_pixel_avg_weight_w8_mmxext, referenced from:
_x264_pixel_avg_weight_8x16_mmxext in libx264.a(mc-c.o)
_x264_pixel_avg_weight_8x8_mmxext in libx264.a(mc-c.o)
_x264_pixel_avg_weight_8x4_mmxext in libx264.a(mc-c.o)
_x264_pixel_ssd_4x8_mmx, referenced from:
_x264_pixel_init in libx264.a(pixel.o)
_x264_pixel_sad_pde_16x16_mmxext, referenced from:
_x264_pixel_init in libx264.a(pixel.o)
_x264_dct4x4dc_mmx, referenced from:
_x264_dct_init in libx264.a(dct.o)
_x264_quant_2x2_dc_core15_mmx, referenced from:
_x264_quant_init in libx264.a(quant.o)
_x264_pixel_sad_x4_16x16_mmxext, referenced from:
_x264_pixel_init in libx264.a(pixel.o)
_x264_add4x4_idct_mmx, referenced from:
_x264_dct_init in libx264.a(dct.o)
_x264_pixel_ssim_4x4x2_core_sse2, referenced from:
_x264_pixel_init in libx264.a(pixel.o)
ld64-59.2 failed: symbol(s) not found
collect2: ld returned 1 exit status
make: *** [x264] Error 1
akupenguin
28th November 2006, 20:31
try ASFLAGS=-f macho -m amd64
not sure if it needs some support in the asm files, or if just the commandline is enough. The 32bit versions did need some macho-specific code, but that might just be PIC and bug workarounds.
omion
28th November 2006, 20:39
try ASFLAGS=-f macho -m amd64
not sure if it needs some support in the asm files, or if just the commandline is enough. The 32bit versions did need some macho-specific code, but that might just be PIC and bug workarounds.
YASM says "unrecognized object format `macho'"
Typing "yasm -f help" gives the following object formats:
dbg, bin, elf, elf32, elf64, coff, win32, win64, x64, xdf
I tried compiling it with "-f elf64", but it gave the same "missing symbols" errors.
I have YASM version 0.5.0.1591, if that matters. I noticed it's different from the version I use on my Linux machine.
akupenguin
28th November 2006, 20:50
What format are the .o files produced by gcc -m64? (e.g. run `file x264.o`)
If they're macho, then the only thing you can do is find/write a version of yasm that supports it.
omion
28th November 2006, 21:01
"Mach-O 64-bit object x86_64". Hmmph.
It looks like Mach-O support is planned for YASM 0.7. I guess that means no 64-bit for now.
Romario
28th November 2006, 22:07
Very good job, omion. I have one proposal to you:
Why you don't try to compile Windows x64 build, when you finish Mac 64-bit build?
omion
28th November 2006, 23:19
I have tried to compile 64-bit Windows builds in the past. You can actually find a few on my website (http://omion.dyndns.org). The problem is that 64-bit Windows code has a different way of handling exceptions, which is not handled in the current assembly files. It's possible to build it without the assembly, but that would be much slower than a 32-bit build, so there's no point.
In the past, I had relied on some patches squid_80 made to the assembly files. One of the SVN updates broke the patch, and I didn't want to keep bugging squid_80 to update it. If he has a current version, I would be happy to update my builds, but I don't want to nag him.
[ edit: Actually, it looks like squid_80 is still building them. His webpage (http://members.optusnet.com.au/squid_80/) has a fairly recent build (although it doesn't say which revision it is) ]
squid_80
29th November 2006, 03:58
I put my modified source up as well (under sources\ on the website), if you want the latest svn build you can download it and apply the latest svn patches.
(Strange how Romario sounds a lot like a certain user who got banned.)
omion
29th November 2006, 04:49
I put my modified source up as well (under sources\ on the website), if you want the latest svn build you can download it and apply the latest svn patches.
I noticed that, and have already patched it. Thank you for your continued work on this! (I had kind of given up around r400 or so)
(Strange how Romario sounds a lot like a certain user who got banned.)
I was thinking the same thing, actually... ;)
AGDenton
19th January 2007, 21:47
Hi,
A little update on this : yasm features Mach-O support in SVN since 1-13, which makes building a 64-bit version of x264 for Core 2 Duo macs possible. Two changes have to be made :
* 64-bit Mach-O only supports relative addressing, and so the asm files must be compiled with -D__PIC__ .
* yasm (like nasm on x86) is unable to deal with addresses to different sections, so constants must go in the text section (replace rodata with text in the asm files from common/x86_64).
With these changes, you can build a version of x264 about 10-20% faster than the 32-bit version (same as under Win64, apparently). For reference, here's the content of my config.mak :
prefix=/usr/local
exec_prefix=${prefix}
bindir=${exec_prefix}/bin
libdir=${exec_prefix}/lib
includedir=${prefix}/include
ARCH=X86_64
SYS=MACOSX
CC=gcc -m64
CFLAGS=-O4 -ffast-math -Wall -I. -D__X264__ -falign-loops=16 -funsafe-loop-optimizations -freorder-blocks-and-partition -DHAVE_MMXEXT -DHAVE_SSE2 -DARCH_X86_64 -DSYS_MACOSX
LDFLAGS= -lm -lmx -lpthread -s
AS=yasm
ASFLAGS=-f macho64 -DPREFIX -D__PIC__
GTK=no
EXE=
VIS=no
HAVE_GETOPT_LONG=1
DEVNULL=/dev/null
ECHON=echo -n
CONFIGURE_ARGS= '--disable-mp4-output'
To build your own 64-bit x264, install yasm from the svn, then run configure configure without mp4 output, replace your config.mak with this one, and build.
I'm trying to build a 64-bit gpac at the moment (under 10.5, since it needs a few core 64-bit libraries that are not available with 10.4), but progress is slow. Still, I've attached a non-mp4 build compiled with gcc 4.3 (with -march=core2, -mtune=core2, -funsafe-loop-optimizations and -freorder-blocks-and-partition) to this post.
AG
omion
20th January 2007, 05:39
Excellent! Thanks for the info! For me, MP4 support is not needed, so this is great news.
It looks like my little $600 Mac Mini is going to be my fastest encoding computer... :rolleyes:
vBulletin® v3.8.4, Copyright ©2000-2010, Jelsoft Enterprises Ltd.