aboutsummaryrefslogtreecommitdiff
path: root/lib/std/start.zig
AgeCommit message (Collapse)Author
2023-09-19start: workaround for LLVM 17 regressionJacob Young
Tracking issue #16799
2023-08-02Plan 9: add more features to std.os.plan9Jacob G-W
* Replaces the exit assembly with the function from std. * Reads the top-of-stack struct at program startup that can get information like the pid. * Changes the read and write functions to use the Pread and Pwrite syscalls instead of the depreciated _READ and _WRITE * Changes the openat function to use flags instead of perms. Plan9 does not support perms when opening, just when creating. * Adds an errstr function to read the errstr buf created by the kernel
2023-07-31std: finish cleanup up asmJacob Young
This also required implementing the necessary syntax in the x86_64 backend.
2023-07-31std: cleanup asm usageJacob Young
After fixing some issues with inline assembly in the C backend, the std cleanups have the side effect of making these functions compatible with the backend, allowing it to be used on linux without linking libc.
2023-07-28std.start | Remove unused importZachary Raineri
Removes the unused import tlcsprng
2023-07-27linux: do not set stack size hard limitMichael Dusan
At main startup, if the ELF auxiliary vector contains a stacksize value, use it as a hint for the minimum stacksize required by the executable. 1. Never lower the hard-limit. Once a hard-limit is lowered, then it can never be increased (including child processes). 2. If hint exceeds hard-limit then clamp hint to hard-limit. 3. If soft-limit exceeds hint then do nothing.
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-19all: zig fmt and rename "@XToY" to "@YFromX"Eric Joldasov
Signed-off-by: Eric Joldasov <bratishkaerik@getgoogleoff.me>
2023-06-16plan9: flesh out stdlib enough to allow not using simplified start logicJacob G-W
2023-05-01x86_64: enable normal start/test_runner logic on more targetsJacob Young
2023-04-14wasm: no longer use simplified `start.zig`Luuk de Gram
The Wasm backend now supports all features required to use the full `start.zig` logic, rather than the simplified version. With this commit we remove all references to the simplified logic for Wasm specifically.
2023-04-13add c_char typeAndrew Kelley
closes #875
2023-04-12never use C pointers!!Andrew Kelley
you maniacs, you absolute monsters. degenerates. hooligans. criminals. issue #2984 is coming for you.
2023-04-09spirv: minimal start codeRobin Voetter
For SPIR-V, only export the main function if it is actually declared. Kernel entry points will often have parameters and more than one kernel declared. In general, SPIR-V binaries should mostly be compiled as libraries and not as executables. However, this start code is required so that we can build test executables. Note that a call to isSpirV() would emit the code for that function, even though the call is at comptime. To save that function from being emitted the checks are just inlined manually.
2023-04-03start: disable extra start logic on various x86_64 subtargetsJacob Young
2023-04-03Elf: add program headers for the program header tableJacob Young
2023-04-02x86_64: implement large cmpJacob Young
2023-02-17ignore SIGPIPE by defaultJonathan Marler
2023-02-04Add support for mips64/mips64elSuirad
2023-01-05std: collect all options under one namespaceVeikka Tuominen
2023-01-05Don't initialize the static TLS area in single-threaded buildsJens Goldberg
2022-12-17std.builtin: rename Type.Fn's args to paramsr00ster91
This was a poor naming choice; these are parameters, not arguments. Parameters specify what kind of arguments are expected, whereas the arguments are the actual values passed.
2022-12-17std.builtin: rename Type.Fn.Param's arg_type to typer00ster91
It's the type of a parameter, not an argument, but the prefix is redundant either way.
2022-12-13update usages of `@call`Veikka Tuominen
2022-11-04all: rename i386 to x86Ali Chraghi
2022-10-31cbe: improve support for non-native float typesJacob Young
* Fix _start on aarch64. * Add fallbacks when a float type is unsupported. Fixes #13357
2022-10-25cbe: update test casesJacob Young
2022-10-25std: add cbe hacks to more targetsJacob Young
These are needed because clang doesn't support anything in naked functions, not even assembly register inputs.
2022-10-25cbe: get enough things working to support basic programsJacob Young
* Enable advanced start support. * Enable advanced test_runner support. * Zig Language Reference's Hello World now works.
2022-09-07coff: re-enable default entrypoint for WindowsJakub Konka
2022-08-30coff: fallback to _start as default entry point for nowJakub Konka
This is not technically correct, but given that we are not yet able to link against the CRT, it's a good default until then. Add basic logging of generated symbol table in the linker.
2022-08-30coff: add missing bits required for minimal PE exampleJakub Konka
2022-08-30start: allow for explicitly defined entry point for WinJakub Konka
2022-08-07remove 'builtin.stage2_arch', Sema is smart enough nowMeghan Denny
2022-07-26start code: enable segfault handler for stage2Andrew Kelley
2022-07-11Sema: validate extern typesVeikka Tuominen
2022-07-09Remove outdated TODO comment (#12053)Yusuke Tanaka
2022-05-13target: Rename sparcv9 -> sparc64Koakuma
Rename all references of sparcv9 to sparc64, to make Zig align more with other projects. Also, added new function to convert glibc arch name to Zig arch name, since it refers to the architecture as sparcv9. This is based on the suggestion by @kubkon in PR 11847. (https://github.com/ziglang/zig/pull/11487#pullrequestreview-963761757)
2022-05-02std: enable real start code always for LLVM backendAndrew Kelley
2022-04-16start.zig: make sure macos uses full startup codeJakub Konka
2022-04-14stage2: zig fmtKoakuma
2022-04-14stage2: sparcv9: Add exit2 implementationKoakuma
2022-04-14stage2: sparcv9: Register the backend in stdlib & driverKoakuma
2022-03-21Sema: dummy implementation of `@errorReturnTrace`Andrew Kelley
Also update std/build.zig to use stage2 function pointer semantics. This gets us a little bit closer to `zig build` working, although it is now hitting a new crash in the compiler.
2022-03-11stage2: passing threadlocal tests for x86_64-linuxAndrew Kelley
* use the real start code for LLVM backend with x86_64-linux - there is still a check for zig_backend after initializing the TLS area to skip some stuff. * introduce new AIR instructions and implement them for the LLVM backend. They are the same as `call` except with a modifier. - call_always_tail - call_never_tail - call_never_inline * LLVM backend calls hasRuntimeBitsIgnoringComptime in more places to avoid unnecessarily depending on comptimeOnly being resolved for some types. * LLVM backend: remove duplicate code for setting linkage and value name. The canonical place for this is in `updateDeclExports`. * LLVM backend: do some assembly template massaging to make `%%` rendered as `%`. More hacks will be needed to make inline assembly catch up with stage1.
2022-02-08wasm: update test runnerLuuk de Gram
This updates the test runner for stage2 to emit to stdout with the passed, skipped and failed tests similar to the LLVM backend. Another change to this is the start function, as it's now more in line with stage1's. The stage2 test infrastructure for wasm/wasi has been updated to reflect this as well.
2022-01-27fix startup procedure for async WinMainvnc5
2022-01-24Avoid duplicate TLS startup symbolsSizhe Zhao
2022-01-17remove `zig_is_stage2` from `@import("builtin")`Andrew Kelley
Instead use the standarized option for communicating the zig compiler backend at comptime, which is `zig_backend`. This was introduced in commit 1c24ef0d0b09a12a1fe98056f2fc04de78a82df3.
2021-11-29wasm: Update wasm stage2 test backend to use 'main'Luuk de Gram