Skip to content

Conversation

@nohajc
Copy link
Contributor

@nohajc nohajc commented Nov 11, 2025

At the moment, I'm porting init.krun to FreeBSD (hoping to open that PR soon) and I thought it would be neat to have the option to compile on macOS without spinning up a VM if one so chooses.

This relies on clang and lld (the LLVM linker). Plus, you need to provide path to a suitable sysroot. I tested the build by copying /usr/include, /usr/lib/aarch64-linux-gnu and /usr/lib/gcc/aarch64-linux-gnu from a Debian Bookworm system.

Just wasn't sure if I should strip the binary or not. Right now it's configured to only strip debug_info.

@nohajc
Copy link
Contributor Author

nohajc commented Nov 11, 2025

I suppose I should also document this in README if the change is accepted.

@nohajc nohajc force-pushed the init-cross-compilation branch from b59d444 to f62c49d Compare November 11, 2025 13:09
endif

OS = $(shell uname -s)
ARCH = $(shell uname -m)
Copy link
Contributor Author

@nohajc nohajc Nov 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can return arm64 on macOS or aarch64 on Linux but clang seems happy with either in the target triple.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant