diff options
author | Dan Liew <dan@su-root.co.uk> | 2020-03-23 19:57:33 -0700 |
---|---|---|
committer | Dan Liew <dan@su-root.co.uk> | 2020-03-24 15:41:46 -0700 |
commit | b684c1a50f70a39ceb51973950c5cca520ce8b2c (patch) | |
tree | fc5798d9ce6ae7c61216acb7fe02fbf2fed4146f /clang/lib/Frontend/CompilerInvocation.cpp | |
parent | ec184dd548f7832d09d3c6354a6d9d3db6cacc65 (diff) | |
download | llvm-b684c1a50f70a39ceb51973950c5cca520ce8b2c.zip llvm-b684c1a50f70a39ceb51973950c5cca520ce8b2c.tar.gz llvm-b684c1a50f70a39ceb51973950c5cca520ce8b2c.tar.bz2 |
Add a `Symbolizer::GetEnvP()` method that allows symbolizer implementations to customise the environment of the symbolizer binary.
Summary:
This change introduces the `Symbolizer::GetEnvP()` method that returns a
pointer to environment array used for spawning the symbolizer process.
The motivation is to allow implementations to customise the environment
if required. The default implementation just returns
`__sanitizer::GetEnviron()` which (provided it's implemented) should
preserve the existing behaviours of the various implementations.
This change has been plumbed through the `internal_spawn(...)` and
`StartSubprocess(...)` process spawning implementations.
For the `StartSubprocess()` implementation we need to call `execve()`
rather than `execv()` to pass the environment. However, it appears that
`internal_execve(...)` exists in sanitizer_common so this patch use that
which seems like a nice clean up.
Support in the Windows implementation of
`SymbolizerProcess:StartSymbolizerSubprocess()` has not been added
because the Windows sanitizer runtime doesn't implement `GetEnviron()`.
rdar://problem/58789439
Reviewers: kubamracek, yln, dvyukov, vitalybuka, eugenis, phosek, aizatsky, rnk
Subscribers: #sanitizers, llvm-commits
Tags: #sanitizers
Differential Revision: https://reviews.llvm.org/D76666
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
0 files changed, 0 insertions, 0 deletions