[OpenJDK 2D-Dev] RFR: 8264047: Duplicate global variable 'jvm' in libjavajpeg and libawt

Severin Gehwolf sgehwolf at openjdk.java.net
Fri Mar 26 10:07:26 UTC 2021

On Thu, 25 Mar 2021 18:20:36 GMT, Phil Race <prr at openjdk.org> wrote:

> > Anyone?
> I guess I don't understand why this is the right solution.

Thanks for the feedback. I'm open to other approaches. I'm by no means an expert in this area, so you probably know better what the best solution would be.

> If the symbol -in both cases - is made internal won't that be better ? I can't think why it needs to be exported.

I don't know if that'll help the static linking case, I'll give it a try.

> Is the AWT one being used by some other client library ? If so may be that other library needs its own.

I don't think it is. `libawt.so` and `libjavajpeg.so` have each their own. The problem starts when static libraries of them `libawt.a` and `libjavajpeg.a` get linked into one executable. Then we end up with a name clash on the `jvm` symbol. See the bug for some details.

> And calling it "jvm" is common so are these the only two ?

Apparently so. At least no other conflicts were noticed when the following client libraries are in the mix:



PR: https://git.openjdk.java.net/jdk/pull/3155

More information about the 2d-dev mailing list