Commit Graph

37954 Commits

Author SHA1 Message Date
Alex Rønne Petersen 520af69660 zig cc: update intrinsic headers to LLVM 22 2026-04-25 21:49:39 +02:00
Alex Rønne Petersen 1180711035 zig cc: update driver files to LLVM 22 2026-04-25 21:49:39 +02:00
Alex Rønne Petersen 2b6ab59435 cmake: update to LLVM 22
closes https://codeberg.org/ziglang/zig/issues/30558
2026-04-25 21:49:39 +02:00
Alex Rønne Petersen 54573e3542 compiler: fix LLVM ABI selection for loongarch32-linux-musl* 2026-04-25 21:49:39 +02:00
Alex Rønne Petersen 8deae2da4c std.zig.llvm.Builder: fix writing u64 max constant for type bit_count > 64 2026-04-25 21:49:39 +02:00
Alex Rønne Petersen 48d5b66677 std.Target: fuchsia supports arm/thumb now 2026-04-25 21:49:38 +02:00
Alex Rønne Petersen 8a1ec6a54d std.Target: fix Abi.float() for muslsf 2026-04-25 21:49:38 +02:00
Alex Rønne Petersen 47848ba3d6 zig cc: define __CRT__NO_INLINE for MinGW-w64 targets
See added comment for why.
2026-04-25 21:49:38 +02:00
Matthew Lugg 0a9c4008fd Compilation: fix writeDepFile with no file system inputs 2026-04-25 21:49:38 +02:00
Matthew Lugg a8c74e0565 Compilation: add link objects to file system inputs 2026-04-25 21:49:38 +02:00
Matthew Lugg 9ba89394df compiler: raise FD limit before opening link inputs 2026-04-25 21:49:38 +02:00
Matthew Lugg 31bc385a96 cbe: add missing cast of overflow arithmetic out pointer 2026-04-25 05:22:41 +02:00
Jonathan Marler 23bcb8148f add missing CONNECTION_REFUSED and CONNECTION_RESET errors for windows
Adds missing errors CONNECTION_REFUSED for netConnectIpWindows and
CONNECTION_RESET for both netReadWindows and netWriteWindows.  I'm able
to induce these 3 errors on my Windows 11 machine.
2026-04-25 05:20:16 +02:00
Andrew Kelley fb9ba5e4b3 Merge pull request 'llvm: fix multiple_llvm_types handling and aarch64 return types' (#32028) from aarch64-c-abi into master
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/32028
Reviewed-by: Andrew Kelley <andrew@ziglang.org>
2026-04-25 05:19:18 +02:00
Sertonix 5cc281e723 std.os.linux: avoid invalid asm error with gcc on x86
Even though these registry mentions are supposed to be in a comment they
seem to still be interpreted by gcc.

Alternatively one could try to make zig not include comments in assembly
blocks when generating C code.

In function 'os_linux_x86_syscall6__6685',
    inlined from 'os_linux_copy_file_range__4300' at zig2.c:396643:7,
    inlined from 'link_MappedFile_copyFileRange__14079.isra' at zig2.c:289222:10:
zig2.c:396692:2: error: invalid 'asm': operand number missing after %-letter
396692 |  __asm volatile(" push %[args56]\n push %%ebp\n mov 4(%%esp), %%ebp\n mov %%edi, 4(%%esp)\n // The saved %edi and %ebp are on the stack, and %ebp points to `args56`.\n // Prepare the last two args, syscall, then pop the saved %ebp and %edi.\n mov (%%ebp), %%edi\n mov 4(%%ebp), %%ebp\n int  $0x80\n pop  %%ebp\n pop  %%edi": [ret]"=r"(t5): [number]"r"(t6), [arg1]"r"(t7), [arg2]"r"(t8), [arg3]"r"(t9), [arg4]"r"(t10), [args56]"rm"(t2): "memory");
       |  ^~~~~
zig2.c:396692:2: error: invalid 'asm': operand number missing after %-letter
zig2.c:396692:2: error: invalid 'asm': operand number missing after %-letter
zig2.c:396692:2: error: invalid 'asm': operand number missing after %-letter
zig2.c:396692:2: error: invalid 'asm': operand number missing after %-letter
2026-04-24 07:33:22 +02:00
Andrew Kelley f6258b562d Merge pull request 'fix bugs with handling fuzzing crashes' (#32033) from gooncreeper/zig:fuzz-crash-report-bugs into master
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/32033
Reviewed-by: Andrew Kelley <andrew@ziglang.org>
2026-04-24 02:31:12 +02:00
Sertonix 084eab03d7 compiler_rt: Fix extern mem{set,cpy,move} type on arm
Otherwise gcc will refuse to compile the bootstrap compiler_rt.c.
Excerpt of the errors:

/builds/sertonix/aports/community/zig/src/zig-0.16.0/build/compiler_rt.c:1459:21: error: conflicting types for 'memcpy'; have 'uint8_t *(uint8_t *, const uint8_t *, uintptr_t)' {aka 'unsigned char *(unsigned char *, const unsigned char *, unsigned int)'}
 1459 | zig_extern uint8_t *memcpy(uint8_t *a0 zig_nonstring, uint8_t const *a1 zig_nonstring, uintptr_t a2);
      |                     ^~~~~~
/builds/sertonix/aports/community/zig/src/zig-0.16.0/stage1/zig.h:510:18: note: previous declaration of 'memcpy' with type 'void *(void *, const void *, unsigned int)'
  510 | zig_extern void *memcpy (void *zig_restrict, void const *zig_restrict, size_t);
      |                  ^~~~~~
/builds/sertonix/aports/community/zig/src/zig-0.16.0/build/compiler_rt.c: In function 'zig_e___negxf2':
/builds/sertonix/aports/community/zig/src/zig-0.16.0/build/compiler_rt.c:1758:9: error: passing argument 1 of 'memcpy' from incompatible pointer type [-Wincompatible-pointer-types]
 1758 |  memcpy(&t0, &a0, 16);
      |         ^~~
      |         |
      |         zig_u128 *
2026-04-23 08:42:53 +02:00
Kendall Condon 332d632ccc collect all stderr on fuzzing crash 2026-04-22 20:54:17 -04:00
Kendall Condon 122e0c26f2 properly scan through inputs when saving fuzzing crash 2026-04-22 20:54:17 -04:00
Matthew Lugg 99b90a4315 incremental: add misssing dependency on backing/tag type source code 2026-04-23 01:13:22 +02:00
Andrew Kelley 9c7759bdc3 Merge pull request 'distribute the lldb and gdb pretty printers' (#32017) from distribute-debug-helpers into master
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/32017
2026-04-23 01:12:33 +02:00
Andrew Kelley b047641f26 distribute the lldb pretty printers
rather than having them only in the source tree in tools/, distribute
them to zig users.

gdb ones are too outdated, delete them.

stage1 also is useless now.
2026-04-22 16:11:02 -07:00
Andrew Kelley 49fe3f887e tools: rename stage2 to compiler 2026-04-22 16:11:02 -07:00
Andrew Kelley 00a11421e6 remove stage1 debug helpers python code 2026-04-22 16:11:02 -07:00
andrew.kraevskii bbab366b78 Audit usages of toOwnedSlice (#32001)
Followup to #30769

I grepped for `try .*toOwnedSlice` and checked all of them by hand.

Fixes a bunch of memory leaks removes usages or `errdefer` and `vars` in some places. I also switched array_list.Managed to ArrayList where it was convenient.

Reviewed-on: https://codeberg.org/ziglang/zig/pulls/32001
Reviewed-by: Andrew Kelley <andrew@ziglang.org>
2026-04-22 19:35:46 +02:00
rpkak 03955476ad zigc: test and fix strtol and similar 2026-04-22 19:30:39 +02:00
Jacob Young df3aba6cc0 llvm: fix multiple_llvm_types handling and aarch64 return types
Closes #31994
2026-04-22 13:19:44 -04:00
Jacob Young ea45895a2d tests: cleanup c abi test runner 2026-04-22 13:19:44 -04:00
rpkak 9df02121d0 link.Elf: support R_X86_64_PC64 2026-04-22 19:15:18 +02:00
Alex Rønne Petersen 8a113f83d4 Merge pull request 'Linux 7.0 headers + syscalls' (#32019) from alexrp/zig:linux-7.0 into master
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/32019
2026-04-22 16:32:24 +02:00
Alex Rønne Petersen 73c51c142c ci: update QEMU to 11.0.0 2026-04-22 16:31:08 +02:00
Jacob Young c0e90312fc test: c abi regression tests for aarch64 failures 2026-04-22 14:35:22 +02:00
Jacob Young 97ef8f1f8e llvm: pass more c abi tests on aarch64
This is not what clang does, and is definitely wrong on big endian,
but lets at least pass the following simple tests first.
2026-04-22 14:35:22 +02:00
Alex Rønne Petersen b985404569 std.os.linux: update syscalls to 7.0 2026-04-22 08:37:56 +02:00
Alex Rønne Petersen 7ec6872cc4 libc: update Linux headers to 7.0 2026-04-22 08:37:15 +02:00
Alex Rønne Petersen 8bf72740e3 std.os.linux.IoUring: disable tests on PowerPC
https://codeberg.org/ziglang/zig/issues/31562
2026-04-22 08:27:51 +02:00
glowsquid 0b768cd9dd zig reduce: fix compilation (#31930)
fixes #31926

Reviewed-on: https://codeberg.org/ziglang/zig/pulls/31930
Reviewed-by: Andrew Kelley <andrew@ziglang.org>
2026-04-22 02:00:41 +02:00
Chris Boesch 3ea77badf9 libc: strdup, strndup, wcsdup (#31935)
Contributes to: #30978

Reviewed-on: https://codeberg.org/ziglang/zig/pulls/31935
Reviewed-by: Andrew Kelley <andrew@ziglang.org>
2026-04-22 01:57:58 +02:00
Pavel Verigo 22945fbbdc stage2-wasm: vector, std tests 2026-04-22 00:19:46 +02:00
Pavel Verigo 36faf76fe1 AstGen: add missing addRestoreErrRetIndex calls when handling for/while expr
Fixes #30912
2026-04-22 00:17:52 +02:00
Andrew Kelley d4cac43d30 Merge pull request 'libc: add common implementations of pthread_spin_*' (#31990) from GasInfinity/zig:pthread-spin into master
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/31990
Reviewed-by: Andrew Kelley <andrew@ziglang.org>
2026-04-21 22:29:33 +02:00
Ryan Liptak cfde9303ff Fetch: Fix zip fetching when cache directory doesn't have tmp dir
Fixes #31964
2026-04-21 18:07:36 +02:00
Andrew Kelley b5d8966e05 Merge pull request 'package fetching fixes and enhancements' (#31992) from fetch-enhancements into master
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/31992
2026-04-21 18:06:13 +02:00
GasInfinity f8e9593851 fix: wasm requires strict function prototypes
* `pthread_mutex_*` and friends are also invalid then but they're not
  currently tested (and there's no wasi prong in `pthread_mutex_t`)
2026-04-21 14:45:24 +02:00
GasInfinity a2a91199d7 fix: add pthread_spin_* definitions for the BSDs in std.c
* each BSD has a different one
2026-04-21 10:31:47 +02:00
GasInfinity 61cd38e8ac feat(libzigc): add common implementations of pthread_spin_*
* and remove their mingw, musl and wasi implementations
2026-04-21 09:03:06 +02:00
Andrew Kelley 74b56501b3 fetch: fix the check against package paths escaping root 2026-04-20 21:45:12 -07:00
Andrew Kelley 4636a761cb fetch: fix "unable to open" error message 2026-04-20 19:59:17 -07:00
Andrew Kelley bc9fabcc3f zig fetch: add --debug-log [scope] arg 2026-04-20 19:58:39 -07:00
Andrew Kelley 3a9b16db44 zig fetch: detect global vs local mode via --save
Makes `zig fetch` only fetch globally, just like it used to. However, if
`--save` (or any variant) is used, then it also fetches locally.

When fetching by path, the hash is always computed, recompressed tarball
is always created, always overwrites any existing global cache entry.

closes #31818
closes #31866 (only requires build.zig file when --save is passed)
2026-04-20 18:45:16 -07:00