This is the mail archive of the gcc-patches@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: PATCH RFA: Add -static-libstdc++ option to g++


Ralf Wildenhues <Ralf.Wildenhues@gmx.de> writes:

> * Ian Lance Taylor wrote on Sat, Jun 20, 2009 at 08:05:43AM CEST:
>> --- cp/g++spec.c	(revision 148727)
>> +++ cp/g++spec.c	(working copy)
>
>> @@ -63,7 +65,8 @@ lang_specific_driver (int *in_argc, cons
>>    /* This is a tristate:
>
> No, this isn't a tristate any more.  :-)

Thanks.  Fixed to say "What to do with libstdc++:".


>> @@ -200,9 +206,15 @@ lang_specific_driver (int *in_argc, cons
>>  		 cause a warning.  */
>>  	      library = -1;
>>  	    }
>> -	  else if (strcmp (argv[i], "-static-libgcc") == 0
>> -		   || strcmp (argv[i], "-static") == 0)
>> +	  else if (strcmp (argv[i], "-static") == 0)
>> +	    static_link = 1;
>> +	  else if (strcmp (argv[i], "-static-libgcc") == 0)
>>  	    shared_libgcc = 0;
>> +	  else if (strcmp (argv[i], "-static-libstdc++") == 0)
>> +	    {
>> +	      library = library >= 0 ? 2 : library;
>
> For tools like libtool it would be nice to know for certain that
>   -nodefaultlibs -static-libstdc++
>
> (or -nostdlib) does not add libstdc++ to the link.  Actually, for
> libtool it would be nice if it did add libstdc++ to the link statically,
> but that would be a deviation from current practice with the other
> -{static,shared}-*lib flags.  I guess the fact that -nodefaultlibs and
> -nostdlib overrides these flags could be a separate, documentation-only
> patch (and I suppose I can write it, if there is agreement that that is
> the semantics desired by GCC).

I think that is the desired semantics: -nodefaultlibs and -nostdlib
override -static-libstdc++, not vice-versa.

Ian


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