26792 Commits

Author SHA1 Message Date
Andrew Kelley
a333ac846d Compilation: refactor logic for library-building capabilities
And mark the stage2_x86_64 backend as being capable of building
compiler-rt and zig libc.
2023-11-04 09:12:54 +01:00
Jakub Konka
65adbec918 link: commit missing source StringTable.zig 2023-11-04 09:12:46 +01:00
Jakub Konka
912a774a15 x86_64: rewrite call r/m64 to call rel32 for .got.zig refs when object 2023-11-04 09:12:35 +01:00
Jakub Konka
33a0a72e87 elf: align ar_hdr to at least 2 bytes 2023-11-04 09:12:26 +01:00
Jakub Konka
875beb25b5 elf: fix writing symtab to an archive 2023-11-04 09:12:18 +01:00
Jakub Konka
3b9455f005 elf: generate pretty rudimentary archive 2023-11-04 09:12:07 +01:00
Jakub Konka
eddf9cc65b elf: collect exports from ZigObject into AR symtab 2023-11-04 09:11:58 +01:00
Jakub Konka
481ee1b598 elf: enable static-lib flush path 2023-11-04 09:11:47 +01:00
Jakub Konka
d2c4597eb5 x86_64: rewrite .got.zig movs to standard loads when emitting objects 2023-11-04 09:11:37 +01:00
Jakub Konka
ccb2afacc0 elf: postpone creation of .got.zig entry until code emit 2023-11-04 09:11:29 +01:00
Jakub Konka
5affd29b47 elf: use StringTable for strtab management in ZigObject 2023-11-04 09:11:22 +01:00
Jakub Konka
96f221236d elf: fix r_offset when emitting relocs for the linker 2023-11-04 09:11:14 +01:00
Jakub Konka
7c5c59191e elf: claim unresolved dangling symbols as undef externs when emitting object 2023-11-04 09:10:43 +01:00
Jakub Konka
dbe13200f1 elf: emit STT_SECTION symbols 2023-11-04 09:10:30 +01:00
Jakub Konka
8055f68765 elf: make sure we never emit .got.zig relocs when linking object files 2023-11-04 09:10:23 +01:00
Jakub Konka
e8f522122a elf: fix properly updating .got.zig section 2023-11-04 09:10:14 +01:00
Jakub Konka
5698be3ef0 elf: write out contents of .rela sections 2023-11-04 09:10:06 +01:00
Jakub Konka
3606b5df3f elf: improve Symbol to handle emitting relocatable object files 2023-11-04 09:09:57 +01:00
Jakub Konka
ec2671d16b elf: update .rela section sizes; skip .got.zig when emitting object 2023-11-04 09:09:46 +01:00
Jakub Konka
21853bc310 elf: emit .rela shdrs for output sections 2023-11-04 09:09:35 +01:00
Jakub Konka
0ee2ab413f elf: emit valid section headers table when building an object file 2023-11-04 09:09:26 +01:00
Jakub Konka
74f12d0691 elf: remove now obsolete allocateNonAllocSection helper 2023-11-04 09:09:14 +01:00
Jakub Konka
abf6c20cb9 elf: rename .rodata to .data.rel.ro and remove allocateAllocSection helper 2023-11-04 09:09:01 +01:00
Jakub Konka
b1136a695f elf: remove now obsolete allocateSegment helper 2023-11-04 09:08:50 +01:00
Jakub Konka
1be94878e3 elf: generate invalid object file but with almost correct header 2023-11-04 09:08:38 +01:00
Jakub Konka
b8c8565e93 elf: implement --gc-sections for non-LLVM Zig source 2023-11-04 09:08:27 +01:00
Jakub Konka
25c53f08a6 elf: redo strings management in the linker
* atom names - are stored locally and pulled from defining object's
  strtab
* local symbols - same
* global symbols - in principle, we could store them locally, but
  for better debugging experience - when things go wrong - we
  store the offsets in a global strtab used by the symbol resolver
2023-11-04 09:08:16 +01:00
dweiller
f6de3ec963 zstandard: fix incorrect RLE decompression into ring buffer
This reverts a change introduced in #17400 causing a bug when
decompressing an RLE block into a ring buffer.

RLE blocks contain only a single byte of data to copy into the output,
so attempting to copy a slice causes buffer overruns and incorrect
decompression.
2023-11-03 23:03:43 -04:00
Andrew Kelley
1ccc68f307 frontend: rip out Decl dependencies
This incremental compilation logic will need to be reworked so that it
does not depend on buried pointers - that is, long-lived pointers that
are owned by non-top-level objects such as Decl.

In the meantime, this fixes memory leaks since the memory management of
these dependencies has bitrotted.
2023-11-03 21:24:13 -04:00
mlugg
a95be8f0e0 Sema: use correct error bit length when emitting error_set_has_value safety checks
Resolves: #17843
2023-11-03 22:39:13 +00:00
XXIV
b197c4d79b
std.Atomic: remove unnecessary @ptrCast (#17825) 2023-11-03 14:55:02 -04:00
xdBronch
5bd27a2cb6 dont assume apple chips are macos exclusive 2023-11-03 14:46:53 -04:00
Ryan Liptak
ae6df9e967 start.zig: Replace kernel32 usage with ntdll
Co-authored-by: e4m2 <git@e4m2.com>
2023-11-03 19:25:46 +02:00
Andrew Kelley
94cee4fb27 mingw-w64: add shcore def files
these are copied from mingw-w64 v10.0.0
2023-11-02 12:20:09 -07:00
Ryan Liptak
42d4d07efa start: Make wWinMain nCmdShow setting match Windows better
It won't match perfectly; see https://github.com/ziglang/zig/issues/17808
2023-11-02 00:19:40 -04:00
Andrew Kelley
d892665694
Merge pull request #17819 from Luukdegram/wasm-bitcast-fix
wasm - fix bitcasting between arrays and scalar types
2023-11-01 20:20:11 -04:00
Ali Chraghi
3ead829de1 print_zir: fix crash in writeRestoreErrRetIndex 2023-11-01 19:04:21 -04:00
XXIV
c2cf47ab28
std.os.windows: remove unnecessary @ptrCast (#17816) 2023-11-01 18:45:51 -04:00
Luuk de Gram
db1825e931
wasm: re-enable regressed tests 2023-11-01 19:47:15 +01:00
Luuk de Gram
2c2bc9c8df
wasm: fix bitcasting to -and from arrays
Arrays are currently always passed by reference, this means that we
always keep the value in linear memory and never load it to Wasm's
stack. Scalar values however do get lowered to Wasm's stack.
This means when bitcasting from an array to a scalar value, we must
load the memory of the array as such scalar type. To bitcast
a scalar type to an array, we allocate a new temporary in the
linear data segment, and then store the scalar value there.
2023-11-01 19:47:15 +01:00
Andrew Kelley
7c5d01b95e CI: disable MSVC C backend checks
Tracking issue: #17817
2023-11-01 11:42:47 -07:00
Kai Jellinghaus
7ee7c90274 Fix regressing #17290 from #17734 2023-11-01 18:30:56 +02:00
Jordyfel
61861ef395 std.http: account for renames in docs 2023-11-01 14:46:00 +02:00
Kai Jellinghaus
084a7cf028
Use ArenaAllocator.reset in MemoryPool 2023-11-01 14:45:35 +02:00
Andrew Kelley
725f765c37
Merge pull request #17802 from jacobly0/read-write-int
mem: fix UB in `readInt`/`writeInt` and delete variants
2023-11-01 06:33:40 -04:00
Jacob Young
13b1e10b8f cbe: fix @bitCast warnings 2023-10-31 21:37:40 -04:00
Andrew Kelley
3fc6fc6812 std.builtin.Endian: make the tags lower case
Let's take this breaking change opportunity to fix the style of this
enum.
2023-10-31 21:37:35 -04:00
Jacob Young
149200aac5 mem: delete readIntSlice and writeIntSlice
After deleting all potentially incorrect usages, there were no more
remaining.
2023-10-31 21:37:35 -04:00
Jacob Young
d890e81761 mem: fix ub in writeInt
Use inline to vastly simplify the exposed API.  This allows a
comptime-known endian parameter to be propogated, making extra functions
for a specific endianness completely unnecessary.
2023-10-31 21:37:35 -04:00
Jacob Young
50cdb65784 Sema: fix incorrect error comptime-mutating empty array 2023-10-31 21:37:35 -04:00