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++


On Sun, Jun 28, 2009 at 1:24 PM, NightStrike<nightstrike@gmail.com> wrote:
> On Sat, Jun 20, 2009 at 2:05 AM, Ian Lance Taylor<iant@google.com> wrote:
>> It is sometimes useful to link statically against libstdc++ without
>> doing a full static link. ?In particular, when building gcc with C++,
>> I think this is what we want to do. ?We do not want to worry about
>> ensuring that gcc is able to find the right version of libstdc++ when
>> gcc itself is run.
>>
>> This patch adds a -static-libstdc++ option to the g++ driver. ?This is
>> conceptually similar to the static-libgfortran option supported by the
>> gfortran driver.
>>
>> I suppose this patch requires approval from the C++ frontend
>> maintainers. ?And/or, perhaps, the libstdc++ maintainers or the build
>> system maintainers. ?I'm not sure where this falls.
>>
>> David, I adjusted your LIBSTDCXX_STATIC patch slightly: it now only
>> adds LIBSTDCXX_STATIC if it adds LIBSTDCXX. ?That seemed to me to be
>> the desired behaviour. ?Please let me know if this breaks anything.
>>
>> Bootstrapped and ran C++ testsuite on x86_64-unknown-linux-gnu. ?OK
>> for mainline.
>>
>> Ian
>>
>>
>> gcc/ChangeLog:
>>
>> 2009-06-19 ?Ian Lance Taylor ?<iant@google.com>
>>
>> ? ? ? ?* doc/invoke.texi (Option Summary): Mention -static-libstdc++.
>> ? ? ? ?(Link Options): Document -static-libstdc++.
>>
>> gcc/cp/ChangeLog:
>>
>> 2009-06-19 ?Ian Lance Taylor ?<iant@google.com>
>>
>> ? ? ? ?* g++spec.c (SKIPOPT): define.
>> ? ? ? ?(lang_specific_driver): Handle -static-libstdc++. ?Only add
>> ? ? ? ?LIBSTDCXX_STATIC if we add LIBSTDCXX.
>>
>>
>>
>
>
> This patch looks like it was committed here:
>
> http://gcc.gnu.org/ml/gcc-cvs/2009-06/msg00935.html
>
> That was revision 148951.
>
> That revision breaks the linux64 to win64 cross compiler for g++. ?Any
> attempt to use g++ results in output like this:
>
> *** glibc detected *** malloc(): memory corruption (fast):
> 0x00000000005412c0 ***
> *** glibc detected *** malloc(): memory corruption (fast):
> 0x00000000005412a0 ***
> *** glibc detected *** corrupted double-linked list: 0x00000000005412b0 ***
> *** glibc detected *** malloc(): memory corruption (fast):
> 0x00000000005412c0 ***
> *** glibc detected *** malloc(): memory corruption (fast):
> 0x00000000005412a0 ***
> *** glibc detected *** corrupted double-linked list: 0x00000000005412c0 ***
> *** glibc detected *** malloc(): memory corruption (fast):
> 0x00000000005412b0 ***
> *** glibc detected *** malloc(): memory corruption (fast):
> 0x00000000005412b0 ***
> *** glibc detected *** corrupted double-linked list: 0x00000000005412c0 ***
> libtool.m4: error: problem compiling CXX test program
> *** glibc detected *** malloc(): memory corruption (fast):
> 0x00000000005412b0 ***
>

Ping


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