Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/luukdegram/zwld
Experimental wasm linker
https://github.com/luukdegram/zwld
linker wasm wasm-ld wasm-linker wasmlinker webassembly zig ziglang
Last synced: 4 months ago
JSON representation
Experimental wasm linker
- Host: GitHub
- URL: https://github.com/luukdegram/zwld
- Owner: Luukdegram
- License: mit
- Archived: true
- Created: 2021-09-17T11:13:00.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2022-12-19T15:27:41.000Z (about 2 years ago)
- Last Synced: 2024-10-01T07:04:37.694Z (4 months ago)
- Topics: linker, wasm, wasm-ld, wasm-linker, wasmlinker, webassembly, zig, ziglang
- Language: Zig
- Homepage:
- Size: 345 KB
- Stars: 41
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# zwld
> *Note:* This repository has been archived as all development is now being done in [zld](https://github.com/kubkon/zld) and the [Zig toolchain](https://github.com/ziglang/zig)
Experimental linker for wasm object files.
The idea is to implement a linker that stays close to wasm-ld in regards to features
~so that one day this could potentially be used within the Zig self-hosted compiler to incrementally
link Zig code with other wasm object files.~
With zwld now having been upstreamed, the main development of the linker is done directly within the Zig compiler. Features and improvements will be backported to zwld at one point. Until then, this repository is mostly inactive.While there's no official specification for linking, `zwld` follows the wasm [tool-convention](https://github.com/WebAssembly/tool-conventions/blob/main/Linking.md) closely.
The initial goal is to support mvp features and have a base skeleton which would provide us with enough information on how
to integrate this within the Zig compiler. The first step is to make static linking work as specified by `tool-convention`,
once that is completed, dynamic linking will be tackled.## Usage
```
Usage: zwld [options] [files...] -o [path]Options:
-h, --help Print this help and exit
-o [path] Output path of the binary
--entry Name of entry point symbol
--global-base= Value from where the global data will start
--import-memory Import memory from the host environment
--import-table Import function table from the host environment
--initial-memory= Initial size of the linear memory
--max-memory= Maximum size of the linear memory
--merge-data-segments Enable merging data segments
--no-entry Do not output any entry point
--stack-first Place stack at start of linear memory instead of after data
--stack-size= Specifies the stack size in bytes
--features= Comma-delimited list of used features, inferred by object files if unset
```## Building
`zwld` uses the latest Zig, which can either be [built from source](https://github.com/ziglang/zig/wiki/Building-Zig-From-Source) or you can download
the latest [binary](https://ziglang.org/download).
Zwld can then be built running the following command:
```
zig build [-Denable-logging]
```
Right now zwld only contains debug logging, which is hidden behind the `enable-logging` flag. It is set to `false` by default.