This is the mail archive of the gcc@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]

Re: Targets using implicit extern "C"


Joe Buck wrote:

Right, but you don't need the answer to the question until it's time to
build libstdc++, and you can't build libstdc++ without a C library.
So can't the test be deferred until that point?

I don't think that's a good idea. People build compilers without headers frequently, and this really can be sensibly defaulted in the configuration, perhaps with a configure option to override. Also, the presence of __cplusplus in some system headers isn't enough to make sure that the headers are really C++-aware; I've seen systems with a few such headers, but not complete awareness.


The argument that there's no right answer for *-elf seems odd to me. We already make assumptions for *-elf that may not be correct for all systems, like how to run static initializers, etc. We certainly can't build libstdc++ without knowing about the target C library.

I'd be willing to consider the argument that this should actually be a -f switch, with a default determined by the target triplet. That would make it possible to use a *-elf compiler with different headers/libraries that you got from somewhere without having to rebuild the compiler, which seems better than any autoconfery.

--
Mark Mitchell
CodeSourcery, LLC
mark@codesourcery.com
(916) 791-8304


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