summaryrefslogtreecommitdiffstats
path: root/recipes-core/openjdk/patches-openjdk-8/musl-0006-hotspot-os_linux-remove-glibc-dependencies.patch
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-core/openjdk/patches-openjdk-8/musl-0006-hotspot-os_linux-remove-glibc-dependencies.patch')
-rw-r--r--recipes-core/openjdk/patches-openjdk-8/musl-0006-hotspot-os_linux-remove-glibc-dependencies.patch75
1 files changed, 75 insertions, 0 deletions
diff --git a/recipes-core/openjdk/patches-openjdk-8/musl-0006-hotspot-os_linux-remove-glibc-dependencies.patch b/recipes-core/openjdk/patches-openjdk-8/musl-0006-hotspot-os_linux-remove-glibc-dependencies.patch
new file mode 100644
index 0000000..f0696fc
--- /dev/null
+++ b/recipes-core/openjdk/patches-openjdk-8/musl-0006-hotspot-os_linux-remove-glibc-dependencies.patch
@@ -0,0 +1,75 @@
1From a02a9fbc3f1fed181504bdb5b0a16863247f92fc Mon Sep 17 00:00:00 2001
2From: =?UTF-8?q?Andr=C3=A9=20Draszik?= <andre.draszik at jci.com <https://lists.yoctoproject.org/listinfo/yocto>>
3Date: Fri, 2 Mar 2018 10:11:51 +0000
4Subject: [PATCH 6/9] hotspot: os_linux: remove glibc dependencies
5MIME-Version: 1.0
6Content-Type: text/plain; charset=UTF-8
7Content-Transfer-Encoding: 8bit
8
9* gnu/libc-version.h doesn't exist in musl
10 | hotspot/src/os/linux/vm/os_linux.cpp:97:11: fatal error: gnu/libc-version.h: No such file or directory
11 | # include <gnu/libc-version.h>
12 | ^~~~~~~~~~~~~~~~~~~~
13
14* dlvsym() is a GNU extension and doesn't exist in musl
15 | hotspot/src/os/linux/vm/os_linux.cpp:2846:13: error: 'dlvsym' was not declared in this scope
16 | void *f = dlvsym(handle, name, "libnuma_1.1");
17 | ^~~~~~
18 | hotspot/src/os/linux/vm/os_linux.cpp:2846:13: note: suggested alternative: 'dlsym'
19 | void *f = dlvsym(handle, name, "libnuma_1.1");
20 | ^~~~~~
21 | dlsym
22
23Upstream-Status: Inappropriate [musl specific]
24Signed-off-by: André Draszik <andre.draszik at jci.com <https://lists.yoctoproject.org/listinfo/yocto>>
25---
26 hotspot/src/os/linux/vm/os_linux.cpp | 12 +++++++++++-
27 1 file changed, 11 insertions(+), 1 deletion(-)
28
29diff --git a/hotspot/src/os/linux/vm/os_linux.cpp b/hotspot/src/os/linux/vm/os_linux.cpp
30index 044a70a6..3137796a 100644
31--- a/hotspot/src/os/linux/vm/os_linux.cpp
32+++ b/hotspot/src/os/linux/vm/os_linux.cpp
33@@ -94,7 +94,6 @@
34 # include <string.h>
35 # include <syscall.h>
36 # include <sys/sysinfo.h>
37-# include <gnu/libc-version.h>
38 # include <sys/ipc.h>
39 # include <sys/shm.h>
40 # include <link.h>
41@@ -530,6 +529,13 @@ void os::Linux::hotspot_sigmask(Thread* thread) {
42 // detecting pthread library
43
44 void os::Linux::libpthread_init() {
45+#if 1
46+ // Hard code supported musl compatible settings (taken from alpine linux)
47+ os::Linux::set_glibc_version("glibc 2.9");
48+ os::Linux::set_libpthread_version("NPTL");
49+ os::Linux::set_is_NPTL();
50+ os::Linux::set_is_floating_stack();
51+#else
52 // Save glibc and pthread version strings. Note that _CS_GNU_LIBC_VERSION
53 // and _CS_GNU_LIBPTHREAD_VERSION are supported in glibc >= 2.3.2. Use a
54 // generic name for earlier versions.
55@@ -588,6 +594,7 @@ void os::Linux::libpthread_init() {
56 if (os::Linux::is_NPTL() || os::Linux::supports_variable_stack_size()) {
57 os::Linux::set_is_floating_stack();
58 }
59+#endif
60 }
61
62 /////////////////////////////////////////////////////////////////////////////
63@@ -2814,6 +2821,9 @@ int os::Linux::sched_getcpu_syscall(void) {
64 return (retval == -1) ? retval : cpu;
65 }
66
67+// musl doesn't have dlvsym()
68+#define dlvsym(h,s,v) dlsym(h,s)
69+
70 // Something to do with the numa-aware allocator needs these symbols
71 extern "C" JNIEXPORT void numa_warn(int number, char *where, ...) { }
72 extern "C" JNIEXPORT void numa_error(char *where) { }
73--
742.16.2
75