Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into 8318026_jcmd_VMde…
Browse files Browse the repository at this point in the history
…bug_command
  • Loading branch information
kevinjwalls committed Apr 16, 2024
2 parents dfb60b9 + 97c1808 commit bb92a84
Show file tree
Hide file tree
Showing 556 changed files with 12,297 additions and 7,497 deletions.
5 changes: 4 additions & 1 deletion make/Bundles.gmk
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2016, 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 @@ -28,6 +28,9 @@ default: all
include $(SPEC)
include MakeBase.gmk

include CopyFiles.gmk
include MakeIO.gmk

PRODUCT_TARGETS :=
LEGACY_TARGETS :=
TEST_TARGETS :=
Expand Down
2 changes: 2 additions & 0 deletions make/CompileDemos.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ default: all

include $(SPEC)
include MakeBase.gmk

include CopyFiles.gmk
include JavaCompilation.gmk
include TextFileProcessing.gmk
include ZipArchive.gmk
Expand Down
2 changes: 2 additions & 0 deletions make/CompileInterimLangtools.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ default: all

include $(SPEC)
include MakeBase.gmk

include CopyFiles.gmk
include JavaCompilation.gmk
include Modules.gmk

Expand Down
2 changes: 2 additions & 0 deletions make/CompileToolsJdk.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ default: all

include $(SPEC)
include MakeBase.gmk

include CopyFiles.gmk
include JavaCompilation.gmk
include TextFileProcessing.gmk

Expand Down
2 changes: 2 additions & 0 deletions make/CopyImportModules.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ default: all
include $(SPEC)
include MakeBase.gmk

include CopyFiles.gmk

LIBS_DIR := $(wildcard $(addsuffix /$(MODULE), $(IMPORT_MODULES_LIBS)))
CMDS_DIR := $(wildcard $(addsuffix /$(MODULE), $(IMPORT_MODULES_CMDS)))
CONF_DIR := $(wildcard $(addsuffix /$(MODULE), $(IMPORT_MODULES_CONF)))
Expand Down
2 changes: 2 additions & 0 deletions make/CopyInterimTZDB.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ default: all
include $(SPEC)
include MakeBase.gmk

include CopyFiles.gmk

##########################################################################################

### TZDB tool needs files from java.time.zone package
Expand Down
2 changes: 2 additions & 0 deletions make/CreateJmods.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ default: all

include $(SPEC)
include MakeBase.gmk

include CopyFiles.gmk
include Execute.gmk
include Modules.gmk

Expand Down
2 changes: 2 additions & 0 deletions make/Docs.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ default: all

include $(SPEC)
include MakeBase.gmk

include CopyFiles.gmk
include Execute.gmk
include Modules.gmk
include ModuleTools.gmk
Expand Down
2 changes: 2 additions & 0 deletions make/GenerateLinkOptData.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ default: all

include $(SPEC)
include MakeBase.gmk

include CopyFiles.gmk
include JavaCompilation.gmk

################################################################################
Expand Down
2 changes: 2 additions & 0 deletions make/GraalBuilderImage.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ default: all
include $(SPEC)
include MakeBase.gmk

include CopyFiles.gmk

################################################################################

