LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 2342|回复: 29

把system升级为gcc4的方法

[复制链接]
发表于 2005-4-23 13:40:46 | 显示全部楼层 |阅读模式
1) Make sure that your current system is consistant.
2) Upgrade to at least binutils-2.15.94.0.2.2 with the ld script patch.
3) Shorten your build path e.g. PORTAGE_TMPDIR=/t (this is necessary, otherwise you will get execvp error when installing glibc.
4) You will need glibc weekly HEAD snapshot, or HEAD cvs checkout for gcc4 support.
5) If you are on nptl, make sure to add nptlony to your USE flags.
6) LEAVE YOUR LDFLAGS ALONE, also LEAVE the COMPILER VISIBILITY FLAGS ALONE.
7) Take it easy with your compiler flags, some suggestions:
Sane:-
Code:

CFLAGS="-O2 -march=pentium4 -mtune=pentium4 -fomit-frame-pointer -pipe "
CXXFLAGS=${CFLAGS}

Less Sane:-
Code:

CFLAGS="-O2 -march=pentium4 -mtune=pentium4 -mfpmath=sse -msse2 -fforce-addr -momit-leaf-frame-pointer -fomit-frame-pointer -pipe "
CXXFLAGS=${CFLAGS}

7) Setup an overlay, sources for overlays:
Code:

Mafteah:
http://overlay.mafteah.co.il/
Halcy0n (gentoo dev):
http://dev.gentoo.org/~halcy0n/
I've dumped my overlay here:
http://bugs.gentoo.org/show_bug.cgi?id=90097
dirtyepic, also has an overlay, however, not sure whether he is offering it to th public.

9) Do not ditch your other compiler, as you may need it for those packages which do not yet compile with gcc4.
10) If package compiles fine but segfaults, recompile with -O1 or O0, this may help.
11) Happy compiling :-)
HTH
CAVEATS:
1) If you have a working system back it.
2) It is better to play with gcc4 in a chrooted environment, or a spare partition.
由于存在一定的风险,请用quickpkg备份binutils glibc
发表于 2005-4-23 16:40:54 | 显示全部楼层
http://forums.gentoo.org/viewtopic-t-327669-highlight-gcc.html
注明一下出处好点吧,这是对别人的尊重 :-)
回复 支持 反对

使用道具 举报

发表于 2005-4-23 18:13:16 | 显示全部楼层
每次编译gmp都不能成功
出错信息:
  1. /bin/sh ../libtool --mode=compile --tag=CC ../mpn/m4-ccas --m4="m4" i686-pc-linux-gnu-gcc -c -DHAVE_CONFIG_H -I. -I. -I.. -D__GMP_WITHIN_GMP -I.. -DOPERATION_`echo udiv | sed 's/_$//'`    -march=athlon-xp -O3 -pipe -fomit-frame-pointer `test -f udiv.asm || echo './'`udiv.asm
  2. /bin/sh ../libtool --mode=compile --tag=CC ../mpn/m4-ccas --m4="m4" i686-pc-linux-gnu-gcc -c -DHAVE_CONFIG_H -I. -I. -I.. -D__GMP_WITHIN_GMP -I.. -DOPERATION_`echo umul | sed 's/_$//'`    -march=athlon-xp -O3 -pipe -fomit-frame-pointer `test -f umul.asm || echo './'`umul.asm
  3. libtool: unrecognized option `--tag=CC'
  4. Try `libtool --help' for more information.
  5. make[2]: *** [umul.lo] Error 1
  6. make[2]: *** Waiting for unfinished jobs....
  7. libtool: unrecognized option `--tag=CC'
  8. Try `libtool --help' for more information.
  9. make[2]: *** [udiv.lo] Error 1
  10. make[2]: Leaving directory `/var/tmp/portage/gmp-4.1.4/work/gmp-4.1.4/mpn'
  11. make[1]: *** [all-recursive] Error 1
  12. make[1]: Leaving directory `/var/tmp/portage/gmp-4.1.4/work/gmp-4.1.4'
  13. make: *** [all] Error 2

  14. !!! ERROR: dev-libs/gmp-4.1.4 failed.
  15. !!! Function src_compile, Line 61, Exitcode 2
  16. !!! emake failed
  17. !!! If you need support, post the topmost build error, NOT this status message.
复制代码


