16942 Commits

Author SHA1 Message Date
Koakuma
755d116ecf stage1: use u16 for __truncxfhf2/__extendhfxf2 on non-Arm CPUs
Non-Arm CPUs use u16 as the parameter to __extendhfxf2 and the return value of
__truncxfhf2, so insert appropriate bitcasts in gen_soft_f80_widen_or_shorten.
Otherwise, LLVM might crash because the functions are called in a different way
than its compiler-rt definition.

This fixes stage1 build on SPARCv9, and possibly other non-x86, non-Arm CPUs.
2022-02-17 14:46:04 +02:00
Hadrien Dorio
02902cc099
ci: azure: split build-and-test step (#10853)
replace the .bat script by a pwsh script
2022-02-16 22:33:08 -05:00
Andrew Kelley
df8c325012
Merge pull request #10907 from ziglang/ci-windows-zig-cc
CI: windows: depend on Zig instead of CMake and MSVC
2022-02-16 20:44:42 -05:00
Andrew Kelley
25a7025613 ci: use zig-bootstrap for windows 2022-02-16 18:43:45 -07:00
Andrew Kelley
cc9eb9e90f build.zig: bootstrap stage1 with zig0
Instead of assuming that the zig version used with `zig build` is
appropriate for building the self-hosted compiler component, we follow
the same path as the cmake build script and build zig0, using that to
produce zig1.o, re-linking to produce stage1.

This allows an arbitrarily old Zig version and corresponding build.zig
script to build all future versions of Zig from source via the bootstrap
compiler. In other words, it allows us to use `zig build` as an
alternative to cmake when bootstrapping.
2022-02-16 14:12:15 -07:00
Andrew Kelley
2b3df5c81d link: avoid double close on openPath error 2022-02-16 14:12:15 -07:00
joachimschmidt557
1a84c23d69 stage2 AArch64: Simplify and correct invocations of genInlineMemcpy
Previously, the invocations used movk instead of movz
2022-02-16 15:47:44 +01:00
iddev5
77e5b042a0 fmt: allow uppercase prefix to be parsed in std.fmt.parseInt()
std.fmt.parseHexFloat allow both 0x and 0X as prefix, so in order to
keep things consistent. This commit modifies std.fmt.parseWithSign to
check for the prefix case insensitively in order to allow both upper
case and lower case prefix.

This change now allows: 0O, 0B and 0X as prefixes for parsing.
2022-02-16 11:27:10 +01:00
Jakub Konka
5283a52af5 macho: handle binary updates in dSYM companion file
* move DWARF in file if LINKEDIT spilled in dSYM
* update VM addresses for all segments
* introduce copyFileRangeOverlappedAll instead of File.copyRangeAll
  since we make lots of overlapping writes in MachO linker
2022-02-16 08:38:28 +01:00
Andrew Kelley
0b22b6b70e ci: update x86_64-linux tarballs
The updated docker images has LLVM, LLD, Clang updated to 13.0.1 and Zig
updated to 0.9.1.
2022-02-15 20:12:10 -07:00
Andrew Kelley
65cb8a03ee CI: update macos and freebsd tarballs 2022-02-15 19:50:38 -07:00
Andrew Kelley
22f464a8c3 zig cc: handle -l :FILE syntax
This "feature" of gcc/clang means to treat this as a positional
link object, but using the library search directories as a prefix.

We solve this problem in the CLI layer, using a separate map for
the data since it is an uncommon case.

Closes #10851
2022-02-15 17:36:12 -07:00
Jakub Konka
092b019a2f
Merge pull request #10899 from ziglang/arm64-macos
aarch64,macos: handle GOT and direct loads in codegen
2022-02-16 00:18:42 +01:00
Jakub Konka
1c975607e1 aarch64: add lowerUnnamedConst glue to codegen 2022-02-15 21:04:40 +01:00
Jakub Konka
5bba041bae aarch64: introduce MCValue.got_load and MCValue.direct_load
This matches the current design in x86_64 backend and significantly
simplifies handling of PIE targets in aarch64 backend.
2022-02-15 21:04:40 +01:00
Jakub Konka
9c82f3ae6f stage2: disable failing aarch64-macos behavior tests 2022-02-15 21:04:36 +01:00
Veikka Tuominen
cf5009f9af
Merge pull request #10003 from viriuwu/nt-thread-name
std.Thread.getName/setName: rework windows implementation
2022-02-15 13:23:09 +02:00
Anthony Carrico
078aa5f7b2 Adds Linux support for POSIX file locking with fcntl
On Linux, locking fails with EAGAIN (vs. EACCES on other systems).
This commit also adds FcntlErrors for EDEADLK and ENOLCK.
2022-02-15 13:22:50 +02:00
Jan Philipp Hafer
c6cd919a18 stage1: fix comptime saturation subtraction
- also simplifies code
- adding a few more tests

closes #10870
2022-02-15 10:40:53 +02:00
viri
0bde55e881
std.Thread(windows): use NT internals for name fns 2022-02-15 01:20:54 -06:00
Jakub Konka
be98f30a2d
Merge pull request #10893 from joachimschmidt557/stage2-aarch64
stage2 AArch64: get zig test working; enable behavior tests
2022-02-15 07:05:24 +01:00
Andrew Kelley
dc6553d93e CI: update download page and langref for 0.9.1 2022-02-14 20:08:04 -07:00
John Schmidt
807edd2234
LLVM backend: refactor LLVM bitcount ops (#10882)
Use `llvm.getIntrinsic` instead of `llvm.getNamedFunction`
2022-02-14 21:52:12 -05:00
joachimschmidt557
6c195db03a
ci: add aarch64-linux behavior tests 2022-02-14 22:36:13 +01:00
joachimschmidt557
22895f5616
stage2 AArch64: Enable behavior testing 2022-02-14 22:33:01 +01:00
joachimschmidt557
98c71cc88a
stage2 AArch64: Implement calling function pointers 2022-02-14 22:09:44 +01:00
joachimschmidt557
783e216e7d
stage2 AArch64: Fix issue in binOp and add regression test 2022-02-14 22:09:44 +01:00
joachimschmidt557
1c37622659
stage2 AArch64: Implement not for booleans 2022-02-14 22:09:44 +01:00
joachimschmidt557
3a33f31334
stage2 AArch64: implement cond_br for other MCValues 2022-02-14 22:09:44 +01:00
joachimschmidt557
edb2a75982
stage2 AArch64: Implement binOp for add, sub 2022-02-14 22:09:44 +01:00
joachimschmidt557
8bfc4b2f9c
stage2 AArch64: extract store out of airStore for recursive calls 2022-02-14 22:09:44 +01:00
joachimschmidt557
f47245865e
stage2 AArch64: minor refactors in Mir + Emit 2022-02-14 22:09:43 +01:00
joachimschmidt557
f598d2ae05
stage2 AArch64: implement unwrap_errunion_err and struct_field_ptr 2022-02-14 22:09:43 +01:00
joachimschmidt557
8204ad1937
stage2 AArch64: implement slice_len and slice_elem_val 2022-02-14 22:09:43 +01:00
joachimschmidt557
82f91adbb4
stage2 AArch64: Add madd, msub, mul, mneg instructions 2022-02-14 22:09:43 +01:00
joachimschmidt557
77cf000438
stage2 AArch64: implement loading from register 2022-02-14 22:09:43 +01:00
joachimschmidt557
0d16e908fb
stage2 AArch64: implement is_err/is_non_err for simple error unions 2022-02-14 22:09:39 +01:00
ominitay
7b938767bb std.os: throw compile error for argv on Windows
On Windows, `argv` is not populated by start code, and instead left as undefined. This is problematic, and can lead to incorrect programs compiling, but panicking when trying to access `argv`. This change causes these programs to produce a compile error on Windows instead, which is far preferable to a runtime panic.
2022-02-14 22:44:17 +02:00
Andrew Kelley
1e49d1fca8 langref: correct info about type info of declarations 2022-02-14 12:26:55 -07:00
Andrew Kelley
d164865308 add missing source file to CMakeLists.txt 2022-02-14 12:26:15 -07:00
Jakub Konka
27cfbf949a macho: re-enable creating dSYM bundle
* update number of type abbrevs to match Elf linker
* update `DebugSymbols` to write symbol and string tables
  at the end to match the `MachO` linker
* TODO: update segment vm addresses when growing segments in
  the binary
* TODO: store DWARF relocations in linker's interned arena
2022-02-14 19:24:23 +01:00
Al Hoang
04f3d93017 haiku add missing cimport include for compilation 2022-02-14 15:24:53 +02:00
Veikka Tuominen
b85c0d6a47 std: fix tests that were not run due to refAllDecls regression 2022-02-14 15:23:45 +02:00
John Schmidt
ee69a4b45f stage2: improve compiler error message for bad union init 2022-02-14 13:05:00 +02:00
Veikka Tuominen
3eb29f15f5
Merge pull request #10849 from sharpobject/sharpobject_fix_json_comptime_fields
std.json: fix compile error for comptime fields
2022-02-14 12:34:33 +02:00
Veikka Tuominen
90f2a8d9c5
Merge pull request #10486 from ominitay/metadata
std: Implement cross-platform metadata API
2022-02-14 12:33:49 +02:00
erikarvstedt
8ed792b640
std.Progress: fix suffix printing
Previously, `suffix` was copied to `output_buffer` at position
`max_end`, thereby writing into reserved space after `max_end`.
This only worked because `suffix` was not larger than
`bytes_needed_for_esc_codes_at_end` (otherwise there'd be a potential
buffer overrun) and no escape codes at end are actually written.

Since 2d5b2bf1c986d037ef965bf8c9b4d8dfd5967478, escape codes are no
longer written to the end of the buffer. They are now written
exclusively to the front of the buffer.
This allows removing `bytes_needed_for_esc_codes_at_end` and
simplifying the suffix printing logic.

This also fixes the bug that the ellipse suffix was not printed in
Windows terminals because `end.* > max_end` was never true.
2022-02-14 12:14:50 +02:00
Sebastian Keller
9ca3c897ec test_runner.zig: Do not log test name twice
In #10859 I moved the `test_node.end()` call after everything else has
been logged. Now the `test_fn.name` is printed by `Progress` itself,
making the additional log obsolete.
2022-02-14 12:09:24 +02:00
joachimschmidt557
f5068107cd stage2 regalloc: track Inst instead of ?Inst in register mapping
The information whether a register is allocated to an instruction is
already encoded in the free_registers "bitmap". Duplicating that
information in the registers map is unnecessary and may lead to
performance degradations.
2022-02-13 23:24:26 +01:00
Andrew Kelley
5f50980880
Merge pull request #10863 from m-radomski/fix
std: validate frame-pointer address in stack walking
2022-02-13 16:17:40 -05:00