Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 25

Thread: LLVM/Clang Can Build LibreOffice

  1. #11
    Join Date
    Jul 2008
    Location
    Greece
    Posts
    3,801

    Default

    From personal experience, code I wrote that didn't compile with Clang was my own fault. Clang was right not to accept it and GCC was wrong. These are mostly corner cases that are very easy to get wrong when writing code. For example, I didn't know that const objects should not have a compiler-generated default constructor. GCC would generate one just fine. Clang wouldn't because the standard says that user is responsible for providing it. (GCC got fixed now, but only after Clang showed that this was an issue.)

    This is why I now mainly use Clang while developing (I run it through GCC and Intel C++ now and then for brevity though.) It helps in producing more correct code by refusing to compile wrong code. The error messages are also much clearer than GCC's, where you already need to know in advance what the error means by having encountered it before.
    Last edited by RealNC; 10-23-2011 at 01:39 AM.

  2. #12
    Join Date
    Sep 2007
    Location
    Connecticut,USA
    Posts
    973

    Default

    I am sure someday Clang/LLVM will end up becoming the default compiler for the Linux kernel rather than GCC, once it matures. Even desktops like KDE/GNOME could be built with it as well as apps. If Clang does become the "wonder compiler" I am sure it'll become widely used

  3. #13
    Join Date
    Oct 2009
    Posts
    845

    Default

    Quote Originally Posted by rohcQaH View Post
    You may want to read the linked article. It's a valid binary, but it crashes during startup. Whether that's due to a bug in LLVM or a bug in LO (i.e. reliance on gcc specific behaviour) hasn't been researched yet.
    If the compiler doesn't throw errors and the binary fails to run the problem is most likely a bug in the compiler. Still, a while back LLVM/Clang couldn't even compile LibreOffice so there's definately been progress. I think this article should have been posted when it compiled and ran, I'll chalk it up to either Michael's overall entusiasm concerning LLVM/Clang or a lack of newsworthy material.

  4. #14
    Join Date
    Oct 2009
    Posts
    845

    Default

    Quote Originally Posted by yogi_berra View Post
    But can you end the mono-culture that exists around gcc that results in blog posts about patches that allow something else to build?
    What exactly are you referring to?

  5. #15
    Join Date
    Oct 2009
    Posts
    845

    Default

    Quote Originally Posted by RealNC View Post
    The error messages are also much clearer than GCC's, where you already need to know in advance what the error means by having encountered it before.
    Yes the error diagnostics are superior in Clang/LLVM, when it reaches a higher maturity/GCC compability I will most likely switch to it as my development compiler and use GCC primarily for performance/final builds as it generates faster code.

  6. #16

    Default

    Quote Originally Posted by XorEaxEax View Post
    If the compiler doesn't throw errors and the binary fails to run the problem is most likely a bug in the compiler.
    I think it's far more likely that LibreOffice invokes undefined or implementation-defined behaviour during startup, which is compiled in different ways by gcc and clang.

  7. #17
    Join Date
    Sep 2007
    Location
    Connecticut,USA
    Posts
    973

    Default

    Quote Originally Posted by AnonymousCoward View Post
    I think it's far more likely that LibreOffice invokes undefined or implementation-defined behaviour during startup, which is compiled in different ways by gcc and clang.
    A good suggestion is to get some feedback from the LO devs about this and maybe they can do some research to determine what went astray in the clang-compiled LO binary

  8. #18
    Join Date
    Apr 2011
    Posts
    405

    Default

    Well, if I ever need a compiler that produces binaries that don't work but produces them faster with less memory usage, I'll remember clang.

  9. #19

    Default

    Quote Originally Posted by DeepDayze View Post
    I am sure someday Clang/LLVM will end up becoming the default compiler for the Linux kernel rather than GCC, once it matures. Even desktops like KDE/GNOME could be built with it as well as apps. If Clang does become the "wonder compiler" I am sure it'll become widely used
    I wonder why people support Clang/llvm while there's Ekopath. It's probably more GCC compatible and beats cland/llvm in terms of performance badly. It also produces binaries that work. Btw. what do you mean by "wonder"?

  10. #20
    Join Date
    Nov 2008
    Location
    Germany
    Posts
    258

    Default

    I wouldn't trust anything that is under apple's hands and supervision (and generally most things that use a bsd license reek badly to me, but that's just a personal preference). Could be great software for all I care, but evil people have already achieved greatness in the past, that didn't cancel out their evilness though.

    Still, ideally you should code against a standard, not against a compiler, just as you should design web pages against a standard and not against a browser.

Posting Permissions

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