This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix libjava build on current git glibc (PR bootstrap/50888)
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Tom Tromey <tromey at redhat dot com>
- Cc: Andrew Haley <aph at redhat dot com>, Mark Wielaard <mjw at redhat dot com>, gcc-patches at gcc dot gnu dot org, Ulrich Drepper <drepper at gmail dot com>
- Date: Thu, 24 Nov 2011 08:09:36 +0100
- Subject: Re: [PATCH] Fix libjava build on current git glibc (PR bootstrap/50888)
- References: <20111123203813.GE27242@tyan-ft48-01.lab.bos.redhat.com> <m37h2qwmzx.fsf@fleche.redhat.com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Wed, Nov 23, 2011 at 02:24:34PM -0700, Tom Tromey wrote:
> >>>>> "Jakub" == Jakub Jelinek <jakub@redhat.com> writes:
>
> Jakub> As discussed in the PR, libjava fails to build against latest
> Jakub> glibc, because prims.cc is compiled with -fnon-call-exceptions,
> Jakub> uses ctype.h and libgcj isn't linked against -lsupc++ or -lstdc++.
> Jakub> isspace in latest glibc is a throw() inline that calls a throw()
> Jakub> function pointer. Unfortunately, with -fnon-call-exceptions
> Jakub> the compiler doesn't have a guarantee that the function pointer
> Jakub> that is being called is always valid (it is in glibc) and thus adds
> Jakub> a __cxa_call_unexpected call if the call would throw and that symbol
> Jakub> isn't satisfied during linking of libgcj and apps against it.
>
> BTW, it seems odd to me that this function is marked throw() instead of
> __attribute__((nothrow)). The latter would avoid this problem entirely.
Well, appart from -fnon-call-exceptions it should make zero difference.
I guess glibc uses throw() because it is a C++ standard feature, not an
extension.
Jakub