First stab at removing mapfiles. ihse-remove-mapfiles-branch
authorihse
Tue, 13 Feb 2018 10:37:33 +0100
branchihse-remove-mapfiles-branch
changeset 56106 40e61db323c2
parent 56105 749e0ffa206f
child 56107 706dba352bda
First stab at removing mapfiles.
make/lib/CoreLibraries.gmk
make/lib/Lib-jdk.jdi.gmk
make/lib/Lib-jdk.jdwp.agent.gmk
make/lib/LibCommon.gmk
src/java.base/share/native/libjava/jni_util.h
src/java.base/share/native/libjimage/jimage.cpp
src/java.base/share/native/libjimage/jimage.hpp
src/java.base/share/native/libjli/args.c
src/java.base/share/native/libjli/java.c
src/java.base/share/native/libjli/java.h
src/java.base/share/native/libjli/jli_util.c
src/java.base/share/native/libjli/jli_util.h
src/java.base/share/native/libjli/manifest_info.h
src/java.base/share/native/libjli/parse_manifest.c
src/java.base/share/native/libzip/CRC32.c
src/java.base/share/native/libzip/zip_util.c
src/java.base/share/native/libzip/zip_util.h
src/java.base/unix/native/libjava/jni_util_md.c
src/java.base/unix/native/libjli/java_md_common.c
src/java.base/windows/native/libjava/io_util_md.c
src/java.base/windows/native/libjava/io_util_md.h
src/java.base/windows/native/libjava/jni_util_md.c
src/java.base/windows/native/libjli/cmdtoargs.c
src/java.base/windows/native/libjli/java_md.c
src/java.desktop/share/native/libawt/awt/image/cvutils/img_colors.c
src/java.desktop/share/native/libawt/awt/image/cvutils/img_colors.h
src/java.desktop/share/native/libawt/awt/image/cvutils/img_globals.c
src/java.desktop/share/native/libawt/awt/image/cvutils/img_globals.h
src/java.desktop/share/native/libawt/awt/image/dither.c
src/java.desktop/share/native/libawt/awt/image/dither.h
src/java.desktop/share/native/libawt/awt/image/imageInitIDs.h
src/java.desktop/share/native/libawt/java2d/SurfaceData.c
src/java.desktop/share/native/libawt/java2d/SurfaceData.h
src/java.desktop/share/native/libawt/java2d/loops/AlphaMath.c
src/java.desktop/share/native/libawt/java2d/loops/AlphaMath.h
src/java.desktop/share/native/libawt/java2d/loops/GraphicsPrimitiveMgr.c
src/java.desktop/share/native/libawt/java2d/loops/GraphicsPrimitiveMgr.h
src/java.desktop/share/native/libawt/java2d/loops/ProcessPath.c
src/java.desktop/share/native/libawt/java2d/loops/ProcessPath.h
src/java.desktop/unix/native/common/awt/img_util_md.h
src/java.desktop/unix/native/libawt/awt/awt_LoadLibrary.c
src/java.desktop/unix/native/libawt/awt/initIDs.c
src/java.desktop/windows/native/libawt/windows/img_util_md.h
src/jdk.jdi/share/native/libdt_shmem/shmemBack.c
src/jdk.jdwp.agent/share/native/libdt_socket/socketTransport.c
--- a/make/lib/CoreLibraries.gmk	Tue Feb 13 10:36:52 2018 +0100
+++ b/make/lib/CoreLibraries.gmk	Tue Feb 13 10:37:33 2018 +0100
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 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
@@ -171,9 +171,7 @@
     LDFLAGS := $(LDFLAGS_JDKLIB) \
         $(call SET_SHARED_LIBRARY_ORIGIN), \
     LDFLAGS_macosx := -L$(SUPPORT_OUTPUTDIR)/native/$(MODULE)/, \
-    LDFLAGS_windows := -export:winFileHandleOpen -export:handleLseek \
-        -export:getLastErrorString \
-        -export:getErrorString -delayload:shell32.dll, \
+    LDFLAGS_windows := -delayload:shell32.dll, \
     LIBS_unix := -ljvm -lverify, \
     LIBS_linux := $(LIBDL) $(BUILD_LIBFDLIBM), \
     LIBS_solaris := -lsocket -lnsl -lscf $(LIBDL) $(BUILD_LIBFDLIBM) -lc, \
@@ -235,9 +233,6 @@
     REORDER := $(BUILD_LIBZIP_REORDER), \
     LDFLAGS := $(LDFLAGS_JDKLIB) \
         $(call SET_SHARED_LIBRARY_ORIGIN), \
-    LDFLAGS_windows := -export:ZIP_Open -export:ZIP_Close -export:ZIP_FindEntry \
-        -export:ZIP_ReadEntry -export:ZIP_GetNextEntry \
-        -export:ZIP_InflateFully -export:ZIP_CRC32 -export:ZIP_FreeEntry, \
     LIBS_unix := -ljvm -ljava $(LIBZ_LIBS), \
     LIBS_solaris := -lc, \
     LIBS_windows := jvm.lib $(WIN_JAVA_LIB), \
@@ -277,10 +272,6 @@
     MAPFILE := $(TOPDIR)/make/mapfiles/libjimage/mapfile-vers, \
     LDFLAGS := $(LDFLAGS_JDKLIB) $(LDFLAGS_CXX_JDK) \
         $(call SET_SHARED_LIBRARY_ORIGIN), \
-    LDFLAGS_windows := -export:JIMAGE_Open -export:JIMAGE_Close \
-        -export:JIMAGE_PackageToModule \
-        -export:JIMAGE_FindResource -export:JIMAGE_GetResource \
-        -export:JIMAGE_ResourceIterator -export:JIMAGE_ResourcePath, \
     LIBS_unix := -ljvm -ldl $(LIBCXX), \
     LIBS_solaris := -lc, \
     LIBS_macosx := -lc++, \
@@ -375,26 +366,6 @@
         $(call SET_SHARED_LIBRARY_ORIGIN), \
     LDFLAGS_linux := $(call SET_SHARED_LIBRARY_ORIGIN,/..), \
     LDFLAGS_solaris := $(call SET_SHARED_LIBRARY_ORIGIN,/..), \
-    LDFLAGS_windows := \
-        -export:JLI_Launch \
-        -export:JLI_ManifestIterate \
-        -export:JLI_SetTraceLauncher \
-        -export:JLI_ReportErrorMessage \
-        -export:JLI_ReportErrorMessageSys \
-        -export:JLI_ReportMessage \
-        -export:JLI_ReportExceptionDescription \
-        -export:JLI_MemAlloc \
-        -export:JLI_CmdToArgs \
-        -export:JLI_GetStdArgc \
-        -export:JLI_GetStdArgs \
-        -export:JLI_List_new \
-        -export:JLI_List_add \
-        -export:JLI_StringDup \
-        -export:JLI_MemFree \
-        -export:JLI_InitArgProcessing \
-        -export:JLI_PreprocessArg \
-        -export:JLI_AddArgsFromEnvVar \
-        -export:JLI_GetAppArgIndex, \
     LIBS_unix := $(LIBZ_LIBS), \
     LIBS_linux := $(LIBDL) -lc -lpthread, \
     LIBS_solaris := $(LIBDL) -lc, \
