30216 Commits

Author SHA1 Message Date
Jakub Konka
90c54f1eb6 macho: fix symbol visibility merging logic 2024-07-18 09:13:08 +02:00
Jakub Konka
3d58faed12 macho: we do not yet support interposable symbols 2024-07-18 09:13:08 +02:00
Jakub Konka
b4e6b3c53c macho: bring back parts of r mode 2024-07-18 09:13:08 +02:00
Jakub Konka
05a790d784 macho: link hello world in zig compiled with llvm 2024-07-18 09:13:08 +02:00
Jakub Konka
18778e2a0a macho: bring back parts of ar 2024-07-18 09:13:08 +02:00
Jakub Konka
174de37cef macho: fix compile errors 2024-07-18 09:13:08 +02:00
Jakub Konka
5b4c0cc1f9 macho: update ZigObject to use new ownership model 2024-07-18 09:13:08 +02:00
Jakub Konka
f8b5466aef macho: migrate UnwindInfo 2024-07-18 09:13:08 +02:00
Jakub Konka
882ff3ae31 macho: migrate eh_frame module 2024-07-18 09:13:08 +02:00
Jakub Konka
b96339f6f6 macho: migrate Relocation struct 2024-07-18 09:13:08 +02:00
Jakub Konka
58997363d3 macho: migrate MachO.File abstraction 2024-07-18 09:13:08 +02:00
Jakub Konka
f86a38564f macho: migrate synthetic sections 2024-07-18 09:13:08 +02:00
Jakub Konka
2e87883be8 macho: migrate the MachO driver 2024-07-18 09:13:08 +02:00
Jakub Konka
355992cbdf macho: migrate some of MachO driver 2024-07-18 09:13:08 +02:00
Jakub Konka
b9bac32a25 macho: migrate Atom and Symbol 2024-07-18 09:13:08 +02:00
Jakub Konka
c59583e43d macho: migrate InternalObject and Dylib 2024-07-18 09:13:08 +02:00
Jakub Konka
9d5a900f4b macho: migrate Object to self-ownership of atoms and symbols 2024-07-18 09:13:08 +02:00
Jakub Konka
f8cea21514 macho: remove obsolete field from InternalObject 2024-07-18 09:13:07 +02:00
Jakub Konka
d136d06a77 macho: handle ZigObject when calculating dyld relocs 2024-07-18 09:13:07 +02:00
Jakub Konka
e2bfd6fc69 macho: revamp how we compute dyld relocs 2024-07-18 09:13:07 +02:00
Jakub Konka
101299e856 macho: move unwind info records ownership to Objects 2024-07-18 09:13:07 +02:00
Andrew Kelley
a57479afc2
Merge pull request #20652 from pavelverigo/stage2-wasm-finishAir
stage2-wasm: finishAir enhancement
2024-07-17 22:33:29 -07:00
Jacob Young
8ab70f80cb ci: update aarch64-macos for a persistent work dir 2024-07-17 21:52:28 -04:00
Pavel Verigo
31706dc31a stage2-wasm: finishAir handle .stack result
By allowing finishAir to handle .stack results, we simplify a lot of code in
air*** functions, which try to handle this case. Also this changes will result in optimization, if one of operands is dead after instruction its place could be reused by result.

The only downside to this change is that finishAir now can return error, though it handled by returning finishAir result, because it always needs to be final in air*** functions.

Additionally I migrated WValue{ to .{ inside CodeGen.zig.
2024-07-18 00:57:45 +02:00
Pavel Verigo
6eb76f930d stage2-wasm: typeToValtype focus on .auto callconv
This is required for toLocal() correctly handling isByRef values, previous behavior was a hack.
2024-07-18 00:57:18 +02:00
eric-saintetienne
c3faae6bf1
format: do not force user to provide an alignment field when it's not necessary (#19049)
* format: fix default character when no alignment

When no alignment is specified, the character that should be used is the
fill character that is otherwise provided, not space.

This is closer to the default that C programmers (and other languages)
use: "04x" fills with zeroes (in zig as of today x:04 fills with spaces)

Test:

    const std = @import("std");
    const expectFmt = std.testing.expectFmt;

    test "fmt.defaultchar.no-alignment" {

        // as of today the following test passes:
        try expectFmt("0x00ff", "0x{x:0>4}", .{255});

        // as of today the following test fails (returns "0x  ff" instead)
        try expectFmt("0x00ff", "0x{x:04}", .{255});
    }

* non breaking improvement of string formatting

* improved comment

* simplify the code a little

* small improvement around how  characters identified as valid are consumed
2024-07-17 19:02:10 +00:00
Stephen Gregoratto
3095e83d11 Windows: Rework kernel32 apis
To facilitate #1840, this commit slims `std.windows.kernel32` to only
have the functions needed by the standard library. Since this will break
projects that relied on these, I offer two solutions:

- Make an argument as to why certain functions should be added back in.
  Note that they may just be wrappers around `ntdll` APIs, which would
  go against #1840.
  If necessary I'll add them back in *and* make wrappers in
  `std.windows` for it.
- Maintain your own list of APIs. This is the option taken by bun[1],
  where they wrap functions with tracing.
- Use `zigwin32`.

I've also added TODO comments that specify which functions can be
reimplemented using `ntdll` APIs in the future.

Other changes:
- Group functions into groups (I/O, process management etc.).
- Synchronize definitions against Microsoft documentation to use the
  proper parameter types/names.
- Break all functions with parameters over multiple lines.
2024-07-17 23:11:23 +10:00
Stephen Gregoratto
1735455099 QueryObjectName: Add error union 2024-07-17 23:05:31 +10:00
Jakub Konka
9d9b5a11e8
Merge pull request #20474 from Rexicon226/riscv
more RISC-V backend progress
2024-07-17 08:39:44 +02:00
Andrew Kelley
ddc399440d build.zig: expose valgrind flag
Allows to enable Valgrind integrations in release builds, sometimes
useful in combination with tooling.
2024-07-16 23:07:34 -07:00
Matthew Lugg
e82f7d3800
Merge pull request #20653 from mlugg/incremental-fix
Zcu: updateZirRefs typo
2024-07-17 00:08:13 +01:00
Hayden Riddiford
20563d8457 - Added special handling for translating C extern variables declared within scoped blocks
- Added test/cases/run_translated_c/extern_typedef_variables_in_functions.c to test for issue 19687
2024-07-16 23:29:44 +03:00
Jacob Young
88bb0fd288
Merge pull request #20632 from jacobly0/codegen-thread
InternPool: enable separate codegen/linking thread
2024-07-16 14:49:49 -04:00
mlugg
6bd640c7a0
Sema: typo 2024-07-16 19:48:05 +01:00
mlugg
21cde7ad90
Zcu: updateZirRefs typo 2024-07-16 19:46:10 +01:00
mlugg
d8f81372f1
Sema: fix bad merge 2024-07-16 19:44:41 +01:00
mlugg
5093a5cd19
std.Zir: some declaration traversal fixes 2024-07-16 19:44:15 +01:00
Matthew Lugg
ee695c8ef4
Merge pull request #20637 from mlugg/comptime-resolution-strat
Type,Value: mark `ResolveStrat` parameter of type queries as `comptime`
2024-07-16 19:22:39 +01:00
Andrew Kelley
a58ceb3d55
Merge pull request #20646 from ziglang/fix-updateZirRefs
frontend: fix updateZirRefs
2024-07-16 10:47:42 -07:00
Will Lillis
a9d544575d
Sema: add error note for failed coercions to optional types and error unions 2024-07-16 16:42:13 +00:00
mlugg
f84a4953d2
Value: eliminate static recursion loop from value printing 2024-07-16 11:38:21 +01:00
mlugg
67cd14dbdb
Type: avoid incorrect type resolution calls 2024-07-16 11:38:20 +01:00
mlugg
b1d3d48f68
Type,Value: mark ResolveStrat parameter of type queries as comptime
This eliminates the statically-reachable recursion loop between code
generation backends and Sema. This is beneficial for optimizers
(although I do not measure any performance improvement for this change),
and for profilers.
2024-07-16 11:38:20 +01:00
Jacob Young
00fdbf05f3 InternPool: enable separate codegen/linking thread
Let's see what happens :)
2024-07-16 06:28:42 -04:00
Jacob Young
9d1820d206 InternPool: reduce max tid width by one bit
@mlugg keeps stealing my bits!
2024-07-16 06:28:41 -04:00
Jacob Young
b0fe7eef54 InternPool: fix various data structure invariants 2024-07-16 05:14:38 -04:00
Jacob Young
e32454796c indexOfSentinel: fix ub 2024-07-16 05:14:38 -04:00
Jacob Young
14caccb477 Progress: avoid race on global_progress.draw_buffer 2024-07-16 05:14:38 -04:00
Raed Rizqie
9356cb1475 Allocate enough memory when building zig2 2024-07-16 00:41:24 -07:00
Andrew Kelley
4e6518badb
Merge pull request #20640 from BratishkaErik/std.c/setlocale-fix
std.c: setlocale fixes
2024-07-16 00:39:31 -07:00