Skip to content

[compiler-rt] Build with -DCOMPILER_RT_HAS_ATOMICS #24580

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

Merged
merged 1 commit into from
Jun 16, 2025

Conversation

sbc100
Copy link
Collaborator

@sbc100 sbc100 commented Jun 16, 2025

@sbc100 sbc100 requested a review from tlively June 16, 2025 18:48
@sbc100
Copy link
Collaborator Author

sbc100 commented Jun 16, 2025

is it me or are these fallback functions kind of dangerous / wrong?

@sbc100 sbc100 requested a review from kripken June 16, 2025 18:53
@tlively
Copy link
Member

tlively commented Jun 16, 2025

What looks wrong about them? They look like reasonable single-threaded implementations of compare-and-swap and fetch-add.

@sbc100
Copy link
Collaborator Author

sbc100 commented Jun 16, 2025

Right, but as we have shown by the need for this PR the COMPILER_RT_HAS_ATOMICS might not correspond 1-to-1 with single-threaded-only.

In this case we were building without any macros and it was assuming incorrectly that single-theaded version could be substituted (even on multi-threaded builds). Perhaps it would be safer to invert the macro and have COMPILER_RT_SINGLE_THREADED_ONLY or some such.

@sbc100 sbc100 merged commit e1692b4 into emscripten-core:main Jun 16, 2025
30 checks passed
@sbc100 sbc100 deleted the COMPILER_RT_HAS_ATOMICS branch June 16, 2025 20:11
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