[llvm-dev] Building LLVM so it does not need gcc libraries anymore

Meisam Fathi via llvm-dev llvm-dev at lists.llvm.org
Mon Jan 6 12:01:00 PST 2020

I am trying to bootstrap LLVM with LLVM so it does not depend on gcc
libraries anymore, but I had little success. Is it possible to do it? If
yes, what am I doing wrong?

I download the llvm-8.0.1 tar.gz and build these llvm projects:

I do two round of building: a bootstrap round, and a final round.

In the bootstrap round, I build llvm with clang-8 (downloaded form llvm
apt-repo for ubuntu). I link with lld and I set -I, and -L to /include and
/lib paths. I also set the rpath.

In the final round, I copy the llvm binaries from the last round to a new
and pristine system with nothing but the llvm source code on it (to make
sure I do not depend on gcc libraries). Here I try to build the source
code, one more time, with the binaries form the bootstrap round. But my
bootstrap compiler, among other things, depends on -lgcc, and -lgcc_s. I am
wondering if it is possible to build llvm/clang so it does not depend on
them. I fiddled with multiple flags and options, including -nostdinc,
-nostdinc++, -stdlib=libc++, etc, but with no success.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20200106/5e64e0fa/attachment.html>

More information about the llvm-dev mailing list