32312 Commits

Author SHA1 Message Date
Alex Rønne Petersen
566cc4f99d
compiler: Fix @import("builtin").unwind_tables logic. 2025-01-18 14:57:41 +01:00
Andrew Kelley
f38d7a92cc
Merge pull request #22513 from ziglang/memcpy
enhance memcpy and remove redundant implementations
2025-01-17 22:52:03 -05:00
Andrew Kelley
f7f6217df9 macho linker: adjust symbol priority
strong symbols always take precedence over weak symbols.
2025-01-17 15:12:01 -08:00
axel escalada
f9a43770c8
std.zip: Add ZIP64 support for local file header extra field
This PR adds support for handling ZIP64 format in local file headers,
when a zip file contains entries where the compressed or uncompressed
size fields are set to 0xFFFFFFFF, and the extra field contains ZIP64
extended information tag (0x0001)

The code now:

Reads the actual sizes from the ZIP64 extra field data
Validates these sizes against the entry's compressed and uncompressed sizes

Zip file format spec.: https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT

This change allows proper extraction of ZIP files that use ZIP64 format in their
local file headers.

Fixes: #22329
2025-01-17 22:55:55 +01:00
Andrew Kelley
acf7043955 work around llvm failing to lower memcpy
triggers an assertion in LegalizeDAG otherwise
2025-01-17 13:21:30 -08:00
Andrew Kelley
59acfb1263 compiler_rt: don't rely on weak aliases 2025-01-17 12:53:25 -08:00
David Rubin
f278038923 replace compiler_rt memcpy with a better version 2025-01-17 12:34:15 -08:00
Andrew Kelley
b07958e6b7 delete asm files from wasi libc
why the hell are there asm files in wasi libc to begin with?
2025-01-17 12:34:15 -08:00
Andrew Kelley
e6dc85f1b4 remove memcpy and memmove from bundled libcs
These are provided instead by compiler_rt.

Part of #2879
2025-01-17 12:34:15 -08:00
pfg
c748eb2416
std.Build: fix setLibCFile() to add step dependencies 2025-01-17 20:42:55 +01:00
Andrew Kelley
4bace0f621
Merge pull request #22386 from jacobly0/x86_64-rewrite
x86_64: begin rewriting instruction selection
2025-01-17 01:20:11 -05:00
Jacob Young
8c8dfb35f3 x86_64: fix crashes compiling the compiler and tests 2025-01-16 20:47:30 -05:00
Jacob Young
c3d33440f0 x86_64: pass more behavior tests 2025-01-16 20:47:30 -05:00
Jacob Young
666d76d85c x86_64: implement load and store 2025-01-16 20:47:30 -05:00
Jacob Young
6d1fc0f51c x86_64: implement aggregate access 2025-01-16 20:47:30 -05:00
Jacob Young
63730441d0 x86_64: implement union access 2025-01-16 20:47:30 -05:00
Jacob Young
5069f574f4 x86_64: remove pointless jump to epilogue 2025-01-16 20:47:30 -05:00
Jacob Young
3240adfa16 x86_64: implement pointer addition and subtraction 2025-01-16 20:47:30 -05:00
Jacob Young
0d9079f466 x86_64: implement element access 2025-01-16 20:47:30 -05:00
Jacob Young
870443f7fa x86_64: implement passing undefined as a call arg with the new cc 2025-01-16 20:47:30 -05:00
Jacob Young
094ac8c3dc x86_64: fix f16 miscomp exposed by new calling convention 2025-01-16 20:47:30 -05:00
Jacob Young
b7acd97789 x86_64: fix hazards exposed by new calling convention 2025-01-16 20:47:30 -05:00
Jacob Young
074232b3e5 x86_64: implement a custom calling convention for the Zig language 2025-01-16 20:47:30 -05:00
Jacob Young
3c74a478a4 x86_64: fix unnecessary register saving 2025-01-16 20:42:08 -05:00
Jacob Young
7f22c41e09 x86_64: add some ReleaseSmall support 2025-01-16 20:42:08 -05:00
Jacob Young
df7661b8d3 x86_64: optimize value copying slightly 2025-01-16 20:42:08 -05:00
Jacob Young
e5d5a8bc4e x86_64: implement switch jump tables 2025-01-16 20:42:08 -05:00
Jacob Young
ac1a975f9b x86_64: implement clz and not 2025-01-16 20:42:08 -05:00
Jacob Young
a7efc56d86 x86_64: the previous loop abstraction was too confusing
The temp usage was non-obvious, and implicit instructions hard to
reason about.
2025-01-16 20:42:08 -05:00
Jacob Young
a1828ebcda x86_64: demolish the old 2025-01-16 20:42:08 -05:00
Jacob Young
73a42953c9 x86_64: 2 means better 2025-01-16 20:42:08 -05:00
Jacob Young
b9c4400776 x86_64: implement fallback for pcmpeqq 2025-01-16 20:42:08 -05:00
Jacob Young
c4b93555b0 x86_64: testing 2025-01-16 20:42:08 -05:00
Jacob Young
7c713251ca x86_64: looped instructions 2025-01-16 20:42:08 -05:00
Jacob Young
beadf702b8 x86_64: rewrite arithmetic 2025-01-16 20:42:08 -05:00
Jacob Young
af1191ea8b x86_64: rewrite 2025-01-16 20:42:07 -05:00
Jacob Young
257054a146 Revert "disable flaky incremental compilation tests"
This reverts commit 133abdeda2994886c3476a3faf53f8a911513b32 but keeps
the tests disabled for the wasm target, which is the only configuration
that seems to fail, even though the error looks like a frontend error.
2025-01-16 20:02:49 -05:00
Matthew Lugg
4d8c24c6c5
Merge pull request #22505 from mlugg/easier-modify-builtin
std.builtin.Type renames, and make it easier to modify std.builtin
2025-01-16 22:20:02 +00:00
Andrew Kelley
133abdeda2 disable flaky incremental compilation tests
tracking issue #22510
2025-01-16 13:13:11 -08:00
nobkd
4e8c436f69 autodoc: fix device width 2025-01-16 21:15:48 +01:00
max
961fc0e140
std.fs.Dir: update deleteTree doc comment to match function signature (#22509)
the actual parameter name is `sub_path` which is also referenced in other
comments describing the fuction.
2025-01-16 20:11:42 +00:00
mlugg
9804cc8bc6
all: update to std.builtin.Type.{Pointer,Array,StructField} field renames 2025-01-16 12:49:58 +00:00
mlugg
89a9cabafd
std.builtin.Type: improve ergonomics of *const anyopaque fields
For representing struct field default values and array/pointer type
sentinel values, we use `*const anyopaque`, since there is no way for
`std.builtin.Type.StructField` etc to refer back to its `type` field.
However, when introspecting a type, this is quite awkward due to the
pointer casts necessary.

As such, this commit renames the `sentinel` fields to `sentinel_ptr`,
and the `default_value` field to `default_value_ptr`, and introduces
helper methods `sentinel()` and `defaultValue()` to load the values.
These methods are marked as `inline` because their return value, which
is always comptime-known, is very often required at comptime by use
sites, so this avoids having to annotate such calls with `comptime`.

This is a breaking change, although note that 0.14.0 is already a
breaking release for all users of `std.builtin.Type` due to the union
fields being renamed.
2025-01-16 12:49:58 +00:00
mlugg
0cc9d68b77
stage1: update zig1.wasm
Implementing the changes from the prior commit, to prepare for the
following commit.

This also means that zig1 now uses the new value interpret mode, so
that adding and removing fields from `std.builtin` types is easier.

Signed-off-by: mlugg <mlugg@mlugg.co.uk>
2025-01-16 12:49:58 +00:00
mlugg
726c94d5f1
Sema: prepare for sentinel -> sentinel_ptr field rename
The commit 2 after this will explain this diff.
2025-01-16 12:49:58 +00:00
mlugg
b6abe1dbf7
compiler: make it easier to apply breaking changes to std.builtin
Documentation for this will be on the wiki shortly.

Resolves: #21842
2025-01-16 12:49:48 +00:00
mlugg
d00e05f186
all: update to std.builtin.Type.Pointer.Size field renames
This was done by regex substitution with `sed`. I then manually went
over the entire diff and fixed any incorrect changes.

This diff also changes a lot of `callconv(.C)` to `callconv(.c)`, since
my regex happened to also trigger here. I opted to leave these changes
in, since they *are* a correct migration, even if they're not the one I
was trying to do!
2025-01-16 12:46:29 +00:00
mlugg
af6bad46cd
std.builtin.Type: rename Pointer.Size fields to lowercase
This matches established naming conventions. Now is an opportune time to
make this change, since we're already performing breaking changes to
`std.builtin.Type`.
2025-01-16 11:37:46 +00:00
Andrew Kelley
d4fe4698d9
Merge pull request #22220 from ziglang/wasm-linker
wasm linker: aggressive rewrite towards Data-Oriented Design
2025-01-16 04:20:41 -05:00
Andrew Kelley
eda8b6e137 link.MachO: fix error reporting in flushModule 2025-01-15 20:21:33 -08:00