347 Commits

Author SHA1 Message Date
Alex Rønne Petersen
b38fb4bff3
Merge pull request #25917 from alexrp/target-features
`std.Target`: add CPU features and models for alpha and hppa
2025-11-14 12:23:09 +01:00
Alex Rønne Petersen
9ab7eec23e represent Mac Catalyst as aarch64-maccatalyst-none rather than aarch64-ios-macabi
Apple's own headers and tbd files prefer to think of Mac Catalyst as a distinct
OS target. Earlier, when DriverKit support was added to LLVM, it was represented
a distinct OS. So why Apple decided to only represent Mac Catalyst as an ABI in
the target triple is beyond me. But this isn't the first time they've ignored
established target triple norms (see: armv7k and aarch64_32) and it probably
won't be the last.

While doing this, I also audited all Darwin OS prongs throughout the codebase
and made sure they cover all the tags.
2025-11-14 11:33:35 +01:00
Alex Rønne Petersen
39e91deb77
std.Target: add CPU features and models for hppa 2025-11-13 22:29:12 +01:00
Alex Rønne Petersen
2b23f98d2c
std.Target: add CPU features and models for alpha 2025-11-13 22:28:50 +01:00
Alex Rønne Petersen
dfd7b7f233 std.Target: remove Abi.cygnus
There is approximately zero chance of the Zig team ever spending any effort on
supporting Cygwin; the MSVC and MinGW-w64 ABIs are superior in every way that
matters, and not least because they lead to binaries that just run natively on
Windows without needing a POSIX emulation environment installed.
2025-11-12 22:39:04 +01:00
Alex Rønne Petersen
f34b5ce288
std.Target.DynamicLinker: define standard paths for alpha, microblaze, sh on netbsd and openbsd 2025-11-10 09:40:44 +01:00
Alex Rønne Petersen
255fc44036
std.Target: fix toElfMachine() for arc/arceb 2025-11-10 09:40:44 +01:00
Alex Rønne Petersen
378eec95b8
std.Target: kvx requires 32-byte aligned stacks 2025-11-10 08:20:24 +01:00
Alex Rønne Petersen
2c470d24b3
std.Target: add Arch tag and info for kvx 2025-11-10 08:20:21 +01:00
Carl Åstholm
54f2a7c833 Move std.Target.SubSystem to std.zig.Subsystem
Also updates the field names to conform with the rest of std.
2025-11-05 01:31:26 +01:00
Alex Rønne Petersen
8468549726
std.Target: bump vulkan max version to 1.4.331 2025-10-31 15:46:44 +01:00
Alex Rønne Petersen
d677086bcd
std.Target: bump opencl/nvcl max version to 3.0.19 2025-10-31 15:46:29 +01:00
Alex Rønne Petersen
adbf46aef3
std.Target: bump cuda max version to 13.0.2 2025-10-31 15:46:08 +01:00
Alex Rønne Petersen
802ee515d8
std.Target: bump amdhsa max version to 7.1.0 2025-10-31 15:45:57 +01:00
Alex Rønne Petersen
27c949689e
std.Target: bump wasi max version to 0.3.0 2025-10-31 15:45:43 +01:00
Alex Rønne Petersen
3801e6366f
std.Target: bump dragonfly max version to 6.4.2 2025-10-31 15:45:26 +01:00
Alex Rønne Petersen
a9c648c060
std.Target: bump linux max version to 6.17 2025-10-31 15:45:13 +01:00
Alex Rønne Petersen
0116d98093
std.Target: bump fuchsia max version to 28.0.0 2025-10-31 15:45:01 +01:00
Alex Rønne Petersen
38413446b0
std.Target: bump contiki max version to 5.1.0 2025-10-31 15:44:47 +01:00
Alex Rønne Petersen
a7119d4269 remove all IBM AIX and z/OS support
As with Solaris (dba1bf935390ddb0184a4dc72245454de6c06fd2), we have no way to
actually audit contributions for these OSs. IBM also makes it even harder than
Oracle to actually obtain these OSs.