我运行了libtool --help看了一下,是有 --tag这个开关的
  1. $ libtool --help
  2. Usage: libtool [OPTION]... [MODE-ARG]...

  3. Provide generalized library-building support services.

  4.     --config          show all configuration variables
  5.     --debug           enable verbose shell tracing
  6. -n, --dry-run         display commands without modifying any files
  7.     --features        display basic configuration information and exit
  8.     --finish          same as `--mode=finish'
  9.     --help            display this help message and exit
  10.     --mode=MODE       use operation mode MODE [default=inferred from MODE-ARGS]
  11.     --quiet           same as `--silent'
  12.     --silent          don't print informational messages
  13.     --tag=TAG         use configuration variables from tag TAG
  14.     --version         print version information

  15. MODE must be one of the following:

  16.       clean           remove files from the build directory
  17.       compile         compile a source file into a libtool object
  18.       execute         automatically set library path, then run a program
  19.       finish          complete the installation of libtool libraries
  20.       install         install libraries or executables
  21.       link            create a library or an executable
  22.       uninstall       remove libraries from an installed directory

  23. MODE-ARGS vary depending on the MODE.  Try `libtool --help --mode=MODE' for
  24. a more detailed description of MODE.

  25. Report bugs to <bug-libtool@gnu.org>.
复制代码


用google搜过了,在官方论坛也搜了一下,也没找到什么有用的信息 :confused:  :confused:
不知道兄弟们有没有谁碰到过?
回复 支持 反对

使用道具 举报

发表于 2005-4-23 18:27:30 | 显示全部楼层
我的gmp刚过了

可能是因为先emerge linux-headers (2.6.11)
回复 支持 反对

使用道具 举报

发表于 2005-4-23 18:46:01 | 显示全部楼层
linux-headers (2.6.11)我也已经emerge过了啊
  1. $ emerge linux-headers -pv

  2. These are the packages that I would merge, in order:

  3. Calculating dependencies ...done!
  4. [ebuild   R   ] sys-kernel/linux-headers-2.6.11  0 kB

  5. Total size of downloads: 0 kB
复制代码
回复 支持 反对

使用道具 举报

发表于 2005-4-23 19:56:38 | 显示全部楼层
我的是2005.0
到了python2.3.5还是挂了。
CPR ing
回复 支持 反对

使用道具 举报

发表于 2005-4-23 20:39:19 | 显示全部楼层
我emerge -eu system,除了wget编译失败,glibc还没编译外全部都通过了:)
回复 支持 反对

使用道具 举报

发表于 2005-4-23 21:00:07 | 显示全部楼层
我的就是glibc通不过。

错误信息:
../sysdeps/ieee754/dbl-64/s_isinf.c:29: error: 'isinf' aliased to undefined symbol '__isinf'
make[2]: *** [/t/portage/glibc-2.3.5/work/build-default-i686-pc-linux-gnu-nptl/math/s_isinf.os] Error 1
make[2]: *** Waiting for unfinished jobs....
../sysdeps/ieee754/dbl-64/s_isnan.c:40: error: 'isnan' aliased to undefined symbol '__isnan'
make[2]: *** [/t/portage/glibc-2.3.5/work/build-default-i686-pc-linux-gnu-nptl/math/s_isnan.os] Error 1
make[2]: Leaving directory `/t/portage/glibc-2.3.5/work/glibc-2.3.5/math'
make[1]: *** [math/subdir_lib] Error 2
make[1]: Leaving directory `/t/portage/glibc-2.3.5/work/glibc-2.3.5'
make: *** [all] Error 2

!!! ERROR: sys-libs/glibc-2.3.5 failed.
!!! Function toolchain-glibc_src_compile, Line 244, Exitcode 2
!!! (no error message)
!!! If you need support, post the topmost build error, NOT this status message.
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-4-23 21:12:40 | 显示全部楼层
Post by nait
每次编译gmp都不能成功

用google搜过了,在官方论坛也搜了一下,也没找到什么有用的信息 :confused:  :confused:
不知道兄弟们有没有谁碰到过?

是不是你的libtool版本不正确,我的是1.5.14(不过还不知道是否能通过),通过的同志可以
把libtool的版本给贴一下
回复 支持 反对

使用道具 举报

发表于 2005-4-23 22:55:39 | 显示全部楼层
对呀!我和tsaogj的问题一样,大家帮帮忙啊!
回复 支持 反对

使用道具 举报

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

本版积分规则

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