8304893: Link Time Optimization with gcc can be faster

Reviewed-by: dholmes, erikj
This commit is contained in:
Julian Waters 2023-04-02 06:54:09 +00:00
parent b8c748dbe4
commit aa762102e9
2 changed files with 7 additions and 3 deletions

View File

@ -70,7 +70,7 @@ AC_DEFUN([FLAGS_SETUP_LDFLAGS_HELPER],
fi
fi
BASIC_LDFLAGS_JVM_ONLY="-Wl,-O1"
BASIC_LDFLAGS_JVM_ONLY=""
elif test "x$TOOLCHAIN_TYPE" = xclang; then
BASIC_LDFLAGS_JVM_ONLY="-mno-omit-leaf-frame-pointer -mstack-alignment=16 \

View File

@ -169,8 +169,12 @@ ifeq ($(call check-jvm-feature, link-time-opt), true)
# later on if desired
JVM_OPTIMIZATION := HIGHEST_JVM
ifeq ($(call isCompiler, gcc), true)
JVM_CFLAGS_FEATURES += -flto -fuse-linker-plugin
JVM_LDFLAGS_FEATURES += -flto -fuse-linker-plugin -fno-strict-aliasing
JVM_CFLAGS_FEATURES += -flto=auto -fuse-linker-plugin -fno-strict-aliasing -fno-fat-lto-objects
JVM_LDFLAGS_FEATURES += $(CXX_O_FLAG_HIGHEST_JVM) -flto=auto -fuse-linker-plugin -fno-strict-aliasing
endif
else
ifeq ($(call isCompiler, gcc), true)
JVM_LDFLAGS_FEATURES += -O1
endif
endif