closes #23695
closes #23694
closes #3655
closes #23693
2025-10-29 14:25:51 +01:00
Alex Rønne Petersen
06d9e3bc06
Merge pull request #25691 from GasInfinity-Forks/x86_16-gcc
feat: init x86_16 arch via CBE
2025-10-28 10:19:21 +01:00
Alex Rønne Petersen
dba1bf9353 remove all Oracle Solaris support
There is no straightforward way for the Zig team to access the Solaris system
headers; to do this, one has to create an Oracle account, accept their EULA to
download the installer ISO, and finally install it on a machine or VM. We do not
have to jump through hoops like this for any other OS that we support, and no
one on the team has expressed willingness to do it.

As a result, we cannot audit any Solaris contributions to std.c or other
similarly sensitive parts of the standard library. The best we would be able to
do is assume that Solaris and illumos are 100% compatible with no way to verify
that assumption. But at that point, the solaris and illumos OS tags would be
functionally identical anyway.

For Solaris especially, any contributions that involve APIs introduced after the
OS was made closed-source would also be inherently more risky than equivalent
contributions for other proprietary OSs due to the case of Google LLC v. Oracle
America, Inc., wherein Oracle clearly demonstrated its willingness to pursue
legal action against entities that merely copy API declarations.

Finally, Oracle laid off most of the Solaris team in 2017; the OS has been in
maintenance mode since, presumably to be retired completely sometime in the 2030s.

For these reasons, this commit removes all Oracle Solaris support.

Anyone who still wishes to use Zig on Solaris can try their luck by simply using
illumos instead of solaris in target triples - chances are it'll work. But there
will be no effort from the Zig team to support this use case; we recommend that
people move to illumos instead.
2025-10-27 07:35:38 -07:00
GasInfinity
104c272ae5
feat: init x86_16 arch via CBE 2025-10-27 11:19:51 +01:00
Alex Rønne Petersen
9161923405
Revert "std.Target: xtensa defaults to windowed ABI"
This reverts commit c55e83eab1369373fe6db5072802c2fc1c4d7ebc.

