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

db: fix build on Darwin and clang 16 #241178

Merged
merged 2 commits into from
Jul 5, 2023
Merged

Commits on Jul 2, 2023

  1. db: fix build with clang 16

    The configure scripts frequently use `main` returning an implicit `int`,
    which causes spurious failures when CC is clang 16+. This is fixed by
    patching the provided macros and regenerating the scripts with
    autoreconfHook, though it requires some manual processing (see below).
    
    The upstream `configure.ac` is written in such a way that it requires
    fixups and post-processing.
    
    * Fixups are required because the original build process just cats the
      macros together into one file. When `aclocal` is run, it does not pick
      up all of them. This is worked around by catting the missing macros to
      a file that is picked up by autoreconfHook.
    * Post-processing is required to populate the version information. This
      is done in a subshell to avoid polluting the environment with the
      contents of `RELEASE`. Otherwise, the build will fail because the
      version C macros it expects will not be defined.
    reckenrode committed Jul 2, 2023
    Configuration menu
    Copy the full SHA
    6302ba0 View commit details
    Browse the repository at this point in the history
  2. db: fix build with clang 16 on Darwin

    Both `_spin_lock_try` and `_spin_unlock` are private and deprecated
    APIs, which are not exported by any headers in the SDK. The build fails
    because the configure script does not define the functions before
    calling them, which is treated as error by clang 16.
    
    This patch replaces use of those APIs with `os_unfair_lock`, which is
    the recommended replacement per the deprecation messages.
    reckenrode committed Jul 2, 2023
    Configuration menu
    Copy the full SHA
    3801851 View commit details
    Browse the repository at this point in the history