5

I'd like to use the libFLAC dynamic libraries in an app I'm trying to build, but I'm not too familiar with configure and make arguments to actually get FLAC to compile.

I have tried to CC="gcc -m64" CXX="g++ -m64" ./configure and that appears to run fine without issues, but when I run make, I still get

[...lots of output with seemingly no errors...]  
/usr/bin/ranlib: archive member: .libs/libFLAC.a(bitreader_asm.o) cputype (7) does not match previous archive members cputype (16777223) (all members must match)
/usr/bin/ranlib: archive member: .libs/libFLAC.a(cpu_asm.o) cputype (7) does not match previous archive members cputype (16777223) (all members must match)
/usr/bin/ranlib: archive member: .libs/libFLAC.a(fixed_asm.o) cputype (7) does not match previous archive members cputype (16777223) (all members must match)
/usr/bin/ranlib: archive member: .libs/libFLAC.a(lpc_asm.o) cputype (7) does not match previous archive members cputype (16777223) (all members must match)
/usr/bin/ranlib: archive member: .libs/libFLAC.a(stream_encoder_asm.o) cputype (7) does not match previous archive members cputype (16777223) (all members must match)
ranlib .libs/libFLAC.a
ranlib: archive member: .libs/libFLAC.a(bitreader_asm.o) cputype (7) does not match previous archive members cputype (16777223) (all members must match)
ranlib: archive member: .libs/libFLAC.a(cpu_asm.o) cputype (7) does not match previous archive members cputype (16777223) (all members must match)
ranlib: archive member: .libs/libFLAC.a(fixed_asm.o) cputype (7) does not match previous archive members cputype (16777223) (all members must match)
ranlib: archive member: .libs/libFLAC.a(lpc_asm.o) cputype (7) does not match previous archive members cputype (16777223) (all members must match)
ranlib: archive member: .libs/libFLAC.a(stream_encoder_asm.o) cputype (7) does not match previous archive members cputype (16777223) (all members must match)
ranlib: for architecture: x86_64 file: .libs/libFLAC.a(float.o) has no symbols  
make[4]: *** [libFLAC.la] Error 1  
make[3]: *** [all-recursive] Error 1  
make[2]: *** [all-recursive] Error 1  
make[1]: *** [all-recursive] Error 1  
make: *** [all] Error 2

Any suggestions?

eriktous
  • 6,569
  • 2
  • 25
  • 35
ray
  • 1,966
  • 4
  • 24
  • 39
  • Sounds similar to [this issue](http://stackoverflow.com/questions/1185287/compiling-imagemagick-as-64bit-under-os-x) – user1118321 Jan 01 '12 at 18:42
  • @user1118321 Actually, the answer to that question is where I got the configure flags that I've used above, but they do not seem to work in this situation. – ray Jan 01 '12 at 21:50
  • It is different from the linked issue in that in this case, you are compiling C files as 64-bit by default (it is so since Snow Leopard and continues with Lion. `CC="gcc -m64" CXX="g++ -m64"` doesn't do anything) and your problem arrives when trying to link these files with object files that were generated from IA32 assembly. You could try `CC="gcc -m32" CXX="g++ -m32" ./configure`: at least it will have some effects (I can't guarantee they will be positive). – Pascal Cuoq Jan 01 '12 at 22:38

1 Answers1

11

To get this to compile on Lion, disable assembler optimizations:

% ./configure --disable-asm-optimizations

sbooth
  • 16,646
  • 2
  • 55
  • 81