--- a/make/hotspot/lib/CompileDtraceLibraries.gmk Thu Sep 13 13:30:07 2018 -0400
+++ b/make/hotspot/lib/CompileDtraceLibraries.gmk Thu Sep 13 21:12:22 2018 +0200
@@ -25,6 +25,10 @@
ifeq ($(call check-jvm-feature, dtrace), true)
ifeq ($(OPENJDK_TARGET_OS), solaris)
+ JNI_INCLUDE_FLAGS := \
+ -I$(SUPPORT_OUTPUTDIR)/modules_include/java.base \
+ -I$(SUPPORT_OUTPUTDIR)/modules_include/java.base/$(OPENJDK_TARGET_OS_INCLUDE_SUBDIR) \
+ #
############################################################################
# Build the stand-alone dtrace libraries.
@@ -34,10 +38,9 @@
NAME := jvm_dtrace, \
OUTPUT_DIR := $(JVM_LIB_OUTPUTDIR), \
SRC := $(TOPDIR)/src/java.base/solaris/native/libjvm_dtrace, \
- CFLAGS := -m64 -G -mt -KPIC, \
+ CFLAGS := $(JNI_INCLUDE_FLAGS) -m64 -G -mt -KPIC -xldscope=hidden, \
LDFLAGS := -m64 -mt -xnolib $(SHARED_LIBRARY_FLAGS), \
LIBS := $(LIBDL) -lthread -ldoor, \
- MAPFILE := $(TOPDIR)/make/mapfiles/libjvm_dtrace/mapfile-vers, \
OBJECT_DIR := $(LIBJVM_DTRACE_OUTPUTDIR)/objs, \
))
@@ -48,9 +51,8 @@
NAME := jvm_db, \
OUTPUT_DIR := $(JVM_LIB_OUTPUTDIR), \
SRC := $(TOPDIR)/src/java.base/solaris/native/libjvm_db, \
- CFLAGS := -I$(DTRACE_GENSRC_DIR) -m64 -G -mt -KPIC, \
+ CFLAGS := -I$(DTRACE_GENSRC_DIR) $(JNI_INCLUDE_FLAGS) -m64 -G -mt -KPIC -xldscope=hidden, \
LDFLAGS := -m64 -mt -xnolib $(SHARED_LIBRARY_FLAGS), \
- MAPFILE := $(TOPDIR)/make/mapfiles/libjvm_db/mapfile-vers, \
OBJECT_DIR := $(LIBJVM_DB_OUTPUTDIR)/objs, \
))
--- a/make/mapfiles/libjsound/mapfile-vers Thu Sep 13 13:30:07 2018 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,83 +0,0 @@
-#
-# Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation. Oracle designates this
-# particular file as subject to the "Classpath" exception as provided
-# by Oracle in the LICENSE file that accompanied this code.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-# or visit www.oracle.com if you need additional information or have any
-# questions.
-#
-
-# Define library interface.
-
-SUNWprivate_1.1 {
- global:
- Java_com_sun_media_sound_DirectAudioDevice_nAvailable;
- Java_com_sun_media_sound_DirectAudioDevice_nClose;
- Java_com_sun_media_sound_DirectAudioDevice_nFlush;
- Java_com_sun_media_sound_DirectAudioDevice_nGetBufferSize;
- Java_com_sun_media_sound_DirectAudioDevice_nGetBytePosition;
- Java_com_sun_media_sound_DirectAudioDevice_nGetFormats;
- Java_com_sun_media_sound_DirectAudioDevice_nIsStillDraining;
- Java_com_sun_media_sound_DirectAudioDevice_nOpen;
- Java_com_sun_media_sound_DirectAudioDevice_nRead;
- Java_com_sun_media_sound_DirectAudioDevice_nRequiresServicing;
- Java_com_sun_media_sound_DirectAudioDevice_nService;
- Java_com_sun_media_sound_DirectAudioDevice_nSetBytePosition;
- Java_com_sun_media_sound_DirectAudioDevice_nStart;
- Java_com_sun_media_sound_DirectAudioDevice_nStop;
- Java_com_sun_media_sound_DirectAudioDevice_nWrite;
- Java_com_sun_media_sound_DirectAudioDeviceProvider_nGetNumDevices;
- Java_com_sun_media_sound_DirectAudioDeviceProvider_nNewDirectAudioDeviceInfo;
- Java_com_sun_media_sound_MidiInDevice_nClose;
- Java_com_sun_media_sound_MidiInDevice_nGetMessages;
- Java_com_sun_media_sound_MidiInDevice_nGetTimeStamp;
- Java_com_sun_media_sound_MidiInDevice_nOpen;
- Java_com_sun_media_sound_MidiInDevice_nStart;
- Java_com_sun_media_sound_MidiInDevice_nStop;
- Java_com_sun_media_sound_MidiInDeviceProvider_nGetDescription;
- Java_com_sun_media_sound_MidiInDeviceProvider_nGetName;
- Java_com_sun_media_sound_MidiInDeviceProvider_nGetNumDevices;
- Java_com_sun_media_sound_MidiInDeviceProvider_nGetVendor;
- Java_com_sun_media_sound_MidiInDeviceProvider_nGetVersion;
- Java_com_sun_media_sound_MidiOutDevice_nClose;
- Java_com_sun_media_sound_MidiOutDevice_nGetTimeStamp;
- Java_com_sun_media_sound_MidiOutDevice_nOpen;
- Java_com_sun_media_sound_MidiOutDevice_nSendLongMessage;
- Java_com_sun_media_sound_MidiOutDevice_nSendShortMessage;
- Java_com_sun_media_sound_MidiOutDeviceProvider_nGetDescription;
- Java_com_sun_media_sound_MidiOutDeviceProvider_nGetName;
- Java_com_sun_media_sound_MidiOutDeviceProvider_nGetNumDevices;
- Java_com_sun_media_sound_MidiOutDeviceProvider_nGetVendor;
- Java_com_sun_media_sound_MidiOutDeviceProvider_nGetVersion;
- Java_com_sun_media_sound_Platform_nIsBigEndian;
- Java_com_sun_media_sound_PortMixer_nClose;
- Java_com_sun_media_sound_PortMixer_nControlGetFloatValue;
- Java_com_sun_media_sound_PortMixer_nControlGetIntValue;
- Java_com_sun_media_sound_PortMixer_nControlSetFloatValue;
- Java_com_sun_media_sound_PortMixer_nControlSetIntValue;
- Java_com_sun_media_sound_PortMixer_nGetControls;
- Java_com_sun_media_sound_PortMixer_nGetPortCount;
- Java_com_sun_media_sound_PortMixer_nGetPortName;
- Java_com_sun_media_sound_PortMixer_nGetPortType;
- Java_com_sun_media_sound_PortMixer_nOpen;
- Java_com_sun_media_sound_PortMixerProvider_nGetNumDevices;
- Java_com_sun_media_sound_PortMixerProvider_nNewPortMixerInfo;
- local:
- *;
-};
--- a/make/mapfiles/libjvm_db/mapfile-vers Thu Sep 13 13:30:07 2018 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,38 +0,0 @@
-#
-
-#
-# Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-# or visit www.oracle.com if you need additional information or have any
-# questions.
-#
-#
-
-# Define library interface.
-
-SUNWprivate_1.1 {
- global:
- Jagent_create;
- Jagent_destroy;
- Jframe_iter;
- #Jget_vframe;
- #Jlookup_by_regs;
- local:
- *;
-};
--- a/make/mapfiles/libjvm_dtrace/mapfile-vers Thu Sep 13 13:30:07 2018 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,37 +0,0 @@
-#
-
-#
-# Copyright (c) 2006, 2008, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-# or visit www.oracle.com if you need additional information or have any
-# questions.
-#
-#
-
-# Define library interface for JVM-DTrace interface
-
-SUNWprivate_1.1 {
- global:
- jvm_attach;
- jvm_get_last_error;
- jvm_enable_dtprobes;
- jvm_detach;
- local:
- *;
-};
--- a/src/java.base/solaris/native/libjvm_db/libjvm_db.h Thu Sep 13 13:30:07 2018 -0400
+++ b/src/java.base/solaris/native/libjvm_db/libjvm_db.h Thu Sep 13 21:12:22 2018 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,7 @@
#define OS_SOLARIS_DTRACE_LIBJVM_DB_H
#include <proc_service.h>
+#include "jni.h"
#ifdef __cplusplus
extern "C" {
@@ -35,7 +36,7 @@
#define JVM_DB_VERSION 1
-jvm_agent_t *Jagent_create(struct ps_prochandle *P, int vers);
+JNIEXPORT jvm_agent_t *Jagent_create(struct ps_prochandle *P, int vers);
/*
* Called from Jframe_iter() for each java frame. If it returns 0, then
@@ -57,9 +58,9 @@
* frames were found, or if there was some unrecoverable error. Otherwise,
* returns the last value returned from 'func'.
*/
-int Jframe_iter(jvm_agent_t *agent, prgregset_t gregs, java_stack_f *func, void* cld);
+JNIEXPORT int Jframe_iter(jvm_agent_t *agent, prgregset_t gregs, java_stack_f *func, void* cld);
-void Jagent_destroy(jvm_agent_t *J);
+JNIEXPORT void Jagent_destroy(jvm_agent_t *J);
#ifdef __cplusplus
} /* extern "C" */
--- a/src/java.base/solaris/native/libjvm_dtrace/jvm_dtrace.h Thu Sep 13 13:30:07 2018 -0400
+++ b/src/java.base/solaris/native/libjvm_dtrace/jvm_dtrace.h Thu Sep 13 21:12:22 2018 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -36,7 +36,7 @@
#endif
#include <sys/types.h>
-
+#include "jni.h"
struct _jvm_t;
typedef struct _jvm_t jvm_t;
@@ -44,10 +44,10 @@
/* Attach to the given JVM process. Returns NULL on failure.
jvm_get_last_error() returns last error message. */
-jvm_t* jvm_attach(pid_t pid);
+JNIEXPORT jvm_t* jvm_attach(pid_t pid);
/* Returns the last error message from this library or NULL if none. */
-const char* jvm_get_last_error();
+JNIEXPORT const char* jvm_get_last_error();
/* few well-known probe type constants for 'probe_types' param below */
@@ -68,7 +68,7 @@
* On success, this returns number of probe_types enabled.
* On failure, jvm_get_last_error() returns the last error message.
*/
-int jvm_enable_dtprobes(jvm_t* jvm, int num_probe_types, const char** probe_types);
+JNIEXPORT int jvm_enable_dtprobes(jvm_t* jvm, int num_probe_types, const char** probe_types);
/* Note: There is no jvm_disable_dtprobes function. Probes are automatically
* disabled when there are no more clients requiring those probes.
@@ -77,7 +77,7 @@
/* Detach the given JVM. Returns 0 on success, -1 on failure.
* jvm_get_last_error() returns the last error message.
*/
-int jvm_detach(jvm_t* jvm);
+JNIEXPORT int jvm_detach(jvm_t* jvm);
#ifdef __cplusplus
}