From 3668ba76f44bc778ba4446236088c22948a644d0 Mon Sep 17 00:00:00 2001 From: André Draszik Date: Tue, 6 Mar 2018 11:01:53 +0200 Subject: openjdk-8: fix musl build MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add various patches to make it work in musl. Some of them are generic enough to be applied for all builds, some need to be specific to musl. Signed-off-by: André Draszik Signed-off-by: Maxin B. John --- ...ild-fix-use-SIGRTMAX-rather-than-__SIGRTM.patch | 69 ++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 recipes-core/openjdk/patches-openjdk-8/musl-0008-jdk-musl-build-fix-use-SIGRTMAX-rather-than-__SIGRTM.patch (limited to 'recipes-core/openjdk/patches-openjdk-8/musl-0008-jdk-musl-build-fix-use-SIGRTMAX-rather-than-__SIGRTM.patch') diff --git a/recipes-core/openjdk/patches-openjdk-8/musl-0008-jdk-musl-build-fix-use-SIGRTMAX-rather-than-__SIGRTM.patch b/recipes-core/openjdk/patches-openjdk-8/musl-0008-jdk-musl-build-fix-use-SIGRTMAX-rather-than-__SIGRTM.patch new file mode 100644 index 0000000..c15895f --- /dev/null +++ b/recipes-core/openjdk/patches-openjdk-8/musl-0008-jdk-musl-build-fix-use-SIGRTMAX-rather-than-__SIGRTM.patch @@ -0,0 +1,69 @@ +From ec37e9e5663611e49c7c976d34450ea6b90d0f24 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Andr=C3=A9=20Draszik?= > +Date: Fri, 2 Mar 2018 13:37:20 +0000 +Subject: [PATCH 8/9] jdk: musl build fix (use SIGRTMAX rather than __SIGRTMAX) +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +__SIGRTMAX is a private glibc symbol, which isn't provided +by musl, thus failing compilation. + +From https://sourceware.org/ml/rda/2005-q4/msg00011.html + On a GNU(ish) system, [SIGRTMIN / SIGRTMAX] these macros are defined + to call functions which compute the actual minimum and maximum + realtime signal numbers. In particular, this computation will exclude + any signals used by the C library for its own purposes. These signals + could include signals related to thread debugging or, more + importantly, for thread cancellation. +[...] + [The __SIGRTMIN and __SIGRTMAX] constants represent a hard minumum + and maximum. + +Patch taken from Alpine Linux: + https://git.alpinelinux.org/cgit/aports/tree/community/openjdk8/icedtea-jdk-musl.patch?id=4d34f29dddd3934358df7a9607706d09ae0433c3 + +Upstream-Status: Inappropriate [musl specific] +Signed-off-by: André Draszik > +--- + jdk/src/solaris/native/java/net/linux_close.c | 3 ++- + jdk/src/solaris/native/sun/nio/ch/NativeThread.c | 2 +- + 2 files changed, 3 insertions(+), 2 deletions(-) + +diff --git a/jdk/src/solaris/native/java/net/linux_close.c b/jdk/src/solaris/native/java/net/linux_close.c +index 85fba135..e635dafd 100644 +--- a/jdk/src/solaris/native/java/net/linux_close.c ++++ b/jdk/src/solaris/native/java/net/linux_close.c +@@ -56,7 +56,7 @@ typedef struct { + /* + * Signal to unblock thread + */ +-static int sigWakeup = (__SIGRTMAX - 2); ++static int sigWakeup; + + /* + * The fd table and the number of file descriptors +@@ -95,6 +95,7 @@ static void __attribute((constructor)) init() { + /* + * Setup the signal handler + */ ++ sigWakeup = SIGRTMAX - 2; + sa.sa_handler = sig_wakeup; + sa.sa_flags = 0; + sigemptyset(&sa.sa_mask); +diff --git a/jdk/src/solaris/native/sun/nio/ch/NativeThread.c b/jdk/src/solaris/native/sun/nio/ch/NativeThread.c +index 204f0441..f5483bbd 100644 +--- a/jdk/src/solaris/native/sun/nio/ch/NativeThread.c ++++ b/jdk/src/solaris/native/sun/nio/ch/NativeThread.c +@@ -36,7 +36,7 @@ + #include + #include + /* Also defined in net/linux_close.c */ +- #define INTERRUPT_SIGNAL (__SIGRTMAX - 2) ++ #define INTERRUPT_SIGNAL (SIGRTMAX - 2) + #elif __solaris__ + #include + #include +-- +2.16.2 + -- cgit v1.2.3-54-g00ecf