--- old/src/hotspot/share/utilities/globalDefinitions_gcc.hpp 2020-05-20 18:00:44.978937412 -0700 +++ new/src/hotspot/share/utilities/globalDefinitions_gcc.hpp 2020-05-20 18:00:44.586929885 -0700 @@ -39,35 +39,15 @@ #include #include -#ifdef SOLARIS -#include -#endif // SOLARIS - #include #include #include #include #include -#ifdef SOLARIS -#include -#endif // SOLARIS - #include #include -#ifdef SOLARIS -#include -#include -#include -#include -#include -#endif // SOLARIS - -# ifdef SOLARIS_MUTATOR_LIBTHREAD -# include -# endif - #if defined(LINUX) || defined(_ALLBSD_SOURCE) #include #include @@ -81,34 +61,6 @@ #include #endif // LINUX || _ALLBSD_SOURCE -// 4810578: varargs unsafe on 32-bit integer/64-bit pointer architectures -// When __cplusplus is defined, NULL is defined as 0 (32-bit constant) in -// system header files. On 32-bit architectures, there is no problem. -// On 64-bit architectures, defining NULL as a 32-bit constant can cause -// problems with varargs functions: C++ integral promotion rules say for -// varargs, we pass the argument 0 as an int. So, if NULL was passed to a -// varargs function it will remain 32-bits. Depending on the calling -// convention of the machine, if the argument is passed on the stack then -// only 32-bits of the "NULL" pointer may be initialized to zero. The -// other 32-bits will be garbage. If the varargs function is expecting a -// pointer when it extracts the argument, then we have a problem. -// -// Solution: For 64-bit architectures, redefine NULL as 64-bit constant 0. -// -// Note: this fix doesn't work well on Linux because NULL will be overwritten -// whenever a system header file is included. Linux handles NULL correctly -// through a special type '__null'. -#ifdef SOLARIS - #ifdef _LP64 - #undef NULL - #define NULL 0L - #else - #ifndef NULL - #define NULL 0 - #endif - #endif -#endif - // NULL vs NULL_WORD: // On Linux NULL is defined as a special type '__null'. Assigning __null to // integer variable will cause gcc warning. Use NULL_WORD in places where a @@ -156,52 +108,8 @@ typedef uint32_t juint; typedef uint64_t julong; - -#ifdef SOLARIS -// ANSI C++ fixes -// NOTE:In the ANSI committee's continuing attempt to make each version -// of C++ incompatible with the previous version, you can no longer cast -// pointers to functions without specifying linkage unless you want to get -// warnings. -// -// This also means that pointers to functions can no longer be "hidden" -// in opaque types like void * because at the invokation point warnings -// will be generated. While this makes perfect sense from a type safety -// point of view it causes a lot of warnings on old code using C header -// files. Here are some typedefs to make the job of silencing warnings -// a bit easier. -// -// The final kick in the teeth is that you can only have extern "C" linkage -// specified at file scope. So these typedefs are here rather than in the -// .hpp for the class (os:Solaris usually) that needs them. - -extern "C" { - typedef int (*int_fnP_thread_t_iP_uP_stack_tP_gregset_t)(thread_t, int*, unsigned *, stack_t*, gregset_t); - typedef int (*int_fnP_thread_t_i_gregset_t)(thread_t, int, gregset_t); - typedef int (*int_fnP_thread_t_i)(thread_t, int); - typedef int (*int_fnP_thread_t)(thread_t); - - typedef int (*int_fnP_cond_tP_mutex_tP_timestruc_tP)(cond_t *cv, mutex_t *mx, timestruc_t *abst); - typedef int (*int_fnP_cond_tP_mutex_tP)(cond_t *cv, mutex_t *mx); - - // typedef for missing API in libc - typedef int (*int_fnP_mutex_tP_i_vP)(mutex_t *, int, void *); - typedef int (*int_fnP_mutex_tP)(mutex_t *); - typedef int (*int_fnP_cond_tP_i_vP)(cond_t *cv, int scope, void *arg); - typedef int (*int_fnP_cond_tP)(cond_t *cv); -}; -#endif // SOLARIS - // checking for nanness -#ifdef SOLARIS -#ifdef SPARC -inline int g_isnan(float f) { return isnanf(f); } -#else -// isnanf() broken on Intel Solaris use isnand() -inline int g_isnan(float f) { return isnand(f); } -#endif -inline int g_isnan(double f) { return isnand(f); } -#elif defined(__APPLE__) +#if defined(__APPLE__) inline int g_isnan(double f) { return isnan(f); } #elif defined(LINUX) || defined(_ALLBSD_SOURCE) inline int g_isnan(float f) { return isnanf(f); }