Commit Graph

18933 Commits

Author SHA1 Message Date
Andrew Kelley
df1f401cf0 std.x.os.net: make error set consistent across targets 2022-06-27 18:26:50 -07:00
Andrew Kelley
3c1daf951c LLVM: fix invalid IR on @returnAddress of wasm/bpf
see #11946
2022-06-27 17:12:45 -07:00
Andrew Kelley
8d8a5f9733 LLVM: support calls to varargs functions
closes #11944
2022-06-27 16:02:41 -07:00
Andrew Kelley
3b19869853 Sema: honor the --test-filter flag 2022-06-27 14:31:54 -07:00
Ryan Liptak
a76775b50a Fix stack traces with non-null first_address on Windows
Before this commit, the passed in length would always be given to the RtlCaptureStackBackTrace call. Now we always give the length of the actual buffer we're using (the addr_buf_stack size of 32 or the passed in length if it's larger than 32; this matches what the doc comment says the function was meant to be doing as well).

This was causing empty stack traces for things like the GeneralPurposeAllocator leak checking.

Fixes #6687
2022-06-27 20:00:39 +03:00
Pierre Curto
76f8328277 doc: update std.builtin.TypeInfo to std.builtin.Type 2022-06-27 19:48:52 +03:00
Jakub Konka
08459ff1c2
Merge pull request #11933 from Luukdegram/wasm-link-bss
stage2: wasm-linker - Place decls in the correct segment and order segments
2022-06-25 22:51:06 +02:00
joachimschmidt557
960c142060 stage2 ARM: implement basic intCast and error union wrapping 2022-06-25 21:16:51 +02:00
Jakub Konka
76b28ed452
Merge pull request #11929 from ziglang/headerpad_max_install_names
macho: handle `-headerpad` and `-headerpad_max_install_names`
2022-06-25 21:15:59 +02:00
Luuk de Gram
140bac6395
link/wasm: Sort data segments
We now ensure the "bss" section is last, which allows us to not
emit this section and let the runtime initialize the memory with 0's instead.
This allows for smaller binaries.
The order of the other segments is arbitrary and does not matter, this may
change in the future.
2022-06-25 18:36:56 +02:00
Jakub Konka
589bf67635 macho: implement -headerpad_max_install_names 2022-06-25 18:04:40 +02:00
Jakub Konka
a6fbdfabb9 link-tests: add -headerpad_size test scenario 2022-06-25 17:59:09 +02:00
Jakub Konka
8c1feef4cd macho: implement -headerpad_size option
Includes both traditiona and incremental codepaths with one caveat that
in incremental case, the requested size cannot be smaller than the
default padding size due to prealloc required due to incremental nature
of linking.

Also parse `-headerpad_max_install_names`, however, not actionable just yet -
missing implementation.
2022-06-25 17:59:08 +02:00
Jakub Konka
f91503e577 link-tests: defer parsing of the RPN program until running the action 2022-06-25 17:56:03 +02:00
Jakub Konka
0078d36ff3
Merge pull request #11917 from motiejus/wl-search-paths
macho: implement `-search_paths_first` and `-search_dylibs_first`
2022-06-25 17:55:26 +02:00
Jakub Konka
8f00bc9d23 link-tests: put macho search strategy tests into one test case 2022-06-25 10:57:56 +02:00
Jakub Konka
dfdb807543 cache setting macho search strategy flags 2022-06-25 10:50:00 +02:00
Jakub Konka
24821dd17f link-tests: test -search_paths_first and -search_dylibs_first macho flags 2022-06-24 22:07:51 +02:00
Jakub Konka
eadac47631 cli: let the linker resolve libs into dynamic and static
Unlike targeting ELF-based OSes such as Linux, resolving system libs
on Darwin should follow one of two strategies: `-search_paths_first`
or `-search_dylibs_first` and hence we defer always forcing linking
a static library to the linker.
2022-06-24 22:02:19 +02:00
Luuk de Gram
e32a5ba78b
link/wasm: Put decls into the correct segments
Decls will now be put into their respective segment.
e.g. a constant decl will be inserted into the "rodata" segment,
whereas an uninitialized decl will be put in the "bss" segment instead.
2022-06-24 22:01:41 +02:00
Jakub Konka
b60938eefd macho: verbose print all input linker args verbatim 2022-06-24 22:01:29 +02:00
Jakub Konka
905a18849f
Merge pull request #11923 from koachan/sparc64-codegen
stage2: sparc64: Another batch of new Air lowerings, improvements, and fixes
2022-06-24 20:29:21 +02:00
Jakub Konka
0df7ed79d3 macho: implement -search_dylibs_first linker option 2022-06-24 20:25:16 +02:00
Motiejus Jakštys
d589047e80 zld: ignore -search_paths_first
Ignore MachO-specific flag -search_paths_first, since it is the default
in zld and ld64.