--- a/make/lib/Lib-jdk.jdi.gmk	Tue Feb 13 10:36:52 2018 +0100
+++ b/make/lib/Lib-jdk.jdi.gmk	Tue Feb 13 10:37:33 2018 +0100
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 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
@@ -47,7 +47,6 @@
       CFLAGS := $(CFLAGS_JDKLIB) -DUSE_MMAP \
           $(LIBDT_SHMEM_CPPFLAGS), \
       LDFLAGS := $(LDFLAGS_JDKLIB), \
-      LDFLAGS_windows := -export:jdwpTransport_OnLoad, \
       LIBS := $(JDKLIB_LIBS), \
       VERSIONINFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE), \
       RC_FLAGS := $(RC_FLAGS) \
--- a/make/lib/Lib-jdk.jdwp.agent.gmk	Tue Feb 13 10:36:52 2018 +0100
+++ b/make/lib/Lib-jdk.jdwp.agent.gmk	Tue Feb 13 10:37:33 2018 +0100
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 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
@@ -47,7 +47,6 @@
     MAPFILE := $(TOPDIR)/make/mapfiles/libdt_socket/mapfile-vers, \
     LDFLAGS := $(LDFLAGS_JDKLIB) \
         $(call SET_SHARED_LIBRARY_ORIGIN), \
-    LDFLAGS_windows := -export:jdwpTransport_OnLoad, \
     LIBS_linux := -lpthread, \
     LIBS_solaris := -lnsl -lsocket -lc, \
     LIBS_windows := $(JDKLIB_LIBS) ws2_32.lib, \
--- a/make/lib/LibCommon.gmk	Tue Feb 13 10:36:52 2018 +0100
+++ b/make/lib/LibCommon.gmk	Tue Feb 13 10:37:33 2018 +0100
@@ -36,6 +36,9 @@
 # elegant solution to this.
 WIN_JAVA_LIB := $(SUPPORT_OUTPUTDIR)/native/java.base/libjava/java.lib
 
+DISABLE_MAPFILES := true
+CFLAGS_JDKLIB := -fvisibility=hidden $(CFLAGS_JDKLIB)
+
 ifneq ($(findstring $(OPENJDK_TARGET_OS), macosx windows), )
   DISABLE_MAPFILES := true
 endif
--- a/src/java.base/share/native/libjava/jni_util.h	Tue Feb 13 10:36:52 2018 +0100
+++ b/src/java.base/share/native/libjava/jni_util.h	Tue Feb 13 10:37:33 2018 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -395,8 +395,8 @@
 void buildJniFunctionName(const char *sym, const char *cname,
                           char *jniEntryName);
 
-extern size_t getLastErrorString(char *buf, size_t len);
-extern int getErrorString(int err, char *buf, size_t len);
+JNIEXPORT size_t getLastErrorString(char *buf, size_t len);
+JNIEXPORT int getErrorString(int err, char *buf, size_t len);
 
 #ifdef STATIC_BUILD
 /* Macros for handling declaration of static/dynamic
--- a/src/java.base/share/native/libjimage/jimage.cpp	Tue Feb 13 10:36:52 2018 +0100
+++ b/src/java.base/share/native/libjimage/jimage.cpp	Tue Feb 13 10:37:33 2018 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -55,7 +55,7 @@
  *   }
  *   ...
  */
