18042 Commits

Author SHA1 Message Date
Jakub Konka
5195b87639
Merge pull request #11396 from wojtekmach/wm-zig-cc-subsystem
zig cc: support --subsystem linker flag
2022-04-18 19:20:23 +02:00
Wojtek Mach
b2344cc18e Support --subsystem=x instead of --subsystem,x 2022-04-18 11:43:17 +02:00
Ryan Liptak
f8d2b87fa1 Update doc comment of ArrayHashMap to include 4th arg in eql fns
4th argument was added in cf88cf2657d721c68055a284e8c498a18639f74c
2022-04-18 03:47:03 -04:00
Andrew Kelley
a7c05c06be stage2: expose progress bar API to linker backends
This gives us insight as to what is happening when we are waiting for
things such as LLVM emit object and LLD linking.
2022-04-17 04:09:35 -07:00
Yusuf Bham
2aeaa1cfc4
std.os.uefi: fix GUID formatting (#11452) 2022-04-17 06:15:15 -04:00
Cody Tapscott
7b090df668 stdlib std.os: Improve wasi-libc parity for WASI CWD emulation
Two major changes here:
  1. We store the CWD as a simple `[]const u8` and lookup Preopens for
     every absolute or CWD-referenced file operation, based on the
     Preopen with the longest match (i.e. most specific path)
  2. Preorders are normalized to POSIX absolute paths at init time.
     Behavior depends on the "cwd_root" parameter of `initPreopensWasi`:

	`cwd_root` is used for any Preopens that start with "."

	  For example:
            "./foo/bar" - inits to -> "{cwd_root}/foo/bar"
            "foo/bar"   - inits to -> "/foo/bar"
	    "/foo/bar"  - inits to -> "/foo/bar"

        `cwd_root` must be an absolute path.

	Using "/" as `cwd_root` gives behavior similar to wasi-libc.
2022-04-16 18:08:05 +02:00
Jakub Konka
8f75823728
Merge pull request #11446 from ziglang/aarch64-macos-llvm
stage2: fix behavior test failures on aarch64-macos (LLVM+native), and other minor fixes
2022-04-16 18:07:02 +02:00
Andrew Kelley
a315d51c0a
Merge pull request #11437 from koachan/sparc64-mutex
compiler_rt: atomics: Add TAS lock support for SPARC
2022-04-16 06:36:54 -04:00
Andrew Kelley
e428f85cfd
Merge pull request #11445 from viriuwu/f80-freebsd-tests
re-enable f80 tests on freebsd
2022-04-16 06:26:14 -04:00
Jakub Konka
897df18573 stage2: fix @mulAdd on aarch64 Darwin
According to Apple docs, the long double type is a double precision
IEEE754 binary floating-point type, which makes it identical to the
double type. This behavior contrasts to the standard specification,
in which a long double is a quad-precision, IEEE754 binary,
floating-point type.

Thus, we need to take this into account when using the compiler
intrinsics so that we select the correct function version for
FloatMulAdd.
2022-04-16 12:23:47 +02:00
Andrew Kelley
ec8a6544a3
Merge pull request #11444 from kprotty/treap
Introduce std.Treap
2022-04-16 06:23:18 -04:00
Jakub Konka
1b5a43fdf7 start.zig: make sure macos uses full startup code 2022-04-16 12:07:34 +02:00
Jakub Konka
88d87d6506 stage2,macho: swap out inodes before checking for intermediary basename
This way we avoid the infamous SIGKILL on arm64 macos.
2022-04-16 12:06:58 +02:00
Andrew Kelley
578a792b33
Merge pull request #11442 from Vexu/stage3
Make self hosted compiler capable of building itself
2022-04-16 05:42:25 -04:00
joachimschmidt557
3bfb1616db stage2 ARM: move genArgDbgInfo back to CodeGen
This removes the questionable Air -> Mir dependency that existed
before. The x86_64 backend also performed this change.
2022-04-16 09:41:27 +02:00
vi
4ad1480298
std.math.fabs: enable f80 testing 2022-04-15 16:52:02 -06:00
vi
2ef9a0d9ae
std.math: enable f80 tests on freebsd 2022-04-15 16:50:00 -06:00
kprotty
33952dad12 treap: zig fmt 2022-04-15 17:01:01 -05:00
kprotty
4d0303b992 treap: fix + determinstically randomize test cases. 2022-04-15 16:30:45 -05:00
Veikka Tuominen
101aac92c2 stage2: fix bugs preventing stage2 from building stage3 with LLVM 2022-04-15 23:32:26 +03:00
kprotty
7284eb22dc treap: initial implementation 2022-04-15 15:26:51 -05:00
Veikka Tuominen
1c4c826a50 AstGen: fix defer generation in breakExpr 2022-04-15 22:33:07 +03:00
Veikka Tuominen
7be62f695f stage2 llvm: fix optional pointers to zero bit payloads 2022-04-15 19:17:50 +03:00
Andrew Kelley
4c83b11f71
Merge pull request #11438 from Vexu/stage2-fixes
Stage2 fixes
2022-04-15 12:02:55 -04:00
Rekai Musuka
02a43f325b std/math.zig: resolve missed optimization in rotates 2022-04-15 11:51:50 -04:00
Jakub Konka
52c8ac1a84 stage2: lower u128, and refactor some bits in x64 2022-04-15 11:50:08 -04:00
Veikka Tuominen
dbe0d3d579 stage2 llvm: handle dollar signs in asm template 2022-04-15 16:16:22 +03:00
Veikka Tuominen
ef7282bab4 stage2 macho: workaround stage2 bugs 2022-04-15 16:05:27 +03:00
Koakuma
33956b8e55 compiler_rt: atomics: clr -> clrb 2022-04-15 19:48:25 +07:00
Koakuma
fac2a2e754 compiler_rt: atomics: Formatting change for flag definition 2022-04-15 19:44:46 +07:00
Koakuma
5b283fba77 compiler_rt: atomics: Add Leon CAS instruction check for SPARC atomics 2022-04-15 19:40:36 +07:00
Koakuma
6aa89115f9 ompiler_rt: atomics: Split long lines and add comment on constants 2022-04-15 19:31:55 +07:00
Veikka Tuominen
3723eb7f31
Merge pull request #11242 from schmee/sema-handle-more-union-errors
stage2: add more union compile errors / improve error messages
2022-04-15 11:34:04 +03:00
r00ster91
62d717e2ff Add std.unicode.replacement_character 2022-04-15 11:20:11 +03:00
Evan Haas
618398b7d3 std.fs: prevent possible integer overflow in Dir.makePath
The call to `makeDir` for the top-level component of `sub_path`
can return `error.FileNotFound` if the directory represented by
`self` has been deleted.

Fixes #11397
2022-04-15 11:19:23 +03:00
Veikka Tuominen
845a30624f std: add workaround for stage2 bug 2022-04-15 11:17:19 +03:00
Veikka Tuominen
6ad510d832 update self hosted sources to language changes 2022-04-15 11:17:19 +03:00
Veikka Tuominen
4911d39769 AstGen: handle rl_ty_inst for mutable variables 2022-04-15 11:17:06 +03:00
Veikka Tuominen
4ef1c1c705 Sema: allow fieldType on optionals and error unions 2022-04-15 10:24:18 +03:00
Koakuma
274e2a1ef1 compiler_rt: atomics: Add TAS lock support for SPARC
Some SPARC CPUs (particularly old and/or embedded ones) only has atomic
TAS instruction available (`ldstub`). This adds support for emitting
that instruction in the spinlock.
2022-04-15 08:09:57 +07:00
Luuk de Gram
d66c61a2cf wasm-linker: Prevent overalignment for segments
Previously, the data segments were being aligned twice.
This caused us to overalign the segment and therefore allocate a much larger
size for each segment than was required. This fix ensures we align and set the size
just once, ensuring semantically correct binaries as well as smaller binaries.
2022-04-14 22:53:13 +02:00
Luuk de Gram
cf37101108 wasm-linker: Add function table indexes
When linking with an object file, verify if a relocation is a table index relocation.
If that's the case, add the relocation target to the function table.
2022-04-14 22:53:13 +02:00
Luuk de Gram
321a164269 wasm-linker: Fix memory leak
This fixes a memory leak when an object file contains one or more element sections which
then contains one or more function indexes. This commit ensures the slice of index functions
for each element section will be freed upon resource deallocation also.
2022-04-14 22:53:13 +02:00
Jakub Konka
2635e4ca6e
Merge pull request #11434 from koachan/sparc64-codegen 2022-04-14 21:38:35 +02:00
Jakub Konka
35171dd3db
Merge pull request #11433 from ziglang/elf-fixes
elf: support `--strip` option and set symtab size when writing globals
2022-04-14 20:04:29 +02:00
Andrew Kelley
2587474717 stage2: progress towards stage3
* The `@bitCast` workaround is removed in favor of `@ptrCast` properly
   doing element casting for slice element types. This required an
   enhancement both to stage1 and stage2.
 * stage1 incorrectly accepts `.{}` instead of `{}`. stage2 code that
   abused this is fixed.
 * Make some parameters comptime to support functions in switch
   expressions (as opposed to making them function pointers).
 * Avoid relying on local temporaries being mutable.
 * Workarounds for when stage1 and stage2 disagree on function pointer
   types.
 * Workaround recursive formatting bug with a `@panic("TODO")`.
 * Remove unreachable `else` prongs for some inferred error sets.

All in effort towards #89.
2022-04-14 10:12:45 -07:00
Koakuma
c07213269f stage2: zig fmt 2022-04-14 23:26:03 +07:00
Koakuma
e791f062ba stage2: sparcv9: Load tests to the list of testcases 2022-04-14 23:24:46 +07:00
Koakuma
2ee83e76f7 stage2: Adjust line numbers in tests 2022-04-14 23:15:56 +07:00
Koakuma
9201fbe85b stage2: sparcv9: Add cmp_lt_errors_len AIR inst & fix asm parsing 2022-04-14 22:34:51 +07:00