在雪豹上构建 gcc 4.5.2 无法链接不受支持的文件格式
我正在 OS X 10.6.6 上为嵌入式系统构建 gcc 交叉编译器和 gnu java。 gcc native 和 cross 需要是相同的版本,所以我想把所有东西都升级到最新的 gcc 版本。在毫无问题地构建 gmp、mpfr、mpc 和 binutils 后,构建本机 gcc 失败,我认为这是第一个链接步骤。失败的具体步骤是:
fixincludes$ gcc -g -O2 -o fixincl fixincl.o fixtests.o fixfixes.o server.o procopen.o fixlib.o fixopts.o ../libiberty/libiberty.a
ld: warning: in ../libiberty/libiberty.a, file was built for unsupported file format which is not the architecture being linked (x86_64)
此警告后出现许多未定义的符号错误。 libiberty.a 和 .o 文件似乎是相同的体系结构:
fixincludes$ lipo -info ../libiberty/libiberty.a input file ../libiberty/libiberty.a is not a fat file
Non-fat file: ../libiberty/libiberty.a is architecture: x86_64
fixincludes$ lipo -info *.o
Non-fat file: fixfixes.o is architecture: x86_64
Non-fat file: fixincl.o is architecture: x86_64
Non-fat file: fixlib.o is architecture: x86_64
Non-fat file: fixopts.o is architecture: x86_64
Non-fat file: fixtests.o is architecture: x86_64
Non-fat file: procopen.o is architecture: x86_64
Non-fat file: server.o is architecture: x86_64
我怀疑这与 32 位与 64 位有关,但我不知道还要检查什么,并且在任何地方都找不到特定的解决方案。谁能告诉我这里发生了什么事,或者只是将我推向正确的方向?
I'm working on OS X 10.6.6 to build a gcc cross-compiler and gnu java for an embedded system. gcc native and cross need to be the same version, so I want to get everything up to the latest gcc version. After building gmp, mpfr, mpc, and binutils with no problem, building native gcc is failing with what I think is the first link step. The specific step that fails is:
fixincludes$ gcc -g -O2 -o fixincl fixincl.o fixtests.o fixfixes.o server.o procopen.o fixlib.o fixopts.o ../libiberty/libiberty.a
ld: warning: in ../libiberty/libiberty.a, file was built for unsupported file format which is not the architecture being linked (x86_64)
Lots of undefined symbol errors follow this warning. libiberty.a and the .o files appear to be the same architecture:
fixincludes$ lipo -info ../libiberty/libiberty.a input file ../libiberty/libiberty.a is not a fat file
Non-fat file: ../libiberty/libiberty.a is architecture: x86_64
fixincludes$ lipo -info *.o
Non-fat file: fixfixes.o is architecture: x86_64
Non-fat file: fixincl.o is architecture: x86_64
Non-fat file: fixlib.o is architecture: x86_64
Non-fat file: fixopts.o is architecture: x86_64
Non-fat file: fixtests.o is architecture: x86_64
Non-fat file: procopen.o is architecture: x86_64
Non-fat file: server.o is architecture: x86_64
I suspect this has to do with 32-bit vs 64-bit, but I don't know what else to check and can't find a specific solution anywhere. Can anyone tell me what's going on here or just nudge me in the right direction?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论