aboutsummaryrefslogtreecommitdiff
path: root/lib/std/zig.zig
AgeCommit message (Collapse)Author
2021-01-19SPIR-V: Initial architecture definitions and setupRobin Voetter
2021-01-07remove z/Z format specifiersJonathan Marler
Zig's format system is flexible enough to add custom formatters. This PR removes the new z/Z format specifiers that were added for printing Zig identifiers and replaces them with custom formatters.
2020-12-31Year++Frank Denis
2020-10-17std: remove renderStringLiteral in favor of std.fmt specifierVexu
2020-10-15std: move std.meta.refAllDecls to std.testingTadeo Kondrak
2020-09-30fix incorrect dylib filename pattern in the previous commitAndrew Kelley
2020-09-30std.zig.binNameAlloc: take into account version for macos dylibsAndrew Kelley
2020-09-29update wasm to use ".o.wasm" extension for objectsAndrew Kelley
This is convenient for debugging purposes, as well as simplifying the caching system since executable basenames will not conflict with their corresponding object files.
2020-09-29improve stage2 COFF LLD linkingAndrew Kelley
* change some {} to be {s} to gain type safety * fix libraries being libfoo.lib instead of foo.lib for COFF * when linking mingw-w64, add the "always link" libs so that we generate DLL import .lib files for them as the linker code relies on. * COFF LLD linker does not support -r so we do a file copy as an alternative to the -r thing that ELF linking does. I will file an issue for the corresponding TODO upon merging this branch, to look into an optimization that possibly elides this copy when the source and destination are both cache directories. * add a CLI error message when trying to link multiple objects into one and using COFF object format.
2020-09-28stage2: building mingw-w64 and COFF LDD linkingAndrew Kelley
still TODO is the task of creating import .lib files for DLLs on the fly both for -lfoo and for e.g. `extern "kernel32"`
2020-09-24fix a round of regressions in this branchAndrew Kelley
* Don't try to generate C header files yet since it will only cause a crash saying the feature is unimplemented. * Rename the CLI options for release modes to use the `-O` prefix to match C compiler precedent. Options are now `-ODebug`, `-OReleaseFast`, `-OReleaseSafe`, `-OReleaseSmall`. The optimization mode matches the enum tags of std.builtin.Mode. It is planned to, at some point, rename std.builtin.Mode to std.builtin.OptimizationMode and modify the tags to be lower case to match the style convention. - Update build.zig code to support this new CLI. * update std.zig.binNameAlloc to support an optional Version and update the implementation to correctly deal with dynamic library version suffixes.
2020-09-09stage2: more progress moving `zig cc` to stage2Andrew Kelley
* std.cache_hash exposes Hasher type * std.cache_hash makes hasher_init a global const * std.cache_hash supports cloning so that clones can share the same open manifest dir handle as well as fork from shared hasher state * start to populate the cache_hash for stage2 builds * remove a footgun from std.cache_hash add function * get rid of std.Target.ObjectFormat.unknown * rework stage2 logic for resolving output artifact names by adding object_format as an optional parameter to std.zig.binNameAlloc * support -Denable-llvm in stage2 tests * Module supports the use case when there are no .zig files * introduce c_object_table and failed_c_objects to Module * propagate many new kinds of data from CLI into Module and into linker.Options * introduce -fLLVM, -fLLD, -fClang and their -fno- counterparts. closes #6251. - add logic for choosing when to use LLD or zig's self-hosted linker * stub code for implementing invoking Clang to build C objects * add -femit-h, -femit-h=foo, and -fno-emit-h CLI options
2020-09-03update uses of deprecated type field accessVexu
2020-08-21Hash functions now accept an option setFrank Denis
- This avoids having multiple `init()` functions for every combination of optional parameters - The API is consistent across all hash functions - New options can be added later without breaking existing applications. For example, this is going to come in handy if we implement parallelization for BLAKE2 and BLAKE3. - We don't have a mix of snake_case and camelCase functions any more, at least in the public crypto API Support for BLAKE2 salt and personalization (more commonly called context) parameters have been implemented by the way to illustrate this.
2020-08-20Breaking: sort std/crypto functions into categoriesFrank Denis
Instead of having all primitives and constructions share the same namespace, they are now organized by category and function family. Types within the same category are expected to share the exact same API.
2020-08-20add license header to all std lib filesAndrew Kelley
add SPDX license identifier copyright ownership is zig contributors
2020-08-19fixes and improvements for parseCharLiteraldbandstra
2020-08-18stage2: character literals and multiline stringsVexu
2020-08-03stage2 .debug_line stepping with gdb is workingAndrew Kelley
2020-08-02codegen: emit .debug_line ops for IR instructionsAndrew Kelley
2020-06-24self-hosted: add compare output test for new AST->ZIR codeAndrew Kelley
2020-06-18stage2: hook up Zig AST to ZIRAndrew Kelley
* Introduce the concept of anonymous Decls * Primitive Hello, World with inline asm works * There is still an unsolved problem of how to manage ZIR instructions memory when generating from AST. Currently it leaks.
2020-05-01add ZIR compare output test case to test suiteAndrew Kelley
2020-04-19implement rendering escaped zig string literalsAndrew Kelley
2020-02-28separate std.Target and std.zig.CrossTargetAndrew Kelley
Zig now supports a more fine-grained sense of what is native and what is not. Some examples: This is now allowed: -target native Different OS but native CPU, default Windows C ABI: -target native-windows This could be useful for example when running in Wine. Different CPU but native OS, native C ABI. -target x86_64-native -mcpu=skylake Different C ABI but otherwise native target: -target native-native-musl -target native-native-gnu Lots of breaking changes to related std lib APIs. Calls to getOs() will need to be changed to getOsTag(). Calls to getArch() will need to be changed to getCpuArch(). Usage of Target.Cross and Target.Native need to be updated to use CrossTarget API. `std.build.Builder.standardTargetOptions` is changed to accept its parameters as a struct with default values. It now has the ability to specify a whitelist of targets allowed, as well as the default target. Rather than two different ways of collecting the target, it's now always a string that is validated, and prints helpful diagnostics for invalid targets. This feature should now be actually useful, and contributions welcome to further improve the user experience. `std.build.LibExeObjStep.setTheTarget` is removed. `std.build.LibExeObjStep.setTarget` is updated to take a CrossTarget parameter. `std.build.LibExeObjStep.setTargetGLibC` is removed. glibc versions are handled in the CrossTarget API and can be specified with the `-target` triple. `std.builtin.Version` gains a `format` method.
2020-02-19make the CLI support depending on system headers and librariesAndrew Kelley
(include and lib search paths) The detection of native system paths is self-hosted. closes #2041
2019-09-25mv std/ lib/Andrew Kelley
that's all this commit does. further commits will fix cli flags and such. see #2221