uClibc-compat.patch 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. --- w-openjdk-6-1.orig/openjdk-6/hotspot/src/os/linux/vm/os_linux.cpp 2011-02-28 17:03:14.000000000 +0100
  2. +++ w-openjdk-6-1/openjdk-6/hotspot/src/os/linux/vm/os_linux.cpp 2011-08-07 14:30:00.195403776 +0200
  3. @@ -53,7 +53,6 @@
  4. # include <string.h>
  5. # include <syscall.h>
  6. # include <sys/sysinfo.h>
  7. -# include <gnu/libc-version.h>
  8. # include <sys/ipc.h>
  9. # include <sys/shm.h>
  10. # include <link.h>
  11. @@ -553,9 +552,10 @@
  12. os::Linux::set_glibc_version(str);
  13. } else {
  14. // _CS_GNU_LIBC_VERSION is not supported, try gnu_get_libc_version()
  15. - static char _gnu_libc_version[32];
  16. - jio_snprintf(_gnu_libc_version, sizeof(_gnu_libc_version),
  17. - "glibc %s %s", gnu_get_libc_version(), gnu_get_libc_release());
  18. + // static char _gnu_libc_version[32];
  19. + // jio_snprintf(_gnu_libc_version, sizeof(_gnu_libc_version),
  20. + // "glibc %s %s", gnu_get_libc_version(), gnu_get_libc_release());
  21. + static char _gnu_libc_version[32] = "2.12";
  22. os::Linux::set_glibc_version(_gnu_libc_version);
  23. }
  24. @@ -2434,10 +2434,8 @@
  25. // If we are running with earlier version, which did not have symbol versions,
  26. // we should use the base version.
  27. void* os::Linux::libnuma_dlsym(void* handle, const char *name) {
  28. - void *f = dlvsym(handle, name, "libnuma_1.1");
  29. - if (f == NULL) {
  30. - f = dlsym(handle, name);
  31. - }
  32. + void *f;
  33. + f = dlsym(handle, name);
  34. return f;
  35. }
  36. @@ -4446,7 +4444,21 @@
  37. // Linux doesn't yet have a (official) notion of processor sets,
  38. // so just return the system wide load average.
  39. int os::loadavg(double loadavg[], int nelem) {
  40. - return ::getloadavg(loadavg, nelem);
  41. + FILE *LOADAVG;
  42. + double avg[3] = { 0.0, 0.0, 0.0 };
  43. + int i, res = -1;;
  44. +
  45. + if ((LOADAVG = fopen("/proc/loadavg", "r"))) {
  46. + fscanf(LOADAVG, "%lf %lf %lf", &avg[0], &avg[1], &avg[2]);
  47. + res = 0;
  48. + fclose(LOADAVG);
  49. + }
  50. +
  51. + for (i = 0; (i < nelem) && (i < 3); i++) {
  52. + loadavg[i] = avg[i];
  53. + }
  54. +
  55. + return res;
  56. }
  57. void os::pause() {
  58. --- w-openjdk-6-1.orig/openjdk-6/hotspot/make/linux/platform_zero.in 2011-02-28 17:03:13.000000000 +0100
  59. +++ w-openjdk-6-1/openjdk-6/hotspot/make/linux/platform_zero.in 2011-08-07 13:56:56.875281880 +0200
  60. @@ -14,4 +14,4 @@
  61. gnu_dis_arch = zero
  62. -sysdefs = -DLINUX -D_GNU_SOURCE -DCC_INTERP -DZERO -D@ZERO_ARCHDEF@ -DZERO_LIBARCH=\"@ZERO_LIBARCH@\"
  63. +sysdefs = -DLINUX -D_GNU_SOURCE -DCC_INTERP -DZERO -D@ZERO_ARCHDEF@ -DZERO_LIBARCH=\"@ZERO_LIBARCH@\" -D__STDC_LIMIT_MACROS
  64. --- w-openjdk-6-1.orig/openjdk-6/hotspot/src/share/vm/utilities/globalDefinitions_gcc.hpp 2011-02-28 17:03:22.000000000 +0100
  65. +++ w-openjdk-6-1/openjdk-6/hotspot/src/share/vm/utilities/globalDefinitions_gcc.hpp 2011-08-07 12:32:09.325489647 +0200
  66. @@ -238,7 +238,7 @@
  67. #endif
  68. inline int g_isnan(double f) { return isnand(f); }
  69. #elif LINUX
  70. -inline int g_isnan(float f) { return isnanf(f); }
  71. +inline int g_isnan(float f) { return __isnanf(f); }
  72. inline int g_isnan(double f) { return isnan(f); }
  73. #else
  74. #error "missing platform-specific definition here"
  75. @@ -252,8 +252,8 @@
  76. // Checking for finiteness
  77. -inline int g_isfinite(jfloat f) { return finite(f); }
  78. -inline int g_isfinite(jdouble f) { return finite(f); }
  79. +inline int g_isfinite(jfloat f) { return isfinite(f); }
  80. +inline int g_isfinite(jdouble f) { return isfinite(f); }
  81. // Wide characters