aboutsummaryrefslogtreecommitdiff
path: root/lib/std/start.zig
AgeCommit message (Collapse)Author
2024-12-11start: Extend DWARF unwinding protection to more architectures.Alex Rønne Petersen
The function is not marked .cantunwind for Arm/Thumb because of an LLVM assembler bug: https://github.com/llvm/llvm-project/issues/115891
2024-12-11start: Zero the link and frame pointer registers on all architectures.Alex Rønne Petersen
2024-11-03Merge pull request #21843 from alexrp/callconv-followupAlex Rønne Petersen
Some follow-up work for #21697
2024-11-03std.Target: Replace isARM() with isArmOrThumb() and rename it to isArm().Alex Rønne Petersen
The old isARM() function was a portability trap. With the name it had, it seemed like the obviously correct function to use, but it didn't include Thumb. In the vast majority of cases where someone wants to ask "is the target Arm?", Thumb *should* be included. There are exactly 3 cases in the codebase where we do actually need to exclude Thumb, although one of those is in Aro and mirrors a check in Clang that is itself likely a bug. These rare cases can just add an extra isThumb() check.
2024-11-02start: Fix callconv for the wWinMainCRTStartup symbol.Alex Rønne Petersen
This just uses the C calling convention in the vcruntime sources.
2024-11-02start: Fix a calling convention check to use eql().Alex Rønne Petersen
Also modernize some callconv uses. Closes #21813.
2024-10-27spirv: start.zig support for vulkanRobin Voetter
* Use builtin.zig_backend instead of builtin.cpu.arch, the latter does not yet compile under VK. * Don't call regular _start for either opencl or vulkan. We might even want to disable these completely.
2024-10-19std: update for new `CallingConvention`mlugg
The old `CallingConvention` type is replaced with the new `NewCallingConvention`. References to `NewCallingConvention` in the compiler are updated accordingly. In addition, a few parts of the standard library are updated to use the new type correctly.
2024-10-05std ppc64: add nop to start inline-asmMichael Dusan
fixes ld.lld error: call to save_start.posixCallMainAndExit lacks nop, can't restore toc
2024-10-02Merge pull request #21527 from alexrp/elf-emulationsAlex Rønne Petersen
`link.Elf`: Make `getLDMOption()` exhaustive with regards to LLD's `parseEmulation()`.
2024-09-28std.start: dont query stack limit for wanted stack size 0 (#21533)Michael Ortmann
2024-09-26std.Target: Return EM_ARC_COMPACT instead of EM_ARC_COMPACT2 for arc.Alex Rønne Petersen
Also fix an incorrect related comment in start.zig.
2024-09-12start: Rewrite arm code to work for thumb1 too.Alex Rønne Petersen
0ecc6332b4eb1ced547ffa38f57471134aaa4d13 improved things for thumb2, but thumb1 has a much smaller permissible instruction set. This commit makes that work.
2024-08-31start: Fix arm stack alignment code to work for thumb too.Alex Rønne Petersen
2024-08-28std: update `std.builtin.Type` fields to follow naming conventionsmlugg
The compiler actually doesn't need any functional changes for this: Sema does reification based on the tag indices of `std.builtin.Type` already! So, no zig1.wasm update is necessary. This change is necessary to disallow name clashes between fields and decls on a type, which is a prerequisite of #9938.
2024-08-27Dwarf: implement .eh_frameJacob Young
2024-08-27lib,test,tools,doc: update usages of @exportmlugg
2024-08-15start: Avoid concatenating strings for inline asm.Alex Rønne Petersen
For csky, we can just always do the gb initialization. For riscv, the gp code is temporarily pulled above the main switch until the blocking issue is resolved.
2024-08-15start: fix passing comptime-only value to inline asmJacob Young
Also fix fmt directive typo.
2024-08-07Merge pull request #20925 from alexrp/windows-tlsAndrew Kelley
`std`: Some Windows TLS cleanup and fixes
2024-08-07start: Add sparc32 support.Alex Rønne Petersen
2024-08-03std: Move start_windows_tls.zig to os/windows/tls.zig.Alex Rønne Petersen
Just to be consistent with Linux.
2024-08-01start: Fix an isARM() check to use isArmOrThumb() instead.Alex Rønne Petersen
2024-08-01Merge pull request #20797 from alexrp/start-more-archesAndrew Kelley
`start`: Add POSIX arc, csky, and hexagon support
2024-08-01Merge pull request #20857 from alexrp/tls-portingAndrew Kelley
`std.os.linux.tls`: Refactor, improve documentation, fix a bug, and port to more architectures
2024-08-01Merge pull request #20872 from alexrp/riscv-gpAndrew Kelley
start: Initialize `gp` to `__global_pointer$` on riscv.
2024-07-31start: remove riscv conditionDavid Rubin
2024-07-31start: Disable the gp initialization code for the self-hosted riscv64 backend.Alex Rønne Petersen
2024-07-31start: Initialize gp to __global_pointer$ on riscv.Alex Rønne Petersen
2024-07-30start: Copy the mips64 comment about gp to the mips32 code.Alex Rønne Petersen
Also, don't incorrectly claim that it's only needed for dynamic linking/PIC.
2024-07-30start: Add POSIX csky support.Alex Rønne Petersen
2024-07-29Merge pull request #20852 from ziglang/init-array-start-codeAndrew Kelley
start code: implement __init_array_start, __init_array_end
2024-07-30std.os.linux.tls: Refactor and improve documentation.Alex Rønne Petersen
* Elaborate on the sub-variants of Variant I. * Clarify the use of the TCB term. * Rename a bunch of stuff to be more accurate/descriptive. * Follow Zig's style around namespacing more. * Use a structure for the ABI TCB. No functional change intended.
2024-07-29Merge pull request #20389 from alexrp/riscv32Andrew Kelley
Some `riscv32-linux` porting work
2024-07-29Merge pull request #20822 from alexrp/start-mips-fixesAndrew Kelley
`start`: A handful of MIPS fixes
2024-07-29disable the new code for self-hosted riscv backendAndrew Kelley
2024-07-29start: Always inline the call to std.os.linux.pie.relocate().Alex Rønne Petersen
At this stage, we're not ready to make calls yet on some architectures (e.g. MIPS).
2024-07-29start: Set std.os.linux.elf_aux_maybe after PIE relocations.Alex Rønne Petersen
Accesses to this global variable can require relocations on some platforms (e.g. MIPS). If we do it before PIE relocations have been applied, we'll crash.
2024-07-29start: Perform the posixCallMainAndExit() call with jalr on mips.Alex Rønne Petersen
It's actually important for the ABI that r25 (t9) contains the address of the called function, so that this standard prologue sequence works: lui $2, %hi(_gp_disp) addiu $2, $2, %lo(_gp_disp) addu $gp, $2, $t9 (This is a bit similar to the ToC situation on powerpc that was fixed in 7bc78967b400322a0fc5651f37a1b0428c37fb9d.)
2024-07-29start: Set up the gp register on mips and mips64.Alex Rønne Petersen
2024-07-29start: Implement _start() for riscv32.Alex Rønne Petersen
2024-07-28start code: implement __init_array_start, __init_array_endAndrew Kelley
2024-07-26riscv: implement `lr/sr` loop logic for non-native atomicsDavid Rubin
2024-07-26riscv: airAsm rewriteDavid Rubin
with this rewrite we can call functions inside of inline assembly, enabling us to use the default start.zig logic all that's left is to implement lr/sc loops for atomically manipulating 1 and 2 byte values, after which we can use the segfault handler logic.
2024-07-26start: Add POSIX arc support.Alex Rønne Petersen
2024-07-26start: Add POSIX hexagon support.Alex Rønne Petersen
2024-07-25start: Align the stack on sparc64 just in case.Alex Rønne Petersen
The kernel does this as required, but we cannot trust dynamic linkers to do it.
2024-07-25start: Fix mips stack alignment value (should be 8, not 16).Alex Rønne Petersen
2024-07-25start: Simplify mips and mips64 startup code.Alex Rønne Petersen
Switches from using r1 as a temporary to r2. That way, we don't have to set the `noat` assembler option. (r1 is the scratch register used by the assembler's pseudoinstructions; the assembler warns when code uses that register explicitly without `noat` set.)
2024-07-24start: Explicitly clear the link register on mips and mips64 just in case.Alex Rønne Petersen
The kernel does this as required, but we cannot trust dynamic linkers to do it.