TARGETS :=
Expand Down
4 changes: 3 additions & 1 deletion make/Hsdis.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,9 @@ $(eval $(call SetupJdkLibrary, BUILD_HSDIS, \
NAME := hsdis, \
LINK_TYPE := $(HSDIS_LINK_TYPE), \
SRC := $(TOPDIR)/src/utils/hsdis/$(HSDIS_BACKEND), \
EXTRA_HEADER_DIRS := $(TOPDIR)/src/utils/hsdis, \
EXTRA_HEADER_DIRS := \
java.base:include \
$(TOPDIR)/src/utils/hsdis, \
OUTPUT_DIR := $(HSDIS_OUTPUT_DIR), \
OBJECT_DIR := $(HSDIS_OUTPUT_DIR), \
DISABLED_WARNINGS_gcc := undef format-nonliteral sign-compare, \
Expand Down
2 changes: 2 additions & 0 deletions make/Images.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ default: all

include $(SPEC)
include MakeBase.gmk

include CopyFiles.gmk
include Execute.gmk
include Modules.gmk
include Utils.gmk
Expand Down
25 changes: 25 additions & 0 deletions make/InitSupport.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,31 @@ else # $(HAS_SPEC)=true
endef
endif

##############################################################################
# Functions for timers
##############################################################################

# Store the build times in this directory.
BUILDTIMESDIR=$(OUTPUTDIR)/make-support/build-times

# Record starting time for build of a sub repository.
define RecordStartTime
$(DATE) '+%Y %m %d %H %M %S' | $(AWK) '{ print $$1,$$2,$$3,$$4,$$5,$$6,($$4*3600+$$5*60+$$6) }' > $(BUILDTIMESDIR)/build_time_start_$(strip $1) && \
$(DATE) '+%Y-%m-%d %H:%M:%S' > $(BUILDTIMESDIR)/build_time_start_$(strip $1)_human_readable
endef

# Record ending time and calculate the difference and store it in a
# easy to read format. Handles builds that cross midnight. Expects
# that a build will never take 24 hours or more.
define RecordEndTime
$(DATE) '+%Y %m %d %H %M %S' | $(AWK) '{ print $$1,$$2,$$3,$$4,$$5,$$6,($$4*3600+$$5*60+$$6) }' > $(BUILDTIMESDIR)/build_time_end_$(strip $1)
$(DATE) '+%Y-%m-%d %H:%M:%S' > $(BUILDTIMESDIR)/build_time_end_$(strip $1)_human_readable
$(ECHO) `$(CAT) $(BUILDTIMESDIR)/build_time_start_$(strip $1)` `$(CAT) $(BUILDTIMESDIR)/build_time_end_$(strip $1)` $1 | \
$(AWK) '{ F=$$7; T=$$14; if (F > T) { T+=3600*24 }; D=T-F; H=int(D/3600); \
M=int((D-H*3600)/60); S=D-H*3600-M*60; printf("%02d:%02d:%02d %s\n",H,M,S,$$15); }' \
> $(BUILDTIMESDIR)/build_time_diff_$(strip $1)
endef

define StartGlobalTimer
$(RM) -r $(BUILDTIMESDIR) 2> /dev/null && \
$(MKDIR) -p $(BUILDTIMESDIR) && \
Expand Down
2 changes: 2 additions & 0 deletions make/JrtfsJar.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ default: all

include $(SPEC)
include MakeBase.gmk

include CopyFiles.gmk
include JavaCompilation.gmk
include JarArchive.gmk
include TextFileProcessing.gmk
Expand Down
2 changes: 2 additions & 0 deletions make/MacBundles.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@

include $(SPEC)
include MakeBase.gmk

include CopyFiles.gmk
include TextFileProcessing.gmk

default: bundles
Expand Down
2 changes: 2 additions & 0 deletions make/ModuleWrapper.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ default: all
include $(SPEC)
include MakeBase.gmk

include CopyFiles.gmk

MODULE_SRC := $(TOPDIR)/src/$(MODULE)

# All makefiles should add the targets to be built to this variable.
Expand Down
12 changes: 11 additions & 1 deletion make/SourceRevision.gmk
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2016, 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 @@ -41,6 +41,16 @@ $(eval $(call IncludeCustomExtension, SourceRevision-pre.gmk))

STORED_SOURCE_REVISION := $(TOPDIR)/.src-rev

# Locate all sourcecode repositories included in the forest, as absolute paths
FindAllReposAbs = \
$(strip $(sort $(dir $(filter-out $(TOPDIR)/build/%, $(wildcard \
$(addprefix $(TOPDIR)/, .git */.git */*/.git */*/*/.git */*/*/*/.git) \
)))))

# Locate all sourcecode repositories included in the forest, as relative paths
FindAllReposRel = \
$(strip $(subst $(TOPDIR)/,.,$(patsubst $(TOPDIR)/%/, %, $(FindAllReposAbs))))

USE_SCM := false
ifneq ($(and $(GIT), $(wildcard $(TOPDIR)/.git)), )
USE_SCM := true
Expand Down
2 changes: 2 additions & 0 deletions make/StaticLibsImage.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ default: all

include $(SPEC)
include MakeBase.gmk

include CopyFiles.gmk
include Modules.gmk

ALL_MODULES = $(call FindAllModules)
Expand Down
13 changes: 2 additions & 11 deletions make/autoconf/flags-cflags.m4
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_HELPER],
CFLAGS_OS_DEF_JVM="-D_ALLBSD_SOURCE -D_DARWIN_C_SOURCE -D_XOPEN_SOURCE"
CFLAGS_OS_DEF_JDK="-D_ALLBSD_SOURCE -D_DARWIN_UNLIMITED_SELECT"
elif test "x$OPENJDK_TARGET_OS" = xaix; then
CFLAGS_OS_DEF_JVM="-DAIX -D_LARGE_FILES"
CFLAGS_OS_DEF_JVM="-DAIX -Dalloca'(size)'=__builtin_alloca'(size)' -D_LARGE_FILES"
CFLAGS_OS_DEF_JDK="-D_LARGE_FILES"
elif test "x$OPENJDK_TARGET_OS" = xbsd; then
CFLAGS_OS_DEF_JDK="-D_ALLBSD_SOURCE"
Expand All @@ -476,15 +476,6 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_HELPER],
# Always enable optional macros for VM.
ALWAYS_CFLAGS_JVM="-D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS"
# Setup some hard coded includes
ALWAYS_CFLAGS_JDK=" \
-I\$(SUPPORT_OUTPUTDIR)/modules_include/java.base \
-I\$(SUPPORT_OUTPUTDIR)/modules_include/java.base/\$(OPENJDK_TARGET_OS_INCLUDE_SUBDIR) \
-I${TOPDIR}/src/java.base/share/native/libjava \
-I${TOPDIR}/src/java.base/$OPENJDK_TARGET_OS_TYPE/native/libjava \
-I${TOPDIR}/src/hotspot/share/include \
-I${TOPDIR}/src/hotspot/os/${HOTSPOT_TARGET_OS_TYPE}/include"
###############################################################################
# Adjust flags according to debug level.
Expand Down Expand Up @@ -871,7 +862,7 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_CPU_DEP],
$WARNING_CFLAGS $WARNING_CFLAGS_JVM $JVM_PICFLAG $FILE_MACRO_CFLAGS \
$REPRODUCIBLE_CFLAGS $BRANCH_PROTECTION_CFLAGS"
CFLAGS_JDK_COMMON="$ALWAYS_CFLAGS_JDK $ALWAYS_DEFINES_JDK $TOOLCHAIN_CFLAGS_JDK \
CFLAGS_JDK_COMMON="$ALWAYS_DEFINES_JDK $TOOLCHAIN_CFLAGS_JDK \
$OS_CFLAGS $CFLAGS_OS_DEF_JDK $DEBUG_CFLAGS_JDK $DEBUG_OPTIONS_FLAGS_JDK \
$WARNING_CFLAGS $WARNING_CFLAGS_JDK $DEBUG_SYMBOLS_CFLAGS_JDK \
$FILE_MACRO_CFLAGS $REPRODUCIBLE_CFLAGS $BRANCH_PROTECTION_CFLAGS"
Expand Down
24 changes: 2 additions & 22 deletions make/autoconf/flags-ldflags.m4
Original file line number Diff line number Diff line change
Expand Up @@ -31,22 +31,11 @@ AC_DEFUN([FLAGS_SETUP_LDFLAGS],
FLAGS_SETUP_LDFLAGS_HELPER
# Setup the target toolchain
# The target dir matches the name of VM variant
TARGET_JVM_VARIANT_PATH=$JVM_VARIANT_MAIN
# On some platforms (mac) the linker warns about non existing -L dirs.
FLAGS_SETUP_LDFLAGS_CPU_DEP([TARGET])
# Setup the build toolchain
# When building a buildjdk, it's always only the server variant
BUILD_JVM_VARIANT_PATH=server
FLAGS_SETUP_LDFLAGS_CPU_DEP([BUILD], [OPENJDK_BUILD_])
LDFLAGS_TESTEXE="${TARGET_LDFLAGS_JDK_LIBPATH}"
AC_SUBST(LDFLAGS_TESTEXE)
AC_SUBST(ADLC_LDFLAGS)
])

