gcc 4.1.1

なにごともチャレンジ。
"Gentoo Linux GCCアップグレードガイド" を参考にやってみる。

# emerge -uav gcc

Thread are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild     U ] sys-devel/bison-2.2 [2.1] USE="-nls -static" 1,052 kB
[ebuild  NS   ] sys-devel/gcc-4.1.1  USE="gtk -bootstrap -build -doc -fortran -gcj -hardened -ip28 -mudflap -multislot -nls -nocxx -objc -objc++ -objc-gc -vanilla" 38,295 kB
[ebuild  N    ] virtual/libstdc++-3.3  0 kB

Total size of downloads: 39,347 kB

Would you like to merge these packages? [Yes/No]

ここで Yes と答えて、gcc-4.1.1 を入れる。

# gcc-config i686-pc-linux-gnu-4.1.1
# source /etc/profile

eselect もしておく

# eselect compile list
  [1]	i686-pc-linux-gnu-3.3.6/default
  [2]	i686-pc-linux-gnu-3.3.6/hardened
  [3]	i686-pc-linux-gnu-3.3.6/hardenednopie
  [4]	i686-pc-linux-gnu-3.3.6/hardenednopiessp
  [5]	i686-pc-linux-gnu-3.3.6/hardenednossp
  [6]	i686-pc-linux-gnu-3.4.5/default
  [7]	i686-pc-linux-gnu-3.4.5/hardened
  [8]	i686-pc-linux-gnu-3.4.5/hardenednopie
  [9]	i686-pc-linux-gnu-3.4.5/hardenednopiessp
  [10]	i686-pc-linux-gnu-3.4.5/hardenednossp
  [11]	i686-pc-linux-gnu-3.4.6/hardened
  [12]	i686-pc-linux-gnu-3.4.6/hardenednopie
  [13]	i686-pc-linux-gnu-3.4.6/hardenednopiessp
  [14]	i686-pc-linux-gnu-3.4.6/hardenednossp
  [15]	i686-pc-linux-gnu-3.4.6/vanilla
  [16]	i686-pc-linux-gnu-4.1.1/vanilla

Activated profiles:
  i686-pc-linux-gnu *	    i686-pc-linux-gnu-3.4.6/vanilla

# eselect compiler set 16

んで libtool を再構築

# emerge --oneshot -av libtool 

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild   R   ] sys-devel/libtool-1.5.22  2,853 kB

Total size of downloads: 2,853 kB

Would you like to merge these packages? [Yes/No]

これに Yes と応える。
次に気の遠くなるような作業を行う。

# emerge -e system
# emerge -e world

なんか kernel-2.6.11 がインストールされてたような…
まぁ、いいや。とりあえず朝まで放置しておこう。上手くいけば終わってると思う。

朝起きて見てみると、 libsdl のビルドでこけてる。xinerama 関係。USE="xinerama"としてビルドすると上手くいった。
emerge -e world しなおすと、また1からやりなおしになるので、emerge -ep world をリダイレクトして、リストアップし、かたっぱしから emerge する shell script を作る。
それでも firefox が控えてるので、また朝まで放置かな…

と思いきや j2sdk で tar ball をダウンロード出来ないという事でストップしちゃってる。そうだ、こいつはマニュアルで tar ball を落として置いて ./usr/portage/distfie に置かないとだめなんだった。
SUN の Download Center は javascript 必須だから firefox のビルドが終わってから改めてだな。面倒くせ。
とりあえず、emerge shell script から java 関係を全て除外してから、再度走らせる。

今度は app-text/new でビルドエラー

i686-pc-linux-gnu-gcc -g -Wall -DGLOBAL_TEMPLATE_DIR=\"/usr/share/new/templates\" -DGLOBAL_PROJECT_DIR=\"/usr/share/new/projects\" -o .libs/new_proj new_proj.o  -lpwdb ./.libs/libfmt_ptrn.so ./.libs/libtemplate.so -lz
./.libs/libfmt_ptrn.so: undefined reference to `_pair_compare'
collect2: ld returned 1 exit status
make[2]: *** [new_proj] Error 1
make[2]: *** Waiting for unfinished jobs....
i686-pc-linux-gnu-gcc -g -Wall -DGLOBAL_TEMPLATE_DIR=\"/usr/share/new/templates\" -DGLOBAL_PROJECT_DIR=\"/usr/share/new/projects\" -o .libs/new new.o usage_new.o  -lpwdb ./.libs/libfmt_ptrn.so ./.libs/libtemplate.so -lz
./.libs/libfmt_ptrn.so: undefined reference to `_pair_compare'
collect2: ld returned 1 exit status
make[2]: *** [new] Error 1
make[2]: Leaving directory `/var/tmp/portage/new-1.3.2/work/new-1.3.2/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/var/tmp/portage/new-1.3.2/work/new-1.3.2'
make: *** [all-recursive-am] Error 2

!!! ERROR: app-text/new-1.3.2 failed.
Call stack:
ebuild.sh, line 1531:	Called dyn_compile
ebuild.sh, line 931:   Called src_compile
ebuild.sh, line 601:   Called die

!!! emake failed
!!! If you need support, post the topmost build error, and the call stack if relevant.

inline 指定がまずいような気がするが。とりあえず放置して次。

media-fonts/acroread-asianfonts では LINGUAS を指定しろといって止まる。

# LINGUAS="ja" emerge -v media-fonts/acroread-asianfonts

と手動でやる。やれやれ、全然進まねーじゃねーか!
やっと終わった。めんどくさいので java 関係は jre をのぞいて全部削除した。eclipse も必要な時に再 install しよう。
後は旧バージョンを削除れば終わりなんだけど、3.4.6 は取り合えず残しておく。

# gcc --version
i686-pc-linux-gnu-gcc (GCC) 4.1.1 (Gentoo 4.1.1)
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

ふー、やっとおわった。