Patch to enable libgcj.dll for MinGW

TJ Laurenzo tlaurenzo@gmail.com
Fri Sep 9 03:31:00 GMT 2005


Could one of you provide some guidance on the preferred way to do
this?  gjavah.c is part of the bootstrap sequence.  When
bootstrapping, the build treats any warnings as errors, so we can't
have any unused functions.  My original patch which removed all of
this stuff built properly because everything was removed.  However, if
I just do an #ifdef ... around some of the code we are going to have
at least one unused function and thus a compile error during
bootstrap.  I could obviously put the same ifdef in multiple places,
but that gets ugly.  Should I break the check out into a function "int
is_not_pe_coff()" and use that in a normal if statement to isolate the
behavior in question?

Thanks.
TJ

On 9/8/05, Andrew Haley <aph@redhat.com> wrote:
> Danny Smith writes:
>  >
>  > ----- Original Message -----
>  > From: "Andrew Haley">
>  > Sent: Thursday, 8 September 2005 22:48
>  > >
>  > > Interestingly, cygwin.h includes this:
>  > >
>  > > /* Binutils does not handle weak symbols from dlls correctly.  For now,
>  > >    do not use them unnecessarily in gthr-posix.h.  */
>  > > #define GTHREAD_USE_WEAK 0
>  > >
>  > > but mingw32 doesn't.  I assume that mingw32 binutils has exactly the
>  > > same bug, so this is perhaps a mistake.  Danny?
>  >
>  >
>  > MinGW doesn't  use gthr-posix.h, so there is no need for the define.
>  >
>  > The reason why " Binutils does not handle weak symbols from dlls correctly."
>  > is because dlls are normally accessed via an import lib, which is a static
>  > archive, with effectively one export per member object.  Weak symbols are not
>  > resolved by an archive member unless the member is needed to resolve a "strong"
>  > undef.  (as per SVR4 ABI)
>  >
>  > The bug is that __attribute__((weak)) on PE-COFF targets, should actually be
>  > __attribute__((weak ("search" ))) where "search" indicates what type of objects
>  > to search.
> 
> Thanks very much for the info.  One really weird thing is that I can't
> find a target-specific #define for PE-COFF anywhere.  That's OK,
> because we can use ! OBJECT_FORMAT_ELF, but it seems a bit weird.
> 
> Andrew.
> 
> 
>



More information about the Java mailing list