ALT Linux Team development discussions
 help / color / mirror / Atom feed
From: "Dmitry V. Levin" <ldv@altlinux.org>
To: ALT Devel discussion list <devel@lists.altlinux.org>
Subject: Re: [devel] I: illegal RPATH: paths to standard libraries
Date: Mon, 12 Dec 2011 18:57:10 +0400
Message-ID: <20111212145709.GE24413@altlinux.org> (raw)
In-Reply-To: <20111212134733.GB24413@altlinux.org>

[-- Attachment #1: Type: text/plain, Size: 8427 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 - это плохо.
Вот как это выглядит на простом примере.

Обычная простая программа без 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, содержащим /usr/lib64:
$ echo 'int main(void){return 0;}' |gcc -xc - -O2 -Wall -o a.out -Wl,-rpath,/usr/lib64 && strace -eopen ./a.out
open("/usr/lib64/tls/x86_64/libc.so.6", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/lib64/tls/libc.so.6", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/lib64/x86_64/libc.so.6", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/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_LIBRARY_PATH именно
тогда, когда он понадобится.

Пути к стандартным библиотекам в RPATH встречаются, преимущественно, на
x86_64, а самый распространенный из четырех стандартных путей -
это /usr/lib64.  Наиболее частая причина появления /usr/lib64 в RPATH -
это ошибка сборки вследствие кривизны той версии libtool, которую
использовал апстрим.  Традиционные методы борьбы с кривым libtool такие:
- %autoreconf (перегенерация всей камарильи включая libtool, возможны
  нежелательные побочные эффекты);
- sed -ri 's/^(hardcode_libdir_flag_spec|runpath_var)=.*/\1=/' libtool
  (исправление сгенеренного libtool, годится в случае если проект не
  использует RPATH по существу);
- утилита chrpath(1) из одноименного пакета.

Вот список исходных пакетов с путями к стандартным библиотекам в RPATH
на x86-64, в формате ACL:

ORBit	@nobody
Wcalc	gab @everybody
Xdmf	real @everybody
a2ps	george @everybody
adolc	real @qa @everybody
aiksaurus	lav @qa
aqbanking	cas
arpack	real @qa @everybody
aspell	damir
audiofile	real @everybody
aview	kurakin @everybody
babel	real sin @python @qa @everybody
bb	mike @qa
bind	ldv
bogofilter	oddity
bs2b	drool
btanks	oddity dans
c-ares	force @everybody
cegui	vitty
cfengine	stanv @everybody
cherokee	force @everybody
chicken	voins oddity
cilk	real @qa @everybody
clamav	asy force
cvtool	force @everybody
cyrus-sasl2	vvk @everybody
dakota	real @everybody
dar	lav @qa @everybody
devil	redbaron @qa
dialog	inger @qa @everybody
dirac	oddity @everybody
ecore	aris
edbus	aris
eet	aris blake
efreet	aris
ejudge	dk
elementary	vitty @everybody
elmerfem	real @everybody
embryo	aris blake
emotion	aris
enca	mike force lav @qa
erlang	hsv greycat @qa
ethumb	aris
evas	aris
exiv2	force @everybody
ffmpegthumbnailer	shrek @everybody
fidogate	@nobody
findlib	bga avm @qa @everybody
flac7	@nobody
fluidsynth	aris
fontforge	pv real
freehdl	mithraen
freetds	real @everybody
gcc3.4	ldv
gdal	dim boyarsh @qa @everybody
geda-gaf	lav @everybody
gerbv	lav @qa @everybody
gigabase	boris @everybody
glade3	@gnome @everybody
gnash	sbolshakov
gnome-libs	@nobody
gnome-panel	@gnome
gnumeric	swi
google-gadgets	zerg
gphoto2	jinn
gsasl	zerg alexsid @qa
gsql	boris @gnome @everybody
gtkhtml4	aris @gnome
hermesxd	real @everybody
ibutils	stanv inger real @qa
id3lib	real @everybody
iksemel	mithraen
inn	vvk @everybody
juffed	cas
kdeaccessibility	zerg @qa @everybody
kdeaddons	zerg @qa @everybody
kdeadmin	zerg @qa @everybody
kdeartwork	zerg @everybody
kdebase	zerg @everybody
kdebindings	zerg @qa @everybody
kdegraphics	zerg @everybody
kdelibs	zerg @everybody
kdemultimedia	zerg @everybody
kdenetwork	zerg @qa @everybody
kdepim	zerg @everybody
kdesdk	zerg @everybody
kdetoys	zerg @everybody
kdeutils	zerg @everybody
kdewebdev	zerg @qa @everybody
kdirstat	oddity
kesi	zerg @everybody
kflickr	oddity @qa
kmobiletools	oddity @qa zerg @everybody
kmymoney2	cas
kraft	cas
kssh	zerg @everybody
ktoblzcheck	cas
kturing	george @everybody
labplot1.6	lav @qa
lesstif	sin @qa @everybody snejok
lib2geom	lav @qa
libchipcard	cas
libchm	force @everybody
libcommoncpp2	sbolshakov lav
libdmtx	george @everybody
libdv	ldv @everybody
libdynamite	mike @mobile @qa
libextractor	lav force @qa
libfolks	aris
libfreetype	shrek
libgc	lav @qa
libgeotiff	dd @everybody
libggi	george @everybody
libgii	george @qa
libglibmm	aris lav @gnome
libgnomekbd	@gnome
libgssdp	aris
libgtkdatabox	force @everybody
libgtkmm3	aris @gnome
libgxps	aris
libhid	prividen
libicns	azol @everybody
libiec61883	lav @qa
libinfinity	aris @gnome
liblo	@nobody
libmathgl	lav @qa
libmesh-complex	real @qa @everybody
libmesh-real	real @qa @everybody
libming	crux @everybody
libnetfilter_log	liks @everybody
libnetfilter_queue	liks @everybody
libnova	zerg
libofx	migor cas @qa
liboggz	@nobody
liboping	mike @qa @everybody
liborange	mike @mobile @qa
libossp-uuid	misha @everybody
libotr	zerg
libpeas	aris @gnome
libproj	slazav @everybody
libpuzzle	force @everybody
libqof	lav @qa
librarian	lav @gnome @qa
librasqal	lav @qa
libraw1394	lav @qa
libsamplerate	aris
libsndfile	shrek
libspf2	force @everybody
libstatgrab	zhum @everybody
libtelepathy-farstream	aris
libtlalli	force @everybody
libtranslate	lav @qa real
libunshield	mike genix shaba @mobile @qa
libvncserver	zerg @everybody
libwnck	@gnome
libwpd	shrek
libwpd9	shrek
libwpg	lav @qa
libwpg2	shrek
libwps	shrek
libxbsql	lav @everybody
libxerces-c	lav @qa
libxine	zerg @everybody
libxspf	lav @qa
link-grammar	aris
lksctp-tools	mithraen @everybody
lxc	dans
mcpp	sin @qa
minidjvu	vkni @everybody
mjpegtools	@nobody
mpg123	swi
mplayer	ender real sbolshakov @qa
msynctool0	@mobile
multisync-gui	shaba @mobile @qa @everybody
musescore	lav @qa
mxml	real @everybody
mysql-proxy	force @everybody
net-snmp26	dubrsl @everybody
net-snmp30	dubrsl @everybody
ntfsprogs	@nobody
ntrack	zerg @everybody
obexftp	week
ocaml	bga avm @qa @everybody
ocaml-cryptokit	boris @everybody
openbabel	mike zerg @qa
opendbx	boyarsh
openjade	aris @everybody
owfs	zver @python
p4est	real @everybody
papi	real @qa @everybody
pastix	real @qa @everybody
perl-Text-BibTeX	kirill @cpan @everybody
pgpool-II	open @everybody
pgtcl	mithraen
php5	rider
php5-ctpp	mithraen @everybody
php5-magickwand	rider naf
php5-pgsql	rider @everybody
pike7.8	boris @everybody
plan9	peet @everybody
plotutils	lav @qa
pstoedit	oddity rider
python-module-pysvn	gik @python
qhull	manowar real
qrencode	force @everybody
qutim	nenderus @everybody
quvi	aris @gnome
racket	real @everybody
raptor	real @everybody
rarpd	@nobody
rasqal	zerg @everybody
rawstudio	force @everybody
recode	mike @qa @everybody
reiser4progs	seriv @everybody
runawfe	kana @everybody
salsa-complex	real @qa @everybody
salsa-real	real @qa @everybody
sane-frontends	lav @qa
serveez	@nobody
silo	real sin @python @qa @everybody
sim	drool @qa
sks	boris @everybody
slang2	gns @qa
slurm	real @qa @everybody
smalltalk	ildar
smpeg	real @everybody
speex	mithraen
sundials	real @qa @everybody
sword	lav azol @qa @everybody
t1lib	mike @qa @everybody
tastymenu	drool
tau	real sin @python @qa @everybody
tcl-plugin	sbolshakov
telepathy-logger	aris
telepathy-mission-control	aris
toxine	@nobody
tre	mike @qa avm
vips	mike rom_as @qa force @everybody
wildmidi	george @everybody
wimax-network-service	@nobody
wxsvg	dubrsl @qa
xar	@nobody
xdrfile	real @qa @everybody
xfdiff	@nobody
xforms	viy @everybody
xfprint	@xfce oddity
xine-ui	boyarsh @everybody
xmedcon	anyr @everybody
xmms	mike eugvv bp gns @qa real
xmorph	george @qa
xsane	lav @qa
zeromq	crux @everybody
zziplib	force @everybody

Я предлагаю считать наличие путей к стандартным библиотекам в RPATH
ошибками, приводящими к ошибке сборки в режиме проверки rpath=normal.


-- 
ldv

[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]

      parent reply	other threads:[~2011-12-12 14:57 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 ` [devel] I: illegal RPATH: out of standard library tree paths Dmitry V. Levin
2011-12-13  3:43   ` REAL
2011-12-13 11:17     ` Dmitry V. Levin
2011-12-13 12:25       ` REAL
2011-12-12 14:57 ` Dmitry V. Levin [this message]

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=20111212145709.GE24413@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