Does openSUSE use LTO for building packages?

Simply that is all I wanted to ask… :slight_smile:
Recently I was reading this blog post about OpenMandriva release
where it said that

Combined with the high level of optimisation used for both code and linking (by enabling LTO) used in its building, this gives the OpenMandriva desktop an unbelievably crisp response to operations on the KDE Plasma5 desktop which makes it a pleasure to use.

After which my curiosity drove me here to ask about my favorite distro!

I’m afraid the claim is a bit like saying ‘We breathe’ and that gives us an advantage - see where you will find it has been in GCC for some time (along with various other compilers).

Sure it is, but as far as i know it is rarely being used by default in distributions for building packages.

openSUSE is a community distribution; so people are free to make their own decisions within the packaging guidelines but, since LTO is included by default in most compilers, a contributor would have to make an explicit decision not to use it.

Thanks for the answer.
And is there any way that users can see what compiler options have been used for particular package?

Look on OBS at the package build log, else spec file and project config.


For example gstreamer;

Follow Tumbleweed ‘official release’ takes me to

Then on the right standard and under x86_64 click succeeded takes me to;

Hit download logfile takes me to;

Down the log I see;

  112s] + export 'CFLAGS=-fmessage-length=0 -grecord-gcc-switches -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -g -fno-strict-aliasing -fPIE'
  112s] + CFLAGS='-fmessage-length=0 -grecord-gcc-switches -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -g -fno-strict-aliasing -fPIE'
  112s] + export LDFLAGS=-pie
  112s] + LDFLAGS=-pie
  112s] + CFLAGS='-fmessage-length=0 -grecord-gcc-switches -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -g -fno-strict-aliasing -fPIE'
  112s] + export CFLAGS
  112s] + CXXFLAGS='-fmessage-length=0 -grecord-gcc-switches -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -g'
  112s] + export CXXFLAGS
  113s] + FFLAGS='-fmessage-length=0 -grecord-gcc-switches -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -g'
  113s] + export FFLAGS
  113s] + ./configure --host=x86_64-suse-linux-gnu --build=x86_64-suse-linux-gnu --program-prefix= --disable-dependency-tracking --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib64 --libexecdir=/usr/lib --localstatedir=/var --sharedstatedir=/usr/com --mandir=/usr/share/man --infodir=/usr/share/info --disable-dependency-tracking --with-ptp-helper-permissions=capabilities --enable-introspection --disable-static

If you check project config at you will see Optfags options which are the defaults for %configure macro.