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

atomic: detect clang separately #4755

Merged
merged 1 commit into from
Sep 17, 2021
Merged

atomic: detect clang separately #4755

merged 1 commit into from
Sep 17, 2021

Conversation

0181532686cf4a31163be0bf3e6bb6732bf
Copy link
Contributor

Description

Original code was assuming that Clang is linked to libatomic from GCC, which's not always the case – Clang can use atomic implementation from its own compiler-rt library [1].

For example, such explicit usage of "native" atomic implementation for Clang is present on Gentoo [2] – in this case, it's possible to create completely GCC-free toolchain. Proposed change should allow such systems to fully utilize atomics from compiler-rt.

Also I think it can fix Android bug mentioned in the comment, since according to [3] and [4], they've slated GCC for removal in v18; while support for required #ifdef is kinda there [5], I guess it'll be safe to remove if !defined(__ANDROID__) altogether.

[1] https://clang.llvm.org/docs/Toolchain.html#atomics-library
[2] https://github.com/gentoo/gentoo/blob/master/sys-libs/libcxx/libcxx-12.0.1.ebuild#L134
[3] https://developer.android.com/ndk/downloads/revision_history
[4] https://en.wikipedia.org/wiki/Android_NDK
[5] android/ndk#1029

@slouken slouken merged commit ebdfd0e into libsdl-org:main Sep 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants