RFR: 8345265: Fix gcc LTO without disabling LTO for g1ParScanThreadState.cpp [v2]
Julian Waters
jwaters at openjdk.org
Tue Dec 17 14:54:03 UTC 2024
> [JDK-8343698](https://bugs.openjdk.org/browse/JDK-8343698) fixed LTO for gcc when compiling for platforms where the FORBID_C_FUNCTION mechanism is active, however the fix does so by inhibiting LTO for a specific file. This can hinder optimization, which is the end goal if one is indeed doing an LTO build. Fix the issue in a different way by disabling FORBID_C_FUNCTION entirely for os.cpp, which is where the error originates. This has a wide downstream effect, as os.cpp contains a call to os::malloc which contains the forbidden malloc that causes errors that cannot be suppressed by ALLOW_C_FUNCTION in an LTO build. This is a stopgap fix until FORBID_C_FUNCTION is fixed to work properly with LTO on all platforms. While here, also fix a memory leak in jvmciEnv.cpp
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/00943376...9d05cb8e
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/22464/files
- new: https://git.openjdk.org/jdk/pull/22464/files/a357017f..9d05cb8e
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=22464&range=01
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=22464&range=00-01
Stats: 77380 lines in 3812 files changed: 58525 ins; 10150 del; 8705 mod
Patch: https://git.openjdk.org/jdk/pull/22464.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/22464/head:pull/22464
PR: https://git.openjdk.org/jdk/pull/22464
More information about the build-dev
mailing list