RFR[16] 8248495: [macos] zerovm is broken due to libffi headers location

Vladimir Kempik vkempik at azul.com
Wed Jul 1 06:54:31 UTC 2020


Hello

You are using libffi from brew. I'm trying to use the system's one. On x86_64 you have a choice, but on arm64 there is no choice atm.

I believe its wrong when configure script can't find default system's library located at default location for this type of OS.

Thanks, Vladimir.

"jiefu(傅杰)" <jiefu at tencent.com> 1 июля 2020 г. 02:59:18 написал:

Hi Vladimir and Magnus,

How about configuring with --with-libffi=... like this:
        --with-libffi=/usr/local/Cellar/libffi/3.2.1/lib/libffi-3.2.1     --disable-warnings-as-errors

I can compile zero vm on our macos platforms with that configuration.

Thanks.
Best regards,
Jie

On 2020/7/1, 3:15 AM, "build-dev on behalf of Vladimir Kempik" <build-dev-retn at openjdk.java.net on behalf of vkempik at azul.com> wrote:

    Hello

    I agree modding  hpp files is a bad idea

    Thanks for idea with setting LIBFFI_CFLAGS

    here is updated webrev: http://cr.openjdk.java.net/~vkempik/8248495/webrev.01/

    AC_CHECK_HEADERS ignored CFLAGS for some reason, so modding header_name for it was still needed.
    This special case only applies to macos/clang when sysroot is set and no libffi configure options is used. (which is default case)

    Thanks, Vladimir


30 июня 2020 г., в 19:46, Magnus Ihse Bursie <magnus.ihse.bursie at oracle.com> написал(а):

Vladimir,

This looks like it can break in other situation than your specific case.

It sounds like you should set LIBFFI_CFLAGS= to  -I<path to your ffi installation>, such that "<path to your ffi installation>/ffi.h" exists. In particular, the change of include path in globalDefinitions_zero.hpp looks bad.

/Magnus

On 2020-06-30 15:33, Vladimir Kempik wrote:
Hello

Please review this fix for zero vm building on macos.

The issue comes from the libffi, it’s headers are located inside usr/include/ffi/ folder in Macos.sdk, so it can’t be found by configure script.

If one wants to use system’s libffi and pass path to libffi via configure argument as --with-libffi-include=/usr/include/ffi, then it won’t be found by configure because clang will look exactly in /usr/include/ffi, but not in macos.sdk
The system, at least on 10.15 doesn’t have /usr/includes at all.

This patch makes jdk to look for ffi/ffi.h header in case of Macos/clang and no --with-libffi-include argument.

However there is one issue with this patch, if --with-libffi-include passed then c++ code will still try to include <ffi/ffi.h>

I’m not sure which way is the best for such rare case. it could be possible to define include filename in configure and pass it via -D and CFLAGS to c++ code.


The webrev - http://cr.openjdk.java.net/~vkempik/8248495/webrev.00/

The bug - https://bugs.openjdk.java.net/browse/JDK-8248495

Thanks, Vladimir



More information about the build-dev mailing list