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 https://blog.openmandriva.org/2016/06/openmandriva-lx-3-0-beta2-is-here/#comment-100404
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!
Thanks.

I’m afraid the claim is a bit like saying ‘We breathe’ and that gives us an advantage - see https://en.wikipedia.org/wiki/Link-time_optimization 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?

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

Use https://software.opensuse.org/search?

For example gstreamer;
https://software.opensuse.org/package/gstreamer

Follow Tumbleweed ‘official release’ takes me to https://build.opensuse.org/package/show?project=openSUSE%3AFactory&package=gstreamer

Then on the right standard and under x86_64 click succeeded takes me to;
https://build.opensuse.org/package/live_build_log/openSUSE:Factory/gstreamer/standard/x86_64

Hit download logfile takes me to;
https://build.opensuse.org/public/build/openSUSE:Factory/standard/x86_64/gstreamer/_log

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 https://build.opensuse.org/project/prjconf/openSUSE:Factory you will see Optfags options which are the defaults for %configure macro.