8077824: Introduce DefineNativeToolchain to handle toolchain configurations
authorerikj
Fri, 17 Apr 2015 13:55:42 +0200
changeset 29931 64e274ed6567
parent 29930 d816cb0064ee
child 29932 f3b242bc6136
8077824: Introduce DefineNativeToolchain to handle toolchain configurations Reviewed-by: ihse, tbell
jdk/make/CompileDemos.gmk
jdk/make/Tools.gmk
jdk/make/gensrc/GensrcMisc.gmk
jdk/make/launcher/Launcher-java.base.gmk
jdk/make/launcher/Launcher-jdk.accessibility.gmk
jdk/make/launcher/Launcher-jdk.pack200.gmk
jdk/make/launcher/LauncherCommon.gmk
jdk/make/lib/Awt2dLibraries.gmk
jdk/make/lib/CoreLibraries.gmk
jdk/make/lib/Lib-java.instrument.gmk
jdk/make/lib/Lib-java.management.gmk
jdk/make/lib/Lib-java.prefs.gmk
jdk/make/lib/Lib-java.security.jgss.gmk
jdk/make/lib/Lib-java.smartcardio.gmk
jdk/make/lib/Lib-jdk.accessibility.gmk
jdk/make/lib/Lib-jdk.attach.gmk
jdk/make/lib/Lib-jdk.crypto.ec.gmk
jdk/make/lib/Lib-jdk.crypto.mscapi.gmk
jdk/make/lib/Lib-jdk.crypto.pkcs11.gmk
jdk/make/lib/Lib-jdk.crypto.ucrypto.gmk
jdk/make/lib/Lib-jdk.deploy.osx.gmk
jdk/make/lib/Lib-jdk.hprof.agent.gmk
jdk/make/lib/Lib-jdk.jdi.gmk
jdk/make/lib/Lib-jdk.jdwp.agent.gmk
jdk/make/lib/Lib-jdk.pack200.gmk
jdk/make/lib/Lib-jdk.sctp.gmk
jdk/make/lib/Lib-jdk.security.auth.gmk
jdk/make/lib/NetworkingLibraries.gmk
jdk/make/lib/NioLibraries.gmk
jdk/make/lib/PlatformLibraries.gmk
jdk/make/lib/SoundLibraries.gmk
--- a/jdk/make/CompileDemos.gmk	Fri Apr 17 16:50:16 2015 +0900
+++ b/jdk/make/CompileDemos.gmk	Fri Apr 17 13:55:42 2015 +0200
@@ -230,11 +230,8 @@
       $$(wildcard $$(patsubst %, $(DEMO_SHARE_SRC)/jvmti/%/README.txt, $2)) \
       $$(wildcard $$(patsubst %, $(DEMO_SHARE_SRC)/jvmti/%/sample.makefile.txt, $2))
   BUILD_DEMO_JVMTI_$1_EXTRA_INC := $$(addprefix -I, $$(BUILD_DEMO_JVMTI_$1_EXTRA_SRC))
-  BUILD_DEMO_JVMTI_$1_LANG := C
-  ifneq (, $4)
-    BUILD_DEMO_JVMTI_$1_LANG := $4
-  endif
   ifeq (C++, $4)
+    BUILD_DEMO_JVMTI_$1_TOOLCHAIN := TOOLCHAIN_LINK_CXX
     $1_EXTRA_CXX := $(LDFLAGS_CXX_JDK) $(LIBCXX)
   endif
 
@@ -254,7 +251,7 @@
   # Remove the -incremental:no setting to get .ilk-files like in the old build.
   $$(eval $$(call SetupNativeCompilation,BUILD_DEMO_JVMTI_$1, \
       SRC := $(DEMO_SHARE_SRC)/jvmti/$1 $$(BUILD_DEMO_JVMTI_$1_EXTRA_SRC), \
-      LANG := $$(BUILD_DEMO_JVMTI_$1_LANG), \
+      TOOLCHAIN := $$(BUILD_DEMO_JVMTI_$1_TOOLCHAIN), \
       OPTIMIZATION := LOW, \
       CXXFLAGS := $$($1_CXXFLAGS), \
       DISABLED_WARNINGS_gcc := $(10), \
@@ -398,7 +395,6 @@
 
   $(eval $(call SetupNativeCompilation,BUILD_LIBPOLLER, \
       SRC := $(DEMO_SOLARIS_SRC)/jni/Poller, \
-      LANG := C, \
       OPTIMIZATION := LOW, \
       CFLAGS := $(CFLAGS_JDKLIB) $(SHARED_LIBRARY_FLAGS) \
           -I$(SUPPORT_OUTPUTDIR)/demo/classes/jni/Poller, \
--- a/jdk/make/Tools.gmk	Fri Apr 17 16:50:16 2015 +0900
+++ b/jdk/make/Tools.gmk	Fri Apr 17 13:55:42 2015 +0200
@@ -163,9 +163,7 @@
 ifeq ($(OPENJDK_TARGET_OS), solaris)
   $(eval $(call SetupNativeCompilation,ADD_GNU_DEBUGLINK, \
       SRC := $(JDK_TOPDIR)/make/src/native/add_gnu_debuglink, \
-      LANG := C, \
-      CC := $(BUILD_CC), \
-      LDEXE := $(BUILD_LD), \
+      TOOLCHAIN := TOOLCHAIN_BUILD, \
       LDFLAGS := -lelf, \
       OBJECT_DIR := $(BUILDTOOLS_OUTPUTDIR)/objs/add_gnu_debuglink, \
       OUTPUT_DIR := $(BUILDTOOLS_OUTPUTDIR)/bin, \
@@ -173,9 +171,7 @@
 
   $(eval $(call SetupNativeCompilation,FIX_EMPTY_SEC_HDR_FLAGS, \
       SRC := $(JDK_TOPDIR)/make/src/native/fix_empty_sec_hdr_flags, \
-      LANG := C, \
-      CC := $(BUILD_CC), \
-      LDEXE := $(BUILD_LD), \
+      TOOLCHAIN := TOOLCHAIN_BUILD, \
       LDFLAGS := -lelf, \
       OBJECT_DIR := $(BUILDTOOLS_OUTPUTDIR)/objs/fix_empty_sec_hdr_flags, \
       OUTPUT_DIR := $(BUILDTOOLS_OUTPUTDIR)/bin, \
--- a/jdk/make/gensrc/GensrcMisc.gmk	Fri Apr 17 16:50:16 2015 +0900
+++ b/jdk/make/gensrc/GensrcMisc.gmk	Fri Apr 17 13:55:42 2015 +0200
@@ -63,9 +63,7 @@
 $(eval $(call SetupNativeCompilation,BUILD_GENSRC_SOR_EXE, \
     SRC := $(GENSRC_SOR_SRC), \
     INCLUDE_FILES := $(GENSRC_SOR_SRC_FILE), \
-    LANG := C, \
-    CC := $(BUILD_CC), \
-    LDEXE := $(BUILD_LD), \
+    TOOLCHAIN := TOOLCHAIN_BUILD, \
     OBJECT_DIR := $(GENSRC_SOR_BIN), \
     OUTPUT_DIR := $(GENSRC_SOR_BIN), \
     PROGRAM := genSocketOptionRegistry))
@@ -101,9 +99,7 @@
   $(eval $(call SetupNativeCompilation,BUILD_GENSRC_UC_EXE, \
       SRC := $(GENSRC_UC_SRC), \
       INCLUDE_FILES := $(GENSRC_UC_SRC_FILE), \
-      LANG := C, \
-      CC := $(BUILD_CC), \
-      LDEXE := $(BUILD_CC), \
+      TOOLCHAIN := TOOLCHAIN_BUILD, \
       CFLAGS := $(filter -D%, $(CFLAGS_JDKEXE)), \
       OBJECT_DIR := $(GENSRC_UC_BIN), \
       OUTPUT_DIR := $(GENSRC_UC_BIN), \
@@ -142,9 +138,7 @@
   $(eval $(call SetupNativeCompilation,BUILD_GENSRC_SOL_EXE, \
       SRC := $(GENSRC_SOL_SRC), \
       INCLUDE_FILES := $(GENSRC_SOL_SRC_FILE), \
-      LANG := C, \
-      CC := $(BUILD_CC), \
-      LDEXE := $(BUILD_CC), \
+      TOOLCHAIN := TOOLCHAIN_BUILD, \
       OBJECT_DIR := $(GENSRC_SOL_BIN), \
       OUTPUT_DIR := $(GENSRC_SOL_BIN), \
       PROGRAM := genSolarisConstants))
--- a/jdk/make/launcher/Launcher-java.base.gmk	Fri Apr 17 16:50:16 2015 +0900
+++ b/jdk/make/launcher/Launcher-java.base.gmk	Fri Apr 17 13:55:42 2015 +0200
@@ -103,7 +103,6 @@
   $(eval $(call SetupNativeCompilation,BUILD_JEXEC, \
       SRC := $(BUILD_JEXEC_SRC), \
       INCLUDE_FILES := jexec.c, \
-      LANG := C, \
       OPTIMIZATION := LOW, \
       CFLAGS := $(CFLAGS_JDKEXE) \
           $(BUILD_JEXEC_INC), \
@@ -144,7 +143,6 @@
   $(eval $(call SetupNativeCompilation,BUILD_JSPAWNHELPER, \
       SRC := $(BUILD_JSPAWNHELPER_SRC), \
       INCLUDE_FILES := jspawnhelper.c, \
-      LANG := C, \
       OPTIMIZATION := LOW, \
       CFLAGS := $(CFLAGS_JDKEXE) $(JSPAWNHELPER_CFLAGS), \
       LDFLAGS := $(LDFLAGS_JDKEXE) $(LINK_JSPAWNHELPER_FLAGS), \
--- a/jdk/make/launcher/Launcher-jdk.accessibility.gmk	Fri Apr 17 16:50:16 2015 +0900
+++ b/jdk/make/launcher/Launcher-jdk.accessibility.gmk	Fri Apr 17 13:55:42 2015 +0200
@@ -36,7 +36,6 @@
   $(eval $(call SetupNativeCompilation,BUILD_JABSWITCH, \
       SRC := $(JABSWITCH_SRC), \
       INCLUDE_FILES := jabswitch.cpp, \
-      LANG := C++, \
       CFLAGS := $(filter-out -Zc:wchar_t-, $(CFLAGS_JDKEXE)) -Zc:wchar_t \
           -analyze- -Od -Gd -D_WINDOWS \
           -D_UNICODE -DUNICODE -RTC1 -EHsc, \
--- a/jdk/make/launcher/Launcher-jdk.pack200.gmk	Fri Apr 17 16:50:16 2015 +0900
+++ b/jdk/make/launcher/Launcher-jdk.pack200.gmk	Fri Apr 17 13:55:42 2015 +0200
@@ -56,9 +56,8 @@
 
 endif
 
-UNPACKEXE_LANG := C
 ifeq ($(OPENJDK_TARGET_OS), solaris)
-  UNPACKEXE_LANG := C++
+  UNPACKEXE_TOOLCHAIN := TOOLCHAIN_LINK_CXX
 endif
 
 UNPACK_MAPFILE_DIR := $(JDK_TOPDIR)/make/mapfiles/libunpack
@@ -78,7 +77,7 @@
 
 $(eval $(call SetupNativeCompilation,BUILD_UNPACKEXE, \
     SRC := $(UNPACKEXE_SRC), \
-    LANG := $(UNPACKEXE_LANG), \
+    TOOLCHAIN := $(UNPACKEXE_TOOLCHAIN), \
     OPTIMIZATION := LOW, \
     CFLAGS := $(UNPACKEXE_CFLAGS) $(CXXFLAGS_JDKEXE) -DFULL, \
     CFLAGS_release := -DPRODUCT, \
--- a/jdk/make/launcher/LauncherCommon.gmk	Fri Apr 17 16:50:16 2015 +0900
+++ b/jdk/make/launcher/LauncherCommon.gmk	Fri Apr 17 13:55:42 2015 +0200
@@ -161,7 +161,6 @@
   $(call SetupNativeCompilation,BUILD_LAUNCHER_$1, \
       SRC := $(LAUNCHER_SRC), \
       INCLUDE_FILES := main.c, \
-      LANG := C, \
       OPTIMIZATION := $$($1_OPTIMIZATION_ARG), \
       CFLAGS := $$($1_CFLAGS) \
           $(LAUNCHER_CFLAGS) \
--- a/jdk/make/lib/Awt2dLibraries.gmk	Fri Apr 17 16:50:16 2015 +0900
+++ b/jdk/make/lib/Awt2dLibraries.gmk	Fri Apr 17 13:55:42 2015 +0200
@@ -51,7 +51,6 @@
     OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
     SRC := $(BUILD_LIBMLIB_SRC), \
     EXCLUDE_FILES := mlib_c_ImageBlendTable.c, \
-    LANG := C, \
     OPTIMIZATION := HIGHEST, \
     CFLAGS := $(CFLAGS_JDKLIB) \
         $(BUILD_LIBMLIB_CFLAGS), \
@@ -124,7 +123,6 @@
       LIBRARY := mlib_image_v, \
       OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
       SRC := $(LIBMLIB_IMAGE_V_SRC), \
-      LANG := C, \
       EXCLUDE_FILES := $(BUILD_LIBMLIB_IMAGE_V_EXFILES), \
       OPTIMIZATION := HIGHEST, \
       CFLAGS := -xarch=sparcvis \
@@ -204,8 +202,6 @@
   LIBAWT_CFLAGS += -DMLIB_NO_LIBSUNMATH
 endif
 
-LIBAWT_LANG := C
-
 ifeq ($(OPENJDK_TARGET_OS), windows)
   LIBAWT_DIRS += $(JDK_TOPDIR)/src/java.desktop/share/native/common/font \
       $(JDK_TOPDIR)/src/java.desktop/share/native/common/java2d/opengl \
@@ -222,7 +218,6 @@
       awt/image/cvutils/img_colors.c \
       #
 
-  LIBAWT_LANG := C++
   LIBAWT_CFLAGS += -EHsc -DUNICODE -D_UNICODE
   ifeq ($(OPENJDK_TARGET_CPU_BITS), 64)
     LIBAWT_CFLAGS += -DMLIB_OS64BIT
@@ -247,7 +242,6 @@
     SRC := $(LIBAWT_DIRS), \
     EXCLUDES := $(LIBAWT_EXCLUDES), \
     EXCLUDE_FILES := $(LIBAWT_EXFILES), \
-    LANG := $(LIBAWT_LANG), \
     OPTIMIZATION := LOW, \
     CFLAGS := $(CFLAGS_JDKLIB) $(LIBAWT_CFLAGS), \
     DISABLED_WARNINGS_gcc := sign-compare unused-result maybe-uninitialized \
@@ -355,7 +349,6 @@
         OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
         SRC := $(LIBAWT_XAWT_DIRS), \
         EXCLUDES := $(LIBAWT_XAWT_EXCLUDES), \
-        LANG := C, \
         OPTIMIZATION := LOW, \
         CFLAGS := $(CFLAGS_JDKLIB) $(LIBAWT_XAWT_CFLAGS) \
             $(X_CFLAGS), \
@@ -413,7 +406,6 @@
     OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
     SRC := $(LIBLCMS_SRC), \
     INCLUDE_FILES := $(BUILD_LIBLCMS_INCLUDE_FILES), \
-    LANG := C, \
     OPTIMIZATION := HIGHEST, \
     CFLAGS := $(filter-out -xc99=%none, $(CFLAGS_JDKLIB)) \
         $(SHARED_LIBRARY_FLAGS) $(LIBLCMS_CPPFLAGS) \
@@ -496,7 +488,6 @@
     OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
     SRC := $(LIBJAVAJPEG_SRC), \
     INCLUDE_FILES := $(BUILD_LIBJAVAJPEG_INCLUDE_FILES), \
-    LANG := C, \
     OPTIMIZATION := HIGHEST, \
     CFLAGS := $(CFLAGS_JDKLIB) $(addprefix -I, $(LIBJAVAJPEG_SRC)) \
         $(LIBJAVA_HEADER_FLAGS) \
@@ -564,7 +555,6 @@
         OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
         SRC := $(LIBAWT_HEADLESS_DIRS), \
         EXCLUDES := $(LIBAWT_HEADLESS_EXCLUDES), \
-        LANG := C, \
         OPTIMIZATION := LOW, \
         CFLAGS := $(CFLAGS_JDKLIB) \
             -DHEADLESS=true \
@@ -651,7 +641,7 @@
     SRC := $(LIBFONTMANAGER_SRC), \
     EXCLUDE_FILES := $(LIBFONTMANAGER_EXCLUDE_FILES) \
         AccelGlyphCache.c, \
-    LANG := C++, \
+    TOOLCHAIN := TOOLCHAIN_LINK_CXX, \
     CFLAGS := $(CFLAGS_JDKLIB) $(LIBFONTMANAGER_CFLAGS), \
     CXXFLAGS := $(CXXFLAGS_JDKLIB) $(LIBFONTMANAGER_CFLAGS), \
     OPTIMIZATION := $(LIBFONTMANAGER_OPTIMIZATION), \
@@ -712,7 +702,6 @@
       OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
       SRC := $(LIBJAWT_SRC), \
       INCLUDE_FILES := $(LIBJAWT_INCLUDE_FILES), \
-      LANG := C++, \
       OPTIMIZATION := LOW, \
       CFLAGS := $(CXXFLAGS_JDKLIB) \
           -EHsc -DUNICODE -D_UNICODE \
@@ -771,7 +760,6 @@
       OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
       SRC := $(LIBJAWT_SRC), \
       INCLUDE_FILES := $(JAWT_FILES), \
-      LANG := C, \
       OPTIMIZATION := LOW, \
       CFLAGS := $(CFLAGS_JDKLIB) \
           $(LIBJAWT_CFLAGS), \
@@ -889,7 +877,6 @@
       SRC := $(LIBSPLASHSCREEN_DIRS), \
       EXCLUDE_FILES := imageioJPEG.c jpegdecoder.c pngtest.c, \
       EXCLUDES := $(LIBSPLASHSCREEN_EXCLUDES), \
-      LANG := C, \
       OPTIMIZATION := LOW, \
       CFLAGS := $(LIBSPLASHSCREEN_CFLAGS) $(CFLAGS_JDKLIB) \
                 $(GIFLIB_CFLAGS) $(LIBJPEG_CFLAGS) $(PNG_CFLAGS), \
@@ -958,7 +945,6 @@
       LIBRARY := awt_lwawt, \
       OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
       SRC := $(LIBAWT_LWAWT_DIRS), \
-      LANG := C, \
       INCLUDE_FILES := $(LIBAWT_LWAWT_FILES), \
       EXCLUDE_FILES := $(LIBAWT_LWAWT_EXFILES), \
       EXCLUDES := $(LIBAWT_LWAWT_EXCLUDES), \
@@ -1008,7 +994,6 @@
       LIBRARY := osxui, \
       OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
       SRC := $(JDK_TOPDIR)/src/java.desktop/macosx/native/libosxui, \
-      LANG := C, \
       OPTIMIZATION := LOW, \
       CFLAGS := $(CFLAGS_JDKLIB) \
           -I$(JDK_TOPDIR)/src/java.desktop/macosx/native/libosxui \
--- a/jdk/make/lib/CoreLibraries.gmk	Fri Apr 17 16:50:16 2015 +0900
+++ b/jdk/make/lib/CoreLibraries.gmk	Fri Apr 17 13:55:42 2015 +0200
@@ -43,7 +43,6 @@
       STATIC_LIBRARY := fdlibm, \
       OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE), \
       SRC := $(LIBFDLIBM_SRC), \
-      LANG := C, \
       OPTIMIZATION := $(BUILD_LIBFDLIBM_OPTIMIZATION), \
       CFLAGS := $(CFLAGS_JDKLIB) $(LIBFDLIBM_CFLAGS), \
       CFLAGS_windows_debug := -DLOGGING, \
@@ -62,7 +61,6 @@
       LIBRARY := fdlibm, \
       OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libfdlibm, \
       SRC := $(LIBFDLIBM_SRC), \
-      LANG := C, \
       CFLAGS := $(CFLAGS_JDKLIB) $(LIBFDLIBM_CFLAGS), \
       LDFLAGS := -nostdlib -r -arch x86_64, \
       OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libfdlibm, \
@@ -93,7 +91,6 @@
     LIBRARY := verify, \
     OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
     SRC := $(JDK_TOPDIR)/src/java.base/share/native/libverify, \
-    LANG := C, \
     OPTIMIZATION := $(LIBVERIFY_OPTIMIZATION), \
     CFLAGS := $(CFLAGS_JDKLIB), \
     DISABLED_WARNINGS_microsoft := 4244 4267, \
@@ -146,7 +143,6 @@
     LIBRARY := java, \
     OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
     SRC := $(LIBJAVA_SRC_DIRS), \
-    LANG := C, \
     OPTIMIZATION := HIGH, \
     CFLAGS := $(CFLAGS_JDKLIB) \
         $(LIBJAVA_CFLAGS), \
@@ -206,7 +202,6 @@
 $(eval $(call SetupNativeCompilation,BUILD_LIBZIP, \
     LIBRARY := zip, \
     OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
-    LANG := C, \
     OPTIMIZATION := LOW, \
     SRC := $(JDK_TOPDIR)/src/java.base/share/native/libzip, \
     EXCLUDES := $(LIBZIP_EXCLUDES), \
@@ -314,7 +309,6 @@
     SRC := $(LIBJLI_SRC_DIRS), \
     EXCLUDE_FILES := $(LIBJLI_EXCLUDE_FILES), \
     EXTRA_FILES := $(LIBJLI_EXTRA_FILES), \
-    LANG := C, \
     OPTIMIZATION := HIGH, \
     CFLAGS := $(LIBJLI_CFLAGS), \
     DISABLED_WARNINGS_solstudio := E_ASM_DISABLES_OPTIMIZATION, \
@@ -363,7 +357,6 @@
       SRC := $(LIBJLI_SRC_DIRS), \
       EXCLUDE_FILES := $(LIBJLI_EXCLUDE_FILES), \
       EXTRA_FILES := $(LIBJLI_EXTRA_FILES), \
-      LANG := C, \
       OPTIMIZATION := HIGH, \
       CFLAGS := $(STATIC_LIBRARY_FLAGS) $(LIBJLI_CFLAGS), \
       ARFLAGS := $(ARFLAGS), \
@@ -383,7 +376,6 @@
       SRC := $(LIBJLI_SRC_DIRS), \
       EXCLUDE_FILES := $(LIBJLI_EXCLUDE_FILES), \
       EXTRA_FILES := $(LIBJLI_EXTRA_FILES), \
-      LANG := C, \
       OPTIMIZATION := HIGH, \
       CFLAGS := $(CFLAGS_JDKLIB) $(LIBJLI_CFLAGS), \
       LDFLAGS := -nostdlib -r, \
@@ -403,7 +395,6 @@
       SRC := $(LIBJLI_SRC_DIRS), \
       EXCLUDE_FILES := $(LIBJLI_EXCLUDE_FILES), \
       EXTRA_FILES := $(LIBJLI_EXTRA_FILES), \
-      LANG := C, \
       OPTIMIZATION := HIGH, \
       CFLAGS := $(STATIC_LIBRARY_FLAGS) $(LIBJLI_CFLAGS), \
       ARFLAGS := $(ARFLAGS), \
--- a/jdk/make/lib/Lib-java.instrument.gmk	Fri Apr 17 16:50:16 2015 +0900
+++ b/jdk/make/lib/Lib-java.instrument.gmk	Fri Apr 17 13:55:42 2015 +0200
@@ -57,7 +57,6 @@
     LIBRARY := instrument, \
     OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
     SRC := $(LIBINSTRUMENT_SRC), \
-    LANG := C, \
     OPTIMIZATION := LOW, \
     CFLAGS := $(LIBINSTRUMENT_CFLAGS) $(CFLAGS_WARNINGS_ARE_ERRORS), \
     CFLAGS_debug := -DJPLIS_LOGGING, \
--- a/jdk/make/lib/Lib-java.management.gmk	Fri Apr 17 16:50:16 2015 +0900
+++ b/jdk/make/lib/Lib-java.management.gmk	Fri Apr 17 13:55:42 2015 +0200
@@ -72,7 +72,6 @@
     OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
     SRC := $(BUILD_LIBMANAGEMENT_SRC), \
     EXCLUDE_FILES := $(BUILD_LIBMANAGEMENT_EXCLUDES), \
-    LANG := C, \
     OPTIMIZATION := $(LIBMANAGEMENT_OPTIMIZATION), \
     CFLAGS := $(CFLAGS_JDKLIB) $(CFLAGS_WARNINGS_ARE_ERRORS) $(BUILD_LIBMANAGEMENT_CFLAGS), \
     MAPFILE := $(LIBMANAGEMENT_MAPFILE), \
--- a/jdk/make/lib/Lib-java.prefs.gmk	Fri Apr 17 16:50:16 2015 +0900
+++ b/jdk/make/lib/Lib-java.prefs.gmk	Fri Apr 17 13:55:42 2015 +0200
@@ -37,7 +37,6 @@
     LIBRARY := prefs, \
     OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
     SRC := $(LIBPREF_SRC_DIRS), \
-    LANG := C, \
     OPTIMIZATION := HIGH, \
     CFLAGS := $(CFLAGS_JDKLIB) $(addprefix -I, $(LIBPREF_SRC_DIRS)) \
         $(LIBJAVA_HEADER_FLAGS), \
--- a/jdk/make/lib/Lib-java.security.jgss.gmk	Fri Apr 17 16:50:16 2015 +0900
+++ b/jdk/make/lib/Lib-java.security.jgss.gmk	Fri Apr 17 13:55:42 2015 +0200
@@ -36,7 +36,6 @@
       LIBRARY := j2gss, \
       OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
       SRC := $(LIBJ2GSS_SRC), \
-      LANG := C, \
       OPTIMIZATION := LOW, \
       CFLAGS := $(CFLAGS_JDKLIB) $(addprefix -I, $(LIBJ2GSS_SRC)) \
           $(LIBJAVA_HEADER_FLAGS) \
@@ -79,7 +78,6 @@
         LIBRARY := $(BUILD_LIBKRB5_NAME), \
         OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
         SRC := $(BUILD_LIBKRB5_SRC), \
-        LANG := C, \
         OPTIMIZATION := LOW, \
         CFLAGS := $(CFLAGS_JDKLIB) \
             $(addprefix -I, $(BUILD_LIBKRB5_SRC)) \
--- a/jdk/make/lib/Lib-java.smartcardio.gmk	Fri Apr 17 16:50:16 2015 +0900
+++ b/jdk/make/lib/Lib-java.smartcardio.gmk	Fri Apr 17 13:55:42 2015 +0200
@@ -37,7 +37,6 @@
     LIBRARY := j2pcsc, \
     OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
     SRC := $(LIBJ2PCSC_SRC), \
-    LANG := C, \
     CFLAGS_unix := -D__sun_jdk, \
     OPTIMIZATION := LOW, \
     CFLAGS := $(CFLAGS_JDKLIB) $(LIBJ2PCSC_CPPFLAGS), \
--- a/jdk/make/lib/Lib-jdk.accessibility.gmk	Fri Apr 17 16:50:16 2015 +0900
+++ b/jdk/make/lib/Lib-jdk.accessibility.gmk	Fri Apr 17 13:55:42 2015 +0200
@@ -45,7 +45,6 @@
         LIBRARY = javaaccessbridge$1, \
         OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
         SRC := $(JAVA_AB_SRCDIR), \
-        LANG := C++, \
         OPTIMIZATION := LOW, \
         CFLAGS := $(CFLAGS_JDKLIB) $(ACCESSBRIDGE_CFLAGS) \
             $(addprefix -I,$(JAVA_AB_SRCDIR)) \
@@ -76,7 +75,6 @@
         LIBRARY = windowsaccessbridge$1, \
         OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
         SRC := $(WIN_AB_SRCDIR), \
-        LANG := C++, \
         OPTIMIZATION := LOW, \
         CFLAGS := $(filter-out -MD, $(CFLAGS_JDKLIB)) -MT $(ACCESSBRIDGE_CFLAGS) \
             $(addprefix -I,$(WIN_AB_SRCDIR)) \
@@ -105,7 +103,6 @@
         LIBRARY = jabsysinfo, \
         OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
         SRC := $(SYSINFO_SRCDIR), \
-        LANG := C++, \
         OPTIMIZATION := LOW, \
         CFLAGS := $(CFLAGS_JDKLIB) $(ACCESSBRIDGE_CFLAGS), \
         LDFLAGS := $(LDFLAGS_JDKLIB) \
--- a/jdk/make/lib/Lib-jdk.attach.gmk	Fri Apr 17 16:50:16 2015 +0900
+++ b/jdk/make/lib/Lib-jdk.attach.gmk	Fri Apr 17 13:55:42 2015 +0200
@@ -32,7 +32,6 @@
     LIBRARY := attach, \
     OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
     SRC := $(call FindSrcDirsForLib, jdk.attach, attach), \
-    LANG := C, \
     OPTIMIZATION := LOW, \
     CFLAGS := $(CFLAGS_JDKLIB) $(CFLAGS_WARNINGS_ARE_ERRORS) \
         -I$(SUPPORT_OUTPUTDIR)/headers/jdk.attach \
--- a/jdk/make/lib/Lib-jdk.crypto.ec.gmk	Fri Apr 17 16:50:16 2015 +0900
+++ b/jdk/make/lib/Lib-jdk.crypto.ec.gmk	Fri Apr 17 13:55:42 2015 +0200
@@ -47,7 +47,7 @@
       LIBRARY := sunec, \
       OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
       SRC := $(LIBSUNEC_SRC), \
-      LANG := C++, \
+      TOOLCHAIN := TOOLCHAIN_LINK_CXX, \
       OPTIMIZATION := LOW, \
       CFLAGS := $(filter-out $(ECC_JNI_SOLSPARC_FILTER), $(CFLAGS_JDKLIB)) \
           $(BUILD_LIBSUNEC_FLAGS) \
--- a/jdk/make/lib/Lib-jdk.crypto.mscapi.gmk	Fri Apr 17 16:50:16 2015 +0900
+++ b/jdk/make/lib/Lib-jdk.crypto.mscapi.gmk	Fri Apr 17 13:55:42 2015 +0200
@@ -35,7 +35,6 @@
       LIBRARY := sunmscapi, \
       OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
       SRC := $(LIBSUNMSCAPI_SRC), \
-      LANG := C++, \
       OPTIMIZATION := LOW, \
       CFLAGS := $(CFLAGS_JDKLIB) \
           -I$(LIBSUNMSCAPI_SRC), \
--- a/jdk/make/lib/Lib-jdk.crypto.pkcs11.gmk	Fri Apr 17 16:50:16 2015 +0900
+++ b/jdk/make/lib/Lib-jdk.crypto.pkcs11.gmk	Fri Apr 17 13:55:42 2015 +0200
@@ -34,7 +34,6 @@
     LIBRARY := j2pkcs11, \
     OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
     SRC := $(LIBJ2PKCS11_SRC), \
-    LANG := C, \
     OPTIMIZATION := LOW, \
     CFLAGS := $(CFLAGS_JDKLIB) $(addprefix -I, $(LIBJ2PKCS11_SRC)) \
         $(LIBJAVA_HEADER_FLAGS) \
--- a/jdk/make/lib/Lib-jdk.crypto.ucrypto.gmk	Fri Apr 17 16:50:16 2015 +0900
+++ b/jdk/make/lib/Lib-jdk.crypto.ucrypto.gmk	Fri Apr 17 13:55:42 2015 +0200
@@ -35,7 +35,6 @@
       LIBRARY := j2ucrypto, \
       OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
       SRC := $(LIBJ2UCRYPTO_SRC), \
-      LANG := C, \
       OPTIMIZATION := LOW, \
       CFLAGS := $(CFLAGS_JDKLIB) \
           $(addprefix -I, $(LIBJ2UCRYPTO_SRC)), \
--- a/jdk/make/lib/Lib-jdk.deploy.osx.gmk	Fri Apr 17 16:50:16 2015 +0900
+++ b/jdk/make/lib/Lib-jdk.deploy.osx.gmk	Fri Apr 17 13:55:42 2015 +0200
@@ -35,7 +35,6 @@
       LIBRARY := AppleScriptEngine, \
       OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
       SRC := $(LIBAPPLESCRIPTENGINE_SRC), \
-      LANG := C, \
       OPTIMIZATION := LOW, \
       CFLAGS := $(CFLAGS_JDKLIB) \
           -I$(LIBAPPLESCRIPTENGINE_SRC) \
@@ -68,7 +67,6 @@
       LIBRARY := osx, \
       OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
       SRC := $(LIBOSX_DIRS), \
-      LANG := C, \
       OPTIMIZATION := LOW, \
       CFLAGS := $(CFLAGS_JDKLIB) \
           $(LIBOSX_CFLAGS), \
--- a/jdk/make/lib/Lib-jdk.hprof.agent.gmk	Fri Apr 17 16:50:16 2015 +0900
+++ b/jdk/make/lib/Lib-jdk.hprof.agent.gmk	Fri Apr 17 13:55:42 2015 +0200
@@ -45,7 +45,6 @@
     LIBRARY := hprof, \
     OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
     SRC := $(BUILD_LIBHPROF_SRC), \
-    LANG := C, \
     OPTIMIZATION := $(LIBHPROF_OPTIMIZATION), \
     CFLAGS := $(CFLAGS_JDKLIB) $(CFLAGS_WARNINGS_ARE_ERRORS) \
         $(BUILD_LIBHPROF_CFLAGS), \
@@ -75,7 +74,6 @@
     LIBRARY := java_crw_demo, \
     OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
     SRC := $(LIBJAVA_CRW_DEMO_SRC), \
-    LANG := C, \
     OPTIMIZATION := LOW, \
     CFLAGS := $(CFLAGS_JDKLIB) $(CFLAGS_WARNINGS_ARE_ERRORS) \
         $(addprefix -I, $(LIBJAVA_CRW_DEMO_SRC)), \
--- a/jdk/make/lib/Lib-jdk.jdi.gmk	Fri Apr 17 16:50:16 2015 +0900
+++ b/jdk/make/lib/Lib-jdk.jdi.gmk	Fri Apr 17 13:55:42 2015 +0200
@@ -43,7 +43,6 @@
       LIBRARY := dt_shmem, \
       OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
       SRC := $(LIBDT_SHMEM_SRC), \
-      LANG := C, \
       OPTIMIZATION := LOW, \
       CFLAGS := $(CFLAGS_JDKLIB) $(CFLAGS_WARNINGS_ARE_ERRORS) -DUSE_MMAP \
           $(LIBDT_SHMEM_CPPFLAGS), \
--- a/jdk/make/lib/Lib-jdk.jdwp.agent.gmk	Fri Apr 17 16:50:16 2015 +0900
+++ b/jdk/make/lib/Lib-jdk.jdwp.agent.gmk	Fri Apr 17 13:55:42 2015 +0200
@@ -40,7 +40,6 @@
     LIBRARY := dt_socket, \
     OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
     SRC := $(LIBDT_SOCKET_SRC), \
-    LANG := C, \
     OPTIMIZATION := LOW, \
     CFLAGS := $(CFLAGS_JDKLIB) $(CFLAGS_CFLAGS_WARNINGS_ARE_ERRORS) -DUSE_MMAP \
         $(LIBDT_SOCKET_CPPFLAGS), \
@@ -77,7 +76,6 @@
     LIBRARY := jdwp, \
     OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
     SRC := $(LIBJDWP_SRC), \
-    LANG := C, \
     OPTIMIZATION := LOW, \
     CFLAGS := $(CFLAGS_JDKLIB) $(CFLAGS_WARNINGS_ARE_ERRORS) -DJDWP_LOGGING \
         $(LIBJDWP_CPPFLAGS) \
--- a/jdk/make/lib/Lib-jdk.pack200.gmk	Fri Apr 17 16:50:16 2015 +0900
+++ b/jdk/make/lib/Lib-jdk.pack200.gmk	Fri Apr 17 13:55:42 2015 +0200
@@ -32,7 +32,7 @@
     OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
     SRC := $(JDK_TOPDIR)/src/jdk.pack200/share/native/libunpack \
         $(JDK_TOPDIR)/src/jdk.pack200/share/native/common-unpack, \
-    LANG := C++, \
+    TOOLCHAIN := TOOLCHAIN_LINK_CXX, \
     OPTIMIZATION := LOW, \
     CFLAGS := $(CXXFLAGS_JDKLIB) \
         -DNO_ZLIB -DUNPACK_JNI -DFULL \
--- a/jdk/make/lib/Lib-jdk.sctp.gmk	Fri Apr 17 16:50:16 2015 +0900
+++ b/jdk/make/lib/Lib-jdk.sctp.gmk	Fri Apr 17 13:55:42 2015 +0200
@@ -41,7 +41,6 @@
         LIBRARY := sctp, \
         OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
         SRC := $(JDK_TOPDIR)/src/jdk.sctp/$(OPENJDK_TARGET_OS_TYPE)/native/libsctp, \
-        LANG := C, \
         OPTIMIZATION := LOW, \
         CFLAGS := $(CFLAGS_JDKLIB) \
             -I $(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/libnio/ch \
--- a/jdk/make/lib/Lib-jdk.security.auth.gmk	Fri Apr 17 16:50:16 2015 +0900
+++ b/jdk/make/lib/Lib-jdk.security.auth.gmk	Fri Apr 17 13:55:42 2015 +0200
@@ -42,7 +42,6 @@
     LIBRARY := $(LIBJAAS_NAME), \
     OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
     SRC := $(call FindSrcDirsForLib, jdk.security.auth, jaas), \
-    LANG := C, \
     OPTIMIZATION := LOW, \
     CFLAGS := $(CFLAGS_JDKLIB) -I$(SUPPORT_OUTPUTDIR)/headers/jdk.security.auth, \
     MAPFILE := $(LIBJAAS_MAPFILE), \
--- a/jdk/make/lib/NetworkingLibraries.gmk	Fri Apr 17 16:50:16 2015 +0900
+++ b/jdk/make/lib/NetworkingLibraries.gmk	Fri Apr 17 13:55:42 2015 +0200
@@ -29,7 +29,6 @@
     LIBRARY := net, \
     OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
     SRC := $(LIBNET_SRC_DIRS), \
-    LANG := C, \
     OPTIMIZATION := LOW, \
     CFLAGS := $(CFLAGS_JDKLIB) -I$(SUPPORT_OUTPUTDIR)/headers/java.base \
         $(LIBJAVA_HEADER_FLAGS) $(addprefix -I, $(LIBNET_SRC_DIRS)), \
--- a/jdk/make/lib/NioLibraries.gmk	Fri Apr 17 16:50:16 2015 +0900
+++ b/jdk/make/lib/NioLibraries.gmk	Fri Apr 17 13:55:42 2015 +0200
@@ -65,7 +65,6 @@
     OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
     SRC := $(BUILD_LIBNIO_SRC), \
     EXCLUDE_FILES := $(BUILD_LIBNIO_EXFILES), \
-    LANG := C, \
     OPTIMIZATION := HIGH, \
     CFLAGS := $(CFLAGS_JDKLIB) \
         $(BUILD_LIBNIO_CFLAGS), \
--- a/jdk/make/lib/PlatformLibraries.gmk	Fri Apr 17 16:50:16 2015 +0900
+++ b/jdk/make/lib/PlatformLibraries.gmk	Fri Apr 17 13:55:42 2015 +0200
@@ -33,7 +33,6 @@
       LIBRARY := osxapp, \
       OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
       SRC := $(LIBOSXAPP_SRC), \
-      LANG := C, \
       OPTIMIZATION := LOW, \
       CFLAGS := $(CFLAGS_JDKLIB) \
           $(addprefix -I, $(LIBOSXAPP_SRC)) \
--- a/jdk/make/lib/SoundLibraries.gmk	Fri Apr 17 16:50:16 2015 +0900
+++ b/jdk/make/lib/SoundLibraries.gmk	Fri Apr 17 13:55:42 2015 +0200
@@ -35,8 +35,6 @@
 
 LIBJSOUND_SRC_FILES := Utilities.c Platform.c
 
-LIBJSOUND_LANG := C
-
 EXTRA_SOUND_JNI_LIBS :=
 
 LIBJSOUND_MIDIFILES := \
@@ -81,7 +79,7 @@
 endif # OPENJDK_TARGET_OS aix
 
 ifeq ($(OPENJDK_TARGET_OS), macosx)
-  LIBJSOUND_LANG := C++
+  LIBJSOUND_TOOLCHAIN := TOOLCHAIN_LINK_CXX
   LIBJSOUND_CFLAGS += -DX_PLATFORM=X_MACOSX \
       -DUSE_PORTS=TRUE \
       -DUSE_DAUDIO=TRUE \
@@ -124,7 +122,7 @@
     OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
     SRC := $(LIBJSOUND_SRC_DIRS), \
     INCLUDE_FILES := $(LIBJSOUND_SRC_FILES), \
-    LANG := $(LIBJSOUND_LANG), \
+    TOOLCHAIN := $(LIBJSOUND_TOOLCHAIN), \
     OPTIMIZATION := LOW, \
     CFLAGS := $(CFLAGS_JDKLIB) \
         $(LIBJSOUND_CFLAGS), \
@@ -169,7 +167,6 @@
           PLATFORM_API_LinuxOS_ALSA_MidiOut.c \
           PLATFORM_API_LinuxOS_ALSA_MidiUtils.c \
           PLATFORM_API_LinuxOS_ALSA_Ports.c, \
-      LANG := C, \
       OPTIMIZATION := LOW, \
       CFLAGS := $(CFLAGS_JDKLIB) $(ALSA_CFLAGS) \
           $(LIBJSOUND_CFLAGS) \
@@ -201,7 +198,6 @@
       SRC := $(LIBJSOUND_SRC_DIRS), \
       INCLUDE_FILES := Utilities.c $(LIBJSOUND_DAUDIOFILES) \
           PLATFORM_API_WinOS_DirectSound.cpp, \
-      LANG := C++, \
       OPTIMIZATION := LOW, \
       CFLAGS := $(CFLAGS_JDKLIB) \
           $(LIBJSOUND_CFLAGS) \