ALT Linux Community general discussions
 help / color / mirror / Atom feed
* Re: [Comm] Сборка mongoose web server и cc -ldl
  2010-12-01  7:51 [Comm] Сборка mongoose web server и cc -ldl Vladimir Zhirov
@ 2010-12-01  7:50 ` Damir
  0 siblings, 0 replies; 2+ messages in thread
From: Damir @ 2010-12-01  7:50 UTC (permalink / raw)
  To: ALT Linux Community general discussions

> В связи с чем вопрос: есть ли отличия в gcc из p5, по сравнению
> с другими бранчами/дистрибутивами (от ALT и не от ALT),
> которые могли бы вызвать такое поведение?

Есть, в данном случае это опция -Wl,--as-needed, которая у нас
включена по умолчанию.

Библиотеки всегда должны быть перечислены после файлов .o (или .c),
иначе ломается статическая сборка во всех дистрибутивах, и
динамическая в Альте и во многих остальных, типа Gentoo, где тоже
используется --as-needed.

http://www.altlinux.org/UpStream/AsNeeded

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

* [Comm] Сборка mongoose web server и  cc -ldl
@ 2010-12-01  7:51 Vladimir Zhirov
  2010-12-01  7:50 ` Damir
  0 siblings, 1 reply; 2+ messages in thread
From: Vladimir Zhirov @ 2010-12-01  7:51 UTC (permalink / raw)
  To: community

Всем привет.

Возникла задача собрать веб-сервер mongoose
http://code.google.com/p/mongoose/. 
Пока не пакет, только бинарный исполняемый файл.

Поскольку в проекте используется динамическая загрузка
библиотек, в командной строке cc необходимо передавать 
опцию -ldl. Возникла проблема с расположением этой опции.

Строка в makefile выглядит примерно так:
$(CC) -ldl <другие опции> mongoose.c main.c -o $(PROG)

У меня на Simply Linux в результате получается:
main.c -o mongoose /tmp/.private/vvzh/ccwJbBvT.o: In function `load_dll':
mongoose.c:(.text+0x110b): undefined reference to `dlopen'
mongoose.c:(.text+0x1123): undefined reference to `dlsym' 
collect2: ld returned 1 exit status
make: *** [linux] Error 1

Если я перемещаю -ldl так:
$(CC) <другие опции> mongoose.c main.c -ldl -o $(PROG)
Всё нормально собирается.

Разработчику был направлен багрепорт c предложением переместить опцию, 
на что был получен ответ:

> It looks like "cc" command does something weird on your distribution.
> It does not behave like it needs to.

В связи с чем вопрос: есть ли отличия в gcc из p5, по сравнению
с другими бранчами/дистрибутивами (от ALT и не от ALT),
которые могли бы вызвать такое поведение?


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

end of thread, other threads:[~2010-12-01  7:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-12-01  7:51 [Comm] Сборка mongoose web server и cc -ldl Vladimir Zhirov
2010-12-01  7:50 ` Damir

ALT Linux Community general discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/community/0 community/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 community community/ http://lore.altlinux.org/community \
		mandrake-russian@linuxteam.iplabs.ru community@lists.altlinux.org community@lists.altlinux.ru community@lists.altlinux.com
	public-inbox-index community

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.community


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git