Also see Jakub's comment[1]:

    Changing topic slightly, @motiejus dunno if you noticed, with this
    change building arm64 Zig binary fails on macos - it complains about
    unknown -search_paths_first flag. This one is an easy fix: we should
    ignore it since this is the default behaviour in both ld64 and zld.

[1]: https://github.com/ziglang/zig/pull/11906#issuecomment-1163545849
2022-06-24 19:03:15 +02:00
Koakuma
672d6df429 stage2: sparc64: Skip Sema-failing tests for now 2022-06-24 21:19:33 +07:00
Koakuma
ad176b319d stage2: sparc64: Implement SPARCv9 movr 2022-06-24 21:19:33 +07:00
Koakuma
65c5ef52e9 stage2: sparc64: Implement airRem, airMod, and SPARCv9 s/udivx 2022-06-24 21:19:33 +07:00
Koakuma
27adee3f12 stage2: sparc64: Implement airErrUnionPayloadPtrSet 2022-06-24 21:19:33 +07:00
Koakuma
84a57987c7 stage2: sparc64: Implement airAggregateInit 2022-06-24 21:19:33 +07:00
Koakuma
dd57729299 stage2: sparc64: Update BigTomb implementation to use Liveness
Change BigTomb implementation to call to Liveness' implementation
rather than implementing feed() in itself.
This is modelled after the AArch64 backend.
2022-06-24 21:19:33 +07:00
Koakuma
e2cb25358e stage2: sparc64: Implement airCall with BigTomb use for return 2022-06-24 21:19:33 +07:00
Koakuma
26b63b022f stage2: sparc64: Add airMemset placeholder 2022-06-24 21:19:33 +07:00
Koakuma
4fd0500bb5 stage2: sparc64: Implement airBoolToInt 2022-06-24 21:19:33 +07:00
Koakuma
837cd0d8af stage2: sparc64: Fix airNot comments/error messages 2022-06-24 21:19:33 +07:00
Koakuma
be6718b796 stage2: sparc64: Implement airIsNull/airIsNonNull 2022-06-24 21:19:33 +07:00
Koakuma
4d15284c3c stage2: sparc64: Implement SPARCv9 shifts 2022-06-24 21:19:33 +07:00
Koakuma
513ab4eb56 stage2: sparc64: Implement airIntCast basics 2022-06-24 21:19:33 +07:00
Koakuma
36bfe4b7ef stage2: sparc64: Implement airFence + SPARCv9 membar 2022-06-24 21:19:33 +07:00
Koakuma
18d61d691c stage2: sparc64: Implement airArrayElemVal 2022-06-24 21:19:33 +07:00
Koakuma
672cd2f02f stage2: sparc64: Implement SPARCv9 and 2022-06-24 21:19:33 +07:00
Koakuma
6218d70d09 stage2: sparc64: Implement airBinOp for and, or, and xor 2022-06-24 21:19:33 +07:00
Koakuma
921f776224 stage2: sparc64: Implement airTry 2022-06-24 21:19:27 +07:00
Koakuma
40590c8bf9 stage2: sparc64: Save registers before calling another function 2022-06-24 21:08:41 +07:00
Koakuma
5c8612642b stage2: sparc64: Use official encoding for not rs2, rs1 2022-06-24 21:08:41 +07:00
Koakuma
e7fde5f64e stage2: sparc64: Introduce condition_register MCValue type
Introduce condition_register MCValue type for future uses with BPr/MOVr
(mostly when needing to compare a signed value with zero)
2022-06-24 21:08:41 +07:00
Koakuma
accc3bad63 stage2: sparc64: Move conditional branch emission out of airCondBr 2022-06-24 21:08:41 +07:00
Koakuma
8b3f7d2ad8 stage2: sparc64: Merge the compare_flag structs into condition_flags
This follows the design in the aarch64 backend (commit
61844b6bd4).
2022-06-24 21:08:40 +07:00
Luuk de Gram
7c87f9c828 link:clarification & enable MachO getGlobalSymbol
This adds clarification to the getGlobalSymbol doc comments,
as well as renames the `addExternFn` function for MachO to `getGlobalSymbol`.
This function will now be called from 'src/link.zig' as well.

Finally, this also enables compiling zig's libc using LLVM even though
the `fno-LLVM` flag is given.
2022-06-24 08:12:17 +02:00
Luuk de Gram
3868864695 Revert "wasm: Enable f16 behavior tests"
This reverts commit 3c34c9f13c67ff1716a9531e87d23a6dad12b45e.
2022-06-24 08:12:17 +02:00
Luuk de Gram
6ae898b244 wasm: more f16 support and cleanup of intrinsics
`genFunctype` now accepts calling convention, param types, and return type
as part of its function signature rather than `fnData`. This means
we no longer have to create a dummy for our intrinsic call abstraction.
This also adds support for f16 division and builtins such as `@ceil` & more.
2022-06-24 08:12:17 +02:00