g++ compiled programs that link with Java HotSpot VM core dump
John Vickers
John.Vickers@pacemicro.com
Wed Dec 1 08:30:00 GMT 1999
Alexandre Oliva wrote:
>
> On Nov 29, 1999, Michael Newcomb <michael.p.newcomb@lmco.com> wrote:
>
> > Basically, any program (however simple) that gets linked with
> > the Java HotSpot VM (-ljvm) core dumps at initialization.
>
> A program that uses cout from -lstdc++ is hardly a ``simple'' one;
> there's a lot of code involved in its initialization, and it happens
> that g++ and Sun's C++ refer to the `cout' symbol assuming completely
> different structures.
>
> The only way to work around this problem would be to mangle variable
> names, just like we mangle functions.
>
> Having C++ hidden within libraries is becoming more and more common,
> and, if we intend to be able to link g++-compiled code with such
> libraries, I can't see any other way to go.
>
> Can anybody think of any reason for *not* introducing name mangling in
> variable names with -fnew-abi?
Sharing of variables with non-C++ code. C library code.
Maybe assembler code.
How about mangling only names used to access non-POD ?
This clearly falls down rather badly if one package thinks it's
tweaking a double, and the other thinks it's tweaking a char,
but in that case we're no worse off than in C,
and non-POD mangling would presumably at least catch the 'cout' case.
John.
More information about the Gcc-bugs
mailing list