282 Commits

Author SHA1 Message Date
Alex Rønne Petersen
ba7cc72c47
std.Target: bump watchos min version to 8.0.0 2025-08-03 20:08:19 +02:00
Alex Rønne Petersen
71722df4ab
std.Target: bump driverkit min version to 20.0.0 2025-08-03 20:08:07 +02:00
Alex Rønne Petersen
e9093b8d18
std.Target: bump max versions for Apple targets 2025-08-03 20:05:21 +02:00
Alex Rønne Petersen
5b74d33471
std.Target: bump amdhsa max version to 6.4.2 2025-08-03 20:00:32 +02:00
Alex Rønne Petersen
afe458e9b6
std.Target: bump vulkan max version to 1.4.321 2025-08-03 19:59:46 +02:00
Alex Rønne Petersen
7f2140710f
std.Target: bump cuda max version to 12.9.1 2025-08-03 19:59:46 +02:00
Alex Rønne Petersen
39b653c5e7
std.Target: bump freebsd max version to 14.3.0 2025-08-03 19:59:43 +02:00
Alex Rønne Petersen
af3baee5ca
std.Target: bump linux max version to 6.16.0 2025-08-03 19:59:40 +02:00
Alex Rønne Petersen
1808ecfa04
std.Target: bump fuchsia max version to 27.0.0 2025-08-03 19:59:35 +02:00
Andrew Kelley
0cb558ba3a better default min versions for freebsd and netbsd
Without this change, by default you get a failure when trying to cross
compile for these targets.

freebsd was error: undefined symbol: __libc_start1
netbsd was warning: invalid target NetBSD libc version: 9.4.0
error: unable to build NetBSD libc shared objects: InvalidTargetLibCVersion

now they work by default
2025-07-15 15:32:18 +02:00
Andrew Kelley
7e2a26c0c4 std.io.Writer.printValue: rework logic
Alignment and fill options only apply to numbers.

Rework the implementation to mainly branch on the format string rather
than the type information. This is more straightforward to maintain and
more straightforward for comptime evaluation.

Enums support being printed as decimal, hexadecimal, octal, and binary.

`formatInteger` is another possible format method that is
unconditionally called when the value type is struct and one of the
integer-printing format specifiers are used.
2025-07-07 22:43:53 -07:00
Andrew Kelley
0e37ff0d59 std.fmt: breaking API changes
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-07-07 22:43:51 -07:00
Andrew Kelley
aa52bb8327 zig fmt 2025-07-07 13:39:16 -07:00
Ali Cheraghi
1df79ab895 remove spirv cpu arch 2025-06-23 06:03:03 +02:00
Jacob Young
917640810e Target: pass and use locals by pointer instead of by value
This struct is larger than 256 bytes and code that copies it
consistently shows up in profiles of the compiler.
2025-06-19 11:45:06 -04:00
Andrew Kelley
5a52da1b7a CI: skip llvm backend tests in the script for testing x86 backend 2025-06-06 23:42:15 -07:00
Alex Rønne Petersen
9d534790eb std.Target: Introduce Cpu convenience functions for feature tests.
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-06-05 06:12:00 +02:00
Jacob Young
ec579aa0f3
Legalize: implement scalarization of @shuffle 2025-06-01 08:24:01 +01:00
Ali Cheraghi
0901328f12 spirv: write error value in an storage buffer 2025-05-21 12:57:40 +03:30
Alex Rønne Petersen
1a82cceb8c
std.Target: Factor arch/ABI into NetBSD minimum OS version selection.
Based on data in std.zig.target.
2025-05-17 04:41:27 +02:00
Alex Rønne Petersen
6028db7f29
std.Target: Add isNetBSDLibC() function. 2025-05-17 04:41:27 +02:00
Alex Rønne Petersen
8a7d925d36
std.Target: Fix requiresLibC() for NetBSD. 2025-05-17 04:41:27 +02:00
Alex Rønne Petersen
3d6f83b331
std.Target: Adjust DynamicLinker.standard() for NetBSD.
* powerpc64 does not appear to be a thing.
* riscv32/riscv64 have not had actual releases yet.
2025-05-17 04:41:27 +02:00
Alex Rønne Petersen
8285de62d5
Merge pull request #23745 from alexrp/target-os-versions
`std.Target`: Update supported OS version ranges
2025-05-12 16:59:46 +02:00
Alex Rønne Petersen
833d4c9ce4
Merge pull request #23835 from alexrp/freebsd-libc
Support dynamically-linked FreeBSD libc when cross-compiling
2025-05-12 01:19:23 +02:00
Alex Rønne Petersen
c3906718b3
Merge pull request #23810 from alexrp/more-test-targets 2025-05-11 20:52:47 +02:00
Alex Rønne Petersen
837e0f9c37 std.Target: Remove ObjectFormat.nvptx (and associated linker code).
Textual PTX is just assembly language like any other. And if we do ever add
support for emitting PTX object files after reverse engineering the bytecode
format, we'd be emitting ELF files like the CUDA toolchain. So there's really no
need for a special ObjectFormat tag here, nor linker code that treats it as a
distinct format.
2025-05-10 12:21:57 +02:00
Alex Rønne Petersen
0e3609b8e0
std.Target: Factor arch/ABI into FreeBSD minimum OS version selection.
Based on data in std.zig.target.
2025-05-10 12:19:26 +02:00
Alex Rønne Petersen
309ff9c34e
std.Target: Add isFreeBSDLibC() function. 2025-05-10 12:19:26 +02:00
Alex Rønne Petersen
46042170cb
std.Target: Fix requiresLibC() for FreeBSD. 2025-05-10 12:19:26 +02:00
Alex Rønne Petersen
23cb2b2662
std.Target: Handle {powerpc64,riscv32}-netbsd in DynamicLinker.standard(). 2025-05-09 14:07:40 +02:00
Alex Rønne Petersen
d3e8541268
std.Target: Prune dead targets in Abi.default() and DynamicLinker.standard(). 2025-05-08 21:32:20 +02:00
Alex Rønne Petersen
bf9b15ee67 std.Target: Add Cpu.Arch.or1k and basic target info. 2025-05-03 11:22:27 +02:00
Alex Rønne Petersen
c1fc353923
std.Target: Update maximum supported Vulkan version. 2025-05-02 19:56:00 +02:00
Alex Rønne Petersen
8b7f512b9a
std.Target: Update maximum supported CUDA version. 2025-05-02 19:55:58 +02:00
Alex Rønne Petersen
3af2594df5
std.Target: Update supported AMD ROCm version range. 2025-05-02 19:55:08 +02:00
Alex Rønne Petersen
b3977695bd
std.Target: Update supported Apple OS version ranges. 2025-05-02 19:54:48 +02:00
Alex Rønne Petersen
be8b6b5435
std.Target: Update supported OpenBSD version range. 2025-05-02 19:54:34 +02:00
Alex Rønne Petersen
f3bf26138c
std.Target: Update maximum supported Dragonfly BSD version. 2025-05-02 19:54:10 +02:00
Alex Rønne Petersen
9013d9ed78
std.Target: Update maximum supported AIX version. 2025-05-02 19:53:58 +02:00
Alex Rønne Petersen
2f999dd3af
std.Target: Update supported Hermit version range. 2025-05-02 19:52:47 +02:00
Alex Rønne Petersen
cb4022b039
std.Target: Update supported Fuchsia version range. 2025-05-02 19:52:23 +02:00
Alex Rønne Petersen
e7b46363ae std.Target: Remove Os.Tag.elfiamcu.
The last Intel Quark MCU was released in 2015. Quark was announced to be EOL in
2019, and stopped shipping entirely in 2022.

