安裝 gcc 和 binutils 時 C 編譯器無法建立執行檔

安裝 gcc 和 binutils 時 C 編譯器無法建立執行檔

我在建立幾乎所有 GNU 程式時都遇到了問題。我嘗試使用以下方法建立 Binutils 或 GCC:

./configure
make
make install

然而,./configure似乎總是拋出錯誤:

configure: error: in `/home/user/Desktop/binutils-2.28':
configure: error: C compiler cannot create executables
See `config.log' for more details.

Binutils 和 GCC 上都會發生這種情況。我嘗試了其他問題和文章中的所有內容,但沒有解決問題...

我主要尋求 GCC 方面的幫助,因為我最需要這個。 (Binutils 已預先安裝在我的系統上。)

++++ GCC 的 Config.log 輸出 ++++

https://pastebin.com/BJzNMjG2

答案1

gcc作為獨立安裝,無法在大多數「Linux 作業系統」上進行編譯。安裝 g++ (gcc-c++),缺少的部分也會安裝。

如何建構 gcc:gcc 需要 gcc-7.1.0/ 來源之外的建置資料夾! http://www.linuxfromscratch.org/lfs/view/development/chapter05/gcc-pass2.html

如連結中所述解壓縮 gmp、mpfr、mpc,您可以從 build/ 進行配置,例如:

../gcc-7.1.0/configure --prefix=/usr/local/gcc7 --program-suffix=7 --enable-languages=c,c++ --disable-multilib

相關內容