From: "Dmitry V. Levin" <ldv@altlinux.org>
To: ALT Devel discussion list <devel@lists.altlinux.org>
Subject: Re: [devel] I: illegal RPATH: out of standard library tree paths
Date: Mon, 12 Dec 2011 18:33:04 +0400
Message-ID: <20111212143304.GD24413@altlinux.org> (raw)
In-Reply-To: <20111212134733.GB24413@altlinux.org>
[-- Attachment #1: Type: text/plain, Size: 2639 bytes --]
Hi,
On Mon, Dec 12, 2011 at 05:47:33PM +0400, Dmitry V. Levin wrote:
> Анализ логов тестовой пересборки показывает, что в Sisyphus-x86_64 очень много
> пакетов с ошибочными и/или некорректными RPATH.
[...]
> - пути за пределы разумного (/lib, lib64, /usr/lib, /usr/lib64);
Пути за пределами стандартного размещения библиотек и плагинов - это плохо.
Вот как это выглядит на простом примере.
Обычная простая программа без RPATH:
$ echo 'int main(void){return 0;}' |gcc -xc - -O2 -Wall -o a.out && strace -eopen ./a.out
open("/etc/ld.so.cache", O_RDONLY) = 3
open("/lib64/libc.so.6", O_RDONLY) = 3
+++ exited with 0 +++
Та же самая программа, но с RPATH, содержащим запредельный путь:
$ echo 'int main(void){return 0;}' |gcc -xc - -O2 -Wall -o a.out -Wl,-rpath,/usr/local/lib64 && strace -eopen ./a.out
open("/usr/local/lib64/tls/x86_64/libc.so.6", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/local/lib64/tls/libc.so.6", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/local/lib64/x86_64/libc.so.6", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/local/lib64/libc.so.6", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY) = 3
open("/lib64/libc.so.6", O_RDONLY) = 3
+++ exited with 0 +++
Как видно, запредельный путь в RPATH приводит к тому, что ld.so во время
запуска программы ищет все слинкованные библиотеки относительно этого
пути. В лучшем случае это приводит к замедлению запуска, в худшем случае
ld.so там чего-нибудь найдет и запустит.
Как правило, запредельные пути в RPATH - это либо простые ошибки сборки,
либо ошибки переноса софта на GNU/Linux. Вот, например, самая
распространенная из таких ошибок в Sisyphus-x86_64:
$ lftp -c 'cat http://git.altlinux.org/beehive/logs/Sisyphus-x86_64/latest/success/AriaMaestosa-1.3b4-alt1' | grep RPATH
verify-elf: WARNING: ./usr/bin/Aria: RPATH entry found: /usr/local/lib64/
Вот список исходных пакетов с запредельными путями в RPATH на x86-64,
в формате ACL:
AriaMaestosa karpov @everybody
caudium boris @everybody
cca-spec-babel real sin @python @qa @everybody
erlang hsv greycat @qa
fglrx_glx oddity @everybody @qa
libfreetype shrek
mixxx kaman @everybody
nxclient mike @everybody
ocaml-zip @nobody
php5-ffmpeg rider naf
php5-interbase rider @everybody
pike7.6 boris viy @everybody
python-module-cmemcache swi
rarpd @nobody
salsa-complex real @qa @everybody
salsa-real real @qa @everybody
Я предлагаю считать запредельные пути в RPATH ошибками,
приводящими к ошибке сборки в режиме проверки rpath=normal.
--
ldv
[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]
next prev parent reply other threads:[~2011-12-12 14:33 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-12 13:47 [devel] I: illegal RPATH, introduction Dmitry V. Levin
2011-12-12 14:12 ` [devel] I: illegal RPATH: relative paths Dmitry V. Levin
2011-12-12 18:01 ` Igor Vlasenko
2011-12-13 3:40 ` REAL
2011-12-13 4:18 ` Damir Shayhutdinov
2011-12-13 5:52 ` REAL
2011-12-13 6:50 ` Damir Shayhutdinov
2011-12-13 7:56 ` REAL
2011-12-13 11:06 ` Dmitry V. Levin
2011-12-13 12:11 ` REAL
2011-12-13 17:24 ` Michael Shigorin
2011-12-13 11:30 ` Dmitry V. Levin
2011-12-13 12:33 ` REAL
2011-12-13 16:01 ` Dmitry V. Levin
2011-12-13 16:11 ` Денис Смирнов
2011-12-13 16:46 ` Damir Shayhutdinov
2011-12-14 6:44 ` Денис Смирнов
2011-12-14 8:53 ` Sergey Y. Afonin
2011-12-14 10:07 ` REAL
2011-12-14 11:09 ` Michael Shigorin
2011-12-14 12:11 ` REAL
2011-12-13 17:25 ` Michael Shigorin
2011-12-13 17:32 ` Dmitry V. Levin
2011-12-13 19:17 ` Michael Shigorin
2011-12-13 21:29 ` Dmitry V. Levin
2011-12-13 3:37 ` REAL
2011-12-21 10:55 ` Michael Shigorin
2011-12-31 15:43 ` Yuri N. Sedunov
2011-12-12 14:33 ` Dmitry V. Levin [this message]
2011-12-13 3:43 ` [devel] I: illegal RPATH: out of standard library tree paths REAL
2011-12-13 11:17 ` Dmitry V. Levin
2011-12-13 12:25 ` REAL
2011-12-12 14:57 ` [devel] I: illegal RPATH: paths to standard libraries Dmitry V. Levin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20111212143304.GD24413@altlinux.org \
--to=ldv@altlinux.org \
--cc=devel@lists.altlinux.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
ALT Linux Team development discussions
This inbox may be cloned and mirrored by anyone:
git clone --mirror http://lore.altlinux.org/devel/0 devel/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 devel devel/ http://lore.altlinux.org/devel \
devel@altlinux.org devel@altlinux.ru devel@lists.altlinux.org devel@lists.altlinux.ru devel@linux.iplabs.ru mandrake-russian@linuxteam.iplabs.ru sisyphus@linuxteam.iplabs.ru
public-inbox-index devel
Example config snippet for mirrors.
Newsgroup available over NNTP:
nntp://lore.altlinux.org/org.altlinux.lists.devel
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git