23284 Commits

Author SHA1 Message Date
Jakub Konka
ad8dfd3673 macho+coff: remove alignment from Atom as it is unused 2023-04-03 09:14:36 +02:00
Veikka Tuominen
a31450375e
Merge pull request #15134 from castholm/reverse-iterator
std.mem.reverseIterator: misc improvements
2023-04-02 18:06:55 +03:00
Jacob Young
f4b411314c Sema: defer stores to inferred allocs
This lets us generate the store with knowledge of the type to be stored.
Therefore, we can avoid generating garbage Air with stores through
pointers to comptime-only types which backends cannot lower.

Closes #13410
Closes #15122
2023-04-02 18:05:44 +03:00
Jakub Konka
878163e588
Merge pull request #15140 from jacobly0/x86_64
x86_64: implement more stuff
2023-04-02 14:34:12 +02:00
Jacob Young
f4359531b1 x86_64: implement shl with overflow 2023-04-02 06:11:12 -04:00
Jacob Young
0e289cc826 x86_64: implement large add/sub with overflow 2023-04-02 05:16:46 -04:00
Jacob Young
c713c86389 x86_64: implement wide multiply 2023-04-02 04:49:53 -04:00
Jacob Young
b80cdde4f0 x86_64: implement struct_field_val for large packed structs 2023-04-02 04:49:53 -04:00
Jacob Young
83a208c355 x86_64: implement large cmp 2023-04-02 04:49:53 -04:00
Jacob Young
677427bc3a x86_64: implement error name 2023-04-02 04:49:53 -04:00
Jacob Young
ccefa9dbf5 x86_64: implement calling var args functions 2023-04-02 04:49:53 -04:00
Jacob Young
ac68d72d24 x86_64: implement aggregate init of a packed struct 2023-04-02 04:49:53 -04:00
Jakub Konka
43a6384e9c link-test: adjust test/link/bugs/macho/13056 to latest changes on macOS 13.3
Latest macOS 13.3 rolled out LLVM 15 and thus the way `nullptr_t` is
defined within the `libc++`:

157bbe6aea

This seems to require including `/usr/include` with `-isystem` directive
rather than `-I`. Otherwise we get clang miscompilation issues due to
missing `nullptr_t` declaration.
2023-04-02 10:18:43 +02:00
Jakub Konka
ab44b454d0
Merge pull request #15135 from ziglang/fix-15103
macho: handle cases where entrypoint is in an archive or dylib
2023-04-01 22:30:22 +02:00
Jakub Konka
e0bf7b6424 link-test: skip foreign checks in entry_in_archive MachO test 2023-04-01 20:02:33 +02:00
Jakub Konka
a88c0b4d08 link: handle -u flag in all linkers
Also clean up parsing of linker args - reuse `ArgsIterator`.

In MachO, ensure we add every symbol marked with `-u` as undefined
before proceeding with symbol resolution. Additionally, ensure those
symbols are never garbage collected.

