[libcxx-commits] [libcxx] 1939eb3 - [libc++] Disable int128_t and ship filesystem on MSVC by default
Louis Dionne via libcxx-commits
libcxx-commits at lists.llvm.org
Tue Jun 6 13:31:12 PDT 2023
Author: Louis Dionne
Date: 2023-06-06T13:31:03-07:00
New Revision: 1939eb3dc2330af6fb9609a7c3bd5276e127c9ce
URL: https://github.com/llvm/llvm-project/commit/1939eb3dc2330af6fb9609a7c3bd5276e127c9ce
DIFF: https://github.com/llvm/llvm-project/commit/1939eb3dc2330af6fb9609a7c3bd5276e127c9ce.diff
LOG: [libc++] Disable int128_t and ship filesystem on MSVC by default
Back in 2020 [1], we went very close to enabling Filesystem on MSVC
by disabling int128_t, but decided to wait because MSVC support
for int128_t was supposed to come shortly after. Since it's not
there yet, I propose turning off int128_t support by default on MSVC.
This will make <filesystem> available by default on MSVC, and most
importantly will open the possibility for changing
LIBCXX_ENABLE_FILESYSTEM to mean "the system doesn't have support
for a filesystem" instead of simply "don't build the std::filesystem
library", which is what I'm really after with this change.
In a way, this is a resurection of D91139.
[1]: https://reviews.llvm.org/D91139#2429595
Differential Revision: https://reviews.llvm.org/D134912
Added:
Modified:
libcxx/CMakeLists.txt
libcxx/include/__config
libcxx/utils/ci/run-buildbot
Removed:
################################################################################
diff --git a/libcxx/CMakeLists.txt b/libcxx/CMakeLists.txt
index c44d05f6599cd..d3b7f6fbbdc82 100644
--- a/libcxx/CMakeLists.txt
+++ b/libcxx/CMakeLists.txt
@@ -57,16 +57,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)
-set(ENABLE_FILESYSTEM_DEFAULT ON)
-if (WIN32 AND NOT MINGW)
- # Filesystem is buildable for windows, but it requires __int128 helper
- # functions, that currently are provided by libgcc or compiler_rt builtins.
- # These are available in MinGW environments, but not currently in MSVC
- # environments.
- set(ENABLE_FILESYSTEM_DEFAULT OFF)
-endif()
-option(LIBCXX_ENABLE_FILESYSTEM "Build filesystem as part of the main libc++ library"
- ${ENABLE_FILESYSTEM_DEFAULT})
+option(LIBCXX_ENABLE_FILESYSTEM "Build filesystem as part of the main libc++ library" ON)
option(LIBCXX_INCLUDE_TESTS "Build the libc++ tests." ${LLVM_INCLUDE_TESTS})
option(LIBCXX_ENABLE_DEBUG_MODE
"Whether to build libc++ with the debug mode enabled.
diff --git a/libcxx/include/__config b/libcxx/include/__config
index 023fa0c5493b5..1fc45b5fa9eef 100644
--- a/libcxx/include/__config
+++ b/libcxx/include/__config
@@ -685,7 +685,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD _LIBCPP_END_NAMESPACE_STD
# define _LIBCPP_PREFERRED_OVERLOAD __attribute__((__enable_if__(true, "")))
# endif
-# ifndef __SIZEOF_INT128__
+#if !defined(__SIZEOF_INT128__) || defined(_MSC_VER)
# define _LIBCPP_HAS_NO_INT128
# endif
diff --git a/libcxx/utils/ci/run-buildbot b/libcxx/utils/ci/run-buildbot
index fc3d432cba793..411e3f7468a7d 100755
--- a/libcxx/utils/ci/run-buildbot
+++ b/libcxx/utils/ci/run-buildbot
@@ -124,19 +124,10 @@ function generate-cmake() {
}
function generate-cmake-libcxx-win() {
- # TODO: Clang-cl in MSVC configurations don't have access to compiler_rt
- # builtins helpers for int128 division. See
- # https://reviews.llvm.org/D91139#2429595 for a comment about longterm
- # intent for handling the issue. In the meantime, define
- # -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 \
-DCMAKE_CXX_COMPILER=clang-cl \
- -DLIBCXX_ENABLE_FILESYSTEM=YES \
- -DLIBCXX_EXTRA_SITE_DEFINES="_LIBCPP_HAS_NO_INT128" \
"${@}"
}
More information about the libcxx-commits
mailing list