RFR: 8345265: Fix gcc LTO without disabling LTO for g1ParScanThreadState.cpp
Julian Waters
jwaters at openjdk.org
Tue Dec 17 14:54:04 UTC 2024
On Sat, 30 Nov 2024 00:35:59 GMT, Julian Waters <jwaters at openjdk.org> wrote:
> [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
This needs a name and description change, I'll do so later. @MBaesken does this fix LTO on your end? Kim also reports that LTO hangs indefinitely alongside several warning messages, do you have similar issues when you try to enable LTO?
Reverted the change in compilerWarnings_gcc.hpp since it was causing problems like Matthias reported. This still needs a title and description change since it now tries to improve LTO for all compilers, will do that later
-------------
PR Comment: https://git.openjdk.org/jdk/pull/22464#issuecomment-2525421248
PR Comment: https://git.openjdk.org/jdk/pull/22464#issuecomment-2548658789
More information about the build-dev
mailing list