aboutsummaryrefslogtreecommitdiff
path: root/lib/std/Target/Query.zig
AgeCommit message (Collapse)Author
2025-10-29Elf2: start implementing dynamic linkingJacob Young
2025-10-29std.zig.system: upgrade to std.Io.ReaderAndrew Kelley
2025-10-28Fix stale reference bug in `std.zig.system.resolveTargetQuery` (#25713)Sean
Co-authored-by: Alex Rønne Petersen <alex@alexrp.com>
2025-08-11std.ArrayList: make unmanaged the defaultAndrew Kelley
2025-08-05std.Target.Query: fix `WindowsVersion` format in `zigTriple()`KNnut
2025-07-07std.fmt: breaking API changesAndrew Kelley
added adapter to AnyWriter and GenericWriter to help bridge the gap between old and new API make std.testing.expectFmt work at compile-time std.fmt no longer has a dependency on std.unicode. Formatted printing was never properly unicode-aware. Now it no longer pretends to be. Breakage/deprecations: * std.fs.File.reader -> std.fs.File.deprecatedReader * std.fs.File.writer -> std.fs.File.deprecatedWriter * std.io.GenericReader -> std.io.Reader * std.io.GenericWriter -> std.io.Writer * std.io.AnyReader -> std.io.Reader * std.io.AnyWriter -> std.io.Writer * std.fmt.format -> std.fmt.deprecatedFormat * std.fmt.fmtSliceEscapeLower -> std.ascii.hexEscape * std.fmt.fmtSliceEscapeUpper -> std.ascii.hexEscape * std.fmt.fmtSliceHexLower -> {x} * std.fmt.fmtSliceHexUpper -> {X} * std.fmt.fmtIntSizeDec -> {B} * std.fmt.fmtIntSizeBin -> {Bi} * std.fmt.fmtDuration -> {D} * std.fmt.fmtDurationSigned -> {D} * {} -> {f} when there is a format method * format method signature - anytype -> *std.io.Writer - inferred error set -> error{WriteFailed} - options -> (deleted) * std.fmt.Formatted - now takes context type explicitly - no fmt string
2025-06-19Target: pass and use locals by pointer instead of by valueJacob Young
This struct is larger than 256 bytes and code that copies it consistently shows up in profiles of the compiler.
2025-06-05std.Target: Introduce Cpu convenience functions for feature tests.Alex Rønne Petersen
Before: * std.Target.arm.featureSetHas(target.cpu.features, .has_v7) * std.Target.x86.featureSetHasAny(target.cpu.features, .{ .sse, .avx, .cmov }) * std.Target.wasm.featureSetHasAll(target.cpu.features, .{ .atomics, .bulk_memory }) After: * target.cpu.has(.arm, .has_v7) * target.cpu.hasAny(.x86, &.{ .sse, .avx, .cmov }) * target.cpu.hasAll(.wasm, &.{ .atomics, .bulk_memory })
2025-03-09std.Target.Query: Don't append glibc version in zigTriple() if ABI isn't GNU.Alex Rønne Petersen
2025-02-17std.Target: Remove functions that just wrap component functions.Alex Rønne Petersen
Functions like isMinGW() and isGnuLibC() have a good reason to exist: They look at multiple components of the target. But functions like isWasm(), isDarwin(), isGnu(), etc only exist to save 4-8 characters. I don't think this is a good enough reason to keep them, especially given that: * It's not immediately obvious to a reader whether target.isDarwin() means the same thing as target.os.tag.isDarwin() precisely because isMinGW() and similar functions *do* look at multiple components. * It's not clear where we would draw the line. The logical conclusion before this commit would be to also wrap Arch.isX86(), Os.Tag.isSolarish(), Abi.isOpenHarmony(), etc... this obviously quickly gets out of hand. * It's nice to just have a single correct way of doing something.
2025-01-16x86_64: implement clz and notJacob Young
2025-01-05std: fix undefined value in Target.Querymlugg
This is an RLS footgun. Resolves: #21834
2024-11-24std.Target: Add Os.HurdVersionRange for Os.Tag.hurd.Alex Rønne Petersen
This is necessary since isGnuLibC() is true for hurd, so we need to be able to represent a glibc version for it. Also add an Os.TaggedVersionRange.gnuLibCVersion() convenience function.
2024-11-06Provide a detailed message for invalid arch in target triple (#21921)Daniel Hooper
2024-11-01std.Target: Add support for specifying Android API level.Alex Rønne Petersen
2024-10-16std.Target: Rename OS version range functions to drop the "get" prefix.Alex Rønne Petersen
2024-10-16std.Target: Change Cpu.baseline() to also be able to take OS into consideration.Alex Rønne Petersen
2024-10-12std.Target.Query: fix compilation error (#21669)DravenK
closes #21668 Co-authored-by: Alex Rønne Petersen <alex@alexrp.com>
2024-09-24std.Target: Introduce Abi.androideabi to distinguish the soft float case.Alex Rønne Petersen
Abi.android on its own is not enough to know whether soft float or hard float should be used. In the C world, androideabi is typically used for the soft float case, so let's go with that. Note that Android doesn't have a hard float ABI, so no androideabihf. Closes #21488.
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-23std.Target.Query: Fix `parse` test on ABIs like `gnueabi`, `gnuabi64`, etc.Alex Rønne Petersen
The `zigTriple()` implementation simply returns `gnu` when a glibc version is provided but a more specific ABI isn't.
2024-04-18std.Build: revert --host-target, --host-cpu, --host-dynamic-linkerAndrew Kelley
This is a partial revert of 105db13536b4dc2affe130cb8d2eee6c97c89bcd. As we learned from Void Linux packaging, these options are not actually helpful since the distribution package manager may very well want to cross-compile the packages that it is building. So, let's not overcomplicate things. There are already the standard options: -Dtarget, -Dcpu, and -Ddynamic-linker. These options are generally provided when the project generates machine code artifacts, however, there may be a project that does no such thing, in which case it makes sense for these options to be missing. The Zig Build System is a general-purpose build system, after all.
2024-04-14Target: cleanupJacob Young
2024-03-13zig libc: allow non-native targetsMichael Dusan
On macos, allow targets supported by the SDK. This then spawns `xcrun` and correct paths are emitted for: - x86_64-macos - x86_64-ios - x86_64-tvos - x86_64-watchos - x86_64-ios-macbi - aarch64-macos - aarch64-ios - aarch64-tvos - aarch64-watchos - aarch64-ios-macbi On platforms with android NDK, allow android targets. Example usage: ``` CC=/NDK/.../bin/aarch64-linux-android34-clang zig libc -target aarch64-linux-android ```
2024-02-02std.Target.Query: avoid using builtin.target.abiAndrew Kelley
This value is very likely incorrect. When glibc_version is provided but no explicit ABI is provided, use the string "gnu" instead.
2024-01-01std.Target.Query: fix regression with windows os version rangeAndrew Kelley
somebody left a landmine here without even a comment to warn about it
2024-01-01std.Target.Query: remove deprecated APIAndrew Kelley
These functions have been doomed for a long time. Finally I figured out what the proper relationship between this API and std.Target is.
2024-01-01std.Target: add DynamicLinkerAndrew Kelley
2024-01-01rename std.zig.CrossTarget to std.Target.QueryAndrew Kelley