diff options
author | André Draszik <andre.draszik@jci.com> | 2018-03-06 11:01:53 +0200 |
---|---|---|
committer | Maxin B. John <maxin.john@intel.com> | 2018-03-06 11:03:09 +0200 |
commit | 3668ba76f44bc778ba4446236088c22948a644d0 (patch) | |
tree | cc3291774f0e41350f22a1e5e0196e08f14500a3 /recipes-core/openjdk/patches-openjdk-8/musl-0006-hotspot-os_linux-remove-glibc-dependencies.patch | |
parent | f8be3065f7c5dbd73516394c0bcd2c7ba1777abf (diff) | |
download | meta-java-3668ba76f44bc778ba4446236088c22948a644d0.tar.gz |
openjdk-8: fix musl build
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 <andre.draszik@jci.com>
Signed-off-by: Maxin B. John <maxin.john@intel.com>
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.patch | 75 |
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 @@ | |||
1 | From a02a9fbc3f1fed181504bdb5b0a16863247f92fc Mon Sep 17 00:00:00 2001 | ||
2 | From: =?UTF-8?q?Andr=C3=A9=20Draszik?= <andre.draszik at jci.com <https://lists.yoctoproject.org/listinfo/yocto>> | ||
3 | Date: Fri, 2 Mar 2018 10:11:51 +0000 | ||
4 | Subject: [PATCH 6/9] hotspot: os_linux: remove glibc dependencies | ||
5 | MIME-Version: 1.0 | ||
6 | Content-Type: text/plain; charset=UTF-8 | ||
7 | Content-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 | |||
23 | Upstream-Status: Inappropriate [musl specific] | ||
24 | Signed-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 | |||
29 | diff --git a/hotspot/src/os/linux/vm/os_linux.cpp b/hotspot/src/os/linux/vm/os_linux.cpp | ||
30 | index 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 | -- | ||
74 | 2.16.2 | ||
75 | |||