Results 1 to 10 of 32

Thread: Using LLVM As The Compiler Within Fedora?

Hybrid View

  1. #1
    Join Date
    Jan 2007
    Posts
    15,629

    Default Using LLVM As The Compiler Within Fedora?

    Phoronix: Using LLVM As The Compiler Within Fedora?

    For those wanting to see another polarized discussion taking place within the Fedora camp, similar to the Fedora rolling-release discussion, drop by the mailing list...

    http://www.phoronix.com/vr.php?view=MTA1ODA

  2. #2
    Join Date
    Oct 2008
    Posts
    3,244

    Default Hmm, I'm not sure I see the controversy here. Maybe Phoronix could point it out?

    There's 5 responses to the original post, which doesn't even advocate a switch to llvm - just wondering what the current status of llvm support in linux is.

    The replies all basically come down to, "well, we'd have to have a reason to switch, like if it generated better code. and then someone would need to step up and do the work."

    That's supposed to be polarizing?

  3. #3
    Join Date
    Apr 2011
    Posts
    35

    Default

    I tried llvm/clang with several packages on my gentoo system and the result ist: there are many packages that rely on specific gcc behaviour or gcc specific extensions like this endless list: http://gcc.gnu.org/onlinedocs/gcc/C-Extensions.html
    So basically, many programs are not written in C anymore, but a GNU dialect. This means: those programs will not compile with clang without patching the usage of GNU extensions out of the code (or bringing those extensions to clang).
    And even if a package compiles, there is no guaranty, that it will work afterwards without segfaults or other crashes (I had this especially with mesa/drivers/X).
    This needs some enthusiasts (or linux developers) who compile everything with llvm/clang, test it and file bug reports to the projects, to llvm/clang and write patches to get rid of GNU extensions and bugs. Have fun :-)
    BSD compiles the system with clang afaik, so my guess is: they have a more standard C codebase, some compatibility patches in other cases and thus no problems with clang.

    and while there are many packages that can be compiled with clang, there are some essential packages that don't: glibc fails afair, the kernel does not support clang completely, Qt is not supported (changes with Qt 5 afaik), I had problems with X
    Last edited by mark_; 02-16-2012 at 04:45 AM.

  4. #4
    Join Date
    Oct 2009
    Posts
    845

    Default

    Quote Originally Posted by smitty3268 View Post
    There's 5 responses to the original post, which doesn't even advocate a switch to llvm - just wondering what the current status of llvm support in linux is.

    The replies all basically come down to, "well, we'd have to have a reason to switch, like if it generated better code. and then someone would need to step up and do the work."

    That's supposed to be polarizing?
    Micheal is a huge proponent of LLVM/Clang, so he inflates anything regarding it. Whenever he brings LLVM/Clang up it's described as 'wildly popular' etc, and GCC at best as 'popular' despite it being the de facto standard compiler toolchain which pretty much the entire open source world relies on while LLVM being mostly used as a JIT solution (although a VERY GOOD solution) and Clang hardly used at all as it's still very immature. He has an agenda in his compiler reporting (and I'm guessing the poor quality of his compiler benchmarks is also a result of tailoring them to present LLVM/Clang as good as possible) and it's sad, that said it's not as if there has ever been anything even remotely objective about Phoronix reporting. This 'article' is just another piece of that LLVM/Clang propaganda.

  5. #5

    Default

    What a dumb article. There's nothing that even suggests they'll switch to that apple's crap. Not only it's usually much slower then GCC, but it can't compile many packages. Afaik apple can't ship with the latest GCC, so what's left for them? Slower and less mature llvm.

  6. #6
    Join Date
    Feb 2008
    Location
    Linuxland
    Posts
    5,332

    Default

    write patches to get rid of GNU extensions
    The extensions are obviously useful, otherwise they wouldn't be used. I'm going to bet you'd have a hard time trying to convert some linux packages to more/worse code just to compile under clang.

  7. #7
    Join Date
    Apr 2011
    Posts
    35

    Default

    Quote Originally Posted by curaga View Post
    The extensions are obviously useful, otherwise they wouldn't be used. I'm going to bet you'd have a hard time trying to convert some linux packages to more/worse code just to compile under clang.
    I am not so sure of the usefulness; the extensions certainly make it easy for the programmer to implement something (and thus are useful from this point of view) but as we see now it complicates independance and portability, so there is a high price. As C is Turing complete, the extensions are not necessary and I personally would not want to pay that price of compiler dependence to make some coding techniques a bit easier. In fact, I never had a deeper look at the gcc extensions, always used standard C, never missed something and my code is portable.
    I agree that converting the affected linux packages is hard, but I see it as an improvement in code quality, not as more/worse code - where is the freedom in free software if I cannot choose my favorite compiler? ;-)
    I hope, Fedora succeeds.

  8. #8
    Join Date
    Oct 2008
    Posts
    902

    Default

    Quote Originally Posted by kraftman View Post
    it can't compile many packages
    That's the fault of the person coding the "package" not the compiler.

  9. #9
    Join Date
    Jun 2011
    Posts
    316

    Default

    Quote Originally Posted by yogi_berra View Post
    That's the fault of the person coding the "package" not the compiler.
    I'd disagree there.. The reason GCC has those extensions is because the standard is inadequate and it's not GCC's problem that the standard is inadequate..

    If you make a compiler that meets just the standards instead of making what people actually need, you've made something that's a whole heap of worthless.

    The assumption that the standards are good enough is obviously incorrect as if that was true then there would be no need for extensions.
    Last edited by Sidicas; 02-16-2012 at 04:57 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •