summaryrefslogtreecommitdiff
path: root/package/openjdk8/files/openadk.patch
blob: 2f87878909b0df72a050b4c68f325a46c1e9116a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
diff -Nur openjdk.orig/hotspot/src/cpu/zero/vm/entry_zero.hpp openjdk/hotspot/src/cpu/zero/vm/entry_zero.hpp
--- openjdk.orig/hotspot/src/cpu/zero/vm/entry_zero.hpp	2015-12-23 01:50:46.000000000 +0100
+++ openjdk/hotspot/src/cpu/zero/vm/entry_zero.hpp	2016-01-06 11:43:50.108091228 +0100
@@ -26,6 +26,8 @@
 #ifndef CPU_ZERO_VM_ENTRY_ZERO_HPP
 #define CPU_ZERO_VM_ENTRY_ZERO_HPP
 
+#include "interpreter/cppInterpreter.hpp"
+
 class ZeroEntry {
  public:
   ZeroEntry() {
diff -Nur openjdk.orig/hotspot/src/cpu/zero/vm/nativeInst_zero.cpp openjdk/hotspot/src/cpu/zero/vm/nativeInst_zero.cpp
--- openjdk.orig/hotspot/src/cpu/zero/vm/nativeInst_zero.cpp	2015-12-23 01:50:46.000000000 +0100
+++ openjdk/hotspot/src/cpu/zero/vm/nativeInst_zero.cpp	2016-01-06 11:43:50.108091228 +0100
@@ -25,6 +25,7 @@
 
 #include "precompiled.hpp"
 #include "assembler_zero.inline.hpp"
+#include "entry_zero.hpp"
 #include "memory/resourceArea.hpp"
 #include "nativeInst_zero.hpp"
 #include "oops/oop.inline.hpp"
diff -Nur openjdk.orig/hotspot/src/os/linux/vm/os_linux.cpp openjdk/hotspot/src/os/linux/vm/os_linux.cpp
--- openjdk.orig/hotspot/src/os/linux/vm/os_linux.cpp	2015-12-23 01:50:46.000000000 +0100
+++ openjdk/hotspot/src/os/linux/vm/os_linux.cpp	2016-01-06 11:43:50.112090962 +0100
@@ -94,7 +94,9 @@
 # include <string.h>
 # include <syscall.h>
 # include <sys/sysinfo.h>
+# ifndef __UCLIBC__
 # include <gnu/libc-version.h>
+# endif
 # include <sys/ipc.h>
 # include <sys/shm.h>
 # include <link.h>
@@ -533,6 +535,7 @@
 # define _CS_GNU_LIBPTHREAD_VERSION 3
 # endif
 
+# ifndef __UCLIBC__
   size_t n = confstr(_CS_GNU_LIBC_VERSION, NULL, 0);
   if (n > 0) {
      char *str = (char *)malloc(n, mtInternal);
@@ -545,6 +548,10 @@
               "glibc %s %s", gnu_get_libc_version(), gnu_get_libc_release());
      os::Linux::set_glibc_version(_gnu_libc_version);
   }
+# else
+  size_t n = 1;
+  os::Linux::set_glibc_version("2");
+# endif
 
   n = confstr(_CS_GNU_LIBPTHREAD_VERSION, NULL, 0);
   if (n > 0) {
@@ -2789,10 +2796,14 @@
 // 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) {
+#ifndef __UCLIBC__
   void *f = dlvsym(handle, name, "libnuma_1.1");
   if (f == NULL) {
     f = dlsym(handle, name);
   }
+#else
+  void *f = dlsym(handle, name);
+#endif
   return f;
 }
 
@@ -4805,7 +4816,7 @@
 
   Linux::capture_initial_stack(JavaThread::stack_size_at_create());
 
-#if defined(IA32)
+#if defined(IA32) && !defined(ZERO)
   workaround_expand_exec_shield_cs_limit();
 #endif
 
@@ -5437,6 +5448,43 @@
 // System loadavg support.  Returns -1 if load average cannot be obtained.
 // Linux doesn't yet have a (official) notion of processor sets,
 // so just return the system wide load average.
+#ifdef __UCLIBC__
+static int getloadavg (double loadavg[], int nelem)
+{
+  int fd;
+
+  fd = open ("/proc/loadavg", O_RDONLY);
+  if (fd < 0)
+    return -1;
+  else
+    {
+      char buf[65], *p;
+      ssize_t nread;
+      int i;
+
+      nread = read (fd, buf, sizeof buf - 1);
+      close (fd);
+      if (nread <= 0)
+	return -1;
+      buf[nread - 1] = '\0';
+
+      if (nelem > 3)
+	nelem = 3;
+      p = buf;
+      for (i = 0; i < nelem; ++i)
+	{
+	  char *endp;
+	  loadavg[i] = strtod (p, &endp);
+	  if (endp == p)
+	    return -1;
+	  p = endp;
+	}
+
+      return i;
+    }
+}
+#endif
+
 int os::loadavg(double loadavg[], int nelem) {
   return ::getloadavg(loadavg, nelem);
 }
diff -Nur openjdk.orig/hotspot/src/share/vm/utilities/globalDefinitions_gcc.hpp openjdk/hotspot/src/share/vm/utilities/globalDefinitions_gcc.hpp
--- openjdk.orig/hotspot/src/share/vm/utilities/globalDefinitions_gcc.hpp	2015-12-23 01:50:46.000000000 +0100
+++ openjdk/hotspot/src/share/vm/utilities/globalDefinitions_gcc.hpp	2016-01-06 11:43:50.220083765 +0100
@@ -223,6 +223,10 @@
 #define BREAKPOINT ::breakpoint()
 #endif
 
+#ifdef __UCLIBC__
+#define isnanf __isnanf
+#endif
+
 // checking for nanness
 #ifdef SOLARIS
 #ifdef SPARC
@@ -249,8 +253,13 @@
 
 // Checking for finiteness
 
+#ifdef __UCLIBC__
+inline int g_isfinite(jfloat  f)                 { return isfinite(f); }
+inline int g_isfinite(jdouble f)                 { return isfinite(f); }
+#else
 inline int g_isfinite(jfloat  f)                 { return finite(f); }
 inline int g_isfinite(jdouble f)                 { return finite(f); }
+#endif
 
 
 // Wide characters
diff -Nur openjdk.orig/jdk/src/solaris/native/sun/xawt/XToolkit.c openjdk/jdk/src/solaris/native/sun/xawt/XToolkit.c
--- openjdk.orig/jdk/src/solaris/native/sun/xawt/XToolkit.c	2015-12-23 01:50:56.000000000 +0100
+++ openjdk/jdk/src/solaris/native/sun/xawt/XToolkit.c	2016-01-06 12:56:51.970983142 +0100
@@ -27,7 +27,7 @@
 #include <X11/Xutil.h>
 #include <X11/Xos.h>
 #include <X11/Xatom.h>
-#ifdef __linux__
+#if defined(__GLIBC__) && !defined(__UCLIBC__)
 #include <execinfo.h>
 #endif
 
@@ -799,7 +799,7 @@
     return ret;
 }
 
-#ifdef __linux__
+#if defined(__GLIBC__) && !defined(__UCLIBC__)
 void print_stack(void)
 {
   void *array[10];