[linux] identical code folding and LINKER_SUPPORTS_ICF

39 views
Skip to first unread message

Evan Martin

unread,
May 4, 2011, 5:22:32 PM5/4/11
to chromium-dev
I landed some changes to make us use the identical-code-folding flag
if your linker supports it.
Currently only gold supports this, not GNU ld. It saves around 500kb
off our binaries.

If you encounter an error like this:
NameError: name 'LINKER_SUPPORTS_ICF' is not defined while evaluating
condition 'LINKER_SUPPORTS_ICF==1' in
/usr/local/google/chrome/src/build/all.gyp while trying to load
src/build/all.gyp

You need to
1) verify you have the correct version of gyp
2) verify you don't have GYP_GENERATOR=scons in your environment (I
doubt that build works anyway)

Antony Sargent

unread,
May 4, 2011, 5:28:12 PM5/4/11
to ev...@chromium.org, chromium-dev
I just updated to the tip of tree and started hitting this error. I do not have  GYP_GENERATOR=scons in my environment. How do I verify whether I have the right version of gyp as you mention in (1)? 



--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
   http://groups.google.com/a/chromium.org/group/chromium-dev

Evan Martin

unread,
May 4, 2011, 5:40:46 PM5/4/11
to Antony Sargent, chromium-dev
Current version is 917:
$ grep 'gyp.*trunk' DEPS
(Var("googlecode_url") % "gyp") + "/trunk@917",

To see your current version:
$ svn info tools/gyp/ | grep Revision

Fred Akalin

unread,
May 4, 2011, 5:50:32 PM5/4/11
to ev...@chromium.org, Antony Sargent, chromium-dev
I ran into the same problem. It turned out it was because I had
GYP_GENERATORS=ninja. Removing that fixed it.

Fred Akalin

unread,
May 4, 2011, 6:03:22 PM5/4/11
to ev...@chromium.org, Antony Sargent, chromium-dev
Evan pointed me to
http://www.corp.google.com/~evanm/projects/chrome/ninja/ which has
updated instructions got Chrome with ninja, which works with
LINKER_SUPPORTS_ICF.

Evan Martin

unread,
May 4, 2011, 6:05:46 PM5/4/11
to Fred Akalin, Antony Sargent, chromium-dev
Sorry, I should publish real instructions on this. I wanted to fix
some of the remaining bugs first...
https://github.com/martine/ninja/issues/18 in particular.

Antony Sargent

unread,
May 4, 2011, 6:10:39 PM5/4/11
to Fred Akalin, ev...@chromium.org, chromium-dev
Ah, that fixed things for me. Thanks Evan & Fred!
Reply all
Reply to author
Forward
0 new messages