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

[android] Update headers that were split in NDK 23 #568

Merged
merged 1 commit into from
Nov 18, 2021

Conversation

finagolfin
Copy link
Contributor

NDK 23 split stdatomic.h up and that causes problems when invoked from C++ files, so use the new bits/stdatomic.h instead as a workaround, as seen in the test for aosp-mirror/platform_bionic@76e2b15.

Building libdispatch for Android with the new NDK causes linkage issues in the headers, so I used this same workaround that can be seen in the C++ test for that Bionic commit that split the header up and libdispatch builds for Android again.

I don't know if there's a better way to fix these linkage issues, so let me know if there is.

NDK 23 split stdatomic.h up and that causes problems when invoked from C++ files,
so use the new bits/stdatomic.h instead as a workaround, as seen in the test for
aosp-mirror/platform_bionic@76e2b15.
@finagolfin
Copy link
Contributor Author

@drodriguez, would you review? swiftlang/swift#38441 will need this, once we switch to NDK 23.

@drodriguez
Copy link
Contributor

Have you tried...

#if defined(__cplusplus)
#include <atomic>
#else
#include <stdatomic.h>
#endif

One should not access the bits/ headers outside the standard headers. They are private details of the implementation.

@finagolfin
Copy link
Contributor Author

No, I'm not familiar with these linkage issues when mixing C headers with C++, will try your way instead and let you know.

@finagolfin
Copy link
Contributor Author

finagolfin commented Aug 28, 2021

Just tried it, doesn't work either. If you look at the error trace from my link above, the problem is that src/internal.h starts a __BEGIN_DECLS block where it includes these shims. The issue is that is an extern C block that's invoked inside a C++ file, so stadomic.h gives it the C++ <atomic> too, which then complains about the enclosing extern C block. I don't know why this doesn't hit oOn other platforms though, the stdatomic.h that comes with the linux clang doesn't include C++ <atomic>, so this appears to be an issue with Bionic trying to provide both C and C++ declarations in one header, which the Bionic commit I linked above enabled.

This problem remains with your proposed fix, whereas mine makes sure only the C declarations are called, even if it calls an internal header to do so. If you have another fix in mind, let me know.

@finagolfin
Copy link
Contributor Author

@drexin, any input on this? Maybe you've dealt with these mixed linkage issues before, I haven't.

@triplef
Copy link
Contributor

triplef commented Sep 6, 2021

I think this also applies to previous NDK versions. We’ve been using the following to work around these for a while:

#if defined(ANDROID) && __has_include(<bits/stdatomic.h>)
#include <bits/stdatomic.h>
#else
#include <stdatomic.h>
#endif

See also the following related discussions in the NDK project for more background:

@finagolfin
Copy link
Contributor Author

Thanks for all the links. According to Dan Albert last year, what libdispatch does in src/internal.h is against the C++ standard, so this pull is just a workaround for that:

"I did get an authoritative answer on this from multiple members of the C++ standard committee, and using #include within extern "C" is disallowed by the standard.

http://eel.is/c++draft/using.headers#3

A translation unit shall include a header only outside of any declaration or definition and, in the case of a module unit, only in its global-module-fragment, and shall include the header or import the corresponding header unit lexically before the first reference in that translation unit to any of the entities declared in that header. No diagnostic is required.

An extern "C" block is a declaration, so it's disallowed."

@ktopley-apple, is there a better change we can make to internal.h to make it standard-compliant?

@shrukul
Copy link

shrukul commented Sep 19, 2021

@buttaface - I'm facing this issue in NDK r22, and can confirm that including <bits/stdatomic.h> fixes the issue!

