public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/12975] New: if exec-prefix set/ g++ looks for include files in wrong place
@ 2003-11-09  3:01 boyland at cs dot uwm dot edu
  2003-11-09  3:09 ` [Bug c++/12975] " pinskia at gcc dot gnu dot org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: boyland at cs dot uwm dot edu @ 2003-11-09  3:01 UTC (permalink / raw)
  To: gcc-bugs

(I reported this for 3.2.1 but I know more about the cause now.)

If you specify an exec-prefix that is not a subdirectory of prefix,
g++ looks for the include files in a different place from where
they are stored.  After installation things work badly:

% /usr/new/bin/g++ -v test.cc
Reading specs from /usr/new/bin/../lib/gcc-lib/sparc-sun-solaris2.8/3.3/specs
Configured with: /afs/cs/package/gcc/temp-link/common/gcc-3.3/configure
--prefix=/afs/cs.uwm.edu/package/gcc/gcc-3.3/common
--exec-prefix=/afs/cs.uwm.edu/package/gcc/gcc-3.3/sun4x_58 --enable-languages=c,c++
Thread model: posix
gcc version 3.3
 /usr/new/bin/../lib/gcc-lib/sparc-sun-solaris2.8/3.3/cc1plus -quiet -v -iprefix
/usr/new/bin/../lib/gcc-lib/sparc-sun-solaris2.8/3.3/ -D__GNUC__=3
-D__GNUC_MINOR__=3 -D__GNUC_PATCHLEVEL__=0 -Dsparc -D__sparc__ -D__sparc
-D__GCC_NEW_VARARGS__ -Acpu=sparc -Amachine=sparc test.cc -D__GNUG__=3 -quiet
-dumpbase test.cc -auxbase test -version -o /var/tmp//ccgS3XGG.s
GNU C++ version 3.3 (sparc-sun-solaris2.8)
        compiled by GNU C version 3.3.
GGC heuristics: --param ggc-min-expand=47 --param ggc-min-heapsize=32768
ignoring nonexistent directory
"/usr/new/lib/gcc-lib/../../../../../../../../include/c++/3.3"
ignoring nonexistent directory
"/usr/new/lib/gcc-lib/../../../../../../../../include/c++/3.3/sparc-sun-solaris2.8"
ignoring nonexistent directory
"/usr/new/lib/gcc-lib/../../../../../../../../include/c++/3.3/backward"
ignoring nonexistent directory
"/usr/new/lib/gcc-lib/../../../../../../../sparc-sun-solaris2.8/include"
ignoring nonexistent directory "/include/c++/3.3"
ignoring nonexistent directory "/include/c++/3.3/sparc-sun-solaris2.8"
ignoring nonexistent directory "/include/c++/3.3/backward"
ignoring nonexistent directory "/afs/sparc-sun-solaris2.8/include"
ignoring duplicate directory
"/afs/cs.uwm.edu/package/gcc/gcc-3.3/sun4x_58/lib/gcc-lib/sparc-sun-solaris2.8/3.3/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/new/lib/gcc-lib/sparc-sun-solaris2.8/3.3/include
 /usr/local/include
 /afs/cs.uwm.edu/package/gcc/gcc-3.3/common/include
 /usr/include
End of search list.
test.cc:1:16: list: No such file or directory
test.cc:7: error: 'list' is used as a type, but is not defined as a type.

The problem is due to line 790 of gcc-3.3/gcc/configure:

  gcc_gxx_include_dir="\$(libsubdir)/\$(unlibsubdir)/..\`echo \$(exec_prefix)
| sed -e 's|^\$(prefix)||' -e 's|/[^/]*|/..|g'\`/include/"${libstdcxx_incdir}

This definition is nonsense if exec_prefix is not a subdirectory of prefix.
(It generates a huge number of ../'s)

I don't know the intricacies of gcc well enough to suggest a fix, but
Workarounds:
(1) don't do it (specify exec-prefix)
(2) apparently -with-gxx-include-dir=/absolute/pathname should work
    (haven't tried it yet)

-- 
           Summary: if exec-prefix set/ g++ looks for include files in wrong
                    place
           Product: gcc
           Version: 3.3
            Status: UNCONFIRMED
          Severity: minor
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: boyland at cs dot uwm dot edu
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: sparc-sun-solaris2.8
  GCC host triplet: sparc-sun-solaris2.8
GCC target triplet: sparc-sun-solaris2.8


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


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

* [Bug c++/12975] if exec-prefix set/ g++ looks for include files in wrong place
  2003-11-09  3:01 [Bug c++/12975] New: if exec-prefix set/ g++ looks for include files in wrong place boyland at cs dot uwm dot edu
@ 2003-11-09  3:09 ` pinskia at gcc dot gnu dot org
  2003-11-10  2:32 ` boyland at cs dot uwm dot edu
  2003-11-10  2:39 ` pinskia at gcc dot gnu dot org
  2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2003-11-09  3:09 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2003-11-09 03:09 -------
