Commit Graph

10795 Commits

Author SHA1 Message Date
Alex Rønne Petersen
1c8f0b8909 libcxx: Update to LLVM 19.
* Moved the tz.cpp patch to experimental/tzdb.cpp.
* Extended the __config_site patch to a few more files.
2024-09-19 18:20:21 -07:00
Alex Rønne Petersen
d13bc04cb4 libcxxabi: Update to LLVM 19. 2024-09-19 18:20:21 -07:00
Alex Rønne Petersen
26ddfabba4 libunwind: Update to LLVM 19. 2024-09-19 18:20:21 -07:00
Alex Rønne Petersen
dc14434c0a clang: Update compiler-provided C headers to Clang 19. 2024-09-19 18:20:21 -07:00
Juan Julián Merelo Guervós
8b82a0e0fc
std.DynamicBitSet: remove wrong and useless comments (#21418) 2024-09-19 17:06:23 -07:00
Linus Groh
72fc164178 std.os.linux: Fix tc_oflag_t for PowerPC
std/os/linux.zig:6504:20: error: expected type 'os.linux.NLDLY__enum_11313', found 'comptime_int'
2024-09-19 16:55:00 -07:00
Jay Petacat
812557bfde std: Restore conventional compareFn behavior for binarySearch
PR #20927 made some improvements to the `binarySearch` API, but one
change I found surprising was the relationship between the left-hand and
right-hand parameters of `compareFn` was inverted. This is different
from how comparison functions typically behave, both in other parts of
Zig (e.g. `std.math.order`) and in other languages (e.g. C's `bsearch`).
Unless a strong reason can be identified and documented for doing
otherwise, I think it'll be better to stick with convention.

While writing this patch and changing things back to the way they were,
the predicates of `lowerBound` and `upperBound` seemed to be the only
areas that benefited from the inversion. I don't think that benefit is
worth the cost, personally. Calling `Order.invert()` in the predicates
accomplishes the same goal.
2024-09-16 14:04:18 -07:00
mlugg
1365be5d02
compiler: provide correct result types to += and -=
Resolves: #21341
2024-09-16 16:42:42 +01:00
mlugg
5d7fa5513f std.Build: allow packages to expose arbitrary LazyPaths by name 2024-09-15 17:24:44 -07:00
CrazyboyQCD
8ddce90e62
std.ascii: make toLower toUpper branchless (#21369)
Co-authored-by: WX\shixi <shixi1@cnwxsoft.com>
2024-09-13 17:22:19 -07:00
Alex Rønne Petersen
b56a667ecd start: Rewrite arm code to work for thumb1 too.
0ecc6332b4 improved things for thumb2, but thumb1
has a much smaller permissible instruction set. This commit makes that work.
2024-09-12 20:10:45 -07:00
Linus Groh
e17dfb9da0 std.http.WebSocket: Make 'upgrade: websocket' check case-insensitive
I've seen implementations in the wild that send 'Upgrade: WebSocket',
which currently fails the handshake.

From https://datatracker.ietf.org/doc/html/rfc6455:

"If the response lacks an |Upgrade| header field or the |Upgrade| header
field contains a value that is not an ASCII case-insensitive match for
the value "websocket", the client MUST _Fail the WebSocket Connection_."
2024-09-12 20:02:19 -07:00
mlugg
03c363300f AstGen: do not allow unlabeled break to exit a labeled switch
`break`ing from something which isn't a loop should always be opt-in.
This was a bug in #21257.
2024-09-12 22:52:23 +01:00
Linus Groh
8588964972 Replace deprecated default initializations with decl literals 2024-09-12 16:01:23 +01:00
Andrew Kelley
eccd06f5d0
Merge pull request #21370 from ziglang/fuzz
rework fuzzing API to accept a function pointer parameter
2024-09-11 23:41:51 -07:00
Andrew Kelley
e3f58bd551 add runs per second to fuzzing ui
closes #21025
2024-09-11 19:53:29 -07:00
Andrew Kelley
4fba7336a9
Merge pull request #21269 from alexrp/soft-float
Fix soft float support, split musl triples by float ABI, and enable CI
2024-09-11 17:41:55 -07:00
Andrew Kelley
9dc75f03e2 fix init template for new fuzz testing API 2024-09-11 13:41:29 -07:00
Andrew Kelley
2d005827b8 make lowest stack an internal libfuzzer detail
This value is useful to help determine run uniqueness in the face of
recursion, however it is not valuable to expose to the fuzzing UI.
2024-09-11 13:41:29 -07:00
Andrew Kelley
0cdccff519 fuzzer: move web files into separate directory 2024-09-11 13:41:29 -07:00
Andrew Kelley
9bc731b30a fuzzing: better std.testing.allocator lifetime management 2024-09-11 13:41:29 -07:00
Andrew Kelley
2b76221a46 libfuzzer: use a function pointer instead of extern
solves the problem presented in the previous commit message
2024-09-11 13:41:29 -07:00
Andrew Kelley
892ce7ef52 rework fuzzing API
The previous API used `std.testing.fuzzInput(.{})` however that has the
problem that users call it multiple times incorrectly, and there might
be work happening to obtain the corpus which should not be included in
coverage analysis, and which must not slow down iteration speed.

This commit restructures it so that the main loop lives in libfuzzer and
directly calls the "test one" function.

In this commit I was a little too aggressive because I made the test
runner export `fuzzer_one` for this purpose. This was motivated by
performance, but it causes "exported symbol collision: fuzzer_one" to
occur when more than one fuzz test is provided.

There are three ways to solve this:

1. libfuzzer needs to be passed a function pointer instead. Possible
   performance downside.

2. build runner needs to build a different process per fuzz test.
   Potentially wasteful and unclear how to isolate them.

3. test runner needs to perform a relocation at runtime to point the
   function call to the relevant unit test. Portability issues and
   dubious performance gains.
2024-09-11 13:41:29 -07:00
Andrew Kelley
b81782366b
Merge pull request #21367 from RetroDev256/faster-tokenizer
Update the zig tokenizer to use labeled switch statements
2024-09-10 19:59:43 -07:00
David Rubin
421fbd939c
thread: don't leak the thread in spawnManager (#21379) 2024-09-11 01:04:59 +00:00
Eric Petersen
36b89101df tokenizer: use labeled switch statements 2024-09-10 16:09:37 -07:00
Jacob Young
6aa6d088d9 Dwarf: implement and test hash maps 2024-09-10 13:06:08 -04:00
Jacob Young
e048e78886 Dwarf: implement and test multi array list 2024-09-10 12:27:57 -04:00
Ian Johnson
9007534551 std.zig.tokenizer: simplify line-based tokens
Closes #21358
Closes #21360

This commit modifies the `multiline_string_literal_line`, `doc_comment`,
and `container_doc_comment` tokens to no longer include the line ending
as part of the token. This makes it easier to handle line endings (which
may be LF, CRLF, or in edge cases possibly nonexistent) consistently.

In the two issues linked above, Autodoc was already assuming this for
doc comments, and yielding incorrect results when handling files with
CRLF line endings (both in Markdown parsing and source rendering).

Applying the same simplification for multiline string literals also
brings `zig fmt` into conformance with
https://github.com/ziglang/zig-spec/issues/38 regarding formatting of
multiline strings with CRLF line endings: the spec says that `zig fmt`
should remove the CR from such line endings, but this was not previously
the case.
2024-09-10 13:34:33 +03:00
Alex Rønne Petersen
f1645772c1
compiler_rt: Export __truncdfhf2() for AEABI too.
Similar to __truncsfhf2() and __extendhfsf2().
2024-09-10 08:53:30 +02:00
Alex Rønne Petersen
26119bd98d
test: Skip some floating point tests that fail on arm-linux-(gnu,musl)eabi.
https://github.com/ziglang/zig/issues/21234
2024-09-10 08:53:30 +02:00
Alex Rønne Petersen
65d36be4a8
std.zig.system: Work around llvm/llvm-project#105978 by disabling vfp2.
https://github.com/llvm/llvm-project/issues/105978
2024-09-10 08:53:30 +02:00
xdBronch
d6d09f4ea7 add error for discarding if/while pointer capture 2024-09-10 01:45:48 +03:00
Des-Nerger
6b1f509422 std.zig.render: replace magic number 4 with indent_delta. 2024-09-10 01:27:49 +03:00
Veikka Tuominen
de8cece6e7 sync Aro dependency
ref: adfd13c6ffb563b1379052b92f6ae4148b91cc12
2024-09-09 12:35:49 +03:00
Linus Groh
54b668f8a3 std.fmt: Update casing of a few functions to match naming style guide 2024-09-08 11:30:20 -07:00
Alex Rønne Petersen
af04404b49 std: Fix assembler comment syntax for sparc. 2024-09-07 13:16:22 -07:00
pfg
c97db8e497
Support stringifying non-exhaustive enum to json (#21228) 2024-09-07 11:06:41 -04:00
Andrew Kelley
5f3d9e0b7a
Merge pull request #21261 from alexrp/riscv32
More `riscv32-linux` port work
2024-09-06 17:43:10 -07:00
Alex Rønne Petersen
af370a69cd
std.Target: Make Abi.floatAbi() more accurate.
Also rename Target.getFloatAbi() to floatAbi().
2024-09-06 20:11:47 +02:00
Alex Rønne Petersen
17f54e8274
std.zig.target: Split powerpc-linux-musl triple into powerpc-linux-musleabi(hf). 2024-09-06 20:11:47 +02:00
Alex Rønne Petersen
c1a70acc91
std.zig.target: Split mips(el)-linux-musl triples into mips(el)-linux-musleabi(hf).
Closes #21184.
2024-09-06 20:11:47 +02:00
Alex Rønne Petersen
a0205fff98
std.DynLib: Prefer std.fs.File.stat() over posix.fstat().
This is necessary for riscv32-linux.
2024-09-06 20:03:15 +02:00
Alex Rønne Petersen
65a6e9eee5
std.posix: Skip a couple of tests that use fstat()/fstatat() on riscv32. 2024-09-06 20:03:15 +02:00
Alex Rønne Petersen
f35015575e
std.time: Use clock_nanosleep() to implement sleep() on Linux.
This fixes the function for riscv32 where the old nanosleep() is not available.
clock_nanosleep() has been available since Linux 2.6 and glibc 2.1 anyway.
2024-09-06 20:03:12 +02:00
Alex Rønne Petersen
8043197995
std.os.linux: Add clock_nanosleep() syscall wrapper. 2024-09-06 20:03:00 +02:00
Andrew Kelley
f29bdd6746
Merge pull request #21263 from alexrp/thumb-fixes
Some fixes for `thumb-linux-*` support
2024-09-06 10:55:45 -07:00
Andrew Kelley
96fcc8d63b
Merge pull request #21195 from alexrp/glibc-fixes
`glibc`: Some bug fixes, plus arc and csky start files
2024-09-06 10:50:56 -07:00
Alex Rønne Petersen
b230e4f598 glibc: Patch to work around missing features in LLVM's s390x assembler.
Revert this with LLVM 20.
2024-09-06 10:39:30 -07:00
Ian Johnson
3543f28320 std.math.big.int: fix shiftRight sign handling
Closes #21311

The sign of the result `r` needs to be initialized before the correction
`r.addScalar(r.toConst(), -1)`, or the intended end result could be off
by 2 (depending on the original sign of `r`).
2024-09-06 10:36:12 -07:00