How to pass argument to VC8 linker from .mozconfig
-
- Posts: 1264
- Joined: June 16th, 2004, 6:00 am
- Location: Exton, PA
How to pass argument to VC8 linker from .mozconfig
Does anybody know how to pass a flag to the VC8 linker during a compile? On my compiles, I use the /GL flag. Using /GL causes the VC8 linker to assume the /LTCG flag as well, but first it has to restart the linking process on every module. To speed the process up, the /LTCG flag can be sent to the linker in the first place so it doesn't have to start over after realizing that /GL was used with the compiler.
However, --enable-optimize only passes arguments to the compiler and not the linker, meaning the /LTCG flag is completely ignored. I've also tried mk_add_options LDFLAGS="/LTCG", but that apparently only works for unix-based linkers and not VC8.
So, that's where I'm at. Does anybody in here know how to pass the /LTCG argument to the VC8 linker via .mozconfig?
Thanks!
However, --enable-optimize only passes arguments to the compiler and not the linker, meaning the /LTCG flag is completely ignored. I've also tried mk_add_options LDFLAGS="/LTCG", but that apparently only works for unix-based linkers and not VC8.
So, that's where I'm at. Does anybody in here know how to pass the /LTCG argument to the VC8 linker via .mozconfig?
Thanks!
- auenf
- Posts: 709
- Joined: August 28th, 2004, 2:25 am
- Contact:
If this post isn't funny, you didn't read it correctly.
My Firefox (and sometimes Camino, Suite, Thunderbird and Sunbird) Builds (enabled with MNG/JNG support!)
My Firefox (and sometimes Camino, Suite, Thunderbird and Sunbird) Builds (enabled with MNG/JNG support!)
-
- Posts: 1264
- Joined: June 16th, 2004, 6:00 am
- Location: Exton, PA
- mahowi
- Posts: 569
- Joined: September 16th, 2005, 12:37 pm
- Location: Germany
- Contact:
Same problem here. It's because /LTCG should be passed to LIB.exe, not LINK.exe. And I couldn't find anything about passing options to LIB.
Firefox: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9pre) Gecko/2008052316 Firefox/3.0pre (mahowi) ID:2008052316
Thunderbird: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9pre) Gecko/2008052904 Thunderbird/3.0a2pre ID:2008052904
Thunderbird: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9pre) Gecko/2008052904 Thunderbird/3.0a2pre ID:2008052904
- mahowi
- Posts: 569
- Joined: September 16th, 2005, 12:37 pm
- Location: Germany
- Contact:
You could change line 5449 in configure (line 1275 in configure.in) from
to
Code: Select all
HOST_AR_FLAGS='-NOLOGO -OUT:"$@"'
Code: Select all
HOST_AR_FLAGS='-NOLOGO -LTCG -OUT:"$@"'
Firefox: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9pre) Gecko/2008052316 Firefox/3.0pre (mahowi) ID:2008052316
Thunderbird: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9pre) Gecko/2008052904 Thunderbird/3.0a2pre ID:2008052904
Thunderbird: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9pre) Gecko/2008052904 Thunderbird/3.0a2pre ID:2008052904
- Sephirot
- Posts: 247
- Joined: June 15th, 2004, 7:56 am
mahowi wrote:You could change line 5449 in configure (line 1275 in configure.in) fromtoCode: Select all
HOST_AR_FLAGS='-NOLOGO -OUT:"$@"'
Code: Select all
HOST_AR_FLAGS='-NOLOGO -LTCG -OUT:"$@"'
don't forget line 1692 of configure.in (line 6164 in configure)
p.s.
LIB does not use an environment variable.
Running LIB
Author of Bookmarks Menu Button, Autoclose Bookmark&History Folders and more
Mozilla/5.0 (Windows; U; Windows NT 6.1; de; rv:1.9.2.19pre) Gecko/20110701 Firefox/3.6.19pre <-- build with MS VC++ 2010 SP1 and PGO on Win 7 x64
Mozilla/5.0 (Windows; U; Windows NT 6.1; de; rv:1.9.2.19pre) Gecko/20110701 Firefox/3.6.19pre <-- build with MS VC++ 2010 SP1 and PGO on Win 7 x64
-
- Posts: 1264
- Joined: June 16th, 2004, 6:00 am
- Location: Exton, PA
SUCCESS!!!
Here's a diff (off the trunk) for anybody else who may want to enable LTCG by default.
http://www.ryanvm.net/files/ltcg.diff
Here's a diff (off the trunk) for anybody else who may want to enable LTCG by default.
http://www.ryanvm.net/files/ltcg.diff
-
- Posts: 1264
- Joined: June 16th, 2004, 6:00 am
- Location: Exton, PA
One more note, you'll still want to set the LINK environment variable to -LTCG (I do it in my mozset.cmd), as there are a few instances (such as when the actual browser app is being built) when link.exe is still being called. But I have now confirmed that the diff posted above along with the environment variable completely takes care of it
- bangbang023
- Posts: 1726
- Joined: July 7th, 2003, 12:23 am
- Location: Brooklyn, NY
- Contact:
- auenf
- Posts: 709
- Joined: August 28th, 2004, 2:25 am
- Contact:
hmm, didnt seem to shave any time of for me at all, and i do see some of the /ltcg messages too, just going to try a couple of things...
Enf...
Enf...
If this post isn't funny, you didn't read it correctly.
My Firefox (and sometimes Camino, Suite, Thunderbird and Sunbird) Builds (enabled with MNG/JNG support!)
My Firefox (and sometimes Camino, Suite, Thunderbird and Sunbird) Builds (enabled with MNG/JNG support!)
- BlueFyre
- Posts: 1985
- Joined: February 11th, 2004, 4:33 pm
Comparing my build logs and what not, it does not seem to shave any time on average...
It does how ever reduce the build log by 60KB almost... not sure if thats really just /LTCG though
Also I am seeing some of these warnings about /LTCG
Here's a list of files where I am seeing it
It does how ever reduce the build log by 60KB almost... not sure if thats really just /LTCG though
Also I am seeing some of these warnings about /LTCG
Here's a list of files where I am seeing it
Code: Select all
host_cppsetup.obj now.obj w95dllmain.obj prvrsion.obj plvrsion.obj plarena.obj plgetopt.obj plvrsion.obj host_jskwgen.obj jsapi.obj xpt_dump.obj xpt_link.obj xpidl.obj pldhash.obj nsXPComStub.obj host_mar.obj nsZipArchive.obj jsdebug.obj AccessibleMarshal.obj updater.obj CertReader.obj InstallCleanup.obj nsStubNotifier.obj nsinstall.obj nsztool.obj ren8dot3.obj ds32.obj GetShortPathName.obj regxpcom.obj xpcshell.obj maindll.obj StdAfx.obj nsBrowserApp.obj
If you notice this notice you may notice that this notice is not worth noticing.
- Sephirot
- Posts: 247
- Joined: June 15th, 2004, 7:56 am
BlueFyre wrote:Comparing my build logs and what not, it does not seem to shave any time on average...
It does how ever reduce the build log by 60KB almost... not sure if thats really just /LTCG though
Also I am seeing some of these warnings about /LTCG
Here's a list of files where I am seeing itCode: Select all
host_cppsetup.obj now.obj w95dllmain.obj prvrsion.obj plvrsion.obj plarena.obj plgetopt.obj plvrsion.obj host_jskwgen.obj jsapi.obj xpt_dump.obj xpt_link.obj xpidl.obj pldhash.obj nsXPComStub.obj host_mar.obj nsZipArchive.obj jsdebug.obj AccessibleMarshal.obj updater.obj CertReader.obj InstallCleanup.obj nsStubNotifier.obj nsinstall.obj nsztool.obj ren8dot3.obj ds32.obj GetShortPathName.obj regxpcom.obj xpcshell.obj maindll.obj StdAfx.obj nsBrowserApp.obj
same here ...
for /mozilla/nsprpub/ configure/configure.in need to be modified too.
http://lxr.mozilla.org/mozilla1.8/sourc ... re.in#1469
http://lxr.mozilla.org/mozilla1.8/sourc ... igure#3945
Author of Bookmarks Menu Button, Autoclose Bookmark&History Folders and more
Mozilla/5.0 (Windows; U; Windows NT 6.1; de; rv:1.9.2.19pre) Gecko/20110701 Firefox/3.6.19pre <-- build with MS VC++ 2010 SP1 and PGO on Win 7 x64
Mozilla/5.0 (Windows; U; Windows NT 6.1; de; rv:1.9.2.19pre) Gecko/20110701 Firefox/3.6.19pre <-- build with MS VC++ 2010 SP1 and PGO on Win 7 x64