Skip to content

Commit

Permalink
Merge branch 'master' into matchers-experiment
Browse files Browse the repository at this point in the history
  • Loading branch information
biboudis committed Mar 22, 2024
2 parents 1ecb187 + f207aa9 commit 5d29b7f
Show file tree
Hide file tree
Showing 2,187 changed files with 10,111 additions and 6,678 deletions.
16 changes: 15 additions & 1 deletion .github/workflows/build-cross-compile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,27 +61,32 @@ jobs:
debian-arch: arm64
debian-repository: https://httpredir.debian.org/debian/
debian-version: bullseye
tolerate-sysroot-errors: false
- target-cpu: arm
gnu-arch: arm
debian-arch: armhf
debian-repository: https://httpredir.debian.org/debian/
debian-version: bullseye
tolerate-sysroot-errors: false
gnu-abi: eabihf
- target-cpu: s390x
gnu-arch: s390x
debian-arch: s390x
debian-repository: https://httpredir.debian.org/debian/
debian-version: bullseye
tolerate-sysroot-errors: false
- target-cpu: ppc64le
gnu-arch: powerpc64le
debian-arch: ppc64el
debian-repository: https://httpredir.debian.org/debian/
debian-version: bullseye
tolerate-sysroot-errors: false
- target-cpu: riscv64
gnu-arch: riscv64
debian-arch: riscv64
debian-repository: https://httpredir.debian.org/debian/
debian-version: sid
tolerate-sysroot-errors: true

steps:
- name: 'Checkout the JDK source'
Expand Down Expand Up @@ -130,6 +135,7 @@ jobs:
if: steps.get-cached-sysroot.outputs.cache-hit != 'true'

- name: 'Create sysroot'
id: create-sysroot
run: >
sudo debootstrap
--arch=${{ matrix.debian-arch }}
Expand All @@ -140,6 +146,7 @@ jobs:
${{ matrix.debian-version }}
sysroot
${{ matrix.debian-repository }}
continue-on-error: ${{ matrix.tolerate-sysroot-errors }}
if: steps.get-cached-sysroot.outputs.cache-hit != 'true'

- name: 'Prepare sysroot'
Expand All @@ -151,7 +158,12 @@ jobs:
rm -rf sysroot/usr/{sbin,bin,share}
rm -rf sysroot/usr/lib/{apt,gcc,udev,systemd}
rm -rf sysroot/usr/libexec/gcc
if: steps.get-cached-sysroot.outputs.cache-hit != 'true'
if: steps.create-sysroot.outcome == 'success' && steps.get-cached-sysroot.outputs.cache-hit != 'true'

- name: 'Remove broken sysroot'
run: |
sudo rm -rf sysroot/
if: steps.create-sysroot.outcome != 'success' && steps.get-cached-sysroot.outputs.cache-hit != 'true'

- name: 'Configure'
run: >
Expand All @@ -173,10 +185,12 @@ jobs:
echo "Dumping config.log:" &&
cat config.log &&
exit 1)
if: steps.create-sysroot.outcome == 'success'

