aboutsummaryrefslogtreecommitdiff
path: root/src/Package/Module.zig
AgeCommit message (Collapse)Author
2024-02-01remove std.io.ModeVeikka Tuominen
2024-01-01frontend: fix populateTestFunctions accessing the wrong moduleAndrew Kelley
The test runner reads the list of test function pointers from its own builtin module, which is the root_mod, not main_mod.
2024-01-01Package.Module: fix typo in default red-zone settingAndrew Kelley
oops, this was supposed to return true, not false.
2024-01-01fix compilation errors when enabling llvmAndrew Kelley
2024-01-01fix population of builtin.zig not making the parent dirAndrew Kelley
2024-01-01libcxx: update to new Compilation APIAndrew Kelley
2024-01-01update bin_file.options references in SemaAndrew Kelley
mainly pertaining to error return tracing
2024-01-01compiler: miscellaneous branch progressAndrew Kelley
implement builtin.zig file population for all modules rather than assuming there is only one global builtin.zig module. move some fields from link.File to Compilation move some fields from Module to Compilation compute debug_format in global Compilation config resolution wire up C compilation to the concept of owner modules make whole cache mode call link.File.createEmpty() instead of link.File.open()
2024-01-01compiler: update many references to bin_file.optionsAndrew Kelley
2024-01-01frontend: fix stack protector option logicAndrew Kelley
Commit 97e23896a9168132b6d36ca22ae1af10dd53d80d regressed this behavior because it made target_util.supportsStackProtector *correctly* notice which zig backend is being used to generate code, while the logic calling that function *incorrectly assumed* that .zig code is being compiled, when in reality it might be only C code being compiled. This commit adjusts the option resolution logic for stack protector so that it takes into account the zig backend only if there is a zig compilation unit. A separate piece of logic checks whether clang supports stack protector for a given target. closes #18009 closes #18114 closes #18254
2024-01-01WIP: move many global settings to become per-ModuleAndrew Kelley
Much of the logic from Compilation.create() is extracted into Compilation.Config.resolve() which accepts many optional settings and produces concrete settings. This separate step is needed by API users of Compilation so that they can pass the resolved global settings to the Module creation function, which itself needs to resolve per-Module settings. Since the target and other things are no longer global settings, I did not want them stored in link.File (in the `options` field). That options field was already a kludge; those options should be resolved into concrete settings. This commit also starts to work on that, deleting link.Options, moving the fields into Compilation and ObjectFormat-specific structs instead. Some fields were ephemeral and should not have been stored at all, such as symbol_size_hint. The link.File object of Compilation is now a `?*link.File` and `null` when -fno-emit-bin is passed. It is now arena-allocated along with Compilation itself, avoiding some messy cleanup code that was there before. On the command line, it is now possible to configure the standard library itself by using `--mod std` just like any other module. This meant that the CLI needed to create the standard library module rather than having Compilation create it. There are a lot of changes in this commit and it's still not done. I didn't realize how quickly this changeset was going to balloon out of control, and there are still many lines that need to be changed before it even compiles successfully. * introduce std.Build.Cache.HashHelper.oneShot * add error_tracing to std.Build.Module * extract build.zig file generation into src/Builtin.zig * each CSourceFile and RcSourceFile now has a Module owner, which determines some of the C compiler flags.
2024-01-01Compilation: cleanup hashmap usageJacob Young
2023-10-08give modules friendly names for error reportingAndrew Kelley
2023-10-08CLI: finish updating module API usageAndrew Kelley
Finish the work started in 4c4fb839972f66f55aa44fc0aca5f80b0608c731. Now the compiler compiles again. Wire up dependency tree fetching code in the CLI for `zig build`. Everything is hooked up except for `createDependenciesModule` is not yet implemented.
2023-10-08get `zig fetch` working with the new systemAndrew Kelley
* start renaming "package" to "module" (see #14307) - build system gains `main_mod_path` and `main_pkg_path` is still there but it is deprecated. * eliminate the object-oriented memory management style of what was previously `*Package`. Now it is `*Package.Module` and all pointers point to externally managed memory. * fixes to get the new Fetch.zig code working. The previous commit was work-in-progress. There are still two commented out code paths, the one that leads to `Compilation.create` and the one for `zig build` that fetches the entire dependency tree and creates the required modules for the build runner.