Skip to content
This repository has been archived by the owner on Nov 27, 2023. It is now read-only.

Linking Rust programs against a Unikraft static library.

License

Notifications You must be signed in to change notification settings

mkroening/unikraft-rs-staticlib

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

unikraft-rs (static library)

Important

This approach is deprecated and will not work on current Unikraft versions. See *-unikraft-linux-musl—The rustc book for running Rust apps on current versions of Unikraft.

This crate builds and links against Unikraft.

Requirements

Supported Unikraft platforms

  • kvm
  • linuxu

Usage

You can compile the examples like this:

cargo build \
    --example <EXAMPLE> \
    --features <PLATFORM> \
    --target <TRIPLE>

x86_64-unknown-linux-gnu

You can only build no-std applications using the x86_64-unknown-linux-gnu target.

This target requires additional RUSTFLAGS:

-Crelocation-model=static
-Clink-arg=-Wl,-T,unikraft_linker_script.ld
-Clink-arg=-Wl,-dT,default_unikraft_linker_script.ld
-Clink-arg=-Wl,-e,_unikraft_rs_start
-Cpanic=abort

See Cargo configuration build.rustflags and cargo-rustc for more information on how to set them.

You also need to provide stubs for eh_personality and _Unwind_Resume as seen in the example.

License

unikraft-rs is part of the Unikraft OSS Project and licensed under BSD-3-Clause.

About

Linking Rust programs against a Unikraft static library.

Topics

Resources

License

Stars

Watchers

Forks

Languages