authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2024-08-24 00:45:00+02:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2024-09-19 18:20:21-07:00
log9f669df1b31d0379d3b9dcd14d415cfba9924319
tree2de8ae66b3b02b745d7861faf1c0d9a2a2a8f757
parent1c8f0b8909f342201f84def1efb8c6fb4386cc2c

libcxx: Synchronize some CXXFLAGS with upstream.


1 files changed, 13 insertions(+), 13 deletions(-)

src/libcxx.zig+13-13
...@@ -237,19 +237,18 @@ pub fn buildLibCXX(comp: *Compilation, prog_node: std.Progress.Node) BuildError!...@@ -237,19 +237,18 @@ pub fn buildLibCXX(comp: *Compilation, prog_node: std.Progress.Node) BuildError!
237 try cflags.append("-DNDEBUG");237 try cflags.append("-DNDEBUG");
238 try cflags.append(hardeningModeFlag(optimize_mode));238 try cflags.append(hardeningModeFlag(optimize_mode));
239 try cflags.append("-D_LIBCPP_BUILDING_LIBRARY");239 try cflags.append("-D_LIBCPP_BUILDING_LIBRARY");
240 try cflags.append("-D_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS");
240 try cflags.append("-D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER");241 try cflags.append("-D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER");
242 try cflags.append("-D_LIBCPP_HAS_NO_VENDOR_AVAILABILITY_ANNOTATIONS");
241 try cflags.append("-DLIBCXX_BUILDING_LIBCXXABI");243 try cflags.append("-DLIBCXX_BUILDING_LIBCXXABI");
242 try cflags.append("-D_LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS");244 try cflags.append("-D_LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS");
243 try cflags.append("-D_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS");
244 try cflags.append("-D_LIBCPP_DISABLE_NEW_DELETE_DEFINITIONS");
245 try cflags.append("-D_LIBCPP_HAS_NO_VENDOR_AVAILABILITY_ANNOTATIONS");
246245
247 // See libcxx/include/__algorithm/pstl_backends/cpu_backends/backend.h246 // See libcxx/include/__algorithm/pstl_backends/cpu_backends/backend.h
248 // for potentially enabling some fancy features here, which would247 // for potentially enabling some fancy features here, which would
249 // require corresponding changes in libcxx.zig, as well as248 // require corresponding changes in libcxx.zig, as well as
250 // Compilation.addCCArgs. This option makes it use serial backend which249 // Compilation.addCCArgs. This option makes it use serial backend which
251 // is simple and works everywhere.250 // is simple and works everywhere.
252 try cflags.append("-D_LIBCPP_PSTL_CPU_BACKEND_SERIAL");251 try cflags.append("-D_LIBCPP_PSTL_BACKEND_SERIAL");
253252
254 try cflags.append(abi_version_arg);253 try cflags.append(abi_version_arg);
255 try cflags.append(abi_namespace_arg);254 try cflags.append(abi_namespace_arg);
...@@ -283,8 +282,10 @@ pub fn buildLibCXX(comp: *Compilation, prog_node: std.Progress.Node) BuildError!...@@ -283,8 +282,10 @@ pub fn buildLibCXX(comp: *Compilation, prog_node: std.Progress.Node) BuildError!
283 try cflags.append("-fPIC");282 try cflags.append("-fPIC");
284 }283 }
285 try cflags.append("-nostdinc++");284 try cflags.append("-nostdinc++");
286 try cflags.append("-std=c++20");285 try cflags.append("-std=c++23");
287 try cflags.append("-Wno-user-defined-literals");286 try cflags.append("-Wno-user-defined-literals");
287 try cflags.append("-Wno-covered-switch-default");
288 try cflags.append("-Wno-suggest-override");
288289
289 // These depend on only the zig lib directory file path, which is290 // These depend on only the zig lib directory file path, which is
290 // purposefully either in the cache or not in the cache. The decision291 // purposefully either in the cache or not in the cache. The decision
...@@ -476,19 +477,17 @@ pub fn buildLibCXXABI(comp: *Compilation, prog_node: std.Progress.Node) BuildErr...@@ -476,19 +477,17 @@ pub fn buildLibCXXABI(comp: *Compilation, prog_node: std.Progress.Node) BuildErr
476 continue;477 continue;
477 }478 }
478 try cflags.append("-D_LIBCXXABI_HAS_NO_THREADS");479 try cflags.append("-D_LIBCXXABI_HAS_NO_THREADS");
479 try cflags.append("-D_LIBCPP_HAS_NO_THREADS");
480 } else if (target.abi.isGnu()) {480 } else if (target.abi.isGnu()) {
481 if (target.os.tag != .linux or !(target.os.version_range.linux.glibc.order(.{ .major = 2, .minor = 18, .patch = 0 }) == .lt))481 if (target.os.tag != .linux or !(target.os.version_range.linux.glibc.order(.{ .major = 2, .minor = 18, .patch = 0 }) == .lt))
482 try cflags.append("-DHAVE___CXA_THREAD_ATEXIT_IMPL");482 try cflags.append("-DHAVE___CXA_THREAD_ATEXIT_IMPL");
483 }483 }
484484
485 try cflags.append("-D_LIBCPP_DISABLE_EXTERN_TEMPLATE");485 try cflags.append("-DNDEBUG");
486 try cflags.append("-D_LIBCPP_ENABLE_CXX17_REMOVED_UNEXPECTED_FUNCTIONS");486 try cflags.append(hardeningModeFlag(optimize_mode));
487 try cflags.append("-D_LIBCXXABI_BUILDING_LIBRARY");487 try cflags.append("-D_LIBCXXABI_BUILDING_LIBRARY");
488 try cflags.append("-D_LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS");488 try cflags.append("-D_LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS");
489 try cflags.append("-D_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS");489 try cflags.append("-D_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS");
490 // This must be coordinated with the same flag in libcxx490 try cflags.append("-D_LIBCPP_ENABLE_CXX17_REMOVED_UNEXPECTED_FUNCTIONS");
491 try cflags.append("-D_LIBCPP_PSTL_CPU_BACKEND_SERIAL");
492491
493 try cflags.append(abi_version_arg);492 try cflags.append(abi_version_arg);
494 try cflags.append(abi_namespace_arg);493 try cflags.append(abi_namespace_arg);
...@@ -507,14 +506,15 @@ pub fn buildLibCXXABI(comp: *Compilation, prog_node: std.Progress.Node) BuildErr...@@ -507,14 +506,15 @@ pub fn buildLibCXXABI(comp: *Compilation, prog_node: std.Progress.Node) BuildErr
507 }506 }
508 }507 }
509508
510 try cflags.append(hardeningModeFlag(optimize_mode));
511
512 if (target_util.supports_fpic(target)) {509 if (target_util.supports_fpic(target)) {
513 try cflags.append("-fPIC");510 try cflags.append("-fPIC");
514 }511 }
515 try cflags.append("-nostdinc++");512 try cflags.append("-nostdinc++");
516 try cflags.append("-fstrict-aliasing");513 try cflags.append("-fstrict-aliasing");
517 try cflags.append("-std=c++20");514 try cflags.append("-std=c++23");
515 try cflags.append("-Wno-user-defined-literals");
516 try cflags.append("-Wno-covered-switch-default");
517 try cflags.append("-Wno-suggest-override");
518518
519 // These depend on only the zig lib directory file path, which is519 // These depend on only the zig lib directory file path, which is
520 // purposefully either in the cache or not in the cache. The decision520 // purposefully either in the cache or not in the cache. The decision