| 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 import("//build/config/nacl/config.gni") | 5 import("//build/config/nacl/config.gni") |
| 6 import("//build/config/sanitizers/sanitizers.gni") | 6 import("//build/config/sanitizers/sanitizers.gni") |
| 7 import("//build/toolchain/ccache.gni") | 7 import("//build/toolchain/ccache.gni") |
| 8 import("//build/toolchain/goma.gni") | 8 import("//build/toolchain/goma.gni") |
| 9 import("//build/toolchain/toolchain.gni") | 9 import("//build/toolchain/toolchain.gni") |
| 10 | 10 |
| (...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 278 sofile, | 278 sofile, |
| 279 tocfile, | 279 tocfile, |
| 280 ] | 280 ] |
| 281 if (sofile != unstripped_sofile) { | 281 if (sofile != unstripped_sofile) { |
| 282 outputs += [ unstripped_sofile ] | 282 outputs += [ unstripped_sofile ] |
| 283 } | 283 } |
| 284 link_output = sofile | 284 link_output = sofile |
| 285 depend_output = tocfile | 285 depend_output = tocfile |
| 286 } | 286 } |
| 287 | 287 |
| 288 tool("solink_module") { |
| 289 soname = "{{target_output_name}}{{output_extension}}" # e.g. "libfoo.so". |
| 290 sofile = "{{root_out_dir}}/$soname" # Possibly including toolchain dir. |
| 291 if (shlib_subdir != ".") { |
| 292 sofile = "{{root_out_dir}}/$shlib_subdir/$soname" |
| 293 } |
| 294 rspfile = sofile + ".rsp" |
| 295 |
| 296 unstripped_sofile = sofile |
| 297 if (defined(invoker.strip)) { |
| 298 unstripped_sofile = "{{root_out_dir}}/lib.unstripped/$soname" |
| 299 } |
| 300 |
| 301 command = "$ld -shared {{ldflags}} -o $unstripped_sofile -Wl,-soname=$sona
me @$rspfile" |
| 302 |
| 303 if (defined(invoker.strip)) { |
| 304 strip_command = |
| 305 "${invoker.strip} --strip-unneeded -o $sofile $unstripped_sofile" |
| 306 command += " && " + strip_command |
| 307 } |
| 308 rspfile_content = "-Wl,--whole-archive {{inputs}} {{solibs}} -Wl,--no-whol
e-archive $solink_libs_section_prefix {{libs}} $solink_libs_section_postfix" |
| 309 |
| 310 description = "SOLINK_MODULE $sofile" |
| 311 |
| 312 # Use this for {{output_extension}} expansions unless a target manually |
| 313 # overrides it (in which case {{output_extension}} will be what the target |
| 314 # specifies). |
| 315 default_output_extension = default_shlib_extension |
| 316 |
| 317 output_prefix = "lib" |
| 318 |
| 319 outputs = [ |
| 320 sofile, |
| 321 ] |
| 322 if (sofile != unstripped_sofile) { |
| 323 outputs += [ unstripped_sofile ] |
| 324 } |
| 325 } |
| 326 |
| 288 tool("link") { | 327 tool("link") { |
| 289 exename = "{{target_output_name}}{{output_extension}}" | 328 exename = "{{target_output_name}}{{output_extension}}" |
| 290 outfile = "{{root_out_dir}}/$exename" | 329 outfile = "{{root_out_dir}}/$exename" |
| 291 rspfile = "$outfile.rsp" | 330 rspfile = "$outfile.rsp" |
| 292 unstripped_outfile = outfile | 331 unstripped_outfile = outfile |
| 293 | 332 |
| 294 # Use this for {{output_extension}} expansions unless a target manually | 333 # Use this for {{output_extension}} expansions unless a target manually |
| 295 # overrides it (in which case {{output_extension}} will be what the target | 334 # overrides it (in which case {{output_extension}} will be what the target |
| 296 # specifies). | 335 # specifies). |
| 297 default_output_extension = default_executable_extension | 336 default_output_extension = default_executable_extension |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 398 nm = "${toolprefix}nm" | 437 nm = "${toolprefix}nm" |
| 399 | 438 |
| 400 forward_variables_from(invoker, | 439 forward_variables_from(invoker, |
| 401 [ | 440 [ |
| 402 "toolchain_cpu", | 441 "toolchain_cpu", |
| 403 "toolchain_os", | 442 "toolchain_os", |
| 404 "use_gold", | 443 "use_gold", |
| 405 ]) | 444 ]) |
| 406 } | 445 } |
| 407 } | 446 } |
| OLD | NEW |