public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug bootstrap/50888] New: Bootstrap failure in libjava against latest git glibc
@ 2011-10-27 18:40 jakub at gcc dot gnu.org
  2011-10-27 18:42 ` [Bug bootstrap/50888] " jakub at gcc dot gnu.org
                   ` (15 more replies)
  0 siblings, 16 replies; 17+ messages in thread
From: jakub at gcc dot gnu.org @ 2011-10-27 18:40 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50888

             Bug #: 50888
           Summary: Bootstrap failure in libjava against latest git glibc
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: bootstrap
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: jakub@gcc.gnu.org
                CC: aph@gcc.gnu.org, mark@gcc.gnu.org, tromey@gcc.gnu.org


./.libs/libgcj.so: undefined reference to `__cxa_call_unexpected'
collect2: ld returned 1 exit status
make[3]: *** [jv-convert] Error 1
make[3]: *** Waiting for unfinished jobs....
./.libs/libgcj.so: undefined reference to `__cxa_call_unexpected'
collect2: ld returned 1 exit status
make[3]: *** [gcj-dbtool] Error 1

The problem is that libgcj is compiled with C++ and -fnon-call-exceptions, but
doesn't link against -lstdc++ nor -lsupc++.  <ctype.h> in glibc recently
changed, so that isspace in C++ is now an inline function:
# define __isctype_f(type) \
  __extern_inline int                                                         \
  is##type (int __c) __THROW                                                  \
  {                                                                           \
    return (*__ctype_b_loc ())[(int) (__c)] & (unsigned short int) _IS##type; \
  }
...
__isctype_f (space)

While __ctype_b_loc, a function pointer, has throw () on it, the isspace inline
has it too.  So normally not a problem.  But with -fnon-call-exceptions we end
up with __cxa_call_unexpected call just in case __ctype_b_loc fn pointer would
be invalid (it is not, but gcc doesn't know it).

2011-10-27  Jakub Jelinek  <jakub@redhat.com>

        * prims.cc (__NO_CTYPE): For glibc define this before including
        ctype.h.

--- libjava/prims.cc    2009-04-28 06:02:30.000000000 +0200
+++ libjava/prims.cc    2011-10-27 12:57:42.748752380 +0200
@@ -38,6 +38,14 @@ details.  */
 #endif

 #ifndef DISABLE_GETENV_PROPERTIES
+#ifdef __GLIBC__
+/* glibc 2.15+ provides even for C++ inline optimized ::isspace etc.
+   Unfortunately those inlines are throw (), and call a function pointer
+   (which is throw () too, but with -fnon-call-exceptions this results
+   in a __cxa_call_unexpected call.  This macro disables the optimized
+   version.  */
+#define __NO_CTYPE 1
+#endif
 #include <ctype.h>
 #include <java-props.h>
 #define PROCESS_GCJ_PROPERTIES process_gcj_properties()

works for me but might be considered too hackish (__NO_CTYPE results in macro
says to <ctype.h> it should optimize isspace etc.).

Other alternatives would be to link -lsupc++ in, or replace use of isspace (c)
with memchr (" \t\n\r\v", c, 5) != NULL (the standard POSIX "C" locale isspace
characters), or use safe-ctype, etc.


^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2014-04-15 23:01 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-10-27 18:40 [Bug bootstrap/50888] New: Bootstrap failure in libjava against latest git glibc jakub at gcc dot gnu.org
2011-10-27 18:42 ` [Bug bootstrap/50888] " jakub at gcc dot gnu.org
2011-10-27 18:54 ` mark at gcc dot gnu.org
2011-10-27 23:15 ` mark at gcc dot gnu.org
2011-10-31  5:30 ` christian.joensson at gmail dot com
2011-11-16 21:18 ` pinskia at gcc dot gnu.org
2011-11-21 19:22 ` aph at gcc dot gnu.org
2011-11-22 15:37 ` jakub at gcc dot gnu.org
2011-11-22 18:34 ` aph at gcc dot gnu.org
2011-11-23 13:35 ` jakub at gcc dot gnu.org
2011-11-24  7:27 ` jakub at gcc dot gnu.org
2011-11-24  8:26 ` jakub at gcc dot gnu.org
2011-11-24  8:42 ` jakub at gcc dot gnu.org
2011-11-24  9:22 ` jakub at gcc dot gnu.org
2011-11-24  9:24 ` jakub at gcc dot gnu.org
2012-07-11  6:03 ` xguo at gcc dot gnu.org
2014-04-15 23:01 ` wade.colson at aol dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).