Index: build/toolchain/gcc_toolchain.gni |
diff --git a/build/toolchain/gcc_toolchain.gni b/build/toolchain/gcc_toolchain.gni |
index 8ca3e8a3fbd31691793f21773aa1b6f9bd3379ee..9d61196216ece06b9ae8771a5acd9194cd7606bf 100644 |
--- a/build/toolchain/gcc_toolchain.gni |
+++ b/build/toolchain/gcc_toolchain.gni |
@@ -22,6 +22,9 @@ |
# The contents of these strings, if specified, will be placed around |
# the libs section of the linker line. It allows one to inject libraries |
# at the beginning and end for all targets in a toolchain. |
+# - solink_libs_section_prefix |
+# - solink_libs_section_postfix |
+# Same as libs_section_{pre,post}fix except used for solink instead of link. |
# - deps |
# Just fowarded to the toolchain definition. |
# - is_clang |
@@ -57,6 +60,18 @@ template("gcc_toolchain") { |
libs_section_postfix = "" |
} |
+ if (defined(invoker.solink_libs_section_prefix)) { |
+ solink_libs_section_prefix = invoker.solink_libs_section_prefix |
+ } else { |
+ solink_libs_section_prefix = "" |
+ } |
+ |
+ if (defined(invoker.solink_libs_section_postfix)) { |
+ solink_libs_section_postfix = invoker.solink_libs_section_postfix |
+ } else { |
+ solink_libs_section_postfix = "" |
+ } |
+ |
# Make these apply to all tools below. |
lib_prefix = "-l" |
lib_dir_prefix="-L" |
@@ -82,7 +97,7 @@ 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" |
+ 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 $solink_libs_section_prefix \$libs $solink_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" |
jamesr
2014/07/29 02:13:25
d'oh, I flubbed this and since I didn't realize th
|
description = "SOLINK \$lib" |
rspfile = "\$out.rsp" |
rspfile_content = "-Wl,--whole-archive \$in \$solibs -Wl,--no-whole-archive \$libs" |