ALT Linux Team development discussions
 help / color / mirror / Atom feed
* [devel] Q: gcc/ld madness
@ 2007-09-22 10:07 Konstantin A. Lepikhov
  2007-09-22 10:14 ` Andrey Rahmatullin
  2007-09-22 10:29 ` Alexey I. Froloff
  0 siblings, 2 replies; 7+ messages in thread
From: Konstantin A. Lepikhov @ 2007-09-22 10:07 UTC (permalink / raw)
  To: ALT Linux Devel Mailing List

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

Hi!

Кто может мне объяснить чем вызвано такое поведение нашего gcc?

echo 'int main(int argc, char **argv) { gzdopen(0, "rb"); return 0; }' | \
gcc -Wall -include zlib.h -x c -o a.out -lz -

/tmp/.private/lakostis/cc5O0Xwo.o: In function `main':
:(.text+0x1c): undefined reference to `gzdopen'
...

PS Если уши растут из as-needed, просьба дать детальное и
документированное объяснение почему эта ass ломает такие простые примеры.

-- 
WBR et al.

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [devel] Q: gcc/ld madness
  2007-09-22 10:07 [devel] Q: gcc/ld madness Konstantin A. Lepikhov
@ 2007-09-22 10:14 ` Andrey Rahmatullin
  2007-09-22 10:31   ` Konstantin A. Lepikhov
  2007-09-22 10:29 ` Alexey I. Froloff
  1 sibling, 1 reply; 7+ messages in thread
From: Andrey Rahmatullin @ 2007-09-22 10:14 UTC (permalink / raw)
  To: devel

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

On Sat, Sep 22, 2007 at 02:07:16PM +0400, Konstantin A. Lepikhov wrote:
> gcc -Wall -include zlib.h -x c -o a.out -lz -

> PS Если уши растут из as-needed, просьба дать детальное и
> документированное объяснение почему эта ass ломает такие простые примеры.
Потому что -lz указано до исходника.

-- 
WBR, wRAR (ALT Linux Team)
Powered by the ALT Linux fortune(8):

Штатные телепаты сами-знаете-где.
		-- ldv in sisyphus@

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [devel] Q: gcc/ld madness
  2007-09-22 10:07 [devel] Q: gcc/ld madness Konstantin A. Lepikhov
  2007-09-22 10:14 ` Andrey Rahmatullin
@ 2007-09-22 10:29 ` Alexey I. Froloff
  2007-09-22 11:21   ` Konstantin A. Lepikhov
  1 sibling, 1 reply; 7+ messages in thread
From: Alexey I. Froloff @ 2007-09-22 10:29 UTC (permalink / raw)
  To: ALT Devel discussion list

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

* Konstantin A. Lepikhov <lakostis@> [070922 14:13]:
> echo 'int main(int argc, char **argv) { gzdopen(0, "rb"); return 0; }' | \
> gcc -Wall -include zlib.h -x c -o a.out -lz -
gcc -Wall -include zlib.h -x c -o a.out - -lz

> PS Если уши растут из as-needed, просьба дать детальное и
> документированное объяснение почему эта ass ломает такие простые примеры.

info ld:

`--as-needed'
`--no-as-needed'
     This option affects ELF DT_NEEDED tags for dynamic libraries
     mentioned on the command line after the `--as-needed' option.
     Normally, the linker will add a DT_NEEDED tag for each dynamic
     library mentioned on the command line, regardless of whether the
     library is actually needed.  `--as-needed' causes DT_NEEDED tags
     to only be emitted for libraries that satisfy some symbol
     reference from regular objects which is undefined at the point
     that the library was linked.  `--no-as-needed' restores the
     default behaviour.

Собсно, в первом случае в момент линковки libz нет ссылок на
символы оттуда, во втором они появляются.  Это уже неоднократно
здесь обсуждалось.

-- 
Regards,
Sir Raorn.

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [devel] Q: gcc/ld madness
  2007-09-22 10:14 ` Andrey Rahmatullin
@ 2007-09-22 10:31   ` Konstantin A. Lepikhov
  0 siblings, 0 replies; 7+ messages in thread
From: Konstantin A. Lepikhov @ 2007-09-22 10:31 UTC (permalink / raw)
  To: ALT Linux Team development discussions

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

Hi Andrey!

Saturday 22, at 04:14:12 PM you wrote:

> On Sat, Sep 22, 2007 at 02:07:16PM +0400, Konstantin A. Lepikhov wrote:
> > gcc -Wall -include zlib.h -x c -o a.out -lz -
> 
> > PS Если уши растут из as-needed, просьба дать детальное и
> > документированное объяснение почему эта ass ломает такие простые примеры.
> Потому что -lz указано до исходника.
вот уродство :(

-- 
WBR et al.

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [devel] Q: gcc/ld madness
  2007-09-22 10:29 ` Alexey I. Froloff
