Skip to content

CyberHive/musl-libc

Repository files navigation

Musl libc for Morello

Musl C library ported to Morello

Disclaimer

This repository contains work-in-progress port of Musl libc to Morello targeting purecap ABI. It is intended for experimental use.

Using this library

To build Morello Musl libc, use Morello toolchain, for example, Morello LLVM (see below). This toolchain will cross-compile Musl libc. This works in the same way on both AArch64 and x86 hosts.

Building consists of two stages: configure and build.

To configure for purecap target, run

CC=${MORELLO}/bin/clang ./configure --enable-morello --prefix=${PREFIX} \
     --target=aarch64-linux-musl_purecap

Here, ${MORELLO} is directory where Morello LLVM is installed and ${PREFIX} is where Musl will be installed. You may use this folder as sysroot for compiling and linking purecap Morello applications based on Musl.

To build and install, just run

make
make install

The following example demonstrates how to build a purecap Morello application and link it to this C library. We presume the code of the application is in the hello.c file.

Compile and link application:

${MORELLO_HOME}/bin/clang \
     -march=morello --target=aarch64-linux-musl_purecap \
     --sysroot ${PREFIX} hello.c -o hello -static

Running unit tests

TBD

Morello LLVM toolchain

See this document for details about how to build Morello LLVM toolchain from source: build-morello-clang.rst. It explains how to use the tools/build-morello.sh script.

Original README

Original Musl README file.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 120