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

Phil Race prr at openjdk.java.net
Fri Mar 26 14:51:26 UTC 2021


On Fri, 26 Mar 2021 10:04:07 GMT, Severin Gehwolf <sgehwolf at openjdk.org> wrote:

>>> Anyone?
>> 
>> I guess I don't understand why this is the right solution.
>> If the symbol -in both cases - is made internal won't that be better ? I can't think why it needs to be exported.
>> Is the AWT one being used by some other client library ? If so may be that other library needs its own.
>> And calling it "jvm" is common so are these the only two ?
>
>> > 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:
> 
> libjavajpeg.a
> liblcms.a
> libfontmanager.a
> libawt_headless.a
> libawt.a
> libharfbuzz.a

The list of libraries doesn't seem to include xawt. Although I'd be astonished if it defined one since it links with awt.
But it also suggests you are only looking at one platform and perhaps that is because the problem is very specific
to your toolchain ? Actually why are you seeing it now and it has not been a problem before ?

-------------

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


More information about the 2d-dev mailing list