Re: Avian on QNX-ARM using OpenJDK

288 views
Skip to first unread message

Joel Dice

unread,
Aug 30, 2012, 8:17:33 PM8/30/12
to av...@googlegroups.com
On Thu, 30 Aug 2012, Anthony Serravalle wrote:

> Hello Joel,
> I have been trying to compile avian for QNX on ARM using JDK7 (on a Linux
> host), and am running into an issue that 'langinfo.h' is not present on the
> target when trying to compile the java_props_md.c file in the JDK source.
> This seems to be intentional by QNX:
>
> http://community.qnx.com/sf/discussion/do/listPosts/projects.pkgsrc/discuss
> ion.general.topc1871�
> (it's an old topic from 2008, though perhaps still relevant)
>
> If I hack the JDK source (which I don't really want to do) and remove
> reference to langinfo.h and any referenced functions (nl_langinfo()), I run
> into a number of subsequent problems.
> Any ideas? Or is this not really supported?

Hi Anthony,

You actually got farther than I did when I tried it. My build died on the
first OpenJDK file with a complaint about sys/signal.h missing.

As far as I can tell, nobody has tried porting OpenJDK to QNX yet. You
might want to post to the OpenJDK mailing list to see if anyone's tried it
or wants to help. I've never tried porting OpenJDK to a new platform, so
I have no idea how much work it will be.

Anyway, it's not something I have any interest in, although I'd be happy
to help ensure Avian is compatible if/when there's an upstream port
available.

Depending on the complexity of your app(s), you might consider using
Avian's built-in class library, which should be fully QNX-compatible,
although it's quite limited in scope compared to OpenJDK's library.

Anthony Serravalle

unread,
Aug 31, 2012, 10:44:11 AM8/31/12
to av...@googlegroups.com
Hi Joel,

Ah, okay. For reference, the 'sys/signal.h' problem came from the fact that (at least on my target), sys/signal.h was actually located in $QNX_TARGET/usr/include/io-pkt (as opposed to just the usr/include directory).

I can actually get the smaller avian executable to run on QNX-ARM (the one with the avian-specific Java libraries), but I already had an application already written that I wanted to test on QNX which used quite a few Java libraries not present on the slim version of avian. I will try posting to the OpenJDK mailing list (or possibly even QNX, if such a mailing list even exists) for some feedback.

If you're interested, I will gladly post back any finding I run into.

Take care,
Anthony.


On Thursday, August 30, 2012 8:17:06 PM UTC-4, Joel Dice wrote:
On Thu, 30 Aug 2012, Anthony Serravalle wrote:

> Hello Joel,
> I have been trying to compile avian for QNX on ARM using JDK7 (on a Linux
> host), and am running into an issue that 'langinfo.h' is not present on the
> target when trying to compile the java_props_md.c file in the JDK source.
> This seems to be intentional by QNX:
>
> http://community.qnx.com/sf/discussion/do/listPosts/projects.pkgsrc/discuss
> ion.general.topc1871�

Xerxes Rånby

unread,
Oct 2, 2012, 9:55:32 AM10/2/12
to av...@googlegroups.com, sszy...@gmail.com

On Tuesday, October 2, 2012 8:42:13 AM UTC+2, sszy...@gmail.com wrote:
Hello,

If you are still interested, check my attached patch allowing to cross-compile Avian + OpenJDK (openjdk-7-fcs-src-b147-27_jun_2011.zip) for x86 QNX 6.4.1. I managed to run Jenkins slave and Apache Ivy on QNX with this, so it's more or less working. Let me know if you find any problems. The only change in Avian sources was to force linking with my custom build of zlib - the one provided with QNX 6.4.1 caused problems when accessing classes in some jar files.

Regards,
Stanisław Szymczyk


Greetings Stanisław
This QNX-ARM OpenJDK patch would be of good use in OpenJDK upstream or possibly hosted by the IcedTea project.
Do you plan to upstream it?

Cheers
Xerxes

Joel Dice

unread,
Dec 4, 2012, 12:22:10 PM12/4/12
to av...@googlegroups.com, sszy...@gmail.com
Hi Stanisław,

On Wed, 7 Nov 2012, sszy...@gmail.com wrote:

> I did some more tests with my x86 QNX Avian port and found one major problem
> in Avian VM while trying to run Apache Ivy. The problem manifests as
> follows:
>
> 1. MySystem::Thread X is created, during its creation pthread mutex and
> conditional variable are initialized
> 2. Program runs for some time
> 3. MySystem Thread X is disposed, it's memory is freed (during garbage
> collection I guess)
> 4. Program runs for some time
> 5. MySystem::Thread Y is created in exactly the same memory address as
> MySystem::Thread X disposed in step 3 (I suppose that's due to the way
> memory allocator works in Avian)
> 6. During MySystem::Thread Y creation pthread mutex and conditional variable
> initialization fail silently with EBUSY. QNX documentation says it means
> "The given mutex was previously initialized and hasn't been destroyed."
> which is correct, because it's exactly in the same memory address as mutex
> and conditional variable of MySystem::Thread X and they haven't been
> destroyed during MySystem::Thread X disposal
>
> Fortunately solution for this is easy, see the attached patch. Now Apache
> Ivy works without any problems.

Thanks for the report and the patch. I've committed it to the Git repo.
Reply all
Reply to author
Forward
0 new messages