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