RFR: 8328614: hsdis: dlsym can't find decode symbol [v2]

Andrew Haley aph at openjdk.org
Thu Apr 4 16:33:08 UTC 2024


On Mon, 25 Mar 2024 09:11:40 GMT, Magnus Ihse Bursie <ihse at openjdk.org> wrote:

> > And neither should we compile or link it with "-fvisibility=hidden". That is the root of this problem.
> 
> If you suggest that we should not compile hsdis with hidden visibility, I disagree.

Yes, that's what I would do. 

> I have been working hard on unifying build of native libraries across the entire product, to fix holes where we have not used a consistent way of compiling and/or linking. There is no reason to tread hsdis differently. If I restore using hidden visibility as an option that all native libraries, except hsdis, must opt in to, then we are just back to square one, and suddenly someone will forget about it. Instead, now we set -fvisibility=hidden in configure so nobody can forget about it.

OK, OK! So please can we get this fix in?

> Robbin proposes to change this to
> 
> ```
> #if defined(_WIN32)
> __declspec(dllexport)
> #elif defined(_GNU_SOURCE)
> __attribute__ ((visibility ("default")))
> #endif
> ```
> 
> My counter-proposal was to replace it with just `JNIEXPORT`. Surely you can't say that is a worse solution?

JNIEXPORT is better, I guess, but it does mean that hsdis is no longer standalone, and IMO it should have a pathological dependency on some JVM header file. That's the problem here.

But really, whatever works is good with me. The last thing I want to do is delay this fix any further.

Robbin has asked "How would you add jni.h ?" Is anyone going to answer?

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

PR Comment: https://git.openjdk.org/jdk/pull/18400#issuecomment-2037672904


More information about the hotspot-compiler-dev mailing list