Just a note this only wrong when there are links in PREFIX or EXEC_PREFIX or the relocated 
EXEC_PREFIX.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2003-11-09 03:09:21
               date|                            |


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


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

* [Bug c++/12975] if exec-prefix set/ g++ looks for include files in wrong place
  2003-11-09  3:01 [Bug c++/12975] New: if exec-prefix set/ g++ looks for include files in wrong place boyland at cs dot uwm dot edu
  2003-11-09  3:09 ` [Bug c++/12975] " pinskia at gcc dot gnu dot org
@ 2003-11-10  2:32 ` boyland at cs dot uwm dot edu
  2003-11-10  2:39 ` pinskia at gcc dot gnu dot org
  2 siblings, 0 replies; 4+ messages in thread
From: boyland at cs dot uwm dot edu @ 2003-11-10  2:32 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From boyland at cs dot uwm dot edu  2003-11-10 02:32 -------
Actually, even without symbolic links there are problems.
(My previous example, however, failed to show that
since I ran g++ through a symbolic link.)
Here's another -v run that uses the exec-prefix path directly.
Notice the "non-existent" directories.  They are compiled into
the binary with lots of ../'s as explained in the original bug report.

A new link-free execution:

% /afs/cs.uwm.edu/package/gcc/gcc-3.3/sun4x_58/bin/g++ -v test.cc
Reading specs from
/afs/cs.uwm.edu/package/gcc/gcc-3.3/sun4x_58/lib/gcc-lib/sparc-sun-solaris2.8/3.3/specs
Configured with: /afs/cs/package/gcc/temp-link/common/gcc-3.3/configure
--prefix=/afs/cs.uwm.edu/package/gcc/gcc-3.3/common
--exec-prefix=/afs/cs.uwm.edu/package/gcc/gcc-3.3/sun4x_58 --enable-languages=c,c++
Thread model: posix
gcc version 3.3
 /afs/cs.uwm.edu/package/gcc/gcc-3.3/sun4x_58/lib/gcc-lib/sparc-sun-solaris2.8/3.3/cc1plus -quiet -v -D__GNUC__=3 -D__GNUC_MINOR__=3 -D__GNUC_PATCHLEVEL__=0 -Dsparc -D__sparc__ -D__sparc -D__GCC_NEW_VARARGS__ -Acpu=sparc -Amachine=sparc test.cc -D__GNUG__=3 -quiet -dumpbase test.cc -auxbase test -version -o /var/tmp//ccij82f8.s
GNU C++ version 3.3 (sparc-sun-solaris2.8)
        compiled by GNU C version 3.3.
GGC heuristics: --param ggc-min-expand=47 --param ggc-min-heapsize=32768
ignoring nonexistent directory "/include/c++/3.3"
ignoring nonexistent directory "/include/c++/3.3/sparc-sun-solaris2.8"
ignoring nonexistent directory "/include/c++/3.3/backward"
ignoring nonexistent directory "/afs/sparc-sun-solaris2.8/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/include
 /afs/cs.uwm.edu/package/gcc/gcc-3.3/common/include
 /afs/cs.uwm.edu/package/gcc/gcc-3.3/sun4x_58/lib/gcc-lib/sparc-sun-solaris2.8/3.3/include
 /usr/include
End of search list.
test.cc:1:16: list: No such file or directory
test.cc:7: error: 'list' is used as a type, but is not defined as a type.

BTW: I'm installing a version with --with-gxx-include-dir, so if you have AFS
and want to try things out yourself, it won't be there anymore.

-- 


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


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

* [Bug c++/12975] if exec-prefix set/ g++ looks for include files in wrong place
  2003-11-09  3:01 [Bug c++/12975] New: if exec-prefix set/ g++ looks for include files in wrong place boyland at cs dot uwm dot edu
  2003-11-09  3:09 ` [Bug c++/12975] " pinskia at gcc dot gnu dot org
  2003-11-10  2:32 ` boyland at cs dot uwm dot edu
@ 2003-11-10  2:39 ` pinskia at gcc dot gnu dot org
  2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2003-11-10  2:39 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2003-11-10 02:39 -------
Actually this is a dup of bug 8477.

*** This bug has been marked as a duplicate of 8477 ***

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |DUPLICATE


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


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

end of thread, other threads:[~2003-11-10  2:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-11-09  3:01 [Bug c++/12975] New: if exec-prefix set/ g++ looks for include files in wrong place boyland at cs dot uwm dot edu
2003-11-09  3:09 ` [Bug c++/12975] " pinskia at gcc dot gnu dot org
2003-11-10  2:32 ` boyland at cs dot uwm dot edu
2003-11-10  2:39 ` pinskia at gcc dot gnu dot org

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).