Bug 11926 - -print-file-name doesn't aways print full path names
Summary: -print-file-name doesn't aways print full path names
Status: RESOLVED INVALID
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 3.3.1
: P2 normal
Target Milestone: 3.4.0
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-08-15 08:36 UTC by Adriaan van Os
Modified: 2016-03-21 07:16 UTC (History)
1 user (show)

See Also:
Host: apple-powerpc-darwin
Target: apple-powerpc-darwin
Build: apple-powerpc-darwin
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Adriaan van Os 2003-08-15 08:36:55 UTC
-print-file-name and -print-prog-name don't aways print full path names, where
-print-libgcc-file-name does:

[G4:/usr] adriaan% gcc -print-file-name=libgcc
libgcc

[G4:/usr] adriaan% gcc -print-file-name=libgpc
libgpc

[G4:/usr] adriaan% gcc -print-prog-name=libgcc
libgcc

[G4:/usr] adriaan% gcc -print-prog-name=libgpc
libgpc

[G4:/usr] adriaan% gcc -print-libgcc-file-name
/Developer/Pascal/gpc331d2/lib/gcc-lib/powerpc-apple-darwin/3.3.1/libgcc.a

[G4:/usr] adriaan% gcc -print-prog-name=cc1
/Developer/Pascal/gpc331d2/lib/gcc-lib/powerpc-apple-darwin/3.3.1/cc1

[G4:/usr] adriaan% gcc -print-prog-name=gpc1
/Developer/Pascal/gpc331d2/lib/gcc-lib/powerpc-apple-darwin/3.3.1/gpc1

[G4:/usr] adriaan% gcc -v
Reading specs from
/Developer/Pascal/gpc331d2/lib/gcc-lib/powerpc-apple-darwin/3.3.1/specs
Configured with: ../gpc-331d2/configure --enable-languages=pascal,c
--prefix=/Developer/Pascal/gpc331d2 --enable-threads=posix
--target=powerpc-apple-darwin
Thread model: posix
gcc version 3.3.1

If this is intended behaviour, then the docs are wrong.

Regards,

Adriaan van Os
Comment 1 Andrew Pinski 2003-08-15 11:03:14 UTC
I do not think the documenation is wrong or the behaviour you are see either.
If I supply the full file name gcc -print-file-name=libgcc.a produces what you wanted:
/Users/pinskia/fsf-clean-nocheck/lib/gcc/powerpc-apple-darwin6.6/3.4/libgcc.a
Comment 2 Adriaan van Os 2003-08-15 13:40:22 UTC
Subject: Re:  -print-file-name doesn't aways print full path names

pinskia at gcc dot gnu dot org wrote:

> If I supply the full file name gcc -print-file-name=libgcc.a produces  
> what you wanted:
> /Users/pinskia/fsf-clean-nocheck/lib/gcc/powerpc-apple-darwin6.6/3.4/ 
> libgcc.a

You are right, I apologize.

Regards,

Adriaan van Os

Comment 3 Andrew Pinski 2003-08-15 13:44:15 UTC
Reporter says that he was wrong and he needed the full name rather than the name without the 
extension which is the way the documentation says.
Comment 4 Gunter Königsmann 2016-03-21 07:16:08 UTC
Perhaps one thing on the man page could be changed, though:

       -print-file-name=library
           Print the full absolute name of the library file library that would
           be used when linking---and don't do anything else.  With this
           option, GCC does not compile or link anything; it just prints the
           file name.


might better read:

       -print-file-name=library
           Print the full absolute name of the library file library that would
           be used when linking---and don't do anything else.  With this
           option, GCC does not compile or link anything. It just prints the
           file name; The parameter "library" is required to contain the file
           name ending. Valid examples are: libstdc++.a or libstdc++.dll.