diff --git a/make/hotspot/lib/JvmFeatures.gmk b/make/hotspot/lib/JvmFeatures.gmk index b94031515f7..09a48508eff 100644 --- a/make/hotspot/lib/JvmFeatures.gmk +++ b/make/hotspot/lib/JvmFeatures.gmk @@ -174,6 +174,12 @@ ifeq ($(call check-jvm-feature, link-time-opt), true) -fno-fat-lto-objects JVM_LDFLAGS_FEATURES += $(CXX_O_FLAG_HIGHEST_JVM) -flto=auto \ -fuse-linker-plugin -fno-strict-aliasing + else ifeq ($(call isCompiler, clang), true) + JVM_CFLAGS_FEATURES += -flto -fno-strict-aliasing + ifeq ($(call isBuildOs, aix), true) + JVM_CFLAGS_FEATURES += -ffat-lto-objects + endif + JVM_LDFLAGS_FEATURES += $(CXX_O_FLAG_HIGHEST_JVM) -flto -fno-strict-aliasing else ifeq ($(call isCompiler, microsoft), true) JVM_CFLAGS_FEATURES += -GL JVM_LDFLAGS_FEATURES += -LTCG:INCREMENTAL diff --git a/src/hotspot/os_cpu/bsd_aarch64/os_bsd_aarch64.cpp b/src/hotspot/os_cpu/bsd_aarch64/os_bsd_aarch64.cpp index 7702dbd17ad..1e3602d08f4 100644 --- a/src/hotspot/os_cpu/bsd_aarch64/os_bsd_aarch64.cpp +++ b/src/hotspot/os_cpu/bsd_aarch64/os_bsd_aarch64.cpp @@ -501,6 +501,7 @@ static inline void atomic_copy64(const volatile void *src, volatile void *dst) { } extern "C" { + // needs local assembler label '1:' to avoid trouble when using linktime optimization int SpinPause() { // We don't use StubRoutines::aarch64::spin_wait stub in order to // avoid a costly call to os::current_thread_enable_wx() on MacOS. @@ -523,14 +524,14 @@ extern "C" { // to entry for case SpinWait::NOP " add %[d], %[d], %[o] \n" " br %[d] \n" - " b SpinPause_return \n" // case SpinWait::NONE (-1) + " b 1f \n" // case SpinWait::NONE (-1) " nop \n" // padding " nop \n" // case SpinWait::NOP ( 0) - " b SpinPause_return \n" + " b 1f \n" " isb \n" // case SpinWait::ISB ( 1) - " b SpinPause_return \n" + " b 1f \n" " yield \n" // case SpinWait::YIELD ( 2) - "SpinPause_return: \n" + "1: \n" : [d]"=&r"(br_dst) : [o]"r"(off) : "memory");