ld flag that gives ~40% startup time boost

John Richard Moser nigelenki at comcast.net
Thu Jun 22 22:07:49 BST 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1



James Laver wrote:
> Yes, yet when I saw that, I was thinking `that's an odd warning
> level`. A check of the docs for gcc later and I still can't find any
> note of it. Would you like to explain a touch more about how it
> affects things?
> 

- -Wl tells gcc to tell the linker to do something; so -Wl,-O1 tells gcc
to tell ld to use -O1.

gcc infile.c -o outfile

becomes (effectively) -->
gcc infile.c | ld -o outfile

Or some such.

gcc -Wl,-O1,--relax,-znow infile.c -o outfile

becomes (effectively) -->
gcc infile.c | ld -O1 --relax -znow -o outfile

And so on.

In short, rtfm for ld, not gcc.


> Thanks
> 
> On 22/06/06, John Richard Moser <nigelenki at comcast.net> wrote:
> 
> 
> James Laver wrote:
>> With gentoo it's largely in the users' hands. They can build the base
>> tarball with whatever switches they like, but by the time it comes
>> round to updates of the system, a lot of core things will be updated
>> and compiled with your global make.conf options.
> 
>> On a sidenote, I'm rather fond of -O3 where it works (sqlite, for
>> example), but i typically go -O2 for most of my compiles.
> 
> 
> -O3 and -O2 do nothing with -Wl,-O; it's a binary switch.
> 
>> Obviously start up speed is a big factor, it's what everyone whines
>> about, and I mean everyone.
> 
> I'm currently looking into other things like --relax (which... does
> what?  The man page is very vague) and anything else I can come across
> that's harmless.  It's hard to know exactly what the environment on the
> build server looks like though, since ubuntu doesn't seem to have this
> documented anywhere I can easily locate... (one of the devs told me he
> "thinks" -Wl,-O1 is in the ENV on the build server)
> 
> 
>> On 22/06/06, Scott James Remnant <scott at ubuntu.com> wrote:
>>> On Thu, 2006-06-22 at 15:51 -0400, John Richard Moser wrote:
> 
>>> > Does Ubuntu build everything with -Wl,-O1?  This was something that
>>> > Gentoo did as an optimization;
>>> >
>>> Yes, we do; Gentoo started doing it because we did.
> 
>>> Scott
>>> --
>>> Scott James Remnant
>>> scott at ubuntu.com
> 
> 
>>> 

>>
- --
ubuntu-devel mailing list
ubuntu-devel at lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel
>>

- --
All content of all messages exchanged herein are left in the
Public Domain, unless otherwise explicitly stated.

    Creative brains are a valuable, limited resource. They shouldn't be
    wasted on re-inventing the wheel when there are so many fascinating
    new problems waiting out there.
                                                 -- Eric Steven Raymond

    We will enslave their women, eat their children and rape their
    cattle!
                  -- Bosc, Evil alien overlord from the fifth dimension
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iQIVAwUBRJsGows1xW0HCTEFAQJM7g//ZNpp8d7kL8mV6+4EKzULHvaTW4022Ehh
GVwYty+M3skaCh0If5d9qwBXwDE1X1jjVaJc99Xv5pSACf2p0aJhyN3jyeIbnZGG
h60vgnld5eJLmIYW40cpGsM/jncDpbHjvBYzW5u+ms/ErQq6nOJepnOHInhQNVFG
gxK3M0Ru3a8LLDyPBymDfQZ3tuShVUD5goCItvS9mfovB/n4cfowhX9zFxZt7xYt
xw3XRwNt/RZ1iSf7F4I3scdU1tSAgR+MuwmBMS3x0i3WbH/nmzjJSpzKzK9Gu1H1
mfwe9giYC22OxZx1MZ4dXrTSZqwSoL6DVtbWELE/PAM6ytUVZIhs1l7gp0hQM1U8
O8nM3Pc0U0oiNhvPSFcdZkaqXTNUpTMXo+IFqs5q+mfhmB9ovbD5hXp60r6U36hI
5j458b8+LwuSovGI20XIqfx9OJby3lniVne3qwqJD5JP7fBFirhJIognBIUlflEP
YOMH1mS0xgAOHOL/53Y6sMwTXLgMfpw3ZPMo1l8tXXSzPz6lB8UW7RT7tntnk92B
/b1mSY40QHutqY2lUt211mCP503Cr1EuRgUsiD7JAIKp3/nAN5zKKsMTAPBV+tu4
8UDl0uPxa5GOZ7NJ5rYBFHFGupFokKxAycLyRxvmYbYE5BnR5B6eVikVcxMhx8KC
a58ml9FLbAc=
=rpBI
-----END PGP SIGNATURE-----



More information about the ubuntu-devel mailing list