[PATCH] D88308: [unittests] Preserve LD_LIBRARY_PATH in crash recovery test
Mikhail Maltsev via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Sep 25 08:07:27 PDT 2020
miyuki created this revision.
miyuki added reviewers: aganea, MaskRay.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
miyuki requested review of this revision.
We need to preserve the LD_LIBRARY_PATH environment variable when
spawning a child process (certain setups rely on non-standard paths
for e.g. libstdc++).
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D88308
Files:
llvm/unittests/Support/CrashRecoveryTest.cpp
Index: llvm/unittests/Support/CrashRecoveryTest.cpp
===================================================================
--- llvm/unittests/Support/CrashRecoveryTest.cpp
+++ llvm/unittests/Support/CrashRecoveryTest.cpp
@@ -172,6 +172,13 @@
// Add LLVM_CRC_UNIXCRCRETURNCODE to the environment of the child process.
std::vector<StringRef> EnvTable;
EnvTable.push_back("LLVM_CRC_UNIXCRCRETURNCODE=1");
+ std::string LibPathEnv;
+ // Preserve LD_LIBRARY_PATH environment variable
+ if (const char *LibPathValue = getenv("LD_LIBRARY_PATH")) {
+ LibPathEnv = "LD_LIBRARY_PATH=";
+ LibPathEnv += LibPathValue;
+ EnvTable.push_back(LibPathEnv);
+ }
std::string Error;
bool ExecutionFailed;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D88308.294315.patch
Type: text/x-patch
Size: 712 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200925/9476ac07/attachment.bin>
More information about the llvm-commits
mailing list