Bug#912631: liblwjgl-java-jni: Missing symbols in liblwjgl.so, stretch-sid, 386, amd64, mips

Le Gall Guillaume bill.legall at orange.fr
Wed Dec 26 20:10:12 GMT 2018


Dear package maintainer and Petr Cvek,


I have the same issue. And it seems to me the provided description is 
correct: some of the C files do not get compiled and included into the 
LWJGL native library.


I think the problematic file is "platform_build/linux_ant/build.xml". It 
has a "compiledeb" target (after applying all patches, and especially 
"allarchs.patch"), but this target forgets to include in the build some 
of the files in subdirectories of "src/native/common" and 
"src/native/linux". I believe the thing to do here is to add them back 
into the native library while still leaving aside the "opengles" subfolders.


Please see the attached patch file for more details about the proposed 
solution. Please also note that "debian/patches/javah.patch" conflicts 
with what I propose, as some of the C headers do not get generated 
anymore. So you should disable it if you want to try what I suggest.


Also, this "compiledeb" target (still in the 
"platform_build/linux_ant/build.xml" file) has another issue, I think. 
It does not ask gcc to link against the "jawt" library, while targets 
from upstream rules do. However it gives a nice library path to 
"libjawt.so", with "-L${java.home}/lib/${os.arch}". So you can see in 
the patch I propose I also added back the "-ljawt" argument to the gcc 
command line.


After doing these two changes to this file, I have a usable LWJGL. But 
my test application (something I could share, if needed) still had 
issues, because "libjawt.so" is not accessible to ld. After building the 
package, from root folder:

$ ldd libs/linux/liblwjgl.so | grep libjawt.so

     libjawt.so => not found


So the folder "/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64" (on my 
machine, expanded from "${java.home}/lib/${os.arch}") should be 
accessible to the linker. Either by being in the LD_LIBRARY_PATH 
environment variable, or better, by being in a file in 
"/etc/ld.so.conf.d/". But I am not sure which package should do that.


Hope this helps, and let me know if I can help with this issue.


Regards,

Guillaume


-----

Versions used:

LWJGL: liblwjgl-java-jni_2.9.3+dfsg-4

Archithecture: amd64

OpenJDK 8: 8u181-b13-2~deb9u1

Ant: 1.10.5-2

-----


On Thu, 01 Nov 2018 19:28:15 -0500 Petr Cvek <petrcvekcz at gmail.com> wrote:

 > Package: liblwjgl-java-jni
 > Version: 2.9.3+dfsg-1
 > Severity: important
 >
 > Hello,
 >
 > I was trying to set up my debian for a vintage minecraft test play 
and I had to use not bundled
 > lwjgl library for it (unsupported architecture). After a quick setup 
the java failed with unsatisfied
 > link error because of missing symbols in native library. A look into 
liblwjgl.so and a compare with
 > the bundled version revealed a big differences in library size. The 
debian one is about 37kB and
 > the bundled one is over 300kB. Some of the missing symbols are: 
getJNIVersion, nLockAWT and many
 > openGL wrappers. The symbols/native methods calls are present in java 
classes.
 >
 > The problem doesn't depend on system architecture (verified on 386, 
amd64 and mipsel) and exists
 > on actual stretch and sid (probably doesn't depend on this too).
 >
 > I've tried to compile my local version, but the problem doesn't get 
resolved. I suppose the problem
 > is in original build system. I've tried to fix the problem with 
copying all .c and .h files into
 > a single directory at src/native/linux, which resulted in the working 
version of the library.
 >
 > It seems the build system ignores the (sub)directories other than 
src/native/linux. I'm not familiar
 > with java development (and ant) nor patching in debian build system 
so I'm not able to make a fix.
 >
 >
 > Petr Cvek
 >
 > -- System Information:
 > Debian Release: 9.5
 > APT prefers stable-updates
 > APT policy: (500, 'stable-updates'), (500, 'stable')
 > Architecture: amd64 (x86_64)
 > Foreign Architectures: mipsel
 >
 > Kernel: Linux 4.9.0-7-amd64 (SMP w/2 CPU cores)
 > Locale: LANG=en_US.utf8, LC_CTYPE=en_US.utf8 (charmap=UTF-8), 
LANGUAGE=en_US.utf8 (charmap=UTF-8)
 > Shell: /bin/sh linked to /bin/dash
 > Init: systemd (via /run/systemd/system)
 >
 > Versions of packages liblwjgl-java-jni depends on:
 > ii libc6 2.24-11+deb9u3
 > ii libx11-6 2:1.6.4-3
 > ii libxcursor1 1:1.1.14-1+deb9u1
 > ii libxrandr2 2:1.5.1-1
 > ii libxxf86vm1 1:1.1.4-1+b2
 >
 > liblwjgl-java-jni recommends no packages.
 >
 > liblwjgl-java-jni suggests no packages.
 >
 > -- no debconf information
 >
 >

-------------- next part --------------
A non-text attachment was scrubbed...
Name: add-missing-symbols-in-native-lib.patch
Type: text/x-patch
Size: 2042 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/pkg-java-maintainers/attachments/20181226/b93a3509/attachment.bin>


More information about the pkg-java-maintainers mailing list