2012年2月27日星期一

安装gcc-3.3.3

Opensuse 安装gcc-3.3

1) 下载gcc-3.3.3.tar.gz

2) 解压
% tar xzvf gcc-3.3.3.tar.gz

3) 安装
% mkdir gcc-build #随便叫什么名字都行
% cd gcc-build
% /pathtogcc-3.3.3/configure --prefix=/opt/gcc3.3 #/opt/gcc3.3是自定义目录, 需要有相关权限
% make
make出错
错误1 read-rtl.c:653: error: lvalue required as increment operand
解决1 修改/pathtogcc-3.3.3/include/obstack.h
第426行 *((void **)__o->next_free)++ = ((void *)datum); \
修改为
*((void **)__o->next_free) = ((void *)datum); \
__o->next_free += sizeof(void *); \

错误2 lvalue required as left operand of assignment In file included from ../../gcc/cp/decl.c:15472
patch decl.c < gcc42-patch-gcc-3.3.1_gcc_cp_decl.c

错误3 ../../gcc/f/com.c:11079: error: conflicting types for ‘ffecom_gfrt_basictype’
../../gcc/f/com.h:236: error: previous declaration of ‘ffecom_gfrt_basictype’ was here
解决3 修改gcc/f/com.h:236 ffeinfoKindtype-->ffeinfoBasictype

错误4 ../../gcc/java/gjavah.c:49: error: static declaration of ‘flag_jni’ follows non-static declaration
../../gcc/java/java-tree.h:170: error: previous declaration of ‘flag_jni’ was here
解决4 修改gjavah.c第49, static int flag_jni = 0; --> int flag_jni = 0;

错误5 /usr/include/gnu/stubs.h:7:27: gnu/stubs-32.h: No such file or directory
解决5 configure时添加参数 /pathtogcc-3.3.3/configure --prefix=/opt/gcc3.3 --enable-threads=posix --disable-checking --disable-multilib --enable-languages=c,c++

% make install