Skip to content
This repository has been archived by the owner on Apr 21, 2023. It is now read-only.

Link error on "html_minifier_main" using GCC 4.9.0 + [Gold] Linker (binutils = release.binutils- #915

GoogleCodeExporter opened this issue Apr 6, 2015 · 2 comments


Copy link

Actual compile / link error is:


LINK(target) out/Release/html_minifier_main
comments_filter.o: In function 
tringPiece<std::string> const&) const':

undefined reference to 
const&, bool) const'

undefined reference to 
const&, bool) const'

collect2: error: ld returned 1 exit status
make[1]: *** [out/Release/html_minifier_main] Error 1


Basically, the symbol for 'net_instaweb::FastWildcardGroup::Match' is not 
found. The required library for this is in the "libpagespeed_base.a" - and not 
the already included "libpagespeed_base_core.a".

The solution (I found and used), is to patch both files; 
src/net/instaweb/ and 
src/net/instaweb/, and add the 
library -> libpagespeed_base.a.

1) ~/mod_pagespeed/src/net/instaweb/

Add: $(obj).target/pagespeed/libpagespeed_base.a
     ^---------------- [ADD ] -----------------^


Mod: "$(obj).$(TOOLSET)/pagespeed/libpagespeed_base.a" 
     ^------------------- [ADD ] -------------------^

The above patch is to be done just after the "gclient runhooks" stage (or 
gclient sync --force --jobs=1).

I know patching the automatically "gyp" generated *.mk (make files) is a bit 
'backward', however - I have not (yet) traced back to what build *.gyp file to 
patch to achieve this change. I have attached the patch I used here:


The 'Gold' Linker (HJ Lu's Linux binutils at ) is known to be more critical 
about unresolved
symbols using indirect dependent shared libraries. See for some history.

It seems that the 'Gold' linker gold was not intended to be a precise 
replacement for the GNU linker...

Quoting a gold linker developers here: "What gold requires is that you 
enumerate all direct dependencies of the program itself.  If your program calls 
foo(), then you must explicitly link against some library which defines foo().  
The GNU linker permits foo() to be defined indirectly, by a dependency of some 
shared library which you do explicitly link against.  gold does not search 
those indirect dependencies for symbol definitions."

Original issue reported on by peterbowey on 24 Mar 2014 at 2:34


Copy link

Thanks for the report. Actually it's supposed to be buildable with base_core 
alone, that's kinda the point of building. It's odd that I am not seeing the 
It sounds like RemoveCommentsFilter::OptionsImpl needs to move out someplace, 

Original comment by on 24 Mar 2014 at 5:02

Copy link

Should be fixed in r3878. Thanks again for reporting this!

Original comment by on 24 Mar 2014 at 7:26

  • Changed state: Fixed

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
None yet

No branches or pull requests

1 participant