diff --git a/make/Hsdis.gmk b/make/Hsdis.gmk index df365a08021..13d84f964bc 100644 --- a/make/Hsdis.gmk +++ b/make/Hsdis.gmk @@ -144,7 +144,9 @@ $(eval $(call SetupJdkLibrary, BUILD_HSDIS, \ NAME := hsdis, \ LINK_TYPE := $(HSDIS_LINK_TYPE), \ SRC := $(TOPDIR)/src/utils/hsdis/$(HSDIS_BACKEND), \ - EXTRA_HEADER_DIRS := $(TOPDIR)/src/utils/hsdis, \ + EXTRA_HEADER_DIRS := \ + java.base:include \ + $(TOPDIR)/src/utils/hsdis, \ OUTPUT_DIR := $(HSDIS_OUTPUT_DIR), \ OBJECT_DIR := $(HSDIS_OUTPUT_DIR), \ DISABLED_WARNINGS_gcc := undef format-nonliteral sign-compare, \ diff --git a/src/utils/hsdis/binutils/hsdis-binutils.c b/src/utils/hsdis/binutils/hsdis-binutils.c index d011dc579b5..fda6a53a6d3 100644 --- a/src/utils/hsdis/binutils/hsdis-binutils.c +++ b/src/utils/hsdis/binutils/hsdis-binutils.c @@ -120,10 +120,8 @@ static const char* format_insn_close(const char* close, disassemble_info* dinfo, char* buf, size_t bufsize); +JNIEXPORT void* -#ifdef DLL_ENTRY - DLL_ENTRY -#endif decode_instructions_virtual(uintptr_t start_va, uintptr_t end_va, unsigned char* buffer, uintptr_t length, event_callback_t event_callback_arg, void* event_stream_arg, @@ -145,10 +143,8 @@ decode_instructions_virtual(uintptr_t start_va, uintptr_t end_va, } /* This is the compatability interface for older version of hotspot */ +JNIEXPORT void* -#ifdef DLL_ENTRY - DLL_ENTRY -#endif decode_instructions(void* start_pv, void* end_pv, event_callback_t event_callback_arg, void* event_stream_arg, printf_callback_t printf_callback_arg, void* printf_stream_arg, diff --git a/src/utils/hsdis/capstone/hsdis-capstone.c b/src/utils/hsdis/capstone/hsdis-capstone.c index 410b88eb2db..015a617fd8a 100644 --- a/src/utils/hsdis/capstone/hsdis-capstone.c +++ b/src/utils/hsdis/capstone/hsdis-capstone.c @@ -120,9 +120,7 @@ static Options parse_options(const char* options, printf_callback_t printf_callb return ops; } -#ifdef _WIN32 -__declspec(dllexport) -#endif +JNIEXPORT void* decode_instructions_virtual(uintptr_t start_va, uintptr_t end_va, unsigned char* buffer, uintptr_t length, event_callback_t event_callback, diff --git a/src/utils/hsdis/hsdis.h b/src/utils/hsdis/hsdis.h index 7e3b8e397af..ecb3a40a5b5 100644 --- a/src/utils/hsdis/hsdis.h +++ b/src/utils/hsdis/hsdis.h @@ -72,6 +72,8 @@ #ifndef SHARED_TOOLS_HSDIS_H #define SHARED_TOOLS_HSDIS_H +#include "jni.h" + #ifdef __cplusplus extern "C" { diff --git a/src/utils/hsdis/llvm/hsdis-llvm.cpp b/src/utils/hsdis/llvm/hsdis-llvm.cpp index 34edfac2113..ec08c9e6004 100644 --- a/src/utils/hsdis/llvm/hsdis-llvm.cpp +++ b/src/utils/hsdis/llvm/hsdis-llvm.cpp @@ -328,6 +328,7 @@ class hsdis_backend : public hsdis_backend_base { }; +JNIEXPORT void* decode_instructions_virtual(uintptr_t start_va, uintptr_t end_va, unsigned char* buffer, uintptr_t length, event_callback_t event_callback_arg, void* event_stream_arg, @@ -342,6 +343,7 @@ void* decode_instructions_virtual(uintptr_t start_va, uintptr_t end_va, } /* This is the compatability interface for older version of hotspot */ +JNIEXPORT void* decode_instructions(void* start_pv, void* end_pv, event_callback_t event_callback_arg, void* event_stream_arg, printf_callback_t printf_callback_arg, void* printf_stream_arg,