[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug gold/10238] Gold linker does not resolve symbols using indirect dep

From: mattijs.janssens at gmail dot com
Subject: [Bug gold/10238] Gold linker does not resolve symbols using indirect dependencies
Date: Mon, 10 Dec 2012 15:59:09 +0000


mattijs.janssens at gmail dot com changed:

           What    |Removed                     |Added
                 CC|                            |mattijs.janssens at gmail
                   |                            |dot com
            Version|2.19                        |2.22

--- Comment #18 from mattijs.janssens at gmail dot com 2012-12-10 15:59:09 UTC 
This feature is causing us quite a headache. We are developing an open source
application (OpenFOAM) which is chock full of models and models of models which
are in separate libraries. We have always used the facility of indirect linkage
so a library needs to link in only those libraries it directly calls, and not
those that those libraries need. Works great.

If we want to use gold we suddenly need to specify all the indirectly used
libraries. Why should a user of our libraries need to know that e.g. the
turbulence library internally depends on the liquid properties library (and
about 10 more)?

>From my point of view: I have gone through all my dependencies and not link in
more than needed and have 'told' the linker so with --copy-dt-needed-entries,
--no-as-needed. But it seems to ignore these now.

Below a modification of the testscript which demonstrates the indirect linking
problem at the shared library level.

My question: can we please keep/have an option to tell the linker to do
indirect linkage.



# Build libl3.so with no dependents
echo 'l3() { ; }' > l3.c
gcc -Xlinker --no-as-needed -Xlinker  --copy-dt-needed-entries -Xlinker
-rpath=. -shared -fPIC -o libl3.so l3.c

# Build libl2.so  that depends on libl3.so
echo 'l2() { l3(); }' > l2.c
gcc -Xlinker --no-as-needed -Xlinker  --copy-dt-needed-entries -Xlinker
-rpath=. -shared -fPIC -o libl2.so l2.c -L. -ll3

# Build libl1.so that depends on libl2.so
echo 'l1() { l2(); }' > l1.c
gcc -Xlinker --no-as-needed -Xlinker  --copy-dt-needed-entries -Xlinker
-rpath=. -shared -fPIC -o libl1.so l1.c -L. -ll2

# Build main source file which depends on l1 only (so indirectly on l2)
echo 'main() { l1(); }' > top.c
gcc top.c -L. -ll1

Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]