Skip to content
This repository has been archived by the owner on Feb 5, 2019. It is now read-only.

Add support for writing HermitCore (https://hermitcore.org) ELF binaries #122

Conversation

ColinFinck
Copy link

HermitCore is a POSIX-compatible kernel for running a single application in an isolated environment to get maximum performance and predictable runtime behavior. It can either be used bare-metal on hardware or a VM (Unikernel) or side by side to an existing Linux system (Multikernel).
Due to the latter feature, HermitCore binaries are marked with a different OS ABI to let the Linux ELF loader distinguish them from regular Unix/Linux binaries and load them using the HermitCore "proxy" tool.

This patch has also been submitted to LLVM (https://reviews.llvm.org/D48964) and is currently waiting for a reply from [email protected] regarding the official allocation of the ELFOSABI_HERMIT constant.
However, after weeks of waiting, I'm not sure if this E-Mail address and the official ELFOSABI registration still exists. Furthermore, my patch is part of a patch series to add HermitCore as a Rust target.

Therefore, I hope that my patch can be added to the Rust fork of LLVM with the temporary ELFOSABI_HERMIT constant until an official one is assigned. This would unblock my series of Rust patches to add HermitCore support.

…ies.

HermitCore is a POSIX-compatible kernel for running a single application in
an isolated environment to get maximum performance and predictable runtime
behavior. It can either be used bare-metal on hardware or a VM (Unikernel)
or side by side to an existing Linux system (Multikernel).
Due to the latter feature, HermitCore binaries are marked with a different
OS ABI to let the Linux ELF loader distinguish them from regular Unix/Linux
binaries and load them using the HermitCore "proxy" tool.
@alexcrichton
Copy link
Member

Thanks for the PR! We do have a strict policy though for patches like this to be in upstream LLVM before we pull them into our own fork. Would it be possible to wait for the constant allocation and the LLVM patch to land for this?

GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Jul 31, 2018
Add targets for HermitCore (https://hermitcore.org) to the Rust compiler and port libstd to it.

As a start, the port uses the simplest possible configuration (no jemalloc, abort on panic) and makes use of existing Unix-specific code wherever possible.
It adds targets for x86_64 (current main HermitCore platform) and aarch64 (HermitCore platform under development).

Together with the patches to "liblibc" (rust-lang/libc#1048) and llvm (rust-lang/llvm#122), this enables HermitCore applications to be written in Rust.
Mark-Simulacrum added a commit to Mark-Simulacrum/rust that referenced this pull request Aug 1, 2018
Add targets for HermitCore (https://hermitcore.org) to the Rust compiler and port libstd to it.

As a start, the port uses the simplest possible configuration (no jemalloc, abort on panic) and makes use of existing Unix-specific code wherever possible.
It adds targets for x86_64 (current main HermitCore platform) and aarch64 (HermitCore platform under development).

Together with the patches to "liblibc" (rust-lang/libc#1048) and llvm (rust-lang/llvm#122), this enables HermitCore applications to be written in Rust.
pietroalbini added a commit to pietroalbini/rust that referenced this pull request Aug 1, 2018
Add targets for HermitCore (https://hermitcore.org) to the Rust compiler and port libstd to it.

As a start, the port uses the simplest possible configuration (no jemalloc, abort on panic) and makes use of existing Unix-specific code wherever possible.
It adds targets for x86_64 (current main HermitCore platform) and aarch64 (HermitCore platform under development).

Together with the patches to "liblibc" (rust-lang/libc#1048) and llvm (rust-lang/llvm#122), this enables HermitCore applications to be written in Rust.
@ColinFinck
Copy link
Author

ColinFinck commented Aug 3, 2018

Would it be possible to wait for the constant allocation and the LLVM patch to land for this?

Guess I have no other choice ;)
However, looking at the state of the SCO company, there is no guarantee that I ever receive a reply at all.
I really hope that the Binutils and LLVM developers eventually find an alternative for ELF standardization than relying on an unreachable company.

@ColinFinck
Copy link
Author

After a reply from SCO/Xinuos and an explanation regarding the ELFOSABI constants, we came to the conclusion that the existing ELFOSABI_STANDALONE suits our needs.
Therefore, the patch has been updated to use ELFOSABI_STANDALONE for HermitCore applications.

As soon as the patch at https://reviews.llvm.org/D48964 has been officially included into LLVM, this PR can be merged to enable the Rust fork of LLVM to build HermitCore applications.

@ColinFinck
Copy link
Author

This patch has been committed to upstream LLVM in the meantime: https://reviews.llvm.org/D48964
Please integrate it into Rust's LLVM fork too, either by applying this Pull Request or by importing the commit from LLVM directly. That would finally enable full support for writing HermitCore applications in Rust :)

@alexcrichton alexcrichton merged commit f8053e8 into rust-lang:rust-llvm-release-7-0-0-v1 Aug 30, 2018
@alexcrichton
Copy link
Member

Ok great!

@cuviper
Copy link
Member

cuviper commented Aug 30, 2018

Shouldn't this have targeted rust-llvm-release-7-0-0-v2 now?

@stlankes
Copy link

stlankes commented Sep 3, 2018

Yes, this will be great!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants