Amker.Cheng wrote:
I want to build a c++ cross-toolchain from gcc source code. which I'm not sure is that libstdc++ depends on libc?
Yes, it depends on the "custom C library" for the target, although that is usually called as "standard C library" :(
In my experiment, I found that it is only possible to built c++ compiler after libc(uclibc, newlib,...) is compiled and installed.
That is not true. Producing the C++ compiler parts ('cc1plus', 'g++') shouldn't require any information about the target C library! Even producing "everything" for a cross GCC for an newlib-using embedded target shouldn't require anything else than the generic newlib headers being copied from 'newlib/libc/include' in the newlib sources. So 'libstdc++' should succeed without a prebuilt newlib for the target ! Furthermore it is nonsense that the target C library should be compiled from its sources during the GCC build! The expectation is that it already exists on the target system and one only copies it from there onto the cross host.
I did not find any clue about this kind of dependency in docs,
The old gcc-2.95 manual still told that the target C library must be provided during a cross GCC build. Just as it must be provided during a native GCC build, it this it has double meaning, it is both the C library for the $host and the C library for the $target. In a cross GCC build these are two separate required C libraries.