On Tue, 17 Dec 2024 14:54:03 GMT, Julian Waters <jwat...@openjdk.org> wrote:
>> This is a general cleanup and improvement of LTO, as well as a quick fix to >> remove a workaround in the Makefiles that disabled LTO for >> g1ParScanThreadState.cpp due to the old poisoning mechanism causing trouble. >> The -Wno-attribute-warning change here can be removed once Kim's new >> poisoning solution is integrated. >> >> - -fno-omit-frame-pointer is added to gcc to stop the linker from emitting >> code without the frame pointer >> - -flto is set to $(JOBS) instead of auto to better match what the user >> requested >> - -Gy is passed to the Microsoft compiler. This does not fully fix LTO under >> Microsoft, but prevents warnings about -LTCG:INCREMENTAL at least > > Julian Waters has updated the pull request with a new target base due to a > merge or a rebase. The incremental webrev excludes the unrelated changes > brought in by the merge/rebase. The pull request contains 12 additional > commits since the last revision: > > - Merge branch 'openjdk:master' into patch-16 > - -fno-omit-frame-pointer in JvmFeatures.gmk > - Revert compilerWarnings_gcc.hpp > - General LTO fixes JvmFeatures.gmk > - Revert DISABLE_POISONING_STOPGAP compilerWarnings_gcc.hpp > - Merge branch 'openjdk:master' into patch-16 > - Revert os.cpp > - Fix memory leak in jvmciEnv.cpp > - Stopgap fix in os.cpp > - Declaration fix in compilerWarnings_gcc.hpp > - ... and 2 more: https://git.openjdk.org/jdk/compare/2c3c6c41...9d05cb8e When setting -fno-use-linker-plugin and removing also -fno-fat-lto-objects , the error above goes away. but we get a ton of other errors src/hotspot/share/gc/g1/g1ParScanThreadState.cpp:663: error: undefined reference to 'G1NUMA::is_enabled() const' src/hotspot/share/gc/g1/g1ParScanThreadState.cpp:667: error: undefined reference to 'G1NUMA::num_active_nodes() const' src/hotspot/share/gc/g1/g1ParScanThreadState.cpp:669: error: undefined reference to 'AllocateHeap(unsigned long, MemTag, AllocFailStrategy::AllocFailEnum)' src/hotspot/share/gc/g1/g1ParScanThreadState.cpp:116: error: undefined reference to 'G1RedirtyCardsLocalQueueSet::flush()' src/hotspot/share/gc/g1/g1ParScanThreadState.cpp:677: error: undefined reference to 'G1NUMA::index_of_current_thread() const' src/hotspot/share/gc/g1/g1ParScanThreadState.cpp:678: error: undefined reference to 'G1NUMA::copy_statistics(G1NUMAStats::NodeDataItems, unsigned int, unsigned long*)' src/hotspot/share/gc/g1/g1ParScanThreadState.cpp:119: error: undefined reference to 'G1PLABAllocator::flush_and_retire_stats(unsigned int)' src/hotspot/share/gc/g1/g1Policy.hpp:427: error: undefined reference to 'AgeTable::merge(AgeTable const*)' src/hotspot/share/gc/g1/g1ParScanThreadState.cpp:123: error: undefined reference to 'G1NewTracer::report_evacuation_failed(EvacuationFailedInfo&)' src/hotspot/share/gc/g1/g1Allocator.inline.hpp:116: error: undefined reference to 'G1PLABAllocator::allocate_direct_or_new_plab(G1HeapRegionAttr, unsigned long, bool*, unsigned int)' src/hotspot/share/gc/g1/g1ParScanThreadState.cpp:384: error: undefined reference to 'G1PLABAllocator::allocate_direct_or_new_plab(G1HeapRegionAttr, unsigned long, bool*, unsigned int)' src/hotspot/share/gc/g1/g1ParScanThreadState.cpp:397: error: undefined reference to 'YoungGCTracer::should_report_promotion_events() const' src/hotspot/share/gc/g1/g1Allocator.inline.hpp:116: error: undefined reference to 'G1PLABAllocator::allocate_direct_or_new_plab(G1HeapRegionAttr, unsigned long, bool*, unsigned int)' src/hotspot/share/gc/shared/cardTable.hpp:184: error: undefined reference to 'CardTable::_card_size' src/hotspot/share/gc/g1/g1CollectedHeap.inline.hpp:126: error: undefined reference to 'G1HeapRegion::LogOfHRGrainBytes' src/hotspot/share/gc/g1/g1CollectedHeap.inline.hpp:79: error: undefined reference to 'G1Policy::phase_times() const' src/hotspot/share/gc/g1/g1ParScanThreadState.cpp:143: error: undefined reference to 'G1PLABAllocator::waste() const' src/hotspot/share/gc/g1/g1ParScanThreadState.cpp:147: error: undefined reference to 'G1PLABAllocator::undo_waste() const' and src/hotspot/os/linux/mallocInfoDcmd.cpp: In member function 'execute': src/hotspot/os/linux/mallocInfoDcmd.cpp:57:3: warning: call to 'free' declared with attribute warning: use os::free [-Wattribute-warning] In member function '__dt_base ', inlined from 'c2v_getLocalVariableTableLength' at src/hotspot/share/jvmci/jvmciCompilerToVM.cpp:1348:1: src/hotspot/share/jvmci/jvmciEnv.cpp:615:5: warning: call to 'free' declared with attribute warning: use os::free [-Wattribute-warning] In member function '__dt_base ', inlined from 'c2v_getCountersSize' at src/hotspot/share/jvmci/jvmciCompilerToVM.cpp:1403:1: src/hotspot/share/jvmci/jvmciEnv.cpp:615:5: warning: call to 'free' declared with attribute warning: use os::free [-Wattribute-warning] In member function '__dt_base ', inlined from 'c2v_setCountersSize' at src/hotspot/share/jvmci/jvmciCompilerToVM.cpp:1407:1: src/hotspot/share/jvmci/jvmciEnv.cpp:615:5: warning: call to 'free' declared with attribute warning: use os::free [-Wattribute-warning] In member function '__dt_base ', inlined from 'c2v_isMature' at src/hotspot/share/jvmci/jvmciCompilerToVM.cpp:1425:1: src/hotspot/share/jvmci/jvmciEnv.cpp:615:5: warning: call to 'free' declared with attribute warning: use os::free [-Wattribute-warning] In member function '__dt_base ', ... (rest of output omitted) (some examples) ; so this does not work (at least with gcc-14) . ------------- PR Comment: https://git.openjdk.org/jdk/pull/22464#issuecomment-2769734227