11801 Commits

Author SHA1 Message Date
Alex Rønne Petersen
379f1c9fa0
std.Build.Step: Don't capture a stack trace if !std.debug.sys_can_stack_trace. 2025-04-15 01:30:52 +02:00
Pat Tullmann
2a7683933a
linux.zig: epoll_wait: pass kernel sigset size
Linux kernel syscalls expect to be given the number of bits of sigset that
they're built for, not the full 1024-bit sigsets that glibc supports.

I audited the other syscalls in here that use `sigset_t` and they're all
using `NSIG / 8`.

Fixes #12715
2025-04-10 10:49:04 +02:00
Meghan Denny
9397dc5af6
std: add nvidia as a known arm implementer 2025-04-09 15:03:45 +02:00
Stefan Weigl-Bosker
8bb7c85bd4
start: fix pc register syntax for m68k 2025-04-08 12:10:22 +02:00
Alex Rønne Petersen
79e3c4a9a8
start: Align the stack on m68k. 2025-04-08 12:10:16 +02:00
Alex Rønne Petersen
b2feb0d575
glibc: Add missing stubs-lp64s.h for loongarch64-linux-gnusf.
https://sourceware.org/bugzilla/show_bug.cgi?id=32776
2025-04-06 17:23:19 +02:00
Zenomat
a2ea4b02bc
std.net: Implement if_nametoindex for windows (#22555) 2025-04-05 20:41:50 +02:00
Alex Rønne Petersen
1bada4b275
Merge pull request #23447 from alexrp/cpuid-updates 2025-04-03 19:32:59 +02:00
Alex Rønne Petersen
f5de2770e5
Merge pull request #23445 from alexrp/external-executor-fixes 2025-04-03 19:32:54 +02:00
Misaki Kasumi
d128f5c0bb
std.os.linux: block all signals in raise 2025-04-02 23:57:32 +02:00
Parker Liu
06fc600aec
translate-c: fix function prototype decalared inside a function
* If a function prototype is declarated inside a function, do not
  translate it to a top-level extern function declaration. Similar to
  extern local variable, just wrapped it into a block-local struct.

* Add a new extern_local_fn tag of aro_translate_c node for present
  extern local function declaration.

* When a function body has a C function prototype declaration, it adds
  an extern local function declaration. Subsequent function references
  will look for this function declaration.
2025-04-02 23:56:07 +02:00
Auguste Rame
0b4176891c
DebugAllocator: Fix bucket removal logic causing segfault/leak (#23390)
Make buckets doubly linked
2025-04-02 14:22:15 +02:00
Ali Cheraghi
edaa9584cc
zon: normalize negative zeroes 2025-04-02 08:43:21 +02:00
Parker Liu
6ecd143212
translate-c: fix referencing extern locals from nested blocks 2025-04-02 08:43:13 +02:00
Alex Rønne Petersen
4c0913ff7c
Merge pull request #23417 from dweiller/zstd-fixes
Zstd fixes
2025-03-31 17:52:23 +02:00
Simon Brown
e5ea175ffb
Add quota for comptime sort, add test 2025-03-31 17:52:16 +02:00
Sean Stasiak
9025f73733
check result of mmap() call to handle a large base_addr value correctly 2025-03-27 21:08:23 +01:00
Alex Rønne Petersen
ed6418544c
Merge pull request #23373 from alexrp/get-base-address
`std.process`: Some minor fixes for `getBaseAddress()`
2025-03-27 21:08:04 +01:00
Андрей Краевский
8088105b05
std.meta.FieldType -> @FieldType 2025-03-27 12:19:07 +01:00
孙冰
38a8fd5d85
std.posix: update LFS64 interfaces for android bionic C 2025-03-26 23:52:16 +01:00
Felix "xq" Queißner
3592868435
Enables parsing for '-Wl,-rpath,' in pkg-config output, allows better support for NixOS linking. 2025-03-26 23:51:58 +01:00
wooster0
27ae10afe0
linux: don't export getauxval when not required 2025-03-26 21:52:44 +01:00
Kendall Condon
f391a2cd20
Allocator.create: properly handle alignment for zero-sized types (#21864) 2025-03-26 21:52:12 +01:00
dweiller
172dc6c314
zig build: add env_map entries to hash for Step.Run
This change fixes false-positive cache hits for run steps that get run
with different sets of environment variables due the the environment map
being excluded from the cache hash.
2025-03-26 15:41:17 +01:00
Arnau Camprubí
9c857bb32d
Fix std.debug.dumpHex address offsets 2025-03-26 15:40:56 +01:00
Alex Rønne Petersen
38ececf0a7
Merge pull request #23310 from Rexicon226/fix-23309
big.int: return normalized results from `{add,sub}Carry`
2025-03-25 18:44:58 +01:00
Chris Clark
cb3eec285f
std.zig.Ast: Fix error case memory leak in parse() 2025-03-25 15:40:55 +01:00
godalming123
0367d46d3c
Update the documentation comment in arena_allocator.zig to be more accurate
Update the documentation comment in arena_allocator.zig to specify that free() is a no-op unless the item is the most recent allocation.
2025-03-25 15:24:20 +01:00
孙冰
d67bf8bde3
std.c: android bionic C supports arc4random_buf and getentropy
1. https://android.googlesource.com/platform/bionic/+/refs/heads/main/libc/include/bits/getentropy.h
2. https://android.googlesource.com/platform/bionic/+/refs/heads/main/libc/include/stdlib.h
2025-03-25 15:24:07 +01:00
Alex Rønne Petersen
7d8a556ba9
Merge pull request #23220 from samy-00007/bytesAsSlice-fix
Minor fix for `Allocator.remap` and `mem.bytesAsSlice` for zero-sized types
2025-03-25 15:23:08 +01:00
rpkak
1aca3dd6e0
DepTokenizer: allow space between target and colon 2025-03-24 15:31:59 +01:00
Shun Sakai
f062ec2a1a
docs(std.base64): Add references to RFC 4648
There are multiple implementations of Base64, but `std.base64` appears
to be based on RFC 4648, so we clarify that it is based on RFC 4648.
2025-03-24 15:31:58 +01:00
GasInfinity
a7cfc23e5a
fix(std/fmt.zig): fix overflow in fmtDurationSigned
fixes #23315
2025-03-24 15:31:53 +01:00
Jacob Young
7757302c3a big.int: fix negative multi-limb shift right adjust crash 2025-03-23 21:59:12 -04:00
Jacob Young
4f47be5c6b big.int: fix yet another truncate bug
Too many bugs have been found with `truncate` at this point, so it was
rewritten from scratch.

Based on the doc comment, the utility of `convertToTwosComplement` over
`r.truncate(a, .unsigned, bit_count)` is unclear and it has a subtle
behavior difference that is almost certainly a bug, so it was deleted.
2025-03-23 21:59:07 -04:00
Ryan Liptak
59bdd77229 Trick the meson build system into thinking zig rc is rc.exe
When determining the type of RC compiler, meson passes `/?` or `--version` and then reads from `stdout` looking for particular string(s) anywhere in the output.

So, by adding the string "Microsoft Resource Compiler" to the `/?` output, meson will recognize `zig rc` as rc.exe and give it the correct options, which works fine since `zig rc` is drop-in CLI compatible with rc.exe.

This allows using `zig rc` with meson for (cross-)compiling, by either:

- Setting WINDRES="zig rc" or putting windres = ['zig', 'rc'] in the cross-file
  + This will work like rc.exe, so it will output .res files. This will only link successfully if you are using a linker that can do .res -> .obj conversion (so something like zig cc, MSVC, lld)
- Setting WINDRES="zig rc /:output-format coff" or putting windres = ['zig', 'rc', '/:output-format', 'coff'] in the cross-file
  + This will make meson pass flags as if it were rc.exe, but it will cause the resulting .res file to actually be a COFF object file, meaning it will work with any linker that handles COFF object files

Example cross file that uses `zig cc` (which can link `.res` files, so `/:output-format coff` is not necessary) and `zig rc`:

```
[binaries]
c = ['zig', 'cc', '--target=x86_64-windows-gnu']
windres = ['zig', 'rc']

[target_machine]
system = 'windows'
cpu_family = 'x86_64'
cpu = 'x86_64'
endian = 'little'
```
2025-03-21 15:07:57 -07:00
Alex Rønne Petersen
bfc554b542 compiler: Support more GCC code models and fix the mapping to LLVM code models.
Closes #22517.
2025-03-20 13:34:04 -07:00
Roman Frołow
74a79da4ec
typo: was issues -> was issued 2025-03-18 04:58:08 +01:00
Jonathan Gautheron
18b821666e
std.zig.c_translation: fix function pointer casting 2025-03-18 04:58:03 +01:00
Loris Cro
f954950485
std.Build.Watch: fix macos implementation
The code did one useless thing and two wrong things:

- ref counting was basically a noop
- last_dir_fd was chosen from the wrong index and also under the wrong
  condition

This caused regular crashes on macOS which are now gone.
2025-03-18 04:57:31 +01:00
Elijah M. Immer
f79dacbfc4
lib/std/http/Client.zig: Ignore empty proxy environment variables (#23223)
This fixes #21032 by ignoring proxy environment variables that are
empty.
2025-03-14 21:20:55 +01:00
TCROC
dc75a64c46
glibc: fix uninitialized memory in __pthread_cond_s for <=2.40
* https://sourceware.org/bugzilla/show_bug.cgi?id=32786
* https://inbox.sourceware.org/libc-alpha/87zfhpfqsm.fsf@oldenburg.str.redhat.com
2025-03-14 21:19:17 +01:00
mlugg
af4b39395c std.mem.Allocator.remap: fix incorrect doc comment (part 2) 2025-03-12 12:25:32 -07:00
孙冰
99b5a4f294 std.c: fix sysconf names (std.c._SC) for android api
c.f. https://android.googlesource.com/platform/bionic/+/refs/heads/main/libc/include/bits/sysconf.h
2025-03-12 12:25:20 -07:00
mlugg
72775adcd0 std.mem.Allocator.remap: fix incorrect doc comment
Resolves: #23194
2025-03-11 11:20:46 -07:00
Alex Rønne Petersen
6d44a8cd0b std.Target.Query: Don't append glibc version in zigTriple() if ABI isn't GNU. 2025-03-09 12:07:34 -07:00
Jacob Young
8b9c517515 compiler-rt: fix signed min int from float 2025-03-08 11:22:46 -08:00
Andrew Kelley
8e91862571 fix InstallArtifact opening empty string
this appears to have been a problem since 43f73af3595c3174b8e67e9f2792c3774f2192e9
2025-03-07 13:34:13 -08:00
Alex Rønne Petersen
3c924abb69 std.zig.llvm.bitcode_writer: Fix word byte order on big endian systems.
The bitcode format always uses little endian words. Prior to this commit, a
bitcode file produced on e.g. aarch64_be or s390x would fail to be loaded by
LLVM.
2025-03-04 17:28:03 -05:00
Andrew Kelley
1e2b3b1df9 std.Build.Step: fix missing path sep in error message
I have a more robust solution to this coming up in the writer interface
branch.
2025-03-03 17:18:18 -08:00