ALT Linux Team development discussions
 help / color / mirror / Atom feed
* [devel] --as-needed & gcc -
@ 2009-03-03  0:30 Led
  2009-03-03  0:49 ` Dmitry V. Levin
  0 siblings, 1 reply; 3+ messages in thread
From: Led @ 2009-03-03  0:30 UTC (permalink / raw)
  To: ALT Linux Team development discussions

Когда gcc отдаются исходники через stdin, умолчательный --as-needed напрочь 
игнорирует все библиотеки. Например:

$ echo 'int main(int argc, char **argv) { gzdopen(0, "rb"); return 0; }' |  
gcc -include zlib.h -x c -o /tmp/a.out -lz -
/tmp/.private/led/ccw45haA.o: In function `main':
:(.text+0x1a): undefined reference to `gzdopen'
collect2: ld returned 1 exit status

Это бага, или "неприятная фича"?

-- 
Led

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

* Re: [devel] --as-needed & gcc -
  2009-03-03  0:30 [devel] --as-needed & gcc - Led
@ 2009-03-03  0:49 ` Dmitry V. Levin
  2009-03-03  0:53   ` Led
  0 siblings, 1 reply; 3+ messages in thread
From: Dmitry V. Levin @ 2009-03-03  0:49 UTC (permalink / raw)
  To: ALT Linux Team development discussions

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

On Tue, Mar 03, 2009 at 02:30:56AM +0200, Led wrote:
> Когда gcc отдаются исходники через stdin, умолчательный --as-needed напрочь 
> игнорирует все библиотеки. Например:
> 
> $ echo 'int main(int argc, char **argv) { gzdopen(0, "rb"); return 0; }' |  
> gcc -include zlib.h -x c -o /tmp/a.out -lz -
> /tmp/.private/led/ccw45haA.o: In function `main':
> :(.text+0x1a): undefined reference to `gzdopen'
> collect2: ld returned 1 exit status
> 
> Это бага, или "неприятная фича"?

Это частный случай, надо указать имя файла (в данном случае "-") до имени
библиотеки (в данном случае "-lz").


-- 
ldv

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

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

* Re: [devel] --as-needed & gcc -
  2009-03-03  0:49 ` Dmitry V. Levin
@ 2009-03-03  0:53   ` Led
  0 siblings, 0 replies; 3+ messages in thread
From: Led @ 2009-03-03  0:53 UTC (permalink / raw)
  To: ALT Linux Team development discussions

On Tuesday, 03 March 2009 02:49:12 Dmitry V. Levin wrote:
> On Tue, Mar 03, 2009 at 02:30:56AM +0200, Led wrote:
> > Когда gcc отдаются исходники через stdin, умолчательный --as-needed
> > напрочь игнорирует все библиотеки. Например:
> >
> > $ echo 'int main(int argc, char **argv) { gzdopen(0, "rb"); return 0; }'
> > | gcc -include zlib.h -x c -o /tmp/a.out -lz -
> >
> > /tmp/.private/led/ccw45haA.o: In function `main':
> > :(.text+0x1a): undefined reference to `gzdopen'
> >
> > collect2: ld returned 1 exit status
> >
> > Это бага, или "неприятная фича"?
>
> Это частный случай, надо указать имя файла (в данном случае "-") до имени
> библиотеки (в данном случае "-lz").

"Посыпаю голову пеплом"... Чё-то не подумал, что так можно:)
Спасибо.

-- 
Led

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

end of thread, other threads:[~2009-03-03  0:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-03-03  0:30 [devel] --as-needed & gcc - Led
2009-03-03  0:49 ` Dmitry V. Levin
2009-03-03  0:53   ` Led

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