Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Print full paths of libraries used when linking?

1,384 views
Skip to first unread message

dspfun

unread,
Jan 23, 2012, 9:59:59 AM1/23/12
to
Hi!

Is it possible to print the full paths of libraries that is used
during linking? I am using the cross compiler "powerpc-e500-linux-gnu-
gcc".

Instead of "-lc" "-lgcc" "-lmy_lib" etc. I would like to see the full
paths.

Brs,
Markus

Peter

unread,
Feb 10, 2012, 8:19:21 AM2/10/12
to

Nicolai Stange

unread,
Mar 18, 2012, 7:49:07 AM3/18/12
to
Hi,

you can use `gcc -v' when linking. This will print the command lines of
all commands involved in compilation/linking to stderr.

Since in the end, linking is just handed over to ld, you'll have to collect
the information together by hand (by looking at the -L and -l flags
gcc passes to collect2 which in turn invokes ld).

If your gcc is configured to use GNU ld (which may not be the case), you
can pass it the `-t' flag (see `man ld'):
gcc -Wl,-t ...

Best,

Nicolai
0 new messages