编译gcc4.4.6与ICE遇到的几个问题

时间:2022-01-03 14:51:01

1.遇错
./.libs/libgcj.so: undefined reference to `__cxa_call_unexpected'

解决:d.错误码:"/.libs/libgcj.so: undefined reference to `__cxa_call_unexpected' collect2: ld returned 1 exit status"
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=50888
http://gcc.gnu.org/viewcvs/gcc/branches/ARM/embedded-4_6-branch/libjava/prims.cc?view=log&pathrev=189421
替换 libjava/prims.cc这个文件

2.建立软连接,注意之前备份/usr/bin gcc,g++,c++
#which gcc
找到路径
ln -s /usr/local/gcc-4.4.6/bin/gcc /usr/bin/gcc
ln -s /usr/local/gcc-4.4.6/bin/g++ /usr/bin/g++
ln -s /usr/local/gcc-4.4.6/bin/c++ /usr/bin/c++
也可以直接替换,注意备份哈

3.
发现OPENSSL依旧不是最新版本,因为老版本有漏洞,所以手动编译升级了OPENSSL,在安装过程中,执行make install时,
出现“POD document had syntax errors at /usr/bin/pod2man line 69. make .”错误,解决办法如下:

输入以下命令即可:
    rm /usr/bin/pod2man

4.在配置gcc之前遇到类似configure: error: Building GCC requires GMP 4.2+, MPFR 2.3.1+ and MPC 0.8.0+.错误

参考:http://blog.163.com/phys_atom/blog/static/1676445532012229814992/

5.参考配置环境变量

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/mpc-0.8.1/lib:/usr/local/gmp-4.3.2/lib:/usr/local/mpfr-2.4.2/lib
export ICE_HOME=/usr/local/ICE-3.4.2/Ice-3.4.2
export PATH=$PATH:$ICE_HOME/bin
export LD_LIBRARY_PATH=$ICE_HOME/lib:$LD_LIBRARY_PATH