profile
viewpoint
If you are wondering where the data of this site comes from, please visit https://api.github.com/users/kubkon/events. GitMemory does not store any data, but only uses NGINX to cache data for a period of time. The idea behind GitMemory is simply to give users a better reading experience.
Jakub Konka kubkon Zig Warsaw, Poland www.jakubkonka.com Zig core team member

bytecodealliance/wasmtime 5977

Standalone JIT-style runtime for WebAssembly, using Cranelift

bytecodealliance/cap-std 283

Capability-oriented version of the Rust standard library

bytecodealliance/wasi 132

Experimental WASI API bindings for Rust

CraneStation/wasi-common 28

WASI implementation in Rust

CraneStation/wasi-misc-tests 3

Miscellaneous tests for WASI

CraneStation/homebrew-cranestation 2

Homebrew tap for CraneStation

kubkon/des-in-python 2

Discrete Event Simulation (DES) in py3k

kubkon/dotfiles 2

dot dot dot

kubkon/conduit-persistent-example 1

This code demonstrates how to use Conduit together with Persistent to stream data in constant memory in Haskell.

kubkon/deqnap 1

Simple utility for removing extraneous files created by QNAP's rename merging policy

issue commentziglang/zig

zig ar: a drop-in llvm-ar replacement

Yeah, the ultimate goal of zar should be generating static archives. Adding parsing logic is a good first step to figuring out how it works though. One thing to pay particular attention to is the differences in generated ar structure between linux and macos - I believe there is a difference in at least the header format but maybe more. Also, I've been reached out to by multiple people expressing interest in helping out so @moosichu are you fine taking charge on this one and potentially collaborating with others? If so, I'll send them your way (to your fresh repo, etc.).

kubkon

comment created time in 4 hours

issue commentziglang/zig

zig ar: a drop-in llvm-ar replacement

If I were tackling this problem, I would most likely create a fresh repo with sole purpose of building a drop-in replacement for llvm-ar, much like zld is for lld. You can then build it out-of-tree which means you don't have to worry about passing Zig tests at this stage and you significantly cut down on build times. I would also focus on just one file format in the beginning say ELF, or Mach-O. The idea here is that if you were to pick any large C/C++ codebase (or whatnot) in the wild, you could pass the Zig archiver as a replacement for the default system one or llvm-ar, that is you'd tweak the CMake/Make invocation like so:

AR=zig-ar CC=... CXX=... cmake ../

or the same but with make. If the build process succeeds, then success!

Afterwards, you might wanna consider dropping the archiver as a direct replacement for llvm-ar in the Zig upstream either by calling directly to a precompiled binary or putting the sources in-tree (the latter is the end-goal actually). The relevant source where this should/could happen is in src/link.zig#L668:

pub fn linkAsArchive(base: *File, comp: *Compilation) !void {
    //...
    const llvm = @import("codegen/llvm/bindings.zig");
    const os_type = @import("target.zig").osToLLVM(base.options.target.os.tag);
    const bad = llvm.WriteArchive(full_out_path_z, object_files.items.ptr, object_files.items.len, os_type);
    if (bad) return error.UnableToWriteArchive;
    //...
}
kubkon

comment created time in 10 hours

push eventkubkon/zld

Jakub Konka

commit sha 765c0c5f43a0b6e472fbbd6da22989a63272af87

elf: prepopulate .text, .rodata and .data section indexes

view details

Jakub Konka

commit sha e97e9f0dc7bb59fc715364c87a9014a1ee3ca39c

elf: handle two most basic relocation types

view details

push time in a day

push eventkubkon/zld

Jakub Konka

commit sha 0ebfa3fe16a51676f237a9baecb502753dbd70ae

elf: fix nonloadable segment sizes

view details

push time in a day

push eventkubkon/zld

Jakub Konka

commit sha 3ed8f909a28a055f6206b062b1f10244180bd110

elf: match source->target sections and link atoms

view details

Jakub Konka

commit sha a83dc5faac041ebff669aba59de44f9dba8b484c

elf: allocate segments and sections

view details

Jakub Konka

commit sha a5b5b861255af3e353254fccacc686f12ef3fb3f

elf: allocate atoms

view details

Jakub Konka

commit sha 18b7c4af394ec637eba6a40805a9ede26b026fb0

elf: write atoms to file

view details

push time in a day

push eventkubkon/zld

Nuno Leiria

commit sha 5c608b75ad37c37d8d3997c38cd480d6c7b6936a

coff: Add initial Coff support

view details

push time in a day

PR merged kubkon/zld

coff: Add initial Coff support
+64 -4

3 comments

2 changed files

Pombal

pr closed time in a day

pull request commentkubkon/zld

coff: Add initial Coff support

Also, do you mind changing the README to say that work on COFF is now officially in progress?

I would rather not do that until I'm more certain I have the bandwidth to work on this for an extended period of time. But I can make the change if you'd prefer it.

I'm good with either TBH, and just so we're clear, there is absolutely no pressure!

Pombal

comment created time in a day

Pull request review commentkubkon/zld

coff: Add initial Coff support

