Skip to content

About

build a ZIG_LIBC environment for Zig, targeting OpenBSD

Topics

Resources

Stars

4 stars

Watchers

2 watching

Forks

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

OpenBSD ZIG_LIBC support

Simple shell script to build a ZIG_LIBC environment for Zig targeting OpenBSD.

Usage

$ ./build-ziglibc.sh
usage: ./build-ziglibc.sh url output-dir

Examples of url

Use the environment

$ ZIG_LIBC=path/to/amd64/libc.conf zig build-exe -target x86_64-openbsd -o tests/helloz tests/hello.zig
$ ZIG_LIBC=path/to/amd64/libc.conf zig cc -target x86_64-openbsd -o tests/helloc tests/hello.c

Make shell wrapper

For easy use of crosscompilation, you could create a shell wrapper named x86_64-openbsd-cc:

#!/bin/sh
exec env ZIG_LIBC=path/to/amd64/libc.conf zig cc -target x86_64-openbsd "$@"

And do the same for x86_64-openbsd-c++, x86_64-openbsd-ar, …

About

build a ZIG_LIBC environment for Zig, targeting OpenBSD

Topics

Resources

Stars

4 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages