26280 Commits

Author SHA1 Message Date
Andrew Kelley
f9c9ae84c6 glibc patch: version-gate _DYNAMIC_STACK_SIZE_SOURCE
This is a patch to glibc features.h which makes
_DYNAMIC_STACK_SIZE_SOURCE undefined unless the version is >= 2.34.

This feature was introduced with glibc 2.34 and without this patch, code
built against these headers but then run on an older glibc will end up
making a call to sysconf() that returns -1 for the value of SIGSTKSZ
and MINSIGSTKSZ.
2023-10-13 17:44:27 -07:00
Andrew Kelley
4bfa18b07f glibc patch: don't hardcode __GLIBC_MINOR__
Instead Zig passes it based on the target.
2023-10-13 17:44:27 -07:00
Andrew Kelley
8d3892b755 update glibc headers to 2.38 2023-10-13 17:44:27 -07:00
Andrew Kelley
0813539c28 it's unclear which zig target glibc sparcv9 maps to
so let's not include those headers until more investigation happens.
2023-10-13 17:44:27 -07:00
Andrew Kelley
4a3002848c glibc: update libc-modules.h to 2.38 2023-10-13 17:44:27 -07:00
Andrew Kelley
2314051aca update glibc start files to 2.38
I went ahead and left the README.md file deleted because it had broken
git hashes. Better to use `git log -- lib/libc/glibc/` to find out the
patches.
2023-10-13 17:44:27 -07:00
Andrew Kelley
87b3e23172 tools/update_glibc: exempt some more files 2023-10-13 17:44:27 -07:00
Andrew Kelley
f458c13494 glibc: update abilists file
generated from the latest commits of ziglang/glibc-abi-tool which
contains glibc 2.35, 2.36, 2.37, and 2.38.
2023-10-13 17:44:27 -07:00
Andrew Kelley
7aa85691b0
Merge pull request #17504 from ziglang/fix-var-args-coercion
Sema: fix crash when coercion dest is var args
2023-10-13 08:16:55 -07:00
radar roark
244233da2a remove redundant use of pathFromRoot 2023-10-13 07:20:45 -07:00
Andrew Kelley
027aabf497 drop for loop syntax upgrade mechanisms 2023-10-13 03:43:54 -07:00
Andrew Kelley
69dc1a6bb2 llvm: fix incorrect file paths in debug info
The previous code incorrectly added `sub_path` twice.

Also for the compilation unit, it was passing empty string to realpath,
resulting in the error handling codepath being used.

closes #17482
2023-10-13 03:07:50 -07:00
Andrew Kelley
b6762c2473 Sema: fix crash when ref coercion dest is var args
When analyzing the `validate_ref_ty` ZIR instruction, an assertion would
trip if the result type was a var args function argument. The fix is the
same as e6b73be870a39f4da7a08a40da23e38b5e9613da - inline the logic of
`resolveType` and handle the case of var args.

Closes #17494
2023-10-13 00:31:22 -07:00
Andrew Kelley
e6b73be870 Sema: fix crash when coercion dest is var args
When analyzing the `as` ZIR instruction, an assertion would trip if the
result type was a var args function argument. The fix is simple: inline
a little bit of the `resolveType` logic into `analyzeAs` to make it
detect this situation - which it was already attempting to do.

Closes #16197
2023-10-12 22:03:39 -07:00
Ryan Liptak
2769215b90 Add zig rc subcommand, a drop-in replacement for rc.exe
Uses resinator under-the-hood (see https://github.com/ziglang/zig/pull/17069)

Closes #9564
2023-10-12 16:19:34 -07:00
Koakuma
375bb5f4a1 lib: Fix asm code in _start for SPARC
SPARCs have delayed branches, that is, it will unconditionally
run the next instruction following a branch.
Slightly reorder the _start code sequence to prevent it from
accidentally executing stray instructions, which may result in odd
program behavior.
2023-10-12 16:13:32 -07:00
Andrew Kelley
67ee68fc9e
Merge pull request #17498 from ziglang/fix-fetch
path-related fixes for Package.Fetch and Package.Manifest
2023-10-12 15:48:16 -07:00
JustinWayland
b37fdf387a Fix minor typo in the description of Progress 2023-10-13 00:44:30 +03:00
Andrew Kelley
b9f75a39d3 Package.Manifest: fix error message for paths
closes #17491
2023-10-12 10:47:22 -07:00
Andrew Kelley
1d1e5a8617 Package.Fetch: fix empty path and "." not including all
Related to #17491
2023-10-12 10:47:22 -07:00
Kai Jellinghaus
2254882ebe Fix compilation failure in valgrind.zig 2023-10-12 10:17:49 -07:00
Krzysztof Wolicki
8c6b0271cc Package.Fetch: wrap operations involving tmp_directory in a block
This makes tmp_directory close before calling renameTmpIntoCache which fixes occurences of those AccessDenied errors that aren't synonymous with PathAlreadyExists on Windows
2023-10-11 20:28:07 -07:00
Alexander Heinrich
4e188dd66c Update docs of PriorityQueue.iterator() and PriorityDeque.iterator() 2023-10-12 04:48:22 +03:00
Andrew Kelley
1302274910 move two TODO comments to a github issue 2023-10-11 11:40:13 -07:00
Andrew Kelley
f80ca1d66a disable flaky test 2023-10-11 11:35:51 -07:00
Andrew Kelley
5722261e64
Merge pull request #17465
Compilation: default to self-hosted backends when not using libllvm
2023-10-11 00:53:07 -07:00
Ryan Liptak
42998e637b Package: Fix path separator not being escaped between root_dir and sub_path
Fixes a package fetching regression on Windows. Closes #17477
2023-10-10 23:02:03 -07:00
mlugg
1033d71017 Sema,type: unify type query functions
The following pairs of functions have been combined using the "advanced"
pattern used for other type queries:

* `Sema.fnHasRuntimeBits`, `Type.isFnOrHasRuntimeBits`
* `Sema.typeRequiresComptime`, `Type.comptimeOnly`
2023-10-10 21:40:23 -07:00
Krzysztof Wolicki
7edba14d7c
Step.Run: change cwd to ?Build.LazyPath (#17418)
closes #17409
2023-10-10 18:39:44 -04:00
Krzysztof Wolicki
7abf9b3a83
Step.Compile: add options struct for addCSourceFiles (#17420)
Closes #17410
2023-10-10 14:29:26 -04:00
Andrew Kelley
da7e4fb31a revert compiler_rt: no need to put it in a static library
This mostly reverts 6e0904504155d3cba80955c108116170fd739aec however it
leaves intact the linker supporting both obj and lib files, and the
frontend choosing which one to create.
2023-10-10 11:23:39 -07:00
Jakub Konka
33ef01d16b macho: test for presence of _abc as export in 16308 test 2023-10-10 11:17:29 -07:00
Andrew Kelley
8679c7a607 Compilation: default to self-hosted backend when not using libllvm
When not using libllvm, it means the compiler is not capable of
producing an object file or executable, making the self-hosted backends
be a better default.
2023-10-10 11:17:29 -07:00
Andrew Kelley
6e09045041 compiler_rt: no need to put it in a static library
It's simpler to link against compiler_rt.o directly.
2023-10-10 11:17:29 -07:00
Andrew Kelley
2ca7cc46c4 Package.Fetch: fix inclusions not working for directories
Oops, the loop was checking the wrong variable! Added a unit test.
2023-10-10 02:29:29 -07:00
Andrew Kelley
aaf46187ab
Merge pull request #17391 from xxxbxxx/load-i4
codegen/llvm: truncate padding bits when loading a non-byte-sized value
2023-10-09 22:06:49 -07:00
Andrew Kelley
fa08e49f83 Package.Fetch: allow relative paths outside project root
Only for packages that come from the main package. Fetched packages
still cannot depend on paths outside their package root.
2023-10-09 22:01:18 -07:00
Veikka Tuominen
b2c36b14de Sema: fix dbg_inline instructions not being emitted
This broke with #16604 but went unnoticed due to lack of tests.
Closes #17444
2023-10-09 21:00:31 -07:00
Eric Joldasov
1f6d82ec01 std.cstr: remove deprecated namespace
Followup to 0a868dacdd31b7d5c529a332da718683477a2505 .

Signed-off-by: Eric Joldasov <bratishkaerik@getgoogleoff.me>
2023-10-10 02:08:03 +03:00
Jonathan Marler
3a47bc7154 Grammar: Use ContainerDeclaration* instead of ContainerDeclarations
`ContainerDeclarations` is an abstraction of `ContainerDeclaration*`.
Removing this abstraction allows the `ContainerMembers` rule to contain
more concrete information without having to look at the definition
of `ContainerDeclarations`.
2023-10-10 00:51:58 +03:00
Jacob Young
9e341a6da3
Merge pull request #17447 from jacobly0/x86_64
x86_64: fix codegen errors when compiling compiler_rt
2023-10-09 16:18:50 -04:00
Andrew Kelley
f7bc55c013
Merge pull request #17392 from ziglang/fetch
rework package manager
2023-10-09 11:47:37 -07:00
Karl Seguin
75b48ef503
std.mem: use indexOfScalarPos when indexOf is called where needle.len == 1
When `std.mem.indexOf` is called with a single-item needle, use `indexOfScalarPos` which is significantly faster than the more general `indexOfPosLinear`.  This can be done without introducing overhead to normal cases (where `needle.len > 1`).
2023-10-09 16:50:16 +03:00
Pat Tullmann
57874ce619
lib/std/fs/test.zig: cleanup (#17443)
* fs/test.zig: use arena allocator more consistently

* fs/test.zig: remove unnecessary type information

Zig can (now?) implicitly cast a `&.{ "foo"}` when passed to
`fs.path.join()`, so the `[_][]const u8` is unnecessary.

* fs/test.zig: Use fs.path.join() for longer paths

Replace long path constructions (that use several "++ path_sep ++")
with a single call to `fs.path.join`.  Seems more readable to me.

* fs/test.zig: fmt
2023-10-09 16:44:14 +03:00
Jacob Young
922b5b5453 x86_64: implement 128-bit integer multiply and divide 2023-10-09 05:23:23 -04:00
Jacob Young
d559c61902 x86_64: implement @min and @max for 128-bit integers 2023-10-09 03:11:41 -04:00
Jacob Young
21948d7540 x86_64: implement @abs of 128-bit integers 2023-10-09 03:11:41 -04:00
Jacob Young
a96c08c1d1 x86_64: implement struct field value for register pairs 2023-10-09 03:11:40 -04:00
Jacob Young
f28b1657aa x86_64: implement 128-bit integer shifts in registers 2023-10-09 03:09:01 -04:00
Andrew Kelley
95907cb795 restore progress reporting for package fetching 2023-10-08 21:14:30 -07:00