aboutsummaryrefslogtreecommitdiff
path: root/src/link/MachO/load_commands.zig
AgeCommit message (Collapse)Author
2025-11-14represent Mac Catalyst as aarch64-maccatalyst-none rather than ↵Alex Rønne Petersen
aarch64-ios-macabi Apple's own headers and tbd files prefer to think of Mac Catalyst as a distinct OS target. Earlier, when DriverKit support was added to LLVM, it was represented a distinct OS. So why Apple decided to only represent Mac Catalyst as an ABI in the target triple is beyond me. But this isn't the first time they've ignored established target triple norms (see: armv7k and aarch64_32) and it probably won't be the last. While doing this, I also audited all Darwin OS prongs throughout the codebase and made sure they cover all the tags.
2025-08-28link.MachO: update to not use GenericWriterAndrew Kelley
2025-07-07MachO: revert unfinished changesAndrew Kelley
2025-07-07MachO: update to new std.io APIsAndrew Kelley
2024-10-10link: fix false positive crtbegin/crtend detectionAndrew Kelley
Embrace the Path abstraction, doing more operations based on directory handles rather than absolute file paths. Most of the diff noise here comes from this one. Fix sorting of crtbegin/crtend atoms. Previously it would look at all path components for those strings. Make the C runtime path detection partially a pure function, and move some logic to glibc.zig where it belongs.
2024-10-08link.Elf: avoid converting rpath data in flush()Andrew Kelley
The goal is to minimize as much as possible how much logic is inside flush(). So let's start by moving out obvious stuff. This data can be preformatted before flush().
2024-08-19replace Compilation.Emit with std.Build.Cache.PathRobin Voetter
This type is exactly the same as std.Build.Cache.Path, except for one function which is not used anymore. Therefore we can replace it without consequences.
2024-07-04Compilation: rename tsan_static_lib to tsan_libJakub Konka
2024-07-04macho: do not save rpaths globally in the driverJakub Konka
2024-07-04macho: link dynamic TSAN libJakub Konka
2024-03-11std.builtin: make link mode fields lowercaseTristan Ross
2024-02-21MachO: fix `calcLoadCommandsSize` computationJacob Young
Closes #19026
2024-01-29macho: re-enable dSYM but don't write anything to it yetJakub Konka
2024-01-24macho: remove all rpath parsing from the linkerJakub Konka
2024-01-24macho: re-instate build-obj codepathJakub Konka
2024-01-24macho: write to fileJakub Konka
2024-01-24macho: allocate sections, segments and atomsJakub Konka
2024-01-24macho: copy over new implementation sources from zldJakub Konka
2024-01-01fix remaining compile errors except oneAndrew Kelley
2024-01-01compiler: update many references to bin_file.optionsAndrew Kelley
2024-01-01linkers: update references to "options" fieldAndrew Kelley
2024-01-01linker: update target referencesAndrew Kelley
2023-11-19compiler: correct unnecessary uses of 'var'mlugg
2023-09-26kubkon review changes: 4Michael Dusan
- fix `darwin_sdk_layout.?` with null checks
2023-09-25kubkon review changes: 3Michael Dusan
- make vendored settings failure unreachable - rename field `darwinSdkLayout` → `darwin_sdk_layout` - make `darwin_sdk_layout` optional
2023-09-25kubkon review changes: 1Michael Dusan
general: - rename `DarwinSdkLayout` → `DarwinSdkLayout` - drop `DarwinSdkLayout.installation` (not needed for darwin) - document struct inferSdkVersion: - use explicit allocator - avoid trying to infer SDK ver from vendored path
2023-09-25macos: better SDK version detectionMichael Dusan
SDK version detection: - read SDKSettings.json before inferral from SDK path - vendored libc: add SDKSettings.json for SDK version info resolveLibSystem: - adjust search order to { search_dirs, { sysroot or vendored }} - previous search order was { sysroot, search_dirs, vendored }
2023-09-04macho: check if we should emit LC_VERSION_MIN_ if target low enoughJakub Konka
2023-08-30macho: improve error reporting for re-exports mismatchJakub Konka
2023-08-29macho: simplify handling and reporting parsing errorsJakub Konka
2023-08-29macho: handle mismatched and missing platform errorsJakub Konka
2023-08-29macho: clean up array of supported platforms and versionsJakub Konka
2023-08-29macho: clean up helpers for std.SemanticVersion <-> Apple version formattingJakub Konka
2023-08-29macho: parse platform info from each object file into Platform structJakub Konka
2023-08-29macho: make MachO.requiresCodeSignature accept link.OptionsJakub Konka
2023-08-29macho: merge Zld state with MachO stateJakub Konka
2023-08-29darwin: move inference of SDK version into the linkerJakub Konka
`std.zig.system.darwin.getSdk` now pulls only the SDK path so we execute a child process only once and not twice as it was until now since we parse the SDK version directly from the pulled path. This is actually how `ld64` does it too.
2023-08-03zig libc: restore functionality on macOSAndrew Kelley
Regressed in 2006add8496c47804ee3b6c562f420871cb4ea0a. References to native_darwin_sdk are no longer kept in the frontend. Instead the darwin SDK is detected as part of NativePaths and as part of LibCInstallation.
2023-06-24all: migrate code to new cast builtin syntaxmlugg
Most of this migration was performed automatically with `zig fmt`. There were a few exceptions which I had to manually fix: * `@alignCast` and `@addrSpaceCast` cannot be automatically rewritten * `@truncate`'s fixup is incorrect for vectors * Test cases are not formatted, and their error locations change
2023-06-17std: replace builtin.Version with SemanticVersionr00ster91
2023-06-17mem: rename align*Generic to mem.align*Motiejus Jakštys
Anecdote 1: The generic version is way more popular than the non-generic one in Zig codebase: git grep -w alignForward | wc -l 56 git grep -w alignForwardGeneric | wc -l 149 git grep -w alignBackward | wc -l 6 git grep -w alignBackwardGeneric | wc -l 15 Anecdote 2: In my project (turbonss) that does much arithmetic and alignment I exclusively use the Generic functions. Anecdote 3: we used only the Generic versions in the Macho Man's linker workshop.
2023-04-01macho: look for entry in archives/dylibs tooJakub Konka
2023-03-21macho: use TOOL=0x5 to mean ZIG as the build toolJakub Konka
2023-01-29std: restrict mem.span() and mem.len() to sentinel terminated pointersIsaac Freund
These functions are currently footgunny when working with pointers to arrays and slices. They just return the stated length of the array/slice without iterating and looking for the first sentinel, even if the array/slice is a sentinel terminated type. From looking at the quite small list of places in the standard library/compiler that this change breaks existing code, the new code looks to be more readable in all cases. The usage of std.mem.span/len was totally unneeded in most of the cases affected by this breaking change. We could remove these functions entirely in favor of other existing functions in std.mem such as std.mem.sliceTo(), but that would be a somewhat nasty breaking change as std.mem.span() is very widely used for converting sentinel terminated pointers to slices. It is however not at all widely used for anything else. Therefore I think it is better to break these few non-standard and potentially incorrect usages of these functions now and at some later time, if deemed worthwhile, finally remove these functions. If we wait for at least a full release cycle so that everyone adapts to this change first, updating for the removal could be a simple find and replace without needing to worry about the semantics.
2022-12-17Sema: make is_non_{null,err} stricter about typesVeikka Tuominen
Closes #13023
2022-12-16macho: store LC headers to often updated LINKEDIT sectionsJakub Konka
2022-12-16macho: calculate UUID as a streaming MD5 hash of the file contentsJakub Konka
2022-12-16macho: dedup LC emitting logicJakub Konka
Fix path written to `LC_ID_DYLIB` to include the current CWD (if any).