LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
12
返回列表 发新帖
楼主: whitelilis

升级 gcc (问题已经解决,详见第 8 贴我的办法)

[复制链接]
发表于 2008-3-27 12:54:46 | 显示全部楼层
我不熟 Fortran,f95 是 CBLFS 上的写法,如果还是不行的话就帮不上忙了,Sorry!
回复 支持 反对

使用道具 举报

 楼主| 发表于 2008-3-27 13:01:14 | 显示全部楼层
另外附上完整的出错信息:

libtool: compile:  /mnt/RedHat/space_need/source/gcc-build/./gcc/xgcc -B/mnt/RedHat/space_need/source/gcc-build/./gcc/ -B/usr/i686-pc-linux-gnu/bin/ -B/usr/i686-pc-linux-gnu/lib/ -isystem /usr/i686-pc-linux-gnu/include -isystem /usr/i686-pc-linux-gnu/sys-include -DHAVE_CONFIG_H -I. -I../../../gcc-4.3.0/libgfortran -I. -iquote../../../gcc-4.3.0/libgfortran/io -I../../../gcc-4.3.0/libgfortran/../gcc -I../../../gcc-4.3.0/libgfortran/../gcc/config -I../.././gcc -D_GNU_SOURCE -std=gnu99 -Wall -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wextra -Wwrite-strings -O2 -g -g -O2 -MT unix.lo -MD -MP -MF .deps/unix.Tpo -c ../../../gcc-4.3.0/libgfortran/io/unix.c  -fPIC -DPIC -o .libs/unix.o
/usr/include/bits/mathinline.h: Assembler messages:
/usr/include/bits/mathinline.h:6224: Error: symbol `fstat64' is already defined
/usr/include/bits/mathinline.h:7040: Error: symbol `lstat64' is already defined
/usr/include/bits/mathinline.h:7073: Error: symbol `stat64' is already defined
make[3]: *** [unix.lo] 错误 1
make[3]: Leaving directory `/mnt/RedHat/space_need/source/gcc-build/i686-pc-linux-gnu/libgfortran'
make[2]: *** [all] 错误 2
make[2]: Leaving directory `/mnt/RedHat/space_need/source/gcc-build/i686-pc-linux-gnu/libgfortran'
make[1]: *** [all-target-libgfortran] 错误 2
make[1]: Leaving directory `/mnt/RedHat/space_need/source/gcc-build'
make: *** [bootstrap] 错误 2

从这个信息来看,确实是 fortran 的问题,既然说重复定义,我试着改一下看能不能消除这个。
回复 支持 反对

使用道具 举报

发表于 2008-6-6 15:56:45 | 显示全部楼层
mistake:

checking for suffix of object files... configure: error: cannot compute suffix of object files: cannot compile
See `config.log' for more details.
make[2]: *** [configure-stage1-target-libgcc] Error 1
make[2]: Leaving directory `/tmp/gcc-4.3.0'
make[1]: *** [stage1-bubble] Error 2
make[1]: Leaving directory `/tmp/gcc-4.3.0'
make: *** [bootstrap] Error 2

求whitelilis帮帮忙。我邮箱3qlongfa@gmail.com如果方便的话。
谢谢各位高手了
回复 支持 反对

使用道具 举报

发表于 2008-6-6 16:06:24 | 显示全部楼层
sed -i 's/install_to_$(INSTALL_DEST) //' libiberty/Makefile.in &&
sed -i 's@\./fixinc\.sh@-c true@' gcc/Makefile.in &&
mkdir ../gcc-build

8楼这几步的作用是什么?
回复 支持 反对

使用道具 举报

发表于 2008-6-11 11:29:10 | 显示全部楼层
Post by whitelilis;1831069
下载下来今年3月6日发布的 4.3 版,准备安装。
   发现,以前,作为可选项的 GMP 和 MPFR 成为必须的了,只好上网把它们也下载下来。
   先安 GMP, 按照 BLFS 的手册, ./configure --prefix=/usr --enable-cxx --enable-mpsd && make
   文档就不安了,check 也没做。直接再 make install
   再看 MPFR 的 INSTALL,说它依赖于 GMP.还说强烈建议安装补丁:
   wget http://www.mpfr.org/mpfr-2.3.0/patches
   patch -N -Z -p1 < patches
   再往下,没有特殊的说明,./configure --prefix=/usr (这个是 lfs 的习惯)
   还是不 check 不安文档, make && make install
   完事。
   sed -i 's/install_to_$(INSTALL_DEST) //' libiberty/Makefile.in &&
   sed -i 's@\./fixinc\.sh@-c true@' gcc/Makefile.in &&
   mkdir ../gcc-build
   因为我要用 fortran, 所以
   ../gcc-4.3.0/configure --prefix=/usr --libdir=/usr/lib -libexecdir=/usr/lib --enable-shared --enable-threads=posix -enable-__cxa_atexit --enable-c99 --enable-long-long --enable-clocale=gnu --disable-libstdcxx-pch --disable-multilib --enable-languages=c,c++,fortran
   make bootstrap
   /usr/include/bits/mathinline.h: Assembler messages:
   /usr/include/bits/mathinline.h:6224: Error: symbol `fstat64' is already defined
   /usr/include/bits/mathinline.h:7040: Error: symbol `lstat64' is already defined
   /usr/include/bits/mathinline.h:7073: Error: symbol `stat64' is already defined

下面改这个源代码试一下
--------------------------------------------
我在怀疑是不是 fortran 的问题,于是 configure 时去掉最后的 fortran 支持,只编译 c,c++ 就通过了。
即:
../gcc-4.3.0/configure --prefix=/usr --libdir=/usr/lib -libexecdir=/usr/lib --enable-shared --enable-threads=posix -enable-__cxa_atexit --enable-c99 --enable-long-long --enable-clocale=gnu --disable-libstdcxx-pch --disable-multilib --enable-languages=c,c++
然后,
make bootstrap
ln -v -sf ../usr/bin/cpp /lib &&
ln -v -sf gcc /usr/bin/cc &&
chown -v -R root:root    /usr/lib/gcc/i686-pc-linux-gnu/4.3.0/include &&
chown -v -R root:root    /usr/lib/gcc/i686-pc-linux-gnu/4.3.0/ada{lib,include}

为什么加上 fortran 就不行呢?
以后用到了再研究,毕竟 linux 是拿来用的,不是用来折腾的。

还是谢谢楼上的各位。


如果想加fortran支持,需要指出mpfr和gmp的安装目录(以安装到/usr为例):
--with-mpfr=/usr --with-gmp=/usr   
更多信息可查看这个hints:
http://www.linuxfromscratch.org/ ... _gcc_during_lfs.txt
回复 支持 反对

使用道具 举报

发表于 2008-6-19 17:15:38 | 显示全部楼层

遇到了同样的问题

Post by 3qlongfa;1859781
mistake:

checking for suffix of object files... configure: error: cannot compute suffix of object files: cannot compile
See `config.log' for more details.
make[2]: *** [configure-stage1-target-libgcc] Error 1
make[2]: Leaving directory `/tmp/gcc-4.3.0'
make[1]: *** [stage1-bubble] Error 2
make[1]: Leaving directory `/tmp/gcc-4.3.0'
make: *** [bootstrap] Error 2

求whitelilis帮帮忙。我邮箱3qlongfa@gmail.com如果方便的话。
谢谢各位高手了



遇到了同样的问题,麻烦大家帮忙看看啊!!万分感谢!!!
回复 支持 反对

使用道具 举报

 楼主| 发表于 2008-6-19 22:05:28 | 显示全部楼层
奇怪了。
大家都是从什么版本升级过来的?是按我 8 楼的方法做的吗?
回复 支持 反对

使用道具 举报

发表于 2008-6-20 11:10:42 | 显示全部楼层
下载的是4.3.1 版,先安装了GMP 和 MPFR ,然后解压gcc-4.3.1,执行./configure --prefix=/usr ,然后make,就报错了。不知道是什么原因引起的啊
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表