I'm trying to build Google's ligjingle following the Getting started steps, and I've reached the "Building" section.
When I issue either
ninja -C out/Debug
or
ninja -C out/Release
I get the following error : I posted the output in pastebin too, if you prefer
ninja -C out/Debug
ninja: Entering directory `out/Debug'
[3/2606] LINK genmacro
FAILED: cc -Wl,-z,now -Wl,-z,relro -Wl,--fatal-warnings -pthread -Wl,-z,noexecstack -fPIC -B/home/nschoe/workspace/webrtc/jingle/trunk/third_party/binutils/Linux_x64/Release/bin -Wl,--disable-new-dtags -m64 -Wl,--icf=none -fuse-ld=gold -Wl,--gdb-index -o genmacro -Wl,--start-group obj/third_party/yasm/source/patched-yasm/tools/genmacro/genmacro.genmacro.o -Wl,--end-group
/home/nschoe/workspace/webrtc/jingle/trunk/third_party/binutils/Linux_x64/Release/bin/ld.gold: -plugin: unknown option
/home/nschoe/workspace/webrtc/jingle/trunk/third_party/binutils/Linux_x64/Release/bin/ld.gold: use the --help option for usage information
collect2: error: ld returned 1 exit status
[3/2606] CC obj/net/third_party/nss/ssl/libssl.sslauth.o
ninja: build stopped: subcommand failed.
I tried
ld.gold --help | grep "plugin"
and got :
--plugin PLUGIN Load a plugin library
--plugin-opt OPTION Pass an option to the plugin
So I suppose the error I'm getting is because somewhere in the code, ld.gold is called with -plugin xxx rather than --plugin xxx
I have been "playing" with grep -Hr and different combinations of "plugin" to try to find the problem, but so far I haven't found anything. I suppose it is hidden somewhere in a Makefile.
The problem is not that the
-pluginoption should be--plugin.ld.goldaccepts both options if it accepts either of them.But it only accepts either of them if the build of
binutilshas been configured with--enable-plugins. Documentation.When you run
ld.gold --help | grep "plugin"the output shows that--pluginis a recognized option.Therefore the problem appears to be this:-
/home/nschoe/workspace/webrtc/jingle/trunk/third_party/binutils/Linux_x64/Release/bin/ld.goldhas not been configured with--enable-pluginsWhen you run
ld.gold --help | grep "plugin"you are executing the firstld.goldthat is found on yourPATH. It is probably/usr/bin/ld.goldfrom your distro. You can find out by running:Anyhow, it isn't
/home/nschoe/workspace/webrtc/jingle/trunk/third_party/binutils/Linux_x64/Release/bin/ld.goldand it is anld.goldthat has been configured with--enable-pluginsIf you
cdinto/home/nschoe/workspace/webrtc/jingle/trunk/third_party/binutils/Linux_x64/Release/bin/and run:you will get:
To fix the problem the ideal solution is to rebuild
/home/nschoe/workspace/webrtc/jingle/trunk/third_party/binutilsas per that DocumentationIf you cannot rebuild these third party
binutilsfrom source then it will probably work if you just copy the systemld.golddetected bywhichover the one in the third partybinutils, or delete/rename the third party one and replace it with a symlink to the system one. There is an outside chance that either of the these hacks would cause you some obscure breakage.