MachO entry_in_dylib test: pass `-u _my_main` when linking executable
so that it is not incorrectly garbage collected by the linker.
2023-04-01 14:22:44 +02:00
Jakub Konka
2dd178443a macho: do not assume entrypoint is defined 2023-04-01 14:22:44 +02:00
Jakub Konka
5d0bb50e3d link-test: add test for entry in a dynamic library for MachO 2023-04-01 14:22:44 +02:00
Jakub Konka
3874df839d link-test: add test for entry in a static archive for MachO 2023-04-01 14:22:44 +02:00
Jakub Konka
6f83a741d8 macho: handle weird case of entrypoint being a stub 2023-04-01 14:22:44 +02:00
Jakub Konka
f2587de4e9 macho: look for entry in archives/dylibs too 2023-04-01 14:22:44 +02:00
Jakub Konka
381dc2d950
Merge pull request #15139 from ziglang/macos-13-fixes
Fixes for latest macOS 13.3 SDK release
2023-04-01 14:22:29 +02:00
Jakub Konka
a0a854b1fc libc: update macOS libSystem.13.tbd 2023-04-01 08:33:13 +02:00
Jakub Konka
ab2b70f6c1 tapi: update to latest Apple changes 2023-04-01 08:31:27 +02:00
Jakub Konka
9ea04f4f1c tapi: update yaml parser
5de8b0b3a2
2023-04-01 08:31:16 +02:00
Jakub Konka
575a98a081
Merge pull request #15130 from ziglang/macos-13.3
macos: update to latest libc headers macOS SDK 13.3
2023-04-01 08:23:13 +02:00
Carl Ã…stholm
3cd72951c0 std.mem.reverseIterator: add nextPtr() 2023-03-31 22:50:31 +02:00
Carl Ã…stholm
0bbc1ec206 std.mem.reverseIterator: accept pointer to array 2023-03-31 22:48:32 +02:00
Jakub Konka
f6845bbbc6 std: bump max macOS version to 13.3 2023-03-31 21:22:30 +02:00
Jakub Konka
26c88e4f45 libc: update macOS libc headers to latest SDK 13.3 2023-03-31 21:20:47 +02:00
Loris Cro
9cb2919d50
Merge pull request #15127 from der-teufel-programming/autodoc_newbuiltins
autodoc: Add new builtins to Autodoc
2023-03-31 17:30:09 +02:00
Loris Cro
ab2c602f34
Merge pull request #14823 from der-teufel-programming/autodoc-quickfixes
autodoc: Add struct to tryResolveRefPath
2023-03-31 17:26:55 +02:00
Jakub Konka
23cf44c227 libc: add missing sys/timex.h to macOS libc headers 2023-03-31 12:36:38 +02:00
Krzysztof Wolicki
b69578e19c autodoc: add new builtins 2023-03-31 11:47:14 +02:00
Krzysztof Wolicki
652b005f9b autodoc: fix Extended builtin functions names rendering 2023-03-31 11:47:14 +02:00
Jakub Konka
5b82b40043
Merge pull request #15125 from ziglang/hcs-win-poc
coff: add hot-code swapping PoC
2023-03-31 00:38:30 +02:00
jagt
c964e10821 docgen: add additional_option token; fix wasm-freestanding example
- Fix usage string `--skip-code-test` to `--skip-code-tests`.
- Added a token `{#additonal_option|-rdynamic#}` which introduce arbitrary flag to `build-exe/obj/lib` example.
- Fix wasm freestanding example, it now needs explicit export symbols to work.
2023-03-30 22:56:33 +03:00
Jakub Konka
908ccce064 coff: enable hot-code swapping on a compatible host only 2023-03-30 21:24:49 +02:00
Jakub Konka
ee0c445765 coff: due to ASLR we need to dupe the code for relocating
In addition, we need to be careful not to mark the relocations as
resolved prematurely as then we are risking malforming the binary
as we need to resolve the relocs twice: once for in-memory writes,
and once for in-file updates.
2023-03-30 21:08:32 +02:00
Jakub Konka
349349fa01 std: simplify VirtualProtectEx and fix ntdll signature 2023-03-30 21:08:31 +02:00
Jakub Konka
216badef0b coff: use std.os.windows wrappers; fix relocating in-file 2023-03-30 21:08:31 +02:00
Jakub Konka
ba5302c4f8 std: move ntdll wrappers to std.os.windows 2023-03-30 21:08:31 +02:00
Jakub Konka
5d387742fd coff: reimplement VirtualProtectEx using our own ntdll wrapper 2023-03-30 21:08:31 +02:00
Jakub Konka
423b9f1114 coff: reimplement Read/WriteProcessMemory using our own ntdll wrappers 2023-03-30 21:08:31 +02:00
Jakub Konka
d2f0130855 coff: make sure we correctly slide relocation target when resolving 2023-03-30 21:08:30 +02:00
Jakub Konka
39d6303644 coff: first (not-fully-functional) PoC of HCS 2023-03-30 21:08:30 +02:00
Jakub Konka
22e1b03360 coff: use copy in zig-cache for child process in HCS
Ideally, we would just do an atomic rename, but so far I had no
luck. I have also tried marking the file to delete-on-close but
then we cannot use it to spawn the process. So for now, let's just
put a copy in `zig-cache` and let the user decide when to recycle
the cache dir.
2023-03-30 21:08:30 +02:00
bing
64214b1ca6
Change ordering of prep provide buffers args 2023-03-30 16:51:57 +00:00
Robin Voetter
3357c59ceb new builtins: @workItemId, @workGroupId, @workGroupSize
* @workItemId returns the index of the work item in a work group for a
  dimension.
* @workGroupId returns the index of the work group in the kernel dispatch for a
  dimension.
* @workGroupSize returns the size of the work group for a dimension.

These builtins are mainly useful for GPU backends. They are currently only
implemented for the AMDGCN LLVM backend.
2023-03-30 12:20:24 +03:00
Silver
83051b0cbf Update GDB pretty printers 2023-03-30 12:15:53 +03:00