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

Unified Diff: build/toolchain/gcc_toolchain.gni

Issue 1409553003: [GN] Add solink_module tool on the Mac, Win, and GCC toolchains. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update win and gcc toolchains as well. Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « build/config/BUILDCONFIG.gn ('k') | build/toolchain/mac/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/toolchain/gcc_toolchain.gni
diff --git a/build/toolchain/gcc_toolchain.gni b/build/toolchain/gcc_toolchain.gni
index c4feb9732a985213a5bb24417a1a680908df3d2b..1afc7ddf239dfc7113e90eeea9a1461736352ff2 100644
--- a/build/toolchain/gcc_toolchain.gni
+++ b/build/toolchain/gcc_toolchain.gni
@@ -285,6 +285,45 @@ template("gcc_toolchain") {
depend_output = tocfile
}
+ tool("solink_module") {
+ soname = "{{target_output_name}}{{output_extension}}" # e.g. "libfoo.so".
+ sofile = "{{root_out_dir}}/$soname" # Possibly including toolchain dir.
+ if (shlib_subdir != ".") {
+ sofile = "{{root_out_dir}}/$shlib_subdir/$soname"
+ }
+ rspfile = sofile + ".rsp"
+
+ unstripped_sofile = sofile
+ if (defined(invoker.strip)) {
+ unstripped_sofile = "{{root_out_dir}}/lib.unstripped/$soname"
+ }
+
+ command = "$ld -shared {{ldflags}} -o $unstripped_sofile -Wl,-soname=$soname @$rspfile"
+
+ if (defined(invoker.strip)) {
+ strip_command =
+ "${invoker.strip} --strip-unneeded -o $sofile $unstripped_sofile"
+ command += " && " + strip_command
+ }
+ rspfile_content = "-Wl,--whole-archive {{inputs}} {{solibs}} -Wl,--no-whole-archive $solink_libs_section_prefix {{libs}} $solink_libs_section_postfix"
+
+ description = "SOLINK_MODULE $sofile"
+
+ # Use this for {{output_extension}} expansions unless a target manually
+ # overrides it (in which case {{output_extension}} will be what the target
+ # specifies).
+ default_output_extension = default_shlib_extension
+
+ output_prefix = "lib"
+
+ outputs = [
+ sofile,
+ ]
+ if (sofile != unstripped_sofile) {
+ outputs += [ unstripped_sofile ]
+ }
+ }
+
tool("link") {
exename = "{{target_output_name}}{{output_extension}}"
outfile = "{{root_out_dir}}/$exename"
« no previous file with comments | « build/config/BUILDCONFIG.gn ('k') | build/toolchain/mac/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698