Le 8 déc. 2009 à 12:17, Alexander Carôt a écrit : > Thanks for the quick response ! > >> It appends when you try to link a x64 application on a i386 library. Xcode >> set the arch to x64 by default for new projects and gcc compile into x64 >> by default too if you do not explicitly set the architecture. > > The situation is as follows: I am using a 32Bit-Version of Qt, which so far > works fine with any other libs I am linking with. So, I explicitly configure > my app as x86 and not x86_64. Nevertheless, I am not sure if libffmpeg is > built as 32 or 64 bit but if gcc´s default is x64 I believe the latter is the > case. So, I tried to configure as you suggested: > >> I'm configuring ffmpeg like this to compile for i386 >> >> ./configure --prefix=/opt/ffmpeg --enable-cross-compile --arch=i386 >> --extra-cflags='-arch i386' --extra-ldflags='-arch i386' > > but this lead to this error: > > libavcodec/x86/h264dsp_mmx.c: In function ‘put_h264_qpel4_h_lowpass_3dnow’: > libavcodec/x86/h264dsp_mmx.c:2058: error: can't find a register in class > ‘GENERAL_REGS’ while reloading ‘asm’ > libavcodec/x86/h264dsp_mmx.c:2058: error: ‘asm’ operand has impossible > constraints > > Do you know how to fix this ?
There is a couple of x86 asm file that cannot be compiled by gcc, but works with llvm-gcc. Unfortunately, compiling the whole library with llvm-gcc does not works (I got invalid behaviors). When you got an error like this one, just compile the file yourself. For example, if the compilation failed on the line: gcc -DHAVE_AV_CONFIG_H -I. -I"/Users/jddupas/Desktop/Emerald/subprojs/Sapphire/sdk/ffmpeg" -D_ISOC99_SOURCE -D_POSIX_C_SOURCE=200112 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -DPIC -arch i386 -std=c99 -fomit-frame-pointer -fPIC -g -Wdeclaration-after-statement -Wall -Wno-switch -Wdisabled-optimization -Wpointer-arith -Wredundant-decls -Wno-pointer-sign -Wcast-qual -Wwrite-strings -Wundef -O3 -fno-math-errno -fno-tree-vectorize -MMD -MF libavcodec/x86/lpc_mmx.d -MT libavcodec/x86/lpc_mmx.o -c -o libavcodec/x86/lpc_mmx.o libavcodec/x86/lpc_mmx.c Just copy it and replace gcc by llvm-gcc. llvm-gcc -DHAVE_AV_CONFIG_H -I. -I"/Users/jddupas/Desktop/Emerald/subprojs/Sapphire/sdk/ffmpeg" -D_ISOC99_SOURCE -D_POSIX_C_SOURCE=200112 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -DPIC -arch i386 -std=c99 -fomit-frame-pointer -fPIC -g -Wdeclaration-after-statement -Wall -Wno-switch -Wdisabled-optimization -Wpointer-arith -Wredundant-decls -Wno-pointer-sign -Wcast-qual -Wwrite-strings -Wundef -O3 -fno-math-errno -fno-tree-vectorize -MMD -MF libavcodec/x86/lpc_mmx.d -MT libavcodec/x86/lpc_mmx.o -c -o libavcodec/x86/lpc_mmx.o libavcodec/x86/lpc_mmx.c then you can resume compilation by using make (until the next failure). -- Jean-Daniel _______________________________________________ libav-user mailing list [email protected] https://lists.mplayerhq.hu/mailman/listinfo/libav-user
