* move wasi_emulated_libs into Compilation
- It needs to be accessed from Compilation, which needs to potentially
build those artifacts.
* Compilation: improve error reporting for two cases
- the setMiscFailure mechanism is handy - let's use it!
* fix one instance of incorrectly checking for emit_bin via
`comp.bin_file != null`. There are more instances of this that need to
be fixed in a future commit.
* fix renameTmpIntoCache not handling the case where it needs to make
the "o" directory in the zig-cache directory.
- while I'm at it, simplify the logic for handling the fact that
Windows returns error.AccessDenied rather than
error.PathAlreadyExists for failure to rename a directory over
another one.
* fix missing cache hash additions
- there are still more to add in a future commit -
addNonIncrementalStuffToCacheManifest is called when bin_file is
always null, and then it incorrectly checks if bin_file is non-null
and only then adds a bunch of stuff to the cache hash. It needs to
instead add to the cache hash based on lf_open_opts.
This is necessary because on COFF, the entry symbol name is not known
until the linker has looked at the set of global symbol names to
determine which of the four possible main entry points is present.
use_llvm=false does not always mean there needs to be a zig compiler
backend available. In particular, when there is no zig compilation unit,
use_llvm=false and yet no zig backend will be used to produce code.
In Compilation.create, update the resolved config to account for the
default resolution of the root module. This makes it so that, for
example, reading comp.config.any_non_single_threaded is valid in order
to determine whether any module has single_threaded=false.
Now that we always pass --image-base to LLD, including when Zig chooses
the default value, LLD is complaining about 32-bit architectures because
it requires being at least equal to the max page size, which is 64K.
When using the build system to do unit testing, it lowers to --mod
arguments which were incorrectly tripping a "zig test requires a source
file argument" error.
* fix relationship between createEmpty/open (similar logic as
607111aa758002bc51914b7dc800b23927c931b8)
* still resolve the start symbol when linking libc because when zig is
the linker it still needs to know the entry symbol.
* make use_llvm=false when there is no zig compilation unit.
when linking libc, the entry point is within libc.
when producing C code, the entry point is decided when compiling the C
code and does not need to be known up front.
fixes a false positive "error: unknown target entry point" when using
-ofmt=c.
This is redundant with CacheMode.whole which caches everything,
including linking output. Linker code does not need to concern itself
with caching like this.