步驟:
1、先編譯gmp mpfr mpc這幾個庫,注意configure時--prefix=/usr/local/
2、中間碰到過can not compute suffix的錯誤,在命令
export LD_LIBRARY_PATH=/usr/local/:${LD_LIBRARY_PATH}
export LD_RUN_PATH=/usr/local/:${LD_RUN_PATH}
也不行,最后修改了/home/musictom/.bash_profile加上了如下行:
PATH="/bin/:/lib/:/usr/sbin/:/usr/local/bin/:/usr/i686-pc-mingw32/sys-root/mingw/bin/"
LD_LIBRARY_PATH="/lib/:/usr/local/lib/:/usr/i686-pc-mingw32/lib/:/usr/i686-pc-mingw32/sys-root/mingw/lib/:${LD_RUN_PATH}"
LD_RUN_PATH="/lib/:/usr/local/lib/:/usr/i686-pc-mingw32/lib/:/usr/i686-pc-mingw32/sys-root/mingw/lib/:${LD_RUN_PATH}"
就可以了
3、mkdir /home/gcc-4.7.1-i386-pc-cygwin-out
cd /home/gcc-4.7.1-i386-pc-cygwin-out
../gcc-4.7.1/configure --prefix=/usr/local/gcc-4.7.1-i386-pc-cygwin --with-gmp=/usr/local/ --with-mpc=/usr/local/ --with-mpfr=/usr/local/ --enable-shared=libgcc,libstdc++ --enable-languages=c,c++ --disable-libada --disable-libssp --disable-libquadmath --disable-libquadmath-support --disable-libgomp
make
make install
原來把gdb也放在了gcc的源代碼目錄里,結果報找不到庫termcap,弄了半天也沒弄出來,最后只好把gdb的源代碼拿掉
基實還需要把binutils也編譯后,再安裝,這個可以另外再弄,整個編譯大概花了五六個小時,好了,下次再嘗試編譯arm的交叉編譯器
更多文章、技術交流、商務合作、聯系博主
微信掃碼或搜索:z360901061

微信掃一掃加我為好友
QQ號聯系: 360901061
您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點擊下面給點支持吧,站長非常感激您!手機微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點擊微信右上角掃一掃功能,選擇支付二維碼完成支付。
【本文對您有幫助就好】元
