stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Sebor <se...@roguewave.com>
Subject Re: -nostdinc++ gcc option is required?
Date Tue, 16 Oct 2007 14:13:49 GMT
Farid Zaripov wrote:
>> -----Original Message-----
>> From: Martin Sebor [mailto:sebor@roguewave.com] 
>> Sent: Monday, October 15, 2007 1:31 AM
>> To: stdcxx-dev@incubator.apache.org
>> Subject: Re: -nostdinc++ gcc option is required?
>>
>>>   As for gcc, the all configuration tests which are uses typeid 
>>> operator are failed to compile with error: must #include <typeinfo> 
>>> before using typeid
>> Right. We need to deal with this, certainly if it's affecting 
>> the correctness or functionality of our library (in which 
>> case, we need a test case :) 
> 
>   I've tried to make config with and without -nostdinc++ option
> using gcc 4.2.0/Cygwin and no difference was detected in config.h.

We need to think about this carefully. It's important that we use
the same options when configuring the library as when building or
using it. If we need access to the native headers only at a single
stage of the build process it doesn't make sense to risk exposing
them during other stages. I see no reason not to drop -nostdinc++
when compiling the config test(s) where it causes trouble but I'm
not comfortable dropping it altogether.

If you'd like to do this, since we have no general interface for
removing command line options for specific config tests, the one
I've been contemplating extends the "LDOPTS = <linker-options>"
syntax understood by GNUmakefile.cfg to also accept LDFLAGS and
the -= (and possibly also +=) operator to remove the named set
of options. I.e., in the TYPEINFO.cpp test, we would add
a comment like so:

     // CPPFLAGS -= -nostdinc++

which the config infrastructure would interpret to as a request
to remove the option from CPPFLAGS. The only issue to resolve
is how to deal with conditionals (if the option is to be removed
only under specific circumstances). I don't have any idea how to
do that at this time.

Martin

Mime
View raw message