From f79801b74db6d31726937372989ce35ca0ac8bde Mon Sep 17 00:00:00 2001 From: Bob Vandette Date: Fri, 29 May 2020 19:18:23 +0000 Subject: [PATCH] 8245832: JDK build make-static-libs should build all JDK libraries Reviewed-by: erikj --- make/Main.gmk | 6 +++++- make/StaticLibsImage.gmk | 4 +++- make/common/Modules.gmk | 15 --------------- src/java.desktop/macosx/native/libjawt/jawt.m | 2 +- src/java.desktop/unix/native/libjawt/jawt.c | 2 +- src/java.desktop/windows/native/libjawt/jawt.cpp | 2 +- 6 files changed, 11 insertions(+), 20 deletions(-) diff --git a/make/Main.gmk b/make/Main.gmk index 14ae6213653..99fc816edf3 100644 --- a/make/Main.gmk +++ b/make/Main.gmk @@ -217,7 +217,7 @@ $(eval $(call DeclareRecipesForPhase, STATIC_LIBS, \ TARGET_SUFFIX := static-libs, \ FILE_PREFIX := Lib, \ MAKE_SUBDIR := lib, \ - CHECK_MODULES := $(STATIC_LIBS_MODULES), \ + CHECK_MODULES := $(ALL_MODULES), \ EXTRA_ARGS := STATIC_LIBS=true, \ )) @@ -798,10 +798,14 @@ else # If not already set, set the JVM variant target so that the JVM will be built. JVM_MAIN_LIB_TARGETS ?= hotspot-$(JVM_VARIANT_MAIN)-libs + JVM_MAIN_GENSRC_TARGETS ?= hotspot-$(JVM_VARIANT_MAIN)-gensrc # Building one JVM variant is enough to start building the other libs $(LIBS_TARGETS): $(JVM_MAIN_LIB_TARGETS) + # Static libs depend on hotspot gensrc + $(STATIC_LIBS_TARGETS): $(JVM_MAIN_GENSRC_TARGETS) + $(LAUNCHER_TARGETS): java.base-libs ifeq ($(STATIC_BUILD), true) diff --git a/make/StaticLibsImage.gmk b/make/StaticLibsImage.gmk index 672e9a9ab66..21c4608f4dd 100644 --- a/make/StaticLibsImage.gmk +++ b/make/StaticLibsImage.gmk @@ -32,11 +32,13 @@ include $(SPEC) include MakeBase.gmk include Modules.gmk +ALL_MODULES = $(call FindAllModules) + ################################################################################ TARGETS := -$(foreach m, $(STATIC_LIBS_MODULES), \ +$(foreach m, $(ALL_MODULES), \ $(eval $(call SetupCopyFiles, COPY_STATIC_LIBS_$m, \ FLATTEN := true, \ SRC := $(SUPPORT_OUTPUTDIR)/native/$m, \ diff --git a/make/common/Modules.gmk b/make/common/Modules.gmk index 826dca3552f..9f6dff6cef9 100644 --- a/make/common/Modules.gmk +++ b/make/common/Modules.gmk @@ -193,21 +193,6 @@ HOTSPOT_MODULES := \ jdk.internal.vm.compiler.management \ # -# The native dynamic libraries in these modules will also get built into static -# libraries for consumption by downstream projects that need to statically link -# the JDK libraries. Those static libraries are not part of the main JDK -# distribution. -STATIC_LIBS_MODULES := \ - java.base \ - jdk.crypto.ec \ - jdk.security.auth \ - java.prefs \ - java.security.jgss \ - java.smartcardio \ - jdk.crypto.cryptoki \ - jdk.net \ - # - ################################################################################ # Some platforms don't have the serviceability agent diff --git a/src/java.desktop/macosx/native/libjawt/jawt.m b/src/java.desktop/macosx/native/libjawt/jawt.m index 773c6482caa..f5dc048a482 100644 --- a/src/java.desktop/macosx/native/libjawt/jawt.m +++ b/src/java.desktop/macosx/native/libjawt/jawt.m @@ -39,7 +39,7 @@ DEF_STATIC_JNI_OnLoad * Get the AWT native structure. * This function returns JNI_FALSE if an error occurs. */ -JNIEXPORT jboolean JNICALL JAWT_GetAWT +_JNI_IMPORT_OR_EXPORT_ jboolean JNICALL JAWT_GetAWT (JNIEnv* env, JAWT* awt) { if (awt == NULL) { diff --git a/src/java.desktop/unix/native/libjawt/jawt.c b/src/java.desktop/unix/native/libjawt/jawt.c index ee61138dd31..96d2b52e55d 100644 --- a/src/java.desktop/unix/native/libjawt/jawt.c +++ b/src/java.desktop/unix/native/libjawt/jawt.c @@ -37,7 +37,7 @@ DEF_STATIC_JNI_OnLoad * Get the AWT native structure. This function returns JNI_FALSE if * an error occurs. */ -JNIEXPORT jboolean JNICALL JAWT_GetAWT(JNIEnv* env, JAWT* awt) +_JNI_IMPORT_OR_EXPORT_ jboolean JNICALL JAWT_GetAWT(JNIEnv* env, JAWT* awt) { #if defined(HEADLESS) /* there are no AWT libs available at all */ diff --git a/src/java.desktop/windows/native/libjawt/jawt.cpp b/src/java.desktop/windows/native/libjawt/jawt.cpp index 1393dfcf8f6..93f34c50f7a 100644 --- a/src/java.desktop/windows/native/libjawt/jawt.cpp +++ b/src/java.desktop/windows/native/libjawt/jawt.cpp @@ -39,7 +39,7 @@ DEF_STATIC_JNI_OnLoad * Get the AWT native structure. This function returns JNI_FALSE if * an error occurs. */ -extern "C" JNIEXPORT jboolean JNICALL JAWT_GetAWT(JNIEnv* env, JAWT* awt) +extern "C" _JNI_IMPORT_OR_EXPORT_ jboolean JNICALL JAWT_GetAWT(JNIEnv* env, JAWT* awt) { if (awt == NULL) { return JNI_FALSE;