Announcement

Collapse
No announcement yet.

Compiling The Linux Kernel With LLVM's Clang Matured In 2022

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

  • Compiling The Linux Kernel With LLVM's Clang Matured In 2022

    Phoronix: Compiling The Linux Kernel With LLVM's Clang Matured In 2022

    Over the past few years it's become possible to compile the mainline Linux kernel with LLVM/Clang compared to the long-standing dependence on using the GCC compiler. While it's been possible for 3+ years to use the mainline Linux kernel and mainline Clang for building a working x86_64 and AArch64 kernel, the process and support continues to mature...

    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
    Compiled kernel for all of my life using GCC(gentoo fetishist), and last kernel or two with LLVM, did not notice difference, as user, what so ever.

    Comment


    • #3
      I just want faster clean compile times,

      Comment


      • #4
        Originally posted by Quackdoc View Post
        I just want faster clean compile times,
        I dont care for fast compiles. Or clean ones.
        I care for speed and stability of resulting kernel. I have 16 coresx2(hyperthreading). I throw hardware at the problem.
        So far did not notice any difference between GCC and CLANG

        Comment


        • #5
          Android kernels have only supported clang for the past few major versions. Glad to see support in the mainline improve.

          Comment


          • #6
            Originally posted by dimko View Post

            I dont care for fast compiles. Or clean ones.
            I care for speed and stability of resulting kernel. I have 16 coresx2(hyperthreading). I throw hardware at the problem.
            So far did not notice any difference between GCC and CLANG
            I mostly compile on my 2600 that does dual duty as my main work PC, that and I do clean builds fairly often, mostly because im an idiot and keep forgetting though. but regardless, clean compile increases are what I mainly care about right now.

            Comment


            • #7
              Good job, Nathan! As a user from the first hour of being able to build the Kernel with Clang, it has been quite a journey. And as I throw in Polly into the mix, this makes it even more challanging. Thanks to you, Nick and all the LLVM/Clang devs for making this a reality.

              Comment


              • #8
                Have there been any recent'ish benchmark comparisons between a GCC compiled kernel and a Clang/LLVM compiled one ?

                Comment


                • #9
                  ⬤​​ Specs

                  CPU: Ryzen 7 1700, 2.5GHz at 0.768V and 1.55GHz at 0.612V, VCORE SOC set to 0.684V
                  GPU: XFX RX 580 4GB being able to use 1150MHz core clock at 0.865V and 1750 MHz memory clock at 0.865V
                  Storage: 2TB 7200RPM 3.5" HDD​
                  Boot: Triple-boot: Windows 10, Ubuntu, Arch Linux

                  ⬤​ Still currently using GCC

                  Still compiling my minimized Linux Kernels with GCC and with initrd disabled, all things built-in, had to include firmware files from /lib/firmware which increased size of kernel (AMD GPU firmware files to make my XFX RX 580 4GB GPU work and USB wifi firmware file to make my USB wifi work) and got total size of kernel to 7.7MB.

                  ⬤​ Currently using "-Ofast", "-march=native", "-pipe" by editing the makefile when compiling Linux Kernel

                  -Ofast increases size of kernel
                  -march=native decreases size of kernel
                  Last edited by CHECK_12345; 26 February 2023, 02:22 AM.

                  Comment


                  • #10
                    Kernel built works also quite fine with AOCC 4 which is based on LLVM 14.0.6

                    Comment

                    Working...
                    X