Skip to content

Fails to build on arm64 macOS #19

@cho-m

Description

@cho-m

Currently, OpenSLP fails to build on arm64 macOS (Apple Silicon) due to atomics code. The preprocessor will pick the Apple Atomics conditional:

#elif defined(__APPLE__)
# define USE_APPLE_ATOMICS

Which first fails due to missing #include <libkern/OSAtomic.h> and then fails due to undefined o at

while (!OSAtomicCompareAndSwap32(o, n, (int32_t *)pn));

Also may need to look into behavior of 32-bit casts on arm64.


A temporary workaround is to not use Apple Atomics on arm64 macOS and build with fallback.

Fixing above issues for arm64 macOS could work but Apple has deprecated these functions so they may be removed in a future release.

Ideally adding support for a modern option like C11 atomics could be more useful.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions