Compiling glibc with clang/LLVM

Hey all,

I was wondering if clang/LLVM has support to compile glibc in its entirety? The only thing I could find of recent was this thread saying the only way it could really be done is to use the dragonegg plugin with gcc…

https://groups.google.com/forum/#!topic/llvm-dev/pmZYVNTrVYQ

[LLVMdev] clang/llvm with glibc

8 posts by 5 authors



Dave Buehmann





6/5/13

Other recipients: llv…@cs.uiuc.edu

This question has been asked occasionally with no positive responses.

Has anybody had success compiling glib with clang/llvm? If so, can you share any details?

If not, are there any good libc replacements with more complete functionality than newlib?

Thanks, dave



JF Bastien





6/5/13

Other recipients: db....@gmail.com, mcgr...@google.com, llv…@cs.uiuc.edu

Roland says the main blocker for now is support for nested functions, he thinks the rest should be straightforward.

There was apparently a post to the glibc mailing list about this.

- show quoted text -

- show quoted text -

_____________**
LLVM Developers mailing list
LLV…@cs.uiuc.edu http://llvm.cs.uiuc.edu
*http://lists.cs.uiuc.edu/*mailman/listinfo/llvmdev



Peter Collingbourne





6/5/13

Other recipients: db....@gmail.com, llv…@cs.uiuc.edu

- show quoted text -

It is (almost) possible to compile glibc using DragonEgg – there
are only a handful of patches required (for LLVM and DragonEgg),
most of which are now up for review.

It builds, and most of glibc’s test suite currently passes, except
for some tests that deal with floating point arithmetic, and some
tests which use very obscure GNU as features which I haven’t seen
used outside the glibc test suite.

Hopefully within a month or so everything should be upstreamed, but
if you’re itching for something that works now I can try to find some
time to send some WIP patches and instructions.

Thanks,

Hi Joshua,

uClibc can be compiled with clang. You can try to use it if it works for you.

Thanks,
Swarup.

+kcc

AFAIU there are recent improvements in building glibc with Clang. Kostya, what is the current status of building upstream glibc?

+kcc

AFAIU there are recent improvements in building glibc with Clang. Kostya,
what is the current status of building upstream glibc?

glibc still doesn't build with clang, but the number of reasons is becoming
less.
No ETA yet, I am doing this work in background.

--kcc