This is the mail archive of the crossgcc@sourceware.org mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


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

Re: c++ includes not getting searched for correctly?


On Tue, Oct 5, 2010 at 9:01 AM, Anthony Foiani <anthony.foiani@gmail.com> wrote:
> On Mon, Oct 4, 2010 at 9:13 PM, Ralf Corsepius <rc040203@freenet.de> wrote:
>> On 10/01/2010 10:47 PM, Anthony Foiani wrote:
>>> The upshot is that the final cross-compiler looks in the wrong place
>>> for c++ headers; it ends up looking in
>>>
>>> Â TARGET/lib/gcc/TARGET/4.5.1/include/
>>> Â TARGET/lib/gcc/TARGET/4.5.1/include-fixed/
>>> Â TARGET/TARGET/sys-root/usr/include/
>>
>> These are the correct locations.
>>
>>> When it should be looking in:
>>>
>>> Â TARGET/TARGET/sys-root/usr/include/c++/4.5.1/
>>
>> And this would be wrong.

I don't understand. Could you kindly explain more about why this is wrong?

> Ok, I think I see the reasoning behind this: things like "stdio.h" in
> /usr/include are a part of libc, while the g++ headers are properly a
> part of GCC itself. ÂOk.
>
> So how do I get libstdc++ installed into one of those proper search
> directories? ÂHere's where they ended up:
>
> [tony@fedora12-64 xtools]$ find . -name '*stdc++*' -print
> ./powerpc-e500v2-linux-gnuspe/sys-root/lib/libstdc++.so
> ./powerpc-e500v2-linux-gnuspe/sys-root/lib/libstdc++.so.6.0.14
> ./powerpc-e500v2-linux-gnuspe/sys-root/lib/libstdc++.la
> ./powerpc-e500v2-linux-gnuspe/sys-root/lib/libstdc++.so.6.0.14-gdb.py
> ./powerpc-e500v2-linux-gnuspe/sys-root/lib/libstdc++.a
> ./powerpc-e500v2-linux-gnuspe/sys-root/lib/libstdc++.so.6
> ./powerpc-e500v2-linux-gnuspe/sys-root/usr/include/c++/4.5.1/powerpc-e500v2-linux-gnuspe/bits/stdc++.h
>
> [tony@fedora12-64 xtools]$ find . -name 'iostream' -print
> ./powerpc-e500v2-linux-gnuspe/sys-root/usr/include/c++/4.5.1/iostream
>
> Config file attached.
>
> Thanks,
> Tony
>
> --
> For unsubscribe information see http://sourceware.org/lists.html#faq
>

I have the same issue on a ppc (e500v2), and armeb (armv5te), and this
x86 toolchain built with crosstool-ng (gcc-4.5.1, eglibc-trunk).

g++test.cpp:
----------------------8<---------------------
#include <iostream>
using namespace std;
int main( int argc, char **argv )
{
    cout << "Hello World" << endl;
    return 0;
}
----------------------8<---------------------

$ /home/bryan/x-tools/i686-nptl-linux-gnu/bin/i686-nptl-linux-gnu-g++
-o g++test g++test.cpp
g++test.cpp:1:20: fatal error: iostream: No such file or directory
compilation terminated.

$ /home/bryan/x-tools/i686-nptl-linux-gnu/bin/i686-nptl-linux-gnu-gcc
-print-search-dirs
install: /home/bryan/x-tools/i686-nptl-linux-gnu/lib/gcc/i686-nptl-linux-gnu/4.5.1/
programs: =/home/bryan/x-tools/i686-nptl-linux-gnu/libexec/gcc/i686-nptl-linux-gnu/4.5.1/:/home/bryan/x-tools/i686-nptl-linux-gnu/libexec/gcc/i686-nptl-linux-gnu/4.5.1/:/home/bryan/x-tools/i686-nptl-linux-gnu/libexec/gcc/i686-nptl-linux-gnu/:/home/bryan/x-tools/i686-nptl-linux-gnu/lib/gcc/i686-nptl-linux-gnu/4.5.1/:/home/bryan/x-tools/i686-nptl-linux-gnu/lib/gcc/i686-nptl-linux-gnu/:/home/bryan/x-tools/i686-nptl-linux-gnu/lib/gcc/i686-nptl-linux-gnu/4.5.1/../../../../i686-nptl-linux-gnu/bin/i686-nptl-linux-gnu/4.5.1/:/home/bryan/x-tools/i686-nptl-linux-gnu/lib/gcc/i686-nptl-linux-gnu/4.5.1/../../../../i686-nptl-linux-gnu/bin/
libraries: =/home/bryan/x-tools/i686-nptl-linux-gnu/lib/gcc/i686-nptl-linux-gnu/4.5.1/:/home/bryan/x-tools/i686-nptl-linux-gnu/lib/gcc/i686-nptl-linux-gnu/4.5.1/../../../../i686-nptl-linux-gnu/lib/i686-nptl-linux-gnu/4.5.1/:/home/bryan/x-tools/i686-nptl-linux-gnu/lib/gcc/i686-nptl-linux-gnu/4.5.1/../../../../i686-nptl-linux-gnu/lib/:/home/bryan/x-tools/i686-nptl-linux-gnu/i686-nptl-linux-gnu//sys-root/lib/i686-nptl-linux-gnu/4.5.1/:/home/bryan/x-tools/i686-nptl-linux-gnu/i686-nptl-linux-gnu//sys-root/lib/:/home/bryan/x-tools/i686-nptl-linux-gnu/i686-nptl-linux-gnu//sys-root/usr/lib/i686-nptl-linux-gnu/4.5.1/:/home/bryan/x-tools/i686-nptl-linux-gnu/i686-nptl-linux-gnu//sys-root/usr/lib/


