20328 Commits

Author SHA1 Message Date
Andrew Kelley
902f6db67b
Merge pull request #12889 from ziglang/unwrap-error-switch
safety: show error return trace when unwrapping error in switch
2022-09-21 02:56:21 -04:00
Andrew Kelley
d7d21672b8 CI: update windows tarball 2022-09-20 19:05:00 -07:00
Veikka Tuominen
694fab4848 std: add return address parameter to panic fn 2022-09-20 19:05:00 -07:00
Veikka Tuominen
8f2e82dbf6 safety: show error return trace when unwrapping error in switch 2022-09-20 19:05:00 -07:00
Andrew Kelley
62ecc154d9
Merge pull request #12904 from Vexu/ptrcast
stage2: pointer casting fixes and improvements
2022-09-20 22:02:36 -04:00
Meghan
521c753fda std: fix os.linux.S function signatures to use mode_t 2022-09-20 17:54:32 -04:00
Joachim Schmidt
1f50810733
Merge pull request #12912 from joachimschmidt557/stage2-arm
stage2 ARM: minor fixes
2022-09-20 21:51:02 +02:00
joachimschmidt557
f014de6456
stage2 ARM: fix debug info for arguments passed in registers 2022-09-20 17:14:31 +02:00
joachimschmidt557
258b058eec
stage2 ARM: make sub_sp_scratch MIR instruction use r4
r0 is used for argument passing, so this register is not available as
a scratch register upon function entry.
2022-09-20 17:14:27 +02:00
Veikka Tuominen
eef6539049 Sema: handle Value.slice in beginComptimePtrLoad 2022-09-20 00:50:13 +03:00
Veikka Tuominen
3e80aa9079 Sema: validate @alignOf type 2022-09-20 00:50:13 +03:00
Veikka Tuominen
540130650f Sema: pass calculated offset to elemPtrType in elemPtrSlice 2022-09-20 00:50:13 +03:00
Veikka Tuominen
541b3e3a31 Sema: check pointer qualifiers before implicit cast
Closes #12881
2022-09-20 00:50:13 +03:00
Motiejus Jakštys
4521456f66 zig cc: emit to a.out if outpath is unspecified
If `-o` is not specified for `zig cc` for linking, it should emit the
`a.out` (or equivalent) to the current directory. So then this:

    $ zig cc test.c

Should result in `./a.out`.

If directory is omitted from `Compilation.EmitLoc`, it will default to
the cache directory later in the compilation chain, which will result
in `a.out` missing in the current directory.

If we specify the directory to `Compilation.EmitLoc`, it will be
handled, allegedly, correctly.

