openadk.patch 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295
  1. diff -Nur openjdk.orig/common/autoconf/platform.m4 openjdk/common/autoconf/platform.m4
  2. --- openjdk.orig/common/autoconf/platform.m4 2015-12-23 01:50:32.000000000 +0100
  3. +++ openjdk/common/autoconf/platform.m4 2016-01-08 17:54:55.814451099 +0100
  4. @@ -36,25 +36,85 @@
  5. VAR_CPU_BITS=64
  6. VAR_CPU_ENDIAN=little
  7. ;;
  8. - i?86)
  9. + x86|i?86)
  10. VAR_CPU=x86
  11. VAR_CPU_ARCH=x86
  12. VAR_CPU_BITS=32
  13. VAR_CPU_ENDIAN=little
  14. ;;
  15. + alpha*)
  16. + VAR_CPU=alpha
  17. + VAR_CPU_ARCH=alpha
  18. + VAR_CPU_BITS=64
  19. + VAR_CPU_ENDIAN=little
  20. + ;;
  21. + arm*eb)
  22. + VAR_CPU=armeb
  23. + VAR_CPU_ARCH=arm
  24. + VAR_CPU_BITS=32
  25. + VAR_CPU_ENDIAN=big
  26. + ;;
  27. arm*)
  28. VAR_CPU=arm
  29. VAR_CPU_ARCH=arm
  30. VAR_CPU_BITS=32
  31. VAR_CPU_ENDIAN=little
  32. ;;
  33. + aarch64eb)
  34. + VAR_CPU=aarch64eb
  35. + VAR_CPU_ARCH=aarch64
  36. + VAR_CPU_BITS=64
  37. + VAR_CPU_ENDIAN=big
  38. + ;;
  39. aarch64)
  40. VAR_CPU=aarch64
  41. VAR_CPU_ARCH=aarch64
  42. VAR_CPU_BITS=64
  43. VAR_CPU_ENDIAN=little
  44. ;;
  45. - powerpc)
  46. + m68k)
  47. + VAR_CPU=m68k
  48. + VAR_CPU_ARCH=m68k
  49. + VAR_CPU_BITS=32
  50. + VAR_CPU_ENDIAN=big
  51. + ;;
  52. + mips)
  53. + VAR_CPU=mips
  54. + VAR_CPU_ARCH=mips
  55. + VAR_CPU_BITS=32
  56. + VAR_CPU_ENDIAN=big
  57. + ;;
  58. + mipsel)
  59. + VAR_CPU=mipsel
  60. + VAR_CPU_ARCH=mipsel
  61. + VAR_CPU_BITS=32
  62. + VAR_CPU_ENDIAN=little
  63. + ;;
  64. + mipsn32)
  65. + VAR_CPU=mipsn32
  66. + VAR_CPU_ARCH=mipsn32
  67. + VAR_CPU_BITS=32
  68. + VAR_CPU_ENDIAN=big
  69. + ;;
  70. + mipsn32el)
  71. + VAR_CPU=mipsn32el
  72. + VAR_CPU_ARCH=mipsn32el
  73. + VAR_CPU_BITS=32
  74. + VAR_CPU_ENDIAN=little
  75. + ;;
  76. + mips64)
  77. + VAR_CPU=mips64
  78. + VAR_CPU_ARCH=mips64
  79. + VAR_CPU_BITS=64
  80. + VAR_CPU_ENDIAN=big
  81. + ;;
  82. + mips64el)
  83. + VAR_CPU=mips64el
  84. + VAR_CPU_ARCH=mips64el
  85. + VAR_CPU_BITS=64
  86. + VAR_CPU_ENDIAN=little
  87. + ;;
  88. + powerpc|ppc)
  89. VAR_CPU=ppc
  90. VAR_CPU_ARCH=ppc
  91. VAR_CPU_BITS=32
  92. @@ -66,12 +126,18 @@
  93. VAR_CPU_BITS=64
  94. VAR_CPU_ENDIAN=big
  95. ;;
  96. - powerpc64le)
  97. + powerpc64le|ppc64le)
  98. VAR_CPU=ppc64
  99. VAR_CPU_ARCH=ppc
  100. VAR_CPU_BITS=64
  101. VAR_CPU_ENDIAN=little
  102. ;;
  103. + sh*)
  104. + VAR_CPU=sh
  105. + VAR_CPU_ARCH=sh
  106. + VAR_CPU_BITS=32
  107. + VAR_CPU_ENDIAN=little
  108. + ;;
  109. s390)
  110. VAR_CPU=s390
  111. VAR_CPU_ARCH=s390
  112. @@ -371,6 +437,11 @@
  113. # ZERO_ARCHDEF is used to enable architecture-specific code
  114. case "${OPENJDK_TARGET_CPU}" in
  115. + alpha*) ZERO_ARCHDEF=ALPHA ;;
  116. + m68k) ZERO_ARCHDEF=M68K ;;
  117. + mips|mipsn32|mips64) ZERO_ARCHDEF=MIPS ;;
  118. + mipsel|mipsn32el|mips64el) ZERO_ARCHDEF=MIPSEL ;;
  119. + sh*) ZERO_ARCHDEF=sh ;;
  120. ppc) ZERO_ARCHDEF=PPC32 ;;
  121. ppc64) ZERO_ARCHDEF=PPC64 ;;
  122. s390*) ZERO_ARCHDEF=S390 ;;
  123. diff -Nur openjdk.orig/hotspot/src/cpu/zero/vm/entry_zero.hpp openjdk/hotspot/src/cpu/zero/vm/entry_zero.hpp
  124. --- openjdk.orig/hotspot/src/cpu/zero/vm/entry_zero.hpp 2015-12-23 01:50:46.000000000 +0100
  125. +++ openjdk/hotspot/src/cpu/zero/vm/entry_zero.hpp 2016-01-06 11:43:50.108091228 +0100
  126. @@ -26,6 +26,8 @@
  127. #ifndef CPU_ZERO_VM_ENTRY_ZERO_HPP
  128. #define CPU_ZERO_VM_ENTRY_ZERO_HPP
  129. +#include "interpreter/cppInterpreter.hpp"
  130. +
  131. class ZeroEntry {
  132. public:
  133. ZeroEntry() {
  134. diff -Nur openjdk.orig/hotspot/src/cpu/zero/vm/nativeInst_zero.cpp openjdk/hotspot/src/cpu/zero/vm/nativeInst_zero.cpp
  135. --- openjdk.orig/hotspot/src/cpu/zero/vm/nativeInst_zero.cpp 2015-12-23 01:50:46.000000000 +0100
  136. +++ openjdk/hotspot/src/cpu/zero/vm/nativeInst_zero.cpp 2016-01-06 11:43:50.108091228 +0100
  137. @@ -25,6 +25,7 @@
  138. #include "precompiled.hpp"
  139. #include "assembler_zero.inline.hpp"
  140. +#include "entry_zero.hpp"
  141. #include "memory/resourceArea.hpp"
  142. #include "nativeInst_zero.hpp"
  143. #include "oops/oop.inline.hpp"
  144. diff -Nur openjdk.orig/hotspot/src/os/linux/vm/os_linux.cpp openjdk/hotspot/src/os/linux/vm/os_linux.cpp
  145. --- openjdk.orig/hotspot/src/os/linux/vm/os_linux.cpp 2015-12-23 01:50:46.000000000 +0100
  146. +++ openjdk/hotspot/src/os/linux/vm/os_linux.cpp 2016-01-06 11:43:50.112090962 +0100
  147. @@ -94,7 +94,9 @@
  148. # include <string.h>
  149. # include <syscall.h>
  150. # include <sys/sysinfo.h>
  151. +# ifndef __UCLIBC__
  152. # include <gnu/libc-version.h>
  153. +# endif
  154. # include <sys/ipc.h>
  155. # include <sys/shm.h>
  156. # include <link.h>
  157. @@ -533,6 +535,7 @@
  158. # define _CS_GNU_LIBPTHREAD_VERSION 3
  159. # endif
  160. +# ifndef __UCLIBC__
  161. size_t n = confstr(_CS_GNU_LIBC_VERSION, NULL, 0);
  162. if (n > 0) {
  163. char *str = (char *)malloc(n, mtInternal);
  164. @@ -545,6 +548,10 @@
  165. "glibc %s %s", gnu_get_libc_version(), gnu_get_libc_release());
  166. os::Linux::set_glibc_version(_gnu_libc_version);
  167. }
  168. +# else
  169. + size_t n = 1;
  170. + os::Linux::set_glibc_version("2");
  171. +# endif
  172. n = confstr(_CS_GNU_LIBPTHREAD_VERSION, NULL, 0);
  173. if (n > 0) {
  174. @@ -2789,10 +2796,14 @@
  175. // If we are running with earlier version, which did not have symbol versions,
  176. // we should use the base version.
  177. void* os::Linux::libnuma_dlsym(void* handle, const char *name) {
  178. +#ifndef __UCLIBC__
  179. void *f = dlvsym(handle, name, "libnuma_1.1");
  180. if (f == NULL) {
  181. f = dlsym(handle, name);
  182. }
  183. +#else
  184. + void *f = dlsym(handle, name);
  185. +#endif
  186. return f;
  187. }
  188. @@ -4805,7 +4816,7 @@
  189. Linux::capture_initial_stack(JavaThread::stack_size_at_create());
  190. -#if defined(IA32)
  191. +#if defined(IA32) && !defined(ZERO)
  192. workaround_expand_exec_shield_cs_limit();
  193. #endif
  194. @@ -5437,6 +5448,43 @@
  195. // System loadavg support. Returns -1 if load average cannot be obtained.
  196. // Linux doesn't yet have a (official) notion of processor sets,
  197. // so just return the system wide load average.
  198. +#ifdef __UCLIBC__
  199. +static int getloadavg (double loadavg[], int nelem)
  200. +{
  201. + int fd;
  202. +
  203. + fd = open ("/proc/loadavg", O_RDONLY);
  204. + if (fd < 0)
  205. + return -1;
  206. + else
  207. + {
  208. + char buf[65], *p;
  209. + ssize_t nread;
  210. + int i;
  211. +
  212. + nread = read (fd, buf, sizeof buf - 1);
  213. + close (fd);
  214. + if (nread <= 0)
  215. + return -1;
  216. + buf[nread - 1] = '\0';
  217. +
  218. + if (nelem > 3)
  219. + nelem = 3;
  220. + p = buf;
  221. + for (i = 0; i < nelem; ++i)
  222. + {
  223. + char *endp;
  224. + loadavg[i] = strtod (p, &endp);
  225. + if (endp == p)
  226. + return -1;
  227. + p = endp;
  228. + }
  229. +
  230. + return i;
  231. + }
  232. +}
  233. +#endif
  234. +
  235. int os::loadavg(double loadavg[], int nelem) {
  236. return ::getloadavg(loadavg, nelem);
  237. }
  238. diff -Nur openjdk.orig/hotspot/src/share/vm/utilities/globalDefinitions_gcc.hpp openjdk/hotspot/src/share/vm/utilities/globalDefinitions_gcc.hpp
  239. --- openjdk.orig/hotspot/src/share/vm/utilities/globalDefinitions_gcc.hpp 2015-12-23 01:50:46.000000000 +0100
  240. +++ openjdk/hotspot/src/share/vm/utilities/globalDefinitions_gcc.hpp 2016-01-06 11:43:50.220083765 +0100
  241. @@ -223,6 +223,10 @@
  242. #define BREAKPOINT ::breakpoint()
  243. #endif
  244. +#ifdef __UCLIBC__
  245. +#define isnanf __isnanf
  246. +#endif
  247. +
  248. // checking for nanness
  249. #ifdef SOLARIS
  250. #ifdef SPARC
  251. @@ -249,8 +253,13 @@
  252. // Checking for finiteness
  253. +#ifdef __UCLIBC__
  254. +inline int g_isfinite(jfloat f) { return isfinite(f); }
  255. +inline int g_isfinite(jdouble f) { return isfinite(f); }
  256. +#else
  257. inline int g_isfinite(jfloat f) { return finite(f); }
  258. inline int g_isfinite(jdouble f) { return finite(f); }
  259. +#endif
  260. // Wide characters
  261. diff -Nur openjdk.orig/jdk/src/solaris/native/sun/xawt/XToolkit.c openjdk/jdk/src/solaris/native/sun/xawt/XToolkit.c
  262. --- openjdk.orig/jdk/src/solaris/native/sun/xawt/XToolkit.c 2015-12-23 01:50:56.000000000 +0100
  263. +++ openjdk/jdk/src/solaris/native/sun/xawt/XToolkit.c 2016-01-06 12:56:51.970983142 +0100
  264. @@ -27,7 +27,7 @@
  265. #include <X11/Xutil.h>
  266. #include <X11/Xos.h>
  267. #include <X11/Xatom.h>
  268. -#ifdef __linux__
  269. +#if defined(__GLIBC__) && !defined(__UCLIBC__)
  270. #include <execinfo.h>
  271. #endif
  272. @@ -799,7 +799,7 @@
  273. return ret;
  274. }
  275. -#ifdef __linux__
  276. +#if defined(__GLIBC__) && !defined(__UCLIBC__)
  277. void print_stack(void)
  278. {
  279. void *array[10];