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

2019-01-02 Thread Markus Koschany
Control: tags -1 pending

Am 31.12.18 um 06:13 schrieb Le Gall Guillaume:
> Hello,
> 
> 
> and thank you very much for your answer.
> 
> 
> First, about OpenJDK 11, and "debian/patches/javah.patch". You are
> absolutely right to point that out. Actually, I had missed that the
> "javah" tool was removed since OpenJDK 10. Sorry for that.
> 
> I was able to reproduce the same error as the one you showed with
> OpenJDK 11.
> If we take care of a few more C headers include and constant export, it
> works. At least for me.
> Maybe just a thing to note: the path to "libjawt.so" has changed between
> 8 and 11, and we need to remove the "${os.arch}" part when giving that
> path to GCC, in "platform_build/linux_ant/build.xml".
> 
> Please find attached a new version of the patch I proposed, including
> those modifications specific to OpenJDK 11.
> Should you want to try it, please apply after everything else, including
> "javah.patch". (but not the previous version I sent).
> 
> Please let me know if this works for you, or maybe what you think about it.

Thank you for the updated patch. I have applied it and intend to upload
a new revision shortly. However I noticed that something still seems to
be wrong with linking libjawt.so. Your observation that we can remove
the ${os.arch} part is correct. However our debhelper tool dh_shlibdeps
is unable to link libjawt.so into liblwjgl.so. I have to explicitly set
the LD_LIBRARY_PATH in debian/rules when I override dh_shlibdeps but
then I still get a warning:

dpkg-shlibdeps: warning: can't extract name and version from library
name 'libjawt.so'

ldd shows:

ldd /usr/lib/jni/liblwjgl.so

libjawt.so => not found

That is strange to say the least. Let me know if the new version works
for you, otherwise we have to dig deeper into this problem.

> Then, about "OpenGL" and "OpenGL ES": from what I understand they are
> two versions of the same thing.

[...]

Thanks for your explanation!

Regards,

Markus



signature.asc
Description: OpenPGP digital signature


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

2018-12-30 Thread Le Gall Guillaume

Hello,


and thank you very much for your answer.


First, about OpenJDK 11, and "debian/patches/javah.patch". You are 
absolutely right to point that out. Actually, I had missed that the 
"javah" tool was removed since OpenJDK 10. Sorry for that.


I was able to reproduce the same error as the one you showed with 
OpenJDK 11.
If we take care of a few more C headers include and constant export, it 
works. At least for me.
Maybe just a thing to note: the path to "libjawt.so" has changed between 
8 and 11, and we need to remove the "${os.arch}" part when giving that 
path to GCC, in "platform_build/linux_ant/build.xml".


Please find attached a new version of the patch I proposed, including 
those modifications specific to OpenJDK 11.
Should you want to try it, please apply after everything else, including 
"javah.patch". (but not the previous version I sent).


Please let me know if this works for you, or maybe what you think about it.



Then, about "OpenGL" and "OpenGL ES": from what I understand they are 
two versions of the same thing.


From Wikipedia: "OpenGL for Embedded Systems (OpenGL ES) is a subset of 
the OpenGL computer graphics rendering application programming interface 
(API)" .


About the technical details: in the "build.xml" file, in the root 
folder, there is a "compile_native" and "compile_native_es". When we 
look at "debian/rules", the "override_dh_auto_build" calls 
"compile_native", but never "compile_native_es". And it seems to me that 
"compile_native_es" is the only target to call Ant with 
"platform_build/linux_ant/build_es.xml" (which is the only build file to 
include C files in the sub folders named "opengles"). Also, when looking 
at "platform_build/linux_ant/build.xml", the targets that were defined 
by upstream (or at least in 
) 
do not include the C files in the "opengles" folders. And finally, if I 
remember correctly, at first I tried to include C files from every sub 
folders, but ended up with conflicting redefinitions of the same C 
functions.


So, I am not sure whether we need "OpenGL ES" support or not. And if we 
do, I don't know how it should be packaged. But personally I would 
simply leave it out, at least for now.




Regards,
Guillaume

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.
 .
 This patch should allow building the Debian package with OpenJDK 11.
Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=912631#5
Last-Update: 2018-12-31

