Announcement

Collapse
No announcement yet.

Using LLVM Clang To Compile The Linux Kernel Is Heating Up Again Thanks To Google

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Using LLVM Clang To Compile The Linux Kernel Is Heating Up Again Thanks To Google

    Phoronix: Using LLVM Clang To Compile The Linux Kernel Is Heating Up Again Thanks To Google

    Interest in building the mainline Linux kernel with LLVM Clang as an alternative to GCC seemed like it waned for several years, but in recent months that effort has been moving forward thanks to Google's involvement...

    Phoronix, Linux Hardware Reviews, Linux hardware benchmarks, Linux server benchmarks, Linux benchmarking, Desktop Linux, Linux performance, Open Source graphics, Linux How To, Ubuntu benchmarks, Ubuntu hardware, Phoronix Test Suite

  • #2
    why would you compile a Kernel with LLVM/Clang? seriously you must have rocks in ya head afaik LLVM/Clang lacks security . just read why Firefox in Fedora wasnt compiled with LLVM/Clang

    Comment


    • #3
      Originally posted by Anvil View Post
      why would you compile a Kernel with LLVM/Clang? seriously you must have rocks in ya head afaik LLVM/Clang lacks security . just read why Firefox in Fedora wasnt compiled with LLVM/Clang
      Nothing about that was due to security in my reading of the situation... the lack of optimisation stopped them temporarily and then it was sorted and a Clang build of 64 bit Firefox runs about 5% faster than a GCC build.

      Being able to build the kernel with Clang is a win - two compilers are better than one... With all big code bases it's good practice to not paint yourself into a corner by "building in" idiosyncrasies of a particular compiler be that GCC, MSVC, Clang, or what have you.

      Comment


      • #4
        Originally posted by Anvil View Post
        why would you compile a Kernel with LLVM/Clang? seriously you must have rocks in ya head afaik LLVM/Clang lacks security . just read why Firefox in Fedora wasnt compiled with LLVM/Clang
        As Happy Heyoka said, it had nothing to do with security. It was issues with Profile Guided Optimization (PGO) and Link Time Optimization (LTO) under GCC. The GCC team fixed those and they're back to using GCC on Fedora. They still use LLVM/clang on other platforms and as part of their overall build chain (e.g. static analysis is done with clang-tidy). Beyond that FreeBSD and macOS/iOS are build with LLVM/clang.

        Do you have anything you could reference that justifies your claim that it lacks security?

        Last edited by thesandbender; 05 February 2019, 01:06 AM.

        Comment


        • #5
          I really should dig up my musl/clang/libc++ (no GCC) gentoo stage4 again (or the variant someone made based on it with llvm binutil replacements). Spare time for playing is unfortunately limited but it would be very cool with an entirely self-hosting musl/clang/libc++ distro.

          Comment


          • #6
            This is a really interesting blog by someone working with GCC 8 and building Firefox as a test-case : http://hubicka.blogspot.com/2018/12/...and-clang.html

            He makes some claims about Clangs stack protection etc, but later one goes on to say maybe his use of build options with Clang were a bit naive... I'll just stand by my original statement above and say "two compilers are better than one"... I want both to be good.

            The way Clang has been structured is really nice and supports all sorts of new and interesting work-flows... GCC is old and trusted (and I know, there's a lot of people working to clean/change/improve it).

            There are few enough smart compiler people in the world that we can't really afford to start some kind of schism...

            Comment


            • #7
              Originally posted by Anvil View Post
              why would you compile a Kernel with LLVM/Clang? seriously you must have rocks in ya head afaik LLVM/Clang lacks security . just read why Firefox in Fedora wasnt compiled with LLVM/Clang
              Why would you not.

              Comment


              • #8
                GCC's error messages and formatting is so much good now a days that is purely due to competition from clang. The biggest issue is why in the hell should any open source project have build dependencies on a specific compiler?

                Comment


                • #9
                  Originally posted by babai View Post
                  GCC's error messages and formatting is so much good now a days that is purely due to competition from clang. The biggest issue is why in the hell should any open source project have build dependencies on a specific compiler?
                  Because Linux depends on GNU C language extensions. It's not just about depending on GCC for the sake of it. In that sense it's more like depending on a specific language and the argument becomes as relevant as saying "why should that project depend on C?"

                  Comment


                  • #10
                    Originally posted by AsuMagic View Post

                    Because Linux depends on GNU C language extensions. It's not just about depending on GCC for the sake of it. In that sense it's more like depending on a specific language and the argument becomes as relevant as saying "why should that project depend on C?"
                    The popular C language extensions are supported by Clang as well FYI.

                    Comment

                    Working...
                    X