ALT Linux Team development discussions
 help / color / mirror / Atom feed
From: "Dmitry V. Levin" <ldv@altlinux.org>
To: ALT Linux Team development discussions <devel@lists.altlinux.org>
Subject: Re: [devel] symbols into dependencies
Date: Mon, 16 Nov 2009 03:05:46 +0300
Message-ID: <20091116000546.GA32432@wo.int.altlinux.org> (raw)
In-Reply-To: <20091115211443.GR10659@altlinux.org>

[-- Attachment #1: Type: text/plain, Size: 1892 bytes --]

On Mon, Nov 16, 2009 at 12:14:43AM +0300, Alexey Tourbin wrote:
[...]
> Есть идея формировать зависимости на сонеймы с учетом символов.
> Это может выглядеть так:
> 
> 	%package -n libfoo
> 	Provides(auto): libfoo.so.1 = set:0123abcd...(очень длинная строка)
> 
> 	%package -n foo
> 	Requires(auto): libfoo.so.1 >= set:abcd0123...(умеренно длинная строка)
> 
> То есть реализовать зависимости специального вида, которые представляют
> собой "множество строк" (символов).  Вместо обычного сравнения версий
> для таких зависимостей будет выполняться проверка, что requires set
> является подмножеством provides set.

Please do not over-optimize here.
For example, have a look at /bin/ls ELF executable:

$ readelf -d /bin/ls |awk '/NEEDED/{print $5}'
[librt.so.1]
[libcap.so.2]
[libtinfo.so.5]
[libacl.so.1]
[libc.so.6]
$ readelf -s /bin/ls |grep tgetent
    36: 0000000000000000     0 FUNC    GLOBAL DEFAULT  UND tgetent

Where does the "tgetent" symbol come from?  Dynamic linker will be
sufficed if at least one of abovementioned libraries will provide it.

Here is a more artificial example written to demonstrate ld.so behaviour:
$ echo 'int a(){return 1;}' >liba.c &&
gcc -fpic -shared liba.c -o liba.so &&
echo 'int b(){return 2;}' >libb.c &&
gcc -fpic -shared libb.c -o libb.so &&
echo 'int main(){return a()+b();}' >exe.c &&
gcc exe.c -L. -la -lb -o exe &&
LD_LIBRARY_PATH=. ./exe; echo $?;
echo 'int b(){return 10;}' >liba.c &&
gcc -fpic -shared liba.c -o liba.so &&
echo 'int a(){return 20;}' >libb.c &&
gcc -fpic -shared libb.c -o libb.so &&
LD_LIBRARY_PATH=. ./exe; echo $?
3
30

That is, a needed ELF symbol may jump from one library to another.
And it had happened once with the "tgetent" symbol.

P.S. This issue is not an ALT Linux specific, so if we succeed to
work out a solution, it could be used by others.


-- 
ldv

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

  parent reply	other threads:[~2009-11-16  0:05 UTC|newest]

Thread overview: 69+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-13  8:36 [devel] SharedLibsPolicy или хорошо что мы не Debian Valery V. Inozemtsev
2009-11-13 10:42 ` Anton Farygin
2009-11-13 11:14   ` Damir Shayhutdinov
2009-11-13 11:17     ` Anton Farygin
2009-11-13 11:26       ` Led
2009-11-13 11:27       ` Damir Shayhutdinov
2009-11-13 11:33         ` Valery V. Inozemtsev
2009-11-13 11:37           ` Damir Shayhutdinov
2009-11-13 11:44             ` Anton Farygin
2009-11-13 11:46             ` Valery V. Inozemtsev
2009-11-13 12:18               ` Damir Shayhutdinov
2009-11-13 11:56   ` Денис Смирнов
2009-11-18 19:17     ` Yury Aliaev
2009-11-19  2:40       ` Денис Смирнов
2009-11-19  7:20         ` Yury Aliaev
2009-11-13 16:07   ` Igor Vlasenko
2009-11-13 16:40     ` Anton Farygin
2009-11-13 17:12       ` Igor Vlasenko
2009-11-13 17:19         ` Anton Farygin
2009-11-18 19:19     ` Yury Aliaev
2009-11-13 12:22 ` Sergey V Turchin
2009-11-13 21:25 ` [devel] SharedLibsPolicy Michael Shigorin
2009-11-13 21:39   ` Led
2009-11-13 22:55     ` Michael Shigorin
2009-11-13 23:17       ` Led
2009-11-14  9:53         ` Michael Shigorin
2009-11-14 20:25     ` Денис Смирнов
2009-11-14 20:45       ` Led
2009-11-14 22:20         ` Денис Смирнов
2009-11-14 22:30           ` Led
2009-11-14 22:55             ` Денис Смирнов
2009-11-14 23:19               ` Led
2009-11-15  0:46                 ` Денис Смирнов
2009-11-15  1:36                   ` Led
2009-11-15  7:06                     ` Денис Смирнов
2009-11-15 20:00                       ` Led
2009-11-15 20:27                         ` Michael Shigorin
2009-11-15 21:01                           ` Led
2009-11-15 21:27                             ` Michael Shigorin
2009-11-15 22:20                               ` Anton Farygin
2009-11-15 21:14                         ` [devel] symbols into dependencies Alexey Tourbin
2009-11-15 22:47                           ` Led
2009-11-15 23:11                             ` Alexey Tourbin
2009-11-15 23:43                               ` Led
2009-11-16  0:16                                 ` Alexey Tourbin
2009-11-16  0:27                                   ` Dmitry V. Levin
2009-11-17  1:10                                     ` Alexey Tourbin
2009-11-16  0:05                           ` Dmitry V. Levin [this message]
2009-11-16  0:44                             ` Alexey Tourbin
2009-11-16  9:46                               ` Sergey Vlasov
2009-11-16 10:48                                 ` Dmitry V. Levin
2009-11-16 11:36                                   ` Alexey Tourbin
2009-11-16 12:01                                     ` Damir Shayhutdinov
2009-11-16 12:17                                       ` Alexey Tourbin
2009-11-16 12:50                                       ` Sergey Vlasov
2009-11-16 13:09                                         ` Alexey Tourbin
2009-11-16  8:16                           ` Stanislav Ievlev
2009-11-15 22:01                         ` [devel] SharedLibsPolicy Sergey Vlasov
2009-11-15 22:54                           ` Led
2009-11-15 12:08               ` Igor Vlasenko
2009-11-15 13:30                 ` Michael Shigorin
2009-11-15 19:11                     ` Michael Shigorin
2009-11-15 19:36                   ` Денис Смирнов
2009-11-15 20:29                     ` Michael Shigorin
2009-11-15 19:36                   ` Konstantin Pavlov
2009-11-15 19:39                 ` Денис Смирнов
2009-11-14 20:31 ` [devel] SharedLibsPolicy или хорошо что мы не Debian Денис Смирнов
2009-11-14 23:14   ` Anton Farygin
2009-11-15 12:24     ` Michael Shigorin

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=20091116000546.GA32432@wo.int.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