Skip to content


Subversion checkout URL

You can clone with
Download ZIP
GYP can Generate Your Projects.
Python C++ C Shell Objective-C Objective-C++ Other
Branch: master

Do not remote duplicate entries from ldflags when generating ninja fi…

…les as it changes behavior

In some cases linker command line is required to contain duplicate entries. One example is to pass
-Wl,--whole-archive <libs> -Wl,--no-whole-archive. Removing repeating --no-whole-archive will result in incorrect behavior.

This happens e.g. when generating ninja files for io.js (./tools/ -f ninja). Without this  fix linkage would fail due to multiple definition of symbols from libopenssl and libv8_base. That's because node.gyp contains several places where ldflags are extended with manual flags, e.g. nodejs/io.js@9f36c0d . Without this CL contains

ldflags = -pthread -rdynamic -m64 -Wl,--whole-archive libopenssl.a $
    -Wl,--no-whole-archive -Wl,-z,noexecstack -Wl,--whole-archive libv8_base.a

Notice unbalanced --whole-archive. With the patch it becomes

ldflags = -pthread -rdynamic -m64 -Wl,--whole-archive libopenssl.a $
    -Wl,--no-whole-archive -Wl,-z,noexecstack -Wl,--whole-archive $
    libv8_base.a -Wl,--no-whole-archive -pthread


Review URL:

Patch from Yury Semikhatsky <>.
latest commit 25ed9ac4ac
@yury-s yury-s authored nico committed
Something went wrong with that request. Please try again.