其实我只要在 .xprofile 中加上 export LD_PRELOAD=/usr/lib64/opengl/ati/lib/libGL.so gnome就可以正常启动
加上这句后 像 android sdk 包中的 adb 和 jd-gui 就不能使用了,
提示
ERROR: ld.so: object '/usr/lib64/opengl/ati/lib/libGL.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS64): ignored在执行这两个工具前加上 LD_PRELAOD=/usr/lib32/opengl/ati/lib/libGL.so 这两个工具就可以正常执行了
查资料说32或64的ELF文件中指定的动态链接器是不同的
$~/Java/android-sdk-linux/platform-tools $ file adb #32位的adb
adb: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.2, for GNU/Linux 2.6.15, not stripped
$ file ~/c/getinfo #一个64位ELF
/home/mr.liyanh/c/getinfo: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, not stripped
可以看到确实是不同的加载器,之后就不明白了,ld-linux.so 查找动态库的顺序是怎样的, /usr/lib 指向 /lib32 和 /lib64 有什么不同,32位程序和64位程序是怎么在一起执行那个的
我知道 LD_PRELAOD 的优先级很高,指定了这个变量会优先查找,找到了就直接使用了,导致 adb 和 jd-gui 不能正确识别
目前已经把这个变量从 .xprofile 中删除,退到 xfce4 环境中使用(gnome 经常出问题,xfce4放心很多)
附:
2015-03-28-true-multilib
Title True multilib support on amd64
Author Michał Górny <
mgo...@gentoo.org>
Posted 2015-03-28
Revision 1
Starting on 2015-03-29, we are enabling true multilib support on amd64
and masking the old emul-linux-x86 package sets for removal. This
change provides our users with the opportunity to build 32-bit libraries
from source with all the flexibility given by ebuilds and the security
of using mainline ebuilds, rather than relying on pre-packaged binary
versions of them.
The switch to the new system is likely to require a specific action from
the users of our multilib profiles. Since the new system collides with
the old one, the Package Manager must be able to clearly satisfy all
the dependencies using the new system in order to proceed. This may
require unmerging packages installed from third-party repositories that
have not been updated to support the new system.
In order to enable building necessary 32-bit libraries, users will be
required to enable the abi_x86_32 USE flag on respective packages.
This can be done using /etc/portage/package.use entries alike
the following:
sys-libs/zlib abi_x86_32
In most of the cases, Portage will be able to deliver correct
suggestions for that when using the --autounmask feature. However, some
users may prefer setting ABI_X86 globally to enable 32-bit libraries
in all packages that support building them. This can be done using
the following package.use entry:
*/* abi_x86_32
In case of issues, blockers especially, users are recommended
to manually uninstall any emul-linux-x86 packages that may have been
installed on their systems. This will aid the Package Manager
in choosing the correct dependency resolution path. If using Portage,
this can be done using the following command:
$ emerge -C 'app-emulation/emul-linux-x86*'
Note: 32-bit applications may be temporarily broken after this step.
Therefore, it should be followed by a @world upgrade immediately.