Skip to content

Commit a0b752d

Browse files
authored
Merge pull request SAP#2067 from SAP/pr-jdk-26+17
Merge to tag jdk-26+17
2 parents 0fc521a + 2aafda1 commit a0b752d

File tree

1,111 files changed

+121294
-15064
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,111 files changed

+121294
-15064
lines changed

make/Hsdis.gmk

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,6 @@ ifeq ($(HSDIS_BACKEND), binutils)
114114
TOOLCHAIN_TYPE := gcc
115115
OPENJDK_TARGET_OS := linux
116116
OPENJDK_TARGET_OS_TYPE := unix
117-
CC_OUT_OPTION := -o$(SPACE)
118117
GENDEPS_FLAGS := -MMD -MF
119118
CFLAGS_DEBUG_SYMBOLS := -g
120119
DISABLED_WARNINGS :=

make/autoconf/boot-jdk.m4

Lines changed: 7 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -597,51 +597,25 @@ AC_DEFUN([BOOTJDK_SETUP_BUILD_JDK],
597597
AC_ARG_WITH(build-jdk, [AS_HELP_STRING([--with-build-jdk],
598598
[path to JDK of same version as is being built@<:@the newly built JDK@:>@])])
599599
600-
CREATE_BUILDJDK=false
601-
EXTERNAL_BUILDJDK=false
602-
BUILD_JDK_FOUND="no"
600+
EXTERNAL_BUILDJDK_PATH=""
603601
if test "x$with_build_jdk" != "x"; then
602+
BUILD_JDK_FOUND=no
604603
BOOTJDK_CHECK_BUILD_JDK([
605604
if test "x$with_build_jdk" != x; then
606605
BUILD_JDK=$with_build_jdk
607606
BUILD_JDK_FOUND=maybe
608607
AC_MSG_NOTICE([Found potential Build JDK using configure arguments])
609608
fi
610609
])
611-
EXTERNAL_BUILDJDK=true
612-
else
613-
if test "x$COMPILE_TYPE" = "xcross"; then
614-
BUILD_JDK="\$(BUILDJDK_OUTPUTDIR)/jdk"
615-
BUILD_JDK_FOUND=yes
616-
CREATE_BUILDJDK=true
617-
AC_MSG_CHECKING([for Build JDK])
618-
AC_MSG_RESULT([yes, will build it for the host platform])
619-
else
620-
BUILD_JDK="\$(JDK_OUTPUTDIR)"
621-
BUILD_JDK_FOUND=yes
610+
if test "x$BUILD_JDK_FOUND" != "xyes"; then
622611
AC_MSG_CHECKING([for Build JDK])
623-
AC_MSG_RESULT([yes, will use output dir])
612+
AC_MSG_RESULT([no])
613+
AC_MSG_ERROR([Could not find a suitable Build JDK])
624614
fi
615+
EXTERNAL_BUILDJDK_PATH="$BUILD_JDK"
625616
fi
626617
627-
# Since these tools do not yet exist, we cannot use UTIL_FIXUP_EXECUTABLE to
628-
# detect the need of fixpath
629-
JMOD="$BUILD_JDK/bin/jmod"
630-
UTIL_ADD_FIXPATH(JMOD)
631-
JLINK="$BUILD_JDK/bin/jlink"
632-
UTIL_ADD_FIXPATH(JLINK)
633-
AC_SUBST(JMOD)
634-
AC_SUBST(JLINK)
635-
636-
if test "x$BUILD_JDK_FOUND" != "xyes"; then
637-
AC_MSG_CHECKING([for Build JDK])
638-
AC_MSG_RESULT([no])
639-
AC_MSG_ERROR([Could not find a suitable Build JDK])
640-
fi
641-
642-
AC_SUBST(CREATE_BUILDJDK)
643-
AC_SUBST(BUILD_JDK)
644-
AC_SUBST(EXTERNAL_BUILDJDK)
618+
AC_SUBST(EXTERNAL_BUILDJDK_PATH)
645619
])
646620

