Skip to content

Commit 3f8ffcf

Browse files
committed
feat(guest): replace musl with picolibc
Signed-off-by: Tomasz Andrzejak <andreiltd@gmail.com>
1 parent 852f0ff commit 3f8ffcf

File tree

557 files changed

+1494
-46641
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

557 files changed

+1494
-46641
lines changed

.gitmodules

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[submodule "src/hyperlight_guest_bin/third_party/picolibc"]
2+
path = src/hyperlight_guest_bin/third_party/picolibc
3+
url = https://github.com/picolibc/picolibc.git
4+
shallow = true

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

c.just

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ mkdir := if os() == "windows" { "mkdir -f -p" } else { "mkdir -p"}
22

33
# Elf options
44
# We don't support stack protectors at the moment, but Arch Linux clang auto-enables them for -linux platforms, so explicitly disable them.
5-
c-compile-options-elf := '-nobuiltininc -H --target=x86_64-unknown-linux-none -fno-stack-protector -fstack-clash-protection -mstack-probe-size=4096 -fPIC'
6-
c-include-flags-elf := "-I " + root / "src/hyperlight_guest_capi/include/" + " -I " + root / "src/hyperlight_guest_bin/third_party/musl/include/" + " -I " + root / "src/hyperlight_guest_bin/third_party/musl/arch/x86_64" + " -I " + root / "src/hyperlight_guest_bin/third_party/printf"
5+
c-compile-options-elf := '-nostdlibinc -H --target=x86_64-unknown-linux-none -fno-stack-protector -fstack-clash-protection -mstack-probe-size=4096 -fPIC'
6+
c-include-flags-elf := "-I " + root / "src/hyperlight_guest_capi/include/" + " -I " + root / "src/hyperlight_guest_bin/third_party/picolibc/newlib/libc/include/" + " -I " + root / "src/hyperlight_guest_bin/third_party/picolibc/newlib/libc/tinystdio/"
77
c-linker-options-elf := '--entry "entrypoint" --nostdlib -pie'
88
c-flags-debug-elf := '-O0'
99
c-flags-release-elf := '-O3'

src/hyperlight_guest_bin/Cargo.toml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ and third-party code used by our C-API needed to build a native hyperlight-guest
1414
"""
1515

1616
[features]
17-
default = ["libc", "printf"]
18-
libc = [] # compile musl libc
19-
printf = [ "libc" ] # compile printf
17+
default = ["libc"]
18+
libc = [] # compile libc from picolibc
19+
libm = ["libc"] # compile libm from picolibc
2020
trace_guest = ["hyperlight-common/trace_guest", "hyperlight-guest/trace_guest", "hyperlight-guest-tracing/trace"]
2121
mem_profile = ["hyperlight-common/unwind_guest","hyperlight-common/mem_profile"]
2222

@@ -32,6 +32,7 @@ spin = "0.10.0"
3232
workspace = true
3333

3434
[build-dependencies]
35+
anyhow = "1"
3536
cc = "1.2"
3637
cfg-if = "1.0"
3738
glob = "0.3.3"

0 commit comments

Comments
 (0)