Linux/Compiler Options

< Linux
Revision as of 21:49, 8 January 2008 by Christopherblizzard (talk | contribs) (add overview section)

Overview

Compilers

Compiler + Options Notes
gcc 4.1.2 (-Os -freorder-blocks -fno-reorder-functions)

Baseline for testing. Very similar to our reference platform, which uses gcc 4.1.1. Those options above are the default options that we use for compiling.

This compiler version apparently does not inline even trivial functions.[1]

gcc 4.2.1 (-Os -freorder-blocks -fno-reorder-functions -finline-limit=50)

Note the use of -finline-limit=n. This will force many small functions and helpers to be inlined. (-O2 uses 600 as a value, for example.) On a 32-bit Linux build this results in:

codesize saving of 225kb (2%)
Ts win of 3%
Txul win of 18%
Tp2 win of about 25% (!)

gcc 4.2.1 (-O2 -freorder-blocks -fno-reorder-functions)

Comparing -O2 vs. -Os -finline-limit=50, not directly against baseline. [2]


Txul is unchanged
Ts improves 3%
Tp2 improves about 4%
however, codesize jumps 2,414kb (19%)

Distributions

Name

GCC Version

Last Build

Ubuntu 7.10

gcc version 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)

2.0.0.11+2nobinonly-0ubuntu0.7.10 (2008-01-07)

gcc flags
-Wall -W -Wno-unused -Wpointer-arith -Wcast-align -Wno-long-long -pedantic -g -Wall -O2 -pthread -pipe
g++ flags
-fno-rtti -fno-exceptions -Wall -Wconversion -Wpointer-arith -Wcast-align -Woverloaded-virtual -Wsynth -Wno-ctor-dtor-privacy -Wno-non-virtual-dtor -Wno-long-long -pedantic -g -Wall -O2 -fshort-wchar -pthread -pipe
configure flags --build=i486-linux-gnu --prefix=/usr '--includedir=${prefix}/include' '--mandir=${prefix}/share/man' '--infodir=${prefix}/share/info' --sysconfdir=/etc --localstatedir=/var '--libexecdir=${prefix}/lib/firefox' --disable-maintainer-mode --disable-dependency-tracking --srcdir=. --disable-debug --with-default-mozilla-five-home= --with-user-appdir=.mozilla --with-system-png=/usr --with-system-jpeg=/usr --with-system-zlib=/usr --with-system-nspr --with-system-nss --disable-composer --disable-debug --disable-elf-dynstr-gc --disable-gtktest --disable-installer --disable-ldap --disable-mailnews --disable-profilesharing --disable-strip --disable-strip-libs --disable-tests --disable-updater --disable-xprint --enable-application=browser --enable-canvas --enable-default-toolkit=gtk2 --enable-gnomevfs --enable-libthai '--enable-optimize=-pipe\ -w\ -O2\ -fno-strict-aliasing\ -g' --enable-pango --enable-postscript --enable-svg --enable-svg-renderer=cairo --enable-system-cairo --enable-mathml --enable-xft --enable-xinerama --enable-extensions=default --enable-single-profile --enable-system-myspell --with-distribution-id=com.ubuntu --enable-official-branding --enable-system-c

Fedora 8

gcc version 4.1.2 20070925 (Red Hat 4.1.2-33)

firefox-2.0.0.10-3.fc8 (2008-01-04)

gcc flags
-Wall -W -Wno-unused -Wpointer-arith -Wcast-align -Wno-long-long -pedantic -pthread -pipe
g++ flags
-fno-rtti -fno-exceptions -Wall -Wconversion -Wpointer-arith -Wcast-align -Woverloaded-virtual -Wsynth -Wno-ctor-dtor-privacy -Wno-non-virtual-dtor -Wno-long-long -pedantic -fshort-wchar -pthread -pipe
configure flags
--enable-application=browser --prefix=/usr --libdir=/usr/lib --with-system-nspr --with-system-nss --with-system-jpeg --with-system-zlib --with-system-png --with-pthreads --disable-tests --disable-debug --disable-installer '--enable-optimize=-Os -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables' --enable-xinerama --enable-default-toolkit=gtk2 --disable-xprint --disable-strip --enable-pango --enable-system-cairo --enable-svg --enable-canvas --enable-startup-notification --enable-official-branding

CentOS 5.1

gcc version 4.1.2 20070626 (Red Hat 4.1.2-14)

firefox-1.5.0.12-7.el5.centos (2008-01-07)

gcc flags
-Wall -W -Wno-unused -Wpointer-arith -Wcast-align -Wno-long-long -pedantic -pthread -pipe
g++ flags
-fno-rtti -fno-exceptions -Wall -Wconversion -Wpointer-arith -Wcast-align -Woverloaded-virtual -Wsynth -Wno-ctor-dtor-privacy -Wno-non-virtual-dtor -Wno-long-long -pedantic -fshort-wchar -pthread -pipe
configure flags
--enable-application=browser --prefix=/usr --libdir=/usr/lib --with-system-nspr --with-system-nss --with-system-jpeg --with-system-zlib --with-system-png --with-pthreads --disable-tests --disable-debug --disable-installer '--enable-optimize=-Os -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables' --enable-xinerama --enable-default-toolkit=gtk2 --disable-xprint --disable-strip --enable-pango --enable-system-cairo --enable-svg --enable-canvas --enable-official-branding