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" |
} |