+const Coff = @This();++const std = @import("std");+const assert = std.debug.assert;+const coff = std.coff;+const fs = std.fs;+const log = std.log.scoped(.coff);+const mem = std.mem;++const Allocator = mem.Allocator;+const Zld = @import("Zld.zig");++pub const base_tag = Zld.Tag.coff;++base: Zld,++pub fn openPath(allocator: *Allocator, options: Zld.Options) !*Coff {+    const file = try options.emit.directory.createFile(options.emit.sub_path, .{+        .truncate = true,+        .read = true,+        .mode = 0,

Also, I'm not sure how this works with cross-linking to Windows from Linux while testing in Wine. Something I need to give a look but didn't yet. It might not be needed indeed, but for consistency I'd like for all linker backends to set the mode correctly :-)

Pombal

comment created time in a day

PullRequestReviewEvent

Pull request review commentkubkon/zld

coff: Add initial Coff support

+const Coff = @This();++const std = @import("std");+const assert = std.debug.assert;+const coff = std.coff;+const fs = std.fs;+const log = std.log.scoped(.coff);+const mem = std.mem;++const Allocator = mem.Allocator;+const Zld = @import("Zld.zig");++pub const base_tag = Zld.Tag.coff;++base: Zld,++pub fn openPath(allocator: *Allocator, options: Zld.Options) !*Coff {+    const file = try options.emit.directory.createFile(options.emit.sub_path, .{+        .truncate = true,+        .read = true,+        .mode = 0,

So the idea is that in principle since zld is written in Zig, it can easily be cross-compiled for any platform which we should make use by giving the possibility to easily cross-link to any platform too. It will obviously be lacking in this department all of the automation tooling that goes with Zig proper, but this where once would use the zig ld abstraction embedded directly in Zig toolchain.

Pombal

comment created time in a day

PullRequestReviewEvent

push eventkubkon/zld

Jakub Konka

commit sha 67a1f63fab0be069640687b13439c0e0643b936a

elf: create atoms from sections in objects

view details

push time in 2 days

pull request commentkubkon/zld

coff: Add initial Coff support

Also, do you mind changing the README to say that work on COFF is now officially in progress?

Pombal

comment created time in 2 days

PullRequestReviewEvent

Pull request review commentkubkon/zld

coff: Add initial Coff support

+const Coff = @This();++const std = @import("std");+const assert = std.debug.assert;+const coff = std.coff;+const fs = std.fs;+const log = std.log.scoped(.coff);+const mem = std.mem;++const Allocator = mem.Allocator;+const Zld = @import("Zld.zig");++pub const base_tag = Zld.Tag.coff;++base: Zld,++pub fn openPath(allocator: *Allocator, options: Zld.Options) !*Coff {+    const file = try options.emit.directory.createFile(options.emit.sub_path, .{+        .truncate = true,+        .read = true,+        .mode = 0,

I think this should include a check like in other backends when using zld to cross-link to a foreign platform from Linux say.

        .mode = if (std.Target.current.os.tag == .windows) 0 else 0o777,
Pombal

comment created time in 2 days

PullRequestReviewEvent

push eventkubkon/zld

Jakub Konka

commit sha 81162eb4abbe5ada0a32212b09c9a26d5b7e01bb

elf: start working on object into atoms parser

view details

push time in 2 days

push eventkubkon/zld

Jakub Konka

commit sha c9c68162715a012760d11c71217e10ff6c5688df

elf: store Elf64_Ehdr as part of the state This might be up for rethinking once zld supports 32bit archs and MSB endian archs but for now, this just makes for a more convenient implementation.

view details

push time in 2 days

push eventkubkon/zld

Jakub Konka

commit sha 0907153a5fbe9cbc0af0ff6e5b4de93d62984d9b

elf: write symtab and strtabs into executable

view details

push time in 2 days

push eventkubkon/zld

Jakub Konka

commit sha d27e92958db3c1491d98f9e7b3cb9b5de8349204

elf: add stubs for allocating segments

view details

push time in 2 days

push eventkubkon/zld

Jakub Konka

commit sha fcdf6e97b708d7b2b1b2bc324aa551d9c539ab41

elf: add minimum required program headers Now, readelf doesn't complain about a malformed ELF executable.

view details

push time in 3 days

push eventkubkon/zld

Jakub Konka

commit sha df95456e25b57dd630f8a20009d75ad818a28663

elf: write section headers and shstrtab to file

view details

push time in 3 days

push eventkubkon/zld

Jakub Konka

commit sha f9b3cb41fc88dcb9d207da961306b602d245ca7a

elf: refactor weak and global symbol resolution

view details

push time in 3 days

push eventkubkon/zld

Jakub Konka

commit sha 122280e29663bbc13404f80e38f6958ef65d5d8d

elf: draft out incomplete symbol resolution in objects

view details

push time in 3 days

push eventkubkon/zld

Jakub Konka

commit sha 7ea7d772ea4dc9fa350a9da497c356e055947df5

elf: parse symbol and string tables

view details

push time in 3 days

push eventkubkon/zld

Jakub Konka

commit sha 54cff2f9d47792fadea2aaabf0c034a47350bb1c

elf+macho: refactor debug log scopes and parse section headers

view details

push time in 4 days

push eventkubkon/dotfiles

Jakub Konka

commit sha eac75b31bc706893796009780a8f064f40d58d16

Undo removal of auto-pairs

view details

push time in 4 days

push eventkubkon/zld

Jakub Konka

commit sha 11129f5e62d9dc84ac1212890ba2e122fc7d93c9

Refactor Zld interface; close the out file

view details

push time in 4 days

push eventkubkon/zld

Jakub Konka

commit sha 0bb6273d5feeedf302747268a617db8703ea2e2b

elf: add containers for phdrs and shdrs

view details

push time in 4 days