[Macros] Add option to disable sandbox for exectuable plugins

`-disable-sandbox` to disable sandboxing when invoking subprocess from
from the frontend. Since `sandbox(7)` in macOS doesn't support nested
sandbox, complation used to fail when the parent build process is sandboxed.
This commit is contained in:
Rintaro Ishizaki
2023-11-17 13:42:16 -08:00
parent df30c12d46
commit 0c9f099d88
9 changed files with 116 additions and 11 deletions

View File

@@ -812,8 +812,9 @@ bool CompilerInstance::setUpModuleLoaders() {
bool CompilerInstance::setUpPluginLoader() {
/// FIXME: If Invocation has 'PluginRegistry', we can set it. But should we?
auto loader =
std::make_unique<PluginLoader>(*Context, getDependencyTracker());
auto loader = std::make_unique<PluginLoader>(
*Context, getDependencyTracker(),
Invocation.getFrontendOptions().DisableSandbox);
Context->setPluginLoader(std::move(loader));
return false;
}