I attached my x86.config and output of -dumpspecs

--Bryan

Attachment: x86.config
Description: Binary data

*asm:
%{v:-V} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Yd,*} %{Wa,*:%*} --32   %{!mno-sse2avx:%{mavx:-msse2avx}} %{msse2avx:%{!mavx:-msse2avx}}

*asm_debug:
%{!g0:%{gstabs*:--gstabs}%{!gstabs*:%{g*:--gdwarf2}}} %{fdebug-prefix-map=*:--debug-prefix-map %*}

*asm_final:


*asm_options:
%{--target-help:%:print-asm-header()} %a %Y %{c:%W{o*}%{!o*:-o %w%b%O}}%{!c:-o %d%w%u%O}

*invoke_as:
%{!fwpa:   %{fcompare-debug=*|fdump-final-insns=*:%:compare-debug-dump-opt()}   %{!S:-o %|.s |
 as %(asm_options) %|.s %A }  }

*cpp:
%{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}

*cpp_options:
%(cpp_unique_options) %1 %{m*} %{std*&ansi&trigraphs} %{W*&pedantic*} %{w} %{f*} %{g*:%{!g0:%{g*} %{!fno-working-directory:-fworking-directory}}} %{O*} %{undef} %{save-temps*:-fpch-preprocess}

*cpp_debug_options:
%{d*}

*cpp_unique_options:
%{C|CC:%{!E:%eGCC does not support -C or -CC without -E}} %{!Q:-quiet} %{nostdinc*} %{C} %{CC} %{v} %{I*&F*} %{P} %I %{MD:-MD %{!o:%b.d}%{o*:%.d%*}} %{MMD:-MMD %{!o:%b.d}%{o*:%.d%*}} %{M} %{MM} %{MF*} %{MG} %{MP} %{MQ*} %{MT*} %{!E:%{!M:%{!MM:%{!MT:%{!MQ:%{MD|MMD:%{o*:-MQ %*}}}}}}} %{remap} %{g3|ggdb3|gstabs3|gcoff3|gxcoff3|gvms3:-dD} %{H} %C %{D*&U*&A*} %{i*} %Z %i %{fmudflap:-D_MUDFLAP -include mf-runtime.h} %{fmudflapth:-D_MUDFLAP -D_MUDFLAPTH -include mf-runtime.h} %{E|M|MM:%W{o*}}

*trad_capable_cpp:
cc1 -E %{traditional|ftraditional|traditional-cpp:-traditional-cpp}

*cc1:
%(cc1_cpu) %{profile:-p}

*cc1_options:
%{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are incompatible}} %1 %{!Q:-quiet} %{!dumpbase:-dumpbase %B} %{d*} %{m*} %{a*} %{fcompare-debug-second:%:compare-debug-auxbase-opt(%b)}  %{!fcompare-debug-second:%{c|S:%{o*:-auxbase-strip %*}%{!o*:-auxbase %b}}}%{!c:%{!S:-auxbase %b}}  %{g*} %{O*} %{W*&pedantic*} %{w} %{std*&ansi&trigraphs} %{v:-version} %{pg:-p} %{p} %{f*} %{undef} %{Qn:-fno-ident} %{--help:--help} %{--target-help:--target-help} %{--help=*:--help=%(VALUE)} %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}} %{fsyntax-only:-o %j} %{-param*} %{fmudflap|fmudflapth:-fno-builtin -fno-merge-constants} %{coverage:-fprofile-arcs -ftest-coverage}

*cc1plus:


*link_gcc_c_sequence:
%{static:--start-group} %G %L %{static:--end-group}%{!static:%G}

*link_ssp:
%{fstack-protector:}

