changeset 49249:d7859531621b

8198751: Refactor SetupNativeCompilation to take NAME and TYPE Reviewed-by: tbell
author ihse
date Wed, 28 Feb 2018 21:16:11 +0100
parents e37b804ae0b1
children 1fd4d6068f54
files make/common/NativeCompilation.gmk make/common/TestFilesCompilation.gmk make/hotspot/gensrc/GensrcAdlc.gmk make/hotspot/lib/CompileDtracePostJvm.gmk make/hotspot/lib/CompileGtest.gmk make/hotspot/lib/CompileJvm.gmk make/hotspot/lib/CompileLibjsig.gmk make/launcher/Launcher-java.base.gmk make/launcher/Launcher-jdk.accessibility.gmk make/launcher/Launcher-jdk.pack.gmk make/launcher/LauncherCommon.gmk make/lib/Awt2dLibraries.gmk make/lib/CoreLibraries.gmk make/lib/Lib-java.instrument.gmk make/lib/Lib-java.management.gmk make/lib/Lib-java.prefs.gmk make/lib/Lib-java.rmi.gmk make/lib/Lib-java.security.jgss.gmk make/lib/Lib-java.smartcardio.gmk make/lib/Lib-jdk.accessibility.gmk make/lib/Lib-jdk.attach.gmk make/lib/Lib-jdk.crypto.cryptoki.gmk make/lib/Lib-jdk.crypto.ec.gmk make/lib/Lib-jdk.crypto.mscapi.gmk make/lib/Lib-jdk.crypto.ucrypto.gmk make/lib/Lib-jdk.hotspot.agent.gmk make/lib/Lib-jdk.internal.le.gmk make/lib/Lib-jdk.jdi.gmk make/lib/Lib-jdk.jdwp.agent.gmk make/lib/Lib-jdk.management.agent.gmk make/lib/Lib-jdk.management.gmk make/lib/Lib-jdk.net.gmk make/lib/Lib-jdk.pack.gmk make/lib/Lib-jdk.sctp.gmk make/lib/Lib-jdk.security.auth.gmk make/lib/LibosxLibraries.gmk make/lib/NetworkingLibraries.gmk make/lib/NioLibraries.gmk make/lib/PlatformLibraries.gmk make/lib/SecurityLibraries.gmk make/lib/SoundLibraries.gmk make/test/BuildFailureHandler.gmk
diffstat 42 files changed, 338 insertions(+), 373 deletions(-) [+]
line wrap: on
line diff
--- a/make/common/NativeCompilation.gmk	Wed Feb 28 18:28:17 2018 +0000
+++ b/make/common/NativeCompilation.gmk	Wed Feb 28 21:16:11 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
@@ -30,7 +30,7 @@
 ifndef _NATIVE_COMPILATION_GMK
 _NATIVE_COMPILATION_GMK := 1
 
-ifeq (,$(_MAKEBASE_GMK))
+ifeq ($(_MAKEBASE_GMK), )
   $(error You must include MakeBase.gmk prior to including NativeCompilation.gmk)
 endif
 
@@ -231,32 +231,32 @@
     endif
   endif
 
-  ifneq (,$$(filter %.c,$2))
+  ifneq ($$(filter %.c, $2), )
     # Compile as a C file
-    $1_$2_FLAGS=$(CFLAGS_CCACHE) $$($1_$2_USE_PCH_FLAGS) $4 \
+    $1_$2_FLAGS := $(CFLAGS_CCACHE) $$($1_$2_USE_PCH_FLAGS) $4 \
         $$($1_$(notdir $2)_OPT_CFLAGS) \
         $$($1_$(notdir $2)_CFLAGS) $$($1_$2_THIS_FILE) -c
-    $1_$2_COMP=$5
-    $1_$2_DEP_FLAG:=$(C_FLAG_DEPS)
-  else ifneq (,$$(filter %.m,$2))
+    $1_$2_COMP := $5
+    $1_$2_DEP_FLAG := $(C_FLAG_DEPS)
+  else ifneq ($$(filter %.m, $2), )
     # Compile as an Objective-C file
-    $1_$2_FLAGS=-x objective-c $(CFLAGS_CCACHE) $$($1_$2_USE_PCH_FLAGS) $4 \
+    $1_$2_FLAGS := -x objective-c $(CFLAGS_CCACHE) $$($1_$2_USE_PCH_FLAGS) $4 \
         $$($1_$(notdir $2)_OPT_CFLAGS) \
         $$($1_$(notdir $2)_CFLAGS) $$($1_$2_THIS_FILE) -c
-    $1_$2_COMP=$5
-    $1_$2_DEP_FLAG:=$(C_FLAG_DEPS)
-  else ifneq (,$$(filter %.s %.S,$2))
+    $1_$2_COMP := $5
+    $1_$2_DEP_FLAG := $(C_FLAG_DEPS)
+  else ifneq ($$(filter %.s %.S, $2), )
     # Compile as assembler file
-    $1_$2_FLAGS=$8
-    $1_$2_COMP=$(AS)
-    $1_$2_DEP_FLAG:=
-  else ifneq (,$$(filter %.cpp,$2)$$(filter %.cc,$2)$$(filter %.mm,$2))
+    $1_$2_FLAGS := $8
+    $1_$2_COMP := $(AS)
+    $1_$2_DEP_FLAG :=
+  else ifneq ($$(filter %.cpp, $2)$$(filter %.cc, $2)$$(filter %.mm, $2), )
     # Compile as a C++ or Objective-C++ file
-    $1_$2_FLAGS=$(CFLAGS_CCACHE) $$($1_$2_USE_PCH_FLAGS) $6 \
+    $1_$2_FLAGS := $(CFLAGS_CCACHE) $$($1_$2_USE_PCH_FLAGS) $6 \
         $$($1_$(notdir $2)_OPT_CXXFLAGS) \
         $$($1_$(notdir $2)_CXXFLAGS) $$($1_$2_THIS_FILE) -c
-    $1_$2_COMP=$7
-    $1_$2_DEP_FLAG:=$(CXX_FLAG_DEPS)
+    $1_$2_COMP := $7
+    $1_$2_DEP_FLAG := $(CXX_FLAG_DEPS)
   else
     $$(error Internal error in NativeCompilation.gmk: no compiler for file $2)
   endif
@@ -264,14 +264,14 @@
   $1_$2_OBJ := $3/$$(call replace_with_obj_extension, $$(notdir $2))
   # Only continue if this object file hasn't been processed already. This lets the first found
   # source file override any other with the same name.
-  ifeq (,$$(findstring $$($1_$2_OBJ),$$($1_OBJS_SO_FAR)))
-    $1_OBJS_SO_FAR+=$$($1_$2_OBJ)
-    ifeq (,$$(filter %.s %.S,$2))
+  ifeq ($$(findstring $$($1_$2_OBJ), $$($1_OBJS_SO_FAR)), )
+    $1_OBJS_SO_FAR += $$($1_$2_OBJ)
+    ifeq ($$(filter %.s %.S, $2), )
       # And this is the dependency file for this obj file.
-      $1_$2_DEP:=$$(patsubst %$(OBJ_SUFFIX),%.d,$$($1_$2_OBJ))
+      $1_$2_DEP := $$(patsubst %$(OBJ_SUFFIX),%.d,$$($1_$2_OBJ))
       # The dependency target file lists all dependencies as empty targets
       # to avoid make error "No rule to make target" for removed files
-      $1_$2_DEP_TARGETS:=$$(patsubst %$(OBJ_SUFFIX),%.d.targets,$$($1_$2_OBJ))
+      $1_$2_DEP_TARGETS := $$(patsubst %$(OBJ_SUFFIX),%.d.targets,$$($1_$2_OBJ))
 
       # Include previously generated dependency information. (if it exists)
       -include $$($1_$2_DEP)
@@ -280,7 +280,7 @@
       ifeq ($(TOOLCHAIN_TYPE), microsoft)
         # To avoid name clashes between pdbs for objects and libs/execs, put
         # object pdbs in a separate subdir.
-        $1_$2_DEBUG_OUT_FLAGS:=-Fd$$(strip $$(patsubst $$($1_OBJECT_DIR)/%, \
+        $1_$2_DEBUG_OUT_FLAGS := -Fd$$(strip $$(patsubst $$($1_OBJECT_DIR)/%, \
             $$($1_OBJECT_DIR)/pdb/%, $$(patsubst %$(OBJ_SUFFIX),%.pdb,$$($1_$2_OBJ))))
       endif
     endif
@@ -293,10 +293,10 @@
     endif
 
     $$($1_$2_OBJ) : $2 $$($1_COMPILE_VARDEPS_FILE) $$($1_$2_VARDEPS_FILE) | $$($1_BUILD_INFO)
-	$$(call LogInfo, Compiling $$(notdir $2) (for $$(notdir $$($1_TARGET))))
+	$$(call LogInfo, Compiling $$(notdir $2) (for $$($1_BASENAME)))
 	$$(call MakeDir, $$(@D) $$(@D)/pdb)
         ifneq ($(TOOLCHAIN_TYPE), microsoft)
-          ifeq ($(TOOLCHAIN_TYPE)$$(filter %.s,$2), solstudio)
+          ifeq ($(TOOLCHAIN_TYPE)$$(filter %.s, $2), solstudio)
             # The Solaris studio compiler doesn't output the full path to the object file in the
             # generated deps files. Fixing it with sed. If compiling assembly, don't try this.
 	    $$(call ExecuteWithLog, $$@, \
@@ -308,7 +308,7 @@
           endif
           # Create a dependency target file from the dependency file.
           # Solution suggested by http://make.mad-scientist.net/papers/advanced-auto-dependency-generation/
-          ifneq ($$($1_$2_DEP),)
+          ifneq ($$($1_$2_DEP), )
 	    $(SED) $(DEPENDENCY_TARGET_SED_PATTERN) $$($1_$2_DEP) > $$($1_$2_DEP_TARGETS)
           endif
         else
@@ -338,6 +338,9 @@
 # and the targets generated are listed in a variable by that name.
 #
 # Remaining parameters are named arguments. These include:
+#   NAME The base name for the resulting binary, excluding decorations (like *.exe)
+#   TYPE Type of binary (EXECUTABLE, LIBRARY or STATIC_LIBRARY). Default is LIBRARY.
+#   SUFFIX Override the default suffix for the output file
 #   TOOLCHAIN Name of toolchain setup to use. Defaults to TOOLCHAIN_DEFAULT.
 #   SRC one or more directory roots to scan for C/C++ files.
 #   CFLAGS the compiler flags to be used, used both for C and C++.
@@ -347,8 +350,6 @@
 #   ARFLAGS the archiver flags to be used
 #   OBJECT_DIR the directory where we store the object files
 #   OUTPUT_DIR the directory where the resulting binary is put
-#   LIBRARY the resulting library file
-#   PROGRAM the resulting exec file
 #   INCLUDES only pick source from these directories
 #   EXCLUDES do not pick source from these directories
 #   INCLUDE_FILES only compile exactly these files!
@@ -385,106 +386,60 @@
 SetupNativeCompilation = $(NamedParamsMacroTemplate)
 define SetupNativeCompilationBody
 
+  # If type is unspecified, default to LIBRARY
+  ifeq ($$($1_TYPE), )
+    $1_TYPE := LIBRARY
+  endif
+
   # If we're doing a static build and producing a library
   # force it to be a static library and remove the -l libraries
   ifeq ($(STATIC_BUILD), true)
-    ifneq ($$($1_LIBRARY),)
-      $1_STATIC_LIBRARY := $$($1_LIBRARY)
-      $1_LIBRARY :=
+    ifeq ($$($1_TYPE), LIBRARY)
+      $1_TYPE := STATIC_LIBRARY
     endif
   endif
 
-  ifneq (,$$($1_BIN))
-    $$(error BIN has been replaced with OBJECT_DIR)
-  endif
-
-  ifneq (,$$($1_LIB))
-    $$(error LIB has been replaced with LIBRARY)
-  endif
-
-  ifneq (,$$($1_EXE))
-    $$(error EXE has been replaced with PROGRAM)
-  endif
-
-  ifneq (,$$($1_LIBRARY))
-    ifeq (,$$($1_OUTPUT_DIR))
-      $$(error LIBRARY requires OUTPUT_DIR)
-    endif
-
-    ifneq ($$($1_LIBRARY),$(basename $$($1_LIBRARY)))
-      $$(error directory of LIBRARY should be specified using OUTPUT_DIR)
-    endif
-
-    ifneq (,$(findstring $(SHARED_LIBRARY_SUFFIX),$$($1_LIBRARY)))
-      $$(error LIBRARY should be specified without SHARED_LIBRARY_SUFFIX: $(SHARED_LIBRARY_SUFFIX))
-    endif
-
-    ifneq (,$(findstring $(LIBRARY_PREFIX),$$($1_LIBRARY)))
-      $$(error LIBRARY should be specified without LIBRARY_PREFIX: $(LIBRARY_PREFIX))
-    endif
-
-    ifeq ($$($1_SUFFIX), )
-      $1_SUFFIX := $(SHARED_LIBRARY_SUFFIX)
-    endif
-
-    $1_BASENAME:=$(LIBRARY_PREFIX)$$($1_LIBRARY)$$($1_SUFFIX)
-    $1_TARGET:=$$($1_OUTPUT_DIR)/$$($1_BASENAME)
-    $1_NOSUFFIX:=$(LIBRARY_PREFIX)$$($1_LIBRARY)
-  endif
-
-  ifneq (,$$($1_STATIC_LIBRARY))
-    ifeq (,$$($1_OUTPUT_DIR))
-      $$(error STATIC_LIBRARY requires OUTPUT_DIR)
-    endif
-
-    ifneq ($$($1_STATIC_LIBRARY),$(basename $$($1_STATIC_LIBRARY)))
-      $$(error directory of STATIC_LIBRARY should be specified using OUTPUT_DIR)
-    endif
-
-    ifneq (,$(findstring $(STATIC_LIBRARY_SUFFIX),$$($1_STATIC_LIBRARY)))
-      $$(error STATIC_LIBRARY should be specified without STATIC_LIBRARY_SUFFIX: $(STATIC_LIBRARY_SUFFIX))
-    endif
-
-    ifneq (,$(findstring $(LIBRARY_PREFIX),$$($1_STATIC_LIBRARY)))
-      $$(error STATIC_LIBRARY should be specified without LIBRARY_PREFIX: $(LIBRARY_PREFIX))
-    endif
-
-    ifeq ($$($1_SUFFIX), )
-      $1_SUFFIX := $(STATIC_LIBRARY_SUFFIX)
-    endif
-
-    $1_BASENAME:=$(LIBRARY_PREFIX)$$($1_STATIC_LIBRARY)$$($1_SUFFIX)
-    $1_TARGET:=$$($1_OUTPUT_DIR)/$$($1_BASENAME)
-    $1_NOSUFFIX:=$(LIBRARY_PREFIX)$$($1_STATIC_LIBRARY)
-  endif
-
-  ifneq (,$$($1_PROGRAM))
-    ifeq (,$$($1_OUTPUT_DIR))
-      $$(error PROGRAM requires OUTPUT_DIR)
-    endif
-
-    ifneq ($$($1_PROGRAM),$(basename $$($1_PROGRAM)))
-      $$(error directory of PROGRAM should be specified using OUTPUT_DIR)
-    endif
-
-    ifneq (,$(findstring $(EXE_SUFFIX),$$($1_PROGRAM)))
-      $$(error PROGRAM should be specified without EXE_SUFFIX: $(EXE_SUFFIX))
-    endif
-
+  ifeq ($$($1_TYPE), EXECUTABLE)
+    $1_PREFIX :=
     ifeq ($$($1_SUFFIX), )
       $1_SUFFIX := $(EXE_SUFFIX)
     endif
+  else
+    $1_PREFIX := $(LIBRARY_PREFIX)
+    ifeq ($$($1_TYPE), LIBRARY)
+      ifeq ($$($1_SUFFIX), )
+        $1_SUFFIX := $(SHARED_LIBRARY_SUFFIX)
+      endif
+    else ifeq ($$($1_TYPE), STATIC_LIBRARY)
+      ifeq ($$($1_SUFFIX), )
+        $1_SUFFIX := $(STATIC_LIBRARY_SUFFIX)
+      endif
+    endif
+  endif
 
-    $1_BASENAME:=$$($1_PROGRAM)$$($1_SUFFIX)
-    $1_TARGET:=$$($1_OUTPUT_DIR)/$$($1_BASENAME)
-    $1_NOSUFFIX:=$$($1_PROGRAM)
+  ifneq ($$($1_NAME), $(basename $$($1_NAME)))
+    $$(error NAME must not contain any directory path in $1)
   endif
+  ifneq ($(findstring $$($1_SUFFIX), $$($1_NAME)), )
+    $$(error NAME should be specified without suffix: $$($1_SUFFIX) in $1)
+  endif
+  ifneq ($(findstring $$($1_PREFIX), $$($1_NAME)), )
+    $$(error NAME should be specified without prefix: $$($1_PREFIX) in $1)
+  endif
+  ifeq ($$($1_OUTPUT_DIR), )
+    $$(error OUTPUT_DIR is missing in $1)
+  endif
+  ifneq ($$($1_MANIFEST), )
+    ifeq ($$($1_MANIFEST_VERSION), )
+      $$(error If MANIFEST is provided, then MANIFEST_VERSION is required in $1)
+    endif
+  endif
+
+  $1_BASENAME := $$($1_PREFIX)$$($1_NAME)$$($1_SUFFIX)
+  $1_TARGET := $$($1_OUTPUT_DIR)/$$($1_BASENAME)
+  $1_NOSUFFIX := $$($1_PREFIX)$$($1_NAME)
   $1_SAFE_NAME := $$(strip $$(subst /,_, $1))
 
-  ifeq (,$$($1_TARGET))
-    $$(error Neither PROGRAM, LIBRARY nor STATIC_LIBRARY has been specified for SetupNativeCompilation)
-  endif
-
   # Setup the toolchain to be used
   $$(call SetIfEmpty, $1_TOOLCHAIN, TOOLCHAIN_DEFAULT)
   $$(call SetIfEmpty, $1_CC, $$($$($1_TOOLCHAIN)_CC))
@@ -499,41 +454,35 @@
   $$(call SetIfEmpty, $1_SYSROOT_CFLAGS, $$($$($1_TOOLCHAIN)_SYSROOT_CFLAGS))
   $$(call SetIfEmpty, $1_SYSROOT_LDFLAGS, $$($$($1_TOOLCHAIN)_SYSROOT_LDFLAGS))
 
-  ifneq ($$($1_MANIFEST), )
-    ifeq ($$($1_MANIFEST_VERSION), )
-      $$(error If MANIFEST is provided, then MANIFEST_VERSION is required in $1)
-    endif
-  endif
-
   # Make sure the dirs exist.
-  $$(call MakeDir,$$($1_OBJECT_DIR) $$($1_OUTPUT_DIR))
-  $$(foreach d,$$($1_SRC), $$(if $$(wildcard $$d),, \
+  $$(call MakeDir, $$($1_OBJECT_DIR) $$($1_OUTPUT_DIR))
+  $$(foreach d, $$($1_SRC), $$(if $$(wildcard $$d), , \
       $$(error SRC specified to SetupNativeCompilation $1 contains missing directory $$d)))
 
   # Find all files in the source trees. Preserve order.
-  $1_SRCS := $$(foreach s, $$($1_SRC), $$(call CacheFind,$$(s)))
+  $1_SRCS := $$(foreach s, $$($1_SRC), $$(call CacheFind, $$(s)))
   $1_SRCS := $$(filter $$(NATIVE_SOURCE_EXTENSIONS), $$($1_SRCS))
   # Extract the C/C++ files.
   ifneq ($$($1_EXCLUDE_PATTERNS), )
     # We must not match the exclude pattern against the src root(s).
     $1_SRCS_WITHOUT_ROOTS := $$($1_SRCS)
-    $$(foreach i,$$($1_SRC),$$(eval $1_SRCS_WITHOUT_ROOTS := $$(patsubst \
+    $$(foreach i, $$($1_SRC), $$(eval $1_SRCS_WITHOUT_ROOTS := $$(patsubst \
         $$i/%,%, $$($1_SRCS_WITHOUT_ROOTS))))
     $1_ALL_EXCLUDE_FILES :=  $$(call containing, $$($1_EXCLUDE_PATTERNS), \
         $$($1_SRCS_WITHOUT_ROOTS))
   endif
-  ifneq ($$($1_EXCLUDE_FILES),)
+  ifneq ($$($1_EXCLUDE_FILES), )
     $1_ALL_EXCLUDE_FILES += $$($1_EXCLUDE_FILES)
   endif
-  ifneq ($$($1_ALL_EXCLUDE_FILES),)
+  ifneq ($$($1_ALL_EXCLUDE_FILES), )
     $1_EXCLUDE_FILES_PAT := $$($1_ALL_EXCLUDE_FILES) \
-        $$(foreach i,$$($1_SRC),$$(addprefix $$i/,$$($1_ALL_EXCLUDE_FILES)))
-    $1_EXCLUDE_FILES_PAT := $$(addprefix %,$$($1_EXCLUDE_FILES_PAT))
-    $1_SRCS := $$(filter-out $$($1_EXCLUDE_FILES_PAT),$$($1_SRCS))
+        $$(foreach i, $$($1_SRC), $$(addprefix $$i/, $$($1_ALL_EXCLUDE_FILES)))
+    $1_EXCLUDE_FILES_PAT := $$(addprefix %, $$($1_EXCLUDE_FILES_PAT))
+    $1_SRCS := $$(filter-out $$($1_EXCLUDE_FILES_PAT), $$($1_SRCS))
   endif
   ifneq ($$($1_INCLUDE_FILES), )
-    $1_INCLUDE_FILES_PAT := $$(foreach i,$$($1_SRC),$$(addprefix $$i/,$$($1_INCLUDE_FILES)))
-    $1_SRCS := $$(filter $$($1_INCLUDE_FILES_PAT),$$($1_SRCS))
+    $1_INCLUDE_FILES_PAT := $$(foreach i, $$($1_SRC), $$(addprefix $$i/, $$($1_INCLUDE_FILES)))
+    $1_SRCS := $$(filter $$($1_INCLUDE_FILES_PAT), $$($1_SRCS))
   endif
   # There can be only a single bin dir root, no need to foreach over the roots.
   $1_BINS := $$(wildcard $$($1_OBJECT_DIR)/*$(OBJ_SUFFIX))
@@ -541,29 +490,29 @@
   # and we have a list of all existing object files: $$($1_BINS)
 
   # Prepend the source/bin path to the filter expressions. Then do the filtering.
-  ifneq ($$($1_INCLUDES),)
-    $1_SRC_INCLUDES := $$(foreach i,$$($1_SRC),$$(addprefix $$i/,$$(addsuffix /%,$$($1_INCLUDES))))
-    $1_SRCS := $$(filter $$($1_SRC_INCLUDES),$$($1_SRCS))
+  ifneq ($$($1_INCLUDES), )
+    $1_SRC_INCLUDES := $$(foreach i, $$($1_SRC), $$(addprefix $$i/, $$(addsuffix /%, $$($1_INCLUDES))))
+    $1_SRCS := $$(filter $$($1_SRC_INCLUDES), $$($1_SRCS))
   endif
-  ifneq ($$($1_EXCLUDES),)
-    $1_SRC_EXCLUDES := $$(addsuffix /%,$$($1_EXCLUDES))
-    $1_SRC_EXCLUDES += $$(foreach i,$$($1_SRC),$$(addprefix $$i/,$$(addsuffix /%,$$($1_EXCLUDES))))
-    $1_SRCS := $$(filter-out $$($1_SRC_EXCLUDES),$$($1_SRCS))
+  ifneq ($$($1_EXCLUDES), )
+    $1_SRC_EXCLUDES := $$(addsuffix /%, $$($1_EXCLUDES))
+    $1_SRC_EXCLUDES += $$(foreach i, $$($1_SRC), $$(addprefix $$i/, $$(addsuffix /%, $$($1_EXCLUDES))))
+    $1_SRCS := $$(filter-out $$($1_SRC_EXCLUDES), $$($1_SRCS))
   endif
 
   $1_SRCS += $$($1_EXTRA_FILES)
 
-  ifeq (,$$($1_SRCS))
+  ifeq ($$($1_SRCS), )
     $$(error No sources found for $1 when looking inside the dirs $$($1_SRC))
   endif
 
   # Calculate the expected output from compiling the sources
   $1_EXPECTED_OBJS_FILENAMES := $$(call replace_with_obj_extension, $$(notdir $$($1_SRCS)))
-  $1_EXPECTED_OBJS := $$(addprefix $$($1_OBJECT_DIR)/,$$($1_EXPECTED_OBJS_FILENAMES))
+  $1_EXPECTED_OBJS := $$(addprefix $$($1_OBJECT_DIR)/, $$($1_EXPECTED_OBJS_FILENAMES))
   # Are there too many object files on disk? Perhaps because some source file was removed?
-  $1_SUPERFLOUS_OBJS:=$$(sort $$(filter-out $$($1_EXPECTED_OBJS),$$($1_BINS)))
+  $1_SUPERFLOUS_OBJS := $$(sort $$(filter-out $$($1_EXPECTED_OBJS), $$($1_BINS)))
   # Clean out the superfluous object files.
-  ifneq ($$($1_SUPERFLUOUS_OBJS),)
+  ifneq ($$($1_SUPERFLUOUS_OBJS), )
     $$(shell $(RM) -f $$($1_SUPERFLUOUS_OBJS))
   endif
   # Sort to remove dupliates and provide a reproducable order on the input files to the linker.
@@ -571,42 +520,42 @@
 
   # Pickup extra OPENJDK_TARGET_OS_TYPE, OPENJDK_TARGET_OS, and/or OPENJDK_TARGET_OS plus
   # OPENJDK_TARGET_CPU pair dependent variables for CFLAGS.
-  $1_EXTRA_CFLAGS:=$$($1_CFLAGS_$(OPENJDK_TARGET_OS_TYPE)) $$($1_CFLAGS_$(OPENJDK_TARGET_OS)) \
+  $1_EXTRA_CFLAGS := $$($1_CFLAGS_$(OPENJDK_TARGET_OS_TYPE)) $$($1_CFLAGS_$(OPENJDK_TARGET_OS)) \
       $$($1_CFLAGS_$(OPENJDK_TARGET_OS)_$(OPENJDK_TARGET_CPU))
-  ifneq ($(DEBUG_LEVEL),release)
+  ifneq ($(DEBUG_LEVEL), release)
     # Pickup extra debug dependent variables for CFLAGS
-    $1_EXTRA_CFLAGS+=$$($1_CFLAGS_debug)
-    $1_EXTRA_CFLAGS+=$$($1_CFLAGS_$(OPENJDK_TARGET_OS_TYPE)_debug)
-    $1_EXTRA_CFLAGS+=$$($1_CFLAGS_$(OPENJDK_TARGET_OS)_debug)
-    $1_EXTRA_CFLAGS+=$$($1_CFLAGS_$(OPENJDK_TARGET_OS)_$(OPENJDK_TARGET_CPU)_debug)
+    $1_EXTRA_CFLAGS += $$($1_CFLAGS_debug)
+    $1_EXTRA_CFLAGS += $$($1_CFLAGS_$(OPENJDK_TARGET_OS_TYPE)_debug)
+    $1_EXTRA_CFLAGS += $$($1_CFLAGS_$(OPENJDK_TARGET_OS)_debug)
+    $1_EXTRA_CFLAGS += $$($1_CFLAGS_$(OPENJDK_TARGET_OS)_$(OPENJDK_TARGET_CPU)_debug)
   else
-    $1_EXTRA_CFLAGS+=$$($1_CFLAGS_release)
-    $1_EXTRA_CFLAGS+=$$($1_CFLAGS_$(OPENJDK_TARGET_OS_TYPE)_release)
-    $1_EXTRA_CFLAGS+=$$($1_CFLAGS_$(OPENJDK_TARGET_OS)_release)
-    $1_EXTRA_CFLAGS+=$$($1_CFLAGS_$(OPENJDK_TARGET_OS)_$(OPENJDK_TARGET_CPU)_release)
+    $1_EXTRA_CFLAGS += $$($1_CFLAGS_release)
+    $1_EXTRA_CFLAGS += $$($1_CFLAGS_$(OPENJDK_TARGET_OS_TYPE)_release)
+    $1_EXTRA_CFLAGS += $$($1_CFLAGS_$(OPENJDK_TARGET_OS)_release)
+    $1_EXTRA_CFLAGS += $$($1_CFLAGS_$(OPENJDK_TARGET_OS)_$(OPENJDK_TARGET_CPU)_release)
   endif
 
   # Pickup extra OPENJDK_TARGET_OS_TYPE and/or OPENJDK_TARGET_OS dependent variables for CXXFLAGS.
-  $1_EXTRA_CXXFLAGS:=$$($1_CXXFLAGS_$(OPENJDK_TARGET_OS_TYPE)) $$($1_CXXFLAGS_$(OPENJDK_TARGET_OS))
-  ifneq ($(DEBUG_LEVEL),release)
+  $1_EXTRA_CXXFLAGS := $$($1_CXXFLAGS_$(OPENJDK_TARGET_OS_TYPE)) $$($1_CXXFLAGS_$(OPENJDK_TARGET_OS))
+  ifneq ($(DEBUG_LEVEL), release)
     # Pickup extra debug dependent variables for CXXFLAGS
-    $1_EXTRA_CXXFLAGS+=$$($1_CXXFLAGS_debug)
-    $1_EXTRA_CXXFLAGS+=$$($1_CXXFLAGS_$(OPENJDK_TARGET_OS_TYPE)_debug)
-    $1_EXTRA_CXXFLAGS+=$$($1_CXXFLAGS_$(OPENJDK_TARGET_OS)_debug)
+    $1_EXTRA_CXXFLAGS += $$($1_CXXFLAGS_debug)
+    $1_EXTRA_CXXFLAGS += $$($1_CXXFLAGS_$(OPENJDK_TARGET_OS_TYPE)_debug)
+    $1_EXTRA_CXXFLAGS += $$($1_CXXFLAGS_$(OPENJDK_TARGET_OS)_debug)
   else
-    $1_EXTRA_CXXFLAGS+=$$($1_CXXFLAGS_release)
-    $1_EXTRA_CXXFLAGS+=$$($1_CXXFLAGS_$(OPENJDK_TARGET_OS_TYPE)_release)
-    $1_EXTRA_CXXFLAGS+=$$($1_CXXFLAGS_$(OPENJDK_TARGET_OS)_release)
+    $1_EXTRA_CXXFLAGS += $$($1_CXXFLAGS_release)
+    $1_EXTRA_CXXFLAGS += $$($1_CXXFLAGS_$(OPENJDK_TARGET_OS_TYPE)_release)
+    $1_EXTRA_CXXFLAGS += $$($1_CXXFLAGS_$(OPENJDK_TARGET_OS)_release)
   endif
 
   # If no C++ flags are explicitly set, default to using the C flags.
   # After that, we can set additional C++ flags that should not interfere
   # with the mechanism for copying the C flags by default.
-  ifeq ($$($1_CXXFLAGS),)
-    $1_CXXFLAGS:=$$($1_CFLAGS)
+  ifeq ($$($1_CXXFLAGS), )
+    $1_CXXFLAGS := $$($1_CFLAGS)
   endif
-  ifeq ($$(strip $$($1_EXTRA_CXXFLAGS)),)
-    $1_EXTRA_CXXFLAGS:=$$($1_EXTRA_CFLAGS)
+  ifeq ($$(strip $$($1_EXTRA_CXXFLAGS)), )
+    $1_EXTRA_CXXFLAGS := $$($1_EXTRA_CFLAGS)
   endif
 
   ifeq ($(COMPILE_WITH_DEBUG_SYMBOLS), true)
@@ -616,19 +565,19 @@
     $1_EXTRA_CXXFLAGS += $$($1_CXXFLAGS_DEBUG_SYMBOLS)
   endif
 
-  ifneq (,$$($1_REORDER))
+  ifneq ($$($1_REORDER), )
     $1_EXTRA_CFLAGS += $$(C_FLAG_REORDER)
     $1_EXTRA_CXXFLAGS += $$(CXX_FLAG_REORDER)
   endif
 
   # Pass the library name for static JNI library naming
-  ifneq ($$($1_STATIC_LIBRARY),)
-    $1_EXTRA_CFLAGS += -DLIBRARY_NAME=$$($1_STATIC_LIBRARY)
-    $1_EXTRA_CXXFLAGS += -DLIBRARY_NAME=$$($1_STATIC_LIBRARY)
+  ifeq ($$($1_TYPE), STATIC_LIBRARY)
+    $1_EXTRA_CFLAGS += -DLIBRARY_NAME=$$($1_NAME)
+    $1_EXTRA_CXXFLAGS += -DLIBRARY_NAME=$$($1_NAME)
   endif
 
   # Pick up disabled warnings, if possible on this platform.
-  ifneq ($(DISABLE_WARNING_PREFIX),)
+  ifneq ($(DISABLE_WARNING_PREFIX), )
     $1_EXTRA_CFLAGS += $$(addprefix $(DISABLE_WARNING_PREFIX), \
         $$($1_DISABLED_WARNINGS_$(TOOLCHAIN_TYPE)) \
         $$($1_DISABLED_WARNINGS_C_$(TOOLCHAIN_TYPE)))
@@ -639,8 +588,8 @@
 
   # Check if warnings should be considered errors.
   # Pick first binary and toolchain specific, then binary specific, then general setting.
-  ifeq ($$($1_WARNINGS_AS_ERRORS_$(TOOLCHAIN_TYPE)),)
-    ifeq ($$($1_WARNINGS_AS_ERRORS),)
+  ifeq ($$($1_WARNINGS_AS_ERRORS_$(TOOLCHAIN_TYPE)), )
+    ifeq ($$($1_WARNINGS_AS_ERRORS), )
       $1_WARNINGS_AS_ERRORS_$(TOOLCHAIN_TYPE) := $$(WARNINGS_AS_ERRORS)
     else
       $1_WARNINGS_AS_ERRORS_$(TOOLCHAIN_TYPE) := $$($1_WARNINGS_AS_ERRORS)
@@ -740,7 +689,7 @@
   endif
 
   # Now call add_native_source for each source file we are going to compile.
-  $$(foreach p,$$($1_SRCS), \
+  $$(foreach p, $$($1_SRCS), \
       $$(eval $$(call add_native_source,$1,$$p,$$($1_OBJECT_DIR), \
           $$($1_CFLAGS) $$($1_EXTRA_CFLAGS) $$($1_SYSROOT_CFLAGS), \
           $$($1_CC), \
@@ -750,7 +699,7 @@
   # Setup rule for printing progress info when compiling source files.
   # This is a rough heuristic and may not always print accurate information.
   $$($1_BUILD_INFO): $$($1_SRCS) $$($1_COMPILE_VARDEPS_FILE)
-        ifeq ($$(wildcard $$($1_TARGET)),)
+        ifeq ($$(wildcard $$($1_TARGET)), )
 	  $(ECHO) 'Creating $$(subst $$(OUTPUTDIR)/,,$$($1_TARGET)) from $$(words \
 	      $$(filter-out %.vardeps, $$?)) file(s)'
         else
@@ -763,10 +712,10 @@
 
   # On windows we need to create a resource file
   ifeq ($(OPENJDK_TARGET_OS), windows)
-    ifneq (,$$($1_VERSIONINFO_RESOURCE))
-      $1_RES:=$$($1_OBJECT_DIR)/$$($1_BASENAME).res
-      $1_RES_DEP:=$$($1_RES).d
-      $1_RES_DEP_TARGETS:=$$($1_RES).d.targets
+    ifneq ($$($1_VERSIONINFO_RESOURCE), )
+      $1_RES := $$($1_OBJECT_DIR)/$$($1_BASENAME).res
+      $1_RES_DEP := $$($1_RES).d
+      $1_RES_DEP_TARGETS := $$($1_RES).d.targets
       -include $$($1_RES_DEP)
       -include $$($1_RES_DEP_TARGETS)
 
@@ -775,7 +724,7 @@
           $$($1_RES).vardeps)
 
       $$($1_RES): $$($1_VERSIONINFO_RESOURCE) $$($1_RES_VARDEPS_FILE)
-		$$(call LogInfo, Compiling resource $$(notdir $$($1_VERSIONINFO_RESOURCE)) (for $$(notdir $$($1_TARGET))))
+		$$(call LogInfo, Compiling resource $$(notdir $$($1_VERSIONINFO_RESOURCE)) (for $$($1_BASENAME)))
 		$$(call MakeDir, $$(@D) $$($1_OBJECT_DIR))
 		$$(call ExecuteWithLog, $$@, \
 		    $$($1_RC) $$($1_RC_FLAGS) $$($1_SYSROOT_CFLAGS) $(CC_OUT_OPTION)$$@ \
@@ -798,10 +747,10 @@
     endif
   endif
 
-  ifneq ($(DISABLE_MAPFILES),true)
+  ifneq ($(DISABLE_MAPFILES), true)
     $1_REAL_MAPFILE := $$($1_MAPFILE)
-    ifneq ($(OPENJDK_TARGET_OS),windows)
-      ifneq (,$$($1_REORDER))
+    ifneq ($(OPENJDK_TARGET_OS), windows)
+      ifneq ($$($1_REORDER), )
         $1_REAL_MAPFILE := $$($1_OBJECT_DIR)/mapfile
 
         $$($1_REAL_MAPFILE) : $$($1_MAPFILE) $$($1_REORDER)
@@ -815,9 +764,9 @@
 
   # Pickup extra OPENJDK_TARGET_OS_TYPE and/or OPENJDK_TARGET_OS dependent variables
   # for LDFLAGS and LIBS
-  $1_EXTRA_LDFLAGS:=$$($1_LDFLAGS_$(OPENJDK_TARGET_OS_TYPE)) $$($1_LDFLAGS_$(OPENJDK_TARGET_OS))
-  $1_EXTRA_LIBS:=$$($1_LIBS_$(OPENJDK_TARGET_OS_TYPE)) $$($1_LIBS_$(OPENJDK_TARGET_OS))
-  ifneq (,$$($1_REAL_MAPFILE))
+  $1_EXTRA_LDFLAGS := $$($1_LDFLAGS_$(OPENJDK_TARGET_OS_TYPE)) $$($1_LDFLAGS_$(OPENJDK_TARGET_OS))
+  $1_EXTRA_LIBS := $$($1_LIBS_$(OPENJDK_TARGET_OS_TYPE)) $$($1_LIBS_$(OPENJDK_TARGET_OS))
+  ifneq ($$($1_REAL_MAPFILE), )
     $1_EXTRA_LDFLAGS += $(call SET_SHARED_LIBRARY_MAPFILE,$$($1_REAL_MAPFILE))
   endif
 
@@ -835,7 +784,7 @@
   ifeq ($$($1_COPY_DEBUG_SYMBOLS), true)
     ifneq ($$($1_DEBUG_SYMBOLS), false)
       # Only copy debug symbols for dynamic libraries and programs.
-      ifeq ($$($1_STATIC_LIBRARY), )
+      ifneq ($$($1_TYPE), STATIC_LIBRARY)
         # Generate debuginfo files.
         ifeq ($(OPENJDK_TARGET_OS), windows)
           $1_EXTRA_LDFLAGS += -debug "-pdb:$$($1_OUTPUT_DIR)/$$($1_NOSUFFIX).pdb" \
@@ -899,17 +848,17 @@
     endif
   endif
 
-  ifneq (,$$($1_LIBRARY))
+  ifeq ($$($1_TYPE), LIBRARY)
     # Generating a dynamic library.
     $1_EXTRA_LDFLAGS += $$(call SET_SHARED_LIBRARY_NAME,$$($1_BASENAME))
     ifeq ($(OPENJDK_TARGET_OS), windows)
-      $1_EXTRA_LDFLAGS += "-implib:$$($1_OBJECT_DIR)/$$($1_LIBRARY).lib"
+      $1_EXTRA_LDFLAGS += "-implib:$$($1_OBJECT_DIR)/$$($1_NAME).lib"
       # Create a rule for the import lib so that other rules may depend on it
-      $$($1_OBJECT_DIR)/$$($1_LIBRARY).lib: $$($1_TARGET)
+      $$($1_OBJECT_DIR)/$$($1_NAME).lib: $$($1_TARGET)
     endif
 
     # Create loadmap on AIX. Helps in diagnosing some problems.
-    ifneq ($(COMPILER_BINDCMD_FILE_FLAG),)
+    ifneq ($(COMPILER_BINDCMD_FILE_FLAG), )
       $1_EXTRA_LDFLAGS += $(COMPILER_BINDCMD_FILE_FLAG)$$($1_OBJECT_DIR)/$$($1_NOSUFFIX).loadmap
     endif
 
@@ -924,7 +873,7 @@
     # If there are many object files, use an @-file...
     ifneq ($$(word 17, $$($1_ALL_OBJS)), )
       $1_OBJ_FILE_LIST := $$($1_OBJECT_DIR)/_$1_objectfilenames.txt
-      ifneq ($(COMPILER_COMMAND_FILE_FLAG),)
+      ifneq ($(COMPILER_COMMAND_FILE_FLAG), )
         $1_LD_OBJ_ARG := $(COMPILER_COMMAND_FILE_FLAG)$$($1_OBJ_FILE_LIST)
       else
         # ...except for toolchains which don't support them.
@@ -986,7 +935,7 @@
 
   endif
 
-  ifneq (,$$($1_STATIC_LIBRARY))
+  ifeq ($$($1_TYPE), STATIC_LIBRARY)
     $1_VARDEPS := $$($1_AR) $$($1_ARFLAGS) $$($1_LIBS) \
         $$($1_EXTRA_LIBS)
     $1_VARDEPS_FILE := $$(call DependOnVariable, $1_VARDEPS, \
@@ -1000,7 +949,7 @@
     endif
 
     $$($1_TARGET): $$($1_ALL_OBJS) $$($1_RES) $$($1_VARDEPS_FILE) $$(STATIC_MAPFILE_DEP)
-	$$(call LogInfo, Archiving $$($1_STATIC_LIBRARY))
+	$$(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))
@@ -1013,7 +962,7 @@
         endif
   endif
 
-  ifneq (,$$($1_PROGRAM))
+  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) \
         $$($1_LIBS) $$($1_EXTRA_LIBS) $$($1_MT) \
@@ -1038,13 +987,13 @@
 		        $$($1_LIBS) $$($1_EXTRA_LIBS))
                 ifeq ($(OPENJDK_TARGET_OS), windows)
                   ifneq ($$($1_MANIFEST), )
-		    $$($1_MT) -nologo -manifest $$($1_MANIFEST) -identity:"$$($1_PROGRAM).exe, version=$$($1_MANIFEST_VERSION)" -outputresource:$$@;#1
+		    $$($1_MT) -nologo -manifest $$($1_MANIFEST) -identity:"$$($1_NAME).exe, version=$$($1_MANIFEST_VERSION)" -outputresource:$$@;#1
                   endif
                 endif
                 # This only works if the openjdk_codesign identity is present on the system. Let
                 # silently fail otherwise.
-                ifneq (,$(CODESIGN))
-                  ifneq (,$$($1_CODESIGN))
+                ifneq ($(CODESIGN), )
+                  ifneq ($$($1_CODESIGN), )
 		    $(CODESIGN) -s openjdk_codesign $$@
                   endif
                 endif
--- a/make/common/TestFilesCompilation.gmk	Wed Feb 28 18:28:17 2018 +0000
+++ b/make/common/TestFilesCompilation.gmk	Wed Feb 28 21:16:11 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.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -61,11 +61,13 @@
     $1_OUTPUT_SUBDIR := lib
     $1_CFLAGS := $(CFLAGS_TESTLIB) $(CFLAGS_WARNINGS_ARE_ERRORS)
     $1_LDFLAGS := $(LDFLAGS_TESTLIB) $(call SET_SHARED_LIBRARY_ORIGIN)
+    $1_COMPILATION_TYPE := LIBRARY
   else ifeq ($$($1_TYPE), PROGRAM)
     $1_PREFIX = exe
     $1_OUTPUT_SUBDIR := bin
     $1_CFLAGS := $(CFLAGS_TESTEXE) $(CFLAGS_WARNINGS_ARE_ERRORS)
     $1_LDFLAGS := $(LDFLAGS_TESTEXE)
+    $1_COMPILATION_TYPE := EXECUTABLE
   else
     $$(error Unknown type: $$($1_TYPE))
   endif
@@ -78,7 +80,8 @@
   $$(foreach file, $$($1_FILE_LIST),\
     $$(eval name := $$(strip $$(patsubst $$($1_PREFIX)%, %, $$(basename $$(notdir $$(file)))))) \
     $$(eval $$(call SetupNativeCompilation, BUILD_TEST_$$(name), \
-        $$($1_TYPE) := $$(name), \
+        NAME := $$(name), \
+        TYPE := $$($1_COMPILATION_TYPE), \
         SRC := $$(patsubst %/,%,$$(dir $$(file))), \
         INCLUDE_FILES := $$(notdir $$(file)), \
         OBJECT_DIR := $$($1_OUTPUT_DIR)/support/$$($1_PREFIX)$$(name), \
--- a/make/hotspot/gensrc/GensrcAdlc.gmk	Wed Feb 28 18:28:17 2018 +0000
+++ b/make/hotspot/gensrc/GensrcAdlc.gmk	Wed Feb 28 21:16:11 2018 +0100
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2013, 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
@@ -53,7 +53,7 @@
 
   # Set the C++ standard if supported
   ADLC_CFLAGS += $(CXXSTD_CXXFLAG)
-  
+
   # NOTE: The old build didn't set -DASSERT for windows but it doesn't seem to
   # hurt.
   ADLC_CFLAGS += -DASSERT
@@ -63,6 +63,8 @@
   ADLC_CFLAGS += -I$(TOPDIR)/src/hotspot/share
 
   $(eval $(call SetupNativeCompilation, BUILD_ADLC, \
+      NAME := adlc, \
+      TYPE := EXECUTABLE, \
       TOOLCHAIN := TOOLCHAIN_BUILD_LINK_CXX, \
       SRC := $(TOPDIR)/src/hotspot/share/adlc, \
       EXTRA_FILES := $(TOPDIR)/src/hotspot/share/opto/opcodes.cpp, \
@@ -71,7 +73,6 @@
       LIBS := $(ADLC_LIBS), \
       OBJECT_DIR := $(JVM_VARIANT_OUTPUTDIR)/tools/adlc/objs, \
       OUTPUT_DIR := $(JVM_VARIANT_OUTPUTDIR)/tools/adlc, \
-      PROGRAM := adlc, \
       DEBUG_SYMBOLS := false, \
       DISABLED_WARNINGS_clang := tautological-compare, \
       DISABLED_WARNINGS_solstudio := notemsource, \
--- a/make/hotspot/lib/CompileDtracePostJvm.gmk	Wed Feb 28 18:28:17 2018 +0000
+++ b/make/hotspot/lib/CompileDtracePostJvm.gmk	Wed Feb 28 21:16:11 2018 +0100
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2013, 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
@@ -46,6 +46,8 @@
     # in the libjvm.so, using JVM_CFLAGS as setup in CompileJvm.gmk. Otherwise
     # this would preferrably have been done as a part of GensrcDtrace.gmk.
     $(eval $(call SetupNativeCompilation, BUILD_DTRACE_GEN_OFFSETS, \
+        NAME := dtraceGenOffsets, \
+        TYPE := EXECUTABLE, \
         SRC := $(TOPDIR)/make/hotspot/src/native/dtrace, \
         CC := $(BUILD_CXX), \
         CXX := $(BUILD_CXX), \
@@ -56,7 +58,6 @@
         LIBS := -lc, \
         OBJECT_DIR := $(JVM_VARIANT_OUTPUTDIR)/tools/dtrace-gen-offsets/objs, \
         OUTPUT_DIR := $(JVM_VARIANT_OUTPUTDIR)/tools/dtrace-gen-offsets, \
-        PROGRAM := dtraceGenOffsets, \
     ))
 
     DTRACE_GEN_OFFSETS_TOOL := $(BUILD_DTRACE_GEN_OFFSETS_TARGET)
@@ -178,7 +179,7 @@
     LIBJVM_DTRACE_OUTPUTDIR := $(JVM_VARIANT_OUTPUTDIR)/libjvm_dtrace
 
     $(eval $(call SetupNativeCompilation, BUILD_LIBJVM_DTRACE, \
-        LIBRARY := jvm_dtrace, \
+        NAME := jvm_dtrace, \
         OUTPUT_DIR := $(JVM_LIB_OUTPUTDIR), \
         SRC := $(TOPDIR)/src/java.base/solaris/native/libjvm_dtrace, \
         CFLAGS := -m64 -G -mt -KPIC, \
@@ -193,7 +194,7 @@
     # Note that libjvm_db.c has tests for COMPILER2, but this was never set by
     # the old build.
     $(eval $(call SetupNativeCompilation, BUILD_LIBJVM_DB, \
-        LIBRARY := jvm_db, \
+        NAME := jvm_db, \
         OUTPUT_DIR := $(JVM_LIB_OUTPUTDIR), \
         SRC := $(TOPDIR)/src/java.base/solaris/native/libjvm_db, \
         CFLAGS := -I$(JVM_VARIANT_OUTPUTDIR)/gensrc -I$(DTRACE_SUPPORT_DIR) \
--- a/make/hotspot/lib/CompileGtest.gmk	Wed Feb 28 18:28:17 2018 +0000
+++ b/make/hotspot/lib/CompileGtest.gmk	Wed Feb 28 21:16:11 2018 +0100
@@ -63,8 +63,8 @@
 # exclusive to the gtest libjvm.so.
 
 $(eval $(call SetupNativeCompilation, BUILD_GTEST_LIBJVM, \
+    NAME := jvm, \
     TOOLCHAIN := TOOLCHAIN_LINK_CXX, \
-    LIBRARY := jvm, \
     OUTPUT_DIR := $(JVM_OUTPUTDIR)/gtest, \
     OBJECT_DIR := $(JVM_OUTPUTDIR)/gtest/objs, \
     SRC := $(GTEST_TEST_SRC), \
@@ -108,7 +108,8 @@
 
 $(eval $(call SetupNativeCompilation, BUILD_GTEST_LAUNCHER, \
     TOOLCHAIN := TOOLCHAIN_LINK_CXX, \
-    PROGRAM := gtestLauncher, \
+    NAME := gtestLauncher, \
+    TYPE := EXECUTABLE, \
     OUTPUT_DIR := $(JVM_OUTPUTDIR)/gtest, \
     EXTRA_FILES := $(GTEST_LAUNCHER_SRC), \
     OBJECT_DIR := $(JVM_OUTPUTDIR)/gtest/launcher-objs, \
--- a/make/hotspot/lib/CompileJvm.gmk	Wed Feb 28 18:28:17 2018 +0000
+++ b/make/hotspot/lib/CompileJvm.gmk	Wed Feb 28 21:16:11 2018 +0100
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2013, 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
@@ -210,8 +210,8 @@
 # Now set up the actual compilation of the main hotspot native library
 
 $(eval $(call SetupNativeCompilation, BUILD_LIBJVM, \
+    NAME := jvm, \
     TOOLCHAIN := TOOLCHAIN_LINK_CXX, \
-    LIBRARY := jvm, \
     OUTPUT_DIR := $(JVM_LIB_OUTPUTDIR), \
     SRC := $(JVM_SRC_DIRS), \
     EXCLUDES := $(JVM_EXCLUDES), \
--- a/make/hotspot/lib/CompileLibjsig.gmk	Wed Feb 28 18:28:17 2018 +0000
+++ b/make/hotspot/lib/CompileLibjsig.gmk	Wed Feb 28 21:16:11 2018 +0100
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2013, 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
@@ -90,7 +90,7 @@
     LIB_OUTPUTDIR := $(call FindLibDirForModule, java.base)
 
     $(eval $(call SetupNativeCompilation, BUILD_LIBJSIG, \
-        LIBRARY := jsig, \
+        NAME := jsig, \
         SRC := $(LIBJSIG_SRC_DIR), \
         OUTPUT_DIR := $(LIB_OUTPUTDIR), \
         LANG := C, \
--- a/make/launcher/Launcher-java.base.gmk	Wed Feb 28 18:28:17 2018 +0000
+++ b/make/launcher/Launcher-java.base.gmk	Wed Feb 28 21:16:11 2018 +0100
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2011, 2017, 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
@@ -73,6 +73,8 @@
 
 ifeq ($(OPENJDK_TARGET_OS), linux)
   $(eval $(call SetupNativeCompilation, BUILD_JEXEC, \
+      NAME := jexec, \
+      TYPE := EXECUTABLE, \
       SRC := $(TOPDIR)/src/$(MODULE)/unix/native/launcher, \
       INCLUDE_FILES := jexec.c, \
       OPTIMIZATION := LOW, \
@@ -83,7 +85,6 @@
       LDFLAGS := $(LDFLAGS_JDKEXE), \
       OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/jexec_obj, \
       OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/modules_libs/$(MODULE), \
-      PROGRAM := jexec, \
   ))
 
   TARGETS += $(BUILD_JEXEC)
@@ -93,6 +94,8 @@
 
 ifneq ($(findstring $(OPENJDK_TARGET_OS), macosx solaris aix), )
   $(eval $(call SetupNativeCompilation, BUILD_JSPAWNHELPER, \
+      NAME := jspawnhelper, \
+      TYPE := EXECUTABLE, \
       SRC := $(TOPDIR)/src/$(MODULE)/unix/native/jspawnhelper, \
       OPTIMIZATION := LOW, \
       CFLAGS := $(CFLAGS_JDKEXE) -I$(TOPDIR)/src/$(MODULE)/unix/native/libjava, \
@@ -100,7 +103,6 @@
       LDFLAGS := $(LDFLAGS_JDKEXE), \
       OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/jspawnhelper, \
       OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/modules_libs/$(MODULE), \
-      PROGRAM := jspawnhelper, \
   ))
 
   TARGETS += $(BUILD_JSPAWNHELPER)
--- a/make/launcher/Launcher-jdk.accessibility.gmk	Wed Feb 28 18:28:17 2018 +0000
+++ b/make/launcher/Launcher-jdk.accessibility.gmk	Wed Feb 28 21:16:11 2018 +0100
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2014, 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
@@ -33,7 +33,9 @@
   JABSWITCH_SRC := $(TOPDIR)/src/jdk.accessibility/windows/native/jabswitch
   ACCESSBRIDGE_SRC := $(TOPDIR)/src/jdk.accessibility/windows/native/common
 
-  $(eval $(call SetupNativeCompilation,BUILD_JABSWITCH, \
+  $(eval $(call SetupNativeCompilation, BUILD_JABSWITCH, \
+      NAME := jabswitch, \
+      TYPE := EXECUTABLE, \
       SRC := $(JABSWITCH_SRC), \
       INCLUDE_FILES := jabswitch.cpp, \
       CFLAGS := $(filter-out -Zc:wchar_t-, $(CFLAGS_JDKEXE)) -Zc:wchar_t \
@@ -44,7 +46,6 @@
       LIBS := advapi32.lib version.lib user32.lib, \
       OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/jdk.accessibility/jabswitch, \
       OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/modules_cmds/jdk.accessibility, \
-      PROGRAM := jabswitch, \
       VERSIONINFO_RESOURCE := $(ACCESSBRIDGE_SRC)/AccessBridgeStatusWindow.RC, \
       RC_FLAGS := $(RC_FLAGS) \
           -D "JDK_FNAME=jabswitch.exe" \
@@ -70,6 +71,8 @@
   # Parameter 2 ACCESSBRIDGE_ARCH_ -D suffix
 
     $$(eval $$(call SetupNativeCompilation, BUILD_JACCESSINSPECTOR$1, \
+      NAME := jaccessinspector$1, \
+      TYPE := EXECUTABLE, \
       SRC := $(TOPDIR)/jaccessinspector $(TOPDIR)/common \
           $(TOPDIR)/toolscommon $(TOPDIR)/bridge, \
       CFLAGS := $$(CFLAGS_JDKEXE) $(TOOLS_CFLAGS) -DACCESSBRIDGE_ARCH_$2 -EHsc, \
@@ -77,7 +80,6 @@
       LIBS := advapi32.lib user32.lib, \
       OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/jdk.accessibility/jaccessinspector$1, \
       OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/modules_cmds/jdk.accessibility, \
-      PROGRAM := jaccessinspector$1, \
       VERSIONINFO_RESOURCE := $(TOPDIR)/jaccessinspector/jaccessinspectorWindow.rc, \
       RC_FLAGS := $$(RC_FLAGS) \
           -D "JDK_FNAME=jaccessinspector$1.exe" \
@@ -96,7 +98,9 @@
   # Parameter 1 File name suffix
   # Parameter 2 ACCESSBRIDGE_ARCH_ -D suffix
 
-    $$(eval $$(call SetupNativeCompilation,BUILD_JACCESSWALKER$1, \
+    $$(eval $$(call SetupNativeCompilation, BUILD_JACCESSWALKER$1, \
+      NAME := jaccesswalker$1, \
+      TYPE := EXECUTABLE, \
       SRC := $(TOPDIR)/jaccesswalker $(TOPDIR)/common \
           $(TOPDIR)/toolscommon $(TOPDIR)/bridge, \
       CFLAGS := $$(CFLAGS_JDKEXE) $(TOOLS_CFLAGS) -DACCESSBRIDGE_ARCH_$2 -EHsc, \
@@ -104,7 +108,6 @@
       LIBS := advapi32.lib comctl32.lib gdi32.lib user32.lib, \
       OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/jdk.accessibility/jaccesswalker$1, \
       OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/modules_cmds/jdk.accessibility, \
-      PROGRAM := jaccesswalker$1, \
       VERSIONINFO_RESOURCE := $(TOPDIR)/jaccesswalker/jaccesswalkerWindow.rc, \
       RC_FLAGS := $$(RC_FLAGS) \
           -D "JDK_FNAME=jaccesswalker$1.exe" \
--- a/make/launcher/Launcher-jdk.pack.gmk	Wed Feb 28 18:28:17 2018 +0000
+++ b/make/launcher/Launcher-jdk.pack.gmk	Wed Feb 28 21:16:11 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
@@ -73,7 +73,9 @@
   UNPACK_MAPFILE := $(UNPACK_MAPFILE_DIR)/mapfile-vers-unpack200
 endif
 
-$(eval $(call SetupNativeCompilation,BUILD_UNPACKEXE, \
+$(eval $(call SetupNativeCompilation, BUILD_UNPACKEXE, \
+    NAME := unpack200, \
+    TYPE := EXECUTABLE, \
     SRC := $(UNPACKEXE_SRC), \
     TOOLCHAIN := TOOLCHAIN_LINK_CXX, \
     OPTIMIZATION := LOW, \
@@ -91,7 +93,6 @@
     LIBS_solaris :=  -lc, \
     OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/unpackexe, \
     OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/modules_cmds/$(MODULE), \
-    PROGRAM := unpack200, \
     VERSIONINFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE), \
     RC_FLAGS := $(RC_FLAGS) \
         -D "JDK_FNAME=unpack200.exe" \
--- a/make/launcher/LauncherCommon.gmk	Wed Feb 28 18:28:17 2018 +0000
+++ b/make/launcher/LauncherCommon.gmk	Wed Feb 28 21:16:11 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
@@ -183,6 +183,8 @@
   endif
 
   $$(eval $$(call SetupNativeCompilation, BUILD_LAUNCHER_$1, \
+      NAME := $1, \
+      TYPE := EXECUTABLE, \
       EXTRA_FILES := $(LAUNCHER_SRC)/main.c, \
       OPTIMIZATION := $$($1_OPTIMIZATION), \
       CFLAGS := $$($1_CFLAGS) \
@@ -211,7 +213,6 @@
           $$($1_LIBS_windows), \
       OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/$1_objs, \
       OUTPUT_DIR := $$($1_OUTPUT_DIR), \
-      PROGRAM := $1, \
       VERSIONINFO_RESOURCE := $$($1_VERSION_INFO_RESOURCE), \
       RC_FLAGS := $$(RC_FLAGS) \
           -D "JDK_FNAME=$1$(EXE_SUFFIX)" \
--- a/make/lib/Awt2dLibraries.gmk	Wed Feb 28 18:28:17 2018 +0000
+++ b/make/lib/Awt2dLibraries.gmk	Wed Feb 28 21:16:11 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
@@ -48,8 +48,8 @@
   BUILD_LIBMLIB_LDLIBS += $(LIBM) $(LIBDL)
 endif
 
-$(eval $(call SetupNativeCompilation,BUILD_LIBMLIB_IMAGE, \
-    LIBRARY := mlib_image, \
+$(eval $(call SetupNativeCompilation, BUILD_LIBMLIB_IMAGE, \
+    NAME := mlib_image, \
     OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
     SRC := $(BUILD_LIBMLIB_SRC), \
     EXCLUDE_FILES := mlib_c_ImageBlendTable.c, \
@@ -107,8 +107,8 @@
 
   LIBMLIB_IMAGE_V_CFLAGS += $(filter-out -DMLIB_NO_LIBSUNMATH, $(BUILD_LIBMLIB_CFLAGS))
 
-  $(eval $(call SetupNativeCompilation,BUILD_LIBMLIB_IMAGE_V, \
-      LIBRARY := mlib_image_v, \
+  $(eval $(call SetupNativeCompilation, BUILD_LIBMLIB_IMAGE_V, \
+      NAME := mlib_image_v, \
       OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
       SRC := $(LIBMLIB_IMAGE_V_SRC), \
       EXCLUDE_FILES := $(BUILD_LIBMLIB_IMAGE_V_EXFILES), \
@@ -226,8 +226,8 @@
   LIBAWT_CFLAGS += -fgcse-after-reload
 endif
 
-$(eval $(call SetupNativeCompilation,BUILD_LIBAWT, \
-    LIBRARY := awt, \
+$(eval $(call SetupNativeCompilation, BUILD_LIBAWT, \
+    NAME := awt, \
     OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
     SRC := $(LIBAWT_DIRS), \
     EXCLUDES := $(LIBAWT_EXCLUDES), \
@@ -347,8 +347,8 @@
       BUILD_LIBAWT_XAWT_debug_mem.c_CFLAGS := -w
    endif
 
-    $(eval $(call SetupNativeCompilation,BUILD_LIBAWT_XAWT, \
-        LIBRARY := awt_xawt, \
+    $(eval $(call SetupNativeCompilation, BUILD_LIBAWT_XAWT, \
+        NAME := awt_xawt, \
         OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
         SRC := $(LIBAWT_XAWT_DIRS), \
         EXCLUDES := $(LIBAWT_XAWT_EXCLUDES), \
@@ -406,8 +406,8 @@
   LIBLCMS_CPPFLAGS += $(addprefix -I, $(LIBLCMS_SRC))
 endif
 
-$(eval $(call SetupNativeCompilation,BUILD_LIBLCMS, \
-    LIBRARY := lcms, \
+$(eval $(call SetupNativeCompilation, BUILD_LIBLCMS, \
+    NAME := lcms, \
     OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
     SRC := $(LIBLCMS_SRC), \
     INCLUDE_FILES := $(BUILD_LIBLCMS_INCLUDE_FILES), \
@@ -483,8 +483,8 @@
   BUILD_LIBJAVAJPEG_HEADERS := $(addprefix -I, $(LIBJAVAJPEG_SRC))
 endif
 
-$(eval $(call SetupNativeCompilation,BUILD_LIBJAVAJPEG, \
-    LIBRARY := javajpeg, \
+$(eval $(call SetupNativeCompilation, BUILD_LIBJAVAJPEG, \
+    NAME := javajpeg, \
     OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
     SRC := $(LIBJAVAJPEG_SRC), \
     INCLUDE_FILES := $(BUILD_LIBJAVAJPEG_INCLUDE_FILES), \
@@ -547,8 +547,8 @@
     endif
   endif
 
-  $(eval $(call SetupNativeCompilation,BUILD_LIBAWT_HEADLESS, \
-      LIBRARY := awt_headless, \
+  $(eval $(call SetupNativeCompilation, BUILD_LIBAWT_HEADLESS, \
+      NAME := awt_headless, \
       OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
       SRC := $(LIBAWT_HEADLESS_DIRS), \
       EXCLUDES := $(LIBAWT_HEADLESS_EXCLUDES), \
@@ -657,8 +657,8 @@
   BUILD_LIBFONTMANAGER_ExtensionSubtables.cpp_CXXFLAGS := -fno-strict-aliasing
 endif
 
-$(eval $(call SetupNativeCompilation,BUILD_LIBFONTMANAGER, \
-    LIBRARY := fontmanager, \
+$(eval $(call SetupNativeCompilation, BUILD_LIBFONTMANAGER, \
+    NAME := fontmanager, \
     OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libfontmanager, \
     SRC := $(LIBFONTMANAGER_SRC), \
     EXCLUDE_FILES := $(LIBFONTMANAGER_EXCLUDE_FILES) \
@@ -744,8 +744,8 @@
   ifeq ($(OPENJDK_TARGET_CPU), x86)
     KERNEL32_LIB := kernel32.lib
   endif
-  $(eval $(call SetupNativeCompilation,BUILD_LIBJAWT, \
-      LIBRARY := jawt, \
+  $(eval $(call SetupNativeCompilation, BUILD_LIBJAWT, \
+      NAME := jawt, \
       OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
       SRC := $(LIBJAWT_SRC), \
       INCLUDE_FILES := $(LIBJAWT_INCLUDE_FILES), \
@@ -804,8 +804,8 @@
     endif
   endif
 
-  $(eval $(call SetupNativeCompilation,BUILD_LIBJAWT, \
-      LIBRARY := jawt, \
+  $(eval $(call SetupNativeCompilation, BUILD_LIBJAWT, \
+      NAME := jawt, \
       OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
       SRC := $(LIBJAWT_SRC), \
       INCLUDE_FILES := $(JAWT_FILES), \
@@ -935,8 +935,8 @@
     LIBSPLASHSCREEN_LIBS += $(X_LIBS) -lX11 -lXext $(LIBM) -lpthread -ldl
   endif
 
-  $(eval $(call SetupNativeCompilation,BUILD_LIBSPLASHSCREEN, \
-      LIBRARY := splashscreen, \
+  $(eval $(call SetupNativeCompilation, BUILD_LIBSPLASHSCREEN, \
+      NAME := splashscreen, \
       OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
       SRC := $(LIBSPLASHSCREEN_DIRS), \
       EXCLUDE_FILES := imageioJPEG.c jpegdecoder.c pngtest.c, \
@@ -1008,8 +1008,8 @@
   LIBAWT_LWAWT_EXFILES := fontpath.c awt_Font.c X11Color.c
   LIBAWT_LWAWT_EXCLUDES := $(TOPDIR)/src/java.desktop/unix/native/common/awt/medialib
 
-  $(eval $(call SetupNativeCompilation,BUILD_LIBAWT_LWAWT, \
-      LIBRARY := awt_lwawt, \
+  $(eval $(call SetupNativeCompilation, BUILD_LIBAWT_LWAWT, \
+      NAME := awt_lwawt, \
       OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
       SRC := $(LIBAWT_LWAWT_DIRS), \
       INCLUDE_FILES := $(LIBAWT_LWAWT_FILES), \
@@ -1057,8 +1057,8 @@
 
 ifeq ($(OPENJDK_TARGET_OS), macosx)
 
-  $(eval $(call SetupNativeCompilation,BUILD_LIBOSXUI, \
-      LIBRARY := osxui, \
+  $(eval $(call SetupNativeCompilation, BUILD_LIBOSXUI, \
+      NAME := osxui, \
       OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
       SRC := $(TOPDIR)/src/java.desktop/macosx/native/libosxui, \
       OPTIMIZATION := LOW, \
--- a/make/lib/CoreLibraries.gmk	Wed Feb 28 18:28:17 2018 +0000
+++ b/make/lib/CoreLibraries.gmk	Wed Feb 28 21:16:11 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
@@ -55,8 +55,9 @@
 LIBFDLIBM_CFLAGS := -I$(LIBFDLIBM_SRC)
 
 ifneq ($(OPENJDK_TARGET_OS), macosx)
-  $(eval $(call SetupNativeCompilation,BUILD_LIBFDLIBM, \
-      STATIC_LIBRARY := fdlibm, \
+  $(eval $(call SetupNativeCompilation, BUILD_LIBFDLIBM, \
+      NAME := fdlibm, \
+      TYPE := STATIC_LIBRARY, \
       OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE), \
       SRC := $(LIBFDLIBM_SRC), \
       OPTIMIZATION := $(BUILD_LIBFDLIBM_OPTIMIZATION), \
@@ -77,8 +78,8 @@
 
   # On macosx the old build does partial (incremental) linking of fdlibm instead of
   # a plain static library.
-  $(eval $(call SetupNativeCompilation,BUILD_LIBFDLIBM_MAC, \
-      LIBRARY := fdlibm, \
+  $(eval $(call SetupNativeCompilation, BUILD_LIBFDLIBM_MAC, \
+      NAME := fdlibm, \
       OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libfdlibm, \
       SRC := $(LIBFDLIBM_SRC), \
       CFLAGS := $(CFLAGS_JDKLIB) $(LIBFDLIBM_CFLAGS), \
@@ -107,8 +108,8 @@
   endif
 endif
 
-$(eval $(call SetupNativeCompilation,BUILD_LIBVERIFY, \
-    LIBRARY := verify, \
+$(eval $(call SetupNativeCompilation, BUILD_LIBVERIFY, \
+    NAME := verify, \
     OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
     SRC := $(TOPDIR)/src/java.base/share/native/libverify, \
     OPTIMIZATION := $(LIBVERIFY_OPTIMIZATION), \
@@ -155,8 +156,8 @@
   endif
 endif
 
-$(eval $(call SetupNativeCompilation,BUILD_LIBJAVA, \
-    LIBRARY := java, \
+$(eval $(call SetupNativeCompilation, BUILD_LIBJAVA, \
+    NAME := java, \
     OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
     SRC := $(LIBJAVA_SRC_DIRS), \
     OPTIMIZATION := HIGH, \
@@ -218,8 +219,8 @@
   BUILD_LIBZIP_MMAP := -DUSE_MMAP
 endif
 
-$(eval $(call SetupNativeCompilation,BUILD_LIBZIP, \
-    LIBRARY := zip, \
+$(eval $(call SetupNativeCompilation, BUILD_LIBZIP, \
+    NAME := zip, \
     OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
     OPTIMIZATION := LOW, \
     SRC := $(TOPDIR)/src/java.base/share/native/libzip, \
@@ -262,8 +263,8 @@
     -I$(SUPPORT_OUTPUTDIR)/headers/java.base \
     #
 
-$(eval $(call SetupNativeCompilation,BUILD_LIBJIMAGE, \
-    LIBRARY := jimage, \
+$(eval $(call SetupNativeCompilation, BUILD_LIBJIMAGE, \
+    NAME := jimage, \
     TOOLCHAIN := TOOLCHAIN_LINK_CXX, \
     OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
     OPTIMIZATION := LOW, \
@@ -358,8 +359,8 @@
       )
 endif
 
-$(eval $(call SetupNativeCompilation,BUILD_LIBJLI, \
-    LIBRARY := jli, \
+$(eval $(call SetupNativeCompilation, BUILD_LIBJLI, \
+    NAME := jli, \
     OUTPUT_DIR := $(LIBJLI_OUTPUT_DIR), \
     SRC := $(LIBJLI_SRC_DIRS), \
     EXCLUDE_FILES := $(LIBJLI_EXCLUDE_FILES), \
@@ -415,8 +416,9 @@
 # with the shared library, so the static library is given a different name. No harm
 # in doing it for all platform to reduce complexity.
 ifeq ($(OPENJDK_TARGET_OS), windows)
-  $(eval $(call SetupNativeCompilation,BUILD_LIBJLI_STATIC, \
-      STATIC_LIBRARY := jli_static, \
+  $(eval $(call SetupNativeCompilation, BUILD_LIBJLI_STATIC, \
+      NAME := jli_static, \
+      TYPE := STATIC_LIBRARY, \
       OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE), \
       SRC := $(LIBJLI_SRC_DIRS), \
       EXCLUDE_FILES := $(LIBJLI_EXCLUDE_FILES), \
@@ -434,8 +436,8 @@
   # On macosx they do partial (incremental) linking of libjli_static.a
   # code it here...rather than add support to NativeCompilation
   # as this is first time I see it
-  $(eval $(call SetupNativeCompilation,BUILD_LIBJLI_STATIC, \
-      LIBRARY := jli_static, \
+  $(eval $(call SetupNativeCompilation, BUILD_LIBJLI_STATIC, \
+      NAME := jli_static, \
       OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE), \
       SRC := $(LIBJLI_SRC_DIRS), \
       EXCLUDE_FILES := $(LIBJLI_EXCLUDE_FILES), \
@@ -457,8 +459,9 @@
 
 else ifeq ($(OPENJDK_TARGET_OS), aix)
   # AIX also requires a static libjli because the compiler doesn't support '-rpath'
-  $(eval $(call SetupNativeCompilation,BUILD_LIBJLI_STATIC, \
-      STATIC_LIBRARY := jli_static, \
+  $(eval $(call SetupNativeCompilation, BUILD_LIBJLI_STATIC, \
+      NAME := jli_static, \
+      TYPE := STATIC_LIBRARY, \
       OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE), \
       SRC := $(LIBJLI_SRC_DIRS), \
       EXCLUDE_FILES := $(LIBJLI_EXCLUDE_FILES), \
--- a/make/lib/Lib-java.instrument.gmk	Wed Feb 28 18:28:17 2018 +0000
+++ b/make/lib/Lib-java.instrument.gmk	Wed Feb 28 21:16:11 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
@@ -49,8 +49,8 @@
   LIBINSTRUMENT_CFLAGS += -Dstrcasecmp=stricmp
 endif
 
-$(eval $(call SetupNativeCompilation,BUILD_LIBINSTRUMENT, \
-    LIBRARY := instrument, \
+$(eval $(call SetupNativeCompilation, BUILD_LIBINSTRUMENT, \
+    NAME := instrument, \
     OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
     SRC := $(LIBINSTRUMENT_SRC), \
     OPTIMIZATION := LOW, \
--- a/make/lib/Lib-java.management.gmk	Wed Feb 28 18:28:17 2018 +0000
+++ b/make/lib/Lib-java.management.gmk	Wed Feb 28 21:16:11 2018 +0100
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2011, 2017, 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
@@ -44,8 +44,8 @@
   endif
 endif
 
-$(eval $(call SetupNativeCompilation,BUILD_LIBMANAGEMENT, \
-    LIBRARY := management, \
+$(eval $(call SetupNativeCompilation, BUILD_LIBMANAGEMENT, \
+    NAME := management, \
     OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
     SRC := $(LIBMANAGEMENT_SRC), \
     OPTIMIZATION := $(LIBMANAGEMENT_OPTIMIZATION), \
--- a/make/lib/Lib-java.prefs.gmk	Wed Feb 28 18:28:17 2018 +0000
+++ b/make/lib/Lib-java.prefs.gmk	Wed Feb 28 21:16:11 2018 +0100
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2011, 2015, 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
@@ -33,8 +33,8 @@
   LIBPREF_SRC_DIRS := $(TOPDIR)/src/java.prefs/$(OPENJDK_TARGET_OS_TYPE)/native/libprefs
 endif
 
-$(eval $(call SetupNativeCompilation,BUILD_LIBPREFS, \
-    LIBRARY := prefs, \
+$(eval $(call SetupNativeCompilation, BUILD_LIBPREFS, \
+    NAME := prefs, \
     OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
     SRC := $(LIBPREF_SRC_DIRS), \
     OPTIMIZATION := HIGH, \
--- a/make/lib/Lib-java.rmi.gmk	Wed Feb 28 18:28:17 2018 +0000
+++ b/make/lib/Lib-java.rmi.gmk	Wed Feb 28 21:16:11 2018 +0100
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2016, 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,8 +27,8 @@
 
 ################################################################################
 
-$(eval $(call SetupNativeCompilation,BUILD_LIBRMI, \
-    LIBRARY := rmi, \
+$(eval $(call SetupNativeCompilation, BUILD_LIBRMI, \
+    NAME := rmi, \
     OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
     SRC := $(TOPDIR)/src/java.rmi/share/native/librmi, \
     OPTIMIZATION := LOW, \
--- a/make/lib/Lib-java.security.jgss.gmk	Wed Feb 28 18:28:17 2018 +0000
+++ b/make/lib/Lib-java.security.jgss.gmk	Wed Feb 28 21:16:11 2018 +0100
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2011, 2015, 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
@@ -32,8 +32,8 @@
       $(TOPDIR)/src/java.security.jgss/$(OPENJDK_TARGET_OS_TYPE)/native/libj2gss \
       #
 
-  $(eval $(call SetupNativeCompilation,BUILD_LIBJ2GSS, \
-      LIBRARY := j2gss, \
+  $(eval $(call SetupNativeCompilation, BUILD_LIBJ2GSS, \
+      NAME := j2gss, \
       OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
       SRC := $(LIBJ2GSS_SRC), \
       OPTIMIZATION := LOW, \
@@ -74,8 +74,8 @@
   ifneq ($(BUILD_LIBKRB5_NAME), )
     # libosxkrb5 needs to call deprecated krb5 APIs so that java
     # can use the native credentials cache.
-    $(eval $(call SetupNativeCompilation,BUILD_LIBKRB5, \
-        LIBRARY := $(BUILD_LIBKRB5_NAME), \
+    $(eval $(call SetupNativeCompilation, BUILD_LIBKRB5, \
+        NAME := $(BUILD_LIBKRB5_NAME), \
         OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
         SRC := $(BUILD_LIBKRB5_SRC), \
         OPTIMIZATION := LOW, \
--- a/make/lib/Lib-java.smartcardio.gmk	Wed Feb 28 18:28:17 2018 +0000
+++ b/make/lib/Lib-java.smartcardio.gmk	Wed Feb 28 21:16:11 2018 +0100
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2011, 2015, 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
@@ -33,8 +33,8 @@
     -I$(TOPDIR)/src/java.smartcardio/$(OPENJDK_TARGET_OS_TYPE)/native/libj2pcsc/MUSCLE \
     -I$(SUPPORT_OUTPUTDIR)/headers/java.smartcardio
 
-$(eval $(call SetupNativeCompilation,BUILD_LIBJ2PCSC, \
-    LIBRARY := j2pcsc, \
+$(eval $(call SetupNativeCompilation, BUILD_LIBJ2PCSC, \
+    NAME := j2pcsc, \
     OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
     SRC := $(LIBJ2PCSC_SRC), \
     CFLAGS_unix := -D__sun_jdk, \
--- a/make/lib/Lib-jdk.accessibility.gmk	Wed Feb 28 18:28:17 2018 +0000
+++ b/make/lib/Lib-jdk.accessibility.gmk	Wed Feb 28 21:16:11 2018 +0100
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2014, 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
@@ -41,8 +41,8 @@
     # Parameter 1 Suffix
     # Parameter 2 ACCESSBRIDGE_ARCH_ suffix
 
-    $(call SetupNativeCompilation,BUILD_JAVAACCESSBRIDGE$1, \
-        LIBRARY = javaaccessbridge$1, \
+    $(call SetupNativeCompilation, BUILD_JAVAACCESSBRIDGE$1, \
+        NAME := javaaccessbridge$1, \
         OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
         SRC := $(JAVA_AB_SRCDIR), \
         OPTIMIZATION := LOW, \
@@ -71,8 +71,8 @@
   define SetupWinDLL
     # Parameter 1 Suffix
     # Parameter 2 ACCESSBRIDGE_ARCH_ suffix
-    $(call SetupNativeCompilation,BUILD_WINDOWSACCESSBRIDGE$1, \
-        LIBRARY = windowsaccessbridge$1, \
+    $(call SetupNativeCompilation, BUILD_WINDOWSACCESSBRIDGE$1, \
+        NAME := windowsaccessbridge$1, \
         OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
         SRC := $(WIN_AB_SRCDIR), \
         OPTIMIZATION := LOW, \
@@ -99,8 +99,8 @@
 
   define SetupAccessBridgeSysInfo
 
-    $(call SetupNativeCompilation,BUILD_ACCESSBRIDGESYSINFO, \
-        LIBRARY = jabsysinfo, \
+    $(call SetupNativeCompilation, BUILD_ACCESSBRIDGESYSINFO, \
+        NAME := jabsysinfo, \
         OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
         SRC := $(SYSINFO_SRCDIR), \
         OPTIMIZATION := LOW, \
--- a/make/lib/Lib-jdk.attach.gmk	Wed Feb 28 18:28:17 2018 +0000
+++ b/make/lib/Lib-jdk.attach.gmk	Wed Feb 28 21:16:11 2018 +0100
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2011, 2015, 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
@@ -34,8 +34,8 @@
   LIBATTACH_CFLAGS := -DPSAPI_VERSION=1
 endif
 
-$(eval $(call SetupNativeCompilation,BUILD_LIBATTACH, \
-    LIBRARY := attach, \
+$(eval $(call SetupNativeCompilation, BUILD_LIBATTACH, \
+    NAME := attach, \
     OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
     SRC := $(call FindSrcDirsForLib, jdk.attach, attach), \
     OPTIMIZATION := LOW, \
--- a/make/lib/Lib-jdk.crypto.cryptoki.gmk	Wed Feb 28 18:28:17 2018 +0000
+++ b/make/lib/Lib-jdk.crypto.cryptoki.gmk	Wed Feb 28 21:16:11 2018 +0100
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2011, 2017, 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
@@ -30,8 +30,8 @@
 LIBJ2PKCS11_SRC := $(TOPDIR)/src/jdk.crypto.cryptoki/share/native/libj2pkcs11 \
     $(TOPDIR)/src/jdk.crypto.cryptoki/$(OPENJDK_TARGET_OS_TYPE)/native/libj2pkcs11
 
-$(eval $(call SetupNativeCompilation,BUILD_LIBJ2PKCS11, \
-    LIBRARY := j2pkcs11, \
+$(eval $(call SetupNativeCompilation, BUILD_LIBJ2PKCS11, \
+    NAME := j2pkcs11, \
     OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
     SRC := $(LIBJ2PKCS11_SRC), \
     OPTIMIZATION := LOW, \
--- a/make/lib/Lib-jdk.crypto.ec.gmk	Wed Feb 28 18:28:17 2018 +0000
+++ b/make/lib/Lib-jdk.crypto.ec.gmk	Wed Feb 28 21:16:11 2018 +0100
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2011, 2015, 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
@@ -43,8 +43,8 @@
     ECC_JNI_SOLSPARC_FILTER := -xregs=no%appl
   endif
 
-  $(eval $(call SetupNativeCompilation,BUILD_LIBSUNEC, \
-      LIBRARY := sunec, \
+  $(eval $(call SetupNativeCompilation, BUILD_LIBSUNEC, \
+      NAME := sunec, \
       OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
       SRC := $(LIBSUNEC_SRC), \
       TOOLCHAIN := TOOLCHAIN_LINK_CXX, \
--- a/make/lib/Lib-jdk.crypto.mscapi.gmk	Wed Feb 28 18:28:17 2018 +0000
+++ b/make/lib/Lib-jdk.crypto.mscapi.gmk	Wed Feb 28 21:16:11 2018 +0100
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2011, 2015, 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
@@ -31,8 +31,8 @@
 
   LIBSUNMSCAPI_SRC := $(TOPDIR)/src/jdk.crypto.mscapi/$(OPENJDK_TARGET_OS_TYPE)/native/libsunmscapi
 
-  $(eval $(call SetupNativeCompilation,BUILD_LIBSUNMSCAPI, \
-      LIBRARY := sunmscapi, \
+  $(eval $(call SetupNativeCompilation, BUILD_LIBSUNMSCAPI, \
+      NAME := sunmscapi, \
       OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
       SRC := $(LIBSUNMSCAPI_SRC), \
       OPTIMIZATION := LOW, \
--- a/make/lib/Lib-jdk.crypto.ucrypto.gmk	Wed Feb 28 18:28:17 2018 +0000
+++ b/make/lib/Lib-jdk.crypto.ucrypto.gmk	Wed Feb 28 21:16:11 2018 +0100
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2014, 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,8 +31,8 @@
 
   LIBJ2UCRYPTO_SRC := $(TOPDIR)/src/jdk.crypto.ucrypto/solaris/native/libj2ucrypto
 
-  $(eval $(call SetupNativeCompilation,BUILD_LIBJ2UCRYPTO, \
-      LIBRARY := j2ucrypto, \
+  $(eval $(call SetupNativeCompilation, BUILD_LIBJ2UCRYPTO, \
+      NAME := j2ucrypto, \
       OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
       SRC := $(LIBJ2UCRYPTO_SRC), \
       OPTIMIZATION := LOW, \
--- a/make/lib/Lib-jdk.hotspot.agent.gmk	Wed Feb 28 18:28:17 2018 +0000
+++ b/make/lib/Lib-jdk.hotspot.agent.gmk	Wed Feb 28 21:16:11 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.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -98,12 +98,12 @@
 ################################################################################
 
 $(eval $(call SetupNativeCompilation, BUILD_LIBSA, \
+    NAME := $(SA_NAME), \
     TOOLCHAIN := $(SA_TOOLCHAIN), \
     OPTIMIZATION := NONE, \
     DISABLED_WARNINGS_microsoft := 4267, \
     DISABLED_WARNINGS_gcc := sign-compare, \
     DISABLED_WARNINGS_CXX_solstudio := truncwarn unknownpragma, \
-    LIBRARY := $(SA_NAME), \
     OUTPUT_DIR := $(call FindLibDirForModule, $(MODULE)), \
     SRC := $(SA_SRC), \
     EXCLUDE_FILES := test.c saproc_audit.cpp $(SA_EXCLUDE_FILES), \
--- a/make/lib/Lib-jdk.internal.le.gmk	Wed Feb 28 18:28:17 2018 +0000
+++ b/make/lib/Lib-jdk.internal.le.gmk	Wed Feb 28 21:16:11 2018 +0100
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2015, 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
@@ -36,8 +36,8 @@
       -I$(SUPPORT_OUTPUTDIR)/headers/jdk.internal.le \
       #
 
-  $(eval $(call SetupNativeCompilation,BUILD_LIBLE, \
-      LIBRARY := le, \
+  $(eval $(call SetupNativeCompilation, BUILD_LIBLE, \
+      NAME := le, \
       OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
       SRC := $(LIBLE_SRC), \
       OPTIMIZATION := LOW, \
--- a/make/lib/Lib-jdk.jdi.gmk	Wed Feb 28 18:28:17 2018 +0000
+++ b/make/lib/Lib-jdk.jdi.gmk	Wed Feb 28 21:16:11 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
@@ -39,8 +39,8 @@
       -I$(SUPPORT_OUTPUTDIR)/headers/jdk.jdi \
       #
 
-  $(eval $(call SetupNativeCompilation,BUILD_LIBDT_SHMEM, \
-      LIBRARY := dt_shmem, \
+  $(eval $(call SetupNativeCompilation, BUILD_LIBDT_SHMEM, \
+      NAME := dt_shmem, \
       OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
       SRC := $(LIBDT_SHMEM_SRC), \
       OPTIMIZATION := LOW, \
--- a/make/lib/Lib-jdk.jdwp.agent.gmk	Wed Feb 28 18:28:17 2018 +0000
+++ b/make/lib/Lib-jdk.jdwp.agent.gmk	Wed Feb 28 21:16:11 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
@@ -36,8 +36,8 @@
     -I$(TOPDIR)/src/jdk.jdwp.agent/share/native/include \
     #
 
-$(eval $(call SetupNativeCompilation,BUILD_LIBDT_SOCKET, \
-    LIBRARY := dt_socket, \
+$(eval $(call SetupNativeCompilation, BUILD_LIBDT_SOCKET, \
+    NAME := dt_socket, \
     OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
     SRC := $(LIBDT_SOCKET_SRC), \
     OPTIMIZATION := LOW, \
@@ -73,8 +73,8 @@
     $(addprefix -I, $(LIBJDWP_SRC))
 
 # JDWP_LOGGING causes log messages to be compiled into the library.
-$(eval $(call SetupNativeCompilation,BUILD_LIBJDWP, \
-    LIBRARY := jdwp, \
+$(eval $(call SetupNativeCompilation, BUILD_LIBJDWP, \
+    NAME := jdwp, \
     OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
     SRC := $(LIBJDWP_SRC), \
     OPTIMIZATION := LOW, \
--- a/make/lib/Lib-jdk.management.agent.gmk	Wed Feb 28 18:28:17 2018 +0000
+++ b/make/lib/Lib-jdk.management.agent.gmk	Wed Feb 28 21:16:11 2018 +0100
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2017, 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
@@ -33,8 +33,8 @@
     $(LIBJAVA_HEADER_FLAGS) \
     #
 
-$(eval $(call SetupNativeCompilation,BUILD_LIBMANAGEMENT_AGENT, \
-    LIBRARY := management_agent, \
+$(eval $(call SetupNativeCompilation, BUILD_LIBMANAGEMENT_AGENT, \
+    NAME := management_agent, \
     OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
     SRC := $(LIBMANAGEMENT_AGENT_SRC), \
     OPTIMIZATION := LOW, \
--- a/make/lib/Lib-jdk.management.gmk	Wed Feb 28 18:28:17 2018 +0000
+++ b/make/lib/Lib-jdk.management.gmk	Wed Feb 28 21:16:11 2018 +0100
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2015, 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
@@ -53,8 +53,8 @@
   endif
 endif
 
-$(eval $(call SetupNativeCompilation,BUILD_LIBMANAGEMENT_EXT, \
-    LIBRARY := management_ext, \
+$(eval $(call SetupNativeCompilation, BUILD_LIBMANAGEMENT_EXT, \
+    NAME := management_ext, \
     OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
     SRC := $(LIBMANAGEMENT_EXT_SRC), \
     LANG := C, \
--- a/make/lib/Lib-jdk.net.gmk	Wed Feb 28 18:28:17 2018 +0000
+++ b/make/lib/Lib-jdk.net.gmk	Wed Feb 28 21:16:11 2018 +0100
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2016, 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,7 +30,7 @@
 ifeq ($(OPENJDK_TARGET_OS), solaris)
 
   $(eval $(call SetupNativeCompilation, BUILD_LIBEXTNET, \
-      LIBRARY := extnet, \
+      NAME := extnet, \
       OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
       SRC := $(TOPDIR)/src/jdk.net/solaris/native/libextnet, \
       OPTIMIZATION := LOW, \
@@ -51,7 +51,7 @@
 ifeq ($(OPENJDK_TARGET_OS), linux)
 
   $(eval $(call SetupNativeCompilation, BUILD_LIBEXTNET, \
-      LIBRARY := extnet, \
+      NAME := extnet, \
       OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
       SRC := $(TOPDIR)/src/jdk.net/linux/native/libextnet, \
       OPTIMIZATION := LOW, \
--- a/make/lib/Lib-jdk.pack.gmk	Wed Feb 28 18:28:17 2018 +0000
+++ b/make/lib/Lib-jdk.pack.gmk	Wed Feb 28 21:16:11 2018 +0100
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2011, 2015, 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
@@ -27,8 +27,8 @@
 
 ################################################################################
 
-$(eval $(call SetupNativeCompilation,BUILD_LIBUNPACK, \
-    LIBRARY := unpack, \
+$(eval $(call SetupNativeCompilation, BUILD_LIBUNPACK, \
+    NAME := unpack, \
     OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
     SRC := $(TOPDIR)/src/jdk.pack/share/native/libunpack \
         $(TOPDIR)/src/jdk.pack/share/native/common-unpack, \
--- a/make/lib/Lib-jdk.sctp.gmk	Wed Feb 28 18:28:17 2018 +0000
+++ b/make/lib/Lib-jdk.sctp.gmk	Wed Feb 28 21:16:11 2018 +0100
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2011, 2015, 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
@@ -30,8 +30,8 @@
 ifeq ($(OPENJDK_TARGET_OS_TYPE), unix)
 
   ifeq (, $(filter $(OPENJDK_TARGET_OS), macosx aix))
-    $(eval $(call SetupNativeCompilation,BUILD_LIBSCTP, \
-        LIBRARY := sctp, \
+    $(eval $(call SetupNativeCompilation, BUILD_LIBSCTP, \
+        NAME := sctp, \
         OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
         SRC := $(TOPDIR)/src/jdk.sctp/$(OPENJDK_TARGET_OS_TYPE)/native/libsctp, \
         OPTIMIZATION := LOW, \
--- a/make/lib/Lib-jdk.security.auth.gmk	Wed Feb 28 18:28:17 2018 +0000
+++ b/make/lib/Lib-jdk.security.auth.gmk	Wed Feb 28 21:16:11 2018 +0100
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2011, 2015, 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
@@ -38,8 +38,8 @@
   LIBJAAS_NAME := jaas_nt
 endif
 
-$(eval $(call SetupNativeCompilation,BUILD_LIBJAAS, \
-    LIBRARY := $(LIBJAAS_NAME), \
+$(eval $(call SetupNativeCompilation, BUILD_LIBJAAS, \
+    NAME := $(LIBJAAS_NAME), \
     OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
     SRC := $(call FindSrcDirsForLib, jdk.security.auth, jaas), \
     OPTIMIZATION := LOW, \
--- a/make/lib/LibosxLibraries.gmk	Wed Feb 28 18:28:17 2018 +0000
+++ b/make/lib/LibosxLibraries.gmk	Wed Feb 28 21:16:11 2018 +0100
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2011, 2015, 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
@@ -34,8 +34,8 @@
       -I$(SUPPORT_OUTPUTDIR)/headers/java.desktop \
       #
 
-  $(eval $(call SetupNativeCompilation,BUILD_LIBOSX, \
-      LIBRARY := osx, \
+  $(eval $(call SetupNativeCompilation, BUILD_LIBOSX, \
+      NAME := osx, \
       OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
       SRC := $(LIBOSX_DIRS), \
       OPTIMIZATION := LOW, \
--- a/make/lib/NetworkingLibraries.gmk	Wed Feb 28 18:28:17 2018 +0000
+++ b/make/lib/NetworkingLibraries.gmk	Wed Feb 28 21:16:11 2018 +0100
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2011, 2017, 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
@@ -25,8 +25,8 @@
 
 LIBNET_SRC_DIRS := $(call FindSrcDirsForLib, java.base, net)
 
-$(eval $(call SetupNativeCompilation,BUILD_LIBNET, \
-    LIBRARY := net, \
+$(eval $(call SetupNativeCompilation, BUILD_LIBNET, \
+    NAME := net, \
     OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
     SRC := $(LIBNET_SRC_DIRS), \
     OPTIMIZATION := LOW, \
--- a/make/lib/NioLibraries.gmk	Wed Feb 28 18:28:17 2018 +0000
+++ b/make/lib/NioLibraries.gmk	Wed Feb 28 21:16:11 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
@@ -56,8 +56,8 @@
   BUILD_LIBNIO_MAPFILE := $(TOPDIR)/make/mapfiles/libnio/mapfile-$(OPENJDK_TARGET_OS)
 endif
 
-$(eval $(call SetupNativeCompilation,BUILD_LIBNIO, \
-    LIBRARY := nio, \
+$(eval $(call SetupNativeCompilation, BUILD_LIBNIO, \
+    NAME := nio, \
     OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
     SRC := $(BUILD_LIBNIO_SRC), \
     EXCLUDE_FILES := $(BUILD_LIBNIO_EXFILES), \
--- a/make/lib/PlatformLibraries.gmk	Wed Feb 28 18:28:17 2018 +0000
+++ b/make/lib/PlatformLibraries.gmk	Wed Feb 28 21:16:11 2018 +0100
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2011, 2015, 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
@@ -29,8 +29,8 @@
 
   LIBOSXAPP_SRC := $(TOPDIR)/src/java.desktop/macosx/native/libosxapp
 
-  $(eval $(call SetupNativeCompilation,BUILD_LIBOSXAPP, \
-      LIBRARY := osxapp, \
+  $(eval $(call SetupNativeCompilation, BUILD_LIBOSXAPP, \
+      NAME := osxapp, \
       OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
       SRC := $(LIBOSXAPP_SRC), \
       OPTIMIZATION := LOW, \
--- a/make/lib/SecurityLibraries.gmk	Wed Feb 28 18:28:17 2018 +0000
+++ b/make/lib/SecurityLibraries.gmk	Wed Feb 28 21:16:11 2018 +0100
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2015, 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
@@ -26,7 +26,7 @@
 include LibCommon.gmk
 
 ifeq ($(OPENJDK_TARGET_OS), macosx)
-  # JavaNativeFoundation framework not supported in static builds 
+  # JavaNativeFoundation framework not supported in static builds
   ifneq ($(STATIC_BUILD), true)
 
   ################################################################################
@@ -36,8 +36,8 @@
         $(LIBJAVA_HEADER_FLAGS) \
         -I$(SUPPORT_OUTPUTDIR)/headers/java.base \
 
-    $(eval $(call SetupNativeCompilation,BUILD_LIBOSXSECURITY, \
-        LIBRARY := osxsecurity, \
+    $(eval $(call SetupNativeCompilation, BUILD_LIBOSXSECURITY, \
+        NAME := osxsecurity, \
         OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
         SRC := $(LIBOSXSECURITY_DIRS), \
         OPTIMIZATION := LOW, \
--- a/make/lib/SoundLibraries.gmk	Wed Feb 28 18:28:17 2018 +0000
+++ b/make/lib/SoundLibraries.gmk	Wed Feb 28 21:16:11 2018 +0100
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2011, 2015, 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
@@ -114,8 +114,8 @@
 
 LIBJSOUND_CFLAGS += -DEXTRA_SOUND_JNI_LIBS='"$(EXTRA_SOUND_JNI_LIBS)"'
 
-$(eval $(call SetupNativeCompilation,BUILD_LIBJSOUND, \
-    LIBRARY := jsound, \
+$(eval $(call SetupNativeCompilation, BUILD_LIBJSOUND, \
+    NAME := jsound, \
     OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
     SRC := $(LIBJSOUND_SRC_DIRS), \
     INCLUDE_FILES := $(LIBJSOUND_SRC_FILES), \
@@ -149,8 +149,8 @@
 
 ifneq ($(filter jsoundalsa, $(EXTRA_SOUND_JNI_LIBS)), )
 
-  $(eval $(call SetupNativeCompilation,BUILD_LIBJSOUNDALSA, \
-      LIBRARY := jsoundalsa, \
+  $(eval $(call SetupNativeCompilation, BUILD_LIBJSOUNDALSA, \
+      NAME := jsoundalsa, \
       OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
       SRC := $(LIBJSOUND_SRC_DIRS), \
       INCLUDE_FILES := Utilities.c $(LIBJSOUND_MIDIFILES) $(LIBJSOUND_PORTFILES) \
@@ -186,8 +186,8 @@
 
 ifneq ($(filter jsoundds, $(EXTRA_SOUND_JNI_LIBS)), )
 
-  $(eval $(call SetupNativeCompilation,BUILD_LIBJSOUNDDS, \
-      LIBRARY := jsoundds, \
+  $(eval $(call SetupNativeCompilation, BUILD_LIBJSOUNDDS, \
+      NAME := jsoundds, \
       OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
       SRC := $(LIBJSOUND_SRC_DIRS), \
       INCLUDE_FILES := Utilities.c $(LIBJSOUND_DAUDIOFILES) \
--- a/make/test/BuildFailureHandler.gmk	Wed Feb 28 18:28:17 2018 +0000
+++ b/make/test/BuildFailureHandler.gmk	Wed Feb 28 21:16:11 2018 +0100
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2016, 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
@@ -64,7 +64,7 @@
 ifeq ($(OPENJDK_TARGET_OS), windows)
 
   $(eval $(call SetupNativeCompilation, BUILD_LIBTIMEOUT_HANDLER, \
-        LIBRARY := timeoutHandler, \
+        NAME := timeoutHandler, \
         SRC := $(FH_BASEDIR)/src/windows/native/libtimeoutHandler, \
         OBJECT_DIR := $(FH_SUPPORT)/libtimeoutHandler, \
         OUTPUT_DIR := $(FH_SUPPORT), \