This was a misreading of XtensaFeatures.td on my part.
2025-10-27 06:09:33 +01:00
Alex Rønne Petersen
70206af482
Merge pull request #25640 from alexrp/std-target-more-arches
`std.Target`: add tags and info for alpha, hppa, microblaze, sh + some bonus commits
2025-10-23 19:35:54 +02:00
Alex Rønne Petersen
340d6ce1bf
std.builtin: move AddressSpace.Context to std.Target.AddressSpaceContext
This type has nothing to do with the language.
2025-10-23 09:27:17 +02:00
Alex Rønne Petersen
af1d777b27
std.builtin: add CallingConvention.sh_interrupt
Only supported in CBE.
2025-10-23 09:27:17 +02:00
Alex Rønne Petersen
4fa453ce20
std.builtin: add CallingConvention.microblaze_interrupt
Only supported in CBE.
2025-10-23 09:27:17 +02:00
Alex Rønne Petersen
abf40caeb7
std.builtin: add CallingConvention.msp430_interrupt
Supported by LLVM and CBE.
2025-10-23 09:27:17 +02:00
Alex Rønne Petersen
beb507a1ed
std.builtin: add CallingConvention.x86_64_x32
This was forgotten during the refactoring of std.builtin.CallingConvention. It
mirrors mips64_n32 for MIPS.
2025-10-23 09:27:17 +02:00
Alex Rønne Petersen
a1441943e4
std.Target: add stackGrowth() function 2025-10-23 09:27:17 +02:00
Alex Rønne Petersen
ee72f06f47
std.Target: add tags and info for alpha, hppa, microblaze, sh 2025-10-23 09:27:17 +02:00
Alex Rønne Petersen
c55e83eab1
std.Target: xtensa defaults to windowed ABI 2025-10-23 09:27:17 +02:00
Alex Rønne Petersen
3e2daa509a
std.Target: add arceb and xtensaeb Cpu.Arch tags 2025-10-23 09:27:17 +02:00
Alex Rønne Petersen
dda05b29c0
std.Target: fix cMaxIntAlignment() for a few architectures 2025-10-23 09:27:17 +02:00
Alex Rønne Petersen
45b80f2e41
std.Target: fix cTypePreferredAlignment() for arc 2025-10-23 09:27:17 +02:00
Alex Rønne Petersen
862e674758
std.Target: remove bogus hosted avr/msp430 prongs in cTypeBitSize()
These are microcontroller architectures; none of the OSs in the outer switch
run on them.
2025-10-23 09:27:17 +02:00
Alex Rønne Petersen
022dcbc37a
std.Target.DynamicLinker: recognize standard hexagon-linux-musl path 2025-10-23 09:27:16 +02:00
Alex Rønne Petersen
a7f085f0d7
std.Target: fix cCallingConvention() to pick mips64_n32 for muslabin32 2025-10-23 09:27:16 +02:00
Alex Rønne Petersen
93d54cb866 std.Target: bump min-max versions for OpenBSD from 7.6-7.7 to 7.7-7.8
https://cdn.openbsd.org/pub/OpenBSD/7.8/ANNOUNCEMENT
2025-10-23 03:21:06 +02:00
Alex Rønne Petersen
0e15b2ac10
std.Target: handle some more cases in toCoffMachine() 2025-10-22 17:28:19 +02:00
Alex Rønne Petersen
362a44a122
std.Target: better Abi.default() behavior for arc and xtensa 2025-10-22 17:28:19 +02:00
Alex Rønne Petersen
e8d060e5f5
std.Target: update lists of omitted LLVM tags 2025-10-22 17:28:19 +02:00
Alex Rønne Petersen
dbf9c7b548 compiler: add support for arc_interrupt calling convention
Only for use with the C backend at the moment.
2025-10-19 22:27:19 +02:00
Alex Rønne Petersen
f3da54f53c std.Target: move Cpu.supportsAddressSpace() up to here
This allows us to rule out support for certain address spaces based on the OS.
This commit is just a refactor, however, and doesn't actually make use of that
opportunity yet.
2025-10-18 11:13:28 +02:00
Alex Rønne Petersen
ddc815e3d8 drop support for powerpc64 ELF v1
* ELF v1 on powerpc64 is only barely kept on life support in a couple of Linux
  distros. I don't anticipate that this will last much longer.
* Most of the Linux world has moved to powerpc64le which requires ELF v2.
* Some Linux distros have even started supporting powerpc64 with ELF v2.
* The BSD world has long since moved to ELF v2.
* We have no actual linking support for ELF v1.
* ELF v1 had confused DWARF register mappings which is becoming a problem in
  our DWARF code in std.debug.

It's clear that ELF v1 is on its way out, and we never fully supported it
anyway. So let's not waste any time or energy on it going forward.

closes #5927
2025-10-06 01:28:56 +02:00
Alex Rønne Petersen
73602f2a13
std.Target: baseline model for s390x-zos should be arch10, not arch8 2025-10-05 00:23:51 +02:00
Jacob Young
e1f3fc6ce2 Coff2: create a new linker from scratch 2025-10-02 17:44:52 -04:00
Andrew Kelley
426af68b7d compiler: require comptime vector indexes 2025-09-20 18:33:00 -07:00
Alex Rønne Petersen
5e9e1fb0c8
std.Target: adjustments to LoongArch CPU models
* Remove the generic model; we already have generic_la32 and generic_la64 and
  pick appropriately based on bitness.
* Remove the loongarch64 model. We used this as our baseline for 64-bit, but it's
  actually pretty misleading and useless; it doesn't represent any real CPU and
  has less features than generic_la64.
* Add la64v1_0 and la64v1_1 models.
* Change our baseline CPU model for 64-bit to be la64v1_0, thus adding LSX to
  the baseline feature set.
2025-09-18 12:42:24 +02:00