[all-commits] [llvm/llvm-project] e01843: [libc++] Link against libatomic when it is found

Louis Dionne via All-commits all-commits at lists.llvm.org
Fri Jun 5 06:29:03 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: e0184357fc781e939f4e4368fc8aff692ce227ed
      https://github.com/llvm/llvm-project/commit/e0184357fc781e939f4e4368fc8aff692ce227ed
  Author: Louis Dionne <ldionne at apple.com>
  Date:   2020-06-05 (Fri, 05 Jun 2020)

  Changed paths:
    M libcxx/CMakeLists.txt
    R libcxx/cmake/Modules/CheckLibcxxAtomic.cmake
    M libcxx/cmake/config-ix.cmake
    A libcxx/test/libcxx/atomics/atomics.align/align.pass.pass.cpp
    R libcxx/test/libcxx/atomics/atomics.align/align.pass.sh.cpp
    M libcxx/test/libcxx/selftest/dsl/dsl.sh.py
    M libcxx/test/lit.site.cfg.in
    M libcxx/utils/libcxx/test/config.py
    M libcxx/utils/libcxx/test/dsl.py
    M libcxx/utils/libcxx/test/features.py
    M libcxx/utils/libcxx/test/target_info.py

  Log Message:
  -----------
  [libc++] Link against libatomic when it is found

Before this patch, we tried detecting whether small atomics were available
without linking against libatomic. However, that's not really what we want
to know -- instead, we want to know what's required in order to support
atomics fully, which is to link against libatomic when it's provided.

That is both much simpler, and it doesn't suffer the problem that we would
not link against libatomic when small atomics didn't require it, which
lead to non-lockfree atomics never working.

Furthermore, because we understand that some platforms might not want to
(or be able to) ship non-lockfree atomics, we add that notion to the test
suite, independently of a potential extern library.

After this patch, we therefore:
(1) Link against libatomic when it is provided
(2) Independently detect whether non-lockfree atomics are supported in
    the test suite, regardless of whether that means we're linking against
    an external library or not (which is an implementation detail).

Differential Revision: https://reviews.llvm.org/D81190




More information about the All-commits mailing list