 Chromium Code Reviews
 Chromium Code Reviews Issue 2815453004:
  For building v8 using gn on aix_ppc64, linux_s390x and linux_ppc64.  (Closed)
    
  
    Issue 2815453004:
  For building v8 using gn on aix_ppc64, linux_s390x and linux_ppc64.  (Closed) 
  | 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/android/config.gni") | 5 import("//build/config/android/config.gni") | 
| 6 import("//build/config/clang/clang.gni") | 6 import("//build/config/clang/clang.gni") | 
| 7 import("//build/config/nacl/config.gni") | 7 import("//build/config/nacl/config.gni") | 
| 8 import("//build/config/sanitizers/sanitizers.gni") | 8 import("//build/config/sanitizers/sanitizers.gni") | 
| 9 import("//build/config/v8_target_cpu.gni") | 9 import("//build/config/v8_target_cpu.gni") | 
| 10 import("//build/toolchain/cc_wrapper.gni") | 10 import("//build/toolchain/cc_wrapper.gni") | 
| (...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 308 tool("alink") { | 308 tool("alink") { | 
| 309 rspfile = "{{output}}.rsp" | 309 rspfile = "{{output}}.rsp" | 
| 310 whitelist_flag = " " | 310 whitelist_flag = " " | 
| 311 if (enable_resource_whitelist_generation) { | 311 if (enable_resource_whitelist_generation) { | 
| 312 whitelist_flag = " --resource-whitelist=\"{{output}}.whitelist\"" | 312 whitelist_flag = " --resource-whitelist=\"{{output}}.whitelist\"" | 
| 313 } | 313 } | 
| 314 | 314 | 
| 315 # This needs a Python script to avoid using simple sh features in this | 315 # This needs a Python script to avoid using simple sh features in this | 
| 316 # command, in case the host does not use a POSIX shell (e.g. compiling | 316 # command, in case the host does not use a POSIX shell (e.g. compiling | 
| 317 # POSIX-like toolchains such as NaCl on Windows). | 317 # POSIX-like toolchains such as NaCl on Windows). | 
| 318 ar_wrapper = | 318 if (current_os == "aix") { | 
| 319 rebase_path("//build/toolchain/gcc_ar_wrapper.py", root_build_dir) | 319 # We use a different wrapper and slightly different command for AIX. | 
| 320 command = "$python_path \"$ar_wrapper\"$whitelist_flag --output={{output}} --ar=\"$ar\" {{arflags}} rcsD @\"$rspfile\"" | 320 ar_wrapper = rebase_path("//build/toolchain/gcc_ar_wrapper_aix.py", | 
| 
Michael Achenbach
2017/04/18 13:46:04
Maybe pull out the two differences (ar_wrapper, op
 
rayb
2017/04/25 00:41:04
Done. Also using the same gcc_ar_wrapper.py instea
 | |
| 321 root_build_dir) | |
| 322 command = "$python_path \"$ar_wrapper\"$whitelist_flag --output={{output }} --ar=\"$ar\" {{arflags}} rcsT @\"$rspfile\"" | |
| 323 } else { | |
| 324 ar_wrapper = | |
| 325 rebase_path("//build/toolchain/gcc_ar_wrapper.py", root_build_dir) | |
| 326 command = "$python_path \"$ar_wrapper\"$whitelist_flag --output={{output }} --ar=\"$ar\" {{arflags}} rcsD @\"$rspfile\"" | |
| 327 } | |
| 328 | |
| 321 description = "AR {{output}}" | 329 description = "AR {{output}}" | 
| 322 rspfile_content = "{{inputs}}" | 330 rspfile_content = "{{inputs}}" | 
| 323 outputs = [ | 331 outputs = [ | 
| 324 "{{output_dir}}/{{target_output_name}}{{output_extension}}", | 332 "{{output_dir}}/{{target_output_name}}{{output_extension}}", | 
| 325 ] | 333 ] | 
| 326 | 334 | 
| 327 # Shared libraries go in the target out directory by default so we can | 335 # Shared libraries go in the target out directory by default so we can | 
| 328 # generate different targets with the same name and not have them collide. | 336 # generate different targets with the same name and not have them collide. | 
| 329 default_output_dir = "{{target_out_dir}}" | 337 default_output_dir = "{{target_out_dir}}" | 
| 330 default_output_extension = ".a" | 338 default_output_extension = ".a" | 
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 484 | 492 | 
| 485 # Generate a map file to be used for binary size analysis. | 493 # Generate a map file to be used for binary size analysis. | 
| 486 # Map file adds ~10% to the link time on a z620. | 494 # Map file adds ~10% to the link time on a z620. | 
| 487 # With target_os="android", libchrome.so.map.gz is ~20MB. | 495 # With target_os="android", libchrome.so.map.gz is ~20MB. | 
| 488 map_switch = "" | 496 map_switch = "" | 
| 489 if (enable_linker_map && is_official_build) { | 497 if (enable_linker_map && is_official_build) { | 
| 490 map_file = "$unstripped_outfile.map.gz" | 498 map_file = "$unstripped_outfile.map.gz" | 
| 491 map_switch = " --map-file \"$map_file\"" | 499 map_switch = " --map-file \"$map_file\"" | 
| 492 } | 500 } | 
| 493 | 501 | 
| 494 link_command = "$ld {{ldflags}}${extra_ldflags} -o \"$unstripped_outfile\" -Wl,--start-group @\"$rspfile\" {{solibs}} -Wl,--end-group $libs_section_prefix {{libs}} $libs_section_postfix" | 502 if (current_os == "aix") { | 
| 503 # the "--start-group .. --end-group" feature isn't available on the aix ld | |
| 504 link_command = "$ld {{ldflags}}${extra_ldflags} -o \"$unstripped_outfile \" @\"$rspfile\" {{solibs}} $libs_section_prefix {{libs}} $libs_section_postfix " | |
| 505 } else { | |
| 506 link_command = "$ld {{ldflags}}${extra_ldflags} -o \"$unstripped_outfile \" -Wl,--start-group @\"$rspfile\" {{solibs}} -Wl,--end-group $libs_section_pref ix {{libs}} $libs_section_postfix" | |
| 
Michael Achenbach
2017/04/18 13:46:04
nit: Readability: Similar to my comment above, may
 
rayb
2017/04/25 00:41:04
Done.
 | |
| 507 } | |
| 495 | 508 | 
| 496 strip_switch = "" | 509 strip_switch = "" | 
| 510 | |
| 497 if (defined(invoker.strip)) { | 511 if (defined(invoker.strip)) { | 
| 498 strip_switch = " --strip=\"${invoker.strip}\" --unstripped-file=\"$unstr ipped_outfile\"" | 512 strip_switch = " --strip=\"${invoker.strip}\" --unstripped-file=\"$unstr ipped_outfile\"" | 
| 499 } | 513 } | 
| 500 | 514 | 
| 501 link_wrapper = | 515 link_wrapper = | 
| 502 rebase_path("//build/toolchain/gcc_link_wrapper.py", root_build_dir) | 516 rebase_path("//build/toolchain/gcc_link_wrapper.py", root_build_dir) | 
| 503 command = "$python_path \"$link_wrapper\" --output=\"$outfile\"$strip_swit ch$map_switch -- $link_command" | 517 command = "$python_path \"$link_wrapper\" --output=\"$outfile\"$strip_swit ch$map_switch -- $link_command" | 
| 504 description = "LINK $outfile" | 518 description = "LINK $outfile" | 
| 505 rspfile_content = "{{inputs}}" | 519 rspfile_content = "{{inputs}}" | 
| 506 outputs = [ | 520 outputs = [ | 
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 564 ]) | 578 ]) | 
| 565 | 579 | 
| 566 toolchain_args = { | 580 toolchain_args = { | 
| 567 if (defined(invoker.toolchain_args)) { | 581 if (defined(invoker.toolchain_args)) { | 
| 568 forward_variables_from(invoker.toolchain_args, "*") | 582 forward_variables_from(invoker.toolchain_args, "*") | 
| 569 } | 583 } | 
| 570 is_clang = true | 584 is_clang = true | 
| 571 } | 585 } | 
| 572 } | 586 } | 
| 573 } | 587 } | 
| OLD | NEW |