@ 2007-09-22 11:21   ` Konstantin A. Lepikhov
  2007-09-22 11:43     ` Alexey I. Froloff
  2007-09-22 11:59     ` Dmitry V. Levin
  0 siblings, 2 replies; 7+ messages in thread
From: Konstantin A. Lepikhov @ 2007-09-22 11:21 UTC (permalink / raw)
  To: ALT Linux Team development discussions

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

Hi Alexey!

Saturday 22, at 02:29:48 PM you wrote:

> * Konstantin A. Lepikhov <lakostis@> [070922 14:13]:
> > echo 'int main(int argc, char **argv) { gzdopen(0, "rb"); return 0; }' | \
> > gcc -Wall -include zlib.h -x c -o a.out -lz -
> gcc -Wall -include zlib.h -x c -o a.out - -lz
> 
> > PS Если уши растут из as-needed, просьба дать детальное и
> > документированное объяснение почему эта ass ломает такие простые примеры.
> 
> info ld:
> 
> `--as-needed'
> `--no-as-needed'
>      This option affects ELF DT_NEEDED tags for dynamic libraries
>      mentioned on the command line after the `--as-needed' option.
>      Normally, the linker will add a DT_NEEDED tag for each dynamic
>      library mentioned on the command line, regardless of whether the
>      library is actually needed.  `--as-needed' causes DT_NEEDED tags
>      to only be emitted for libraries that satisfy some symbol
>      reference from regular objects which is undefined at the point
>      that the library was linked.  `--no-as-needed' restores the
>      default behaviour.
> 
> Собсно, в первом случае в момент линковки libz нет ссылок на
> символы оттуда, во втором они появляются.  Это уже неоднократно
> здесь обсуждалось.
придется вешать багу на сборочные скрипты из openwrt :(

-- 
WBR et al.

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [devel] Q: gcc/ld madness
  2007-09-22 11:21   ` Konstantin A. Lepikhov
@ 2007-09-22 11:43     ` Alexey I. Froloff
  2007-09-22 11:59     ` Dmitry V. Levin
  1 sibling, 0 replies; 7+ messages in thread
From: Alexey I. Froloff @ 2007-09-22 11:43 UTC (permalink / raw)
  To: ALT Devel discussion list

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

* Konstantin A. Lepikhov <lakostis@> [070922 15:23]:
> придется вешать багу на сборочные скрипты из openwrt :(
Мои соболезнования.  Когда ты вернёшься оттуда, куда тебя пошлют
openwrt'шники, добавь -Wl,--no-as-needed в LDFLAGS ;-)

-- 
Regards,
Sir Raorn.

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [devel] Q: gcc/ld madness
  2007-09-22 11:21   ` Konstantin A. Lepikhov
  2007-09-22 11:43     ` Alexey I. Froloff
@ 2007-09-22 11:59     ` Dmitry V. Levin
  1 sibling, 0 replies; 7+ messages in thread
From: Dmitry V. Levin @ 2007-09-22 11:59 UTC (permalink / raw)
  To: ALT Linux Team development discussions

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

On Sat, Sep 22, 2007 at 03:21:56PM +0400, Konstantin A. Lepikhov wrote:
> Saturday 22, at 02:29:48 PM you wrote:
> > * Konstantin A. Lepikhov <lakostis@> [070922 14:13]:
> > > echo 'int main(int argc, char **argv) { gzdopen(0, "rb"); return 0; }' | \
> > > gcc -Wall -include zlib.h -x c -o a.out -lz -
> > gcc -Wall -include zlib.h -x c -o a.out - -lz
> > 
> > > PS Если уши растут из as-needed, просьба дать детальное и
> > > документированное объяснение почему эта ass ломает такие простые примеры.
> > 
> > info ld:
> > 
> > `--as-needed'
> > `--no-as-needed'
> >      This option affects ELF DT_NEEDED tags for dynamic libraries
> >      mentioned on the command line after the `--as-needed' option.
> >      Normally, the linker will add a DT_NEEDED tag for each dynamic
> >      library mentioned on the command line, regardless of whether the
> >      library is actually needed.  `--as-needed' causes DT_NEEDED tags
> >      to only be emitted for libraries that satisfy some symbol
> >      reference from regular objects which is undefined at the point
> >      that the library was linked.  `--no-as-needed' restores the
> >      default behaviour.
> > 
> > Собсно, в первом случае в момент линковки libz нет ссылок на
> > символы оттуда, во втором они появляются.  Это уже неоднократно
> > здесь обсуждалось.
> придется вешать багу на сборочные скрипты из openwrt :(

Скажи им что у тебя libz.a ;)


-- 
ldv

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2007-09-22 11:59 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-09-22 10:07 [devel] Q: gcc/ld madness Konstantin A. Lepikhov
2007-09-22 10:14 ` Andrey Rahmatullin
2007-09-22 10:31   ` Konstantin A. Lepikhov
2007-09-22 10:29 ` Alexey I. Froloff
2007-09-22 11:21   ` Konstantin A. Lepikhov
2007-09-22 11:43     ` Alexey I. Froloff
2007-09-22 11:59     ` Dmitry V. Levin

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