[libcxx-commits] [libcxx] 09cebfb - Revert "[libc++] Always build c++experimental.a"

Hans Wennborg via libcxx-commits libcxx-commits at lists.llvm.org
Mon Jul 18 07:57:27 PDT 2022


Author: Hans Wennborg
Date: 2022-07-18T16:57:15+02:00
New Revision: 09cebfb978def7fa2a4460bca89690f8d3608216

URL: https://github.com/llvm/llvm-project/commit/09cebfb978def7fa2a4460bca89690f8d3608216
DIFF: https://github.com/llvm/llvm-project/commit/09cebfb978def7fa2a4460bca89690f8d3608216.diff

LOG: Revert "[libc++] Always build c++experimental.a"

This caused build failures when building Clang and libc++ together on Mac:

  fatal error: 'experimental/memory_resource' file not found

See the code review for details. Reverting until the problem and how to
solve it is better understood.

(Updates to some test files were not reverted, since they seemed
unrelated and were later updated by 340b48b267b96.)

> This is the first part of a plan to ship experimental features
> by default while guarding them behind a compiler flag to avoid
> users accidentally depending on them. Subsequent patches will
> also encompass incomplete features (such as <format> and <ranges>)
> in that categorization. Basically, the idea is that we always
> build and ship the c++experimental library, however users can't
> use what's in it unless they pass the `-funstable` flag to Clang.
>
> Note that this patch intentionally does not start guarding
> existing <experimental/FOO> content behind the flag, because
> that would merely break users that might be relying on such
> content being in the headers unconditionally. Instead, we
> should start guarding new TSes behind the flag, and get rid
> of the existing TSes we have by shipping their Standard
> counterpart.
>
> Also, this patch must jump through a few hoops like defining
> _LIBCPP_ENABLE_EXPERIMENTAL because we still support compilers
> that do not implement -funstable yet.
>
> Differential Revision: https://reviews.llvm.org/D128927

This reverts commit bb939931a1adb9a47a2de13c359d6a72aeb277c8.

Added: 
    

Modified: 
    clang/cmake/caches/Fuchsia-stage2.cmake
    clang/cmake/caches/Fuchsia.cmake
    compiler-rt/cmake/Modules/AddCompilerRT.cmake
    libcxx/CMakeLists.txt
    libcxx/appveyor.yml
    libcxx/cmake/caches/AIX.cmake
    libcxx/cmake/caches/Apple.cmake
    libcxx/cmake/caches/Generic-no-experimental.cmake
    libcxx/docs/BuildingLibcxx.rst
    libcxx/docs/UsingLibcxx.rst
    libcxx/src/CMakeLists.txt
    libcxx/test/CMakeLists.txt
    libcxx/test/libcxx/experimental/memory/memory.resource.global/global_memory_resource_lifetime.pass.cpp
    libcxx/test/libcxx/experimental/memory/memory.resource.global/new_delete_resource_lifetime.pass.cpp
    libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_pair.pass.cpp
    libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_piecewise_pair_evil.pass.cpp
    libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/destroy.pass.cpp
    libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/resource.pass.cpp
    libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/select_on_container_copy_construction.pass.cpp
    libcxx/test/std/experimental/memory/memory.resource.aliases/header_deque_synop.pass.cpp
    libcxx/test/std/experimental/memory/memory.resource.aliases/header_forward_list_synop.pass.cpp
    libcxx/test/std/experimental/memory/memory.resource.aliases/header_list_synop.pass.cpp
    libcxx/test/std/experimental/memory/memory.resource.aliases/header_map_synop.pass.cpp
    libcxx/test/std/experimental/memory/memory.resource.aliases/header_regex_synop.pass.cpp
    libcxx/test/std/experimental/memory/memory.resource.aliases/header_set_synop.pass.cpp
    libcxx/test/std/experimental/memory/memory.resource.aliases/header_string_synop.pass.cpp
    libcxx/test/std/experimental/memory/memory.resource.aliases/header_unordered_map_synop.pass.cpp
    libcxx/test/std/experimental/memory/memory.resource.aliases/header_unordered_set_synop.pass.cpp
    libcxx/test/std/experimental/memory/memory.resource.aliases/header_vector_synop.pass.cpp
    libcxx/test/std/experimental/memory/memory.resource.global/new_delete_resource.pass.cpp
    libcxx/test/std/experimental/memory/memory.resource.global/null_memory_resource.pass.cpp
    libcxx/utils/ci/run-buildbot
    libcxx/utils/libcxx/test/params.py

Removed: 
    


################################################################################
diff  --git a/clang/cmake/caches/Fuchsia-stage2.cmake b/clang/cmake/caches/Fuchsia-stage2.cmake
index 566df27c1d1c..13d47d16508d 100644
--- a/clang/cmake/caches/Fuchsia-stage2.cmake
+++ b/clang/cmake/caches/Fuchsia-stage2.cmake
@@ -80,6 +80,7 @@ if(WIN32)
   set(RUNTIMES_${target}_CMAKE_SYSTEM_NAME Windows CACHE STRING "")
   set(RUNTIMES_${target}_CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "")
   set(RUNTIMES_${target}_LIBCXX_ABI_VERSION 2 CACHE STRING "")
