Mac OSX 10.6 compiler: a puzzling experience with 32 vs 64 bit

后端 未结 4 860
天涯浪人
天涯浪人 2020-12-29 13:32

I have trouble understanding the gcc compiler provided by OSX 10.6 snow leopard, mainly because of my lack of experience with 64 bits environments.

$ cat >         


        
4条回答
  •  太阳男子
    2020-12-29 14:24

    Apple toolchains support multiple architectures. If you want to create a fat binary that contains x86 and x86_64 code, then you have to pass the parameters -arch i386 -arch x86_64 to gcc. The compiler will compile your code twice for both platforms in one go.

    Adding -arch i386 -arch x86_64 to CFLAGS may allow you to compile gmp, mpfr, and whatnot for multiple archs in one go. Building libusb that way worked for me.

提交回复
热议问题