openadk.patch 5.0 KB

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