647621
# The docs-reference JDK is used to run javadoc for the docs-reference targets.

make/autoconf/flags-cflags.m4

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -37,56 +37,25 @@ AC_DEFUN([FLAGS_SETUP_SHARED_LIBS],
3737
if test "x$TOOLCHAIN_TYPE" = xgcc; then
3838
# Default works for linux, might work on other platforms as well.
3939
SHARED_LIBRARY_FLAGS='-shared'
40-
# --disable-new-dtags forces use of RPATH instead of RUNPATH for rpaths.
41-
# This protects internal library dependencies within the JDK from being
42-
# overridden using LD_LIBRARY_PATH. See JDK-8326891 for more information.
43-
SET_EXECUTABLE_ORIGIN='-Wl,-rpath,\$$ORIGIN[$]1 -Wl,--disable-new-dtags'
44-
SET_SHARED_LIBRARY_ORIGIN="-Wl,-z,origin $SET_EXECUTABLE_ORIGIN"
45-
SET_SHARED_LIBRARY_NAME='-Wl,-soname=[$]1'
4640
4741
elif test "x$TOOLCHAIN_TYPE" = xclang; then
4842
if test "x$OPENJDK_TARGET_OS" = xmacosx; then
4943
# Linking is different on MacOSX
5044
SHARED_LIBRARY_FLAGS="-dynamiclib -compatibility_version 1.0.0 -current_version 1.0.0"
51-
SET_EXECUTABLE_ORIGIN='-Wl,-rpath,@loader_path$(or [$]1,/.)'
52-
SET_SHARED_LIBRARY_ORIGIN="$SET_EXECUTABLE_ORIGIN"
53-
SET_SHARED_LIBRARY_NAME='-Wl,-install_name,@rpath/[$]1'
5445
5546
elif test "x$OPENJDK_TARGET_OS" = xaix; then
5647
# Linking is different on aix
5748
SHARED_LIBRARY_FLAGS="-shared -Wl,-bM:SRE -Wl,-bnoentry"
58-
SET_EXECUTABLE_ORIGIN=""
59-
SET_SHARED_LIBRARY_ORIGIN=''
60-
SET_SHARED_LIBRARY_NAME=''
6149
6250
else
6351
# Default works for linux, might work on other platforms as well.
6452
SHARED_LIBRARY_FLAGS='-shared'
65-
SET_EXECUTABLE_ORIGIN='-Wl,-rpath,\$$ORIGIN[$]1'
66-
if test "x$OPENJDK_TARGET_OS" = xlinux; then
67-
SET_EXECUTABLE_ORIGIN="$SET_EXECUTABLE_ORIGIN -Wl,--disable-new-dtags"
68-
fi
69-
SET_SHARED_LIBRARY_NAME='-Wl,-soname=[$]1'
70-
71-
# arm specific settings
72-
if test "x$OPENJDK_TARGET_CPU" = "xarm"; then
73-
# '-Wl,-z,origin' isn't used on arm.
74-
SET_SHARED_LIBRARY_ORIGIN='-Wl,-rpath,\$$$$ORIGIN[$]1'
75-
else
76-
SET_SHARED_LIBRARY_ORIGIN="-Wl,-z,origin $SET_EXECUTABLE_ORIGIN"
77-
fi
7853
fi
7954
8055
elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
8156
SHARED_LIBRARY_FLAGS="-dll"
82-
SET_EXECUTABLE_ORIGIN=''
83-
SET_SHARED_LIBRARY_ORIGIN=''
84-
SET_SHARED_LIBRARY_NAME=''
8557
fi
8658
87-
AC_SUBST(SET_EXECUTABLE_ORIGIN)
88-
AC_SUBST(SET_SHARED_LIBRARY_ORIGIN)
89-
AC_SUBST(SET_SHARED_LIBRARY_NAME)
9059
AC_SUBST(SHARED_LIBRARY_FLAGS)
9160
])
9261

