Skip to Content
marmot

marmot sysroot add linux/arm64 fetches Debian stable's glibc and kernel headers, libc link files and gcc runtime files for the target into marmot's cache. The packages are checked against Debian's index. marmot build -target then compiles cgo packages for the target and links the executable here with ld.lld. -libc musl builds musl from its release source for marmot build -static. list shows what is installed, remove deletes one.

Usage
marmot sysroot add|list|remove [-libc musl] [GOOS/GOARCH] [flags]

Examples

marmot sysroot add linux/arm64
marmot build -target linux/arm64 -o app .
marmot sysroot add -libc musl linux/amd64
marmot build -static -target linux/amd64 -o app .
marmot sysroot list

Cross builds of cgo packages

A cross build of a cgo package needs the C headers and libraries of the target. marmot sysroot add fetches them once into marmot's cache:

marmot sysroot add linux/arm64
marmot build -target linux/arm64 -o app .

The glibc sysroot holds the glibc and kernel headers, libc's link files and gcc's runtime files of Debian stable. marmot checks each package against Debian's index. The build links the executable on your machine with ld.lld.

Static executables with musl

marmot sysroot add -libc musl linux/amd64
marmot build -static -target linux/amd64 -o app .

The musl sysroot is built from the musl release source. marmot sysroot list shows what is installed. marmot sysroot remove deletes one. Cross builds has more.

Full help

marmot sysroot --help
marmot sysroot add linux/arm64 fetches Debian stable's glibc and kernel headers, libc link files and gcc runtime files for the target into marmot's cache. The packages are checked against Debian's index. marmot build -target then compiles cgo packages for the target and links the executable here with ld.lld. -libc musl builds musl from its release source for marmot build -static. list shows what is installed, remove deletes one.

Usage:
  marmot sysroot add|list|remove [-libc musl] [GOOS/GOARCH] [flags]

Examples:
marmot sysroot add linux/arm64
marmot build -target linux/arm64 -o app .
marmot sysroot add -libc musl linux/amd64
marmot build -static -target linux/amd64 -o app .
marmot sysroot list

Flags:
  -h, --help   help for sysroot

On this page

Was this page helpful?

Report an issueOpen issues