This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/12975] New: if exec-prefix set/ g++ looks for include files in wrong place


(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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]