RFR: 8307527: MacOS Zero builds fail with undefined FFI_GO_CLOSURES after JDK-8304265
Jorn Vernee
jvernee at openjdk.org
Fri May 5 12:26:12 UTC 2023
On Fri, 5 May 2023 09:11:40 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:
> See the bug. Actually, I am not sure why JDK-8304265 changed the `#ifndef FFI_GO_CLOSURES` to `#ifdef _APPLE_`. That seems too intrusive if `FFI_GO_CLOSURES` *is* enabled. So I rewrote the block to something more safe.
>
> Additional testing:
> - [x] macos-aarch64-zero-fastdebug `make images` passes
Hi Aleksey. The original change came in from: https://github.com/openjdk/panama-foreign/pull/770 with the motivation:
> Finally, I had to slightly modify globalDefinitions_zero.hpp to conditionally define FFI_GO_CLOSURES, since I was getting a redefinition error using GCC. The macro is also defined in ffitarget.h which is included by ffi.h. The define in globalDefinitions comes from this PR: https://github.com/openjdk/jdk/pull/8195 which indicates that the define is only needed on Mac Os X. So I switched out the guard to check for __APPLE__ instead. (the check whether it is already defined doesn't really do anything, since FFI_GO_CLOSURES is defined by including ffi.h).
I kept the check, but I'm still not sure how this define is supposed to work, since as far as I can tell `ffitarget.h` will define `FFI_GO_CLOSURES` (which is included by `ffi.h`). I guess the `#ifndef` is needed in case it is defined on the command line?
I'll run this patch through our CI as well.
P.S. hmm, looks like the aarch64 ffitarget.h doesn't define `FFI_GO_CLOSURES`.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/13827#issuecomment-1536178625
More information about the hotspot-compiler-dev
mailing list