Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(75)

Issue 1690843002: gn: Add runtime_link_output to tool("solib") (Closed)

Created:
4 years, 10 months ago by Nico
Modified:
4 years, 10 months ago
Reviewers:
Dirk Pranke, brettw, scottmg
CC:
chromium-reviews, tfarina
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

gn: Add runtime_link_output to tool("solib") gn's tool("solink") has two settings for the output of the rule: link_output and depend_output. link_output is what targets depending on a shared_library are linked against, and depend_output is what is used for the ninja dependency. On POSIX, this is used to implement a component build optimization: If a shared library is linked but its public interface doesn't change, then it's not necessary to relink its downstream dependencies. To implement this, depend_output is set to a text file that contains a description of all public symbols of the shared library. The link step first links and then checks if the new public symbols are different from the old contents of the file, and only then does it overwrite the TOC file. This allows ninja's restat optimization to work. However, downstream dependencies need to link against the actual .so file on the link line `ld -o foo libinput.so`, so link_output needs to be set to the .so file. On Windows, link.exe writes a .lib and a .dll file when it creates a .dll file. The .lib is only written when needed with incremental links, so if depend_output is set to the .lib then the restat optimization works there too. And downstream dependencies also need to link to the .lib at link time, so in Windows both depend_output and link_output must be set the the .lib file. So far, so good. However, `gn desc runtime_deps` is used to print what files need to be copied to swarming bots to run an executable, and that currently looks at link_output. On POSIX that's ok, but on Windows that ends up copying the .lib instead of the .dll. This patch adds a third setting "runtime_link_output" which can be set to the output of the solink tool that must be present at runtime. It defaults to link_output (which does the right thing on POSIX), but it can be set to the .dll file to make `gn desc runtime_deps` do the right thing on Windows. This is needed to make swarming work in component builds on Windows. BUG=354261, 498033 R=dpranke@chromium.org, scottmg@chromium.org Committed: https://crrev.com/e3398c19aa9769ad99e97a9fabf29614d645a095 Cr-Commit-Position: refs/heads/master@{#374840}

Patch Set 1 #

Total comments: 1

Patch Set 2 : tests #

Patch Set 3 : docs #

Total comments: 2

Patch Set 4 : validate #

Total comments: 4

Patch Set 5 : comments #

Patch Set 6 : e #

Unified diffs Side-by-side diffs Delta from patch set Stats (+107 lines, -25 lines) Patch
M tools/gn/docs/reference.md View 1 2 3 4 5 2 chunks +13 lines, -10 lines 0 comments Download
M tools/gn/function_toolchain.cc View 1 2 3 4 5 5 chunks +33 lines, -14 lines 0 comments Download
M tools/gn/runtime_deps.cc View 1 chunk +1 line, -1 line 0 comments Download
M tools/gn/target.h View 2 chunks +4 lines, -0 lines 0 comments Download
M tools/gn/target.cc View 1 1 chunk +7 lines, -0 lines 0 comments Download
M tools/gn/target_unittest.cc View 1 1 chunk +40 lines, -0 lines 0 comments Download
M tools/gn/tool.h View 2 chunks +9 lines, -0 lines 0 comments Download

Messages

Total messages: 18 (7 generated)
Nico
brettw's out today, so one of you two needs to review this. (I'll address comments ...
4 years, 10 months ago (2016-02-11 01:55:14 UTC) #3
scottmg
"It depends to link_output" -> "It defaults to link_output" in the description. https://codereview.chromium.org/1690843002/diff/40001/tools/gn/target.cc File tools/gn/target.cc ...
4 years, 10 months ago (2016-02-11 02:06:28 UTC) #5
Nico
added some validator stuff in ps4 https://codereview.chromium.org/1690843002/diff/40001/tools/gn/target.cc File tools/gn/target.cc (right): https://codereview.chromium.org/1690843002/diff/40001/tools/gn/target.cc#newcode535 tools/gn/target.cc:535: runtime_link_output_file_ = link_output_file_; ...
4 years, 10 months ago (2016-02-11 02:09:03 UTC) #7
scottmg
k, lgtm
4 years, 10 months ago (2016-02-11 02:13:05 UTC) #9
Dirk Pranke
lgtm w/ a couple of nits. Also, please build this, and run `gn help --markdown ...
4 years, 10 months ago (2016-02-11 02:18:08 UTC) #10
Nico
all done, thanks! https://codereview.chromium.org/1690843002/diff/60001/tools/gn/function_toolchain.cc File tools/gn/function_toolchain.cc (right): https://codereview.chromium.org/1690843002/diff/60001/tools/gn/function_toolchain.cc#newcode516 tools/gn/function_toolchain.cc:516: " is not set, runtime_link_output defaults ...
4 years, 10 months ago (2016-02-11 02:23:41 UTC) #11
Nico
landed in https://chromium.googlesource.com/chromium/src/+/e3398c19aa9769ad99e97a9fabf29614d645a095 Rietveld again didn't get updated for some reason. Weird.
4 years, 10 months ago (2016-02-11 02:31:02 UTC) #12
Dirk Pranke
On 2016/02/11 02:31:02, Nico wrote: > landed in > https://chromium.googlesource.com/chromium/src/+/e3398c19aa9769ad99e97a9fabf29614d645a095 > > Rietveld again didn't ...
4 years, 10 months ago (2016-02-11 02:40:34 UTC) #14
Nico
No, `git cl land` (the previous patch set had green jobs, and I only changed ...
4 years, 10 months ago (2016-02-11 02:42:26 UTC) #15
Dirk Pranke
On 2016/02/11 02:42:26, Nico wrote: > No, `git cl land` (the previous patch set had ...
4 years, 10 months ago (2016-02-11 02:43:29 UTC) #16
commit-bot: I haz the power
4 years, 10 months ago (2016-02-16 22:34:10 UTC) #18
Message was sent while issue was closed.
Patchset 6 (id:??) landed as
https://crrev.com/e3398c19aa9769ad99e97a9fabf29614d645a095
Cr-Commit-Position: refs/heads/master@{#374840}

Powered by Google App Engine
This is Rietveld 408576698