我知道这个问题已经讨论过了(包括那里),没有一次。但是,遗憾的是,我无法解决这个问题。
所以,我有OS X Lion,i686-apple-darwin11-llvm-gcc-4.2(GCC)4.2.1,我尝试构建gcc-4.7.0。
首先,我已经在Debian GNU / Linux上构建了这个编译器,所以我确信任何问题都不会......
所以,我读了this GCC manual,我完全按照所描述的那样做了:
cd gcc-4.7.0
./contrib/download_prerequisites
cd ..
mkdir gcc_build
cd gcc_build
/Users/dshevchenko/Downloads/gcc-4.7.0/configure --prefix=/Users/dshevchenko/Tools/GCC
make
因此,MPC,MPFR和GMP已成功下载, ./ configure 即可。但在制作几分钟后,我收到此错误:
checking for suffix of object files... configure: error:
in `/Users/dshevchenko/Downloads/gcc_build/x86_64-apple-darwin11.4.0/libgcc':
configure: error: cannot compute suffix of object files: cannot compile
See `config.log' for more details.
据我所知,这不能成为动态链接MPFR,MPC或GMP的错误,因为这些库是在GCC源代码树内构建的。
在我的〜/ .bash_profile中:
export DYLD_LIBRARY_PATH=/Users/dshevchenko/Tools/GCC/lib
请帮助我,我将不胜感激任何建议。
答案 0 :(得分:0)
确保您拥有最新的Xcode(撰写本文时为4.4)。在某些版本的Xcode中,llvm编译器中存在一个错误(包括4.1,我有)。对于Xcode 4.4,必须从Xcode首选项下载命令行工具。
答案 1 :(得分:0)
以下解决方案帮助了我:
$ export CC="gcc -D_FORTIFY_SOURCE=0”
$ $srcdir/configure ...
$ make