aboutsummaryrefslogtreecommitdiff
path: root/src/link/Wasm.zig
AgeCommit message (Collapse)Author
2021-02-05Ensure function indices are correct and fix a memory leakLuuk de Gram
2021-02-05Create type declarations for extern functions and write the 'import' sectionLuuk de Gram
2021-02-01Merge pull request #7895 from Luukdegram/wasm-control-flowAndrew Kelley
stage2: wasm control flow
2021-02-01Define wasm constantsLuuk de Gram
Update link.Wasm.zig to use std.wasm for its constants Make opcodes u8 and non-exhaustive Update test and rename 'spec' to 'wasm'
2021-01-26Add tests, fix locals that are created in blocks like loops, and handle all ↵Luuk de Gram
breaks correctly
2021-01-24Nested conditions and loops supportLuuk de Gram
2021-01-24Define wasm constantsLuuk de Gram
Update link.Wasm.zig to use std.wasm for its constants Make opcodes u8 and non-exhaustive Update test and rename 'spec' to 'wasm'
2021-01-23add LTO supportAndrew Kelley
The CLI gains -flto and -fno-lto options to override the default. However, the cool thing about this is that the defaults are great! In general when you use build-exe in release mode, Zig will enable LTO if it would work and it would help. zig cc supports detecting and honoring the -flto and -fno-lto flags as well. The linkWithLld functions are improved to all be the same with regards to copying the artifact instead of trying to pass single objects through LLD with -r. There is possibly a future improvement here as well; see the respective TODOs. stage1 is updated to support outputting LLVM bitcode instead of machine code when lto is enabled. This allows LLVM to optimize across the Zig and C/C++ code boundary. closes #2845
2021-01-16Add tests and move tests to wasm's own fileLuuk de Gram
2021-01-15Cleanup and 'add' instruction for bigger test areaLuuk de Gram
2021-01-15stage2: refactor wasm backend - similar to the other backendsLuuk de Gram
2021-01-13stage2: lay the groundwork in prep for extern fnJakub Konka
This commit lays the groundwork in preparation for implementing handling of extern functions in various backends.
2021-01-02stage2: Use {s} instead of {} when formatting stringsLemonBoy
2020-12-24stage2: fix Cache deadlock and build more of TSANAndrew Kelley
* rename is_compiler_rt_or_libc to skip_linker_dependencies and set it to `true` for all sub-Compilations. I believe this resolves the deadlock we were experiencing on Drone CI and on some users' computers. I will remove the CI workaround in a follow-up commit. * enabling TSAN automatically causes the Compilation to link against libc++ even if not requested, because TSAN depends on libc++. * add -fno-rtti flags where appropriate when building TSAN objects. Thanks Firefox317 for pointing this out. * TSAN support: resolve all the undefined symbols. We are still seeing a dependency on __gcc_personality_v0 but will resolve this one in a follow-up commit. * static libs do not try to build libc++ or libc++abi.
2020-12-09small fixes and zig fmtVexu
2020-12-08stage2: link: properly implement passthrough mode for LLD child procAndrew Kelley
passthrough mode does not mean always exit - it just means to pass through stdio and exit if the child process exits, without doing any special error reporting.
2020-12-08invoke LLD as a child process rather than a libraryAndrew Kelley
Closes #3825
2020-11-30fix regression on wasm targetsAndrew Kelley
The previous commit broke wasm targets because the linking step would look for the compiler-rt lib in the wrong place. Fixed in this commit.
2020-11-19stage2: Make zig cc more verbose (#7166)LemonBoy
* stage2: Make zig cc more verbose Make `zig cc` print more info from Clang itself and from our own linker invocation, this is needed for CMake to properly discover all the include directories and library search paths. Closes #7110 * Update `update_clang_options` * Typo fixes Co-authored-by: Jakub Konka <kubkon@jakubkonka.com>
2020-11-16Move leb128 and remove trivial *mem functions as discussed in #5588 (#6876)tgschultz
* Move leb128 out of debug and remove trivial *mem functions as discussed in #5588 * Turns out one of the *Mem functions was used by MachO. Replaced with trivial use of FixedBufferStream.
2020-10-09fixups to previous commitAndrew Kelley
* std.fs.Dir.readFile: add doc comments to explain what it means when the returned slice has the same length as the supplied buffer. * introduce readSmallFile / writeSmallFile to abstract over the decision to use symlink or file contents to store data.
2020-10-09Use regular file for caching stage 1 hash digest instead of symlink, fix zig ↵mlarouche
build caching on Windows Fix #6500
2020-10-09include compiler_rt and c for wasm static librariesJosh Wolfe
2020-09-29use Allocator.allocSentinel now that the stage1 bug is fixedAndrew Kelley
Thanks @LemonBoy!
2020-09-28stage2: WASM LLD linkingAndrew Kelley
2020-09-26stage2: implement -fno-emit-binAndrew Kelley
we are now passing the cli tests
2020-09-21rename src-self-hosted/ to src/Andrew Kelley