richliu's blog

Linux, 工作, 生活.

richliu's blog header image 2

Gentoo 升級 KDE 碰到的小問題

十月 20th, 2006 · No Comments

最近 Gentoo 升級 2006.01 , 並且 KDE 也從 3.5.4 升級到 3.5.5
所以就順手升級了一下 KDE, 沒有想到會碰到這樣的 Message

libkhtml.so: undefined reference to `__cxa_get_exception_ptr@CXXABI_1.3.1′

*註: 有時候 CXXABI_1.3.1 不會出現.


這個原因是原先的 Library 是 hardcore 到舊版的 GCC, 這時候要做一些小動作更換 GCC 的環境

如果是你使用 Gentoo 的話, 請先列出你的 GCC 版本,

# gcc-config -l
[1] i386-pc-linux-gnu-3.3.4
[2] i686-pc-linux-gnu-3.4.6
[3] i686-pc-linux-gnu-3.4.6-hardened
[4] i686-pc-linux-gnu-3.4.6-hardenednopie
[5] i686-pc-linux-gnu-3.4.6-hardenednopiessp
[6] i686-pc-linux-gnu-3.4.6-hardenednossp
[7] i686-pc-linux-gnu-4.1.1 *

有 * 表示目前使用的版本,
我們從這個列表得知, 較舊的版本是使用 3.4.6 , 所以我們就可以下這個指令修改 gcc 的版本

# fix_libtool_files.sh 3.4.6

會出現類似下面的訊息, 這樣就表示成功了

* [1/9] Scanning /lib
* [2/9] Scanning /usr/lib
* FIXING: /usr/kde/3.5/lib/libkhtml.la …[v]
* FIXING: /usr/kde/3.5/lib/libkabc_slox.la …[v]
* FIXING: /usr/kde/3.5/lib/libkdeinit_kprinter.la …[v]

再重新 emerge -u kde 就可以了.

如果有碰到
libtool: link: cannot find the library `/usr/lib/gcc/i686-pc-linux-gnu/4.1.1/libstdc++.la’

我目前的 solution 是
copy /usr/lib/gcc/i686-pc-linux-gnu/3.4.6/libstdc++.la 的內容到 /usr/lib/gcc/i686-pc-linux-gnu/4.1.1 下, 稍做修改
主要還是路徑和 Library 要正確, 這樣就可以了, 至少看起來 compile 正常
以下是我 /usr/lib/gcc/i686-pc-linux-gnu/4.1.1/libstdc++.la 的內容.

# libstdc++.la – a libtool library file
# Generated by ltmain.sh – GNU libtool 1.4a-GCC3.0 (1.641.2.256 2001/05/28 20:09:07 with GCC-local changes)
#
# Please DO NOT delete this file!
# It is necessary for linking the library.

# The name that we can dlopen(3).
dlname=’libstdc++.so.6′

# Names of this library.
library_names=’libstdc++.so.6.0.8 libstdc++.so.6 libstdc++.so’

# The name of the static archive.
old_library=’libstdc++.a’

# Libraries that this one depends upon.
dependency_libs=’ -lm -L/usr/i686-pc-linux-gnu/bin -L/usr/i686-pc-linux-gnu/lib -L/usr/lib/gcc/i686-pc-linux-g
nu/4.1.1 -L/usr/lib/gcc/i686-pc-linux-gnu/4.1.1/../../../../i686-pc-linux-gnu/lib -lgcc_s -lc’

# Version information for libstdc++.
current=6
age=0
revision=3

# Is this an already installed library?
installed=yes

# Files to dlopen/dlpreopen
dlopen=』
dlpreopen=』

# Directory that this library needs to be installed in:
libdir=’/usr/lib/gcc/i686-pc-linux-gnu/4.1.1′

真難搞 :-/

On this day..

Tags:

Related posts

Tags: Gentoo

0 responses so far ↓

  • There are no comments yet...Kick things off by filling out the form below.

Leave a Comment