Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
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/gyp_node.py -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 iojs.ninja 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

BUG=None
R=thakis@chromium.org

Review URL: https://codereview.chromium.org/1209553002.

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