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

@ -88,6 +88,12 @@ bool Disassembler::load_library() {
os::jvm_path(buf, sizeof(buf));
int jvm_offset = -1;
int lib_offset = -1;
#ifdef STATIC_BUILD
char* p = strrchr(buf, '/');
*p = '\0';
strcat(p, "/lib/");
lib_offset = jvm_offset = strlen(buf);
#else
{
// Match "jvm[^/]*" in jvm_path.
const char* base = buf;
@ -96,6 +102,7 @@ bool Disassembler::load_library() {
p = strstr(p ? p : base, "jvm");
if (p != NULL) jvm_offset = p - base;
}
#endif
// Find the disassembler shared library.
// Search for several paths derived from libjvm, in this order:
// 1. <home>/jre/lib/<arch>/<vm>/libhsdis-<arch>.so (for compatibility)