https://github.com/allyourcodebase/elfutils
elfutils ported to the zig build system
https://github.com/allyourcodebase/elfutils
zig zig-package
Last synced: 10 months ago
JSON representation
elfutils ported to the zig build system
- Host: GitHub
- URL: https://github.com/allyourcodebase/elfutils
- Owner: allyourcodebase
- License: gpl-3.0
- Created: 2025-04-28T19:16:27.000Z (10 months ago)
- Default Branch: master
- Last Pushed: 2025-04-28T19:16:50.000Z (10 months ago)
- Last Synced: 2025-04-29T18:55:54.401Z (10 months ago)
- Topics: zig, zig-package
- Language: C
- Homepage:
- Size: 33.2 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: COPYING
Awesome Lists containing this project
README
[](https://github.com/allyourcodebase/elfutils/actions)
# elfutils
This is [elfutils](https://sourceware.org/elfutils/), packaged for [Zig](https://ziglang.org/).
## Installation
First, update your `build.zig.zon`:
```
# Initialize a `zig build` project if you haven't already
zig init
zig fetch --save git+https://github.com/allyourcodebase/elfutils.git
```
You can then import `elfutils` in your `build.zig` with:
```zig
const elfutils_dependency = b.dependency("elfutils", .{
.target = target,
.optimize = optimize,
});
const libelf = elfutils_dependency.artifact("elf");
const libdw = elfutils_dependency.artifact("dw");
const libasm = elfutils_dependency.artifact("asm");
your_exe.linkLibrary(libelf);
your_exe.linkLibrary(libdw);
your_exe.linkLibrary(libasm);
```