gcc-4.1.2から4.3.2にアップグレード

少し前にemerge -e system -e worldをしたときに新しいgccが来てるのを確認し
インストールしたのだが,gcc --versionを見ると4.1.2のまま.

# ls /usr/bin/ | grep i686-pc-linux-gnu
i686-pc-linux-gnu-addr2line

   (snip)

i686-pc-linux-gnu-gcc
i686-pc-linux-gnu-gcc-4.1.2
i686-pc-linux-gnu-gcc-4.3.2

   (snip)

gcc-4.3.2はインストールされているみたいだけど,
gcc --versionをするとまだ4.1.2になっている(゜o゜)


gcc-configでアクティブなgccを4.3.2に切り替える.(←これをやってなかったのかー
# インストールされていないものを引数に指定したらどうなるのか気になって
# わざと一回間違ってみた.問題ないね.

# gcc-config i686-pc-linux-gnu-4.3.1
 * gcc-config: Could not locate 'i686-pc-linux-gnu-4.3.1' in '/etc/env.d/gcc/' !
# gcc-config i686-pc-linux-gnu-4.3.2
 * Switching native-compiler to i686-pc-linux-gnu-4.3.2 ...
>>> Regenerating /etc/ld.so.cache...

 * If you intend to use the gcc from the new profile in an already
 * running shell, please remember to do:

 *   # source /etc/profile
# source /etc/profile

これで,

# gcc --version
gcc (Gentoo 4.3.2-r3 p1.6, pie-10.1.5) 4.3.2
Copyright (C) 2008 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.


古いgccのunmerge.

# emerge -aC =sys-devel/gcc-4.1.2

>>> These are the packages that would be unmerged:

 sys-devel/gcc
    selected: 4.1.2 
   protected: none 
     omitted: 4.3.2-r3 

>>> 'Selected' packages are slated for removal.
>>> 'Protected' and 'omitted' packages will not be removed.

Would you like to unmerge these packages? [Yes/No] y  
>>> Waiting 5 seconds before starting...
>>> (Control-C to abort)...
>>> Unmerging in: 5 4 3 2 1 
>>> Unmerging sys-devel/gcc-4.1.2...
 * Running 'fix_libtool_files.sh 4.1.2'
 * Scanning libtool files for hardcoded gcc library paths...
 *   [1/4] Scanning /lib ...
 *   [2/4] Scanning /usr/lib ...
 *   [3/4] Scanning /usr/i686-pc-linux-gnu/lib ...
 *   [4/4] Scanning /usr/local/lib ...

 * Regenerating GNU info directory index...
 * Processed 8 info files.

 * IMPORTANT: 4 config files in '/etc' need updating.
 * See the CONFIGURATION FILES section of the emerge
 * man page to learn how to update config files.


lsで/usr/bin以下を見てみたら消えてるのを確認した.


make.confを編集して

CFLAGS="-O2 -march=pentium3 -pipe"

から

CFLAGS="-O2 -march=native -pipe"

に変更してみた.

# CHOSTも書き換えるのか...?
# あとで調べる.

必要ないみたい(d:id:pneumaster:20090414:1239710797



最後に再コンパイル

# emerge -e system