Commit 0ff4beda authored by Jeremy Bicha's avatar Jeremy Bicha

Set default optimization to -O2 instead of -O1

These rules are necessary because otherwise Ubuntu's ppc64el
will try to use -O3 but that will fail the build now
parent a541b458
......@@ -12,8 +12,12 @@ DEB_LDFLAGS_MAINT_APPEND += -Wl,-z,defs
DEB_LDFLAGS_MAINT_APPEND += -Wl,--no-as-needed
# Make the linker work a bit harder so dynamic loading can be done faster
  • @jbicha did you mean to drop this?

  • Yes. My understanding is that we were forcing -O1 everywhere. Now we force -O2.

    Did I misunderstand what that option does?

  • -O1 tells the compiler (cc1) to apply level 1 of compiler optimizations when compiling C code into object files.

    -Wl,-O1 tells the linker (ld) to apply level 1 of linker optimizations when linking object files into an executable or library - not the same.

    The compiler driver (gcc) responds to -O1 by passing it on to the actual compiler cc1, and responds to -Wl,foo (for any value of foo) by passing foo to the linker ld.

    Edited by Simon McVittie
  • This deleted part is the -O1 LDFLAG and not the CFLAG (which you edited below and may or may not be correct: I'd separately like to see a bug report about the gcc -O3 failure please) - see ld(1) or e.g. this LWN article for some information about what it does.

  • Um… I added -Wl,-O1 to many of our Debian GNOME packages years ago copying it from other packages. And then when I realized we were doing -O2 by default these days, I dropped -Wl,-O1 from almost all of them.

    I'll do a bit more reading on this, but maybe we'll end up adding Wl,-O1 to our standard LDFLAGS for all our packages…

  • Could you explain this email linked to from the end of the 1.0 section in the LWN article?

Please register or sign in to reply
# Ubuntu's ppc64el defaults to -O3 but that doesn't build now
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
include /usr/share/dpkg/
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment