This is an archive of the discontinued LLVM Phabricator instance.

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

Authored by ColinFinck on Jul 5 2018, 4:41 AM.

Details

Reviewers
echristo
Summary

This patch adds support to LLVM for writing HermitCore (https://hermitcore.org) ELF binaries.

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 ELFOSABI_STANDALONE to let the Linux ELF loader distinguish them from regular Unix/Linux binaries and load them using the HermitCore "proxy" tool.

Diff Detail

Event Timeline

ColinFinck created this revision.Jul 5 2018, 4:41 AM

Has ELFOSABI_HERMITCORE been officially allocated?

-eric

Has ELFOSABI_HERMITCORE been officially allocated?

I'm not aware of any official entity managing these ELFOSABI numbers, and have neither found references to one at the Binutils and LLVM websites.
The number has been in use for HermitCore since 2016 (https://github.com/hermitcore/binutils/commit/c80f41d4b7ab58892112864110456d37eda6a2e3). It also looks to me like previously added ABIs just took unallocated numbers without any official confirmation.

How are we going to proceed on this?

Has ELFOSABI_HERMITCORE been officially allocated?

I'm not aware of any official entity managing these ELFOSABI numbers, and have neither found references to one at the Binutils and LLVM websites.

Hmm.. I thought the gabi mailing list was.

The number has been in use for HermitCore since 2016 (https://github.com/hermitcore/binutils/commit/c80f41d4b7ab58892112864110456d37eda6a2e3). It also looks to me like previously added ABIs just took unallocated numbers without any official confirmation.

The number you have there is from your own fork :)

That said, coordinate patches between gnu binutils here. If you can post there with the request for the same number and cc me I think that'll work for ad hoc official confirmation.

Thanks!

-eric

Checking out the archives for this list might come in handy:

https://groups.google.com/forum/#!forum/generic-abi

which is what I was thinking of.

-eric

Thank you! Following your links, I have contacted registry@sco.com to request an official ELFOSABI_HERMIT constant to be added to http://www.sco.com/developers/gabi/latest/ch4.eheader.html
Will let you know and update the patch when it's official :)

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.

@echristo Is the updated patch alright?
Given that it doesn't allocate a new ELFOSABI constant, but uses an existing one, I hope that it can be merged soon.

echristo accepted this revision.Aug 22 2018, 9:26 AM

SGTM.

This revision is now accepted and ready to land.Aug 22 2018, 9:26 AM

Oh, you probably want to fix the commit message here.

ColinFinck edited the summary of this revision. (Show Details)Aug 23 2018, 12:05 AM

Oh, you probably want to fix the commit message here.

Done that! Thanks!

Going to guess you need someone to commit this for you.

Done in:

echristo@athyra ~/s/llvm> git svn dcommit
Committing to https://llvm.org/svn/llvm-project/llvm/trunk ...
M include/llvm/ADT/Triple.h
M include/llvm/MC/MCELFObjectWriter.h
M lib/Support/Triple.cpp
M unittests/ADT/TripleTest.cpp
Committed r340675

ColinFinck closed this revision.Feb 17 2021, 5:21 AM

This has landed a long time ago and can be closed.