Announcement

Collapse
No announcement yet.

Ubuntu 21.04 To Turn On LTO Optimizations For Its Packages

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

  • Ubuntu 21.04 To Turn On LTO Optimizations For Its Packages

    Phoronix: Ubuntu 21.04 To Turn On LTO Optimizations For Its Packages

    On top of aiming to use Wayland by default, another high profile change being worked on for this spring's release of Ubuntu 21.04 is using link-time optimizations (LTO) for all 64-bit package builds...

    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
    Wow, that would be amazing, especially after all the performance slowdowns caused by all the security mitigations.

    Comment


    • #3
      I wonder when are we gonna see Arch will do the same.

      Comment


      • #4
        Unfortunately the Linux Kernel still hasn't GCC LTO support, at least the support for Clang is getting very close now (even though x86_64 will take some more time). I also hope that the distributions could make use of PGO where it is easy to sample the profiles, e.g. for the compilers itself as LTO + PGO will show more benefits.

        Comment


        • #5
          You forgot to mention a lot of applications, like Wine, don't even build with LTO, or cause segfaults in the compiler when linking if you use workarounds.

          It's not just unix apps either. I tried building DXVK with LTO (MinGW obviously), it builds but it doesn't work properly anymore. I don't know what the fuck could they possibly be doing to always mess it up.

          Comment


          • #6
            Originally posted by Weasel View Post
            You forgot to mention a lot of applications, like Wine, don't even build with LTO, or cause segfaults in the compiler when linking if you use workarounds.
            As SUSE, and later Fedora, demonstrated with their LTO by default work, there are packages that require to be exempted out of LTO for now. In some cases the code itself needs to be modified due to non-optimal language constructs or usage, and there have been some compiler issues. In both cases there has been work with the upstream projects (the app itself, or gcc/llvm) to resolve those issues. And the reality is that the way you find those issues is try to use LTO everywhere. In the case of Canonical, I expect that their workload will be manageable now that others have plowed the road, but, as you say, there will be new cases where LTO will need to be disabled.

            Comment


            • #7
              Impossibru. I thought people kept saying that Ubuntu wanted to provide a rock-solid experience, which is why performance wasn't important to them? So why the change of heart?

              Comment


              • #8
                Originally posted by Weasel View Post
                You forgot to mention a lot of applications, like Wine, don't even build with LTO, or cause segfaults in the compiler when linking if you use workarounds.

                It's not just unix apps either. I tried building DXVK with LTO (MinGW obviously), it builds but it doesn't work properly anymore. I don't know what the fuck could they possibly be doing to always mess it up.
                I've used Wine with LTO before, so if it doesn't work for you, then please report a bug.

                Comment


                • #9
                  I just hope they will fix GStreamer on aarch64 someday...

                  Hello! I found that totem-video-thumbnailer is broken on aarch64. It fail with following error: (totem-video-thumbnailer:12136): GStreamer-WARNING **: 00:43:52.740: Failed to load plugin '/usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstlibav.so': /lib/aarch64-linux-gnu/libgomp.so.1: cannot allocate memory in static TLS block (totem-video-thumbnailer:12136): GStreamer-WARNING **: 00:43:52.764: Failed to load plugin '/usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstlibav.so': /lib/aarch64-linu...

                  Comment


                  • #10
                    As with almost every compiler optimization feature, the programs that break with LTO are the ones that were already broken.

                    In the past programmers hid their C undefined behavior by putting into a separate module. Then the compiler had to use the common shared ABI to call across the modules.

                    With LTO that is no longer true. Watch out, if the code assumes stack or register layout, or violates strict aliasing with int and float casts, or tries to check pointers for NULL... LTO is coming for you!

                    Comment

                    Working...
                    X