Md Salman Ahmed via llvm-dev
2019-Feb-10 03:23 UTC
[llvm-dev] Compiling GNU C Library (glibc) with llvm
Hi All, I was trying to build GNU C Library (glibc implementation) using the clang compiler in a x86_64 Linux system. However, whenever I try to set the clang compiler as the compiler in the configure script of glibc, I am getting the following error. checking if clang is sufficient to build libc... no I did a quick research to see why does clang compiler is not sufficient to build the glibc implementation and found that the glibc implementation may have some target specific features that GCC only can support. But I am not getting what are the exact reasons behind this insufficiency. Can anybody please point me what are the exact reason behind this insufficiency. Some examples would also help. Any kind of help would be greatly appreciated. Thank you! -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20190209/d13da75a/attachment.html>
Brian Cain via llvm-dev
2019-Feb-10 03:31 UTC
[llvm-dev] Compiling GNU C Library (glibc) with llvm
I don't know for certain but it's likely due to gcc specific extensions that glibc capitalizes on that clang decided not to implement. Autoconf produces evidence of what it's testing for, though. It's probably testing a particular feature. Depending on your goal you might find it easier to deactivate the check and patch glibc to workaround this feature. On Sat, Feb 9, 2019, 9:23 PM Md Salman Ahmed via llvm-dev < llvm-dev at lists.llvm.org wrote:> Hi All, > > I was trying to build GNU C Library (glibc implementation) using the clang > compiler in a x86_64 Linux system. However, whenever I try to set the clang > compiler as the compiler in the configure script of glibc, I am getting the > following error. > > checking if clang is sufficient to build libc... no > > > I did a quick research to see why does clang compiler is not sufficient to > build the glibc implementation and found that the glibc implementation may > have some target specific features that GCC only can support. But I am not > getting what are the exact reasons behind this insufficiency. > > Can anybody please point me what are the exact reason behind this > insufficiency. Some examples would also help. Any kind of help would be > greatly appreciated. Thank you! > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20190209/8ff4dcc5/attachment.html>
blubee blubeeme via llvm-dev
2019-Feb-10 03:31 UTC
[llvm-dev] Compiling GNU C Library (glibc) with llvm
The main reason is that GLIBC uses non-standards compliant extensions for programmers convenience and LLVM want's to stick to the standards as much as possible. LLVM also uses some non-standard extensions. For example asm goto; the last time I checked Clang did not support ASM GOTO and so later linux kernels cannot be compiled. The general answer comes down to standards compliance; that's my understanding. Best, Owen On Sun, Feb 10, 2019 at 11:23 AM Md Salman Ahmed via llvm-dev < llvm-dev at lists.llvm.org> wrote:> Hi All, > > I was trying to build GNU C Library (glibc implementation) using the clang > compiler in a x86_64 Linux system. However, whenever I try to set the clang > compiler as the compiler in the configure script of glibc, I am getting the > following error. > > checking if clang is sufficient to build libc... no > > > I did a quick research to see why does clang compiler is not sufficient to > build the glibc implementation and found that the glibc implementation may > have some target specific features that GCC only can support. But I am not > getting what are the exact reasons behind this insufficiency. > > Can anybody please point me what are the exact reason behind this > insufficiency. Some examples would also help. Any kind of help would be > greatly appreciated. Thank you! > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20190210/10718728/attachment.html>
Kristina Brooks via llvm-dev
2019-Feb-10 07:34 UTC
[llvm-dev] Compiling GNU C Library (glibc) with llvm
There's a fork of glibc in the Sourceware repo that's known to work for at least somewhat being build-able with Clang/LLVM. Not sure how stable it is outside of static linking, I think with LTO and heavy optimizations you may stil get a lot of weird quirks. I think the name is "clangify" or something like that, it's up on Sourceware along with all other glibc forks. But again this is largely uncharted territory so be prepared to deal with a lot of weird ABI-level bugs, there is no official support for that fork from any party. I've used Clang to build glibc with dynamic linking successfully before but the test suite results aren't exactly promising and there's not a lot of effort going into glibc getting to work with Clang due to its licensing conditions, with some developers putting in more effort into permissive licensed libcs (ie. Musl and Bionic being two good examples). Contributing to those projects helps a lot more than untangling the mess that glibc codebase has turned into. I'll add the obvious disclaimer that this is a just personal opinion of mine etc. Thanks. On 10/02/2019 03:31, blubee blubeeme via llvm-dev wrote:> The main reason is that GLIBC uses non-standards compliant extensions for programmers convenience and LLVM want's to > stick to the standards as much as possible. > > LLVM also uses some non-standard extensions. For example asm goto; the last time I checked Clang did not support ASM > GOTO and so later linux kernels cannot be compiled. > > The general answer comes down to standards compliance; that's my understanding. > > Best, > Owen > > On Sun, Feb 10, 2019 at 11:23 AM Md Salman Ahmed via llvm-dev <llvm-dev at lists.llvm.org <mailto:llvm-dev at lists.llvm.org>> > wrote: > > Hi All, > > I was trying to build GNU C Library (glibc implementation) using the clang compiler in a x86_64 Linux system. > However, whenever I try to set the clang compiler as the compiler in the configure script of glibc, I am getting the > following error. > > checking if clang is sufficient to build libc... no > > > I did a quick research to see why does clang compiler is not sufficient to build the glibc implementation and found > that the glibc implementation may have some target specific features that GCC only can support. But I am not getting > what are the exact reasons behind this insufficiency. > > Can anybody please point me what are the exact reason behind this insufficiency. Some examples would also help. Any > kind of help would be greatly appreciated. Thank you! > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org <mailto:llvm-dev at lists.llvm.org> > https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev > > > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >-------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 3992 bytes Desc: S/MIME Cryptographic Signature URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20190210/cd2d2c50/attachment.bin>
David Blaikie via llvm-dev
2019-Feb-10 18:08 UTC
[llvm-dev] Compiling GNU C Library (glibc) with llvm
As luck would have it, asm goto was recently implemented in LLVM: http://llvm.org/viewvc/llvm-project?view=revision&revision=353563 (not sure if it's fully baked yet, that might just be the LLVM part & maybe there's some Clang plumbing still required) On Sat, Feb 9, 2019 at 7:32 PM blubee blubeeme via llvm-dev < llvm-dev at lists.llvm.org> wrote:> The main reason is that GLIBC uses non-standards compliant extensions for > programmers convenience and LLVM want's to stick to the standards as much > as possible. > > LLVM also uses some non-standard extensions. For example asm goto; the > last time I checked Clang did not support ASM GOTO and so later linux > kernels cannot be compiled. > > The general answer comes down to standards compliance; that's my > understanding. > > Best, > Owen > > On Sun, Feb 10, 2019 at 11:23 AM Md Salman Ahmed via llvm-dev < > llvm-dev at lists.llvm.org> wrote: > >> Hi All, >> >> I was trying to build GNU C Library (glibc implementation) using the >> clang compiler in a x86_64 Linux system. However, whenever I try to set the >> clang compiler as the compiler in the configure script of glibc, I am >> getting the following error. >> >> checking if clang is sufficient to build libc... no >> >> >> I did a quick research to see why does clang compiler is not sufficient >> to build the glibc implementation and found that the glibc implementation >> may have some target specific features that GCC only can support. But I am >> not getting what are the exact reasons behind this insufficiency. >> >> Can anybody please point me what are the exact reason behind this >> insufficiency. Some examples would also help. Any kind of help would be >> greatly appreciated. Thank you! >> _______________________________________________ >> LLVM Developers mailing list >> llvm-dev at lists.llvm.org >> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >> > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20190210/13cdf02c/attachment.html>
Seemingly Similar Threads
- Using LLD to link against third-party libraries? How?
- Using LLD to link against third-party libraries? How?
- Using LLD to link against third-party libraries? How?
- Using LLD to link against third-party libraries? How?
- bootstrapping llvm with advanced configuration