ALT Linux Team development discussions
 help / color / mirror / Atom feed
From: Sergey Vlasov <vsu@altlinux.ru>
To: ALT Devel discussion list <devel@lists.altlinux.org>
Subject: Re: [devel] --as-needed
Date: Mon, 6 Mar 2006 18:37:33 +0300
Message-ID: <20060306153733.GD2873@master.mivlgu.local> (raw)
In-Reply-To: <20060306132203.GB11690@basalt.office.altlinux.org>

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

On Mon, Mar 06, 2006 at 04:22:03PM +0300, Dmitry V. Levin wrote:
> On Mon, Mar 06, 2006 at 03:08:44PM +0300, Dmitry V. Levin wrote:
> > On Mon, Mar 06, 2006 at 10:36:26AM +0500, Andrey Rahmatullin wrote:
> > > On Mon, Mar 06, 2006 at 06:09:40AM +0300, QA Team Robot wrote:
> > > > - Pass --as-needed option to GNU ld by default.
> > > И никто не сломался? ;)
> > 
> > Это мы сейчас изучаем...
> 
> Много чего может сломаться.  Вот несколько искусственный пример, полученный
> путём усушки реального случая:
> 
> $ cat zv.c
> #include <zlib.h>
> int main(void) { return !zlibVersion(); }
> $ gcc -c zv.c
> $ ld --as-needed --eh-frame-hdr -m elf_i386 -dynamic-linker /lib/ld-linux.so.2 -o zv /usr/lib/crt1.o /usr/lib/crti.o /usr/lib/gcc/i586-alt-linux/3.4.4/crtbegin.o -L/usr/lib/gcc/i586-alt-linux/3.4.4 -L/usr/lib zv.o -lz -lc /usr/lib/gcc/i586-alt-linux/3.4.4/crtend.o /usr/lib/crtn.o
> $ ld --as-needed --eh-frame-hdr -m elf_i386 -dynamic-linker /lib/ld-linux.so.2 -o zv /usr/lib/crt1.o /usr/lib/crti.o /usr/lib/gcc/i586-alt-linux/3.4.4/crtbegin.o -L/usr/lib/gcc/i586-alt-linux/3.4.4 -L/usr/lib -lz zv.o -lc /usr/lib/gcc/i586-alt-linux/3.4.4/crtend.o /usr/lib/crtn.o
> zv.o: In function `main':zv.c:(.text+0x23): undefined reference to `zlibVersion'
> 
> Первый ld отличается от второго порядком файлов:
> в первом "zv.o -lz", во втором "-lz zv.o".
> 
> Такое поведение ld не является ошибкой, в режиме --as-needed порядок может
> повлиять на значение: если библиотека (здесь -lz) следует до первого
> пользователя (здесь zv.o), то в режиме --as-needed оно будет убрано как
> ненужное.

Собственно, со статическими библиотеками так всегда и было (только ещё
хуже - могла вытащиться часть, которой потом не хватало для остального).

> Я пока не знаю, как быть.

Сколько пакетов от этого перестало собираться?

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

  reply	other threads:[~2006-03-06 15:37 UTC|newest]

