8200358: Remove mapfiles for JDK executables
authorihse
Thu, 05 Apr 2018 21:33:38 +0200
changeset 49534 210cf224b690
parent 49533 0eaddc72d8f4
child 49536 c32855a64719
8200358: Remove mapfiles for JDK executables Reviewed-by: erikj
make/autoconf/flags.m4
make/autoconf/spec.gmk.in
make/autoconf/toolchain.m4
make/common/NativeCompilation.gmk
make/launcher/Launcher-jdk.pack.gmk
make/launcher/LauncherCommon.gmk
make/mapfiles/launchers/mapfile-ppc64
make/mapfiles/launchers/mapfile-ppc64.anonymous
make/mapfiles/launchers/mapfile-sparc
make/mapfiles/launchers/mapfile-sparcv9
make/mapfiles/launchers/mapfile-x86
make/mapfiles/launchers/mapfile-x86.anonymous
make/mapfiles/launchers/mapfile-x86_64
make/mapfiles/launchers/mapfile-x86_64.anonymous
make/mapfiles/libunpack/mapfile-vers-unpack200
make/mapfiles/libunpack/mapfile-vers-unpack200-solaris-sparc
make/mapfiles/libunpack/mapfile-vers-unpack200-solaris-x86
make/mapfiles/libunpack/mapfile-vers-unpack200.anonymous
src/java.base/share/native/launcher/main.c
src/jdk.pack/share/native/unpack200/main.cpp
--- a/make/autoconf/flags.m4	Thu Apr 05 21:29:02 2018 +0200
+++ b/make/autoconf/flags.m4	Thu Apr 05 21:33:38 2018 +0200
@@ -241,7 +241,7 @@
        test "x$OPENJDK_TARGET_CPU" != xmips &&
        test "x$OPENJDK_TARGET_CPU" != xmipsel &&
        test "x$OPENJDK_TARGET_CPU" != xmips64 &&
-       test "x$OPENJDK_TARGET_CPU" != xmips64el; then 
+       test "x$OPENJDK_TARGET_CPU" != xmips64el; then
       MACHINE_FLAG="-m${OPENJDK_TARGET_CPU_BITS}"
     fi
   fi
@@ -325,22 +325,18 @@
 
   if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
     CC_OUT_OPTION=-Fo
-    EXE_OUT_OPTION=-out:
     LD_OUT_OPTION=-out:
     AR_OUT_OPTION=-out:
   else
     # The option used to specify the target .o,.a or .so file.
     # When compiling, how to specify the to be created object file.
     CC_OUT_OPTION='-o$(SPACE)'
-    # When linking, how to specify the to be created executable.
-    EXE_OUT_OPTION='-o$(SPACE)'
-    # When linking, how to specify the to be created dynamically linkable library.
+    # When linking, how to specify the output
     LD_OUT_OPTION='-o$(SPACE)'
     # When archiving, how to specify the to be create static archive for object files.
     AR_OUT_OPTION='rcs$(SPACE)'
   fi
   AC_SUBST(CC_OUT_OPTION)
-  AC_SUBST(EXE_OUT_OPTION)
   AC_SUBST(LD_OUT_OPTION)
   AC_SUBST(AR_OUT_OPTION)
 
--- a/make/autoconf/spec.gmk.in	Thu Apr 05 21:29:02 2018 +0200
+++ b/make/autoconf/spec.gmk.in	Thu Apr 05 21:33:38 2018 +0200
@@ -395,7 +395,6 @@
 COMPILER_BINDCMD_FILE_FLAG:=@COMPILER_BINDCMD_FILE_FLAG@
 
 CC_OUT_OPTION:=@CC_OUT_OPTION@
-EXE_OUT_OPTION:=@EXE_OUT_OPTION@
 LD_OUT_OPTION:=@LD_OUT_OPTION@
 AR_OUT_OPTION:=@AR_OUT_OPTION@
 
@@ -460,11 +459,6 @@
 # Xcode SDK path
 SDKROOT:=@SDKROOT@
 
-# The linker on older SuSE distros (e.g. on SLES 10) complains with:
-# "Invalid version tag `SUNWprivate_1.1'. Only anonymous version tag is allowed in executable."
-# if feeded with a version script which contains named tags.
-USING_BROKEN_SUSE_LD:=@USING_BROKEN_SUSE_LD@
-
 # LDFLAGS used to link the jdk native libraries (C-code)
 LDFLAGS_JDKLIB:=@LDFLAGS_JDKLIB@
 JDKLIB_LIBS:=@JDKLIB_LIBS@
