[libcxx-commits] [libcxx] [libc++] Floating Point Atomic (PR #67799)

via libcxx-commits libcxx-commits at lists.llvm.org
Wed Nov 22 14:05:30 PST 2023


huixie90 wrote:

> > > We started seeing tests failures after this patch:
> > > [...]
> > 
> > 
> > This is likely because our tests didn't reference that function before (our tests for atomics were very very naive). But that function should be provided by compiler-rt. Can you dig into it a bit more? This isn't something wrong with this patch per se, it's probably something wrong with the testing configuration on Fuchsia (which might be attributable to libc++'s config or not).
> 
> To be clear, this is a Fuchsia Clang toolchain, but the test is actually failing on Linux so it's not Fuchsia-specific. What's somewhat unusual for our toolchain is that we ship `libclang_rt.atomic.so` (that's part of compiler-rt) and there is no `libatomic.so` (that's part of GCC) available on our bots (because we want our toolchain to be fully hermetic). We already encountered an issue in compiler-rt tests which were linking `libatomic.so` unconditionally and we had to address that in https://reviews.llvm.org/D151680.
> 
> I see neither `libatomic.so` nor `libclang_rt.atomic.so` in the failing link command. Do you know how are those references satisfied in other toolchains?

Hello, the test is conditionally adding -latomic if compiling a dummy programme with -latomic return 0.  In Libc++ CI, on Linux -latomic would be valid so it would add -latomic in the test. On Mac, -latomic would make the dummy program fail to compile/link , so it would not add the flag.  But the test link fine without the flag. 

I guess in Fushia, the -latomic dummy program test returned false , so it did not add the flag.  What is the right way to link under fushia ?

https://github.com/llvm/llvm-project/pull/67799


More information about the libcxx-commits mailing list