uClibc-compat.patch 3.4 KB

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