]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Disable atomic wait for freestanding [PR105021]
authorJonathan Wakely <jwakely@redhat.com>
Tue, 22 Mar 2022 21:17:01 +0000 (21:17 +0000)
committerJonathan Wakely <jwakely@redhat.com>
Tue, 12 Apr 2022 20:17:50 +0000 (21:17 +0100)
We use either condition variables or futexes to implement atomic waits,
so we can't do it in freestanding. This is non-conforming, so should be
revisited later, probably by making freestanding atomic waiting
operations spin without ever blocking.

Reviewed-by: Thomas Rodgers <trodgers@redhat.com>
libstdc++-v3/ChangeLog:

PR libstdc++/105021
* include/bits/atomic_base.h [!_GLIBCXX_HOSTED]: Do not include
<bits/atomic_wait.h> for freestanding.

(cherry picked from commit 5bf59b004808abf6acbfe5ef54a0f9216b8dce22)

libstdc++-v3/include/bits/atomic_base.h

index 2db35722ce02b7fd25968a377e58a8617e718f17..60b976bf8d155d485b8a1f61bb0b4e52a8b34932 100644 (file)
@@ -37,7 +37,7 @@
 #include <bits/atomic_lockfree_defines.h>
 #include <bits/move.h>
 
-#if __cplusplus > 201703L
+#if __cplusplus > 201703L && _GLIBCXX_HOSTED
 #include <bits/atomic_wait.h>
 #endif