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

Unified Diff: build/toolchain/gcc_toolchain.gni

Issue 372813002: Fix solink and add a postsolink hook (use the hook for android strip) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@gn-arm
Patch Set: Created 6 years, 5 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
« build/toolchain/android/BUILD.gn ('K') | « build/toolchain/android/BUILD.gn ('k') | no next file » | 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 9ad47a4900ee8b84f68f7aa90852602590e41189..6cbcfec824f954bc43e775441d6baad07123006d 100644
--- a/build/toolchain/gcc_toolchain.gni
+++ b/build/toolchain/gcc_toolchain.gni
@@ -80,10 +80,22 @@ template("gcc_toolchain") {
rspfile_content = "\$in"
}
tool("solink") {
- command = "if [ ! -e \$lib -o ! -e \${lib}.TOC ]; then $ld -shared \$ldflags -o \$lib -Wl,-soname=\$soname @\$rspfile && { readelf -d \${lib} | grep SONAME ; nm -gD -f p \${lib} | cut -f1-2 -d' '; } > \${lib}.TOC; else $ld -shared \$ldflags -o \$lib -Wl,-soname=\$soname -Wl,--whole-archive \$in \$solibs -Wl,--no-whole-archive $libs_section_prefix \$libs $libs_section_postfix && { readelf -d \${lib} | grep SONAME ; nm -gD -f p \${lib} | cut -f1-2 -d' '; } > \${lib}.tmp && if ! cmp -s \${lib}.tmp \${lib}.TOC; then mv \${lib}.tmp \${lib}.TOC ; fi; fi"
- description = "SOLINK \$lib"
rspfile = "\$out.rsp"
- rspfile_content = "-Wl,--whole-archive \$in \$solibs -Wl,--no-whole-archive \$libs"
+ rspfile_content = "-Wl,--whole-archive \$in \$solibs -Wl,--no-whole-archive $libs_section_prefix \$libs $libs_section_postfix"
+
+ # TODO(cjhopman): There needs to be a way for gn to correctly figure out
+ # the outputs of a solink command.
cjhopman 2014/07/07 23:00:50 Currently, it looks like gn doesn't know about the
brettw 2014/07/08 22:06:54 I don't know the plan for this either, something w
+
+ link_command = "$ld -shared \$ldflags -o \$lib -Wl,-soname=\$soname $rspfile_content"
+ toc_command = "{ readelf -d \${lib} | grep SONAME ; nm -gD -f p \${lib} | cut -f1-2 -d' '; } > \${lib}.tmp"
+ replace_command = "if ! cmp -s \${lib}.tmp \${lib}.TOC; then mv \${lib}.tmp \${lib}.TOC; fi"
+ command = "$link_command && $toc_command && $replace_command"
cjhopman 2014/07/07 23:00:50 This is slightly different from the previous versi
+
+ if (defined(invoker.postsolink)) {
brettw 2014/07/08 22:06:54 Can you add the extra stuff you added to the optio
+ command += " && " + invoker.postsolink
+ }
+
+ description = "SOLINK \$lib"
#pool = "link_pool"
restat = "1"
}
« build/toolchain/android/BUILD.gn ('K') | « build/toolchain/android/BUILD.gn ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698