Long paths with ../../../../ throughout
Ian Lance Taylor
iant@google.com
Tue Jan 19 18:18:00 GMT 2010
Jon Grant <jg@jguk.org> writes:
> Any easy way to evaluate and reduce command lines? Consider this:
>
> /usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/crt1.o
>
> Is actually the same as: /usr/lib/crt1.o -- which is much clearer!
Using this form of path makes it easy to move an installed gcc tree to
a new location and have it continue to work correctly. Since normal
users never see these paths, the goal is correctness rather than
clarity.
> Also I notice lots of duplicate parameters:
>
> Is this directory really needed twice?
> -L/usr/lib/gcc/i486-linux-gnu/4.3.3 -L/usr/lib/gcc/i486-linux-gnu/4.3.3
No. I would encourage you to investigate why it is happening.
> also -lgcc_s is mentioned twice, as is -gcc
This is because on some systems there is a circular dependency between
-lgcc and -lc. Some of the functions in -lgcc require functions in
-lc. If -lc was compiled with gcc, then on some systems some of the
functions in -lc will require -lgcc. Fortunately the functions which
-lc requires in -lgcc will never themselves require -lc. So
mentioning -lgcc twice, once before -lc and once after, suffices on
all systems.
> Finally, could collect2 output command lines when in -verbose mode?
> Currently I can't see what parameters it is calling "ld" with.. when
> ld fails.
To see what collect2 is doing, use -Wl,-debug.
Ian
More information about the Gcc
mailing list