[LLVMdev] Compiling glibc with clang/LLVM

Sahoo, Swarup Kumar ssahoo2 at illinois.edu
Mon Sep 29 09:33:31 PDT 2014


Hi Joshua,

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

Thanks,
Swarup.

________________________________
From: llvmdev-bounces at cs.uiuc.edu [llvmdev-bounces at cs.uiuc.edu] on behalf of Joshua Tuttle [jtuttle at i-a-i.com]
Sent: Monday, September 29, 2014 9:28 AM
To: llvmdev at cs.uiuc.edu
Subject: [LLVMdev] 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... at 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.... at gmail.com, mcgr... at google.com, llv... at 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... at cs.uiuc.edu         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev



        Peter Collingbourne
6/5/13

Other recipients: db.... at gmail.com, llv... at 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,
--
Peter
- show quoted text -


        Reid Kleckner
6/5/13

Other recipients: j... at google.com, llv... at cs.uiuc.edu, mcgr... at google.com

Here's a clang bug I filed long ago for it that was closed wontfix:
http://llvm.org/bugs/show_bug.cgi?id=9206
- show quoted text -


        Dave Buehmann
6/6/13

Other recipients: llv... at cs.uiuc.edu

Thanks Peter,

I'll try that path and follow up with you for the patches when I get to that
point

Best, dave



--
View this message in context: http://llvm.1065342.n5.nabble.com/clang-llvm-with-glibc-tp58309p58336.html
Sent from the LLVM - Dev mailing list archive at Nabble.com.
- show quoted text -


        Rafael Espíndola
6/7/13

Other recipients: pe... at pcc.me.uk, llv... at cs.uiuc.edu

> 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.

This is amazing!

What are you guys doing about -fno-toplevel-reorder?

Cheers,
Rafael
- show quoted text -


        Peter Collingbourne
6/7/13

Other recipients: rafael.e... at gmail.com, llv... at cs.uiuc.edu

On Fri, Jun 07, 2013 at 11:48:03AM -0400, Rafael Espíndola wrote:
> > 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.
>
> This is amazing!
>
> What are you guys doing about -fno-toplevel-reorder?

I haven't done anything about this flag, to be honest.  From looking
at glibc's git HEAD it seems to currently be only used by two files
-- siglist.c and errlist.c -- and maybe I'm missing something but I
can't see any reason why either of these files now need it (in the
past these files seem to have contained some assembly but now
only contain straight C declarations).  It also seems to have been used
in the past by initfini.c but that file is now gone from glibc git.

Thanks,
--
Peter
- show quoted text -


        Rafael Espíndola
6/7/13

Other recipients: pe... at pcc.me.uk, llv... at cs.uiuc.edu

>> What are you guys doing about -fno-toplevel-reorder?
>
> I haven't done anything about this flag, to be honest.  From looking
> at glibc's git HEAD it seems to currently be only used by two files
> -- siglist.c and errlist.c -- and maybe I'm missing something but I
> can't see any reason why either of these files now need it (in the
> past these files seem to have contained some assembly but now
> only contain straight C declarations).  It also seems to have been used
> in the past by initfini.c but that file is now gone from glibc git.

I went looking in glibc's git and found
3add8e1353d62d77fdd9b4ca363cdf
e7006b0efb adding support for crti and
crtn written is assembly, which eventually replaced the old initfini.c
hack.

Congratulations to all those involved, this a much better state than I
would have dreamed possible some years ago.

Cheers,
Rafael
- show quoted text -





Is there any way to compile glibc only using clang as I have to be able to pass clang specific parameters for a pass to run on each file.



Thanks,

Josh



________________________________
This message and all attachments are PRIVATE, and contain information that is PROPRIETARY to Intelligent Automation, Inc. You are not authorized to transmit or otherwise disclose this message or any attachments to any third party whatsoever without the express written consent of Intelligent Automation, Inc. If you received this message in error or you are not willing to view this message or any attachments on a confidential basis, please immediately delete this email and any attachments and notify Intelligent Automation, Inc.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140929/241bd0fb/attachment.html>


More information about the llvm-dev mailing list