Bogus usage of gcc --print-file

Matthew Burgess matthew at
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" }'
# gcc -print-file-name=libgcc.a
# gcc -print-file-name=specs
# echo `dirname $(gcc -print-file-name=libgcc.a)`/specs

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



More information about the lfs-dev mailing list