make/autoconf/flags-ldflags.m4

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ AC_DEFUN([FLAGS_SETUP_LDFLAGS_HELPER],
9898
9999
# Setup OS-dependent LDFLAGS
100100
if test "x$OPENJDK_TARGET_OS" = xmacosx && test "x$TOOLCHAIN_TYPE" = xclang; then
101-
# FIXME: We should really generalize SET_SHARED_LIBRARY_ORIGIN instead.
101+
# FIXME: We should really generalize SetSharedLibraryOrigin instead.
102102
OS_LDFLAGS_JVM_ONLY="-Wl,-rpath,@loader_path/. -Wl,-rpath,@loader_path/.."
103103
OS_LDFLAGS="-mmacosx-version-min=$MACOSX_VERSION_MIN -Wl,-reproducible"
104104
fi

make/autoconf/flags.m4

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2011, 2025, Oracle and/or its affiliates. All rights reserved.
33
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
#
55
# This code is free software; you can redistribute it and/or modify it
@@ -319,16 +319,10 @@ AC_DEFUN_ONCE([FLAGS_PRE_TOOLCHAIN],
319319
AC_DEFUN([FLAGS_SETUP_TOOLCHAIN_CONTROL],
320320
[
321321
if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
322-
CC_OUT_OPTION=-Fo
323322
if test "x$OPENJDK_TARGET_CPU" != xaarch64; then
324323
AS_NON_ASM_EXTENSION_OPTION=-Ta
325324
fi
326-
else
327-
# The option used to specify the target .o,.a or .so file.
328-
# When compiling, how to specify the to be created object file.
329-
CC_OUT_OPTION='-o$(SPACE)'
330325
fi
331-
AC_SUBST(CC_OUT_OPTION)
332326
AC_SUBST(AS_NON_ASM_EXTENSION_OPTION)
333327
334328
# Generate make dependency files

make/autoconf/lib-tests.m4

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
################################################################################
2929

3030
# Minimum supported versions
31-
JTREG_MINIMUM_VERSION=7.5.2
31+
JTREG_MINIMUM_VERSION=8
3232
GTEST_MINIMUM_VERSION=1.14.0
3333

3434
################################################################################

make/autoconf/spec.gmk.template

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -386,9 +386,22 @@ CAPSTONE_ARCH_AARCH64_NAME := @CAPSTONE_ARCH_AARCH64_NAME@
386386
# it in sync.
387387
BOOT_JDK := @BOOT_JDK@
388388

389-
BUILD_JDK := @BUILD_JDK@
390-
CREATE_BUILDJDK := @CREATE_BUILDJDK@
391-
EXTERNAL_BUILDJDK := @EXTERNAL_BUILDJDK@
389+
EXTERNAL_BUILDJDK_PATH := @EXTERNAL_BUILDJDK_PATH@
390+
391+
ifneq ($(EXTERNAL_BUILDJDK_PATH), )
392+
EXTERNAL_BUILDJDK := true
393+
CREATE_BUILDJDK := false
394+
BUILD_JDK := $(EXTERNAL_BUILDJDK_PATH)
395+
else
396+
EXTERNAL_BUILDJDK := false
397+
ifeq ($(COMPILE_TYPE), cross)
398+
CREATE_BUILDJDK := true
399+
BUILD_JDK := $(BUILDJDK_OUTPUTDIR)/jdk
400+
else
401+
CREATE_BUILDJDK := false
402+
BUILD_JDK := $(JDK_OUTPUTDIR)
403+
endif
404+
endif
392405

393406
# Whether the boot jdk jar supports --date=TIMESTAMP
394407
BOOT_JDK_JAR_SUPPORTS_DATE := @BOOT_JDK_JAR_SUPPORTS_DATE@
@@ -500,7 +513,6 @@ CXX_VERSION_NUMBER := @CXX_VERSION_NUMBER@
500513
# Legacy support
501514
HOTSPOT_TOOLCHAIN_TYPE := @HOTSPOT_TOOLCHAIN_TYPE@
502515

503-
CC_OUT_OPTION := @CC_OUT_OPTION@
504516
AS_NON_ASM_EXTENSION_OPTION := @AS_NON_ASM_EXTENSION_OPTION@
505517

506518
# Flags used for overriding the default opt setting for a C/C++ source file.
@@ -633,17 +645,8 @@ ASFLAGS_DEBUG_SYMBOLS := @ASFLAGS_DEBUG_SYMBOLS@
633645
# Compress (or not) jars
634646
COMPRESS_JARS := @COMPRESS_JARS@
635647

636-
# Options to linker to specify the library name.
637-
# (Note absence of := assignment, because we do not want to evaluate the macro body here)
638-
SET_SHARED_LIBRARY_NAME = @SET_SHARED_LIBRARY_NAME@
639-
640648
SHARED_LIBRARY_FLAGS := @SHARED_LIBRARY_FLAGS@
641649

642-
# Set origin using the linker, ie use the relative path to the dependent library to find the dependencies.
643-
# (Note absence of := assignment, because we do not want to evaluate the macro body here)
644-
SET_SHARED_LIBRARY_ORIGIN = @SET_SHARED_LIBRARY_ORIGIN@
645-
SET_EXECUTABLE_ORIGIN = @SET_EXECUTABLE_ORIGIN@
646-
647650
LIBRARY_PREFIX := @LIBRARY_PREFIX@
648651
SHARED_LIBRARY_SUFFIX := @SHARED_LIBRARY_SUFFIX@
649652
STATIC_LIBRARY_SUFFIX := @STATIC_LIBRARY_SUFFIX@
@@ -666,8 +669,8 @@ JAVA_CMD := @JAVA@
666669
JAVAC_CMD := @JAVAC@
667670
JAVADOC_CMD := @JAVADOC@
668671
JAR_CMD := @JAR@
669-
JLINK_CMD := @JLINK@
670-
JMOD_CMD := @JMOD@
672+
JLINK_CMD := @FIXPATH@ $(BUILD_JDK)/bin/jlink
673+
JMOD_CMD := @FIXPATH@ $(BUILD_JDK)/bin/jmod
671674
# These variables are meant to be used. They are defined with = instead of := to make
672675
# it possible to override only the *_CMD variables.
673676
JAVA = $(JAVA_CMD) $(JAVA_FLAGS_BIG) $(JAVA_FLAGS)

make/common/Execute.gmk

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,9 +148,12 @@ define SetupExecuteBody
148148
$1_INFO := Running commands for $1
149149
endif
150150

151+
$1_VARDEPS := $$($1_COMMAND) $$($1_PRE_COMMAND) $$($1_POST_COMMAND)
152+
$1_VARDEPS_FILE := $$(call DependOnVariable, $1_VARDEPS)
153+
151154
ifneq ($$($1_PRE_COMMAND), )
152155

153-
$$($1_PRE_MARKER): $$($1_DEPS)
156+
$$($1_PRE_MARKER): $$($1_DEPS) $$($1_VARDEPS_FILE)
154157
ifneq ($$($1_WARN), )
155158
$$(call LogWarn, $$($1_WARN))
156159
endif
@@ -176,7 +179,7 @@ define SetupExecuteBody
176179

177180
$1 := $$($1_PRE_MARKER) $$($1_EXEC_RESULT)
178181
else
179-
$$($1_EXEC_RESULT): $$($1_DEPS)
182+
$$($1_EXEC_RESULT): $$($1_DEPS) $$($1_VARDEPS_FILE)
180183
ifneq ($$($1_WARN), )
181184
$$(call LogWarn, $$($1_WARN))
182185
endif

make/common/JdkNativeCompilation.gmk

Lines changed: 43 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,47 @@ ifeq ($(INCLUDE), true)
3030

3131
include NativeCompilation.gmk
3232

33+
ifeq ($(call isCompiler, gcc), true)
34+
# --disable-new-dtags forces use of RPATH instead of RUNPATH for rpaths.
35+
# This protects internal library dependencies within the JDK from being
36+
# overridden using LD_LIBRARY_PATH. See JDK-8326891 for more information.
37+
SetExecutableOrigin = \
38+
-Wl,-rpath,\$(DOLLAR)ORIGIN$1 -Wl,--disable-new-dtags
39+
SetSharedLibraryOrigin = \
40+
-Wl,-z,origin -Wl,-rpath,\$(DOLLAR)ORIGIN$1 -Wl,--disable-new-dtags
41+
else ifeq ($(call isCompiler, clang), true)
42+
ifeq ($(call isTargetOs, macosx), true)
43+
SetExecutableOrigin = \
44+
-Wl,-rpath,@loader_path$(or $1,/.)
45+
SetSharedLibraryOrigin = \
46+
-Wl,-rpath,@loader_path$(or $1,/.)
47+
else ifeq ($(call isTargetOs, aix), true)
48+
SetExecutableOrigin =
49+
SetSharedLibraryOrigin =
50+
else
51+
ifeq ($(call isTargetOs, linux), true)
52+
SetExecutableOrigin = \
53+
-Wl,-rpath,\$(DOLLAR)ORIGIN$1 -Wl,--disable-new-dtags
54+
else
55+
SetExecutableOrigin = \
56+
-Wl,-rpath,\$(DOLLAR)ORIGIN$1
57+
endif
58+
59+
ifeq ($(call isTargetOs, arm), true)
60+
SetSharedLibraryOrigin = \
61+
-Wl,-rpath,\$(DOLLAR)ORIGIN$1
62+
else
63+
SetSharedLibraryOrigin = \
64+
-Wl,-z,origin -Wl,-rpath,\$(DOLLAR)ORIGIN$1
65+
endif
66+
endif
67+
else ifeq ($(call isCompiler, microsoft), true)
68+
SetExecutableOrigin =
69+
SetSharedLibraryOrigin =
70+
else
71+
$(error Unknown toolchain)
72+
endif
73+
3374
FindSrcDirsForComponent += \
3475
$(call uniq, $(wildcard \
3576
$(TOPDIR)/src/$(strip $1)/$(OPENJDK_TARGET_OS)/native/$(strip $2) \
@@ -444,9 +485,9 @@ define SetupJdkNativeCompilationBody
444485

445486
ifneq ($$($1_LD_SET_ORIGIN), false)
446487
ifeq ($$($1_TYPE), EXECUTABLE)
447-
$1_LDFLAGS += $$(call SET_EXECUTABLE_ORIGIN)
488+
$1_LDFLAGS += $$(call SetExecutableOrigin)
448489
else
449-
$1_LDFLAGS += $$(call SET_SHARED_LIBRARY_ORIGIN)
490+
$1_LDFLAGS += $$(call SetSharedLibraryOrigin)
450491
endif
451492
endif
452493
# APPEND_LDFLAGS, if it exists, must be set after the origin flags

make/common/modules/LauncherCommon.gmk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,8 @@ define SetupBuildLauncherBody
156156
DISABLED_WARNINGS_gcc := unused-function unused-variable, \
157157
DISABLED_WARNINGS_clang := unused-function, \
158158
LDFLAGS := $$($1_LDFLAGS), \
159-
LDFLAGS_linux := $$(call SET_EXECUTABLE_ORIGIN,/../lib), \
160-
LDFLAGS_macosx := $$(call SET_EXECUTABLE_ORIGIN,/../lib), \
159+
LDFLAGS_linux := $$(call SetExecutableOrigin,/../lib), \
160+
LDFLAGS_macosx := $$(call SetExecutableOrigin,/../lib), \
161161
LDFLAGS_FILTER_OUT := $$($1_LDFLAGS_FILTER_OUT), \
162162
JDK_LIBS := $$($1_JDK_LIBS), \
163163
JDK_LIBS_windows := $$($1_JDK_LIBS_windows), \

0 commit comments

Comments
 (0)