最近在CentOS7的64位機器上,通過編譯源代碼安裝gcc8.3.0時遇到一個問題如下;
/usr/bin/ld: cannot find crt1.o: No such file or directory
/usr/bin/ld: cannot find crti.o: No such file or directory
看了好多網上的解決方案:有的是把crtl1.o的路徑加入PATH,有的是把crtl.o的路徑加到LD_LIBRARY_PATH,但是,錯誤依舊。
最後的解決方法是:
1) 在執行./configure 時,添加參數 --host=x86_64 來解決
2)通過 添加參數 --disable-multilib 來解決。