Skip to content
(Cross) Compile FreeBSD binaries on Linux
Branch: master
Clone or download
Pull request Compare This branch is 3 commits ahead of sandvine:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore
Dockerfile
Dockerfile.rust
LICENSE.txt
README.md
fix-links

README.md

freebsd-cross-build

This creates a container that can be used to cross-compile FreeBSD binaries natively on Linux.

To build:

docker build -t freebsd-cross .

To run:

docker run --rm -it freebsd-cross bash

There is /freebsd/bin on the path. It has all of the build tools (e.g. x86_64-pc-freebsd12-gcc)

It is likely you would add a -v switch to the run (to put your code on a mount).

Rust Image

There is a second Dockerfile that can be used to cross-compile FreeBSD Rust binaries.

To build:

docker build -f Dockerfile.rust -t freebsd-cross-rust .

See the following script for an example of its use on a Rust project:

https://git.sr.ht/~wezm/lobsters/tree/master/build-freebsd

You can’t perform that action at this time.