This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH RFA: Add -static-libstdc++ option to g++
- From: Dave Korn <dave dot korn dot cygwin at googlemail dot com>
- To: Ian Lance Taylor <iant at google dot com>
- Cc: Dave Korn <dave dot korn dot cygwin at googlemail dot com>, gcc-patches at gcc dot gnu dot org, edelsohn at gnu dot org
- Date: Sat, 29 Aug 2009 00:24:10 +0100
- Subject: Re: PATCH RFA: Add -static-libstdc++ option to g++
- References: <m3vdmrxww8.fsf@pepe.airs.com> <4A98483B.5080506@gmail.com> <m3ljl3vcvh.fsf@google.com>
Ian Lance Taylor wrote:
> Dave Korn <dave.korn.cygwin@googlemail.com> writes:
>
>> I'm finding this aspect of it slightly problematical:
>>
>>> +/* Skip this option. */
>>> +#define SKIPOPT (1<<4)
>>> + else if (strcmp (argv[i], "-static-libstdc++") == 0)
>>> + {
>>> + library = library >= 0 ? 2 : library;
>>> + args[i] |= SKIPOPT;
>>> + }
>> I need to do things differently in my LINK_SPEC according to whether
>> libstdc++ is being linked statically or shared. I can use "%{!static: ...}",
>> but "%{!static-libstdc++: ...}" doesn't of course work because the option is
>> removed by this processing before the specs get a chance to see it, so I can't
>> catch the mixed-shared-libgcc-and-static-libstdc++ combination.
>>
>> Does any obvious workaround spring to mind?
>
> I suppose you could modify the default spec to ignore -static-libstdc++
> and then have g++spec.c keep it.
I'm not sure which default spec you're referring to?
cheers,
DaveK