[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

@@ -199,7 +199,8 @@ PluginLoader::loadExecutablePlugin(StringRef path) {
DepTracker->addDependency(resolvedPath, /*IsSystem=*/false);
// Load the plugin.
auto plugin = getRegistry()->loadExecutablePlugin(resolvedPath);
auto plugin =
getRegistry()->loadExecutablePlugin(resolvedPath, disableSandbox);
if (!plugin) {
resolvedPath.push_back(0);
return llvm::handleErrors(