public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug driver/19856] New: GCC_EXEC_PREFIX used wrong
@ 2005-02-09 20:59 bryanh at giraffe-data dot com
  2005-02-09 21:24 ` [Bug driver/19856] " bryanh at giraffe-data dot com
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: bryanh at giraffe-data dot com @ 2005-02-09 20:59 UTC (permalink / raw)
  To: gcc-bugs

GCC_EXEC_PREFIX behavior doesn't match the manual or reason and several ways.

The manual says GCC_EXEC_PREFIX is a prefix for the program name, which means 
'gcc' should look for 'cc1' as GCC_EXEC_PREFIX/cc1.  But Strace indicates that 
'gcc' looks at GCC_EXEC_PREFIX/MACHINE/VERSION/../../../..
MACHINE/bin/MACHINE/VERSION/cc1.
This is a rather strange path.

The manual says gcc looks using GCC_EXEC_PREFIX first, and then the usual 
places.  That would be normal.  For me, it looks in a bunch of places unrelated 
to GCC_EXEC_PREFIX, then the path described above, then gives up.

The "bunch of places" mentioned above starts with something that is apparently 
based on the path by which 'gcc' was invoked, but has too many .. in it:  
MY_GCC_INSTALL_DIRECTORY/lib/../../lbiexec/gcc/MACHINE/VERSION/cc1.

On the other hand, if I don't set GCC_EXEC_PREFIX, it properly looks at 
MY_GCC_INSTALL_DIRECTORY/bin/../libexec/gcc/MACHINE/VERSION/cc1.

The manual says GCC_EXEC_PREFIX is used for finding subprograms and linker 
files, but it is apparently also used for the specs file -- 
GCC_EXEC_PREFIX/MACHINE/VERSION/specs .

The manual says the default for GCC_EXEC_PREFIX is PREFIX/lib/gcc .  But it also 
says when GCC_EXEC_PREFIX is not set, gcc searches based on the pathname with 
which it was invoked.  The latter matches what the program does for me.

(For clarity, I have written the above as if gcc add a slash after 
GCC_EXEC_PREFIX; as documented, it doesn't).

Note that in these experiments, I built gcc with PREFIX = nonexistent directory 
to ensure no built-in path gets used.

Finally, if someone works on the manual section, I highly recommend moving the 
environment variable section out of the "Gcc Command Options" section.  It 
doesn't fit there; I had a hard time finding it.

-- 
           Summary: GCC_EXEC_PREFIX used wrong
           Product: gcc
           Version: 3.4.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: driver
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: bryanh at giraffe-data dot com
                CC: gcc-bugs at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19856


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug driver/19856] GCC_EXEC_PREFIX used wrong
  2005-02-09 20:59 [Bug driver/19856] New: GCC_EXEC_PREFIX used wrong bryanh at giraffe-data dot com
@ 2005-02-09 21:24 ` bryanh at giraffe-data dot com
  2005-02-09 23:58 ` pinskia at gcc dot gnu dot org
  2005-02-10  0:28 ` bryanh at giraffe-data dot com
  2 siblings, 0 replies; 6+ messages in thread
From: bryanh at giraffe-data dot com @ 2005-02-09 21:24 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From bryanh at giraffe-data dot com  2005-02-09 17:06 -------
Created an attachment (id=8157)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=8157&action=view)
strace of failure to find cc1

In this run, PREFIX is /home/bryanh/gcc .  

GCC_EXEC_PREFIX is /tmp2/gcc-3.4.3/lib/gcc//  .

/tmp2 is a symlink to /mp/hdb2	.

