Complete and isolated LLVM/musl toolchain
Asked Answered
S

2

13

What I'm trying to achieve is to compile an GNU independent and isolated LLVM toolchain using musl as clib.

Recently LLVM 4.0 has been released with lot's of new cool features, including production ready LLD, so also the linking step could be handled by LLVM.

More or less the stack is:

  • clang
  • llvm
  • lld
  • compiler-rt
  • libcxx
  • libcxxabi
  • musl

Following this, it is actually possible to do so without much patching or such (apart from compiling musl), but sadly, there is no good documentation about that.

Any suggestions?

Seymour answered 21/3, 2017 at 6:45 Comment(1)
This might be relevant: ellcc.orgPartiality
A
5

There is an example of using Clang + Musl together to compile "Hello World" in C here: https://github.com/njlr/portable-cxx

It only requires wget, tar and make to be installed. Clang and Musl are downloaded as part of the build process.

The key is to disable the usual include paths using -nostdinc and then add the Musl ones using -isystem.

Asur answered 10/2, 2019 at 19:41 Comment(0)
M
3

I was solving the same problem with my NGTC (Non-GNU toolchain) project. Please take a look at my build scripts and patches.

I used this toolchain to build a small Linux distro without any code from GNU project: nenuzhnix.

Morpho answered 19/12, 2018 at 10:14 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.