--- 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 @@
 	
 	
 	
-	
+	
 	
 
 	
@@ -148,8 +148,12 @@
 			
 			
 			
+			
 			
-			
+			
+			
+					
+			
 		
 		
 			
--- lwjgl-2.9.3+dfsg.orig/src/java/org/lwjgl/opengl/Pbuffer.java
+++ lwjgl-2.9.3+dfsg/src/java/org/lwjgl/opengl/Pbuffer.java
@@ -52,6 +52,7 @@ public final class Pbuffer extends Drawa
 	/**
 	 * Indicates that Pbuffers can be created.
 	 */
+	@java.lang.annotation.Native
 	public static final int PBUFFER_SUPPORTED = 1 << 0;
 
 	/**
--- lwjgl-2.9.3+dfsg.orig/src/native/linux/opengl/org_lwjgl_opengl_Pbuffer.c
+++ lwjgl-2.9.3+dfsg/src/native/linux/opengl/org_lwjgl_opengl_Pbuffer.c
@@ -42,6 +42,7 @@
 #include 
 #include "org_lwjgl_opengl_LinuxPbufferPeerInfo.h"
 #include "org_lwjgl_opengl_Pbuffer.h"
+#include "org_lwjgl_opengl_LinuxDisplay.h"
 #include "extgl.h"
 #include "context.h"
 #include "common_tools.h"


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

2018-12-28 Thread Markus Koschany
Control: severity -1 grave

Hello,

first of all both of you, thank you very much for the report and
investigation and sorry for the late response.

Unfortunately we can't remove the javah.patch because we have to use
OpenJDK 11 to build lwjgl. But we have to improve it if we want to
compile the missing sources anyway. With the applied patch the build
fails with:

compiledeb:
[mkdir] Created dir: /build/lwjgl-2.9.3+dfsg/bin/lwjgl/deb
[apply]
/build/lwjgl-2.9.3+dfsg/src/native/linux/org_lwjgl_opengl_LinuxKeyboard.c:
In function 'Java_org_lwjgl_opengl_LinuxKeyboard_keycodeToKeySym':
[apply]
/build/lwjgl-2.9.3+dfsg/src/native/linux/org_lwjgl_opengl_LinuxKeyboard.c:81:2:
warning: 'XKeycodeToKeysym' is deprecated [-Wdeprecated-declarations]
[apply]   KeySym key_sym = XKeycodeToKeysym(disp, key_code, 0);
[apply]   ^~
[apply] In file included from
/build/lwjgl-2.9.3+dfsg/src/native/linux/org_lwjgl_opengl_LinuxKeyboard.c:43:
[apply] /usr/include/X11/Xlib.h:1687:15: note: declared here
[apply]  extern KeySym XKeycodeToKeysym(
[apply]^~~~
[apply] /build/lwjgl-2.9.3+dfsg/src/native/linux/opengl/context.c:
In function 'chooseVisualGLXFromBPP':
[apply]
/build/lwjgl-2.9.3+dfsg/src/native/linux/opengl/context.c:237:9:
warning: this 'if' clause does not guard... [-Wmisleading-indentation]
[apply]  if ( colorSamples > 0 )
[apply]  ^~
[apply]
/build/lwjgl-2.9.3+dfsg/src/native/linux/opengl/context.c:238:60: note:
...this statement, but the latter is misleadingly indented as if it were
guarded by the 'if'
[apply]  putAttrib(_list, GLX_COLOR_SAMPLES_NV);
putAttrib(_list, colorSamples);
[apply]
^
[apply]
/build/lwjgl-2.9.3+dfsg/src/native/linux/opengl/org_lwjgl_opengl_Pbuffer.c:44:10:
fatal error: org_lwjgl_opengl_Pbuffer.h: No such file or directory
[apply]  #include "org_lwjgl_opengl_Pbuffer.h"
[apply]   ^~~~
[apply] compilation terminated.


We need to fix this as well. Could you explain in more detail why you
omit the opengles directory?

Regards,

Markus







signature.asc
Description: OpenPGP digital signature


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

2018-12-26 Thread Le Gall Guillaume

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  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 @@
 	
 	
 	
-	
+	
 

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

2018-11-01 Thread Petr Cvek
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  libc62.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