我正在尝试在OS X 10.9中编译和安装GCC 4.8.2。我按照这里的说明 (http://gcc.gnu.org/wiki/InstallingGCC),首先运行./contrib/download_prerequesites
,然后从与源代码不同的目录运行configure和make。我的构建失败并显示以下错误:
checking for suffix of object files... configure: error: in `/Users/prokilogrammer/temp/gcc-build482/x86_64-apple-darwin13.0.2/libgcc':
configure: error: cannot compute suffix of object files: cannot compile
See `config.log' for more details.
显然,如果GCC的依赖项(GMP、MPC、MPFR)正确安装,这个问题就会得到解决(http://gcc.gnu.org/wiki/FAQ#configure_suffix)。我检查并确保它们已经正确地安装在/usr/local/lib和/usr/local/include目录下。
查看config.log,我看到以下错误:
configure:3565: checking for suffix of object files
configure:3587: /Users/prokilogrammer/temp/gcc-build482/./gcc/xgcc -B/Users/prokilogrammer/temp/gcc-build482/./gcc/ -B/usr/local/x86_64-apple-darwin13.0.2/bin/ -B/usr/local/x86_64-apple-darwin13.0.2/lib/ -isystem /usr/local/x86_64-apple-darwin13.0.2/include -isystem /usr/local/x86_64-apple-darwin13.0.2/sys-include -c -g -O2 conftest.c >&5
conftest.c:1:0: internal compiler error: Segmentation fault: 11
/* confdefs.h */
^
libbacktrace could not find executable to open
我不确定segmentation fault是由于缺少依赖项还是gcc中的合法问题。
你们有没有遇到类似的问题?是否有解决方法或变通之道?
附注:我也尝试了设置LD_LIBRARY_PATH和DYLD_LIBRARY_PATH,但没有任何运气。
/ usr / local / x86_64-apple-darwin13.0.2
目录。这是否意味着你之前使用过GCC编译器? - Jonathan LefflerConfigured with: --prefix = /Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1 Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn) Target: x86_64-apple-darwin13.0.0 Thread model: posix
)来引导构建,最终成功完成编译。 - Jonathan Leffler