-extern "C" JImageFile* JIMAGE_Open(const char *name, jint* error) {
+extern "C" JNIEXPORT JImageFile* JIMAGE_Open(const char *name, jint* error) {
     // TODO - return a meaningful error code
     *error = 0;
     ImageFileReader* jfile = ImageFileReader::open(name);
@@ -71,7 +71,7 @@
  * Ex.
  *  (*JImageClose)(image);
  */
-extern "C" void JIMAGE_Close(JImageFile* image) {
+extern "C" JNIEXPORT void JIMAGE_Close(JImageFile* image) {
     ImageFileReader::close((ImageFileReader*) image);
 }
 
@@ -87,7 +87,7 @@
  *  tty->print_cr(package);
  *  -> java.base
  */
-extern "C" const char* JIMAGE_PackageToModule(JImageFile* image, const char* package_name) {
+extern "C" JNIEXPORT const char* JIMAGE_PackageToModule(JImageFile* image, const char* package_name) {
     return ((ImageFileReader*) image)->get_image_module_data()->package_to_module(package_name);
 }
 
@@ -105,7 +105,7 @@
  *   JImageLocationRef location = (*JImageFindResource)(image,
  *                                 "java.base", "9.0", "java/lang/String.class", &size);
  */
-extern "C" JImageLocationRef JIMAGE_FindResource(JImageFile* image,
+extern "C" JNIEXPORT JImageLocationRef JIMAGE_FindResource(JImageFile* image,
         const char* module_name, const char* version, const char* name,
         jlong* size) {
     // Concatenate to get full path
@@ -151,7 +151,7 @@
  *  char* buffer = new char[size];
  *  (*JImageGetResource)(image, location, buffer, size);
  */
-extern "C" jlong JIMAGE_GetResource(JImageFile* image, JImageLocationRef location,
+extern "C" JNIEXPORT jlong JIMAGE_GetResource(JImageFile* image, JImageLocationRef location,
         char* buffer, jlong size) {
     ((ImageFileReader*) image)->get_resource((u4) location, (u1*) buffer);
     return size;
@@ -179,7 +179,7 @@
  *   }
  *   (*JImageResourceIterator)(image, ctw_visitor, loader);
  */
-extern "C" void JIMAGE_ResourceIterator(JImageFile* image,
+extern "C" JNIEXPORT void JIMAGE_ResourceIterator(JImageFile* image,
         JImageResourceVisitor_t visitor, void* arg) {
     ImageFileReader* imageFile = (ImageFileReader*) image;
     u4 nEntries = imageFile->table_length();
@@ -220,7 +220,7 @@
  *   char path[JIMAGE_MAX_PATH];
  *    (*JImageResourcePath)(image, location, path, JIMAGE_MAX_PATH);
  */
-extern "C" bool JIMAGE_ResourcePath(JImageFile* image, JImageLocationRef locationRef,
+extern "C" JNIEXPORT bool JIMAGE_ResourcePath(JImageFile* image, JImageLocationRef locationRef,
                                     char* path, size_t max) {
     ImageFileReader* imageFile = (ImageFileReader*) image;
 
--- a/src/java.base/share/native/libjimage/jimage.hpp	Tue Feb 13 10:36:52 2018 +0100
+++ b/src/java.base/share/native/libjimage/jimage.hpp	Tue Feb 13 10:37:33 2018 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -72,7 +72,7 @@
  *   ...
  */
 
-extern "C" JImageFile* JIMAGE_Open(const char *name, jint* error);
+extern "C" JNIEXPORT JImageFile* JIMAGE_Open(const char *name, jint* error);
 
 typedef JImageFile* (*JImageOpen_t)(const char *name, jint* error);
 
@@ -86,7 +86,7 @@
  *  (*JImageClose)(image);
  */
 
-extern "C" void JIMAGE_Close(JImageFile* jimage);
+extern "C" JNIEXPORT void JIMAGE_Close(JImageFile* jimage);
 
 typedef void (*JImageClose_t)(JImageFile* jimage);
 
@@ -104,7 +104,7 @@
  *  -> java.base
  */
 
-extern "C" const char * JIMAGE_PackageToModule(JImageFile* jimage, const char* package_name);
+extern "C" JNIEXPORT const char * JIMAGE_PackageToModule(JImageFile* jimage, const char* package_name);
 
 typedef const char* (*JImagePackageToModule_t)(JImageFile* jimage, const char* package_name);
 
@@ -123,7 +123,7 @@
  *   JImageLocationRef location = (*JImageFindResource)(image,
  *                                "java.base", "9.0", "java/lang/String.class", &size);
  */
-extern "C" JImageLocationRef JIMAGE_FindResource(JImageFile* jimage,
+extern "C" JNIEXPORT JImageLocationRef JIMAGE_FindResource(JImageFile* jimage,
         const char* module_name, const char* version, const char* name,
         jlong* size);
 
@@ -147,7 +147,7 @@
  *  char* buffer = new char[size];
  *  (*JImageGetResource)(image, location, buffer, size);
  */
-extern "C" jlong JIMAGE_GetResource(JImageFile* jimage, JImageLocationRef location,
+extern "C" JNIEXPORT jlong JIMAGE_GetResource(JImageFile* jimage, JImageLocationRef location,
         char* buffer, jlong size);
 
 typedef jlong(*JImageGetResource_t)(JImageFile* jimage, JImageLocationRef location,
@@ -181,7 +181,7 @@
         const char* module_name, const char* version, const char* package,
         const char* name, const char* extension, void* arg);
 
-extern "C" void JIMAGE_ResourceIterator(JImageFile* jimage,
+extern "C" JNIEXPORT void JIMAGE_ResourceIterator(JImageFile* jimage,
         JImageResourceVisitor_t visitor, void *arg);
 
 typedef void (*JImageResourceIterator_t)(JImageFile* jimage,
@@ -197,7 +197,7 @@
  *   char path[JIMAGE_MAX_PATH];
  *    (*JImageResourcePath)(image, location, path, JIMAGE_MAX_PATH);
  */
-extern "C" bool JIMAGE_ResourcePath(JImageFile* image, JImageLocationRef locationRef,
+extern "C" JNIEXPORT bool JIMAGE_ResourcePath(JImageFile* image, JImageLocationRef locationRef,
                                     char* path, size_t max);
 
 typedef bool (*JImage_ResourcePath_t)(JImageFile* jimage, JImageLocationRef location,
--- a/src/java.base/share/native/libjli/args.c	Tue Feb 13 10:36:52 2018 +0100
+++ b/src/java.base/share/native/libjli/args.c	Tue Feb 13 10:37:33 2018 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 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
@@ -38,6 +38,7 @@
   int IsWhiteSpaceOption(const char* name) { return 1; }
 #else
   #include "java.h"
+  #include "jni.h"
 #endif
 
 #include "jli_util.h"
@@ -78,7 +79,8 @@
 static jboolean stopExpansion = JNI_FALSE;
 static jboolean relaunch = JNI_FALSE;
 
-void JLI_InitArgProcessing(jboolean hasJavaArgs, jboolean disableArgFile) {
+JNIEXPORT void
+JLI_InitArgProcessing(jboolean hasJavaArgs, jboolean disableArgFile) {
     // No expansion for relaunch
     if (argsCount != 1) {
         relaunch = JNI_TRUE;
@@ -94,7 +96,8 @@
     firstAppArgIndex = hasJavaArgs ? 0: NOT_FOUND;
 }
 
-int JLI_GetAppArgIndex() {
+JNIEXPORT int
+JLI_GetAppArgIndex() {
     // Will be 0 for tools
     return firstAppArgIndex;
 }
@@ -373,7 +376,8 @@
     return rv;
 }
 
-JLI_List JLI_PreprocessArg(const char *arg)
+JNIEXPORT JLI_List
+JLI_PreprocessArg(const char *arg)
 {
     JLI_List rv;
 
@@ -428,7 +432,8 @@
            JLI_StrCmp(arg, "--full-version") == 0;
 }
 
-jboolean JLI_AddArgsFromEnvVar(JLI_List args, const char *var_name) {
+JNIEXPORT jboolean
+JLI_AddArgsFromEnvVar(JLI_List args, const char *var_name) {
     char *env = getenv(var_name);
     char *p, *arg;
     char quote;
--- a/src/java.base/share/native/libjli/java.c	Tue Feb 13 10:36:52 2018 +0100
+++ b/src/java.base/share/native/libjli/java.c	Tue Feb 13 10:37:33 2018 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 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
@@ -52,6 +52,7 @@
 
 
 #include "java.h"
+#include "jni.h"
 
 /*
  * A NOTE TO DEVELOPERS: For performance reasons it is important that
@@ -212,7 +213,7 @@
 /*
  * Entry point.
  */
-int
+JNIEXPORT int
 JLI_Launch(int argc, char ** argv,              /* main argc, argc */
         int jargc, const char** jargv,          /* java args */
         int appclassc, const char** appclassv,  /* app classpath */
@@ -2337,7 +2338,7 @@
 /*
  * A utility procedure to always print to stderr
  */
-void
+JNIEXPORT void
 JLI_ReportMessage(const char* fmt, ...)
 {
     va_list vl;
--- a/src/java.base/share/native/libjli/java.h	Tue Feb 13 10:36:52 2018 +0100
+++ b/src/java.base/share/native/libjli/java.h	Tue Feb 13 10:37:33 2018 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -86,7 +86,7 @@
     GetCreatedJavaVMs_t GetCreatedJavaVMs;
 } InvocationFunctions;
 
-int
+JNIEXPORT int
 JLI_Launch(int argc, char ** argv,              /* main argc, argc */
         int jargc, const char** jargv,          /* java args */
         int appclassc, const char** appclassv,  /* app classpath */
@@ -136,10 +136,10 @@
 void JLI_ReportErrorMessage(const char * message, ...);
 
 /* Reports a system error message to stderr or a window */
-void JLI_ReportErrorMessageSys(const char * message, ...);
+JNIEXPORT void JLI_ReportErrorMessageSys(const char * message, ...);
 
 /* Reports an error message only to stderr. */
-void JLI_ReportMessage(const char * message, ...);
+JNIEXPORT void JLI_ReportMessage(const char * message, ...);
 
 /* Reports a message only to stdout. */
 void JLI_ShowMessage(const char * message, ...);
@@ -148,7 +148,7 @@
  * Reports an exception which terminates the vm to stderr or a window
  * as appropriate.
  */
-void JLI_ReportExceptionDescription(JNIEnv * env);
+JNIEXPORT void JLI_ReportExceptionDescription(JNIEnv * env);
 void PrintMachineDependentOptions();
 
 /*
--- a/src/java.base/share/native/libjli/jli_util.c	Tue Feb 13 10:36:52 2018 +0100
+++ b/src/java.base/share/native/libjli/jli_util.c	Tue Feb 13 10:37:33 2018 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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,13 +26,14 @@
 #include <stdio.h>
 #include <string.h>
 #include <stdarg.h>
+#include "jni.h"
 #include "jli_util.h"
 
 /*
  * Returns a pointer to a block of at least 'size' bytes of memory.
  * Prints error message and exits if the memory could not be allocated.
  */
-void *
+JNIEXPORT void *
 JLI_MemAlloc(size_t size)
 {
     void *p = malloc(size);
@@ -62,7 +63,7 @@
  * Wrapper over strdup(3C) which prints an error message and exits if memory
  * could not be allocated.
  */
-char *
+JNIEXPORT char *
 JLI_StringDup(const char *s1)
 {
     char *s = strdup(s1);
@@ -77,7 +78,7 @@
  * Very equivalent to free(ptr).
  * Here to maintain pairing with the above routines.
  */
-void
+JNIEXPORT void
 JLI_MemFree(void *ptr)
 {
     free(ptr);
@@ -99,7 +100,7 @@
     fflush(stdout);
 }
 
-void
+JNIEXPORT void
 JLI_SetTraceLauncher()
 {
    if (getenv(JLDEBUG_ENV_ENTRY) != 0) {
@@ -120,7 +121,7 @@
    return JLI_StrNCmp(s1, s2, JLI_StrLen(s2));
 }
 
-JLI_List
+JNIEXPORT JLI_List
 JLI_List_new(size_t capacity)
 {
     JLI_List l = (JLI_List) JLI_MemAlloc(sizeof(struct JLI_List_));
@@ -155,7 +156,7 @@
     }
 }
 
-void
+JNIEXPORT void
 JLI_List_add(JLI_List sl, char *str)
 {
     JLI_List_ensureCapacity(sl, sl->size+1);
--- a/src/java.base/share/native/libjli/jli_util.h	Tue Feb 13 10:36:52 2018 +0100
+++ b/src/java.base/share/native/libjli/jli_util.h	Tue Feb 13 10:37:33 2018 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -40,10 +40,10 @@
 
 #define JLDEBUG_ENV_ENTRY "_JAVA_LAUNCHER_DEBUG"
 
-void *JLI_MemAlloc(size_t size);
+JNIEXPORT void *JLI_MemAlloc(size_t size);
 void *JLI_MemRealloc(void *ptr, size_t size);
-char *JLI_StringDup(const char *s1);
-void  JLI_MemFree(void *ptr);
+JNIEXPORT char *JLI_StringDup(const char *s1);
+JNIEXPORT void  JLI_MemFree(void *ptr);
 int   JLI_StrCCmp(const char *s1, const char* s2);
 
 typedef struct {
@@ -51,9 +51,9 @@
     jboolean has_wildcard;
 } StdArg;
 
-StdArg *JLI_GetStdArgs();
-int     JLI_GetStdArgc();
-int     JLI_GetAppArgIndex();
+JNIEXPORT StdArg *JLI_GetStdArgs();
+JNIEXPORT int     JLI_GetStdArgc();
+JNIEXPORT int     JLI_GetAppArgIndex();
 
 #define JLI_StrLen(p1)          strlen((p1))
 #define JLI_StrChr(p1, p2)      strchr((p1), (p2))
@@ -77,7 +77,7 @@
 #define JLI_StrCaseCmp(p1, p2)          stricmp((p1), (p2))
 #define JLI_StrNCaseCmp(p1, p2, p3)     strnicmp((p1), (p2), (p3))
 int  JLI_Snprintf(char *buffer, size_t size, const char *format, ...);
-void JLI_CmdToArgs(char *cmdline);
+JNIEXPORT void JLI_CmdToArgs(char *cmdline);
 #define JLI_Lseek                       _lseeki64
 #define JLI_PutEnv                      _putenv
 #define JLI_GetPid                      _getpid
@@ -108,7 +108,7 @@
  * Make launcher spit debug output.
  */
 void     JLI_TraceLauncher(const char* fmt, ...);
-void     JLI_SetTraceLauncher();
+JNIEXPORT void JLI_SetTraceLauncher();
 jboolean JLI_IsTraceLauncher();
 
 /*
@@ -122,19 +122,19 @@
 };
 typedef struct JLI_List_ *JLI_List;
 
-JLI_List JLI_List_new(size_t capacity);
+JNIEXPORT JLI_List JLI_List_new(size_t capacity);
 void JLI_List_free(JLI_List l);
 void JLI_List_ensureCapacity(JLI_List l, size_t capacity);
 /* e must be JLI_MemFree-able */
-void JLI_List_add(JLI_List l, char *e);
+JNIEXPORT void JLI_List_add(JLI_List l, char *e);
 /* a copy is made out of beg */
 void JLI_List_addSubstring(JLI_List l, const char *beg, size_t len);
 char *JLI_List_combine(JLI_List sl);
 char *JLI_List_join(JLI_List l, char sep);
 JLI_List JLI_List_split(const char *str, char sep);
 
-void JLI_InitArgProcessing(jboolean hasJavaArgs, jboolean disableArgFile);
-JLI_List JLI_PreprocessArg(const char *arg);
-jboolean JLI_AddArgsFromEnvVar(JLI_List args, const char *var_name);
+JNIEXPORT void JLI_InitArgProcessing(jboolean hasJavaArgs, jboolean disableArgFile);
+JNIEXPORT JLI_List JLI_PreprocessArg(const char *arg);
+JNIEXPORT jboolean JLI_AddArgsFromEnvVar(JLI_List args, const char *var_name);
 
 #endif  /* _JLI_UTIL_H */
--- a/src/java.base/share/native/libjli/manifest_info.h	Tue Feb 13 10:36:52 2018 +0100
+++ b/src/java.base/share/native/libjli/manifest_info.h	Tue Feb 13 10:37:33 2018 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2012, 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
@@ -27,6 +27,7 @@
 #define _MANIFEST_INFO_H
 
 #include <sys/types.h>
+#include "jni.h"
 
 /*
  * Zip file header signatures
@@ -186,6 +187,8 @@
 void    *JLI_JarUnpackFile(const char *jarfile, const char *filename,
                 int *size);
 void    JLI_FreeManifest(void);
+
+JNIEXPORT
 int     JLI_ManifestIterate(const char *jarfile, attribute_closure ac,
                 void *user_data);
 
--- a/src/java.base/share/native/libjli/parse_manifest.c	Tue Feb 13 10:36:52 2018 +0100
+++ b/src/java.base/share/native/libjli/parse_manifest.c	Tue Feb 13 10:37:33 2018 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2015, 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
@@ -29,6 +29,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include "jni.h"
 #include "jli_util.h"
 
 #include <zlib.h>
@@ -676,7 +677,7 @@
  *   -2 Error accessing the manifest from within the jarfile (most likely
  *      this means a manifest is not present, or it isn't a valid zip/jar file).
  */
-int
+JNIEXPORT int
 JLI_ManifestIterate(const char *jarfile, attribute_closure ac, void *user_data)
 {
     int     fd;
--- a/src/java.base/share/native/libzip/CRC32.c	Tue Feb 13 10:36:52 2018 +0100
+++ b/src/java.base/share/native/libzip/CRC32.c	Tue Feb 13 10:37:33 2018 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -54,7 +54,7 @@
     return crc;
 }
 
-jint JNICALL
+JNIEXPORT jint JNICALL
 ZIP_CRC32(jint crc, const jbyte *buf, jint len)
 {
     return crc32(crc, (Bytef*)buf, len);
--- a/src/java.base/share/native/libzip/zip_util.c	Tue Feb 13 10:36:52 2018 +0100
+++ b/src/java.base/share/native/libzip/zip_util.c	Tue Feb 13 10:37:33 2018 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 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
@@ -881,7 +881,7 @@
  * set to the error message text if msg != 0. Otherwise, *msg will be
  * set to NULL. Caller doesn't need to free the error message.
  */
-jzfile * JNICALL
+JNIEXPORT jzfile * JNICALL
 ZIP_Open(const char *name, char **pmsg)
 {
     jzfile *file = ZIP_Open_Generic(name, pmsg, O_RDONLY, 0);
@@ -895,7 +895,7 @@
 /*
  * Closes the specified zip file object.
  */
-void JNICALL
+JNIEXPORT void JNICALL
 ZIP_Close(jzfile *zip)
 {
     MLOCK(zfiles_lock);
@@ -1094,7 +1094,7 @@
  * jzentry for each zip.  This optimizes a common access pattern.
  */
 
-void JNICALL
+JNIEXPORT void JNICALL
 ZIP_FreeEntry(jzfile *jz, jzentry *ze)
 {
     jzentry *last;
@@ -1238,7 +1238,7 @@
  * Returns the n'th (starting at zero) zip file entry, or NULL if the
  * specified index was out of range.
  */
-jzentry * JNICALL
+JNIEXPORT jzentry * JNICALL
 ZIP_GetNextEntry(jzfile *zip, jint n)
 {
     jzentry *result;
@@ -1439,7 +1439,7 @@
  * The current implementation does not support reading an entry that
  * has the size bigger than 2**32 bytes in ONE invocation.
  */
-jzentry * JNICALL
+JNIEXPORT jzentry * JNICALL
 ZIP_FindEntry(jzfile *zip, char *name, jint *sizeP, jint *nameLenP)
 {
     jzentry *entry = ZIP_GetEntry(zip, name, 0);
@@ -1456,7 +1456,7 @@
  * Note: this is called from the separately delivered VM (hotspot/classic)
  * so we have to be careful to maintain the expected behaviour.
  */
-jboolean JNICALL
+JNIEXPORT jboolean JNICALL
 ZIP_ReadEntry(jzfile *zip, jzentry *entry, unsigned char *buf, char *entryname)
 {
     char *msg;
@@ -1515,7 +1515,7 @@
     return JNI_TRUE;
 }
 
-jboolean JNICALL
+JNIEXPORT jboolean JNICALL
 ZIP_InflateFully(void *inBuf, jlong inLen, void *outBuf, jlong outLen, char **pmsg)
 {
     z_stream strm;
--- a/src/java.base/share/native/libzip/zip_util.h	Tue Feb 13 10:36:52 2018 +0100
+++ b/src/java.base/share/native/libzip/zip_util.h	Tue Feb 13 10:37:33 2018 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 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
@@ -30,6 +30,8 @@
 #ifndef _ZIP_H_
 #define _ZIP_H_
 
+#include <jni.h>
+
 /*
  * Header signatures
  */
@@ -239,16 +241,16 @@
  */
 #define ZIP_ENDCHAIN ((jint)-1)
 
-jzentry * JNICALL
+JNIEXPORT jzentry * JNICALL
 ZIP_FindEntry(jzfile *zip, char *name, jint *sizeP, jint *nameLenP);
 
-jboolean JNICALL
+JNIEXPORT jboolean JNICALL
 ZIP_ReadEntry(jzfile *zip, jzentry *entry, unsigned char *buf, char *entrynm);
 
-jzentry * JNICALL
+JNIEXPORT jzentry * JNICALL
 ZIP_GetNextEntry(jzfile *zip, jint n);
 
-jzfile * JNICALL
+JNIEXPORT jzfile * JNICALL
 ZIP_Open(const char *name, char **pmsg);
 
 jzfile *
@@ -263,19 +265,19 @@
 jzfile *
 ZIP_Put_In_Cache0(const char *name, ZFILE zfd, char **pmsg, jlong lastModified, jboolean usemmap);
 
-void JNICALL
+JNIEXPORT void JNICALL
 ZIP_Close(jzfile *zip);
 
 jzentry * ZIP_GetEntry(jzfile *zip, char *name, jint ulen);
 void ZIP_Lock(jzfile *zip);
 void ZIP_Unlock(jzfile *zip);
 jint ZIP_Read(jzfile *zip, jzentry *entry, jlong pos, void *buf, jint len);
-void JNICALL
-ZIP_FreeEntry(jzfile *zip, jzentry *ze);
+JNIEXPORT void JNICALL
+JNIEXPORT ZIP_FreeEntry(jzfile *zip, jzentry *ze);
 jlong ZIP_GetEntryDataOffset(jzfile *zip, jzentry *entry);
 jzentry * ZIP_GetEntry2(jzfile *zip, char *name, jint ulen, jboolean addSlash);
 
-jboolean JNICALL
+JNIEXPORT jboolean JNICALL
 ZIP_InflateFully(void *inBuf, jlong inLen, void *outBuf, jlong outLen, char **pmsg);
 
 #endif /* !_ZIP_H_ */
--- a/src/java.base/unix/native/libjava/jni_util_md.c	Tue Feb 13 10:36:52 2018 +0100
+++ b/src/java.base/unix/native/libjava/jni_util_md.c	Tue Feb 13 10:37:33 2018 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 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
@@ -59,7 +59,7 @@
     }
 }
 
-size_t
+JNIEXPORT size_t
 getLastErrorString(char *buf, size_t len)
 {
     if (errno == 0 || len < 1) return 0;
@@ -67,7 +67,7 @@
     return strlen(buf);
 }
 
-int
+JNIEXPORT int
 getErrorString(int err, char *buf, size_t len)
 {
     if (err == 0 || len < 1) return 0;
--- a/src/java.base/unix/native/libjli/java_md_common.c	Tue Feb 13 10:36:52 2018 +0100
+++ b/src/java.base/unix/native/libjli/java_md_common.c	Tue Feb 13 10:37:33 2018 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -178,7 +178,8 @@
     return result;
 }
 
-void JLI_ReportErrorMessage(const char* fmt, ...) {
+JNIEXPORT void
+JLI_ReportErrorMessage(const char* fmt, ...) {
     va_list vl;
     va_start(vl, fmt);
     vfprintf(stderr, fmt, vl);
@@ -186,7 +187,8 @@
     va_end(vl);
 }
 
-void JLI_ReportErrorMessageSys(const char* fmt, ...) {
+JNIEXPORT void
+JLI_ReportErrorMessageSys(const char* fmt, ...) {
     va_list vl;
     char *emsg;
 
@@ -205,7 +207,8 @@
     va_end(vl);
 }
 
-void  JLI_ReportExceptionDescription(JNIEnv * env) {
+JNIEXPORT void
+JLI_ReportExceptionDescription(JNIEnv * env) {
   (*env)->ExceptionDescribe(env);
 }
 
@@ -345,13 +348,13 @@
    return findBootClass(env, classname);
 }
 
-StdArg
+JNIEXPORT StdArg
 *JLI_GetStdArgs()
 {
     return NULL;
 }
 
-int
+JNIEXPORT int
 JLI_GetStdArgc() {
     return 0;
 }
--- a/src/java.base/windows/native/libjava/io_util_md.c	Tue Feb 13 10:36:52 2018 +0100
+++ b/src/java.base/windows/native/libjava/io_util_md.c	Tue Feb 13 10:37:33 2018 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -223,7 +223,7 @@
     return pathbuf;
 }
 
-FD
+JNIEXPORT FD
 winFileHandleOpen(JNIEnv *env, jstring path, int flags)
 {
     const DWORD access =
@@ -575,7 +575,7 @@
     }
 }
 
-jlong
+JNIEXPORT jlong
 handleLseek(FD fd, jlong offset, jint whence)
 {
     LARGE_INTEGER pos, distance;
--- a/src/java.base/windows/native/libjava/io_util_md.h	Tue Feb 13 10:36:52 2018 +0100
+++ b/src/java.base/windows/native/libjava/io_util_md.h	Tue Feb 13 10:37:33 2018 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2017, 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
@@ -50,13 +50,13 @@
 jint handleAppend(FD fd, const void *buf, jint len);
 void handleClose(JNIEnv *env, jobject this, jfieldID fid);
 void fileDescriptorClose(JNIEnv *env, jobject this);
-jlong handleLseek(FD fd, jlong offset, jint whence);
+JNIEXPORT jlong handleLseek(FD fd, jlong offset, jint whence);
 
 /*
  * Returns an opaque handle to file named by "path".  If an error occurs,
  * returns -1 and an exception is pending.
  */
-FD winFileHandleOpen(JNIEnv *env, jstring path, int flags);
+JNIEXPORT FD winFileHandleOpen(JNIEnv *env, jstring path, int flags);
 
 /*
  * Macros to set/get fd from the java.io.FileDescriptor.
--- a/src/java.base/windows/native/libjava/jni_util_md.c	Tue Feb 13 10:36:52 2018 +0100
+++ b/src/java.base/windows/native/libjava/jni_util_md.c	Tue Feb 13 10:37:33 2018 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 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
@@ -74,7 +74,7 @@
     return;
 }
 
-size_t
+JNIEXPORT size_t
 getLastErrorString(char *utf8_jvmErrorMsg, size_t cbErrorMsg)
 {
     size_t n = 0;
@@ -144,7 +144,7 @@
     return n;
 }
 
-int
+JNIEXPORT int
 getErrorString(int err, char *buf, size_t len)
 {
     int ret = 0;
--- a/src/java.base/windows/native/libjli/cmdtoargs.c	Tue Feb 13 10:36:52 2018 +0100
+++ b/src/java.base/windows/native/libjli/cmdtoargs.c	Tue Feb 13 10:37:33 2018 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -35,6 +35,7 @@
 
 #ifndef IDE_STANDALONE
 #include "java.h"
+#include "jni.h"
 #include "jli_util.h"
 #else /* IDE_STANDALONE */
 // The defines we need for stand alone testing
@@ -188,15 +189,15 @@
     return done ? src : NULL;
 }
 
-int JLI_GetStdArgc() {
+JNIEXPORT int JLI_GetStdArgc() {
     return stdargc;
 }
 
-StdArg* JLI_GetStdArgs() {
+JNIEXPORT StdArg* JLI_GetStdArgs() {
     return stdargs;
 }
 
-void JLI_CmdToArgs(char* cmdline) {
+JNIEXPORT void JLI_CmdToArgs(char* cmdline) {
     int nargs = 0;
     StdArg* argv = NULL;
     jboolean wildcard = JNI_FALSE;
--- a/src/java.base/windows/native/libjli/java_md.c	Tue Feb 13 10:36:52 2018 +0100
+++ b/src/java.base/windows/native/libjli/java_md.c	Tue Feb 13 10:37:33 2018 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -495,7 +495,7 @@
     return rc;
 }
 
-void
+JNIEXPORT void
 JLI_ReportErrorMessage(const char* fmt, ...) {
     va_list vl;
     va_start(vl,fmt);
@@ -524,7 +524,7 @@
  * error message if any, its upto the calling routine to correctly
  * format the separation of the messages.
  */
-void
+JNIEXPORT void
 JLI_ReportErrorMessageSys(const char *fmt, ...)
 {
     va_list vl;
@@ -588,7 +588,8 @@
     va_end(vl);
 }
 
-void  JLI_ReportExceptionDescription(JNIEnv * env) {
+JNIEXPORT void
+JLI_ReportExceptionDescription(JNIEnv * env) {
     if (IsJavaw()) {
        /*
         * This code should be replaced by code which opens a window with
--- a/src/java.desktop/share/native/libawt/awt/image/cvutils/img_colors.c	Tue Feb 13 10:36:52 2018 +0100
+++ b/src/java.desktop/share/native/libawt/awt/image/cvutils/img_colors.c	Tue Feb 13 10:37:33 2018 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2000, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 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
@@ -38,6 +38,7 @@
 
 extern JavaVM *jvm;
 #endif
+#include "img_colors.h"
 
 #define jio_fprintf fprintf
 
@@ -515,7 +516,7 @@
     }
 }
 
-void
+JNIEXPORT void
 img_makePalette(int cmapsize, int tablesize, int lookupsize,
                 float lscale, float weight,
                 int prevclrs, int doMac,
--- a/src/java.desktop/share/native/libawt/awt/image/cvutils/img_colors.h	Tue Feb 13 10:36:52 2018 +0100
+++ b/src/java.desktop/share/native/libawt/awt/image/cvutils/img_colors.h	Tue Feb 13 10:37:33 2018 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 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
@@ -23,7 +23,9 @@
  * questions.
  */
 
-extern void img_makePalette(int cmapsize, int tablesize, int lookupsize,
+#include "jni.h"
+
+JNIEXPORT void img_makePalette(int cmapsize, int tablesize, int lookupsize,
                             float lscale, float weight,
                             int prevclrs, int doMac,
                             unsigned char *reds,
--- a/src/java.desktop/share/native/libawt/awt/image/cvutils/img_globals.c	Tue Feb 13 10:36:52 2018 +0100
+++ b/src/java.desktop/share/native/libawt/awt/image/cvutils/img_globals.c	Tue Feb 13 10:37:33 2018 +0100
@@ -28,6 +28,7 @@
  * by the image conversion package.
  */
 
+#include "jni.h"
 #include "img_globals.h"
 
 #include "java_awt_image_IndexColorModel.h"
@@ -42,7 +43,7 @@
  * a lookup table which returns the next color darker than the error
  * adjusted color used as the index.
  */
-void
+JNIEXPORT void
 make_uns_ordered_dither_array(uns_ordered_dither_array oda,
                               int quantum)
 {
--- a/src/java.desktop/share/native/libawt/awt/image/cvutils/img_globals.h	Tue Feb 13 10:36:52 2018 +0100
+++ b/src/java.desktop/share/native/libawt/awt/image/cvutils/img_globals.h	Tue Feb 13 10:37:33 2018 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 1998, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 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
@@ -31,6 +31,7 @@
 #ifndef IMAGE_GLOBALS_H
 #define IMAGE_GLOBALS_H
 
+#include "jni.h"
 
 /* Image Conversion function return codes. */
 #define SCALEFAILURE    -1
@@ -144,7 +145,7 @@
  * error values appearing in the matrix which should be the same as the
  * distance between adjacent allocated component values in the color cube).
  */
-extern void make_uns_ordered_dither_array(uns_ordered_dither_array oda,
+JNIEXPORT void make_uns_ordered_dither_array(uns_ordered_dither_array oda,
                                           int quantum);
 extern void make_sgn_ordered_dither_array(char* oda, int errmin, int errmax);
 
--- a/src/java.desktop/share/native/libawt/awt/image/dither.c	Tue Feb 13 10:36:52 2018 +0100
+++ b/src/java.desktop/share/native/libawt/awt/image/dither.c	Tue Feb 13 10:37:33 2018 +0100
@@ -23,14 +23,16 @@
  * questions.
  */
 
+#include "jni.h"
 #include "dither.h"
 
-sgn_ordered_dither_array std_img_oda_red;
-sgn_ordered_dither_array std_img_oda_green;
-sgn_ordered_dither_array std_img_oda_blue;
-int std_odas_computed = 0;
+JNIEXPORT sgn_ordered_dither_array std_img_oda_red;
+JNIEXPORT sgn_ordered_dither_array std_img_oda_green;
+JNIEXPORT sgn_ordered_dither_array std_img_oda_blue;
+JNIEXPORT int std_odas_computed = 0;
 
-void initInverseGrayLut(int* prgb, int rgbsize, ColorData *cData) {
+JNIEXPORT void
+initInverseGrayLut(int* prgb, int rgbsize, ColorData *cData) {
     int *inverse;
     int lastindex, lastgray, missing, i;
 
@@ -267,7 +269,8 @@
 
 }
 
-void make_dither_arrays(int cmapsize, ColorData *cData) {
+JNIEXPORT void 
+make_dither_arrays(int cmapsize, ColorData *cData) {
     int i, j, k;
 
     /*
--- a/src/java.desktop/share/native/libawt/awt/image/dither.h	Tue Feb 13 10:36:52 2018 +0100
+++ b/src/java.desktop/share/native/libawt/awt/image/dither.h	Tue Feb 13 10:37:33 2018 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -29,18 +29,22 @@
 #include <string.h>
 
 #include "colordata.h"
+#include "jni.h"
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-extern sgn_ordered_dither_array std_img_oda_red;
-extern sgn_ordered_dither_array std_img_oda_green;
-extern sgn_ordered_dither_array std_img_oda_blue;
-extern int std_odas_computed;
+JNIEXPORT extern sgn_ordered_dither_array std_img_oda_red;
+JNIEXPORT extern sgn_ordered_dither_array std_img_oda_green;
+JNIEXPORT extern sgn_ordered_dither_array std_img_oda_blue;
+JNIEXPORT extern int std_odas_computed;
 
-void make_dither_arrays(int cmapsize, ColorData *cData);
-void initInverseGrayLut(int* prgb, int rgbsize, ColorData* cData);
+JNIEXPORT void
+make_dither_arrays(int cmapsize, ColorData *cData);
+
+JNIEXPORT void
+initInverseGrayLut(int* prgb, int rgbsize, ColorData* cData);
 
 /*
  * state info needed for breadth-first recursion of color cube from
--- a/src/java.desktop/share/native/libawt/awt/image/imageInitIDs.h	Tue Feb 13 10:36:52 2018 +0100
+++ b/src/java.desktop/share/native/libawt/awt/image/imageInitIDs.h	Tue Feb 13 10:37:33 2018 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -74,7 +74,7 @@
 IMGEXTERN jfieldID g_ICRtypeID;
 
 /* Color Model ids */
-IMGEXTERN jfieldID g_CMpDataID;
+JNIEXPORT IMGEXTERN jfieldID g_CMpDataID;
 IMGEXTERN jfieldID g_CMnBitsID;
 IMGEXTERN jfieldID g_CMcspaceID;
 IMGEXTERN jfieldID g_CMnumComponentsID;
--- a/src/java.desktop/share/native/libawt/java2d/SurfaceData.c	Tue Feb 13 10:36:52 2018 +0100
+++ b/src/java.desktop/share/native/libawt/java2d/SurfaceData.c	Tue Feb 13 10:37:33 2018 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -231,7 +231,8 @@
     GETMIN(src->y2, dst->y2 - dy);
 }
 
-SurfaceDataOps *SurfaceData_InitOps(JNIEnv *env, jobject sData, int opsSize)
+JNIEXPORT SurfaceDataOps *
+SurfaceData_InitOps(JNIEnv *env, jobject sData, int opsSize)
 {
     SurfaceDataOps *ops = malloc(opsSize);
     SurfaceData_SetOps(env, sData, ops);
--- a/src/java.desktop/share/native/libawt/java2d/SurfaceData.h	Tue Feb 13 10:36:52 2018 +0100
+++ b/src/java.desktop/share/native/libawt/java2d/SurfaceData.h	Tue Feb 13 10:37:33 2018 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -649,7 +649,8 @@
  * Subclasses of SurfaceData should call this function instead of allocating
  * the memory directly.
  */
-SurfaceDataOps *SurfaceData_InitOps(JNIEnv *env, jobject sData, int opsSize);
+JNIEXPORT SurfaceDataOps *
+SurfaceData_InitOps(JNIEnv *env, jobject sData, int opsSize);
 
 /*
  * This function invokes the ops-specific disposal function.
--- a/src/java.desktop/share/native/libawt/java2d/loops/AlphaMath.c	Tue Feb 13 10:36:52 2018 +0100
+++ b/src/java.desktop/share/native/libawt/java2d/loops/AlphaMath.c	Tue Feb 13 10:37:33 2018 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -23,10 +23,11 @@
  * questions.
  */
 
+#include "jni.h"
 #include "AlphaMath.h"
 
 unsigned char mul8table[256][256];
-unsigned char div8table[256][256];
+JNIEXPORT unsigned char div8table[256][256];
 
 void initAlphaTables()
 {
--- a/src/java.desktop/share/native/libawt/java2d/loops/AlphaMath.h	Tue Feb 13 10:36:52 2018 +0100
+++ b/src/java.desktop/share/native/libawt/java2d/loops/AlphaMath.h	Tue Feb 13 10:37:33 2018 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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,8 +26,10 @@
 #ifndef AlphaMath_h_Included
 #define AlphaMath_h_Included
 
+#include "jni.h"
+
 extern unsigned char mul8table[256][256];
-extern unsigned char div8table[256][256];
+JNIEXPORT extern unsigned char div8table[256][256];
 extern void initAlphaTables();
 
 
--- a/src/java.desktop/share/native/libawt/java2d/loops/GraphicsPrimitiveMgr.c	Tue Feb 13 10:36:52 2018 +0100
+++ b/src/java.desktop/share/native/libawt/java2d/loops/GraphicsPrimitiveMgr.c	Tue Feb 13 10:37:33 2018 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -69,12 +69,12 @@
 static jboolean InitSurfaceTypes(JNIEnv *env, jclass SurfaceType);
 static jboolean InitCompositeTypes(JNIEnv *env, jclass CompositeType);
 
-jfieldID path2DTypesID;
-jfieldID path2DNumTypesID;
-jfieldID path2DWindingRuleID;
-jfieldID path2DFloatCoordsID;
-jfieldID sg2dStrokeHintID;
-jint sunHints_INTVAL_STROKE_PURE;
+JNIEXPORT jfieldID path2DTypesID;
+JNIEXPORT jfieldID path2DNumTypesID;
+JNIEXPORT jfieldID path2DWindingRuleID;
+JNIEXPORT jfieldID path2DFloatCoordsID;
+JNIEXPORT jfieldID sg2dStrokeHintID;
+JNIEXPORT jint sunHints_INTVAL_STROKE_PURE;
 
 /*
  * Class:     sun_java2d_loops_GraphicsPrimitiveMgr
--- a/src/java.desktop/share/native/libawt/java2d/loops/GraphicsPrimitiveMgr.h	Tue Feb 13 10:36:52 2018 +0100
+++ b/src/java.desktop/share/native/libawt/java2d/loops/GraphicsPrimitiveMgr.h	Tue Feb 13 10:37:33 2018 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -31,6 +31,7 @@
 #endif
 
 #include <stddef.h>
+#include "jni.h"
 
 #include "java_awt_AlphaComposite.h"
 
@@ -551,12 +552,12 @@
 void GrPrim_RefineBounds(SurfaceDataBounds *bounds, jint transX, jint transY,
                          jfloat *coords,  jint maxCoords);
 
-extern jfieldID path2DTypesID;
-extern jfieldID path2DNumTypesID;
-extern jfieldID path2DWindingRuleID;
-extern jfieldID path2DFloatCoordsID;
-extern jfieldID sg2dStrokeHintID;
-extern jint sunHints_INTVAL_STROKE_PURE;
+JNIEXPORT extern jfieldID path2DTypesID;
+JNIEXPORT extern jfieldID path2DNumTypesID;
+JNIEXPORT extern jfieldID path2DWindingRuleID;
+JNIEXPORT extern jfieldID path2DFloatCoordsID;
+JNIEXPORT extern jfieldID sg2dStrokeHintID;
+JNIEXPORT extern jint sunHints_INTVAL_STROKE_PURE;
 
 /*
  * Macros for using jlong variables as 32bits.32bits fractional values
--- a/src/java.desktop/share/native/libawt/java2d/loops/ProcessPath.c	Tue Feb 13 10:36:52 2018 +0100
+++ b/src/java.desktop/share/native/libawt/java2d/loops/ProcessPath.c	Tue Feb 13 10:37:33 2018 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -28,6 +28,7 @@
 #include <stdlib.h>
 #include <string.h>
 
+#include "jni.h"
 #include "j2d_md.h"
 #include "java_awt_geom_PathIterator.h"
 
@@ -2177,7 +2178,8 @@
 static void stubEndSubPath(ProcessHandler* hnd) {
 }
 
-jboolean doFillPath(DrawHandler* dhnd,
+JNIEXPORT jboolean
+doFillPath(DrawHandler* dhnd,
                     jint transX, jint transY,
                     jfloat* coords, jint maxCoords,
                     jbyte* types, jint numTypes,
@@ -2217,7 +2219,8 @@
     return JNI_TRUE;
 }
 
-jboolean doDrawPath(DrawHandler* dhnd,
+JNIEXPORT jboolean
+doDrawPath(DrawHandler* dhnd,
                     void (*pProcessEndSubPath)(ProcessHandler*),
                     jint transX, jint transY,
                     jfloat* coords, jint maxCoords,
--- a/src/java.desktop/share/native/libawt/java2d/loops/ProcessPath.h	Tue Feb 13 10:36:52 2018 +0100
+++ b/src/java.desktop/share/native/libawt/java2d/loops/ProcessPath.h	Tue Feb 13 10:37:33 2018 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -92,14 +92,14 @@
 } ProcessHandler;
 
 
-jboolean doDrawPath(DrawHandler* hnd,
+JNIEXPORT jboolean doDrawPath(DrawHandler* hnd,
                     void (*pProcessEndSubPath)(ProcessHandler* hnd),
                     jint transX, jint transY,
                     jfloat* coords, jint maxCoords,
                     jbyte* types, jint numTypes,
                     PHStroke stroke);
 
-jboolean doFillPath(DrawHandler* hnd,
+JNIEXPORT jboolean doFillPath(DrawHandler* hnd,
                     jint transX, jint transY,
                     jfloat* coords, jint maxCoords,
                     jbyte* types, jint numTypes,
--- a/src/java.desktop/unix/native/common/awt/img_util_md.h	Tue Feb 13 10:36:52 2018 +0100
+++ b/src/java.desktop/unix/native/common/awt/img_util_md.h	Tue Feb 13 10:37:33 2018 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 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
@@ -23,6 +23,7 @@
  * questions.
  */
 
+#include "jni.h"
 #include "color.h"
 
 #if !defined(HEADLESS) && !defined(MACOSX)
@@ -101,7 +102,7 @@
 
 extern void freeICMColorData(ColorData *pData);
 
-extern void initInverseGrayLut(int* prgb, int rgbsize, ColorData* cData);
+JNIEXPORT void initInverseGrayLut(int* prgb, int rgbsize, ColorData* cData);
 extern unsigned char* initCubemap(int* cmap, int cmap_len, int cube_dim);
 extern void initDitherTables(ColorData* cData);
 
--- a/src/java.desktop/unix/native/libawt/awt/awt_LoadLibrary.c	Tue Feb 13 10:36:52 2018 +0100
+++ b/src/java.desktop/unix/native/libawt/awt/awt_LoadLibrary.c	Tue Feb 13 10:37:33 2018 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -49,7 +49,7 @@
 
 /* Initialize the Java VM instance variable when the library is
    first loaded */
-JavaVM *jvm;
+JNIEXPORT JavaVM *jvm;
 
 JNIEXPORT jboolean JNICALL AWTIsHeadless() {
     static JNIEnv *env = NULL;
--- a/src/java.desktop/unix/native/libawt/awt/initIDs.c	Tue Feb 13 10:36:52 2018 +0100
+++ b/src/java.desktop/unix/native/libawt/awt/initIDs.c	Tue Feb 13 10:37:33 2018 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -40,7 +40,7 @@
  * which are used in the win32 awt.
  */
 
-jfieldID colorValueID;
+JNIEXPORT jfieldID colorValueID;
 
 JNIEXPORT void JNICALL
 Java_java_awt_Color_initIDs
--- a/src/java.desktop/windows/native/libawt/windows/img_util_md.h	Tue Feb 13 10:36:52 2018 +0100
+++ b/src/java.desktop/windows/native/libawt/windows/img_util_md.h	Tue Feb 13 10:37:33 2018 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 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
@@ -32,6 +32,7 @@
 #else
 #include "colordata.h"
 #endif
+#include "jni.h"
 
 #ifdef __cplusplus
 extern "C" {
@@ -94,7 +95,7 @@
     ((dstLockInfo.inv_cmap)[(((r)>>3)<<10) | (((g)>>3)<<5) | ((b)>>3)])
 
 extern void freeICMColorData(ColorData *pData);
-extern void initInverseGrayLut(int* prgb, int rgbsize, ColorData* cData);
+JNIEXPORT void initInverseGrayLut(int* prgb, int rgbsize, ColorData* cData);
 extern unsigned char* initCubemap(int* cmap, int cmap_len, int cube_dim);
 extern void initDitherTables(ColorData* cData);
 
--- a/src/jdk.jdi/share/native/libdt_shmem/shmemBack.c	Tue Feb 13 10:36:52 2018 +0100
+++ b/src/jdk.jdi/share/native/libdt_shmem/shmemBack.c	Tue Feb 13 10:37:33 2018 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -23,6 +23,7 @@
  * questions.
  */
 #include <string.h>
+#include "jni.h"
 
 #include "jdwpTransport.h"
 #include "shmemBase.h"
@@ -338,7 +339,7 @@
     return JDWPTRANSPORT_ERROR_NONE;
 }
 
-jint JNICALL
+JNIEXPORT jint JNICALL
 jdwpTransport_OnLoad(JavaVM *vm, jdwpTransportCallback* cbTablePtr,
                      jint version, jdwpTransportEnv** result)
 {
--- a/src/jdk.jdwp.agent/share/native/libdt_socket/socketTransport.c	Tue Feb 13 10:36:52 2018 +0100
+++ b/src/jdk.jdwp.agent/share/native/libdt_socket/socketTransport.c	Tue Feb 13 10:37:33 2018 +0100
@@ -28,6 +28,7 @@
 #include <stdlib.h>
 #include <ctype.h>
 
+#include "jni.h"
 #include "jdwpTransport.h"
 #include "sysSocket.h"
 
@@ -1018,7 +1019,7 @@
     return JDWPTRANSPORT_ERROR_NONE;
 }
 
-jint JNICALL
+JNIEXPORT jint JNICALL
 jdwpTransport_OnLoad(JavaVM *vm, jdwpTransportCallback* cbTablePtr,
                      jint version, jdwpTransportEnv** env)
 {