+  set(RUNTIMES_${target}_LIBCXX_ENABLE_EXPERIMENTAL_LIBRARY OFF CACHE BOOL "")
   set(RUNTIMES_${target}_LIBCXX_ENABLE_FILESYSTEM OFF CACHE BOOL "")
   set(RUNTIMES_${target}_LIBCXX_ENABLE_ABI_LINKER_SCRIPT OFF CACHE BOOL "")
   set(RUNTIMES_${target}_LIBCXX_ENABLE_SHARED OFF CACHE BOOL "")

diff  --git a/clang/cmake/caches/Fuchsia.cmake b/clang/cmake/caches/Fuchsia.cmake
index 73ef57150717..83232b776ad9 100644
--- a/clang/cmake/caches/Fuchsia.cmake
+++ b/clang/cmake/caches/Fuchsia.cmake
@@ -51,6 +51,7 @@ endif()
 
 if(WIN32)
   set(LIBCXX_ABI_VERSION 2 CACHE STRING "")
+  set(LIBCXX_ENABLE_EXPERIMENTAL_LIBRARY OFF CACHE BOOL "")
   set(LIBCXX_ENABLE_FILESYSTEM OFF CACHE BOOL "")
   set(LIBCXX_ENABLE_ABI_LINKER_SCRIPT OFF CACHE BOOL "")
   set(LIBCXX_ENABLE_SHARED OFF CACHE BOOL "")

diff  --git a/compiler-rt/cmake/Modules/AddCompilerRT.cmake b/compiler-rt/cmake/Modules/AddCompilerRT.cmake
index 00bb892be595..b7eb04327bb1 100644
--- a/compiler-rt/cmake/Modules/AddCompilerRT.cmake
+++ b/compiler-rt/cmake/Modules/AddCompilerRT.cmake
@@ -685,6 +685,7 @@ macro(add_custom_libcxx name prefix)
                -DLIBCXXABI_HERMETIC_STATIC_LIBRARY=ON
                -DLIBCXXABI_INCLUDE_TESTS=OFF
                -DLIBCXX_CXX_ABI=libcxxabi
+               -DLIBCXX_ENABLE_EXPERIMENTAL_LIBRARY=OFF
                -DLIBCXX_ENABLE_SHARED=OFF
                -DLIBCXX_HERMETIC_STATIC_LIBRARY=ON
                -DLIBCXX_INCLUDE_BENCHMARKS=OFF