*endfile:
%{ffast-math|funsafe-math-optimizations:crtfastmath.o%s}    %{mpc32:crtprec32.o%s}    %{mpc64:crtprec64.o%s}    %{mpc80:crtprec80.o%s}    %{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s

*link:
%{!static:--eh-frame-hdr} -m %(link_emulation) %{shared:-shared}   %{!shared:     %{!ibcs:       %{!static: 	%{rdynamic:-export-dynamic} 	%{!dynamic-linker:-dynamic-linker %(dynamic_linker)}} 	%{static:-static}}}

*lib:
%{pthread:-lpthread}    %{shared:-lc}    %{!shared:%{mieee-fp:-lieee} %{profile:-lc_p}%{!profile:-lc}}

*mfwrap:
 %{static: %{fmudflap|fmudflapth:  --wrap=malloc --wrap=free --wrap=calloc --wrap=realloc --wrap=mmap --wrap=munmap --wrap=alloca} %{fmudflapth: --wrap=pthread_create}} %{fmudflap|fmudflapth: --wrap=main}

*mflib:
%{fmudflap|fmudflapth: -export-dynamic}

*link_gomp:


*libgcc:
%{static|static-libgcc:-lgcc -lgcc_eh}%{!static:%{!static-libgcc:%{!shared-libgcc:-lgcc --as-needed -lgcc_s --no-as-needed}%{shared-libgcc:-lgcc_s%{!shared: -lgcc}}}}

*startfile:
%{!shared: %{pg|p|profile:gcrt1.o%s;pie:Scrt1.o%s;:crt1.o%s}}    crti.o%s %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s}

*switches_need_spaces:
o

*cross_compile:
1

*version:
4.5.1

*multilib:
. ;

*multilib_defaults:


*multilib_extra:


*multilib_matches:


*multilib_exclusions:


*multilib_options:


*linker:
collect2

*linker_plugin_file:


*lto_wrapper:


*lto_gcc:


*lto_libgcc:


*link_libgcc:
%D

*md_exec_prefix:


*md_startfile_prefix:


*md_startfile_prefix_1:


*startfile_prefix_spec:


*sysroot_spec:
--sysroot=%R

*sysroot_suffix_spec:


*sysroot_hdrs_suffix_spec:


*cc1_cpu:
%{mcpu=*:-mtune=%* %n`-mcpu=' is deprecated. Use `-mtune=' or '-march=' instead.
} %<mcpu=* %{mintel-syntax:-masm=intel %n`-mintel-syntax' is deprecated. Use `-masm=intel' instead.
} %{msse5:-mavx %n'-msse5' was removed.
} %{mno-intel-syntax:-masm=att %n`-mno-intel-syntax' is deprecated. Use `-masm=att' instead.
}%{march=native:%<march=native %:local_cpu_detect(arch)   %{!mtune=*:%<mtune=native %:local_cpu_detect(tune)}} %{mtune=native:%<mtune=native %:local_cpu_detect(tune)}

*link_emulation:
elf_i386

*dynamic_linker:
%{muclibc:%{mglibc:%e-mglibc and -muclibc used together}/lib/ld-uClibc.so.0;:/lib/ld-linux.so.2}

*link_command:
%{!fsyntax-only:%{!c:%{!M:%{!MM:%{!E:%{!S:    %(linker)     %{fuse-linker-plugin:     -plugin %(linker_plugin_file)     -plugin-opt=%(lto_wrapper)     -plugin-opt=%(lto_gcc)     %{static|static-libgcc:-plugin-opt=-pass-through=%(lto_libgcc)}	    %{static:-plugin-opt=-pass-through=-lc}	    %{O*:-plugin-opt=-O%*}     %{w:-plugin-opt=-w}     %{f*:-plugin-opt=-f%*}     %{m*:-plugin-opt=-m%*}     %{v:-plugin-opt=-v}     }     %{flto} %{fwhopr} %l %{pie:-pie} %X %{o*} %{A} %{d} %{e*} %{m} %{N} %{n} %{r}    %{s} %{t} %{u*} %{x} %{z} %{Z} %{!A:%{!nostdlib:%{!nostartfiles:%S}}}    %{static:} %{L*} %(mfwrap) %(link_libgcc) %o    %{fopenmp|ftree-parallelize-loops=*:%:include(libgomp.spec)%(link_gomp)} %(mflib)    %{fprofile-arcs|fprofile-generate*|coverage:-lgcov}    %{!nostdlib:%{!nodefaultlibs:%(link_ssp) %(link_gcc_c_sequence)}}    %{!A:%{!nostdlib:%{!nostartfiles:%E}}} %{T*} }}}}}}

--
For unsubscribe information see http://sourceware.org/lists.html#faq

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