Bogus usage of gcc --print-file

Matthew Burgess matthew at linuxfromscratch.org
Tue Aug 16 14:31:08 PDT 2005


Greg Schafer wrote:

> The documented switch is:
> 
>   -print-file-name=
> 
> However, the docs say it is only for "library", but it appears to work for
> any file or dir within GCC's private dir eg: specs, startfiles,

Doesn't appear to do what we need it to do though.  In as much as if the 
specs file isn't there (which it isn't under gcc-4.x), it doesn't report 
it.  I suppose the idea here is to use `dirname' on it, right?

# gcc -print-search-dirs | head -n 1 | awk '{ print $2 "specs" }'
/usr/lib/gcc/i686-pc-linux-gnu/4.0.1/specs
# gcc -print-file-name=libgcc.a
/usr/lib/gcc/i686-pc-linux-gnu/4.0.1/libgcc.a
# gcc -print-file-name=specs
specs
# echo `dirname $(gcc -print-file-name=libgcc.a)`/specs
/usr/lib/gcc/i686-pc-linux-gnu/4.0.1/specs

Do I get extra marks for showing my working? :)

Regards,

Matt.



More information about the lfs-dev mailing list