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 <petrcve...@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
>
>

Description: Compile and add to library missing object files
 Some C files present in "src/native/common", and "src/native/linux"
 were not included in the native library build. This patch should include them
 back.
 .
 Also, when building the Debian package, the library "jawt", which is a
 dependency, was missing as well when building the native library.
Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=912631#5
Last-Update: 2018-12-26

--- lwjgl-2.9.3+dfsg.orig/platform_build/linux_ant/build.xml
+++ lwjgl-2.9.3+dfsg/platform_build/linux_ant/build.xml
@@ -6,7 +6,7 @@
 	<property name="libname64" value="liblwjgl64.so"/>
 	<property name="libs32" value="-L/usr/X11R6/lib -L/usr/X11/lib -lm -lX11 -lXext -lXcursor -lXrandr -lXxf86vm -lpthread -L${java.home}/lib/i386 -ljawt" />
 	<property name="libs64" value="-L/usr/X11R6/lib64 -L/usr/X11/lib64 -lm -lX11 -lXext -lXcursor -lXrandr -lXxf86vm -lpthread -L${java.home}/lib/amd64 -ljawt" />
-	<property name="libs" value="-L/usr/X11R6/lib -L/usr/X11/lib -lm -lX11 -lXcursor -lXrandr -lXxf86vm -L${java.home}/lib/${os.arch}" />
+	<property name="libs" value="-L/usr/X11R6/lib -L/usr/X11/lib -lm -lX11 -lXcursor -lXrandr -lXxf86vm -L${java.home}/lib/${os.arch} -ljawt" />
 	<property name="cflags32" value="-O2 -Wall -c -fPIC -std=c99 -Wunused"/>
 
 	<target name="clean">
@@ -148,8 +148,12 @@
 			<arg value="-I${native}/linux/opengl"/>
 			<mapper type="glob" from="*.c" to="*.o"/>
 			<fileset dir="${native}/linux" includes="*.c"/>
+			<fileset dir="${native}/linux/opengl" includes="*.c"/>
 			<fileset dir="${native}/generated" includes="*.c"/>
-			<fileset dir="${native}/common" includes="*.c"/>
+			<fileset dir="${native}/common" includes="**/*.c" excludes="opengles/**/*"/>
+			<fileset dir="${native}/generated/openal" includes="*.c"/>
+			<fileset dir="${native}/generated/opencl" includes="*.c"/>    		
+			<fileset dir="${native}/generated/opengl" includes="*.c"/>
 		</apply>
 		<apply dir="." parallel="true" executable="gcc" failonerror="true">
 			<srcfile/>

Reply via email to