Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

extconf: add sdk helper, primarily for macOS #757

Closed
wants to merge 1 commit into from

Commits on Mar 26, 2020

  1. extconf: add sdk helper, primarily for macOS

    macOS removed `/usr/include` in recent versions of macOS, which has
    broken the logic in this file and forced the usage of the internal
    libffi when macOS has a perfectly usable one itself.
    
    ```
    checking for ffi.h... no
    checking for ffi.h in /usr/local/include,/usr/include/ffi... no
    ```
    
    The internal libffi also seems to have some issues building on at least
    macOS 10.15/Catalina, and seemed to be the cause of my recent issues
    with other gems that depend on this one.
    
    ```
    linking shared-object ffi_c.bundle
    ld: warning: ignoring file ext/ffi_c/libffi-x86_64-darwin19/.libs/libffi_convenience.a,
    building for macOS-x86_64 but attempting to link with file built for unknown-unsupported file format
    ( 0x21 0x3C 0x61 0x72 0x63 0x68 0x3E 0x0A 0x2F 0x20 0x20 0x20 0x20 0x20 0x20 0x20 )
    ```
    
    This change allows us to use the built-in libffi, and works fine:
    
    ```
    checking for ffi.h... no
    checking for ffi.h in /usr/local/include,/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/ffi... yes
    checking for ffi_call() in -lffi... yes
    checking for ffi_closure_alloc()... yes
    checking for shlwapi.h... no
    checking for rb_thread_call_without_gvl()... yes
    checking for ruby_native_thread_p()... yes
    checking for ruby_thread_has_gvl_p()... yes
    checking for ffi_prep_cif_var()... yes
    checking for ffi_raw_call()... yes
    checking for ffi_prep_raw_closure()... yes
    ```
    DomT4 committed Mar 26, 2020
    Copy the full SHA
    478f335 View commit details
    Browse the repository at this point in the history