diff  --git a/libcxx/CMakeLists.txt b/libcxx/CMakeLists.txt
index 0977a7229e5d..3d63bb0c8fbf 100644
--- a/libcxx/CMakeLists.txt
+++ b/libcxx/CMakeLists.txt
@@ -55,6 +55,7 @@ option(LIBCXX_ENABLE_ASSERTIONS
    by users in their own code regardless of this option." OFF)
 option(LIBCXX_ENABLE_SHARED "Build libc++ as a shared library." ON)
 option(LIBCXX_ENABLE_STATIC "Build libc++ as a static library." ON)
+option(LIBCXX_ENABLE_EXPERIMENTAL_LIBRARY "Build libc++experimental.a" ON)
 set(ENABLE_FILESYSTEM_DEFAULT ON)
 if (WIN32 AND NOT MINGW)
   # Filesystem is buildable for windows, but it requires __int128 helper
@@ -166,6 +167,9 @@ cmake_dependent_option(LIBCXX_INSTALL_STATIC_LIBRARY
 cmake_dependent_option(LIBCXX_INSTALL_SHARED_LIBRARY
   "Install the shared libc++ library." ON
   "LIBCXX_ENABLE_SHARED;LIBCXX_INSTALL_LIBRARY" OFF)
+cmake_dependent_option(LIBCXX_INSTALL_EXPERIMENTAL_LIBRARY
+        "Install libc++experimental.a" ON
+        "LIBCXX_ENABLE_EXPERIMENTAL_LIBRARY;LIBCXX_INSTALL_LIBRARY" OFF)
 
 option(LIBCXX_ABI_UNSTABLE "Use the unstable ABI of libc++. This is equivalent to specifying LIBCXX_ABI_VERSION=n, where n is the not-yet-stable version." OFF)
 if (LIBCXX_ABI_UNSTABLE)
@@ -926,7 +930,11 @@ add_subdirectory(include)
 add_subdirectory(src)
 add_subdirectory(utils)
 
-set(LIBCXX_TEST_DEPS "cxx_experimental")
+set(LIBCXX_TEST_DEPS "")
+
+if (LIBCXX_ENABLE_EXPERIMENTAL_LIBRARY)
+  list(APPEND LIBCXX_TEST_DEPS cxx_experimental)
+endif()
 
 if (LIBCXX_BUILD_EXTERNAL_THREAD_LIBRARY)
   list(APPEND LIBCXX_TEST_DEPS cxx_external_threads)

diff  --git a/libcxx/appveyor.yml b/libcxx/appveyor.yml
index ea2c88e5fda7..ae7c7ad7cf67 100644
--- a/libcxx/appveyor.yml
+++ b/libcxx/appveyor.yml
@@ -45,7 +45,7 @@ build_script:
   #############################################################################
   - cmake -G "%GENERATOR%" %CMAKE_OPTIONS%
     "-DCMAKE_BUILD_TYPE=%configuration%"
-    "-DLLVM_PATH=C:\projects\deps\llvm"
+    "-DLLVM_PATH=C:\projects\deps\llvm" -DLIBCXX_ENABLE_EXPERIMENTAL_LIBRARY=OFF
     -DLLVM_LIT_ARGS="-sv --show-xfail --show-unsupported"
     %APPVEYOR_BUILD_FOLDER%
 

diff  --git a/libcxx/cmake/caches/AIX.cmake b/libcxx/cmake/caches/AIX.cmake
index 76cf17791301..b6c483a31727 100644
--- a/libcxx/cmake/caches/AIX.cmake
+++ b/libcxx/cmake/caches/AIX.cmake
@@ -9,6 +9,7 @@ set(LIBCXX_USE_COMPILER_RT ON CACHE BOOL "")
 set(LIBCXX_ENABLE_ASSERTIONS OFF CACHE BOOL "")
 set(LIBCXX_ABI_VERSION "1" CACHE STRING "")
 set(LIBCXX_ENABLE_ABI_LINKER_SCRIPT OFF CACHE BOOL "")
+set(LIBCXX_ENABLE_EXPERIMENTAL_LIBRARY OFF CACHE BOOL "")
 set(LIBCXX_ENABLE_SHARED ON CACHE BOOL "")
 set(LIBCXX_ENABLE_STATIC OFF CACHE BOOL "")
 set(LIBCXXABI_ENABLE_SHARED ON CACHE BOOL "")

diff  --git a/libcxx/cmake/caches/Apple.cmake b/libcxx/cmake/caches/Apple.cmake
index 734f5ac8a1b9..ea701a43f96a 100644
--- a/libcxx/cmake/caches/Apple.cmake
+++ b/libcxx/cmake/caches/Apple.cmake
@@ -4,6 +4,7 @@ set(CMAKE_POSITION_INDEPENDENT_CODE OFF CACHE BOOL "")
 set(LIBCXX_USE_COMPILER_RT ON CACHE BOOL "")
 set(LIBCXX_ENABLE_ASSERTIONS OFF CACHE BOOL "")
 set(LIBCXX_ABI_VERSION "1" CACHE STRING "")
+set(LIBCXX_ENABLE_EXPERIMENTAL_LIBRARY OFF CACHE BOOL "")
 set(LIBCXX_ENABLE_STATIC ON CACHE BOOL "")
 set(LIBCXX_ENABLE_SHARED ON CACHE BOOL "")
 set(LIBCXX_CXX_ABI libcxxabi CACHE STRING "")

diff  --git a/libcxx/cmake/caches/Generic-no-experimental.cmake b/libcxx/cmake/caches/Generic-no-experimental.cmake
index 98f01418d197..0f055f4a98e0 100644
--- a/libcxx/cmake/caches/Generic-no-experimental.cmake
+++ b/libcxx/cmake/caches/Generic-no-experimental.cmake
@@ -1,3 +1,2 @@
-set(LIBCXX_TEST_PARAMS "enable_experimental=False" CACHE STRING "")
-set(LIBCXXABI_TEST_PARAMS "${LIBCXX_TEST_PARAMS}" CACHE STRING "")
+set(LIBCXX_ENABLE_EXPERIMENTAL_LIBRARY OFF CACHE BOOL "")
 set(LIBCXX_ENABLE_INCOMPLETE_FEATURES OFF CACHE BOOL "")

diff  --git a/libcxx/docs/BuildingLibcxx.rst b/libcxx/docs/BuildingLibcxx.rst
index 7c347c6b57ba..5069c7fe0692 100644
--- a/libcxx/docs/BuildingLibcxx.rst
+++ b/libcxx/docs/BuildingLibcxx.rst
@@ -99,7 +99,8 @@ it is the simplest way to build.
           -T "ClangCL"                                    ^
           -DLLVM_ENABLE_RUNTIMES=libcxx                   ^
           -DLIBCXX_ENABLE_SHARED=YES                      ^
-          -DLIBCXX_ENABLE_STATIC=NO
+          -DLIBCXX_ENABLE_STATIC=NO                       ^
+          -DLIBCXX_ENABLE_EXPERIMENTAL_LIBRARY=NO
   > cmake --build build
 
 CMake + ninja (MSVC)
@@ -130,7 +131,8 @@ In either case, then run:
   > cmake -G Ninja -S runtimes -B build                                               ^
           -DCMAKE_C_COMPILER=clang-cl                                                 ^
           -DCMAKE_CXX_COMPILER=clang-cl                                               ^
-          -DLLVM_ENABLE_RUNTIMES=libcxx
+          -DLLVM_ENABLE_RUNTIMES=libcxx                                               ^
+          -DLIBCXX_ENABLE_EXPERIMENTAL_LIBRARY=NO
   > ninja -C build cxx
   > ninja -C build check-cxx
 
@@ -296,6 +298,23 @@ libc++ specific options
   Path where target-specific libc++ headers should be installed. If a relative
   path, relative to ``CMAKE_INSTALL_PREFIX``.
 
+.. _libc++experimental options:
+
+libc++experimental Specific Options
+------------------------------------
+
+.. option:: LIBCXX_ENABLE_EXPERIMENTAL_LIBRARY:BOOL
+
+  **Default**: ``ON``
+
+  Build and test libc++experimental.a.
+
+.. option:: LIBCXX_INSTALL_EXPERIMENTAL_LIBRARY:BOOL
+
+  **Default**: ``LIBCXX_ENABLE_EXPERIMENTAL_LIBRARY AND LIBCXX_INSTALL_LIBRARY``
+
+  Install libc++experimental.a alongside libc++.
+
 
 .. _ABI Library Specific Options:
 

diff  --git a/libcxx/docs/UsingLibcxx.rst b/libcxx/docs/UsingLibcxx.rst
index 343937b94149..f69f9990cf31 100644
--- a/libcxx/docs/UsingLibcxx.rst
+++ b/libcxx/docs/UsingLibcxx.rst
@@ -34,20 +34,22 @@ matches that Standard in the library.
   library until the standard has been ratified.
 
 
-Enabling experimental C++ Library features
-==========================================
+Using libc++experimental and ``<experimental/...>``
+===================================================
 
-Libc++ provides implementations of some experimental features. Experimental features
-are either Technical Specifications (TSes) or official features that were voted to
-the Standard but whose implementation is not complete or stable yet in libc++. Those
-are disabled by default because they are neither API nor ABI stable. However, the
-``_LIBCPP_ENABLE_EXPERIMENTAL`` macro can be defined to turn those features on. Note
-that you will also need to link to the appropriate ``libc++experimental.a`` static
-archive.
+Libc++ provides implementations of experimental technical specifications
+in a separate library, ``libc++experimental.a``. Users of ``<experimental/...>``
+headers may be required to link ``-lc++experimental``. Note that not all
+vendors ship ``libc++experimental.a``, and as a result, you may not be
+able to use those experimental features.
+
+.. code-block:: bash
+
+  $ clang++ test.cpp -lc++experimental
 
 .. warning::
   Experimental libraries are Experimental.
-    * The contents of the ``<experimental/...>`` headers and the associated static
+    * The contents of the ``<experimental/...>`` headers and ``libc++experimental.a``
       library will not remain compatible between versions.
     * No guarantees of API or ABI stability are provided.
     * When the standardized version of an experimental feature is implemented,

diff  --git a/libcxx/src/CMakeLists.txt b/libcxx/src/CMakeLists.txt
index 10123074f83e..28436fbf38f4 100644
--- a/libcxx/src/CMakeLists.txt
+++ b/libcxx/src/CMakeLists.txt
@@ -315,30 +315,31 @@ endif()
 # Add a meta-target for both libraries.
 add_custom_target(cxx DEPENDS ${LIBCXX_BUILD_TARGETS})
 
-set(LIBCXX_EXPERIMENTAL_SOURCES
-  experimental/memory_resource.cpp
-  )
+if (LIBCXX_ENABLE_EXPERIMENTAL_LIBRARY)
+  set(LIBCXX_EXPERIMENTAL_SOURCES
+    experimental/memory_resource.cpp
+    )
+  add_library(cxx_experimental STATIC ${LIBCXX_EXPERIMENTAL_SOURCES})
+  if (LIBCXX_ENABLE_SHARED)
+    target_link_libraries(cxx_experimental PRIVATE cxx_shared)
+  else()
+    target_link_libraries(cxx_experimental PRIVATE cxx_static)
+  endif()
 
-add_library(cxx_experimental STATIC ${LIBCXX_EXPERIMENTAL_SOURCES})
-if (LIBCXX_ENABLE_SHARED)
-  target_link_libraries(cxx_experimental PRIVATE cxx_shared)
-else()
-  target_link_libraries(cxx_experimental PRIVATE cxx_static)
-endif()
+  set_target_properties(cxx_experimental
+    PROPERTIES
+      COMPILE_FLAGS "${LIBCXX_COMPILE_FLAGS}"
+      OUTPUT_NAME   "c++experimental"
+  )
+  cxx_add_common_build_flags(cxx_experimental)
 
-if (LIBCXX_HERMETIC_STATIC_LIBRARY)
-  # _LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS can be defined in __config_site
-  # too. Define it in the same way here, to avoid redefinition conflicts.
-  target_compile_definitions(cxx_experimental PRIVATE _LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS=)
+  if (LIBCXX_HERMETIC_STATIC_LIBRARY)
+    # _LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS can be defined in __config_site
+    # too. Define it in the same way here, to avoid redefinition conflicts.
+    target_compile_definitions(cxx_experimental PRIVATE _LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS=)
+  endif()
 endif()
 
-set_target_properties(cxx_experimental
-  PROPERTIES
-    COMPILE_FLAGS "${LIBCXX_COMPILE_FLAGS}"
-    OUTPUT_NAME   "c++experimental"
-)
-cxx_add_common_build_flags(cxx_experimental)
-
 
 if (LIBCXX_BUILD_EXTERNAL_THREAD_LIBRARY)
   set(LIBCXX_EXTERNAL_THREADING_SUPPORT_SOURCES
@@ -374,7 +375,7 @@ if (LIBCXX_INSTALL_STATIC_LIBRARY)
     RUNTIME DESTINATION ${LIBCXX_INSTALL_RUNTIME_DIR} COMPONENT cxx)
 endif()
 
-if (LIBCXX_INSTALL_LIBRARY)
+if(LIBCXX_INSTALL_EXPERIMENTAL_LIBRARY)
   install(TARGETS cxx_experimental
     LIBRARY DESTINATION ${LIBCXX_INSTALL_LIBRARY_DIR} COMPONENT cxx
     ARCHIVE DESTINATION ${LIBCXX_INSTALL_LIBRARY_DIR} COMPONENT cxx
@@ -391,7 +392,10 @@ endif()
 
 if (NOT CMAKE_CONFIGURATION_TYPES)
     if(LIBCXX_INSTALL_LIBRARY)
-      set(lib_install_target "cxx;cxx_experimental")
+      set(lib_install_target cxx)
+    endif()
+    if (LIBCXX_INSTALL_EXPERIMENTAL_LIBRARY)
+      set(experimental_lib_install_target cxx_experimental)
     endif()
     if(LIBCXX_INSTALL_HEADERS)
       set(header_install_target install-cxx-headers)
@@ -401,7 +405,7 @@ if (NOT CMAKE_CONFIGURATION_TYPES)
     endif()
     add_custom_target(install-cxx
                       DEPENDS ${lib_install_target}
-                              cxx_experimental
+                              ${experimental_lib_install_target}
                               ${header_install_target}
                               ${pstl_install_target}
                       COMMAND "${CMAKE_COMMAND}"
@@ -409,7 +413,7 @@ if (NOT CMAKE_CONFIGURATION_TYPES)
                       -P "${LIBCXX_BINARY_DIR}/cmake_install.cmake")
     add_custom_target(install-cxx-stripped
                       DEPENDS ${lib_install_target}
-                              cxx_experimental
+                              ${experimental_lib_install_target}
                               ${header_install_target}
                               ${pstl_install_target}
                       COMMAND "${CMAKE_COMMAND}"

diff  --git a/libcxx/test/CMakeLists.txt b/libcxx/test/CMakeLists.txt
index b06db91536eb..b85f726fd1c0 100644
--- a/libcxx/test/CMakeLists.txt
+++ b/libcxx/test/CMakeLists.txt
@@ -93,6 +93,10 @@ if (NOT LIBCXX_ENABLE_EXCEPTIONS)
   serialize_lit_param(enable_exceptions False)
 endif()
 
+if (NOT LIBCXX_ENABLE_EXPERIMENTAL_LIBRARY)
+  serialize_lit_param(enable_experimental False)
+endif()
+
 if (NOT LIBCXX_ENABLE_RTTI)
   serialize_lit_param(enable_rtti False)
 endif()

diff  --git a/libcxx/test/libcxx/experimental/memory/memory.resource.global/global_memory_resource_lifetime.pass.cpp b/libcxx/test/libcxx/experimental/memory/memory.resource.global/global_memory_resource_lifetime.pass.cpp
index 876aa2dad149..a3b5eade7d08 100644
--- a/libcxx/test/libcxx/experimental/memory/memory.resource.global/global_memory_resource_lifetime.pass.cpp
+++ b/libcxx/test/libcxx/experimental/memory/memory.resource.global/global_memory_resource_lifetime.pass.cpp
@@ -8,11 +8,6 @@
 
 // UNSUPPORTED: c++03
 
-// Aligned allocation is required by std::experimental::pmr, but it was not provided
-// before macosx10.13 and as a result we get linker errors when deploying to older than
-// macosx10.13.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}}
-
 // <experimental/memory_resource>
 
 // memory_resource * new_delete_resource()

diff  --git a/libcxx/test/libcxx/experimental/memory/memory.resource.global/new_delete_resource_lifetime.pass.cpp b/libcxx/test/libcxx/experimental/memory/memory.resource.global/new_delete_resource_lifetime.pass.cpp
index 04748c3b5895..1a99d02ebdba 100644
--- a/libcxx/test/libcxx/experimental/memory/memory.resource.global/new_delete_resource_lifetime.pass.cpp
+++ b/libcxx/test/libcxx/experimental/memory/memory.resource.global/new_delete_resource_lifetime.pass.cpp
@@ -8,11 +8,6 @@
 
 // UNSUPPORTED: c++03
 
-// Aligned allocation is required by std::experimental::pmr, but it was not provided
-// before macosx10.13 and as a result we get linker errors when deploying to older than
-// macosx10.13.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}}
-
 // <experimental/memory_resource>
 
 // memory_resource * new_delete_resource()

diff  --git a/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_pair.pass.cpp b/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_pair.pass.cpp
index 6fc77f58428b..d080b059e2f0 100644
--- a/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_pair.pass.cpp
+++ b/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_pair.pass.cpp
@@ -8,11 +8,6 @@
 
 // UNSUPPORTED: c++03
 
-// Aligned allocation is required by std::experimental::pmr, but it was not provided
-// before macosx10.13 and as a result we get linker errors when deploying to older than
-// macosx10.13.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}}
-
 // <experimental/memory_resource>
 
 // template <class T> class polymorphic_allocator

diff  --git a/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_piecewise_pair_evil.pass.cpp b/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_piecewise_pair_evil.pass.cpp
index 5f71e4b5eb65..2a9ca2b39b4b 100644
--- a/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_piecewise_pair_evil.pass.cpp
+++ b/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_piecewise_pair_evil.pass.cpp
@@ -8,11 +8,6 @@
 
 // UNSUPPORTED: c++03
 
-// Aligned allocation is required by std::experimental::pmr, but it was not provided
-// before macosx10.13 and as a result we get linker errors when deploying to older than
-// macosx10.13.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}}
-
 // <memory_resource>
 
 // template <class T> class polymorphic_allocator

diff  --git a/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/destroy.pass.cpp b/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/destroy.pass.cpp
index 58550fe53068..6030c132a0b8 100644
--- a/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/destroy.pass.cpp
+++ b/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/destroy.pass.cpp
@@ -8,11 +8,6 @@
 
 // UNSUPPORTED: c++03
 
-// Aligned allocation is required by std::experimental::pmr, but it was not provided
-// before macosx10.13 and as a result we get linker errors when deploying to older than
-// macosx10.13.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}}
-
 // <experimental/memory_resource>
 
 // template <class T> class polymorphic_allocator

diff  --git a/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/resource.pass.cpp b/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/resource.pass.cpp
index 1a8146ce0ca4..2776e16b1d68 100644
--- a/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/resource.pass.cpp
+++ b/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/resource.pass.cpp
@@ -8,11 +8,6 @@
 
 // UNSUPPORTED: c++03
 
-// Aligned allocation is required by std::experimental::pmr, but it was not provided
-// before macosx10.13 and as a result we get linker errors when deploying to older than
-// macosx10.13.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}}
-
 // <experimental/memory_resource>
 
 // template <class T> class polymorphic_allocator

diff  --git a/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/select_on_container_copy_construction.pass.cpp b/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/select_on_container_copy_construction.pass.cpp
index 7ab203401dc4..5ca6e812c98c 100644
--- a/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/select_on_container_copy_construction.pass.cpp
+++ b/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/select_on_container_copy_construction.pass.cpp
@@ -8,11 +8,6 @@
 
 // UNSUPPORTED: c++03
 
-// Aligned allocation is required by std::experimental::pmr, but it was not provided
-// before macosx10.13 and as a result we get linker errors when deploying to older than
-// macosx10.13.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}}
-
 // <experimental/memory_resource>
 
 // template <class T> class polymorphic_allocator

diff  --git a/libcxx/test/std/experimental/memory/memory.resource.aliases/header_deque_synop.pass.cpp b/libcxx/test/std/experimental/memory/memory.resource.aliases/header_deque_synop.pass.cpp
index 21e3d01d5862..34ea9e1b303c 100644
--- a/libcxx/test/std/experimental/memory/memory.resource.aliases/header_deque_synop.pass.cpp
+++ b/libcxx/test/std/experimental/memory/memory.resource.aliases/header_deque_synop.pass.cpp
@@ -8,11 +8,6 @@
 
 // UNSUPPORTED: c++03
 
-// Aligned allocation is required by std::experimental::pmr, but it was not provided
-// before macosx10.13 and as a result we get linker errors when deploying to older than
-// macosx10.13.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}}
-
 // <experimental/deque>
 
 // namespace std { namespace experimental { namespace pmr {

diff  --git a/libcxx/test/std/experimental/memory/memory.resource.aliases/header_forward_list_synop.pass.cpp b/libcxx/test/std/experimental/memory/memory.resource.aliases/header_forward_list_synop.pass.cpp
index 7925f1058c63..f20d176eccf3 100644
--- a/libcxx/test/std/experimental/memory/memory.resource.aliases/header_forward_list_synop.pass.cpp
+++ b/libcxx/test/std/experimental/memory/memory.resource.aliases/header_forward_list_synop.pass.cpp
@@ -8,11 +8,6 @@
 
 // UNSUPPORTED: c++03
 
-// Aligned allocation is required by std::experimental::pmr, but it was not provided
-// before macosx10.13 and as a result we get linker errors when deploying to older than
-// macosx10.13.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}}
-
 // <experimental/forward_list>
 
 // namespace std { namespace experimental { namespace pmr {

diff  --git a/libcxx/test/std/experimental/memory/memory.resource.aliases/header_list_synop.pass.cpp b/libcxx/test/std/experimental/memory/memory.resource.aliases/header_list_synop.pass.cpp
index d33d132cd804..c4eae679d7e2 100644
--- a/libcxx/test/std/experimental/memory/memory.resource.aliases/header_list_synop.pass.cpp
+++ b/libcxx/test/std/experimental/memory/memory.resource.aliases/header_list_synop.pass.cpp
@@ -8,11 +8,6 @@
 
 // UNSUPPORTED: c++03
 
-// Aligned allocation is required by std::experimental::pmr, but it was not provided
-// before macosx10.13 and as a result we get linker errors when deploying to older than
-// macosx10.13.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}}
-
 // <experimental/list>
 
 // namespace std { namespace experimental { namespace pmr {

diff  --git a/libcxx/test/std/experimental/memory/memory.resource.aliases/header_map_synop.pass.cpp b/libcxx/test/std/experimental/memory/memory.resource.aliases/header_map_synop.pass.cpp
index 5ab24e794fb1..4998f3e64b6a 100644
--- a/libcxx/test/std/experimental/memory/memory.resource.aliases/header_map_synop.pass.cpp
+++ b/libcxx/test/std/experimental/memory/memory.resource.aliases/header_map_synop.pass.cpp
@@ -8,11 +8,6 @@
 
 // UNSUPPORTED: c++03
 
-// Aligned allocation is required by std::experimental::pmr, but it was not provided
-// before macosx10.13 and as a result we get linker errors when deploying to older than
-// macosx10.13.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}}
-
 // <experimental/map>
 
 // namespace std { namespace experimental { namespace pmr {

diff  --git a/libcxx/test/std/experimental/memory/memory.resource.aliases/header_regex_synop.pass.cpp b/libcxx/test/std/experimental/memory/memory.resource.aliases/header_regex_synop.pass.cpp
index 8079840a46bb..eb30b202d9d5 100644
--- a/libcxx/test/std/experimental/memory/memory.resource.aliases/header_regex_synop.pass.cpp
+++ b/libcxx/test/std/experimental/memory/memory.resource.aliases/header_regex_synop.pass.cpp
@@ -9,11 +9,6 @@
 // UNSUPPORTED: c++03
 // UNSUPPORTED: no-localization
 
-// Aligned allocation is required by std::experimental::pmr, but it was not provided
-// before macosx10.13 and as a result we get linker errors when deploying to older than
-// macosx10.13.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}}
-
 // <experimental/regex>
 
 // namespace std { namespace experimental { namespace pmr {

diff  --git a/libcxx/test/std/experimental/memory/memory.resource.aliases/header_set_synop.pass.cpp b/libcxx/test/std/experimental/memory/memory.resource.aliases/header_set_synop.pass.cpp
index 7539b53184b0..6c3ba831d96d 100644
--- a/libcxx/test/std/experimental/memory/memory.resource.aliases/header_set_synop.pass.cpp
+++ b/libcxx/test/std/experimental/memory/memory.resource.aliases/header_set_synop.pass.cpp
@@ -8,11 +8,6 @@
 
 // UNSUPPORTED: c++03
 
-// Aligned allocation is required by std::experimental::pmr, but it was not provided
-// before macosx10.13 and as a result we get linker errors when deploying to older than
-// macosx10.13.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}}
-
 // <experimental/set>
 
 // namespace std { namespace experimental { namespace pmr {

diff  --git a/libcxx/test/std/experimental/memory/memory.resource.aliases/header_string_synop.pass.cpp b/libcxx/test/std/experimental/memory/memory.resource.aliases/header_string_synop.pass.cpp
index ee141039c451..95cb8e5a8d3d 100644
--- a/libcxx/test/std/experimental/memory/memory.resource.aliases/header_string_synop.pass.cpp
+++ b/libcxx/test/std/experimental/memory/memory.resource.aliases/header_string_synop.pass.cpp
@@ -8,11 +8,6 @@
 
 // UNSUPPORTED: c++03
 
-// Aligned allocation is required by std::experimental::pmr, but it was not provided
-// before macosx10.13 and as a result we get linker errors when deploying to older than
-// macosx10.13.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}}
-
 // <experimental/string>
 
 // namespace std { namespace experimental { namespace pmr {

diff  --git a/libcxx/test/std/experimental/memory/memory.resource.aliases/header_unordered_map_synop.pass.cpp b/libcxx/test/std/experimental/memory/memory.resource.aliases/header_unordered_map_synop.pass.cpp
index 775ebcc08229..2087aac4e76c 100644
--- a/libcxx/test/std/experimental/memory/memory.resource.aliases/header_unordered_map_synop.pass.cpp
+++ b/libcxx/test/std/experimental/memory/memory.resource.aliases/header_unordered_map_synop.pass.cpp
@@ -8,11 +8,6 @@
 
 // UNSUPPORTED: c++03
 
-// Aligned allocation is required by std::experimental::pmr, but it was not provided
-// before macosx10.13 and as a result we get linker errors when deploying to older than
-// macosx10.13.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}}
-
 // <experimental/unordered_map>
 
 // namespace std { namespace experimental { namespace pmr {

diff  --git a/libcxx/test/std/experimental/memory/memory.resource.aliases/header_unordered_set_synop.pass.cpp b/libcxx/test/std/experimental/memory/memory.resource.aliases/header_unordered_set_synop.pass.cpp
index 7ef0d6f03f28..da7ecd9c0d13 100644
--- a/libcxx/test/std/experimental/memory/memory.resource.aliases/header_unordered_set_synop.pass.cpp
+++ b/libcxx/test/std/experimental/memory/memory.resource.aliases/header_unordered_set_synop.pass.cpp
@@ -8,11 +8,6 @@
 
 // UNSUPPORTED: c++03
 
-// Aligned allocation is required by std::experimental::pmr, but it was not provided
-// before macosx10.13 and as a result we get linker errors when deploying to older than
-// macosx10.13.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}}
-
 // <experimental/unordered_set>
 
 // namespace std { namespace experimental { namespace pmr {

diff  --git a/libcxx/test/std/experimental/memory/memory.resource.aliases/header_vector_synop.pass.cpp b/libcxx/test/std/experimental/memory/memory.resource.aliases/header_vector_synop.pass.cpp
index 8f76c2397477..f0b14b87cef6 100644
--- a/libcxx/test/std/experimental/memory/memory.resource.aliases/header_vector_synop.pass.cpp
+++ b/libcxx/test/std/experimental/memory/memory.resource.aliases/header_vector_synop.pass.cpp
@@ -8,11 +8,6 @@
 
 // UNSUPPORTED: c++03
 
-// Aligned allocation is required by std::experimental::pmr, but it was not provided
-// before macosx10.13 and as a result we get linker errors when deploying to older than
-// macosx10.13.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}}
-
 // <experimental/vector>
 
 // namespace std { namespace experimental { namespace pmr {

diff  --git a/libcxx/test/std/experimental/memory/memory.resource.global/new_delete_resource.pass.cpp b/libcxx/test/std/experimental/memory/memory.resource.global/new_delete_resource.pass.cpp
index d904d5a14558..91bf1f5efd91 100644
--- a/libcxx/test/std/experimental/memory/memory.resource.global/new_delete_resource.pass.cpp
+++ b/libcxx/test/std/experimental/memory/memory.resource.global/new_delete_resource.pass.cpp
@@ -8,11 +8,6 @@
 
 // UNSUPPORTED: c++03
 
-// Aligned allocation is required by std::experimental::pmr, but it was not provided
-// before macosx10.13 and as a result we get linker errors when deploying to older than
-// macosx10.13.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}}
-
 // <experimental/memory_resource>
 
 // memory_resource * new_delete_resource()

diff  --git a/libcxx/test/std/experimental/memory/memory.resource.global/null_memory_resource.pass.cpp b/libcxx/test/std/experimental/memory/memory.resource.global/null_memory_resource.pass.cpp
index a08e4f93f081..bdd62484d075 100644
--- a/libcxx/test/std/experimental/memory/memory.resource.global/null_memory_resource.pass.cpp
+++ b/libcxx/test/std/experimental/memory/memory.resource.global/null_memory_resource.pass.cpp
@@ -8,11 +8,6 @@
 
 // UNSUPPORTED: c++03
 
-// Aligned allocation is required by std::experimental::pmr, but it was not provided
-// before macosx10.13 and as a result we get linker errors when deploying to older than
-// macosx10.13.
-// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}}
-
 // <experimental/memory_resource>
 
 // memory_resource * null_memory_resource()

diff  --git a/libcxx/utils/ci/run-buildbot b/libcxx/utils/ci/run-buildbot
index 1de4ad9a208e..81a68467e3e1 100755
--- a/libcxx/utils/ci/run-buildbot
+++ b/libcxx/utils/ci/run-buildbot
@@ -105,6 +105,7 @@ function generate-cmake-libcxx-win() {
     # -D_LIBCPP_HAS_NO_INT128 (both when building the library itself and
     # when building tests) to allow enabling filesystem for running tests,
     # even if it uses a non-permanent ABI.
+
     generate-cmake-base \
           -DLLVM_ENABLE_RUNTIMES="libcxx" \
           -DCMAKE_C_COMPILER=clang-cl \
@@ -522,7 +523,7 @@ clang-cl-dll)
     # correctly when libc++ visibility attributes indicate dllimport linkage
     # anyway), thus just disable the experimental library. Remove this
     # setting when cmake and the test driver does the right thing automatically.
-    generate-cmake-libcxx-win -DLIBCXX_TEST_PARAMS="enable_experimental=False"
+    generate-cmake-libcxx-win -DLIBCXX_ENABLE_EXPERIMENTAL_LIBRARY=OFF
     echo "+++ Running the libc++ tests"
     ${NINJA} -vC "${BUILD_DIR}" check-cxx
 ;;

diff  --git a/libcxx/utils/libcxx/test/params.py b/libcxx/utils/libcxx/test/params.py
index a4f4bf226d77..ef6aef077d65 100644
--- a/libcxx/utils/libcxx/test/params.py
+++ b/libcxx/utils/libcxx/test/params.py
@@ -159,19 +159,15 @@ def getStdFlag(cfg, std):
             ])),
 
   Parameter(name='enable_experimental', choices=[True, False], type=bool, default=True,
-            help="Whether to enable tests for experimental C++ Library features.",
+            help="Whether to enable tests for experimental C++ libraries (typically Library Fundamentals TSes).",
             actions=lambda experimental: [] if not experimental else [
+              AddFeature('c++experimental'),
               # When linking in MSVC mode via the Clang driver, a -l<foo>
               # maps to <foo>.lib, so we need to use -llibc++experimental here
               # to make it link against the static libc++experimental.lib.
               # We can't check for the feature 'msvc' in available_features
               # as those features are added after processing parameters.
-              #
-              # TODO: Switch to using the appropriate experimental compiler flag once
-              #       all compilers we support implement that flag.
-              AddFeature('c++experimental'),
-              PrependLinkFlag(lambda cfg: '-llibc++experimental' if _isMSVC(cfg) else '-lc++experimental'),
-              AddCompileFlag('-D_LIBCPP_ENABLE_EXPERIMENTAL'),
+              PrependLinkFlag(lambda config: '-llibc++experimental' if _isMSVC(config) else '-lc++experimental')
             ]),
 
   Parameter(name='long_tests', choices=[True, False], type=bool, default=True,


        


More information about the libcxx-commits mailing list