8136556: Add the ability to perform static builds of MacOSX x64 binaries

Reviewed-by: ihse, bdelsart, gadams, lfoltan, rriggs, hseigel, twisti
This commit is contained in:
Bob Vandette 2015-10-19 13:21:37 -04:00
parent 119988f54a
commit d65d34b99d
11 changed files with 128 additions and 38 deletions

View file

@ -442,6 +442,10 @@ void os::init_system_properties_values() {
if (pslash != NULL) {
*pslash = '\0'; // Get rid of /{client|server|hotspot}.
}
#ifdef STATIC_BUILD
strcat(buf, "/lib");
#endif
Arguments::set_dll_dir(buf);
if (pslash != NULL) {
@ -1390,6 +1394,9 @@ bool os::dll_address_to_library_name(address addr, char* buf,
#ifdef __APPLE__
void * os::dll_load(const char *filename, char *ebuf, int ebuflen) {
#ifdef STATIC_BUILD
return os::get_default_process_handle();
#else
void * result= ::dlopen(filename, RTLD_LAZY);
if (result != NULL) {
// Successful loading
@ -1401,9 +1408,13 @@ void * os::dll_load(const char *filename, char *ebuf, int ebuflen) {
ebuf[ebuflen-1]='\0';
return NULL;
#endif // STATIC_BUILD
}
#else
void * os::dll_load(const char *filename, char *ebuf, int ebuflen) {
#ifdef STATIC_BUILD
return os::get_default_process_handle();
#else
void * result= ::dlopen(filename, RTLD_LAZY);
if (result != NULL) {
// Successful loading
@ -1576,6 +1587,7 @@ void * os::dll_load(const char *filename, char *ebuf, int ebuflen) {
}
return NULL;
#endif // STATIC_BUILD
}
#endif // !__APPLE__