--- a/make/autoconf/toolchain.m4	Thu Apr 05 21:29:02 2018 +0200
+++ b/make/autoconf/toolchain.m4	Thu Apr 05 21:33:38 2018 +0200
@@ -1022,24 +1022,6 @@
     # This is later checked when setting flags.
   fi
 
-  # Check for broken SuSE 'ld' for which 'Only anonymous version tag is allowed
-  # in executable.'
-  USING_BROKEN_SUSE_LD=no
-  if test "x$OPENJDK_TARGET_OS" = xlinux && test "x$TOOLCHAIN_TYPE" = xgcc; then
-    AC_MSG_CHECKING([for broken SuSE 'ld' which only understands anonymous version tags in executables])
-    $ECHO "SUNWprivate_1.1 { local: *; };" > version-script.map
-    $ECHO "int main() { }" > main.c
-    if $CXX -Wl,-version-script=version-script.map main.c 2>&AS_MESSAGE_LOG_FD >&AS_MESSAGE_LOG_FD; then
-      AC_MSG_RESULT(no)
-      USING_BROKEN_SUSE_LD=no
-    else
-      AC_MSG_RESULT(yes)
-      USING_BROKEN_SUSE_LD=yes
-    fi
-    $RM version-script.map main.c a.out
-  fi
-  AC_SUBST(USING_BROKEN_SUSE_LD)
-
   # Setup hotspot lecagy names for toolchains
   HOTSPOT_TOOLCHAIN_TYPE=$TOOLCHAIN_TYPE
   if test "x$TOOLCHAIN_TYPE" = xclang; then
--- a/make/common/NativeCompilation.gmk	Thu Apr 05 21:29:02 2018 +0200
+++ b/make/common/NativeCompilation.gmk	Thu Apr 05 21:33:38 2018 +0200
@@ -860,10 +860,48 @@
     endif
   endif
 
-  ifeq ($$($1_TYPE), LIBRARY)
-    # Generating a dynamic library.
-    $1_EXTRA_LDFLAGS += $$(call SET_SHARED_LIBRARY_NAME,$$($1_BASENAME))
+  ifeq ($$($1_TYPE), STATIC_LIBRARY)
+    $1_VARDEPS := $$($1_AR) $$($1_ARFLAGS) $$($1_LIBS) \
+        $$($1_EXTRA_LIBS)
+    $1_VARDEPS_FILE := $$(call DependOnVariable, $1_VARDEPS, \
+        $$($1_OBJECT_DIR)/$$($1_NOSUFFIX).vardeps)
+
+    # Generating a static library, ie object file archive.
+    ifeq ($(STATIC_BUILD), true)
+      ifeq ($$($1_USE_MAPFILE_FOR_SYMBOLS), true)
+        STATIC_MAPFILE_DEP := $$($1_MAPFILE)
+      endif
+    endif
+
+    $$($1_TARGET): $$($1_ALL_OBJS) $$($1_RES) $$($1_VARDEPS_FILE) $$(STATIC_MAPFILE_DEP)
+	$$(call LogInfo, Building static library $$($1_BASENAME))
+	$$(call ExecuteWithLog, $$($1_OBJECT_DIR)/$$($1_SAFE_NAME)_link, \
+	    $$($1_AR) $$($1_ARFLAGS) $(AR_OUT_OPTION)$$($1_TARGET) $$($1_ALL_OBJS) \
+	        $$($1_RES))
+        ifeq ($(STATIC_BUILD), true)
+          ifeq ($$($1_USE_MAPFILE_FOR_SYMBOLS), true)
+	    $(CP) $$($1_MAPFILE) $$(@D)/$$(basename $$(@F)).symbols
+          else
+	    $(GetSymbols)
+          endif
+        endif
+  else
+    # A shared dynamic library or an executable binary has been specified
+    ifeq ($$($1_TYPE), LIBRARY)
+      # Generating a dynamic library.
+      $1_EXTRA_LDFLAGS += $$(call SET_SHARED_LIBRARY_NAME,$$($1_BASENAME))
+
+      # Create loadmap on AIX. Helps in diagnosing some problems.
+      ifneq ($(COMPILER_BINDCMD_FILE_FLAG), )
+        $1_EXTRA_LDFLAGS += $(COMPILER_BINDCMD_FILE_FLAG)$$($1_OBJECT_DIR)/$$($1_NOSUFFIX).loadmap
+      endif
+    endif
+
     ifeq ($(OPENJDK_TARGET_OS), windows)
