[Bug libgcj/71757] New: libgcj: unknown symbol __cxa_throw_bad_array_new_length
timo.teras at iki dot fi
gcc-bugzilla@gcc.gnu.org
Mon Jul 4 16:29:00 GMT 2016
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71757
Bug ID: 71757
Summary: libgcj: unknown symbol
__cxa_throw_bad_array_new_length
Product: gcc
Version: 6.1.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: libgcj
Assignee: unassigned at gcc dot gnu.org
Reporter: timo.teras at iki dot fi
Target Milestone: ---
The root of the problem is that libjava (libgcj) is built with raw_cxx=true.
Basically the C++ library is built and linked with xgcc (not xg++).
Earlier this was not a problem as it uses limited set of c++ things.
However, gcc 6.1.0 changed the default to -std=gnu++14. This changed certain
allocation methods to raise exceptions by default. Internally the compiler uses
__cxa_throw_bad_array_new_length from libstdc++ to do this. Thus changing the
language default added a new dependency against this symbol. This together with
not using xg++ makes the link stage not pick up libstdc++ as dependency.
The result is:
libgcj.so: undefined reference to `__cxa_throw_bad_array_new_length'
As a quick workaround the adding back -std=gnu++98 to libjava/configure.host's
libgcj_cxxflags made things build again for me.
More information about the Gcc-bugs
mailing list