RFR: 8297606: [AIX] Broken build after JDK-8295475

Kim Barrett kbarrett at openjdk.org
Thu Dec 1 10:54:26 UTC 2022


On Wed, 30 Nov 2022 21:19:35 GMT, Tyler Steele <tsteele at openjdk.org> wrote:

> Recent changes (https://github.com/openjdk/jdk/pull/10745) to ResourceObj, have caused the build to fail on AIX. This is because the AIX compiler (xlclang++) complains if 'operator new' is called on a class where 'operator delete' is marked as deleted (ie. `operator delete(void*) = delete`). This is the case even when 'operator new' is explicitly defined.
> 
> It is my understanding that future PRs will migrate many instances of ResourceObj to AnyObj (or other classes), so it's possible this work-around could be removed in the future. An alternate solution is to change ResouceObj to AnyObj in 61 places. This alternative solution works since AnyObj defines both 'operator new' and 'operator delete'. This is both a much bigger change, and doesn't provide any additional benefit if instances of ResourceObj are being reviewed anyway.

> Note that we got similar error messages when compiling risc-v, and there the problem was that some classes had a virtual destructor, which, apparently, requires the "operator delete" to be available. See: [#11443 (comment)](https://github.com/openjdk/jdk/pull/11443#issuecomment-1286952346)

That's about "deleting destructors".  For a detailed discussion see
https://eli.thegreenplace.net/2015/c-deleting-destructors-and-virtual-operator-delete/

I mentioned this in the bug, but I'll mention it here too. It would be
interesting to know whether marking the relevant constructors (like
for CompiledIC) `noexcept` quashes the problem.  That's if Stefan's
query about compiling with exceptions enabled doesn't bear fruit.

-------------

PR: https://git.openjdk.org/jdk/pull/11443


More information about the hotspot-runtime-dev mailing list