Announcement

Collapse
No announcement yet.

Building The Linux Kernel With Clang Is Becoming Popular Again

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
    wizard69
    Senior Member

  • wizard69
    replied
    Originally posted by Redfoxmoon View Post
    "shaking out GCC'isms" you mean supporting a shit compiler half-implementing GCC, cute. Long live GCC and GNU C
    No he means supporting an excellent compiler that pays attention to kanguage standards.

    By the way if anything GCC has benefited hugely from LLVM/CLang. The development of this alternative has lead to a renewed interest in improving GCC and eliminating some of its limitations. You should be happy that CLang exists or you would most certainly be working with a shit compiler.

    Leave a comment:

  • cyring
    Phoronix Member

  • cyring
    replied
    No nested functions supported by Clang

    Leave a comment:

  • CrystalGamma
    Senior Member

  • CrystalGamma
    replied
    Originally posted by ALRBP View Post

    They mean respecting OPEN STANDARDS to allow PORTABILITY, two fundamental things for FOSS.
    No matter how good GCC is, good code should be portable across compilers as much as possible (and across OSs, but when some OS does not respect standards, I do not think you can blame developers for not supporting it; unfortunately, when this OS is the most used, developers tends to develop for it and forget standards...).
    I don't think Linux will ever stop using inline assembly, and I don't think C will standardize inline assembly either, so Linux will never be completely compliant C …

    Leave a comment:

  • ALRBP
    Senior Member

  • ALRBP
    replied
    Originally posted by Redfoxmoon View Post
    "shaking out GCC'isms" you mean supporting a shit compiler half-implementing GCC, cute. Long live GCC and GNU C
    They mean respecting OPEN STANDARDS to allow PORTABILITY, two fundamental things for FOSS.
    No matter how good GCC is, good code should be portable across compilers as much as possible (and across OSs, but when some OS does not respect standards, I do not think you can blame developers for not supporting it; unfortunately, when this OS is the most used, developers tends to develop for it and forget standards...).

    Leave a comment:

  • Aleksei
    Phoronix Member

  • Aleksei
    replied
    LLVMLinux logo was leet:
    hgf

    Leave a comment:

  • grigi
    Senior Member

  • grigi
    replied
    I have not done lots of LTO-ing with either. But I have had tons of bizzare broken releases that just disappeared when we changed back to GCC.
    And yes, I'm soured on LLVM.

    Leave a comment:

  • discordian
    Senior Member

  • discordian
    replied
    Originally posted by grigi View Post
    ICE is when the compiler generates invalid code? I could have the terminology wrong. That is the one I refered to.

    The undefined behaviour issue of LLVM is a big enough issue https://github.com/rust-lang/rust/issues/28728 that Cretonne is actually a thing now.

    I feel you may be confusing CLANG with LLVM, as CLANG is actually good. LLVM I have my doubts on. Read up on the issues that Unladen Swallow had with the LLVM core team.
    ICE: https://wiki.gentoo.org/wiki/Gcc-ICE-reporting-guide

    Sorry, but this a topic thats about clang / gcc, so I naturally assumed you where talking about this.

    The issue you linked seems more like the rust frontend should mark the code as having sideeffects. What Clang/LLVM does (and gcc doesnt) is typically pick the worst outcome for undefined behavior. eg. returning from a function that's marked as no_return will work in gcc, but either trap or corrupt the stack with clang (if any optimization is active).
    Contrary, clangs LTO just-works, wheres gcc has different quirks every release (gcc8 now often botches debugging information bad enough to crash gdb).

    Dont see why you can blame for LLVM when it works fine for other languages, most likely rust needs to fix there frontend and/or bug LLVM to add some features they need for rust.

    Leave a comment:

  • grigi
    Senior Member

  • grigi
    replied
    ICE is when the compiler generates invalid code? I could have the terminology wrong. That is the one I refered to.

    The undefined behaviour issue of LLVM is a big enough issue https://github.com/rust-lang/rust/issues/28728 that Cretonne is actually a thing now.

    I feel you may be confusing CLANG with LLVM, as CLANG is actually good. LLVM I have my doubts on. Read up on the issues that Unladen Swallow had with the LLVM core team.

    Leave a comment:


  • dungeon
    replied
    Building The Linux Kernel With Clang Is Becoming Popular Again
    It is not again, but no one care there about short term releases, so i would say - cos of annual building & longterm interests

    Distros shipping Clang built kernels:

    Android
    Pixel 2 - Oct 2017 (Clang)
    Pixel 3 - Oct 2018 (Clang+LTO+CFI)
    Expect a LOT more Android devices, soon.

    CrOS
    New devices with 4.19, 4.14, and 4.4 based kernels.
    Minie kernels, blobie drivers... you know and things works fine

    The Clang compiler has been quite popular with the ARM vendors and LLVM's more liberal license has also been attractive to them.
    More bloberal
    Last edited by dungeon; 21 November 2018, 08:06 AM.

    Leave a comment:

  • discordian
    Senior Member

  • discordian
    replied
    Originally posted by grigi View Post
    The real issue with LLVM is that when you turn the optimiser up, it seems to generate faulty code quite often. This is one of the drivers in the Rust world in an alternate no-undefined-behaviour compiler. I ran into it with my own projects where debug compliling would deliver a working executable, but when enabling basic optimisation it has an ICE.
    Not that GCC is invulnerable to it, they just seem to take ICEs much more seriously.
    Funny, I have the exact opposite experience. btw you refer to both faulty code and ICE (internal compiler errors which will stop compilation), it can be only one of them?

    Leave a comment:

Working...
X