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++). In order to achieve this, set
LLVM_CRC_UNIXCRCRETURNCODE in the parent process instead of creating
the child's environment from scratch.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
Thanks for the fix @miyuki ! Just being curious, what happens without this patch? I'm also wondering why isn't it a problem in the ProgramTest.cpp, since it also spawn child processes? (I actually copied some of this code from there)
Comment Actions
In our case, the child process fails to find the correct version of libstdc++ and exits with return code 1, ASSERT_EQ(-2, RetCode) fails.
llvm/unittests/Support/CrashRecoveryTest.cpp | ||
---|---|---|
178 | Perhaps ExecuteAndWait should have a mode to append environment variables. In the absence of that feature, llvm/utils/not/not.cpp #ifdef _WIN32 SetEnvironmentVariableA("...); #else setenv(...); #endif |
llvm/unittests/Support/CrashRecoveryTest.cpp | ||
---|---|---|
178 | Yes, this works in our environment. |
Perhaps ExecuteAndWait should have a mode to append environment variables. In the absence of that feature,
llvm/utils/not/not.cpp