aboutsummaryrefslogtreecommitdiff
path: root/src/link
AgeCommit message (Collapse)Author
2024-01-01link.File.Wasm: remove dead conditionAndrew Kelley
2024-01-01move misc_errors from linker to CompilationAndrew Kelley
So that they can be referenced by getAllErrorsAlloc(). Fixes missing compile errors.
2024-01-01move eh_frame_hdr from link.File to CompilationAndrew Kelley
since it's accessed by Compilation. fixes an invalid check of bin_file==null
2024-01-01move force_undefined_symbols into CompilationAndrew Kelley
This field is needed by Compilation regardless of whether a link file is instantiated. Fixes an invalid check for bin_file=null.
2024-01-01Compilation: several branch regression fixesAndrew Kelley
* 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.
2024-01-01compiler: push entry symbol name resolution into the linkerAndrew Kelley
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.
2024-01-01link.File.Elf: bump 32-bit image_base default to 64KAndrew Kelley
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.
2024-01-01fix MachO linkingAndrew Kelley
* 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.
2024-01-01link.File.Coff: fix relationship between createEmpty/openAndrew Kelley
similar commit to b0c433c80f2e4edd7b60e444b4ea56dacb727051
2024-01-01link.Wasm: fix relationship between createEmpty/openAndrew Kelley
2024-01-01link.Elf: truncate=true in createEmptyAndrew Kelley
2024-01-01linker: rename intermediary_basname to zcu_object_sub_pathAndrew Kelley
2024-01-01fix compilation errors when enabling llvmAndrew Kelley
2024-01-01Elf: fix invalid free of path fieldAndrew Kelley
It's now arena-allocated so no need to free it with gpa
2024-01-01Elf: fix createEmpty not creating the fileAndrew Kelley
2024-01-01MachO: rip out the caching mechanismAndrew Kelley
This is redundant with CacheMode.whole which caches everything, including linking output. Linker code does not need to concern itself with caching like this.
2024-01-01fix remaining compile errors except oneAndrew Kelley
2024-01-01linker: fix some allocator referencesAndrew Kelley
2024-01-01fix more compilation errors introduced by this branchAndrew Kelley
2024-01-01move dll_export_fns and rdynamic to Compilation.ConfigAndrew Kelley
2024-01-01update codegen.llvm references to bin_file.optionsAndrew Kelley
2024-01-01linker: remove bad NvPtx flushModule implementationAndrew Kelley
it's not supposed to mutate Compilation like this.
2024-01-01fix a round of compile errors caused by this branchAndrew Kelley
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-01update bin_file.options references in Module (Zcu)Andrew Kelley
2024-01-01compiler: update references to targetAndrew Kelley
2024-01-01linkers: update references to "options" fieldAndrew Kelley
2024-01-01update image_base referencesAndrew Kelley
2024-01-01compiler: update references to single_threadedAndrew Kelley
2024-01-01linker: update target referencesAndrew Kelley
2024-01-01linker: update options references of CsuObjectsAndrew Kelley
2024-01-01linker: update link_mode referencesAndrew Kelley
2024-01-01linker: update output_mode referencesAndrew Kelley
2024-01-01linker: update references to moduleAndrew Kelley
2024-01-01move a large chunk of linker logic away from "options"Andrew Kelley
These options are only supposed to be provided to the initialization functions, resolved, and then computed values stored in the appropriate place (base struct or the object-format-specific structs). Many more to go...
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-01compiler: get the dynamic linker from the targetAndrew Kelley
instead of passing it to Compilation separately and storing it separately in the linker options.
2024-01-01Revert "Merge pull request #17824 from kcbanner/fixup_msvc_fmax"Andrew Kelley
This reverts commit 7161ed79c4abcaccdd56fe0b4fbd3d93472d41b8, reversing changes made to 3f2a65594e1d3c0a4f4943a4ea522e8405db81e0. Unfortunately, this sat in the PR queue too long and the merge broke the zig1.wasm bootstrap process.
2024-01-01Merge pull request #17824 from kcbanner/fixup_msvc_fmaxAndrew Kelley
cbe: add a system for avoiding collisions with C compiler intrinsics
2023-12-23cbe: fix memory leaksJacob Young
2023-12-05elf: return error.FlushFailure in flushObject and flushStaticLib codepaths ↵Jakub Konka
when found errors
2023-12-05elf: fix typoJakub Konka
2023-12-05elf: copy out committed ZigObject to a buffer when creating static libJakub Konka
2023-12-05elf: exit early with an error when parsing or init failed when flushing ↵Jakub Konka
object/archive
2023-12-05elf: exit early with an error when parsing or init failedJakub Konka
2023-12-05elf: refactorJakub Konka
2023-12-05elf: escape invalid token string when reporting an errorJakub Konka
2023-12-05elf: upcast e_shnum to u64 to check for valid rangesJakub Konka
2023-12-05elf: report malformed archive when parsing errorsJakub Konka