| 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 value will be inherited in the toolchain below. | 5 # This value will be inherited in the toolchain below. |
| 6 concurrent_links = exec_script("get_concurrent_links.py", [], "value") | 6 concurrent_links = exec_script("get_concurrent_links.py", [], "value") |
| 7 | 7 |
| 8 # This template defines a toolchain for something that works like gcc | 8 # This template defines a toolchain for something that works like gcc |
| 9 # (including clang). | 9 # (including clang). |
| 10 # | 10 # |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 rspfile = sofile + ".rsp" | 131 rspfile = sofile + ".rsp" |
| 132 | 132 |
| 133 # These variables are not built into GN but are helpers that implement | 133 # These variables are not built into GN but are helpers that implement |
| 134 # (1) linking to produce a .so, (2) extracting the symbols from that file | 134 # (1) linking to produce a .so, (2) extracting the symbols from that file |
| 135 # to a temporary file, (3) if the temporary file has differences from the | 135 # to a temporary file, (3) if the temporary file has differences from the |
| 136 # existing .TOC file, overwrite it, otherwise, don't change it. | 136 # existing .TOC file, overwrite it, otherwise, don't change it. |
| 137 tocfile = sofile + ".TOC" | 137 tocfile = sofile + ".TOC" |
| 138 temporary_tocname = sofile + ".tmp" | 138 temporary_tocname = sofile + ".tmp" |
| 139 link_command = | 139 link_command = |
| 140 "$ld -shared {{ldflags}} -o $sofile -Wl,-soname=$soname @$rspfile" | 140 "$ld -shared {{ldflags}} -o $sofile -Wl,-soname=$soname @$rspfile" |
| 141 toc_command = "{ readelf -d $sofile | grep SONAME ; nm -gD -f p $soname |
cut -f1-2 -d' '; } > $temporary_tocname" | 141 toc_command = "{ readelf -d $sofile | grep SONAME ; nm -gD -f p $sofile |
cut -f1-2 -d' '; } > $temporary_tocname" |
| 142 replace_command = "if ! cmp -s $temporary_tocname $tocfile; then mv $tempo
rary_tocname $tocfile; fi" | 142 replace_command = "if ! cmp -s $temporary_tocname $tocfile; then mv $tempo
rary_tocname $tocfile; fi" |
| 143 | 143 |
| 144 command = "$link_command && $toc_command && $replace_command" | 144 command = "$link_command && $toc_command && $replace_command" |
| 145 if (defined(invoker.postsolink)) { | 145 if (defined(invoker.postsolink)) { |
| 146 command += " && " + invoker.postsolink | 146 command += " && " + invoker.postsolink |
| 147 } | 147 } |
| 148 rspfile_content = "-Wl,--whole-archive {{inputs}} {{solibs}} -Wl,--no-whol
e-archive $solink_libs_section_prefix {{libs}} $solink_libs_section_postfix" | 148 rspfile_content = "-Wl,--whole-archive {{inputs}} {{solibs}} -Wl,--no-whol
e-archive $solink_libs_section_prefix {{libs}} $solink_libs_section_postfix" |
| 149 | 149 |
| 150 description = "SOLINK $sofile" | 150 description = "SOLINK $sofile" |
| 151 | 151 |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 if (defined(invoker.is_clang)) { | 209 if (defined(invoker.is_clang)) { |
| 210 is_clang = invoker.is_clang | 210 is_clang = invoker.is_clang |
| 211 } | 211 } |
| 212 } | 212 } |
| 213 | 213 |
| 214 if (defined(invoker.deps)) { | 214 if (defined(invoker.deps)) { |
| 215 deps = invoker.deps | 215 deps = invoker.deps |
| 216 } | 216 } |
| 217 } | 217 } |
| 218 } | 218 } |
| OLD | NEW |