-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #42 from hermit-os/rm-toolchain.sh
feat: remove `toolchain.sh` in favor of `Dockerfile`
- Loading branch information
Showing
4 changed files
with
152 additions
and
211 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,31 @@ | ||
# hermit-gcc | ||
|
||
This repository contains scripts to build the cross-compiler for the Rust-based library OS [HermitCore](https://github.com/hermit-os/libhermit-rs). | ||
This repository provides an OCI image ([`ghcr.io/hermit-os/hermit-gcc`], [`Dockerfile`]) containing the GCC cross-compiler for the [Hermit Operating System]. | ||
|
||
## Requirements | ||
[`ghcr.io/hermit-os/hermit-gcc`]: https://github.com/hermit-os/hermit-gcc/pkgs/container/hermit-gcc | ||
[`Dockerfile`]: Dockerfile | ||
[Hermit Operating System]: http://hermit-os.org | ||
|
||
The build process works currently only on **x86-based Linux** systems. The following software packets are required to build HermitCore's toolchain on a Linux system: | ||
## Available Components | ||
|
||
* Netwide Assembler (NASM) | ||
* GNU Make, GNU Binutils, cmake | ||
* Tools and libraries to build *linux*, *binutils* and *gcc* (e.g. flex, bison, MPFR library, ISL library, GMP library, MPC library) | ||
* Rust | ||
- [hermit-os/binutils](https://github.com/hermit-os/binutils) | ||
- [hermit-os/newlib](https://github.com/hermit-os/newlib) | ||
- [hermit-os/pthread-embedded](https://github.com/hermit-os/pthread-embedded) | ||
- [hermit-os/gcc](https://github.com/hermit-os/gcc) | ||
|
||
On Debian-based systems the packets can be installed by executing: | ||
``` | ||
sudo apt-get install cmake nasm libmpfr-dev libisl-dev libmpc-dev libgmp-dev flex bison | ||
``` | ||
|
||
Note: If issues arise during the build, try using requirements.sh to check the versions of the necessary packets and the configuration of the LD_LIBRARY_PATH (it should contain the MPFR library, GMP library and MPC library). | ||
## Usage | ||
|
||
## Building the HermitCore's toolchain | ||
To compile Hermit applications using this image, you need a built [Hermit kernel] (`libhermit.a`). | ||
You can then compile applications like this: | ||
|
||
To build the toolchain just call the script as follow: | ||
[Hermit kernel]: https://github.com/hermit-os/kernel | ||
|
||
```bash | ||
$ ./toolchain.sh x86_64-hermit /home/usr/hermit | ||
docker run --rm -v .:/mnt -w /mnt ghcr.io/hermit-os/hermit-gcc:latest x86_64-hermit-gcc -o app app.c libhermit.a | ||
``` | ||
|
||
The first argument of the script specifies the target architecture, where the second argument defines the path to the installation directory. | ||
To create the toolchain, write access to the installation directory is required. | ||
You can also use the image interactively: | ||
|
||
```bash | ||
docker run --rm -it -v .:/mnt -w /mnt ghcr.io/hermit-os/hermit-gcc:latest | ||
``` |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.