| ... | @@ -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"); | | |
| 246 | | 245 | |
| 247 | // See libcxx/include/__algorithm/pstl_backends/cpu_backends/backend.h | 246 | // See libcxx/include/__algorithm/pstl_backends/cpu_backends/backend.h |
| 248 | // for potentially enabling some fancy features here, which would | 247 | // for potentially enabling some fancy features here, which would |
| 249 | // require corresponding changes in libcxx.zig, as well as | 248 | // require corresponding changes in libcxx.zig, as well as |
| 250 | // Compilation.addCCArgs. This option makes it use serial backend which | 249 | // 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"); |
| 253 | | 252 | |
| 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"); |
| 288 | | 289 | |
| 289 | // These depend on only the zig lib directory file path, which is | 290 | // These depend on only the zig lib directory file path, which is |
| 290 | // purposefully either in the cache or not in the cache. The decision | 291 | // 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 | } |
| 484 | | 484 | |
| 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 libcxx | 490 | try cflags.append("-D_LIBCPP_ENABLE_CXX17_REMOVED_UNEXPECTED_FUNCTIONS"); |
| 491 | try cflags.append("-D_LIBCPP_PSTL_CPU_BACKEND_SERIAL"); | | |
| 492 | | 491 | |
| 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 | } |
| 509 | | 508 | |
| 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"); |
| 518 | | 518 | |
| 519 | // These depend on only the zig lib directory file path, which is | 519 | // These depend on only the zig lib directory file path, which is |
| 520 | // purposefully either in the cache or not in the cache. The decision | 520 | // purposefully either in the cache or not in the cache. The decision |