The OS tag was only meaningful for Intel's weird fork of Linux 3.8.7 with a
special ABI that differs from the regular i386 System V ABI; beyond that, the
CPU itself is just a plain old P54C (i586). We of course keep support for the
CPU itself, just not Intel's Linux fork.
2025-04-28 00:24:09 +02:00
Alex Rønne Petersen
5668c8b7ba std.Target: Bump minimum glibc to 2.34 for arches migrating to 64-bit time.
https://github.com/ziglang/zig/issues/21738#issuecomment-2822411842
2025-04-27 00:24:55 +02:00
Alex Rønne Petersen
23440fbb99 std.Target: Remove Abi.gnuilp32.
* This has not seen meaningful development for about a decade.
* The Linux kernel port was never upstreamed.
* The glibc port was never upstreamed.
* GCC 15.1 recently deprecated support it.

It may still make sense to support an ILP32 ABI on AArch64 more broadly (which
we already have the Abi.ilp32 tag for), but, to the extent that it even existed
in any "official" sense, the *GNU* ILP32 ABI is certainly dead.
2025-04-26 22:12:31 +02:00
Andrew Kelley
2cb69e53b4
Merge pull request #23541 from alexrp/linux-5.10
`std.Target`: Bump minimum Linux kernel and glibc versions according to Debian LTS
2025-04-13 17:25:34 -04:00
Alex Rønne Petersen
46d03c5afa
std.Target: Bump minimum glibc version to 2.31.
This is the version in Debian LTS (bullseye).
2025-04-11 21:11:20 +02:00
Alex Rønne Petersen
731d6531bf
std.Target: Bump minimum Linux kernel version to 5.10.
This is the kernel in Debian LTS (bullseye).
2025-04-11 21:10:55 +02:00
Alex Rønne Petersen
ed9aa8f259 compiler: Move int size/alignment functions to std.Target and std.zig.target.
This allows using them in e.g. compiler-rt.
2025-04-11 05:22:00 -04:00
Alex Rønne Petersen
0132be7bf3 std.Target: Rename charSignedness() to cCharSignedness().
To be consistent with the other functions that answer C ABI questions.
2025-04-11 05:22:00 -04:00