Implement a basic busybox for carbon/clang. (#4406)

For reference, we're going down the busyboxing route because Carbon
depends on Clang, and we want both to be available as binaries.
Busyboxing allows this while avoiding duplicating symbols between
multiple binaries.

I'm removing the `cc_binary` for `driver:carbon` because I want to avoid
a significant increase in binary outputs; `bazel run //toolchain` still
works great.

This still doesn't have great test coverage (but non-zero:
`//examples:sieve` still builds/runs, for example). The problem is that
we want to avoid subprocessing for performance, but this mainly deals
with subprocessing. I'm still thinking about good approaches for that,
since we'll probably want more significant testing for `clang`
interaction... the solution might involve busyboxing `file_test` too.

Note development on this ran into the argv issue being fixed in #4405
This commit is contained in:
Jon Ross-Perkins
2024-10-30 17:07:55 +00:00
committed by GitHub
parent 69d1d344bc
commit 957599b2ab
11 changed files with 190 additions and 82 deletions
+5
View File
@@ -88,6 +88,11 @@ auto Options::Build(CommandLine::CommandBuilder& b) -> void {
}
auto Driver::RunCommand(llvm::ArrayRef<llvm::StringRef> args) -> DriverResult {
if (driver_env_.installation->error()) {
llvm::errs() << "error: " << *driver_env_.installation->error() << "\n";
return {.success = false};
}
Options options;
CommandLine::ParseResult result = CommandLine::Parse(