Hi, The version section gets stripped because the toolchain links with --as-needed and libjawt.so is not using any libc symbols. The loader behaviour that allows loading an unversioned symbol instead of a specific version looks like a bug.
Unfortunately, I can not think of any other solution other than keeping map files for backward compatibility. The JNI code linked against unversioned symbols will continue to work fine after this change. We do not have to maintain compatibility mapfiles, as all new symbols will be unversioned.We will have to update those only if functions in jdk8u change. I wonder if it is an acceptable change? Best Regards, Vladimir. On Thu, Jun 29, 2023 at 7:06 PM David Holmes <david.hol...@oracle.com> wrote: > > Hi Vladimir, > > This is not the first time this has come up: > > https://mail.openjdk.org/pipermail/build-dev/2020-February/026730.html > > but no real resolution. > > David > > On 27/06/2023 6:31 pm, Vladimir Petko wrote: > > Dear Maintainers, > > > > There is a bug[1] submitted in Debian that a number of games crash > > with the assertion > > > > Inconsistency detected by ld.so: dl-lookup.c: 107: check_match: > > Assertion `version->filename == NULL || ! _dl_name_match_p > > (version->filename, map)' failed! > > > > The investigation points to JAWT_GetAWT function from libjawt.so. > > > > In Java 8 the build system supplied a mapfile which set the symbol > > version for JAWT_GetAWT. It is no longer the case for Java 11+ due > > to JDK-8200178. > > If the native library was linked against Java 8 (e.g. lwjgl 2.x) then > > it would be linking against the versioned symbol. > > The assertion in the loader only fires when the version section > > (.gnu.version) is absent, otherwise the loader provides the default > > version of the function. This allows Temurin builds to work with those > > games. > > > > I wonder if some of the map files could be reverted for the > > compatibility reasons with Java 8, or it is not a recommended > > approach? > > > > [1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1031521