Expand Down Expand Up @@ -155,7 +144,7 @@ AC_DEFUN([FLAGS_SETUP_LDFLAGS_HELPER],
fi
# Export some intermediate variables for compatibility
LDFLAGS_CXX_JDK="$BASIC_LDFLAGS_ONLYCXX $BASIC_LDFLAGS_ONLYCXX_JDK_ONLY $DEBUGLEVEL_LDFLAGS_JDK_ONLY"
LDFLAGS_CXX_JDK="$DEBUGLEVEL_LDFLAGS_JDK_ONLY"
AC_SUBST(LDFLAGS_CXX_JDK)
AC_SUBST(LDFLAGS_CXX_PARTIAL_LINKING)
])
Expand Down Expand Up @@ -197,20 +186,11 @@ AC_DEFUN([FLAGS_SETUP_LDFLAGS_CPU_DEP],
fi
fi
# JVM_VARIANT_PATH depends on if this is build or target...
if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
$1_LDFLAGS_JDK_LIBPATH="-libpath:\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base"
else
$1_LDFLAGS_JDK_LIBPATH="-L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base \
-L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base/${$1_JVM_VARIANT_PATH}"
fi
# Export variables according to old definitions, prefix with $2 if present.
LDFLAGS_JDK_COMMON="$BASIC_LDFLAGS $BASIC_LDFLAGS_JDK_ONLY \
$OS_LDFLAGS $DEBUGLEVEL_LDFLAGS_JDK_ONLY ${$2EXTRA_LDFLAGS}"
$2LDFLAGS_JDKLIB="$LDFLAGS_JDK_COMMON $BASIC_LDFLAGS_JDK_LIB_ONLY \
${$1_LDFLAGS_JDK_LIBPATH} $SHARED_LIBRARY_FLAGS \
$REPRODUCIBLE_LDFLAGS $FILE_MACRO_LDFLAGS"
$SHARED_LIBRARY_FLAGS $REPRODUCIBLE_LDFLAGS $FILE_MACRO_LDFLAGS"
$2LDFLAGS_JDKEXE="$LDFLAGS_JDK_COMMON $EXECUTABLE_LDFLAGS \
${$1_CPU_EXECUTABLE_LDFLAGS} $REPRODUCIBLE_LDFLAGS $FILE_MACRO_LDFLAGS"
Expand Down
10 changes: 1 addition & 9 deletions make/autoconf/libraries.m4
Original file line number Diff line number Diff line change
Expand Up @@ -129,12 +129,6 @@ AC_DEFUN_ONCE([LIB_SETUP_LIBRARIES],
LIB_TESTS_SETUP_GTEST
BASIC_JDKLIB_LIBS=""
BASIC_JDKLIB_LIBS_TARGET=""
if test "x$TOOLCHAIN_TYPE" != xmicrosoft; then
BASIC_JDKLIB_LIBS="-ljava -ljvm"
fi
# Math library
BASIC_JVM_LIBS="$LIBM"
Expand Down Expand Up @@ -170,12 +164,10 @@ AC_DEFUN_ONCE([LIB_SETUP_LIBRARIES],
LIB_SETUP_JVM_LIBS(BUILD)
LIB_SETUP_JVM_LIBS(TARGET)
JDKLIB_LIBS="$BASIC_JDKLIB_LIBS"
JVM_LIBS="$BASIC_JVM_LIBS $BASIC_JVM_LIBS_TARGET"
OPENJDK_BUILD_JDKLIB_LIBS="$BASIC_JDKLIB_LIBS"
OPENJDK_BUILD_JDKLIB_LIBS=""
OPENJDK_BUILD_JVM_LIBS="$BASIC_JVM_LIBS $BASIC_JVM_LIBS_BUILD"
AC_SUBST(JDKLIB_LIBS)
AC_SUBST(JVM_LIBS)
AC_SUBST(OPENJDK_BUILD_JDKLIB_LIBS)
AC_SUBST(OPENJDK_BUILD_JVM_LIBS)
Expand Down
8 changes: 4 additions & 4 deletions make/autoconf/spec.gmk.template
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,6 @@ SYSROOT := @SYSROOT@

# LDFLAGS used to link the jdk native libraries (C-code)
LDFLAGS_JDKLIB := @LDFLAGS_JDKLIB@
JDKLIB_LIBS := @JDKLIB_LIBS@

# LDFLAGS used to link the jdk native launchers (C-code)
LDFLAGS_JDKEXE := @LDFLAGS_JDKEXE@
Expand All @@ -571,9 +570,6 @@ LDCXX := @LDCXX@
# The flags for linking libstdc++ linker.
LIBCXX := @LIBCXX@

# Compiler and linker flags used when building native tests
LDFLAGS_TESTEXE := @LDFLAGS_TESTEXE@

# BUILD_CC/BUILD_LD is a compiler/linker that generates code that is runnable on the
# build platform.
BUILD_CC := @BUILD_ICECC@ @BUILD_CC@
Expand Down Expand Up @@ -681,6 +677,10 @@ BUILD_JAR = @FIXPATH@ $(BUILD_JDK)/bin/jar

DOCS_REFERENCE_JAVADOC := @DOCS_REFERENCE_JAVADOC@

# A file containing a way to uniquely identify the source code revision that
# the build was created from
SOURCE_REVISION_TRACKER := $(SUPPORT_OUTPUTDIR)/src-rev/source-revision-tracker

# Interim langtools modules and arguments
INTERIM_LANGTOOLS_BASE_MODULES := java.compiler jdk.compiler jdk.javadoc
INTERIM_LANGTOOLS_MODULES := $(addsuffix .interim, $(INTERIM_LANGTOOLS_BASE_MODULES))
Expand Down
6 changes: 1 addition & 5 deletions make/autoconf/toolchain.m4
Original file line number Diff line number Diff line change
Expand Up @@ -953,11 +953,7 @@ AC_DEFUN_ONCE([TOOLCHAIN_MISC_CHECKS],
# Setup hotspot lecagy names for toolchains
HOTSPOT_TOOLCHAIN_TYPE=$TOOLCHAIN_TYPE
if test "x$TOOLCHAIN_TYPE" = xclang; then
if test "x$OPENJDK_TARGET_OS" = xaix; then
HOTSPOT_TOOLCHAIN_TYPE=xlc
else
HOTSPOT_TOOLCHAIN_TYPE=gcc
fi
HOTSPOT_TOOLCHAIN_TYPE=gcc
elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
HOTSPOT_TOOLCHAIN_TYPE=visCPP
fi
Expand Down
Loading

0 comments on commit bb92a84

Please sign in to comment.