Thread overview: 83+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-06  5:36 ` [devel] --as-needed (was: [Sisyphus-cybertalk] I: Sisyphus-20060306 packages: +4 (5363)) Andrey Rahmatullin
2006-03-06 12:08   ` Dmitry V. Levin
2006-03-06 13:22     ` [devel] --as-needed Dmitry V. Levin
2006-03-06 15:37       ` Sergey Vlasov [this message]
2006-03-06 15:56         ` Dmitry V. Levin
2006-03-06 22:24         ` Dmitry V. Levin
2006-03-06 22:27           ` Dmitry V. Levin
2006-03-07  5:06             ` Andrey Rahmatullin
2006-03-06 22:36           ` Денис Смирнов
2006-03-06 22:46             ` Dmitry V. Levin
2006-03-07  7:19           ` Michael Shigorin
2006-03-07  9:54         ` Dmitry V. Levin
2006-03-07 10:47           ` Mikhail Zabaluev
2006-03-07 10:51             ` Led
2006-03-07 13:11             ` Dmitry V. Levin
2006-03-18 19:06               ` Dmitry V. Levin
2006-03-18 23:21                 ` Dmitry V. Levin
2006-03-27 22:50                   ` Dmitry V. Levin
2006-05-21 23:26                     ` Vitaly Lipatov
2006-05-21 23:37                       ` Dmitry V. Levin
2006-05-22 22:20                         ` Vitaly Lipatov
2006-05-22 22:36                           ` Dmitry V. Levin
2006-05-23 20:02                             ` Vitaly Lipatov
2006-05-23 20:05                               ` Dmitry V. Levin
2006-05-24 20:18                                 ` Vitaly Lipatov
2006-05-24 20:29                                   ` Dmitry V. Levin
2006-05-24 20:34                                     ` Nick S. Grechukh
2006-05-24 20:58                                       ` Dmitry V. Levin
2006-05-24 21:53                                         ` Vitaly Lipatov
2006-05-24 22:01                                           ` Dmitry V. Levin
2006-05-25  9:41                                             ` Igor Zubkov
2006-05-23 20:07                               ` Pavlov Konstantin
2006-03-19  7:17                 ` [devel] [wiki] --as-needed Genix
2006-03-20  8:05                   ` [devel] [wiki!] --as-needed Michael Shigorin
2006-03-19 18:43                 ` [devel] --as-needed Alexey I. Froloff
2006-03-19 21:59                   ` Dmitry V. Levin
2006-03-19 22:06                     ` Alexey I. Froloff
2006-03-07  5:10       ` Andrey Rahmatullin
2006-03-07  7:18         ` [devel] automake и --as-needed Michael Shigorin
2006-03-07  9:24           ` Dmitry V. Levin
2006-03-07  9:34             ` Michael Shigorin
2006-03-07  9:44               ` Dmitry V. Levin
2006-03-07 10:37                 ` [devel] automake и --as-needed (как воспроизвести, пока не добралось?) Michael Shigorin
2006-03-07 11:13                   ` Alexey I. Froloff
2006-03-07 11:48                     ` [devel] automake и --as-needed (LDFLAGS="$LDFLAGS -Wl,--as-needed") Michael Shigorin
2006-03-07 13:13                       ` Dmitry V. Levin
2006-03-07 14:49                         ` [devel] automake и --as-needed (Makefile.am) Michael Shigorin
2006-03-09 11:52               ` [devel] automake и --as-needed Slava Dubrovskiy
2006-03-09 11:58                 ` Michael Shigorin
2006-03-09 12:07                   ` Slava Dubrovskiy
2006-03-09 13:08                     ` Michael Shigorin
2006-03-09 15:53                 ` Dmitry V. Levin
2006-03-07 10:11           ` Sergey V Turchin
2006-03-07 10:34             ` [devel] klogoturtle obsolete (was: automake и --as-needed) Michael Shigorin
2006-03-07  7:25         ` [devel] --as-needed Alexey I. Froloff
2006-03-07  7:34           ` Andrey Rahmatullin
2006-03-07  9:30         ` Dmitry V. Levin
2006-03-06 18:05     ` Andrey Rahmatullin
2006-03-06 18:25       ` Dmitry V. Levin
2006-03-20  9:38         ` Alexey I. Froloff
2006-03-20 12:57           ` Dmitry V. Levin
2006-03-20 13:08             ` Alexey I. Froloff
2006-06-26 14:50         ` [devel] --as-needed: libtinfo, libncurses Dmitry V. Levin
2006-06-26 15:02           ` Alexey Tourbin
2006-06-27  6:17           ` Stanislav Ievlev
2006-06-27 11:50             ` Dmitry V. Levin
2006-06-27 14:13               ` Stanislav Ievlev
2006-03-07  8:04     ` [devel] --as-needed (was: [Sisyphus-cybertalk] I: Sisyphus-20060306 packages: +4 (5363)) Mikhail Zabaluev
2006-03-08  8:04     ` Valery V. Inozemtsev
2006-03-08 14:48       ` Dmitry V. Levin
2006-03-08 15:44         ` Valery V. Inozemtsev
2006-03-14  8:57     ` Sergey Y. Afonin
2006-03-14 10:12       ` Mikhail Zabaluev
2006-03-14 10:31       ` [devel] --as-needed Dmitry V. Levin
2006-03-06 16:04   ` [devel] --as-needed (was: [Sisyphus-cybertalk] I: Sisyphus-20060306 packages: +4 (5363)) Stanislav Ievlev
2006-03-11 22:41 ` [devel] [Sisyphus-cybertalk] I: Sisyphus-20060306 packages: +4 (5363) Alexey I. Froloff
2006-03-11 22:56   ` Dmitry V. Levin
2006-03-12 10:25     ` Alexey I. Froloff
2006-03-12 17:30       ` Alexey I. Froloff
2006-03-12 18:16         ` Dmitry V. Levin
2006-03-12 18:26           ` Anton Gorlov
2006-03-12 18:31           ` Alexey I. Froloff
2006-03-12 16:26   ` Semushin Slava

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=20060306153733.GD2873@master.mivlgu.local \
    --to=vsu@altlinux.ru \
    --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