Gcc, in the form created by 'make install', is installed in /tmp2/gcc-3.4.3 --
i.e. 'make install' created the tree at /home/bryanh/gcc and I moved it to
/tmp2/gcc-3.4.3.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19856


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug driver/19856] GCC_EXEC_PREFIX used wrong
  2005-02-09 20:59 [Bug driver/19856] New: GCC_EXEC_PREFIX used wrong bryanh at giraffe-data dot com
  2005-02-09 21:24 ` [Bug driver/19856] " bryanh at giraffe-data dot com
@ 2005-02-09 23:58 ` pinskia at gcc dot gnu dot org
  2005-02-10  0:28 ` bryanh at giraffe-data dot com
  2 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-02-09 23:58 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-02-09 19:07 -------
I think this related to PR 14435.  But reading the docs (there is a section in there which is useful to 
read):
In addition, the prefix is used in an unusual way in finding the directories to search for header files. For 
each of the standard directories whose name normally begins with /usr/local/lib/gcc (more precisely, 
with the value of GCC_INCLUDE_DIR), GCC tries replacing that beginning with the specified prefix to 
produce an alternate directory name. Thus, with -Bfoo/, GCC will search foo/bar where it would 
normally search /usr/local/lib/bar. These alternate directories are searched first; the standard 
directories come next. 

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19856


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug driver/19856] GCC_EXEC_PREFIX used wrong
  2005-02-09 20:59 [Bug driver/19856] New: GCC_EXEC_PREFIX used wrong bryanh at giraffe-data dot com
  2005-02-09 21:24 ` [Bug driver/19856] " bryanh at giraffe-data dot com
  2005-02-09 23:58 ` pinskia at gcc dot gnu dot org
@ 2005-02-10  0:28 ` bryanh at giraffe-data dot com
  2 siblings, 0 replies; 6+ messages in thread
From: bryanh at giraffe-data dot com @ 2005-02-10  0:28 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From bryanh at giraffe-data dot com  2005-02-09 19:43 -------
Subject: Re:  GCC_EXEC_PREFIX used wrong

I don't see the relevance of that paragraph to either of the problem
reports, since there is no search for header files involved.

I don't know anything about the Gcc bug fixing process, but I see that
PR 14435 is 11 months old.  Has anything been changed because of it?  Will
it be?

If code or doc needs to be written, I'd be happy to do it, but if
someone else has to figure out what GCC_EXEC_PREFIX should do, that
would be premature.



-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19856


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug driver/19856] GCC_EXEC_PREFIX used wrong
       [not found] <bug-19856-4@http.gcc.gnu.org/bugzilla/>
  2020-04-13 20:10 ` msebor at gcc dot gnu.org
@ 2020-04-15  3:51 ` bryanh@giraffe-data.com
  1 sibling, 0 replies; 6+ messages in thread
From: bryanh@giraffe-data.com @ 2020-04-15  3:51 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=19856

--- Comment #5 from Bryan Henderson <bryanh@giraffe-data.com> ---
A quick check of the latest manual shows the same description, and a quick
strace of GCC 6.3 shows the same behavior, so my guess is no one has touched
this area.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug driver/19856] GCC_EXEC_PREFIX used wrong
       [not found] <bug-19856-4@http.gcc.gnu.org/bugzilla/>
@ 2020-04-13 20:10 ` msebor at gcc dot gnu.org
  2020-04-15  3:51 ` bryanh@giraffe-data.com
  1 sibling, 0 replies; 6+ messages in thread
From: msebor at gcc dot gnu.org @ 2020-04-13 20:10 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=19856

Martin Sebor <msebor at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2020-04-13
     Ever confirmed|0                           |1
                 CC|                            |msebor at gcc dot gnu.org
             Status|UNCONFIRMED                 |WAITING

--- Comment #4 from Martin Sebor <msebor at gcc dot gnu.org> ---
I this (still) a problem today (if so, let's confirm it), otherwise let's
resolve it one way or the other.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-04-15  3:51 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-02-09 20:59 [Bug driver/19856] New: GCC_EXEC_PREFIX used wrong bryanh at giraffe-data dot com
2005-02-09 21:24 ` [Bug driver/19856] " bryanh at giraffe-data dot com
2005-02-09 23:58 ` pinskia at gcc dot gnu dot org
2005-02-10  0:28 ` bryanh at giraffe-data dot com
     [not found] <bug-19856-4@http.gcc.gnu.org/bugzilla/>
2020-04-13 20:10 ` msebor at gcc dot gnu.org
2020-04-15  3:51 ` bryanh@giraffe-data.com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).