背景
我在 macos 11.5 上面编译 gcc-4.7.1,target=i686-none-linux-gnu,结果报错
checking for gcc option to accept ISO Standard C... (cached) none needed
checking how to run the C preprocessor... gcc -E
checking build system compiler gcc... rm: conftest.dSYM: is a directory
rm: conftest.dSYM: is a directory
no
configure: error: Specified CC_FOR_BUILD doesn't seem to work
make[1]: *** [configure-gmp] Error 1
make: *** [all] Error 2
原因
我macos上的gcc 版本和要编译的目标gcc版本差距太大
➜ build gcc -v
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/4.2.1
Apple clang version 13.0.0 (clang-1300.0.29.3)
Target: x86_64-apple-darwin20.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDef