9e98118f28
Reviewed-by: erikj
237 lines
8.4 KiB
Plaintext
237 lines
8.4 KiB
Plaintext
#
|
|
# Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved.
|
|
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
#
|
|
# This code is free software; you can redistribute it and/or modify it
|
|
# under the terms of the GNU General Public License version 2 only, as
|
|
# published by the Free Software Foundation. Oracle designates this
|
|
# particular file as subject to the "Classpath" exception as provided
|
|
# by Oracle in the LICENSE file that accompanied this code.
|
|
#
|
|
# This code is distributed in the hope that it will be useful, but WITHOUT
|
|
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
# version 2 for more details (a copy is included in the LICENSE file that
|
|
# accompanied this code).
|
|
#
|
|
# You should have received a copy of the GNU General Public License version
|
|
# 2 along with this work; if not, write to the Free Software Foundation,
|
|
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
#
|
|
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
|
# or visit www.oracle.com if you need additional information or have any
|
|
# questions.
|
|
#
|
|
|
|
include LibCommon.gmk
|
|
|
|
# Hook to include the corresponding custom file, if present.
|
|
$(eval $(call IncludeCustomExtension, modules/java.base/Lib.gmk))
|
|
|
|
# Prepare the find cache.
|
|
$(call FillFindCache, $(wildcard $(TOPDIR)/src/java.base/*/native))
|
|
|
|
################################################################################
|
|
# Create all the core libraries
|
|
|
|
include lib/CoreLibraries.gmk
|
|
|
|
################################################################################
|
|
# Create the network library
|
|
|
|
$(eval $(call SetupJdkLibrary, BUILD_LIBNET, \
|
|
NAME := net, \
|
|
OPTIMIZATION := LOW, \
|
|
DISABLED_WARNINGS_gcc_net_util_md.c := format-nonliteral, \
|
|
DISABLED_WARNINGS_gcc_NetworkInterface.c := unused-function, \
|
|
DISABLED_WARNINGS_clang_net_util_md.c := format-nonliteral, \
|
|
DISABLED_WARNINGS_clang_aix_DefaultProxySelector.c := deprecated-non-prototype, \
|
|
DISABLED_WARNINGS_clang_aix_NetworkInterface.c := gnu-pointer-arith, \
|
|
DISABLED_WARNINGS_microsoft_InetAddress.c := 4244, \
|
|
DISABLED_WARNINGS_microsoft_ResolverConfigurationImpl.c := 4996, \
|
|
LDFLAGS_windows := -delayload:secur32.dll -delayload:iphlpapi.dll \
|
|
-delayload:winhttp.dll, \
|
|
LIBS_unix := -ljvm -ljava, \
|
|
LIBS_linux := $(LIBDL), \
|
|
LIBS_aix := $(LIBDL),\
|
|
LIBS_windows := ws2_32.lib jvm.lib secur32.lib iphlpapi.lib winhttp.lib \
|
|
delayimp.lib $(WIN_JAVA_LIB) advapi32.lib, \
|
|
LIBS_macosx := -framework CoreFoundation -framework CoreServices, \
|
|
))
|
|
|
|
$(BUILD_LIBNET): $(BUILD_LIBJAVA)
|
|
|
|
TARGETS += $(BUILD_LIBNET)
|
|
|
|
################################################################################
|
|
# Create the nio library
|
|
|
|
$(eval $(call SetupJdkLibrary, BUILD_LIBNIO, \
|
|
NAME := nio, \
|
|
OPTIMIZATION := HIGH, \
|
|
EXTRA_HEADER_DIRS := \
|
|
libnio/ch \
|
|
libnio/fs \
|
|
libnet, \
|
|
LIBS_unix := -ljava -lnet, \
|
|
LIBS_linux := -lpthread $(LIBDL), \
|
|
LIBS_aix := $(LIBDL), \
|
|
LIBS_macosx := \
|
|
-framework CoreFoundation -framework CoreServices, \
|
|
LIBS_windows := jvm.lib Mswsock.lib ws2_32.lib $(WIN_JAVA_LIB) \
|
|
$(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libnet/net.lib \
|
|
advapi32.lib, \
|
|
))
|
|
|
|
TARGETS += $(BUILD_LIBNIO)
|
|
|
|
$(BUILD_LIBNIO): $(BUILD_LIBNET)
|
|
|
|
################################################################################
|
|
# Create the macosx security library
|
|
|
|
ifeq ($(call isTargetOs, macosx), true)
|
|
|
|
$(eval $(call SetupJdkLibrary, BUILD_LIBOSXSECURITY, \
|
|
NAME := osxsecurity, \
|
|
OPTIMIZATION := LOW, \
|
|
DISABLED_WARNINGS_clang_KeystoreImpl.m := deprecated-declarations, \
|
|
LDFLAGS := -L$(SUPPORT_OUTPUTDIR)/modules_libs/java.base,\
|
|
LIBS := \
|
|
-lobjc \
|
|
-framework CoreServices \
|
|
-framework Security \
|
|
-framework Foundation \
|
|
$(JDKLIB_LIBS), \
|
|
))
|
|
|
|
$(BUILD_LIBOSXSECURITY): $(BUILD_LIBJAVA)
|
|
|
|
TARGETS += $(BUILD_LIBOSXSECURITY)
|
|
|
|
endif
|
|
|
|
################################################################################
|
|
# Create the jsig library
|
|
|
|
ifeq ($(call isTargetOsType, unix), true)
|
|
ifeq ($(STATIC_BUILD), false)
|
|
$(eval $(call SetupJdkLibrary, BUILD_LIBJSIG, \
|
|
NAME := jsig, \
|
|
OPTIMIZATION := LOW, \
|
|
jsig.c_CFLAGS := -DHOTSPOT_VM_DISTRO='"$(HOTSPOT_VM_DISTRO)"', \
|
|
LIBS_linux := $(LIBDL), \
|
|
LIBS_aix := $(LIBDL), \
|
|
))
|
|
|
|
TARGETS += $(BUILD_LIBJSIG)
|
|
|
|
############################################################################
|
|
# Create symlinks to libjsig in each JVM variant sub dir
|
|
ifneq ($(STATIC_LIBS), true)
|
|
LIB_OUTPUTDIR := $(call FindLibDirForModule, java.base)
|
|
|
|
# $1 variant subdir
|
|
define CreateSymlinks
|
|
# Always symlink from libdir/variant/libjsig.so -> ../libjsig.so.
|
|
$(LIB_OUTPUTDIR)/$1/$(call SHARED_LIBRARY,jsig): \
|
|
$(LIB_OUTPUTDIR)/$(call SHARED_LIBRARY,jsig)
|
|
$$(call MakeDir, $$(@D))
|
|
$(RM) $$@
|
|
$(LN) -s ../$$(@F) $$@
|
|
|
|
TARGETS += $(LIB_OUTPUTDIR)/$1/$(call SHARED_LIBRARY,jsig)
|
|
endef
|
|
|
|
# The subdir is the same as the variant
|
|
$(foreach v, $(JVM_VARIANTS), $(eval $(call CreateSymlinks,$v)))
|
|
endif
|
|
############################################################################
|
|
|
|
endif
|
|
endif
|
|
|
|
################################################################################
|
|
# Create the symbols file for static builds.
|
|
|
|
ifeq ($(STATIC_BUILD), true)
|
|
JAVA_BASE_EXPORT_SYMBOLS_SRC := \
|
|
$(SUPPORT_OUTPUTDIR)/modules_libs/java.base/$(LIBRARY_PREFIX)jli.symbols \
|
|
$(SUPPORT_OUTPUTDIR)/modules_libs/java.base/$(LIBRARY_PREFIX)java.symbols \
|
|
$(SUPPORT_OUTPUTDIR)/modules_libs/java.base/$(LIBRARY_PREFIX)net.symbols \
|
|
$(SUPPORT_OUTPUTDIR)/modules_libs/java.base/$(LIBRARY_PREFIX)nio.symbols \
|
|
$(SUPPORT_OUTPUTDIR)/modules_libs/java.base/$(LIBRARY_PREFIX)verify.symbols \
|
|
$(SUPPORT_OUTPUTDIR)/modules_libs/java.base/$(LIBRARY_PREFIX)zip.symbols \
|
|
$(SUPPORT_OUTPUTDIR)/modules_libs/java.base/$(LIBRARY_PREFIX)jimage.symbols \
|
|
$(SUPPORT_OUTPUTDIR)/modules_libs/java.base/server/$(LIBRARY_PREFIX)jvm.symbols \
|
|
#
|
|
|
|
JAVA_BASE_EXPORT_SYMBOL_FILE := $(SUPPORT_OUTPUTDIR)/modules_libs/java.base/java.base.symbols
|
|
|
|
$(JAVA_BASE_EXPORT_SYMBOL_FILE): $(JAVA_BASE_EXPORT_SYMBOLS_SRC)
|
|
$(call LogInfo, Generating java.base.symbols file)
|
|
$(CAT) $^ > $@
|
|
|
|
# The individual symbol files is generated when the respective lib is built
|
|
$(JAVA_BASE_EXPORT_SYMBOLS_SRC): $(BUILD_LIBJLI) $(BUILD_LIBJAVA) \
|
|
$(BUILD_LIBNET) $(BUILD_LIBNIO) $(BUILD_LIBVERIFY) $(BUILD_LIBZIP) \
|
|
$(BUILD_LIBJIMAGE)
|
|
|
|
TARGETS += $(JAVA_BASE_EXPORT_SYMBOL_FILE)
|
|
endif
|
|
|
|
################################################################################
|
|
# Copy tzmappings file for Windows
|
|
|
|
ifeq ($(call isTargetOs, windows), true)
|
|
$(eval $(call SetupCopyFiles, COPY_TZMAPPINGS, \
|
|
FILES := $(SUPPORT_OUTPUTDIR)/gensrc/java.base/windows/conf/tzmappings, \
|
|
DEST := $(call FindLibDirForModule, $(MODULE)), \
|
|
))
|
|
TARGETS += $(COPY_TZMAPPINGS)
|
|
endif
|
|
|
|
################################################################################
|
|
# Create system lookup
|
|
|
|
$(eval $(call SetupJdkLibrary, BUILD_SYSLOOKUPLIB, \
|
|
NAME := syslookup, \
|
|
LD_SET_ORIGIN := false, \
|
|
LDFLAGS_linux := -Wl$(COMMA)--no-as-needed, \
|
|
LDFLAGS_aix := -brtl -bexpfull, \
|
|
LIBS_linux := -lm -ldl, \
|
|
LIBS_aix := -lm -ldecNumber, \
|
|
))
|
|
|
|
TARGETS += $(BUILD_SYSLOOKUPLIB)
|
|
|
|
################################################################################
|
|
# Create fallback linker lib
|
|
|
|
ifeq ($(ENABLE_FALLBACK_LINKER), true)
|
|
$(eval $(call SetupJdkLibrary, BUILD_LIBFALLBACKLINKER, \
|
|
NAME := fallbackLinker, \
|
|
CFLAGS := $(LIBFFI_CFLAGS), \
|
|
LIBS := $(LIBFFI_LIBS), \
|
|
LIBS_windows := $(LIBFFI_LIBS) ws2_32.lib, \
|
|
))
|
|
|
|
TARGETS += $(BUILD_LIBFALLBACKLINKER)
|
|
endif
|
|
|
|
################################################################################
|
|
|
|
ifeq ($(call isTargetOs, linux)+$(call isTargetCpu, x86_64)+$(INCLUDE_COMPILER2)+$(filter $(TOOLCHAIN_TYPE), gcc), true+true+true+gcc)
|
|
$(eval $(call SetupJdkLibrary, BUILD_LIB_SIMD_SORT, \
|
|
NAME := simdsort, \
|
|
LINK_TYPE := C++, \
|
|
OPTIMIZATION := HIGH, \
|
|
CXXFLAGS := -std=c++17, \
|
|
LIBS_linux := -lm -ldl, \
|
|
))
|
|
|
|
TARGETS += $(BUILD_LIB_SIMD_SORT)
|
|
endif
|
|
|
|
################################################################################
|