Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite70257e

Browse files
author
duke
committed
Automatic merge of master into foreign-memaccess+abi
2 parents2f2ba24 +de06ab3 commite70257e

File tree

488 files changed

+11975
-5763
lines changed

Some content is hidden

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

488 files changed

+11975
-5763
lines changed

‎make/RunTests.gmk‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1157,6 +1157,7 @@ define SetupRunJtregTestBody
11571157
$$(EXPR) $$($1_PASSED) + $$($1_FAILED) + $$($1_ERROR) + $$($1_SKIPPED))) \
11581158
, \
11591159
$$(eval $1_PASSED_AND_RUNTIME_SKIPPED := 0) \
1160+
$$(eval $1_PASSED := 0) \
11601161
$$(eval $1_RUNTIME_SKIPPED := 0) \
11611162
$$(eval $1_SKIPPED := 0) \
11621163
$$(eval $1_FAILED := 0) \

‎make/autoconf/flags-cflags.m4‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,10 +282,17 @@ AC_DEFUN([FLAGS_SETUP_OPTIMIZATION],
282282
C_O_FLAG_DEBUG_JVM="-O0"
283283
C_O_FLAG_NONE="-O0"
284284
285+
if test "x$TOOLCHAIN_TYPE" = xgcc; then
286+
C_O_FLAG_LTO="-flto=auto -fuse-linker-plugin -fno-strict-aliasing -fno-fat-lto-objects"
287+
else
288+
C_O_FLAG_LTO="-flto -fno-strict-aliasing"
289+
fi
290+
285291
if test "x$TOOLCHAIN_TYPE" = xclang && test "x$OPENJDK_TARGET_OS" = xaix; then
286292
C_O_FLAG_HIGHEST_JVM="${C_O_FLAG_HIGHEST_JVM} -finline-functions"
287293
C_O_FLAG_HIGHEST="${C_O_FLAG_HIGHEST} -finline-functions"
288294
C_O_FLAG_HI="${C_O_FLAG_HI} -finline-functions"
295+
C_O_FLAG_LTO="${C_O_FLAG_LTO} -ffat-lto-objects"
289296
fi
290297
291298
# -D_FORTIFY_SOURCE=2 hardening option needs optimization (at least -O1) enabled
@@ -317,6 +324,7 @@ AC_DEFUN([FLAGS_SETUP_OPTIMIZATION],
317324
C_O_FLAG_DEBUG_JVM=""
318325
C_O_FLAG_NONE="-Od"
319326
C_O_FLAG_SIZE="-O1"
327+
C_O_FLAG_LTO="-GL"
320328
fi
321329
322330
# Now copy to C++ flags
@@ -328,6 +336,7 @@ AC_DEFUN([FLAGS_SETUP_OPTIMIZATION],
328336
CXX_O_FLAG_DEBUG_JVM="$C_O_FLAG_DEBUG_JVM"
329337
CXX_O_FLAG_NONE="$C_O_FLAG_NONE"
330338
CXX_O_FLAG_SIZE="$C_O_FLAG_SIZE"
339+
CXX_O_FLAG_LTO="$C_O_FLAG_LTO"
331340
332341
# Adjust optimization flags according to debug level.
333342
case $DEBUG_LEVEL in
@@ -360,12 +369,15 @@ AC_DEFUN([FLAGS_SETUP_OPTIMIZATION],
360369
AC_SUBST(C_O_FLAG_NORM)
361370
AC_SUBST(C_O_FLAG_NONE)
362371
AC_SUBST(C_O_FLAG_SIZE)
372+
AC_SUBST(C_O_FLAG_LTO)
373+
363374
AC_SUBST(CXX_O_FLAG_HIGHEST_JVM)
364375
AC_SUBST(CXX_O_FLAG_HIGHEST)
365376
AC_SUBST(CXX_O_FLAG_HI)
366377
AC_SUBST(CXX_O_FLAG_NORM)
367378
AC_SUBST(CXX_O_FLAG_NONE)
368379
AC_SUBST(CXX_O_FLAG_SIZE)
380+
AC_SUBST(CXX_O_FLAG_LTO)
369381
])
370382

371383
AC_DEFUN([FLAGS_SETUP_CFLAGS],

‎make/autoconf/flags-ldflags.m4‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,14 @@ AC_DEFUN([FLAGS_SETUP_LDFLAGS_HELPER],
5050
# add -z,relro (mark relocations read only) for all libs
5151
# add -z,now ("full relro" - more of the Global Offset Table GOT is marked read only)
5252
# add --no-as-needed to disable default --as-needed link flag on some GCC toolchains
53+
# add --icf=all (Identical Code Folding — merges identical functions)
5354
BASIC_LDFLAGS="-Wl,-z,defs -Wl,-z,relro -Wl,-z,now -Wl,--no-as-needed -Wl,--exclude-libs,ALL"
55+
if test "x$LINKER_TYPE" = "xgold"; then
56+
if test x$DEBUG_LEVEL = xrelease; then
57+
BASIC_LDFLAGS="$BASIC_LDFLAGS -Wl,--icf=all"
58+
fi
59+
fi
60+
5461
# Linux : remove unused code+data in link step
5562
if test "x$ENABLE_LINKTIME_GC" = xtrue; then
5663
if test "x$OPENJDK_TARGET_CPU" = xs390x; then
@@ -61,13 +68,15 @@ AC_DEFUN([FLAGS_SETUP_LDFLAGS_HELPER],
6168
fi
6269
6370
BASIC_LDFLAGS_JVM_ONLY=""
71+
LDFLAGS_LTO="-flto=auto -fuse-linker-plugin -fno-strict-aliasing"
6472
6573
LDFLAGS_CXX_PARTIAL_LINKING="$MACHINE_FLAG -r"
6674
6775
elif test "x$TOOLCHAIN_TYPE" = xclang; then
6876
BASIC_LDFLAGS_JVM_ONLY="-mno-omit-leaf-frame-pointer -mstack-alignment=16 \
6977
-fPIC"
7078
79+
LDFLAGS_LTO="-flto=auto -fuse-linker-plugin -fno-strict-aliasing"
7180
LDFLAGS_CXX_PARTIAL_LINKING="$MACHINE_FLAG -r"
7281
7382
if test "x$OPENJDK_TARGET_OS" = xlinux; then
@@ -87,6 +96,7 @@ AC_DEFUN([FLAGS_SETUP_LDFLAGS_HELPER],
8796
BASIC_LDFLAGS="-opt:ref"
8897
BASIC_LDFLAGS_JDK_ONLY="-incremental:no"
8998
BASIC_LDFLAGS_JVM_ONLY="-opt:icf,8 -subsystem:windows"
99+
LDFLAGS_LTO="-LTCG:INCREMENTAL"
90100
fi
91101
92102
if (test "x$TOOLCHAIN_TYPE" = xgcc || test "x$TOOLCHAIN_TYPE" = xclang) \
@@ -148,6 +158,7 @@ AC_DEFUN([FLAGS_SETUP_LDFLAGS_HELPER],
148158
149159
# Export some intermediate variables for compatibility
150160
LDFLAGS_CXX_JDK="$DEBUGLEVEL_LDFLAGS_JDK_ONLY"
161+
AC_SUBST(LDFLAGS_LTO)
151162
AC_SUBST(LDFLAGS_CXX_JDK)
152163
AC_SUBST(LDFLAGS_CXX_PARTIAL_LINKING)
153164
])

‎make/autoconf/spec.gmk.template‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -513,12 +513,14 @@ C_O_FLAG_HI := @C_O_FLAG_HI@
513513
C_O_FLAG_NORM := @C_O_FLAG_NORM@
514514
C_O_FLAG_NONE := @C_O_FLAG_NONE@
515515
C_O_FLAG_SIZE := @C_O_FLAG_SIZE@
516+
C_O_FLAG_LTO := @C_O_FLAG_LTO@
516517
CXX_O_FLAG_HIGHEST_JVM := @CXX_O_FLAG_HIGHEST_JVM@
517518
CXX_O_FLAG_HIGHEST := @CXX_O_FLAG_HIGHEST@
518519
CXX_O_FLAG_HI := @CXX_O_FLAG_HI@
519520
CXX_O_FLAG_NORM := @CXX_O_FLAG_NORM@
520521
CXX_O_FLAG_NONE := @CXX_O_FLAG_NONE@
521522
CXX_O_FLAG_SIZE := @CXX_O_FLAG_SIZE@
523+
CXX_O_FLAG_LTO := @CXX_O_FLAG_LTO@
522524

523525
GENDEPS_FLAGS := @GENDEPS_FLAGS@
524526

@@ -587,6 +589,9 @@ LDFLAGS_CXX_JDK := @LDFLAGS_CXX_JDK@
587589
# LDFLAGS specific to partial linking.
588590
LDFLAGS_CXX_PARTIAL_LINKING := @LDFLAGS_CXX_PARTIAL_LINKING@
589591

592+
# LDFLAGS specific to link time optimization
593+
LDFLAGS_LTO := @LDFLAGS_LTO@
594+
590595
# Sometimes a different linker is needed for c++ libs
591596
LDCXX := @LDCXX@
592597
# The flags for linking libstdc++ linker.

‎make/autoconf/toolchain.m4‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -516,6 +516,7 @@ AC_DEFUN([TOOLCHAIN_EXTRACT_LD_VERSION],
516516
if[[[ "$LINKER_VERSION_STRING" == *gold*]]]; then
517517
[ LINKER_VERSION_NUMBER=`$ECHO $LINKER_VERSION_STRING | \
518518
$SED -e 's/.* \([0-9][0-9]*\(\.[0-9][0-9]*\)*\).*) .*/\1/'`]
519+
LINKER_TYPE=gold
519520
else
520521
[ LINKER_VERSION_NUMBER=`$ECHO $LINKER_VERSION_STRING | \
521522
$SED -e 's/.* \([0-9][0-9]*\(\.[0-9][0-9]*\)*\).*/\1/'`]

‎make/common/NativeCompilation.gmk‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ include native/Paths.gmk
9898
# SYSROOT_CFLAGS the compiler flags for using the specific sysroot
9999
# SYSROOT_LDFLAGS the linker flags for using the specific sysroot
100100
# OPTIMIZATION sets optimization level to NONE, LOW, HIGH, HIGHEST, HIGHEST_JVM, SIZE
101+
# LINK_TIME_OPTIMIZATION if set to true, enables link time optimization
101102
# DISABLED_WARNINGS_<toolchain> Disable the given warnings for the specified toolchain
102103
# DISABLED_WARNINGS_<toolchain>_<OS> Disable the given warnings for the specified
103104
# toolchain and target OS

‎make/common/native/Flags.gmk‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,11 @@ define SetupCompilerFlags
194194
$1_EXTRA_CXXFLAGS += $(CFLAGS_WARNINGS_ARE_ERRORS)
195195
endif
196196

197+
ifeq (true, $$($1_LINK_TIME_OPTIMIZATION))
198+
$1_EXTRA_CFLAGS += $(C_O_FLAG_LTO)
199+
$1_EXTRA_CXXFLAGS += $(CXX_O_FLAG_LTO)
200+
endif
201+
197202
ifeq (NONE, $$($1_OPTIMIZATION))
198203
$1_OPT_CFLAGS := $(C_O_FLAG_NONE)
199204
$1_OPT_CXXFLAGS := $(CXX_O_FLAG_NONE)
@@ -222,6 +227,10 @@ define SetupLinkerFlags
222227
# Pickup extra OPENJDK_TARGET_OS_TYPE, OPENJDK_TARGET_OS and TOOLCHAIN_TYPE
223228
# dependent variables for LDFLAGS and LIBS, and additionally the pair dependent
224229
# TOOLCHAIN_TYPE plus OPENJDK_TARGET_OS
230+
ifeq ($$($1_LINK_TIME_OPTIMIZATION), true)
231+
$1_EXTRA_LDFLAGS += $(LDFLAGS_LTO)
232+
endif
233+
225234
$1_EXTRA_LDFLAGS += $$($1_LDFLAGS_$(OPENJDK_TARGET_OS_TYPE)) $$($1_LDFLAGS_$(OPENJDK_TARGET_OS)) \
226235
$$($1_LDFLAGS_$(TOOLCHAIN_TYPE)) $$($1_LDFLAGS_$(TOOLCHAIN_TYPE)_$(OPENJDK_TARGET_OS))
227236
$1_EXTRA_LIBS += $$($1_LIBS_$(OPENJDK_TARGET_OS_TYPE)) $$($1_LIBS_$(OPENJDK_TARGET_OS)) \

‎make/hotspot/lib/CompileJvm.gmk‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,7 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBJVM, \
234234
LDFLAGS := $(JVM_LDFLAGS), \
235235
LIBS := $(JVM_LIBS), \
236236
OPTIMIZATION := $(JVM_OPTIMIZATION), \
237+
LINK_TIME_OPTIMIZATION := $(JVM_LTO), \
237238
OBJECT_DIR := $(JVM_OUTPUTDIR)/objs, \
238239
STRIPFLAGS := $(JVM_STRIPFLAGS), \
239240
EMBED_MANIFEST := true, \

‎make/hotspot/lib/JvmFeatures.gmk‎

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -175,22 +175,12 @@ ifeq ($(call check-jvm-feature, link-time-opt), true)
175175
# Set JVM_OPTIMIZATION directly so other jvm-feature flags can override it
176176
# later on if desired
177177
JVM_OPTIMIZATION := HIGHEST_JVM
178-
ifeq ($(call isCompiler, gcc), true)
179-
JVM_CFLAGS_FEATURES += -flto=auto -fuse-linker-plugin -fno-strict-aliasing \
180-
-fno-fat-lto-objects
181-
JVM_LDFLAGS_FEATURES += $(CXX_O_FLAG_HIGHEST_JVM) -flto=auto \
182-
-fuse-linker-plugin -fno-strict-aliasing
183-
else ifeq ($(call isCompiler, clang), true)
184-
JVM_CFLAGS_FEATURES += -flto -fno-strict-aliasing
185-
ifeq ($(call isBuildOs, aix), true)
186-
JVM_CFLAGS_FEATURES += -ffat-lto-objects
187-
endif
188-
JVM_LDFLAGS_FEATURES += $(CXX_O_FLAG_HIGHEST_JVM) -flto -fno-strict-aliasing
189-
else ifeq ($(call isCompiler, microsoft), true)
190-
JVM_CFLAGS_FEATURES += -GL
191-
JVM_LDFLAGS_FEATURES += -LTCG:INCREMENTAL
178+
JVM_LTO := true
179+
ifneq ($(call isCompiler, microsoft), true)
180+
JVM_LDFLAGS_FEATURES += $(CXX_O_FLAG_HIGHEST_JVM)
192181
endif
193182
else
183+
JVM_LTO := false
194184
ifeq ($(call isCompiler, gcc), true)
195185
JVM_LDFLAGS_FEATURES += -O1
196186
endif

‎make/modules/java.desktop/lib/ClientLibraries.gmk‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,7 @@ ifeq ($(ENABLE_HEADLESS_ONLY), false)
226226
EXCLUDE_FILES := imageioJPEG.c jpegdecoder.c pngtest.c, \
227227
EXCLUDES := $(LIBSPLASHSCREEN_EXCLUDES), \
228228
OPTIMIZATION := SIZE, \
229+
LINK_TIME_OPTIMIZATION := true, \
229230
CFLAGS := $(LIBSPLASHSCREEN_CFLAGS) \
230231
$(GIFLIB_CFLAGS) $(LIBJPEG_CFLAGS) $(PNG_CFLAGS) $(LIBZ_CFLAGS) \
231232
$(ICONV_CFLAGS), \

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp