summaryrefslogtreecommitdiffstats
path: root/testing/openjdk8/icedtea-hotspot-uclibc-fixes.patch
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2015-08-17 20:08:39 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2015-08-18 11:16:36 +0200
commit166ad0377b8e939f7777c85b4a791ae53969a42b (patch)
tree4f5c7386e463f17115f62bceb25e8d3bd9f84ef7 /testing/openjdk8/icedtea-hotspot-uclibc-fixes.patch
parent33696ff4c4f593b5c06bafac16d6206c4c591eea (diff)
testing/openjdk8: new aport
ref #4515 openjdk8 and openjdk7 cannot coexist currently due to automatic so dependencies. both packages should be fixed to not provide conflicting so deps (or maybe needs abuild change?)
Diffstat (limited to 'testing/openjdk8/icedtea-hotspot-uclibc-fixes.patch')
-rw-r--r--testing/openjdk8/icedtea-hotspot-uclibc-fixes.patch93
1 files changed, 93 insertions, 0 deletions
diff --git a/testing/openjdk8/icedtea-hotspot-uclibc-fixes.patch b/testing/openjdk8/icedtea-hotspot-uclibc-fixes.patch
new file mode 100644
index 00000000000..1c1d8227600
--- /dev/null
+++ b/testing/openjdk8/icedtea-hotspot-uclibc-fixes.patch
@@ -0,0 +1,93 @@
+--- openjdk.orig/hotspot/src/os/linux/vm/os_linux.cpp
++++ openjdk/hotspot/src/os/linux/vm/os_linux.cpp
+@@ -112,7 +112,6 @@
+ # include <string.h>
+ # include <syscall.h>
+ # include <sys/sysinfo.h>
+-# include <gnu/libc-version.h>
+ # include <sys/ipc.h>
+ # include <sys/shm.h>
+ # include <link.h>
+@@ -632,6 +631,13 @@
+ // detecting pthread library
+
+ void os::Linux::libpthread_init() {
++#if 1
++ // Hard code Alpine Linux supported uclibc/musl compatible settings
++ os::Linux::set_glibc_version("glibc 2.9");
++ os::Linux::set_libpthread_version("NPTL");
++ os::Linux::set_is_NPTL();
++ os::Linux::set_is_floating_stack();
++#else
+ // Save glibc and pthread version strings. Note that _CS_GNU_LIBC_VERSION
+ // and _CS_GNU_LIBPTHREAD_VERSION are supported in glibc >= 2.3.2. Use a
+ // generic name for earlier versions.
+@@ -690,6 +696,7 @@
+ if (os::Linux::is_NPTL() || os::Linux::supports_variable_stack_size()) {
+ os::Linux::set_is_floating_stack();
+ }
++#endif
+ }
+
+ /////////////////////////////////////////////////////////////////////////////
+@@ -2951,11 +2958,7 @@
+ // If we are running with earlier version, which did not have symbol versions,
+ // we should use the base version.
+ void* os::Linux::libnuma_dlsym(void* handle, const char *name) {
+- void *f = dlvsym(handle, name, "libnuma_1.1");
+- if (f == NULL) {
+- f = dlsym(handle, name);
+- }
+- return f;
++ return dlsym(handle, name);
+ }
+
+ bool os::Linux::libnuma_init() {
+@@ -5312,7 +5315,25 @@
+ // Linux doesn't yet have a (official) notion of processor sets,
+ // so just return the system wide load average.
+ int os::loadavg(double loadavg[], int nelem) {
++#ifdef __UCLIBC__
++ FILE *LOADAVG;
++ double avg[3] = { 0.0, 0.0, 0.0 };
++ int i, res = -1;;
++
++ if ((LOADAVG = fopen("/proc/loadavg", "r"))) {
++ fscanf(LOADAVG, "%lf %lf %lf", &avg[0], &avg[1], &avg[2]);
++ res = 0;
++ fclose(LOADAVG);
++ }
++
++ for (i = 0; (i < nelem) && (i < 3); i++) {
++ loadavg[i] = avg[i];
++ }
++
++ return res;
++#else
+ return ::getloadavg(loadavg, nelem);
++#endif
+ }
+
+ void os::pause() {
+--- openjdk.orig/hotspot/src/share/vm/utilities/globalDefinitions_gcc.hpp
++++ openjdk/hotspot/src/share/vm/utilities/globalDefinitions_gcc.hpp
+@@ -253,7 +253,7 @@
+ #elif defined(__APPLE__)
+ inline int g_isnan(double f) { return isnan(f); }
+ #elif defined(LINUX) || defined(_ALLBSD_SOURCE)
+-inline int g_isnan(float f) { return isnanf(f); }
++inline int g_isnan(float f) { return isnan(f); }
+ inline int g_isnan(double f) { return isnan(f); }
+ #else
+ #error "missing platform-specific definition here"
+@@ -267,8 +267,8 @@
+
+ // Checking for finiteness
+
+-inline int g_isfinite(jfloat f) { return finite(f); }
+-inline int g_isfinite(jdouble f) { return finite(f); }
++inline int g_isfinite(jfloat f) { return isfinite(f); }
++inline int g_isfinite(jdouble f) { return isfinite(f); }
+
+
+ // Wide characters