| ... | ... | @@ -233,6 +233,13 @@ pub fn buildLibCXX(comp: *Compilation, prog_node: *std.Progress.Node) !void { |
| 233 | 233 | try cflags.append("-D_LIBCPP_HAS_MUSL_LIBC"); |
| 234 | 234 | } |
| 235 | 235 | |
| 236 | if (target.isGnuLibC()) { |
| 237 | // glibc 2.16 introduced aligned_alloc |
| 238 | if (target.os.version_range.linux.glibc.order(.{ .major = 2, .minor = 16, .patch = 0 }) == .lt) { |
| 239 | try cflags.append("-D_LIBCPP_HAS_NO_LIBRARY_ALIGNED_ALLOCATION"); |
| 240 | } |
| 241 | } |
| 242 | |
| 236 | 243 | if (target.os.tag == .wasi) { |
| 237 | 244 | // WASI doesn't support exceptions yet. |
| 238 | 245 | try cflags.append("-fno-exceptions"); |
| ... | ... | @@ -433,6 +440,13 @@ pub fn buildLibCXXABI(comp: *Compilation, prog_node: *std.Progress.Node) !void { |
| 433 | 440 | try cflags.append("-D_LIBCPP_HAS_MUSL_LIBC"); |
| 434 | 441 | } |
| 435 | 442 | |
| 443 | if (target.isGnuLibC()) { |
| 444 | // glibc 2.16 introduced aligned_alloc |
| 445 | if (target.os.version_range.linux.glibc.order(.{ .major = 2, .minor = 16, .patch = 0 }) == .lt) { |
| 446 | try cflags.append("-D_LIBCPP_HAS_NO_LIBRARY_ALIGNED_ALLOCATION"); |
| 447 | } |
| 448 | } |
| 449 | |
| 436 | 450 | if (target_util.supports_fpic(target)) { |
| 437 | 451 | try cflags.append("-fPIC"); |
| 438 | 452 | } |