| OLD | NEW |
| 1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 # This template defines a toolchain for something that works like gcc | 5 # This template defines a toolchain for something that works like gcc |
| 6 # (including clang). | 6 # (including clang). |
| 7 # | 7 # |
| 8 # It requires the following variables specifying the executables to run: | 8 # It requires the following variables specifying the executables to run: |
| 9 # - cc | 9 # - cc |
| 10 # - cxx | 10 # - cxx |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 rspfile = "\$out.rsp" | 99 rspfile = "\$out.rsp" |
| 100 rspfile_content = "\$in" | 100 rspfile_content = "\$in" |
| 101 } | 101 } |
| 102 tool("solink") { | 102 tool("solink") { |
| 103 rspfile = "\$out.rsp" | 103 rspfile = "\$out.rsp" |
| 104 rspfile_content = "-Wl,--whole-archive \$in \$solibs -Wl,--no-whole-archiv
e $solink_libs_section_prefix \$libs $solink_libs_section_postfix" | 104 rspfile_content = "-Wl,--whole-archive \$in \$solibs -Wl,--no-whole-archiv
e $solink_libs_section_prefix \$libs $solink_libs_section_postfix" |
| 105 | 105 |
| 106 # TODO(cjhopman): There needs to be a way for gn to correctly figure out | 106 # TODO(cjhopman): There needs to be a way for gn to correctly figure out |
| 107 # the outputs of a solink command. | 107 # the outputs of a solink command. |
| 108 | 108 |
| 109 link_command = "$ld -shared \$ldflags -o \$lib -Wl,-soname=\$soname $rspfi
le_content" | 109 link_command = "$ld -shared \$ldflags -o \$lib -Wl,-soname=\$soname @\$rsp
file" |
| 110 toc_command = "{ readelf -d \${lib} | grep SONAME ; nm -gD -f p \${lib} |
cut -f1-2 -d' '; } > \${lib}.tmp" | 110 toc_command = "{ readelf -d \${lib} | grep SONAME ; nm -gD -f p \${lib} |
cut -f1-2 -d' '; } > \${lib}.tmp" |
| 111 replace_command = "if ! cmp -s \${lib}.tmp \${lib}.TOC; then mv \${lib}.tm
p \${lib}.TOC; fi" | 111 replace_command = "if ! cmp -s \${lib}.tmp \${lib}.TOC; then mv \${lib}.tm
p \${lib}.TOC; fi" |
| 112 command = "$link_command && $toc_command && $replace_command" | 112 command = "$link_command && $toc_command && $replace_command" |
| 113 | 113 |
| 114 if (defined(invoker.postsolink)) { | 114 if (defined(invoker.postsolink)) { |
| 115 command += " && " + invoker.postsolink | 115 command += " && " + invoker.postsolink |
| 116 } | 116 } |
| 117 | 117 |
| 118 description = "SOLINK \$lib" | 118 description = "SOLINK \$lib" |
| 119 #pool = "link_pool" | 119 #pool = "link_pool" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 143 if (defined(invoker.is_clang)) { | 143 if (defined(invoker.is_clang)) { |
| 144 is_clang = invoker.is_clang | 144 is_clang = invoker.is_clang |
| 145 } | 145 } |
| 146 } | 146 } |
| 147 | 147 |
| 148 if (defined(invoker.deps)) { | 148 if (defined(invoker.deps)) { |
| 149 deps = invoker.deps | 149 deps = invoker.deps |
| 150 } | 150 } |
| 151 } | 151 } |
| 152 } | 152 } |
| OLD | NEW |