Announcement

Collapse
No announcement yet.

Linux Kernel Patches Add Clang LTO Support

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

  • Linux Kernel Patches Add Clang LTO Support

    Phoronix: Linux Kernel Patches Add Clang LTO Support

    Patches by an Android security team member at Google allow the Linux kernel to be compiled with Clang using Link Time Optimizations (LTO)...

    http://www.phoronix.com/scan.php?pag...rnel-Clang-LTO

  • #2
    I compiled different versions of LTO (last 4.11).
    https://github.com/andikleen/linux-misc

    Maybe in the synthetic benchmark of the kernel you can see the difference. In everyday use - none.
    Yes you can see the difference in kernel size, good on embedded systems.

    Comment


    • #3
      Have they used LTO with GCC?

      I can imagine it could reveal a lot of issues. Normally function calls into other object files works as a memory barrier. Once they can be inlined across object files with LTO, a lot more variables might need to be declared atomic or memory barriers added.

      Comment


      • #4
        About time.

        Comment


        • #5
          Originally posted by latalante View Post
          I compiled different versions of LTO (last 4.11).
          https://github.com/andikleen/linux-misc

          Maybe in the synthetic benchmark of the kernel you can see the difference. In everyday use - none.
          Yes you can see the difference in kernel size, good on embedded systems.
          Last time I checked this was the main argument against mainlining LTO patches (for gcc), LTO doesn't really improve performance (for kernel), merely reduces memory footprint and breaks out of tree module compatibility (strips external symbols that aren't provably in use at compile time).

          Comment


          • #6
            As far as I can see, it seems like mainline can be compiled with clang from chromium:
            https://github.com/ramosian-glider/clang-kernel-build

            Also for the LTO - does it support the fast ThinLTO? This was otherwise a big argument against LTO with GCC - it just takes forever to compile with LTO.

            Comment


            • #7
              Originally posted by tpruzina View Post

              Last time I checked this was the main argument against mainlining LTO patches (for gcc), LTO doesn't really improve performance (for kernel), merely reduces memory footprint and breaks out of tree module compatibility (strips external symbols that aren't provably in use at compile time).
              You don't have to have the second part. Though it is easier when symbols are properly marked exported or internal.

              Comment


              • #8
                Originally posted by tpruzina View Post

                Last time I checked this was the main argument against mainlining LTO patches (for gcc), LTO doesn't really improve performance (for kernel), merely reduces memory footprint and breaks out of tree module compatibility (strips external symbols that aren't provably in use at compile time).
                Quite irrelevant for embedded use. I'd assume the one who's in charge of the kernel has disabled module support anyways.

                Comment

                Working...
                X