JDK 9 fails to build on MIPS

Thomas Stüfe thomas.stuefe at gmail.com
Wed Nov 30 19:33:16 UTC 2016

Hi James,

In general I like your patch - we used sigset_t in the AIX port instead of
masks and this would be a good cleanup for the other platforms too.

But in this case, is the problem not that the mips signal.h headers fails
to define NSIG?

We have NSIG and _NSIG. _NSIG seems to be the platform dependent max
including real time signals. NSIG excludes real time signals, and seems to
be 32 (SIGRTMIN) on all Linux platforms I checked.

I may have looked wrong (I searched
http://lxr.free-electrons.com/ident?v=3.2&i=NSIG), but I found that NSIG
was missing from signal.h on some architectures, mips being among them. I
do not know why, but would like to understand the reason. Do you define
NSIG to be _NSIG?

The VM currently does not use real time signals, so NSIG should be
sufficient. If NSIG is really missing on mips, then maybe defining it
locally as SIGRTMIN would be a less invasive change.

If we were to change the hand-written bitmask to sigset_t, we probably
should also take a look at the arrays of length NSIG (sigact, sigflags,
pending_signals) and the associated checks. This would be a bigger cleanup.


Apart from all that, I'd suggest moving the sigset initialization in
os_linux.cpp from the "__attribute__((constructor))" function to
os::signal_init_pd(). I'd suggest a similar move for jsig.c, but do not see
a suitable initialization function there. Maybe someone else has an idea?

Thanks & Kind Regards, Thomas

On Wed, Nov 30, 2016 at 6:50 PM, James Cowgill <jcowgill at debian.org> wrote:

> Hi,
> Firstly I have never submitted anything to OpenJDK before so apologies
> if I haven't done things the right way. I also have no bug number for this.
> OpenJDK 9 does not build on MIPS machines and hasn't for some time. This
> is due to code in hotspot which assumes NSIG <= 65 which is not the case
> on MIPS since MIPS has 127 signal numbers.
> I've attached an initial patch which converts the offending code in
> hotspot/src/os/linux/vm/jsig.c to use sigset_t instead of an array to
> store the used signals. I notice the AIX implementation of jsig.c
> already does this.
> Originally from: https://bugs.debian.org/841173
> Thanks,
> James

More information about the hotspot-dev mailing list