You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@stdcxx.apache.org by Farid Zaripov <Fa...@epam.com> on 2007/08/02 14:34:11 UTC

[PATCH] fix for STDCXX-507

  Attached is a patch for fix STDCXX-507 issue.

  ChangeLog:

  STDCXX-507
  * i386pe.x-no-rdata: Linker script avoiding .rdata sections.
  * GNUmakefile.exm: Use i386pe.x-no-rdata linker script in dynamic 
builds on Cygwin.
  * GNUmakefile.tst: Ditto.
  * GNUmakefile.bin: Ditto. Don't link locale utility with stdlib.

Farid.


Re: [PATCH] fix for STDCXX-507

Posted by Martin Sebor <se...@roguewave.com>.
Farid Zaripov wrote:
>> -----Original Message-----
>> From: Martin Sebor [mailto:sebor@roguewave.com] 
>> Sent: Friday, August 03, 2007 12:30 AM
>> To: stdcxx-dev@incubator.apache.org
>> Subject: Re: [PATCH] fix for STDCXX-507
>>
>> A few questions:
>>
>> 1. Where does the script come from and are there any licensing
>>     restrictions on incorporating it into stdcxx?
>   I don't think so. I get it by link on page
> http://kde-cygwin.sourceforge.net/kde3/faq.php#0xc000005
> Here
> (http://lists-archives.org/mingw-users/07369-the-application-failed-to-i
> nitializeproperly-0xc0000005.html) 
> I found that this script included into mingw in
> /mingw/usr/lib/ldscripts/.

I *guess* since there's no copyright in the file it might be
okay to use it. Although if it's fixed in a later release of
gcc I wonder if we should document this as a compiler bug,
pointing people to the file on the net, and switch to using
the version of gcc that works.

> 
>> 2. Is the script necessary? I.e., is there a simpler solution,
>>     such as conditionally changing the source code for CygWin
>>     and making the problematic constants non-const?
>   Yes, but how to find this constants?
> 
>> 3. If the answer to (2) is yes, shouldn't the script be used
>>     only for gcc prior to 3.4? From the thread you referenced
>>     in the patch it sounded like the starting with 3.4 gcc
>>     handles this case correctly. Or have I misunderstood?
> 
>   I have gcc 3.4.4 here and problem still exist. And I think it's is
> impossible
> to detect which constants should be located in .data section by compiler
> because the compiler don't knows will be the library linked statically
> or dynamicaly.

IIUC, the constants that have the problem should be namespace
scope pointers to other such symbols defined in the library.
There shouldn't be too many of those. Does the stack trace
provide any clues?

Martin

RE: [PATCH] fix for STDCXX-507

Posted by Farid Zaripov <Fa...@epam.com>.
> -----Original Message-----
> From: Martin Sebor [mailto:sebor@roguewave.com] 
> Sent: Friday, August 03, 2007 12:30 AM
> To: stdcxx-dev@incubator.apache.org
> Subject: Re: [PATCH] fix for STDCXX-507
> 
> A few questions:
> 
> 1. Where does the script come from and are there any licensing
>     restrictions on incorporating it into stdcxx?
  I don't think so. I get it by link on page
http://kde-cygwin.sourceforge.net/kde3/faq.php#0xc000005
Here
(http://lists-archives.org/mingw-users/07369-the-application-failed-to-i
nitializeproperly-0xc0000005.html) 
I found that this script included into mingw in
/mingw/usr/lib/ldscripts/.

> 2. Is the script necessary? I.e., is there a simpler solution,
>     such as conditionally changing the source code for CygWin
>     and making the problematic constants non-const?
  Yes, but how to find this constants?

> 3. If the answer to (2) is yes, shouldn't the script be used
>     only for gcc prior to 3.4? From the thread you referenced
>     in the patch it sounded like the starting with 3.4 gcc
>     handles this case correctly. Or have I misunderstood?

  I have gcc 3.4.4 here and problem still exist. And I think it's is
impossible
to detect which constants should be located in .data section by compiler
because the compiler don't knows will be the library linked statically
or dynamicaly.

Farid.

Re: [PATCH] fix for STDCXX-507

Posted by Martin Sebor <se...@roguewave.com>.
Farid Zaripov wrote:
>  Attached is a patch for fix STDCXX-507 issue.

Wow, tricky stuff!

A few questions:

1. Where does the script come from and are there any licensing
    restrictions on incorporating it into stdcxx?

2. Is the script necessary? I.e., is there a simpler solution,
    such as conditionally changing the source code for CygWin
    and making the problematic constants non-const?

3. If the answer to (2) is yes, shouldn't the script be used
    only for gcc prior to 3.4? From the thread you referenced
    in the patch it sounded like the starting with 3.4 gcc
    handles this case correctly. Or have I misunderstood?

Martin

> 
>  ChangeLog:
> 
>  STDCXX-507
>  * i386pe.x-no-rdata: Linker script avoiding .rdata sections.
>  * GNUmakefile.exm: Use i386pe.x-no-rdata linker script in dynamic 
> builds on Cygwin.
>  * GNUmakefile.tst: Ditto.
>  * GNUmakefile.bin: Ditto. Don't link locale utility with stdlib.
> 
> Farid.
>