Fixes #12858
2022-09-19 15:05:37 -04:00
Veikka Tuominen
fb91483e48 Sema: do not use coerceCompatiblePtr for ptrCast 2022-09-19 18:34:53 +03:00
Veikka Tuominen
e584558bd8 Sema: do not use coerceCompatiblePtr for alignCast
Closes  #12902
2022-09-19 18:34:52 +03:00
Jakub Konka
e42f83825f
Merge pull request #12893 from ziglang/macho-relocs-cleanup
macho: rewrite incremental linker, and init splitting of linking contexts
2022-09-18 23:19:33 +02:00
Loris Cro
2698cb346a autodoc: don't collect tests, usingnamespace and comptime blocks
Previously we were collecting as autodoc decls everything that was a ZIR
decl in a rather naive way. Now we only collect decltests as part of the
data relative to the decl they refer to, and ignore everything else.
2022-09-18 20:00:44 +02:00
Jakub Konka
4474f8dd6e macho: cleanup how we collect dyld data in incremental linker 2022-09-18 15:13:45 +02:00
Jakub Konka
f4706c23e9 macho: fix after sync with master 2022-09-18 11:01:29 +02:00
Jakub Konka
372acb8350 macho: ensure we extend section size when updating last atom 2022-09-18 10:00:04 +02:00
Jakub Konka
275abf7c57 macho: fix overlapping segments in file offset 2022-09-18 10:00:04 +02:00
Jakub Konka
66942cbc1a macho: make sure both vmsize and filesize for segments match always 2022-09-18 10:00:04 +02:00
Jakub Konka
2c971f0085 fix code formatting 2022-09-18 10:00:04 +02:00
Jakub Konka
e35a16c7e0 macho: make sure both vmsize and filesize for segments match 2022-09-18 10:00:04 +02:00
Jakub Konka
7f7669a09e macho: fix building on 32bit targets 2022-09-18 10:00:04 +02:00
Jakub Konka
dc6480dba5 macho: allow for add and ldr when resolving GOT_LOAD_* relocs 2022-09-18 10:00:04 +02:00
Jakub Konka
618c7a3546 macho: add logic for expanding segments in memory 2022-09-18 10:00:04 +02:00
Jakub Konka
e601969244 macho: rewrite how we allocate space in incremental context 2022-09-18 10:00:04 +02:00
Jakub Konka
79ab46ec91 macho: start separating linking contexts 2022-09-18 10:00:04 +02:00
Jakub Konka
53bd7bd044 macho: move to incremental writes and global relocs for incremental 2022-09-18 10:00:04 +02:00
Jakub Konka
34f9360ea2 macho: do not call populateMissingMetadata in full link mode 2022-09-18 10:00:04 +02:00
Jakub Konka
e5da251635 macho: clean up use of section ids 2022-09-18 10:00:04 +02:00
Jakub Konka
05d0c42894 macho: move main driver loop for one-shot into standalone zld module 2022-09-18 10:00:03 +02:00
Jakub Konka
26af8d254a macho: separate in structure and logic incremental relocs and file relocs 2022-09-18 10:00:03 +02:00
Jakub Konka
54854e2ab8 add removed expected stdout comparison in link test 2022-09-18 09:28:46 +02:00
Jakub Konka
0030e72d53 use EmulatableRunStep for newly added macho link test
Reverts 75e9a8c7fabb1f32753960b9114dcee875256351
2022-09-18 09:22:49 +02:00
Andrew Kelley
75e9a8c7fa skip macho link test execution on non-macOS
2c3d87b168bf522f538e78325fdae71c320e6e20 introduced a new test that
passes on macOS but fails on other operating systems. This commit makes
it only run on macOS.
2022-09-17 21:33:19 -07:00
Jakub Konka
437ddcce7a test-cases: remove removed "note: referenced here" note from the error 2022-09-17 23:38:40 +02:00
Jakub Konka
0f1fbbfdfb ci: azure: macos: use updated release tarball 2022-09-17 23:11:58 +02:00
Jakub Konka
2c3d87b168 macho: test empty translation units 2022-09-17 18:43:24 +02:00
Jakub Konka
5391541f11 macho: do not assume every object has a symtab
For example, building stage2 requires an empty `empty.cc` source file
compiling which generates a valid translation unit with no symtab/strtab.
In this case, we cannot simply assume that every translation unit will
have a valid symtab; instead, we cautiously default the input symtab
and strtab fields to optional `null` to signal symtab's presence or its lack of.
In case the symtab is not present, we catch this fact when splitting
input sections into subsections and create a synthetic symbol per every
suitable section.
2022-09-17 18:42:47 +02:00
billzez
dfcadd22bb
fix android definition of pthread_rwlock_t (#12830) 2022-09-16 20:20:24 -05:00
Veikka Tuominen
b2aedb0709
Merge pull request #12796 from Vexu/referenced-by-v2
stage2: add referenced by trace to compile errors attempt #2 (+ some fixes)
2022-09-16 23:49:00 +03:00
Andrew Kelley
8edd7219c0 Sema: improve source location after as_node is used
+2 more passing compile error tests
2022-09-16 14:47:17 -04:00
Andrew Kelley
d3d24874c9 std: remove deprecated API for the upcoming release
See #3811
2022-09-16 14:46:53 -04:00
cod1r
7b32aacbaf fix ChildProcess crash when PATH is empty. 2022-09-15 22:54:17 -04:00
Andrew Kelley
2be72c719e ci: azure: macos: use an unstripped debug zig tarball
Hopefully will give us some insight into the spurious failures.

Follow-up from afba53f0f168365a9540a8c8bb39e85a44e0249c.
2022-09-15 13:56:18 -07:00
Andrew Kelley
9f4408d68b organize some compile error tests
Many of these tests check for the incorrect behavior of stage1 whereas
self-hosted correctly does not emit an error, so they are simply
deleted.

The remaining number of test cases within the stage1/ subdirectory is
reduced from 143 to 103.
2022-09-15 14:40:45 -04:00
Andrew Kelley
afba53f0f1 CI: swap out azure macos tarball for unstripped ReleaseSafe
Hopefully will give us some insight into the spurious failures.
2022-09-14 19:16:02 -07:00