diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/Compilation.zig | 3 | ||||
| -rw-r--r-- | src/libcxx.zig | 21 |
2 files changed, 20 insertions, 4 deletions
diff --git a/src/Compilation.zig b/src/Compilation.zig index 0150d615e3..d6157fec82 100644 --- a/src/Compilation.zig +++ b/src/Compilation.zig @@ -4318,6 +4318,9 @@ pub fn addCCArgs( try argv.append("-D_LIBCPP_HAS_NO_THREADS"); } + // See the comment in libcxx.zig for more details about this. + try argv.append("-D_LIBCPP_PSTL_CPU_BACKEND_SERIAL"); + try argv.append(try std.fmt.allocPrint(arena, "-D_LIBCPP_ABI_VERSION={d}", .{ @intFromEnum(comp.libcxx_abi_version), })); diff --git a/src/libcxx.zig b/src/libcxx.zig index 07967ec694..a75a4098b2 100644 --- a/src/libcxx.zig +++ b/src/libcxx.zig @@ -46,15 +46,17 @@ const libcxx_files = [_][]const u8{ "src/chrono.cpp", "src/condition_variable.cpp", "src/condition_variable_destructor.cpp", - "src/debug.cpp", "src/exception.cpp", "src/experimental/memory_resource.cpp", + "src/filesystem/directory_entry.cpp", "src/filesystem/directory_iterator.cpp", + "src/filesystem/filesystem_clock.cpp", + "src/filesystem/filesystem_error.cpp", // omit int128_builtins.cpp because it provides __muloti4 which is already provided // by compiler_rt and crashes on Windows x86_64: https://github.com/ziglang/zig/issues/10719 //"src/filesystem/int128_builtins.cpp", "src/filesystem/operations.cpp", - "src/format.cpp", + "src/filesystem/path.cpp", "src/functional.cpp", "src/future.cpp", "src/hash.cpp", @@ -65,10 +67,14 @@ const libcxx_files = [_][]const u8{ "src/legacy_pointer_safety.cpp", "src/locale.cpp", "src/memory.cpp", + "src/memory_resource.cpp", "src/mutex.cpp", "src/mutex_destructor.cpp", "src/new.cpp", + "src/new_handler.cpp", + "src/new_helpers.cpp", "src/optional.cpp", + "src/print.cpp", "src/random.cpp", "src/random_shuffle.cpp", "src/regex.cpp", @@ -82,14 +88,12 @@ const libcxx_files = [_][]const u8{ "src/support/ibm/mbsnrtowcs.cpp", "src/support/ibm/wcsnrtombs.cpp", "src/support/ibm/xlocale_zos.cpp", - "src/support/solaris/xlocale.cpp", "src/support/win32/locale_win32.cpp", "src/support/win32/support.cpp", "src/support/win32/thread_win32.cpp", "src/system_error.cpp", "src/thread.cpp", "src/typeinfo.cpp", - "src/utility.cpp", "src/valarray.cpp", "src/variant.cpp", "src/vector.cpp", @@ -166,6 +170,13 @@ pub fn buildLibCXX(comp: *Compilation, prog_node: *std.Progress.Node) !void { try cflags.append("-D_LIBCPP_DISABLE_NEW_DELETE_DEFINITIONS"); try cflags.append("-D_LIBCPP_HAS_NO_VENDOR_AVAILABILITY_ANNOTATIONS"); + // See libcxx/include/__algorithm/pstl_backends/cpu_backends/backend.h + // for potentially enabling some fancy features here, which would + // require corresponding changes in libcxx.zig, as well as + // Compilation.addCCArgs. This option makes it use serial backend which + // is simple and works everywhere. + try cflags.append("-D_LIBCPP_PSTL_CPU_BACKEND_SERIAL"); + try cflags.append(abi_version_arg); try cflags.append(abi_namespace_arg); @@ -336,6 +347,8 @@ pub fn buildLibCXXABI(comp: *Compilation, prog_node: *std.Progress.Node) !void { try cflags.append("-D_LIBCXXABI_BUILDING_LIBRARY"); try cflags.append("-D_LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS"); try cflags.append("-D_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS"); + // This must be coordinated with the same flag in libcxx + try cflags.append("-D_LIBCPP_PSTL_CPU_BACKEND_SERIAL"); try cflags.append(abi_version_arg); try cflags.append(abi_namespace_arg); |
