mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-22 01:11:42 +00:00
Semiwrap / meson / robotpy define `NDEBUG` when building their software in all modes, while `allwplib` only does it when building debug. This causes the size of `DenseMap` to differ between the shared libraries built here, and the extension modules built in `mostrobotpy`, causing segfaults when you try to execute code that uses `DenseMap`. This is not a problem with the robotpy code in `allwpilib`, because bazel uses the exact same compiler flags when building the shared libraries and pybind11 extensions.
38 lines
1.3 KiB
Diff
38 lines
1.3 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: PJ Reiniger <pj.reiniger@gmail.com>
|
|
Date: Thu, 19 May 2022 00:58:36 -0400
|
|
Subject: [PATCH 23/35] Prefer to use static pointers in raw_ostream
|
|
|
|
See #1401
|
|
---
|
|
llvm/lib/Support/raw_ostream.cpp | 8 ++++----
|
|
1 file changed, 4 insertions(+), 4 deletions(-)
|
|
|
|
diff --git a/llvm/lib/Support/raw_ostream.cpp b/llvm/lib/Support/raw_ostream.cpp
|
|
index 3333890ed1b086c94cdfce8bc9efb3d191a47f89..7561f818287d208c628a126c3f8a6f7d531df236 100644
|
|
--- a/llvm/lib/Support/raw_ostream.cpp
|
|
+++ b/llvm/lib/Support/raw_ostream.cpp
|
|
@@ -608,9 +608,9 @@ raw_fd_ostream &llvm::outs() {
|
|
EC = enablezOSAutoConversion(STDOUT_FILENO);
|
|
assert(!EC);
|
|
#endif
|
|
- static raw_fd_ostream S("-", EC, sys::fs::OF_None);
|
|
+ static raw_fd_ostream* S = new raw_fd_ostream("-", EC, sys::fs::OF_None);
|
|
assert(!EC);
|
|
- return S;
|
|
+ return *S;
|
|
}
|
|
|
|
raw_fd_ostream &llvm::errs() {
|
|
@@ -619,8 +619,8 @@ raw_fd_ostream &llvm::errs() {
|
|
std::error_code EC = enablezOSAutoConversion(STDERR_FILENO);
|
|
assert(!EC);
|
|
#endif
|
|
- static raw_fd_ostream S(STDERR_FILENO, false, true);
|
|
- return S;
|
|
+ static raw_fd_ostream* S = new raw_fd_ostream(STDERR_FILENO, false, true);
|
|
+ return *S;
|
|
}
|
|
|
|
/// nulls() - This returns a reference to a raw_ostream which discards output.
|