Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(416)

Side by Side Diff: snapshot_toolchain.gni

Issue 2265983002: Use clang for snapshot_toolchain by default, except on ChromeOS. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Change default. Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2015 the V8 project authors. All rights reserved. 1 # Copyright 2015 the V8 project authors. All rights reserved.
2 # Redistribution and use in source and binary forms, with or without 2 # Redistribution and use in source and binary forms, with or without
3 # modification, are permitted provided that the following conditions are 3 # modification, are permitted provided that the following conditions are
4 # met: 4 # met:
5 # 5 #
6 # * Redistributions of source code must retain the above copyright 6 # * Redistributions of source code must retain the above copyright
7 # notice, this list of conditions and the following disclaimer. 7 # notice, this list of conditions and the following disclaimer.
8 # * Redistributions in binary form must reproduce the above 8 # * Redistributions in binary form must reproduce the above
9 # copyright notice, this list of conditions and the following 9 # copyright notice, this list of conditions and the following
10 # disclaimer in the documentation and/or other materials provided 10 # disclaimer in the documentation and/or other materials provided
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 # validation. 43 # validation.
44 # 44 #
45 # There are test cases for this code posted as an attachment to 45 # There are test cases for this code posted as an attachment to
46 # https://crbug.com/625353. 46 # https://crbug.com/625353.
47 # 47 #
48 # TODO(GYP): Currently only regular (non-cross) compiles, and cross-compiles 48 # TODO(GYP): Currently only regular (non-cross) compiles, and cross-compiles
49 # from x64 hosts to Intel, ARM, or MIPS targets, are implemented. Add support 49 # from x64 hosts to Intel, ARM, or MIPS targets, are implemented. Add support
50 # for the other supported configurations. 50 # for the other supported configurations.
51 51
52 if (v8_snapshot_toolchain == "") { 52 if (v8_snapshot_toolchain == "") {
53
54 if (current_os == host_os && current_cpu == host_cpu) { 53 if (current_os == host_os && current_cpu == host_cpu) {
55 # This is not a cross-compile, so build the snapshot with the current 54 # This is not a cross-compile, so build the snapshot with the current
56 # toolchain. 55 # toolchain.
57 v8_snapshot_toolchain = current_toolchain 56 v8_snapshot_toolchain = current_toolchain
58
59 } else if (current_os == host_os && current_cpu == "x86" && 57 } else if (current_os == host_os && current_cpu == "x86" &&
60 host_cpu == "x64") { 58 host_cpu == "x64") {
61 # This is an x64 -> x86 cross-compile, but x64 hosts can usually run x86 59 # This is an x64 -> x86 cross-compile, but x64 hosts can usually run x86
62 # binaries built for the same OS, so build the snapshot with the current 60 # binaries built for the same OS, so build the snapshot with the current
63 # toolchain here, too. 61 # toolchain here, too.
64 v8_snapshot_toolchain = current_toolchain 62 v8_snapshot_toolchain = current_toolchain
65
66 } else if (current_os == "win" && host_os == "mac" && is_clang) { 63 } else if (current_os == "win" && host_os == "mac" && is_clang) {
67 # This is a mac -> win cross-compile, which is only supported w/ clang. 64 # This is a mac -> win cross-compile, which is only supported w/ clang.
68 v8_snapshot_toolchain = "//build/toolchain/mac:clang_${v8_current_cpu}" 65 v8_snapshot_toolchain = "//build/toolchain/mac:clang_${v8_current_cpu}"
69
70 } else if (host_cpu == "x64") { 66 } else if (host_cpu == "x64") {
71 # This is a cross-compile from an x64 host to either a non-Intel target 67 # This is a cross-compile from an x64 host to either a non-Intel target
72 # cpu or a different target OS. Assume the same toolchain (Clang or GCC 68 # cpu or a different target OS. Clang will always be used by default on the
73 # or MSVS) for target and host, unless this is an Android build, where 69 # host, unless this is a ChromeOS build, in which case the same toolchain
74 # Clang is always used on the host. 70 # (Clang or GCC) will be used for target and host by default.
75 if (is_clang || is_android) { 71 if (is_chromeos && !is_clang) {
72 _clang = ""
73 } else {
76 _clang = "clang_" 74 _clang = "clang_"
77 } else {
78 _clang = ""
79 } 75 }
80 76
81 if (v8_current_cpu == "x64" || v8_current_cpu == "x86") { 77 if (v8_current_cpu == "x64" || v8_current_cpu == "x86") {
82 _cpus = v8_current_cpu 78 _cpus = v8_current_cpu
83 } else if (v8_current_cpu == "arm64" || v8_current_cpu == "mips64el") { 79 } else if (v8_current_cpu == "arm64" || v8_current_cpu == "mips64el") {
84 _cpus = "x64_v8_${v8_current_cpu}" 80 _cpus = "x64_v8_${v8_current_cpu}"
85 } else if (v8_current_cpu == "arm" || v8_current_cpu == "mipsel") { 81 } else if (v8_current_cpu == "arm" || v8_current_cpu == "mipsel") {
86 _cpus = "x86_v8_${v8_current_cpu}" 82 _cpus = "x86_v8_${v8_current_cpu}"
87 } else { 83 } else {
88 # This branch should not be reached; leave _cpus blank so the assert 84 # This branch should not be reached; leave _cpus blank so the assert
89 # below will fail. 85 # below will fail.
90 _cpus = "" 86 _cpus = ""
91 } 87 }
92 88
93 if (_cpus != "") { 89 if (_cpus != "") {
94 v8_snapshot_toolchain = "//build/toolchain/${host_os}:${_clang}${_cpus}" 90 v8_snapshot_toolchain = "//build/toolchain/${host_os}:${_clang}${_cpus}"
95 } 91 }
96 } 92 }
97 } 93 }
98 94
99 assert(v8_snapshot_toolchain != "", 95 assert(v8_snapshot_toolchain != "",
100 "Do not know how to build a snapshot for $current_toolchain " + 96 "Do not know how to build a snapshot for $current_toolchain " +
101 "on $host_os $host_cpu") 97 "on $host_os $host_cpu")
Dirk Pranke 2016/08/22 23:08:45 Was this indentation change intentional?
slan 2016/08/22 23:18:08 That's what gn format wanted.
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698