+      ifeq ($$($1_EMBED_MANIFEST), true)
+        $1_EXTRA_LDFLAGS += -manifest:embed
+      endif
+
       $1_IMPORT_LIBRARY := $$($1_OBJECT_DIR)/$$($1_NAME).lib
       $1_EXTRA_LDFLAGS += "-implib:$$($1_IMPORT_LIBRARY)"
       # To properly trigger downstream dependants of the import library, just as
@@ -882,13 +920,9 @@
 		$(TOUCH) $$@
     endif
 
-    # Create loadmap on AIX. Helps in diagnosing some problems.
-    ifneq ($(COMPILER_BINDCMD_FILE_FLAG), )
-      $1_EXTRA_LDFLAGS += $(COMPILER_BINDCMD_FILE_FLAG)$$($1_OBJECT_DIR)/$$($1_NOSUFFIX).loadmap
-    endif
-
     $1_VARDEPS := $$($1_LD) $$($1_SYSROOT_LDFLAGS) $$($1_LDFLAGS) $$($1_EXTRA_LDFLAGS) \
-        $$(GLOBAL_LIBS) $$($1_LIBS) $$($1_EXTRA_LIBS) $$($1_CREATE_DEBUGINFO_CMDS) \
+        $$(GLOBAL_LIBS) $$($1_LIBS) $$($1_EXTRA_LIBS) $$($1_MT) \
+        $$($1_CODESIGN) $$($1_CREATE_DEBUGINFO_CMDS) $$($1_MANIFEST_VERSION) \
         $$($1_STRIP_CMD)
     $1_VARDEPS_FILE := $$(call DependOnVariable, $1_VARDEPS, \
         $$($1_OBJECT_DIR)/$$($1_NOSUFFIX).vardeps)
@@ -927,8 +961,8 @@
       endif
     endif
 
-    $$($1_TARGET): $$($1_ALL_OBJS) $$($1_RES) $$($1_REAL_MAPFILE) \
-        $$($1_VARDEPS_FILE)
+    $$($1_TARGET): $$($1_ALL_OBJS) $$($1_RES) $$($1_MANIFEST) \
+        $$($1_REAL_MAPFILE) $$($1_VARDEPS_FILE)
                 ifneq ($$($1_OBJ_FILE_LIST), )
                   ifeq ($$($1_LINK_OBJS_RELATIVE), true)
 		    $$(eval $$(call ListPathsSafely, $1_ALL_OBJS_RELATIVE, $$($1_OBJ_FILE_LIST)))
@@ -942,74 +976,21 @@
                 ifeq ($(OPENJDK_TARGET_OS), windows)
 		  $$(call ExecuteWithLog, $$($1_OBJECT_DIR)/$$($1_SAFE_NAME)_link, \
 		      $$($1_LD) $$($1_LDFLAGS) $$($1_EXTRA_LDFLAGS) $$($1_SYSROOT_LDFLAGS) \
-		      $(LD_OUT_OPTION)$$@ $$($1_LD_OBJ_ARG) $$($1_RES) $$(GLOBAL_LIBS) \
-		      $$($1_LIBS) $$($1_EXTRA_LIBS)) \
+		          $(LD_OUT_OPTION)$$($1_TARGET) $$($1_LD_OBJ_ARG) $$($1_RES) $$(GLOBAL_LIBS) \
+		          $$($1_LIBS) $$($1_EXTRA_LIBS)) \
 		      | $(GREP) -v "^   Creating library .*\.lib and object .*\.exp" || \
-		      test "$$$$?" = "1" ; \
+		          test "$$$$?" = "1" ; \
 		  $$($1_CREATE_DEBUGINFO_CMDS)
 		  $$($1_STRIP_CMD)
                 else
 		  $$(call ExecuteWithLog, $$($1_OBJECT_DIR)/$$($1_SAFE_NAME)_link, \
 		      $$(if $$($1_LINK_OBJS_RELATIVE), $$(CD) $$(OUTPUTDIR) ; ) \
 		      $$($1_LD) $$($1_LDFLAGS) $$($1_EXTRA_LDFLAGS) $$($1_SYSROOT_LDFLAGS) \
-		      $(LD_OUT_OPTION)$$@ $$($1_LD_OBJ_ARG) $$($1_RES) $$(GLOBAL_LIBS) \
-		      $$($1_LIBS) $$($1_EXTRA_LIBS)) ; \
+		          $(LD_OUT_OPTION)$$($1_TARGET) $$($1_LD_OBJ_ARG) $$($1_RES) $$(GLOBAL_LIBS) \
+		          $$($1_LIBS) $$($1_EXTRA_LIBS)) ; \
 		  $$($1_CREATE_DEBUGINFO_CMDS)
 		  $$($1_STRIP_CMD)
                 endif