- name: 'Build'
id: build
uses: ./.github/actions/do-build
with:
make-target: 'hotspot ${{ inputs.make-arguments }}'
platform: linux-${{ matrix.target-cpu }}
if: steps.create-sysroot.outcome == 'success'
4 changes: 1 addition & 3 deletions make/autoconf/libraries.m4
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2011, 2023, Oracle and/or its affiliates. All rights reserved.
# 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
Expand Down Expand Up @@ -171,13 +171,11 @@ AC_DEFUN_ONCE([LIB_SETUP_LIBRARIES],
LIB_SETUP_JVM_LIBS(TARGET)
JDKLIB_LIBS="$BASIC_JDKLIB_LIBS"
JDKEXE_LIBS=""
JVM_LIBS="$BASIC_JVM_LIBS $BASIC_JVM_LIBS_TARGET"
OPENJDK_BUILD_JDKLIB_LIBS="$BASIC_JDKLIB_LIBS"
OPENJDK_BUILD_JVM_LIBS="$BASIC_JVM_LIBS $BASIC_JVM_LIBS_BUILD"
AC_SUBST(JDKLIB_LIBS)
AC_SUBST(JDKEXE_LIBS)
AC_SUBST(JVM_LIBS)
AC_SUBST(OPENJDK_BUILD_JDKLIB_LIBS)
AC_SUBST(OPENJDK_BUILD_JVM_LIBS)
Expand Down
1 change: 0 additions & 1 deletion make/autoconf/spec.gmk.template
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,6 @@ JDKLIB_LIBS := @JDKLIB_LIBS@

# LDFLAGS used to link the jdk native launchers (C-code)
LDFLAGS_JDKEXE := @LDFLAGS_JDKEXE@
JDKEXE_LIBS := @JDKEXE_LIBS@

# LDFLAGS specific to C++ linking.
LDFLAGS_CXX_JDK := @LDFLAGS_CXX_JDK@
Expand Down
10 changes: 10 additions & 0 deletions make/common/JdkNativeCompilation.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,11 @@ define SetupJdkLibraryBody
# Add the module specific java header dir
$1_SRC_HEADER_FLAGS += $$(addprefix -I, $$(call GetJavaHeaderDir, $$(MODULE)))

$1_JDK_LIBS += $$($1_JDK_LIBS_$$(OPENJDK_TARGET_OS))
$1_JDK_LIBS += $$($1_JDK_LIBS_$$(OPENJDK_TARGET_OS_TYPE))
# Prepend JDK libs before external libs
$1_LIBS := $$($1_JDK_LIBS) $$($1_LIBS)

ifneq ($$($1_EXTRA_HEADER_DIRS), )
$1_PROCESSED_EXTRA_HEADER_DIRS := $$(foreach dir, $$($1_EXTRA_HEADER_DIRS), \
$$(call ProcessDir, $$(dir)))
Expand Down Expand Up @@ -273,6 +278,11 @@ define SetupJdkExecutableBody
-I$(TOPDIR)/src/java.base/windows/native/common \
$$($1_EXTRA_RCFLAGS)

$1_JDK_LIBS += $$($1_JDK_LIBS_$$(OPENJDK_TARGET_OS))
$1_JDK_LIBS += $$($1_JDK_LIBS_$$(OPENJDK_TARGET_OS_TYPE))
# Prepend JDK libs before external libs
$1_LIBS := $$($1_JDK_LIBS) $$($1_LIBS)

ifneq ($$($1_DEFAULT_CFLAGS), false)
# Set the default flags first to be able to override
$1_CFLAGS := $$(filter-out $$($1_CFLAGS_FILTER_OUT), $$(CFLAGS_JDKEXE)) $$($1_CFLAGS)
Expand Down
24 changes: 13 additions & 11 deletions make/common/modules/LauncherCommon.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,6 @@ define SetupBuildLauncherBody
endif
endif

ifeq ($(USE_EXTERNAL_LIBZ), true)
$1_LIBS += -lz
endif

$1_WINDOWS_JLI_LIB := $(call FindStaticLib, java.base, jli, /libjli)

$1_EXTRA_FILES := $(LAUNCHER_SRC)/main.c
Expand Down Expand Up @@ -155,13 +151,19 @@ define SetupBuildLauncherBody
LDFLAGS_macosx := $$(call SET_EXECUTABLE_ORIGIN,/../lib) \
-L$(call FindLibDirForModule, java.base), \
LDFLAGS_aix := -L$(SUPPORT_OUTPUTDIR)/native/java.base, \
LIBS := $(JDKEXE_LIBS) $$($1_LIBS), \
LIBS_linux := -ljli -lpthread $(LIBDL), \
LIBS_macosx := -ljli -framework Cocoa -framework Security \
-framework ApplicationServices, \
LIBS_aix := -ljli_static, \
LIBS_windows := $$($1_WINDOWS_JLI_LIB) \
$(SUPPORT_OUTPUTDIR)/native/java.base/libjava/java.lib, \
JDK_LIBS_linux := -ljli, \
JDK_LIBS_macosx := -ljli, \
JDK_LIBS_aix := -ljli_static, \
JDK_LIBS_windows := \
$(SUPPORT_OUTPUTDIR)/native/java.base/libjava/java.lib \
$$($1_WINDOWS_JLI_LIB), \
LIBS := $$($1_LIBS), \
LIBS_unix := $(LIBZ_LIBS), \
LIBS_linux := $(LIBDL) -lpthread, \
LIBS_macosx := \
-framework ApplicationServices \
-framework Cocoa \
-framework Security, \
OUTPUT_DIR := $$($1_OUTPUT_DIR), \
VERSIONINFO_RESOURCE := $$($1_VERSION_INFO_RESOURCE), \
EXTRA_RCFLAGS := $$($1_EXTRA_RCFLAGS), \
Expand Down
8 changes: 4 additions & 4 deletions make/hotspot/lib/CompileGtest.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,9 @@ $(eval $(call SetupJdkLibrary, BUILD_GTEST_LIBJVM, \
DEFAULT_LDFLAGS := false, \
LDFLAGS := $(JVM_LDFLAGS), \
LDFLAGS_unix := -L$(JVM_OUTPUTDIR)/libgtest, \
JDK_LIBS_unix := -lgtest, \
JDK_LIBS_windows := $(JVM_OUTPUTDIR)/libgtest/gtest.lib, \
LIBS := $(JVM_LIBS), \
LIBS_unix := -lgtest, \
LIBS_windows := $(JVM_OUTPUTDIR)/libgtest/gtest.lib, \
OPTIMIZATION := $(JVM_OPTIMIZATION), \
COPY_DEBUG_SYMBOLS := $(GTEST_COPY_DEBUG_SYMBOLS), \
ZIP_EXTERNAL_DEBUG_SYMBOLS := false, \
Expand Down Expand Up @@ -146,8 +146,8 @@ $(eval $(call SetupJdkExecutable, BUILD_GTEST_LAUNCHER, \
-I$(GTEST_FRAMEWORK_SRC)/googlemock/include, \
LD_SET_ORIGIN := false, \
LDFLAGS_unix := -L$(JVM_OUTPUTDIR)/gtest $(call SET_SHARED_LIBRARY_ORIGIN), \
LIBS_unix := -ljvm, \
LIBS_windows := $(JVM_OUTPUTDIR)/gtest/objs/jvm.lib, \
JDK_LIBS_unix := -ljvm, \
JDK_LIBS_windows := $(JVM_OUTPUTDIR)/gtest/objs/jvm.lib, \
COPY_DEBUG_SYMBOLS := $(GTEST_COPY_DEBUG_SYMBOLS), \
ZIP_EXTERNAL_DEBUG_SYMBOLS := false, \
))
Expand Down
33 changes: 17 additions & 16 deletions make/modules/java.instrument/Lib.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -25,32 +25,35 @@

include LibCommon.gmk

################################################################################
## Build libinstrument
################################################################################

ifeq ($(call isTargetOs, windows), true)
# equivalent of strcasecmp is stricmp on Windows
LIBINSTRUMENT_CFLAGS := -Dstrcasecmp=stricmp
WINDOWS_JLI_LIB := $(SUPPORT_OUTPUTDIR)/native/java.base/libjli/jli.lib
endif

# equivalent of strcasecmp is stricmp on Windows
$(eval $(call SetupJdkLibrary, BUILD_LIBINSTRUMENT, \
NAME := instrument, \
OPTIMIZATION := LOW, \
CFLAGS := $(LIBINSTRUMENT_CFLAGS), \
CFLAGS_windows := -Dstrcasecmp=stricmp, \
CFLAGS_debug := -DJPLIS_LOGGING, \
CFLAGS_release := -DNO_JPLIS_LOGGING, \
EXTRA_HEADER_DIRS := java.base:libjli, \
LDFLAGS_linux := -L$(call FindLibDirForModule, java.base), \
LDFLAGS_macosx := -L$(call FindLibDirForModule, java.base), \
LDFLAGS_aix := -L$(SUPPORT_OUTPUTDIR)/native/java.base, \
LIBS := $(JDKLIB_LIBS), \
JDK_LIBS := $(JDKLIB_LIBS), \
JDK_LIBS_linux := -ljli, \
JDK_LIBS_macosx := -ljli, \
JDK_LIBS_aix := -ljli_static, \
JDK_LIBS_windows := $(WIN_JAVA_LIB) \
$(SUPPORT_OUTPUTDIR)/native/java.base/libjli/jli.lib jvm.lib, \
LIBS_unix := $(LIBZ_LIBS), \
LIBS_linux := -ljli $(LIBDL), \
LIBS_aix := -liconv -ljli_static $(LIBDL), \
LIBS_macosx := -ljli -liconv -framework Cocoa -framework Security \
-framework ApplicationServices, \
LIBS_windows := jvm.lib $(WIN_JAVA_LIB) advapi32.lib \
$(WINDOWS_JLI_LIB), \
LIBS_linux := $(LIBDL), \
LIBS_aix := $(LIBDL) -liconv, \
LIBS_macosx := -liconv \
-framework ApplicationServices \
-framework Cocoa \
-framework Security, \
LIBS_windows := advapi32.lib, \
))

ifeq ($(call isTargetOs, aix), true)
Expand All @@ -61,5 +64,3 @@ endif
$(BUILD_LIBINSTRUMENT): $(call FindLib, java.base, java)

TARGETS += $(BUILD_LIBINSTRUMENT)

################################################################################
11 changes: 5 additions & 6 deletions make/modules/java.management/Lib.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,17 @@ include LibCommon.gmk
################################################################################

LIBMANAGEMENT_OPTIMIZATION := HIGH
ifeq ($(call isTargetOs, linux), true)
ifeq ($(COMPILE_WITH_DEBUG_SYMBOLS), true)
LIBMANAGEMENT_OPTIMIZATION := LOW
endif
ifeq ($(call isTargetOs, linux)+$(COMPILE_WITH_DEBUG_SYMBOLS), true+true)
LIBMANAGEMENT_OPTIMIZATION := LOW
endif

$(eval $(call SetupJdkLibrary, BUILD_LIBMANAGEMENT, \
NAME := management, \
OPTIMIZATION := $(LIBMANAGEMENT_OPTIMIZATION), \
LIBS := $(JDKLIB_LIBS), \
JDK_LIBS := $(JDKLIB_LIBS), \
JDK_LIBS_windows := $(WIN_JAVA_LIB) jvm.lib, \
LIBS_aix := -lperfstat,\
LIBS_windows := jvm.lib psapi.lib $(WIN_JAVA_LIB) advapi32.lib, \
LIBS_windows := advapi32.lib psapi.lib, \
))

$(BUILD_LIBMANAGEMENT): $(call FindLib, java.base, java)
Expand Down
19 changes: 11 additions & 8 deletions make/modules/java.prefs/Lib.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -25,26 +25,29 @@

include LibCommon.gmk

################################################################################
## Build libprefs
################################################################################

# libprefs on macosx do not use the unix code
ifeq ($(call isTargetOs, macosx), true)
LIBPREFS_EXCLUDE_SRC_PATTERNS := unix
LIBPREFS_EXCLUDE_SRC_PATTERNS := /unix/
endif

$(eval $(call SetupJdkLibrary, BUILD_LIBPREFS, \
NAME := prefs, \
EXCLUDE_SRC_PATTERNS := $(LIBPREFS_EXCLUDE_SRC_PATTERNS), \
OPTIMIZATION := HIGH, \
LIBS_unix := -ljvm, \
LIBS_linux := -ljava, \
LIBS_aix := -ljava, \
LIBS_macosx := -framework CoreFoundation -framework Foundation, \
LIBS_windows := advapi32.lib jvm.lib $(WIN_JAVA_LIB), \
JDK_LIBS_unix := -ljvm, \
JDK_LIBS_linux := -ljava, \
JDK_LIBS_aix := -ljava, \
JDK_LIBS_windows := $(WIN_JAVA_LIB) jvm.lib, \
LIBS_macosx := \
-framework CoreFoundation \
-framework Foundation, \
LIBS_windows := advapi32.lib, \
))

$(BUILD_LIBPREFS): $(call FindLib, java.base, java)

TARGETS += $(BUILD_LIBPREFS)

################################################################################
6 changes: 5 additions & 1 deletion make/modules/java.rmi/Launcher.gmk
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2011, 2021, Oracle and/or its affiliates. All rights reserved.
# 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
Expand All @@ -25,6 +25,10 @@

include LauncherCommon.gmk

################################################################################
## Build rmiregistry
################################################################################

$(eval $(call SetupBuildLauncher, rmiregistry, \
MAIN_CLASS := sun.rmi.registry.RegistryImpl, \
JAVA_ARGS := -Djava.security.manager=allow, \
Expand Down
8 changes: 4 additions & 4 deletions make/modules/java.rmi/Lib.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,17 @@

include LibCommon.gmk

################################################################################
## Build librmi
################################################################################

$(eval $(call SetupJdkLibrary, BUILD_LIBRMI, \
NAME := rmi, \
OPTIMIZATION := LOW, \
LIBS_unix := -ljvm, \
LIBS_windows := jvm.lib, \
JDK_LIBS_unix := -ljvm, \
JDK_LIBS_windows := jvm.lib, \
))

$(BUILD_LIBRMI): $(call FindLib, java.base, java)

TARGETS += $(BUILD_LIBRMI)

################################################################################
6 changes: 5 additions & 1 deletion make/modules/java.scripting/Launcher.gmk
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
# 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
Expand All @@ -25,6 +25,10 @@

include LauncherCommon.gmk

################################################################################
## Build jrunscript
################################################################################

$(eval $(call SetupBuildLauncher, jrunscript, \
MAIN_CLASS := com.sun.tools.script.shell.Main, \
JAVA_ARGS := --add-modules ALL-DEFAULT, \
Expand Down
14 changes: 13 additions & 1 deletion make/modules/java.security.jgss/Launcher.gmk
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved.
# 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
Expand All @@ -26,14 +26,26 @@
include LauncherCommon.gmk

ifeq ($(call isTargetOs, windows), true)
##############################################################################
## Build kinit
##############################################################################

$(eval $(call SetupBuildLauncher, kinit, \
MAIN_CLASS := sun.security.krb5.internal.tools.Kinit, \
))

##############################################################################
## Build klist
##############################################################################

$(eval $(call SetupBuildLauncher, klist, \
MAIN_CLASS := sun.security.krb5.internal.tools.Klist, \
))

##############################################################################
## Build ktab
##############################################################################

$(eval $(call SetupBuildLauncher, ktab, \
MAIN_CLASS := sun.security.krb5.internal.tools.Ktab, \
))
Expand Down
Loading

0 comments on commit 5d29b7f

Please sign in to comment.