Skip to content

Add prerequisite support for macOS - #183

Open
shym wants to merge 8 commits into
mirage:mainfrom
shym:macos3
Open

Add prerequisite support for macOS#183
shym wants to merge 8 commits into
mirage:mainfrom
shym:macos3

Conversation

@shym

@shym shym commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

This PR proposes changes that are along the lines the ones in Solo5/solo5#656 to make adding support for macOS smoother.

At the moment this is a draft containing:

This PR leaves to another PR discussions about the best way to package this.

samoht and others added 8 commits July 10, 2026 23:03
On targets where long double is IEEE quad (aarch64), vfprintf's `union arg`
held the float value as long double, so `%f` (and the fmt_fp call) round-tripped
double -> long double -> double through __extenddftf2/__trunctfdf2. That pulls
libgcc (or compiler-rt) soft-float into every freestanding link that uses printf,
even for integer-only formats. fmt_fp already takes a double, so the long double
was pure overhead.

Use double for the field; %L float conversions are treated as double (never used
by OCaml unikernels). aarch64 cross unikernels now link with no libgcc at all
(clang already inlines the atomics).
The aarch64 wrapper linked -lgcc for printf's long-double soft-float
(now gone: printf formats as double) and for GCC's default outline atomics
(-moutline-atomics lowers C11 atomics to __aarch64_* helpers in libgcc,
which also pull __getauxval, absent on a freestanding solo5 target).

Pass -mno-outline-atomics so atomics inline (LL/SC); the link then needs no
compiler runtime, so drop -lgcc and let a pure-LLVM toolchain link aarch64
unikernels.
Add a new option so that the toolchain can invoke commands with an
extended `PATH`
This CI workflow illustrates how this PR plays with changes from
Solo5/solo5#656 and from mirage#177
It should be amended to follow updates on those other changes
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.

2 participants