-
-  endif
-
-  ifeq ($$($1_TYPE), STATIC_LIBRARY)
-    $1_VARDEPS := $$($1_AR) $$($1_ARFLAGS) $$($1_LIBS) \
-        $$($1_EXTRA_LIBS)
-    $1_VARDEPS_FILE := $$(call DependOnVariable, $1_VARDEPS, \
-        $$($1_OBJECT_DIR)/$$($1_NOSUFFIX).vardeps)
-
-    # Generating a static library, ie object file archive.
-    ifeq ($(STATIC_BUILD), true)
-      ifeq ($$($1_USE_MAPFILE_FOR_SYMBOLS), true)
-        STATIC_MAPFILE_DEP := $$($1_MAPFILE)
-      endif
-    endif
-
-    $$($1_TARGET): $$($1_ALL_OBJS) $$($1_RES) $$($1_VARDEPS_FILE) $$(STATIC_MAPFILE_DEP)
-	$$(call LogInfo, Building static library $$($1_BASENAME))
-	$$(call ExecuteWithLog, $$($1_OBJECT_DIR)/$$($1_SAFE_NAME)_link, \
-	    $$($1_AR) $$($1_ARFLAGS) $(AR_OUT_OPTION)$$($1_TARGET) $$($1_ALL_OBJS) \
-	        $$($1_RES))
-        ifeq ($(STATIC_BUILD), true)
-          ifeq ($$($1_USE_MAPFILE_FOR_SYMBOLS), true)
-	    $(CP) $$($1_MAPFILE) $$(@D)/$$(basename $$(@F)).symbols
-          else
-	    $(GetSymbols)
-          endif
-        endif
-  endif
-
-  ifeq ($$($1_TYPE), EXECUTABLE)
-    # A executable binary has been specified, setup the target for it.
-    $1_VARDEPS := $$($1_LD) $$($1_SYSROOT_LDFLAGS) $$($1_LDFLAGS) $$($1_EXTRA_LDFLAGS) \
-        $$(GLOBAL_LIBS) $$($1_LIBS) $$($1_EXTRA_LIBS) $$($1_MT) \
-        $$($1_CODESIGN) $$($1_CREATE_DEBUGINFO_CMDS) $$($1_MANIFEST_VERSION) \
-        $$($1_STRIP_CMD)
-    $1_VARDEPS_FILE := $$(call DependOnVariable, $1_VARDEPS, \
-        $$($1_OBJECT_DIR)/$$($1_NOSUFFIX).vardeps)
-
-    ifeq ($(OPENJDK_TARGET_OS), windows)
-      ifeq ($$($1_EMBED_MANIFEST), true)
-        $1_EXTRA_LDFLAGS += -manifest:embed
-      endif
-    endif
-
-    $$($1_TARGET): $$($1_ALL_OBJS) $$($1_RES) $$($1_MANIFEST) \
-        $$($1_VARDEPS_FILE)
-		$$(call LogInfo, Linking executable $$($1_BASENAME))
-		$$(call ExecuteWithLog, $$($1_OBJECT_DIR)/$$($1_SAFE_NAME)_link, \
-		    $$($1_LD) $$($1_LDFLAGS) $$($1_EXTRA_LDFLAGS) $$($1_SYSROOT_LDFLAGS) \
-		        $(EXE_OUT_OPTION)$$($1_TARGET) \
-		        $$($1_ALL_OBJS) $$($1_RES) \
-		        $$(GLOBAL_LIBS) $$($1_LIBS) $$($1_EXTRA_LIBS))
                 ifeq ($(OPENJDK_TARGET_OS), windows)
                   ifneq ($$($1_MANIFEST), )
 		    $$($1_MT) -nologo -manifest $$($1_MANIFEST) -identity:"$$($1_NAME).exe, version=$$($1_MANIFEST_VERSION)" -outputresource:$$@;#1
@@ -1022,9 +1003,6 @@
 		    $(CODESIGN) -s openjdk_codesign $$@
                   endif
                 endif
-		$$($1_CREATE_DEBUGINFO_CMDS)
-		$$($1_STRIP_CMD)
-
   endif
 endef
 
--- a/make/launcher/Launcher-jdk.pack.gmk	Thu Apr 05 21:29:02 2018 +0200
+++ b/make/launcher/Launcher-jdk.pack.gmk	Thu Apr 05 21:33:38 2018 +0200
@@ -34,6 +34,25 @@
 # The order of the object files on the link command line affects the size of the resulting
 # binary (at least on linux) which causes the size to differ between old and new build.
 
+# Tell the compiler not to export any functions unless declared so in
+# the source code. On Windows, this is the default and cannot be changed.
+# On Mac, we have always exported all symbols, probably due to oversight
+# and/or misunderstanding. To emulate this, don't hide any symbols
+# by default.
+# Also provide an override for non-conformant libraries.
+ifeq ($(TOOLCHAIN_TYPE), gcc)
+  CXXFLAGS_JDKEXE += -fvisibility=hidden
+  LDFLAGS_JDKEXE += -Wl,--exclude-libs,ALL
+else ifeq ($(TOOLCHAIN_TYPE), clang)
+  ifneq ($(OPENJDK_TARGET_OS), macosx)
+    CXXFLAGS_JDKEXE += -fvisibility=hidden
+  endif
+else ifeq ($(TOOLCHAIN_TYPE), solstudio)
+  CXXFLAGS_JDKEXE += -xldscope=hidden
+else ifeq ($(TOOLCHAIN_TYPE), xlc)
+  CXXFLAGS_JDKEXE += -qvisibility=hidden
+endif
+
 UNPACKEXE_SRC := $(TOPDIR)/src/jdk.pack/share/native/common-unpack \
     $(TOPDIR)/src/jdk.pack/share/native/unpack200
 UNPACKEXE_CFLAGS := -I$(TOPDIR)/src/jdk.pack/share/native/common-unpack \
@@ -58,21 +77,6 @@
 
 endif
 