Hence, wanted to ask: Any particular reason for enabling this fix only for __NDK_MAJOR__ >= 23 ? Given that this was broken in r21b, can we enable this fix starting from r21b? (Let me know if I'm mistaken/incorrect)

@finagolfin
Copy link
Contributor Author

@shrukul, the NDK issues @triplef linked above note that the Bionic header change that triggered this was reverted in later versions of NDK 21, ie the last version 21e doesn't have it. While NDK 22 did, it wasn't an LTS NDK and has now been obsoleted by NDK 23, so I chose the first LTS NDK that made this change, 23.

Anyway, hopefully we can get this fixed properly in internal.h without regard to NDK versions.

@etcwilde, any input?

@etcwilde
Copy link
Contributor

etcwilde commented Oct 1, 2021

@shrukul, the NDK issues @triplef linked above note that the Bionic header change that triggered this was reverted in later versions of NDK 21, ie the last version 21e doesn't have it. While NDK 22 did, it wasn't an LTS NDK and has now been obsoleted by NDK 23, so I chose the first LTS NDK that made this change, 23.

Anyway, hopefully we can get this fixed properly in internal.h without regard to NDK versions.

@etcwilde, any input?

I'm not familiar with android development, so I don't have an opinion on a version, so long as it work.
@rokhinip is probably the best person to page with options in this repository.

@finagolfin
Copy link
Contributor Author

@etcwilde, I was more hoping for an opinion on this comment, which has nothing to do with Android, but is about how one of this project's headers is doing something non-standard, that happens to break for Android. If we fix it there, we might fix this issue without reference to Android or its versions.

I'm unfamiliar with these arcane C/C++ issues, so I was hoping you might have some input on that.

@etcwilde
Copy link
Contributor

etcwilde commented Oct 1, 2021

@etcwilde, I was more hoping for an opinion on this comment, which has nothing to do with Android, but is about how one of this project's headers is doing something non-standard, that happens to break for Android. If we fix it there, we might fix this issue without reference to Android or its versions.

I'm unfamiliar with these arcane C/C++ issues, so I was hoping you might have some input on that.

Ah, sorry, I misunderstood. The answer is a little bit round-a-bout. So as per the C++11 spec (7.6.1.2, Table 14), the C++11 standard library must vend an atomic library, so you should be guaranteed that #include <atomic> will work. If __STDC_NO_ATOMICS__ is defined, then the header stdatomic.h is not available. Apparently this is the case on Android.
If this file were just C++, it would be fine to replace the include of stdatomic.h with atomic, fix up the differences, and move on.

The part I don't know is how standards compliant the Android development kits are, or which version of developer kit contains which version(s) of the standard.

This proposal, which targets C++23, actually comments on this issue. Unfortunately, right now the only portable way is to include atomic from C++ and have a bunch of using statements to strip off the std namespace in the case of C++.

e.g.

#ifdef __cplusplus
  #include <atomic>
  using std::atomic_int;
  using std::memory_order;
  using std::memory_order_acquire;
  ...
#else /* not __cplusplus */
  #include <stdatomic.h>
#endif /* __cplusplus */

@finagolfin
Copy link
Contributor Author

@etcwilde, I was more hoping to hear about the issue causing this, ie that src/internal.h includes several headers inside its __BEGIN_DECLS block, which Dan notes is against the standard. It so happens that Android's stdatomic.h is the one erroring because of that, but others could also later. Is there something we could do to fix the root cause in src/internal.h instead?

I just noticed another #include changing its linkage inside the block so I tried that with shims.h there too, but that caused other errors.

Any ideas for other changes to src/internal.h that could work around this issue there?

@compnerd
Copy link
Member

Could you share what the "other errors" were with switching linkage to c++?

@finagolfin
Copy link
Contributor Author

There's a horrible thing that comes to mind - and I'd prefer to avoid it if at all possible - we could wrap the header via include_next and convert things around either with macros or other things. If we can work out another workaround, I think that would be preferable. But I think that we have some more potent tools available if absolutely required.

I don't think that would work either. Let me state the problem as briefly as possible:

Prior to NDK 22, stdatomic.h in Android's Bionic libc provided both C++ and C declarations, but for whatever reason, the C++ declarations were disabled. That worked fine with src/internal.h as it only could use C declarations, even when compiling C++.

However, once NDK 22 enabled those C++ declarations, it broke compiling C++ files in this codebase, because of the incorrect usage of extern C in src/internal.h. Given that underlying problem, I don't see how include_next or anything other than including bits/stdatomic.h, which is where the C declarations were moved in NDK 22, would work around the improper usage in src/internal.h.

I'd rather fix the underlying problem in src/internal.h and not try to work around it, but I don't know a way to do that.

Could you share what the "other errors" were with switching linkage to c++?

Some other C++ definition issues, I'll rerun that and paste the error later this weekend.

@compnerd
Copy link
Member

Changing the linkage to C++ before including the header as a workaround for android seems reasonable to accommodate the non-conforming behaviour on android. I'd say that once we have the errors we can likely understand the situation better.

@finagolfin
Copy link
Contributor Author

finagolfin commented Oct 16, 2021

the non-conforming behaviour on android

I don't think there was anything to "conform" to for stdatomic.h, but Dan notes that C++ is moving to precisely this solution. So whenever other C++ implementations catch up to Bionic, they will break with libdispatch too, because of this repo's non-conforming usage in src/internal.h.

@finagolfin
Copy link
Contributor Author

I had tried applying the following patch instead to avoid these linkage issues:

diff --git a/src/shims/atomic.h b/src/shims/atomic.h
index c002e72..ea3f5ba 100644
--- a/src/shims/atomic.h
+++ b/src/shims/atomic.h
@@ -35,7 +35,13 @@
 #if defined(__cplusplus)
 #define _Bool bool
 #endif
+#ifdef __cplusplus
+extern "C++" {
+#endif
 #include <stdatomic.h>
+#ifdef __cplusplus
+}
+#endif
 
 #define memory_order_ordered    memory_order_seq_cst
 #define memory_order_dependency memory_order_acquire

I got a bunch of template matching errors:

+ /usr/bin/cmake --build /home/butta/src/build/Ninja-Release/swift-android-aarch64 -- -j2 all swift-test-stdlib-android-aarch64
[1/225][  0%][0.465s] Performing build step for 'libdispatch-android-aarch64'
FAILED: libdispatch-android-aarch64-prefix/src/libdispatch-android-aarch64-stamp/libdispatch-android-aarch64-build libdispatch-android-aarch64-prefix/lib/libdispatch.so libdispatch-android-aarch64-prefix/lib/dispatch libdispatch-android-aarch64-prefix/lib/libBlocksRuntime.so libdispatch-android-aarch64-prefix/lib/BlocksRuntime 
cd /home/butta/src/build/Ninja-Release/swift-android-aarch64/libdispatch-android-aarch64-prefix/src/libdispatch-android-aarch64-build && /usr/bin/cmake --build .
[1/47][  2%][0.114s] Building C object tests/CMakeFiles/dispatch_timer_timeout.dir/dispatch_timer_timeout.c.o
[2/47][  4%][0.221s] Building C object tests/CMakeFiles/dispatch_overcommit.dir/dispatch_overcommit.c.o
[3/47][  6%][0.345s] Building C object tests/CMakeFiles/dispatch_context_for_key.dir/dispatch_context_for_key.c.o
[4/47][  8%][0.395s] Building CXX object src/CMakeFiles/dispatch.dir/block.cpp.o
FAILED: src/CMakeFiles/dispatch.dir/block.cpp.o 
/home/butta/android-ndk-r23/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ --target=aarch64-none-linux-android24 -DDISPATCH_USE_DTRACE=0 -DHAVE_CONFIG_H -Ddispatch_EXPORTS -I. -I/home/butta/src/swift-corelibs-libdispatch -I/home/butta/src/swift-corelibs-libdispatch/src -Isrc -I/home/butta/src/swift-corelibs-libdispatch/private -I/home/butta/src/swift-corelibs-libdispatch/src/BlocksRuntime -Wno-unknown-warning-option -Werror=unguarded-availability-new -fno-stack-protector -fPIC -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wimplicit-fallthrough -Wcovered-switch-default -Wno-class-memaccess -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -fdiagnostics-color -ffunction-sections -fdata-sections -Werror=switch -Wdocumentation -Wimplicit-fallthrough -Wunreachable-code -Woverloaded-virtual -DOBJC_OLD_DISPATCH_PROTOTYPES=0 -O2 -DNDEBUG -fPIC -Werror -Wall -Wextra -Warray-bounds-pointer-arithmetic -Wassign-enum -Watomic-properties -Wcomma -Wconditional-uninitialized -Wconversion -Wcovered-switch-default -Wdate-time -Wdeprecated -Wdocumentation -Wdouble-promotion -Wduplicate-enum -Wexpansion-to-defined -Wfloat-equal -Widiomatic-parentheses -Winfinite-recursion -Wmissing-prototypes -Wnewline-eof -Wnullable-to-nonnull-conversion -Wobjc-interface-ivars -Wover-aligned -Wpacked -Wpointer-arith -Wselector -Wshadow -Wshorten-64-to-32 -Wsign-conversion -Wstatic-in-inline -Wsuper-class-method-mismatch -Wswitch -Wunguarded-availability -Wunreachable-code -Wunused -Wno-unknown-warning-option -Wno-trigraphs -Wno-four-char-constants -Wno-disabled-macro-expansion -Wno-pedantic -Wno-bad-function-cast -Wno-c++-compat -Wno-c++98-compat -Wno-c++98-compat-pedantic -Wno-cast-align -Wno-cast-qual -Wno-documentation-unknown-command -Wno-format-nonliteral -Wno-missing-variable-declarations -Wno-old-style-cast -Wno-padded -Wno-reserved-id-macro -Wno-shift-sign-overflow -Wno-undef -Wno-unreachable-code-aggressive -Wno-unused-macros -Wno-used-but-marked-unused -Wno-void-pointer-to-int-cast -Wno-vla -Wno-incompatible-function-pointer-types -Wno-implicit-function-declaration -Wno-conversion -Wno-int-conversion -Wno-shorten-64-to-32 -Wno-error=assign-enum -U_GNU_SOURCE -fno-exceptions -fblocks -momit-leaf-frame-pointer -pthread -std=gnu++11 -MD -MT src/CMakeFiles/dispatch.dir/block.cpp.o -MF src/CMakeFiles/dispatch.dir/block.cpp.o.d -o src/CMakeFiles/dispatch.dir/block.cpp.o -c /home/butta/src/swift-corelibs-libdispatch/src/block.cpp
In file included from /home/butta/src/swift-corelibs-libdispatch/src/block.cpp:31:
In file included from /home/butta/src/swift-corelibs-libdispatch/src/internal.h:666:
In file included from /home/butta/src/swift-corelibs-libdispatch/src/shims.h:224:
/home/butta/src/swift-corelibs-libdispatch/src/shims/atomic_sfb.h:90:2: error: no matching function for call to 'atomic_load_explicit'
        os_atomic_rmw_loop(p, b, b_masked, relaxed, {
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/butta/src/swift-corelibs-libdispatch/src/shims/atomic.h:166:8: note: expanded from macro 'os_atomic_rmw_loop'
                ov = os_atomic_load(_p, relaxed); \
                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/butta/src/swift-corelibs-libdispatch/src/shims/atomic.h:59:3: note: expanded from macro 'os_atomic_load'
                atomic_load_explicit(_os_atomic_c11_atomic(p), memory_order_##m)
                ^~~~~~~~~~~~~~~~~~~~
/home/butta/android-ndk-r23/toolchains/llvm/prebuilt/linux-x86_64/bin/../sysroot/usr/include/c++/v1/atomic:1928:1: note: candidate template ignored: could not match 'atomic<type-parameter-0-0>' against 'volatile _Atomic(unsigned long)'
atomic_load_explicit(const volatile atomic<_Tp>* __o, memory_order __m) _NOEXCEPT
^
/home/butta/android-ndk-r23/toolchains/llvm/prebuilt/linux-x86_64/bin/../sysroot/usr/include/c++/v1/atomic:1937:1: note: candidate template ignored: could not match 'atomic<type-parameter-0-0>' against 'volatile _Atomic(unsigned long)'
atomic_load_explicit(const atomic<_Tp>* __o, memory_order __m) _NOEXCEPT
^
In file included from /home/butta/src/swift-corelibs-libdispatch/src/block.cpp:31:
In file included from /home/butta/src/swift-corelibs-libdispatch/src/internal.h:666:
In file included from /home/butta/src/swift-corelibs-libdispatch/src/shims.h:224:
/home/butta/src/swift-corelibs-libdispatch/src/shims/atomic_sfb.h:90:2: error: no matching function for call to 'atomic_load_explicit'
        os_atomic_rmw_loop(p, b, b_masked, relaxed, {
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/butta/src/swift-corelibs-libdispatch/src/shims/atomic.h:169:14: note: expanded from macro 'os_atomic_rmw_loop'
                        _result = os_atomic_cmpxchgvw(_p, ov, nv, &ov, m); \
                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/butta/src/swift-corelibs-libdispatch/src/shims/atomic.h:73:6: note: expanded from macro 'os_atomic_cmpxchgvw'
                ({ _os_atomic_basetypeof(p) _r = (e); _Bool _b = \
                   ^~~~~~~~~~~~~~~~~~~~~~~~
/home/butta/src/swift-corelibs-libdispatch/src/shims/atomic.h:56:14: note: expanded from macro '_os_atomic_basetypeof'
                __typeof__(atomic_load_explicit(_os_atomic_c11_atomic(p), memory_order_relaxed))
                           ^~~~~~~~~~~~~~~~~~~~
/home/butta/android-ndk-r23/toolchains/llvm/prebuilt/linux-x86_64/bin/../sysroot/usr/include/c++/v1/atomic:1928:1: note: candidate template ignored: could not match 'atomic<type-parameter-0-0>' against 'volatile _Atomic(unsigned long)'
atomic_load_explicit(const volatile atomic<_Tp>* __o, memory_order __m) _NOEXCEPT
^
/home/butta/android-ndk-r23/toolchains/llvm/prebuilt/linux-x86_64/bin/../sysroot/usr/include/c++/v1/atomic:1937:1: note: candidate template ignored: could not match 'atomic<type-parameter-0-0>' against 'volatile _Atomic(unsigned long)'
atomic_load_explicit(const atomic<_Tp>* __o, memory_order __m) _NOEXCEPT
^
In file included from /home/butta/src/swift-corelibs-libdispatch/src/block.cpp:31:
In file included from /home/butta/src/swift-corelibs-libdispatch/src/internal.h:666:
In file included from /home/butta/src/swift-corelibs-libdispatch/src/shims.h:227:
/home/butta/src/swift-corelibs-libdispatch/src/shims/lock.h:304:6: error: no matching function for call to 'atomic_fetch_add_explicit'
        if (os_atomic_inc_orig(&dte->dte_value, release) == 0) {
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/butta/src/swift-corelibs-libdispatch/src/shims/atomic.h:149:3: note: expanded from macro 'os_atomic_inc_orig'
                os_atomic_add_orig((p), 1, m)
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/butta/src/swift-corelibs-libdispatch/src/shims/atomic.h:87:3: note: expanded from macro 'os_atomic_add_orig'
                _os_atomic_c11_op_orig((p), (v), m, add, +)
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/butta/src/swift-corelibs-libdispatch/src/shims/atomic.h:82:3: note: expanded from macro '_os_atomic_c11_op_orig'
                atomic_fetch_##o##_explicit(_os_atomic_c11_atomic(p), v, \
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~
<scratch space>:42:1: note: expanded from here
atomic_fetch_add_explicit
^~~~~~~~~~~~~~~~~~~~~~~~~
/home/butta/android-ndk-r23/toolchains/llvm/prebuilt/linux-x86_64/bin/../sysroot/usr/include/c++/v1/atomic:2183:1: note: candidate template ignored: could not match 'atomic<type-parameter-0-0>' against '_Atomic(unsigned int)'
atomic_fetch_add_explicit(volatile atomic<_Tp>* __o, _Tp __op, memory_order __m) _NOEXCEPT
^
/home/butta/android-ndk-r23/toolchains/llvm/prebuilt/linux-x86_64/bin/../sysroot/usr/include/c++/v1/atomic:2195:1: note: candidate template ignored: could not match 'atomic<type-parameter-0-0>' against '_Atomic(unsigned int)'
atomic_fetch_add_explicit(atomic<_Tp>* __o, _Tp __op, memory_order __m) _NOEXCEPT
^
/home/butta/android-ndk-r23/toolchains/llvm/prebuilt/linux-x86_64/bin/../sysroot/usr/include/c++/v1/atomic:2203:1: note: candidate template ignored: could not match 'atomic<type-parameter-0-0 *>' against '_Atomic(unsigned int)'
atomic_fetch_add_explicit(volatile atomic<_Tp*>* __o, ptrdiff_t __op,
^
/home/butta/android-ndk-r23/toolchains/llvm/prebuilt/linux-x86_64/bin/../sysroot/usr/include/c++/v1/atomic:2212:1: note: candidate template ignored: could not match 'atomic<type-parameter-0-0 *>' against '_Atomic(unsigned int)'
atomic_fetch_add_explicit(atomic<_Tp*>* __o, ptrdiff_t __op, memory_order __m) _NOEXCEPT
^
In file included from /home/butta/src/swift-corelibs-libdispatch/src/block.cpp:31:
In file included from /home/butta/src/swift-corelibs-libdispatch/src/internal.h:666:
In file included from /home/butta/src/swift-corelibs-libdispatch/src/shims.h:227:
/home/butta/src/swift-corelibs-libdispatch/src/shims/lock.h:322:6: error: no matching function for call to 'atomic_load_explicit'
        if (os_atomic_dec(&dte->dte_value, acquire) == 0) {
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/butta/src/swift-corelibs-libdispatch/src/shims/atomic.h:155:3: note: expanded from macro 'os_atomic_dec'
                os_atomic_sub((p), 1, m)
                ^~~~~~~~~~~~~~~~~~~~~~~~
/home/butta/src/swift-corelibs-libdispatch/src/shims/atomic.h:89:3: note: expanded from macro 'os_atomic_sub'
                _os_atomic_c11_op((p), (v), m, sub, -)
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/butta/src/swift-corelibs-libdispatch/src/shims/atomic.h:78:6: note: expanded from macro '_os_atomic_c11_op'
                ({ _os_atomic_basetypeof(p) _v = (v), _r = \
                   ^~~~~~~~~~~~~~~~~~~~~~~~
/home/butta/src/swift-corelibs-libdispatch/src/shims/atomic.h:56:14: note: expanded from macro '_os_atomic_basetypeof'
                __typeof__(atomic_load_explicit(_os_atomic_c11_atomic(p), memory_order_relaxed))
                           ^~~~~~~~~~~~~~~~~~~~
/home/butta/android-ndk-r23/toolchains/llvm/prebuilt/linux-x86_64/bin/../sysroot/usr/include/c++/v1/atomic:1928:1: note: candidate template ignored: could not match 'atomic<type-parameter-0-0>' against '_Atomic(unsigned int)'
atomic_load_explicit(const volatile atomic<_Tp>* __o, memory_order __m) _NOEXCEPT
^
/home/butta/android-ndk-r23/toolchains/llvm/prebuilt/linux-x86_64/bin/../sysroot/usr/include/c++/v1/atomic:1937:1: note: candidate template ignored: could not match 'atomic<type-parameter-0-0>' against '_Atomic(unsigned int)'
atomic_load_explicit(const atomic<_Tp>* __o, memory_order __m) _NOEXCEPT
^
In file included from /home/butta/src/swift-corelibs-libdispatch/src/block.cpp:31:
In file included from /home/butta/src/swift-corelibs-libdispatch/src/internal.h:666:
In file included from /home/butta/src/swift-corelibs-libdispatch/src/shims.h:227:
/home/butta/src/swift-corelibs-libdispatch/src/shims/lock.h:322:6: error: expected ';' at end of declaration
        if (os_atomic_dec(&dte->dte_value, acquire) == 0) {
            ^
/home/butta/src/swift-corelibs-libdispatch/src/shims/atomic.h:155:3: note: expanded from macro 'os_atomic_dec'
                os_atomic_sub((p), 1, m)
                ^
/home/butta/src/swift-corelibs-libdispatch/src/shims/atomic.h:89:3: note: expanded from macro 'os_atomic_sub'
                _os_atomic_c11_op((p), (v), m, sub, -)
                ^
/home/butta/src/swift-corelibs-libdispatch/src/shims/atomic.h:78:44: note: expanded from macro '_os_atomic_c11_op'
                ({ _os_atomic_basetypeof(p) _v = (v), _r = \
                                                         ^
In file included from /home/butta/src/swift-corelibs-libdispatch/src/block.cpp:31:
In file included from /home/butta/src/swift-corelibs-libdispatch/src/internal.h:666:
In file included from /home/butta/src/swift-corelibs-libdispatch/src/shims.h:227:
/home/butta/src/swift-corelibs-libdispatch/src/shims/lock.h:322:6: error: use of undeclared identifier '_r'
/home/butta/src/swift-corelibs-libdispatch/src/shims/atomic.h:155:3: note: expanded from macro 'os_atomic_dec'
                os_atomic_sub((p), 1, m)
                ^
/home/butta/src/swift-corelibs-libdispatch/src/shims/atomic.h:89:3: note: expanded from macro 'os_atomic_sub'
                _os_atomic_c11_op((p), (v), m, sub, -)
                ^
/home/butta/src/swift-corelibs-libdispatch/src/shims/atomic.h:80:34: note: expanded from macro '_os_atomic_c11_op'
                memory_order_##m); (__typeof__(_r))(_r op _v); })
                                               ^
In file included from /home/butta/src/swift-corelibs-libdispatch/src/block.cpp:31:
In file included from /home/butta/src/swift-corelibs-libdispatch/src/internal.h:666:
In file included from /home/butta/src/swift-corelibs-libdispatch/src/shims.h:227:
/home/butta/src/swift-corelibs-libdispatch/src/shims/lock.h:322:46: error: invalid operands to binary expression ('void' and 'int')
        if (os_atomic_dec(&dte->dte_value, acquire) == 0) {
            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^  ~
/home/butta/src/swift-corelibs-libdispatch/src/shims/lock.h:362:13: error: no matching function for call to 'atomic_load_explicit'
        if (likely(os_atomic_cmpxchg(&l->dul_lock,
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/butta/src/swift-corelibs-libdispatch/src/shims/atomic.h:65:6: note: expanded from macro 'os_atomic_cmpxchg'
                ({ _os_atomic_basetypeof(p) _r = (e); \
                   ^~~~~~~~~~~~~~~~~~~~~~~~
/home/butta/src/swift-corelibs-libdispatch/src/shims/atomic.h:56:14: note: expanded from macro '_os_atomic_basetypeof'
                __typeof__(atomic_load_explicit(_os_atomic_c11_atomic(p), memory_order_relaxed))
                           ^~~~~~~~~~~~~~~~~~~~
/home/butta/src/swift-corelibs-libdispatch/src/internal.h:426:39: note: expanded from macro 'likely'
#define likely(x) __builtin_expect(!!(x), 1)
                                      ^
/home/butta/android-ndk-r23/toolchains/llvm/prebuilt/linux-x86_64/bin/../sysroot/usr/include/c++/v1/atomic:1928:1: note: candidate template ignored: could not match 'atomic<type-parameter-0-0>' against '_Atomic(unsigned int)'
atomic_load_explicit(const volatile atomic<_Tp>* __o, memory_order __m) _NOEXCEPT
^
/home/butta/android-ndk-r23/toolchains/llvm/prebuilt/linux-x86_64/bin/../sysroot/usr/include/c++/v1/atomic:1937:1: note: candidate template ignored: could not match 'atomic<type-parameter-0-0>' against '_Atomic(unsigned int)'
atomic_load_explicit(const atomic<_Tp>* __o, memory_order __m) _NOEXCEPT
^
In file included from /home/butta/src/swift-corelibs-libdispatch/src/block.cpp:31:
In file included from /home/butta/src/swift-corelibs-libdispatch/src/internal.h:666:
In file included from /home/butta/src/swift-corelibs-libdispatch/src/shims.h:227:
/home/butta/src/swift-corelibs-libdispatch/src/shims/lock.h:362:6: error: invalid argument type 'void' to unary expression
        if (likely(os_atomic_cmpxchg(&l->dul_lock,
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/butta/src/swift-corelibs-libdispatch/src/internal.h:426:37: note: expanded from macro 'likely'
#define likely(x) __builtin_expect(!!(x), 1)
                                    ^~~~
In file included from /home/butta/src/swift-corelibs-libdispatch/src/block.cpp:31:
In file included from /home/butta/src/swift-corelibs-libdispatch/src/internal.h:666:
In file included from /home/butta/src/swift-corelibs-libdispatch/src/shims.h:227:
/home/butta/src/swift-corelibs-libdispatch/src/shims/lock.h:376:2: error: no matching function for call to 'atomic_load_explicit'
        os_atomic_rmw_loop(&l->dul_lock, old_value, new_value, acquire, {
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/butta/src/swift-corelibs-libdispatch/src/shims/atomic.h:166:8: note: expanded from macro 'os_atomic_rmw_loop'
                ov = os_atomic_load(_p, relaxed); \
                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/butta/src/swift-corelibs-libdispatch/src/shims/atomic.h:59:3: note: expanded from macro 'os_atomic_load'
                atomic_load_explicit(_os_atomic_c11_atomic(p), memory_order_##m)
                ^~~~~~~~~~~~~~~~~~~~
/home/butta/android-ndk-r23/toolchains/llvm/prebuilt/linux-x86_64/bin/../sysroot/usr/include/c++/v1/atomic:1928:1: note: candidate template ignored: could not match 'atomic<type-parameter-0-0>' against '_Atomic(unsigned int)'
atomic_load_explicit(const volatile atomic<_Tp>* __o, memory_order __m) _NOEXCEPT
^
/home/butta/android-ndk-r23/toolchains/llvm/prebuilt/linux-x86_64/bin/../sysroot/usr/include/c++/v1/atomic:1937:1: note: candidate template ignored: could not match 'atomic<type-parameter-0-0>' against '_Atomic(unsigned int)'
atomic_load_explicit(const atomic<_Tp>* __o, memory_order __m) _NOEXCEPT
^
In file included from /home/butta/src/swift-corelibs-libdispatch/src/block.cpp:31:
In file included from /home/butta/src/swift-corelibs-libdispatch/src/internal.h:666:
In file included from /home/butta/src/swift-corelibs-libdispatch/src/shims.h:227:
/home/butta/src/swift-corelibs-libdispatch/src/shims/lock.h:376:2: error: no matching function for call to 'atomic_load_explicit'
        os_atomic_rmw_loop(&l->dul_lock, old_value, new_value, acquire, {
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/butta/src/swift-corelibs-libdispatch/src/shims/atomic.h:169:14: note: expanded from macro 'os_atomic_rmw_loop'
                        _result = os_atomic_cmpxchgvw(_p, ov, nv, &ov, m); \
                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/butta/src/swift-corelibs-libdispatch/src/shims/atomic.h:73:6: note: expanded from macro 'os_atomic_cmpxchgvw'
                ({ _os_atomic_basetypeof(p) _r = (e); _Bool _b = \
                   ^~~~~~~~~~~~~~~~~~~~~~~~
/home/butta/src/swift-corelibs-libdispatch/src/shims/atomic.h:56:14: note: expanded from macro '_os_atomic_basetypeof'
                __typeof__(atomic_load_explicit(_os_atomic_c11_atomic(p), memory_order_relaxed))
                           ^~~~~~~~~~~~~~~~~~~~
/home/butta/android-ndk-r23/toolchains/llvm/prebuilt/linux-x86_64/bin/../sysroot/usr/include/c++/v1/atomic:1928:1: note: candidate template ignored: could not match 'atomic<type-parameter-0-0>' against '_Atomic(unsigned int)'
atomic_load_explicit(const volatile atomic<_Tp>* __o, memory_order __m) _NOEXCEPT
^
/home/butta/android-ndk-r23/toolchains/llvm/prebuilt/linux-x86_64/bin/../sysroot/usr/include/c++/v1/atomic:1937:1: note: candidate template ignored: could not match 'atomic<type-parameter-0-0>' against '_Atomic(unsigned int)'
atomic_load_explicit(const atomic<_Tp>* __o, memory_order __m) _NOEXCEPT
^
In file included from /home/butta/src/swift-corelibs-libdispatch/src/block.cpp:31:
In file included from /home/butta/src/swift-corelibs-libdispatch/src/internal.h:666:
In file included from /home/butta/src/swift-corelibs-libdispatch/src/shims.h:227:
/home/butta/src/swift-corelibs-libdispatch/src/shims/lock.h:393:2: error: no matching function for call to 'atomic_load_explicit'
        os_atomic_rmw_loop(&l->dul_lock, old_value, new_value, release, {
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/butta/src/swift-corelibs-libdispatch/src/shims/atomic.h:166:8: note: expanded from macro 'os_atomic_rmw_loop'
                ov = os_atomic_load(_p, relaxed); \
                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/butta/src/swift-corelibs-libdispatch/src/shims/atomic.h:59:3: note: expanded from macro 'os_atomic_load'
                atomic_load_explicit(_os_atomic_c11_atomic(p), memory_order_##m)
                ^~~~~~~~~~~~~~~~~~~~
/home/butta/android-ndk-r23/toolchains/llvm/prebuilt/linux-x86_64/bin/../sysroot/usr/include/c++/v1/atomic:1928:1: note: candidate template ignored: could not match 'atomic<type-parameter-0-0>' against '_Atomic(unsigned int)'
atomic_load_explicit(const volatile atomic<_Tp>* __o, memory_order __m) _NOEXCEPT
^
/home/butta/android-ndk-r23/toolchains/llvm/prebuilt/linux-x86_64/bin/../sysroot/usr/include/c++/v1/atomic:1937:1: note: candidate template ignored: could not match 'atomic<type-parameter-0-0>' against '_Atomic(unsigned int)'
atomic_load_explicit(const atomic<_Tp>* __o, memory_order __m) _NOEXCEPT
^
In file included from /home/butta/src/swift-corelibs-libdispatch/src/block.cpp:31:
In file included from /home/butta/src/swift-corelibs-libdispatch/src/internal.h:666:
In file included from /home/butta/src/swift-corelibs-libdispatch/src/shims.h:227:
/home/butta/src/swift-corelibs-libdispatch/src/shims/lock.h:393:2: error: no matching function for call to 'atomic_load_explicit'
        os_atomic_rmw_loop(&l->dul_lock, old_value, new_value, release, {
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/butta/src/swift-corelibs-libdispatch/src/shims/atomic.h:169:14: note: expanded from macro 'os_atomic_rmw_loop'
                        _result = os_atomic_cmpxchgvw(_p, ov, nv, &ov, m); \
                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/butta/src/swift-corelibs-libdispatch/src/shims/atomic.h:73:6: note: expanded from macro 'os_atomic_cmpxchgvw'
                ({ _os_atomic_basetypeof(p) _r = (e); _Bool _b = \
                   ^~~~~~~~~~~~~~~~~~~~~~~~
/home/butta/src/swift-corelibs-libdispatch/src/shims/atomic.h:56:14: note: expanded from macro '_os_atomic_basetypeof'
                __typeof__(atomic_load_explicit(_os_atomic_c11_atomic(p), memory_order_relaxed))
                           ^~~~~~~~~~~~~~~~~~~~
/home/butta/android-ndk-r23/toolchains/llvm/prebuilt/linux-x86_64/bin/../sysroot/usr/include/c++/v1/atomic:1928:1: note: candidate template ignored: could not match 'atomic<type-parameter-0-0>' against '_Atomic(unsigned int)'
atomic_load_explicit(const volatile atomic<_Tp>* __o, memory_order __m) _NOEXCEPT
^
/home/butta/android-ndk-r23/toolchains/llvm/prebuilt/linux-x86_64/bin/../sysroot/usr/include/c++/v1/atomic:1937:1: note: candidate template ignored: could not match 'atomic<type-parameter-0-0>' against '_Atomic(unsigned int)'
atomic_load_explicit(const atomic<_Tp>* __o, memory_order __m) _NOEXCEPT
^
In file included from /home/butta/src/swift-corelibs-libdispatch/src/block.cpp:31:
In file included from /home/butta/src/swift-corelibs-libdispatch/src/internal.h:666:
In file included from /home/butta/src/swift-corelibs-libdispatch/src/shims.h:227:
/home/butta/src/swift-corelibs-libdispatch/src/shims/lock.h:417:13: error: no matching function for call to 'atomic_load_explicit'
        if (likely(os_atomic_cmpxchgv(&l->dul_lock,
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/butta/src/swift-corelibs-libdispatch/src/shims/atomic.h:69:6: note: expanded from macro 'os_atomic_cmpxchgv'
                ({ _os_atomic_basetypeof(p) _r = (e); _Bool _b = \
                   ^~~~~~~~~~~~~~~~~~~~~~~~
/home/butta/src/swift-corelibs-libdispatch/src/shims/atomic.h:56:14: note: expanded from macro '_os_atomic_basetypeof'
                __typeof__(atomic_load_explicit(_os_atomic_c11_atomic(p), memory_order_relaxed))
                           ^~~~~~~~~~~~~~~~~~~~
/home/butta/src/swift-corelibs-libdispatch/src/internal.h:426:39: note: expanded from macro 'likely'
#define likely(x) __builtin_expect(!!(x), 1)
                                      ^
/home/butta/android-ndk-r23/toolchains/llvm/prebuilt/linux-x86_64/bin/../sysroot/usr/include/c++/v1/atomic:1928:1: note: candidate template ignored: could not match 'atomic<type-parameter-0-0>' against '_Atomic(unsigned int)'
atomic_load_explicit(const volatile atomic<_Tp>* __o, memory_order __m) _NOEXCEPT
^
/home/butta/android-ndk-r23/toolchains/llvm/prebuilt/linux-x86_64/bin/../sysroot/usr/include/c++/v1/atomic:1937:1: note: candidate template ignored: could not match 'atomic<type-parameter-0-0>' against '_Atomic(unsigned int)'
atomic_load_explicit(const atomic<_Tp>* __o, memory_order __m) _NOEXCEPT
^
In file included from /home/butta/src/swift-corelibs-libdispatch/src/block.cpp:31:
In file included from /home/butta/src/swift-corelibs-libdispatch/src/internal.h:666:
In file included from /home/butta/src/swift-corelibs-libdispatch/src/shims.h:227:
/home/butta/src/swift-corelibs-libdispatch/src/shims/lock.h:649:9: error: no matching function for call to 'atomic_exchange_explicit'
        return os_atomic_xchg(&dgo->dgo_once, DLOCK_ONCE_DONE, release);
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/butta/src/swift-corelibs-libdispatch/src/shims/atomic.h:63:3: note: expanded from macro 'os_atomic_xchg'
                atomic_exchange_explicit(_os_atomic_c11_atomic(p), v, memory_order_##m)
                ^~~~~~~~~~~~~~~~~~~~~~~~
/home/butta/android-ndk-r23/toolchains/llvm/prebuilt/linux-x86_64/bin/../sysroot/usr/include/c++/v1/atomic:1966:1: note: candidate template ignored: could not match 'atomic<type-parameter-0-0>' against '_Atomic(unsigned long)'
atomic_exchange_explicit(volatile atomic<_Tp>* __o, _Tp __d, memory_order __m) _NOEXCEPT
^
/home/butta/android-ndk-r23/toolchains/llvm/prebuilt/linux-x86_64/bin/../sysroot/usr/include/c++/v1/atomic:1974:1: note: candidate template ignored: could not match 'atomic<type-parameter-0-0>' against '_Atomic(unsigned long)'
atomic_exchange_explicit(atomic<_Tp>* __o, _Tp __d, memory_order __m) _NOEXCEPT
^
In file included from /home/butta/src/swift-corelibs-libdispatch/src/block.cpp:31:
In file included from /home/butta/src/swift-corelibs-libdispatch/src/internal.h:666:
In file included from /home/butta/src/swift-corelibs-libdispatch/src/shims.h:227:
/home/butta/src/swift-corelibs-libdispatch/src/shims/lock.h:660:9: error: no matching function for call to 'atomic_load_explicit'
        return os_atomic_cmpxchg(&l->dgl_lock, DLOCK_GATE_UNLOCKED,
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/butta/src/swift-corelibs-libdispatch/src/shims/atomic.h:65:6: note: expanded from macro 'os_atomic_cmpxchg'
                ({ _os_atomic_basetypeof(p) _r = (e); \
                   ^~~~~~~~~~~~~~~~~~~~~~~~
/home/butta/src/swift-corelibs-libdispatch/src/shims/atomic.h:56:14: note: expanded from macro '_os_atomic_basetypeof'
                __typeof__(atomic_load_explicit(_os_atomic_c11_atomic(p), memory_order_relaxed))
                           ^~~~~~~~~~~~~~~~~~~~
/home/butta/android-ndk-r23/toolchains/llvm/prebuilt/linux-x86_64/bin/../sysroot/usr/include/c++/v1/atomic:1928:1: note: candidate template ignored: could not match 'atomic<type-parameter-0-0>' against '_Atomic(unsigned int)'
atomic_load_explicit(const volatile atomic<_Tp>* __o, memory_order __m) _NOEXCEPT
^
/home/butta/android-ndk-r23/toolchains/llvm/prebuilt/linux-x86_64/bin/../sysroot/usr/include/c++/v1/atomic:1937:1: note: candidate template ignored: could not match 'atomic<type-parameter-0-0>' against '_Atomic(unsigned int)'
atomic_load_explicit(const atomic<_Tp>* __o, memory_order __m) _NOEXCEPT
^
In file included from /home/butta/src/swift-corelibs-libdispatch/src/block.cpp:31:
In file included from /home/butta/src/swift-corelibs-libdispatch/src/internal.h:666:
In file included from /home/butta/src/swift-corelibs-libdispatch/src/shims.h:227:
/home/butta/src/swift-corelibs-libdispatch/src/shims/lock.h:660:9: error: cannot initialize return object of type 'bool' with an rvalue of type 'void'
        return os_atomic_cmpxchg(&l->dgl_lock, DLOCK_GATE_UNLOCKED,
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/butta/src/swift-corelibs-libdispatch/src/shims/atomic.h:65:3: note: expanded from macro 'os_atomic_cmpxchg'
                ({ _os_atomic_basetypeof(p) _r = (e); \
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/butta/src/swift-corelibs-libdispatch/src/block.cpp:31:
In file included from /home/butta/src/swift-corelibs-libdispatch/src/internal.h:666:
In file included from /home/butta/src/swift-corelibs-libdispatch/src/shims.h:227:
/home/butta/src/swift-corelibs-libdispatch/src/shims/lock.h:669:8: error: no matching function for call to 'atomic_exchange_explicit'
        cur = os_atomic_xchg(&l->dgl_lock, DLOCK_GATE_UNLOCKED, release);
              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/butta/src/swift-corelibs-libdispatch/src/shims/atomic.h:63:3: note: expanded from macro 'os_atomic_xchg'
                atomic_exchange_explicit(_os_atomic_c11_atomic(p), v, memory_order_##m)
                ^~~~~~~~~~~~~~~~~~~~~~~~
/home/butta/android-ndk-r23/toolchains/llvm/prebuilt/linux-x86_64/bin/../sysroot/usr/include/c++/v1/atomic:1966:1: note: candidate template ignored: could not match 'atomic<type-parameter-0-0>' against '_Atomic(unsigned int)'
atomic_exchange_explicit(volatile atomic<_Tp>* __o, _Tp __d, memory_order __m) _NOEXCEPT
^
/home/butta/android-ndk-r23/toolchains/llvm/prebuilt/linux-x86_64/bin/../sysroot/usr/include/c++/v1/atomic:1974:1: note: candidate template ignored: could not match 'atomic<type-parameter-0-0>' against '_Atomic(unsigned int)'
atomic_exchange_explicit(atomic<_Tp>* __o, _Tp __d, memory_order __m) _NOEXCEPT
^
In file included from /home/butta/src/swift-corelibs-libdispatch/src/block.cpp:31:
In file included from /home/butta/src/swift-corelibs-libdispatch/src/internal.h:666:
In file included from /home/butta/src/swift-corelibs-libdispatch/src/shims.h:227:
/home/butta/src/swift-corelibs-libdispatch/src/shims/lock.h:678:9: error: no matching function for call to 'atomic_load_explicit'
        return os_atomic_cmpxchg(&l->dgo_once, DLOCK_ONCE_UNLOCKED,
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/butta/src/swift-corelibs-libdispatch/src/shims/atomic.h:65:6: note: expanded from macro 'os_atomic_cmpxchg'
                ({ _os_atomic_basetypeof(p) _r = (e); \
                   ^~~~~~~~~~~~~~~~~~~~~~~~
/home/butta/src/swift-corelibs-libdispatch/src/shims/atomic.h:56:14: note: expanded from macro '_os_atomic_basetypeof'
                __typeof__(atomic_load_explicit(_os_atomic_c11_atomic(p), memory_order_relaxed))
                           ^~~~~~~~~~~~~~~~~~~~
/home/butta/android-ndk-r23/toolchains/llvm/prebuilt/linux-x86_64/bin/../sysroot/usr/include/c++/v1/atomic:1928:1: note: candidate template ignored: could not match 'atomic<type-parameter-0-0>' against '_Atomic(unsigned long)'
atomic_load_explicit(const volatile atomic<_Tp>* __o, memory_order __m) _NOEXCEPT
^
/home/butta/android-ndk-r23/toolchains/llvm/prebuilt/linux-x86_64/bin/../sysroot/usr/include/c++/v1/atomic:1937:1: note: candidate template ignored: could not match 'atomic<type-parameter-0-0>' against '_Atomic(unsigned long)'
atomic_load_explicit(const atomic<_Tp>* __o, memory_order __m) _NOEXCEPT
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
[5/47][ 10%][0.440s] Building C object tests/CMakeFiles/dispatch_data.dir/dispatch_data.c.o
ninja: build stopped: subcommand failed.
[2/225][  0%][0.673s] Building CXX object stdlib/public/CMakeFiles/swiftDemangling-android-aarch64.dir/__/__/lib/Demangling/NodeDumper.cpp.o
ninja: build stopped: subcommand failed.
Building the standard library for: swift-test-stdlib-linux-x86_64 swift-test-stdlib-android-aarch64
Building the standard library for: swift-test-stdlib-android-aarch64
ERROR: command terminated with a non-zero exit status 1, aborting

It looks like switching to C++ <atomic> for libdispatch isn't working atm.

@finagolfin
Copy link
Contributor Author

Btw, the Android CI has been broken for the last month with this issue, because the LLVM rebranch last month switched from linking Android against libgcc to compiler-rt, swiftlang/llvm-project@a478b0a, so Daniel switched the Android NDK on the CI to the latest version 23 that uses such a recent clang too, but has a sysroot that also made this stdatomic.h change.

Since this pull only affects Android and is a workaround for another header that does not conform to the C++ standard in this codebase, I think we should just get this in as a workaround for Android, since nobody has come up with another solution that works.

@drodriguez
Copy link
Contributor

@swift-ci please test

@drodriguez
Copy link
Contributor

@shahmishal can we merge this one to unblock the Android CI before the Thanksgiving break? Thanks!

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.

7 participants