PLDWWW: DevelopingPLD/AdvancedDeveloping/FixingAsNeeded
sparky
sparky at pld-linux.org
Mon Aug 7 02:53:37 CEST 2006
Author: sparky Date: Mon Aug 7 00:53:37 2006 GMT
Module: PLDWWW URL: http://www.pld-linux.org/DevelopingPLD/AdvancedDeveloping/FixingAsNeeded
---- Log message:
---- Page affected: DevelopingPLD/AdvancedDeveloping/FixingAsNeeded
---- Diffs:
================================================================
$ gcc $(LDFLAGS) -o $@ $(OBJECTS) $(LIBS)
}}}
and this generally works well.
-
+ ----
If there is something like that:
{{{
$ gcc -Wl,--as-needed -l<library> <objects.o>
}}}
the library will __never__ be linked, because it's not required at the
time it's checked.
-
+ ----
And with something like that:
{{{
$ gcc -l<library> -Wl,--as-needed <objects.o>
@@ -52, +52 @@
[http://cvs.pld-linux.org/cgi-bin/cvsweb/SOURCES/readline-shared.patch?r1=1.6&r2=1.7 fixed readline];).
But some packages link with readline or ncurses while they use __only__
- symbols from tinfo.
+ symbols from tinfo.
''Without'' {{{--as-needed}}} those executables work because
- they are linked with tinfo from readline/ncurses library.
+ they are linked with tinfo from readline/ncurses library.
''With'' {{{--as-needed}}} it will not work, because readline/ncurses
contain no symbols required by executable
so they are not linked, it's dependencies naturally are neither linked.
@@ -129, +129 @@
What we get after running make in build tree:
{{{
- x86_64-pld-linux-g++ -DNOMMGR -Wall -DGAMEDATADIR=\"/usr/share/xmoto\" -ggdb -O2 -Wl,--as-needed -o xmoto-edit BuiltInFont.o [...object files...] Packager.o -lcurl -lode -llualib50 -llua50 -lSDL_mixer -lSDL -lbz2 -lz -lpng -ljpeg
+ x86_64-pld-linux-g++ -DNOMMGR -Wall -DGAMEDATADIR=\"/usr/share/xmoto\" -ggdb -O2 -Wl,--as-needed -o xmoto-edit BuiltInFont.o [...object files...] Packager.o -lcurl -lode -llualib50 -llua50 -lSDL_mixer -lSDL -lbz2 -lz -lpng -ljpeg
VApp.o: In function `vapp::App::grabScreen()':
src/VApp.cpp:667: undefined reference to `glReadBuffer'
@@ -213, +213 @@
Compilation stops at this place:
{{{
- /bin/sh ../libtool --tag=CC --mode=link x86_64-pld-linux-gcc -ggdb -O2 -Wall -Wl,--as-needed -o test-source-selector test-source-selector.o libedataserverui-1.2.la ../libedataserver/libedataserver-1.2.la -pthread -lglade-2.0 [...many -l libraries...]
+ /bin/sh ../libtool --tag=CC --mode=link x86_64-pld-linux-gcc -ggdb -O2 -Wall -Wl,--as-needed -o test-source-selector test-source-selector.o libedataserverui-1.2.la ../libedataserver/libedataserver-1.2.la -pthread -lglade-2.0 [...many -l libraries...]
-lgnome-keyring -lpthread
x86_64-pld-linux-gcc -ggdb -O2 -Wall -Wl,--as-needed -o .libs/test-source-selector test-source-selector.o -pthread ./.libs/libedataserverui-1.2.so [many, many .so and -l libraries] -lpthread
@@ -288, +288 @@
=== 3. unresolved symbols caused by incorrect order ===
- Two of most difficult of common problems at once,
+ Two of most difficult of common problems at once,
[http://cvs.pld-linux.org/cgi-bin/cvsweb/SPECS/evolution.spec?rev=HEAD evolution.spec]:
The difficulties are:
More information about the pld-cvs-commit
mailing list