-UNPACK_MAPFILE_DIR := $(TOPDIR)/make/mapfiles/libunpack
-UNPACK_MAPFILE_PLATFORM_FILE := \
-    $(UNPACK_MAPFILE_DIR)/mapfile-vers-unpack200-$(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU_ARCH)
-
-# The linker on older SuSE distros (e.g. on SLES 10) complains with:
-# "Invalid version tag `SUNWprivate_1.1'. Only anonymous version tag is allowed in executable."
-# if feeded with a version script which contains named tags.
-ifeq ($(USING_BROKEN_SUSE_LD), yes)
-  UNPACK_MAPFILE := $(UNPACK_MAPFILE_DIR)/mapfile-vers-unpack200.anonymous
-else ifneq ($(wildcard $(UNPACK_MAPFILE_PLATFORM_FILE)), )
-  UNPACK_MAPFILE := $(UNPACK_MAPFILE_PLATFORM_FILE)
-else
-  UNPACK_MAPFILE := $(UNPACK_MAPFILE_DIR)/mapfile-vers-unpack200
-endif
-
 $(eval $(call SetupJdkExecutable, BUILD_UNPACKEXE, \
     NAME := unpack200, \
     SRC := $(UNPACKEXE_SRC), \
@@ -84,7 +88,6 @@
     CFLAGS_solaris := -KPIC, \
     CFLAGS_macosx := -fPIC, \
     DISABLED_WARNINGS_gcc := unused-result implicit-fallthrough, \
-    MAPFILE := $(UNPACK_MAPFILE),\
     LDFLAGS := $(UNPACKEXE_ZIPOBJS) \
         $(LDFLAGS_JDKEXE) $(LDFLAGS_CXX_JDK) \
         $(call SET_SHARED_LIBRARY_ORIGIN), \
--- a/make/launcher/LauncherCommon.gmk	Thu Apr 05 21:29:02 2018 +0200
+++ b/make/launcher/LauncherCommon.gmk	Thu Apr 05 21:33:38 2018 +0200
@@ -26,11 +26,9 @@
 include JdkNativeCompilation.gmk
 
 ifeq ($(OPENJDK_TARGET_OS), macosx)
-  DISABLE_MAPFILES := true
   ORIGIN_ARG := $(call SET_EXECUTABLE_ORIGIN)
 else
   ifeq ($(OPENJDK_TARGET_OS), windows)
-    DISABLE_MAPFILES := true
   endif
   ORIGIN_ARG := $(call SET_EXECUTABLE_ORIGIN,/../lib/jli)
 
@@ -42,8 +40,27 @@
   endif
 endif
 
+# Tell the compiler not to export any functions unless declared so in
+# the source code. On Windows, this is the default and cannot be changed.
+# On Mac, we have always exported all symbols, probably due to oversight
+# and/or misunderstanding. To emulate this, don't hide any symbols
+# by default.
+# Also provide an override for non-conformant libraries.
+ifeq ($(TOOLCHAIN_TYPE), gcc)
+  LAUNCHER_CFLAGS += -fvisibility=hidden
+  LDFLAGS_JDKEXE += -Wl,--exclude-libs,ALL
+else ifeq ($(TOOLCHAIN_TYPE), clang)
+  ifneq ($(OPENJDK_TARGET_OS), macosx)
+    LAUNCHER_CFLAGS += -fvisibility=hidden
+  endif
+else ifeq ($(TOOLCHAIN_TYPE), solstudio)
+  LAUNCHER_CFLAGS += -xldscope=hidden
+else ifeq ($(TOOLCHAIN_TYPE), xlc)
+  LAUNCHER_CFLAGS += -qvisibility=hidden
+endif
+
 LAUNCHER_SRC := $(TOPDIR)/src/java.base/share/native/launcher
-LAUNCHER_CFLAGS := -I$(TOPDIR)/src/java.base/share/native/launcher \
+LAUNCHER_CFLAGS += -I$(TOPDIR)/src/java.base/share/native/launcher \
     -I$(TOPDIR)/src/java.base/share/native/libjli \
     -I$(TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/libjli \
     -I$(TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS)/native/libjli \
@@ -157,23 +174,6 @@
     $1_WINDOWS_JLI_LIB := $(SUPPORT_OUTPUTDIR)/native/java.base/libjli/jli.lib
   endif
 
-  # The linker on older SuSE distros (e.g. on SLES 10) complains with:
-  # "Invalid version tag `SUNWprivate_1.1'. Only anonymous version tag is allowed in executable."
-  # if feeded with a version script which contains named tags.
-  ifeq ($(USING_BROKEN_SUSE_LD),yes)
-    ifneq ($(wildcard $(TOPDIR)/make/mapfiles/launchers/mapfile-$(OPENJDK_TARGET_CPU).anonymous), )
-      $1_MAPFILE := $(TOPDIR)/make/mapfiles/launchers/mapfile-$(OPENJDK_TARGET_CPU).anonymous
-    else
-      $1_MAPFILE :=
-    endif
-  else
-    ifneq ($(wildcard $(TOPDIR)/make/mapfiles/launchers/mapfile-$(OPENJDK_TARGET_CPU)), )
-      $1_MAPFILE := $(TOPDIR)/make/mapfiles/launchers/mapfile-$(OPENJDK_TARGET_CPU)
-    else
-      $1_MAPFILE :=
-    endif
-  endif
-
   $$(eval $$(call SetupJdkExecutable, BUILD_LAUNCHER_$1, \
       NAME := $1, \
       EXTRA_FILES := $(LAUNCHER_SRC)/main.c, \
@@ -194,7 +194,6 @@
           -L$(SUPPORT_OUTPUTDIR)/modules_libs/java.base/jli, \
       LDFLAGS_solaris := $$($1_LDFLAGS_solaris) \
           -L$(SUPPORT_OUTPUTDIR)/modules_libs/java.base/jli, \
-      MAPFILE := $$($1_MAPFILE), \
       LIBS := $(JDKEXE_LIBS) $$($1_LIBS), \
       LIBS_unix := $$($1_LIBS_unix), \
       LIBS_linux := -lpthread -ljli $(LIBDL), \
--- a/make/mapfiles/launchers/mapfile-ppc64	Thu Apr 05 21:29:02 2018 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-#
-# Copyright (c) 2004, 2012, 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.
-#
-#
-# Specify what global symbols we export.  Note that we're not really
-# interested in declaring a version, simply scoping the file is sufficient.
-#
-
-SUNWprivate_1.1 {
-	global:
-		main;		# Provides basic adb symbol offsets
-		environ;	# Public symbols and required by Java run time
-		_environ;
-		__environ_lock;
-
-	local:
-		*;
-};
--- a/make/mapfiles/launchers/mapfile-ppc64.anonymous	Thu Apr 05 21:29:02 2018 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,40 +0,0 @@
-#
-# Copyright (c) 2004, 2012, 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 anonymous library interface (i.e. without a version tag) for broken SuSE ld because
-# the linker on older SuSE distros (e.g. on SLES 10) complains with:
-# "Invalid version tag `SUNWprivate_1.1'. Only anonymous version tag is allowed in executable."
-# if feeded with a version script which contains named tags.
-
-{
-	global:
-		main;		# Provides basic adb symbol offsets
-		environ;	# Public symbols and required by Java run time
-		_environ;
-		__environ_lock;
-
-	local:
-		*;
-};
--- a/make/mapfiles/launchers/mapfile-sparc	Thu Apr 05 21:29:02 2018 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +0,0 @@
-#
-# Copyright (c) 2004, 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.
-#
-# Specify what global symbols we export.  Note that we're not really
-# interested in declaring a version, simply scoping the file is sufficient.
-#
-
-SUNWprivate_1.1 {
-	global:
-		main;		# Provides basic adb symbol offsets
-		environ;	# Public symbols and required by Java run time
-		_environ;
-		__environ_lock;
-		___Argv;	# The following are private, but as they are
-		_start;		# exported from ctr1/crtn, the clever hacker
-		_init;		# might know about them.  However note, that
-		_fini;		# their use is strictly not supported.
-		_lib_version;
-		__cg92_used;
-		__xargc;
-		__xargv;
-		__fsr_init_value;
-
-	local:
-		*;
-};
--- a/make/mapfiles/launchers/mapfile-sparcv9	Thu Apr 05 21:29:02 2018 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-#
-# Copyright (c) 2004, 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.
-#
-
-#
-# Specify what global symbols we export.  Note that we're not really
-# interested in declaring a version, simply scoping the file is sufficient.
-#
-
-SUNWprivate_1.1 {
-	global:
-		main;		# Provides basic adb symbol offsets
-		environ;	# Public symbols and required by Java run time
-		_environ;
-		__environ_lock;
-		___Argv;	# The following are private, but as they are
-		_start;		# exported from ctr1/crtn, the clever hacker
-		_init;		# might know about them.  However note, that
-		_fini;		# their use is strictly not supported.
-		_lib_version;
-		__xargc;
-		__xargv;
-		__fsr_init_value;
-
-	local:
-		*;
-};
--- a/make/mapfiles/launchers/mapfile-x86	Thu Apr 05 21:29:02 2018 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-#
-# Copyright (c) 2004, 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.
-#
-#
-# Specify what global symbols we export.  Note that we're not really
-# interested in declaring a version, simply scoping the file is sufficient.
-#
-
-SUNWprivate_1.1 {
-	global:
-		main;		# Provides basic adb symbol offsets
-		environ;	# Public symbols and required by Java run time
-		_environ;
-		__environ_lock;
-		___Argv;	# The following are private, but as they are
-		_start;		# exported from ctr1/crtn, the clever hacker
-		_init;		# might know about them.  However note, that
-		_fini;		# their use is strictly not supported.
-		_lib_version;
-#		_mcount;
-		__fsr;
-		__fsr_init_value;
-		__longdouble_used;
-
-	local:
-		*;
-};
--- a/make/mapfiles/launchers/mapfile-x86.anonymous	Thu Apr 05 21:29:02 2018 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,49 +0,0 @@
-#
-# Copyright (c) 2004, 2012, 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 anonymous library interface (i.e. without a version tag) for broken SuSE ld because
-# the linker on older SuSE distros (e.g. on SLES 10) complains with:
-# "Invalid version tag `SUNWprivate_1.1'. Only anonymous version tag is allowed in executable."
-# if feeded with a version script which contains named tags.
-
-{
-	global:
-		main;		# Provides basic adb symbol offsets
-		environ;	# Public symbols and required by Java run time
-		_environ;
-		__environ_lock;
-		___Argv;	# The following are private, but as they are
-		_start;		# exported from ctr1/crtn, the clever hacker
-		_init;		# might know about them.  However note, that
-		_fini;		# their use is strictly not supported.
-		_lib_version;
-#		_mcount;
-		__fsr;
-		__fsr_init_value;
-		__longdouble_used;
-
-	local:
-		*;
-};
--- a/make/mapfiles/launchers/mapfile-x86_64	Thu Apr 05 21:29:02 2018 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +0,0 @@
-#
-# Copyright (c) 2004, 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.
-#
-#
-# Specify what global symbols we export.  Note that we're not really
-# interested in declaring a version, simply scoping the file is sufficient.
-#
-
-SUNWprivate_1.1 {
-	global:
-		main;		# Provides basic adb symbol offsets
-		environ;	# Public symbols and required by Java run time
-		_environ;
-		__environ_lock;
-
-		# These are needed by the c runtime in SS12u4
-		___Argv;
-		__xargv;
-		__xargc;
-		_start;
-		__longdouble_used;
-		_lib_version;
-
-	local:
-		*;
-};
--- a/make/mapfiles/launchers/mapfile-x86_64.anonymous	Thu Apr 05 21:29:02 2018 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,40 +0,0 @@
-#
-# Copyright (c) 2004, 2012, 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 anonymous library interface (i.e. without a version tag) for broken SuSE ld because
-# the linker on older SuSE distros (e.g. on SLES 10) complains with:
-# "Invalid version tag `SUNWprivate_1.1'. Only anonymous version tag is allowed in executable."
-# if feeded with a version script which contains named tags.
-
-{
-	global:
-		main;		# Provides basic adb symbol offsets
-		environ;	# Public symbols and required by Java run time
-		_environ;
-		__environ_lock;
-
-	local:
-		*;
-};
--- a/make/mapfiles/libunpack/mapfile-vers-unpack200	Thu Apr 05 21:29:02 2018 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,31 +0,0 @@
-#
-# Copyright (c) 2011, 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 {
-	local:
-	    *;
-};
--- a/make/mapfiles/libunpack/mapfile-vers-unpack200-solaris-sparc	Thu Apr 05 21:29:02 2018 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,42 +0,0 @@
-#
-# Copyright (c) 2011, 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:
-		# These are needed by the c runtime in SS12u4
-		environ;
-		_environ;
-		__environ_lock;
-		___Argv;
-		__xargv;
-		__xargc;
-		_start;
-		_lib_version;
-
-	local:
-	    *;
-};
--- a/make/mapfiles/libunpack/mapfile-vers-unpack200-solaris-x86	Thu Apr 05 21:29:02 2018 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-#
-# 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
-# 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:
-		# These are needed by the c runtime in SS12u4
-		environ;
-		_environ;
-		__environ_lock;
-		___Argv;
-		__xargv;
-		__xargc;
-		_start;
-		__longdouble_used;
-		_lib_version;
-
-	local:
-	    *;
-};
--- a/make/mapfiles/libunpack/mapfile-vers-unpack200.anonymous	Thu Apr 05 21:29:02 2018 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,34 +0,0 @@
-#
-# Copyright (c) 2011, 2012, 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 anonymous library interface (i.e. without a version tag) for broken SuSE ld because
-# the linker on older SuSE distros (e.g. on SLES 10) complains with:
-# "Invalid version tag `SUNWprivate_1.1'. Only anonymous version tag is allowed in executable."
-# if feeded with a version script which contains named tags.
-
-{
-	local:
-	    *;
-};
--- a/src/java.base/share/native/launcher/main.c	Thu Apr 05 21:29:02 2018 +0200
+++ b/src/java.base/share/native/launcher/main.c	Thu Apr 05 21:33:38 2018 +0200
@@ -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
@@ -32,6 +32,7 @@
 
 #include "defines.h"
 #include "jli_util.h"
+#include "jni.h"
 
 #ifdef _MSC_VER
 #if _MSC_VER > 1400 && _MSC_VER < 1600
@@ -92,7 +93,7 @@
     __initenv = _environ;
 
 #else /* JAVAW */
-int
+JNIEXPORT int JNICALL
 main(int argc, char **argv)
 {
     int margc;
--- a/src/jdk.pack/share/native/unpack200/main.cpp	Thu Apr 05 21:29:02 2018 +0200
+++ b/src/jdk.pack/share/native/unpack200/main.cpp	Thu Apr 05 21:33:38 2018 +0200
@@ -45,6 +45,7 @@
 #define THREAD_SELF ((THRTYPE)pthread_self())
 #endif
 
+#include "jni.h"
 #include "defines.h"
 #include "bytes.h"
 #include "utils.h"
@@ -58,7 +59,8 @@
 #include "unpack.h"
 
 
-int main(int argc, char **argv) {
+JNIEXPORT int JNICALL
+main(int argc, char **argv) {
     return unpacker::run(argc, argv);
 }