Coder Social home page Coder Social logo

l4re-toolchain's Introduction

L4Re native toolchain POC

These recipes build native L4Re cross compiling toolchains for amd64 and arm64. As examples, a simple game written in C++ (2048) and Python 3.8 is built with this cross toolchain. The example game uses CMake and has not been modified while some patches were necessary to get Python built.

How to build

First you have to clone the submodules:

$ git submodule update --init

You need the Bob Build Tool to build the project. The examples are built by

$ bob dev l4re/toolchain-amd64 -j
$ bob dev l4re/toolchain-arm64 -j

for the respective platforms. The -j option does a parallel build. You may want to add the --sandbox switch if the build fails. It does the build in an isolated sandbox environment to maximize reproducibility. Both options are optinal.

The results will contain the game executable (usr/bin/2048), Python (usr/bin/python3.8 and standard library) and the L4Re shared libraries (usr/lib/*.so). Include both usr/lib and usr/bin in the Makeconf.boot MODULE_SEARCH_PATH of an existing L4Re build tree, add an entry in your modules.list and start as usual:

entry 2048
roottask moe --init=rom/2048
module l4re
module 2048

Using the toolchain directly

To build just the toolchains do a

$ bob dev l4re/toolchain-amd64/devel::l4re::cross-toolchain/ -j
$ bob dev l4re/toolchain-arm64/devel::l4re::cross-toolchain/ -j

The results will contain the cross-compiler (usr/bin/aarch64-l4re-gcc resp. usr/bin/x86_64-l4re-gcc) together with their sysroot (usr/sysroots/aarch64-l4re resp. usr/sysroots/x86_64-l4re). The sysroot has the headers, static and shared libraries to compile and link with. The cross compiler will find the sysroot automatically (i.e. no need to specify --sysroot).

The toolchain can be copied to other hosts. It's file system position independent and should run on any contemporary x86_64 Linux distribution.

l4re-toolchain's People

Contributors

jkloetzke avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.