OLD | NEW |
---|---|
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 20 matching lines...) Expand all Loading... | |
31 # The snapshot needs to be compiled for the host, but compiled with | 31 # The snapshot needs to be compiled for the host, but compiled with |
32 # a toolchain that matches the bit-width of the target. | 32 # a toolchain that matches the bit-width of the target. |
33 v8_snapshot_toolchain = "" | 33 v8_snapshot_toolchain = "" |
34 } | 34 } |
35 | 35 |
36 # TODO(GYP): For now we only support 32-bit little-endian target builds from an | 36 # TODO(GYP): For now we only support 32-bit little-endian target builds from an |
37 # x64 Linux host. Eventually we need to support all of the host/target | 37 # x64 Linux host. Eventually we need to support all of the host/target |
38 # configurations v8 runs on. | 38 # configurations v8 runs on. |
39 if (v8_snapshot_toolchain == "") { | 39 if (v8_snapshot_toolchain == "") { |
40 if (host_cpu == "x64" && host_os == "linux") { | 40 if (host_cpu == "x64" && host_os == "linux") { |
41 if (current_cpu == "arm" || current_cpu == "mipsel" || | 41 if (v8_current_cpu == v8_target_cpu && current_cpu == target_cpu && |
42 current_cpu == "x86") { | 42 (target_cpu == "x86" || target_cpu == "x64")) { |
Michael Achenbach
2016/07/22 20:55:15
So the revert was due to the case where target cpu
| |
43 _snapshot_cpu = "x86" | 43 # Args that are specified by the user can end up having the same |
44 # effect as args that are specified in a toolchain; for example, | |
45 # building on linux x64 with target_cpu == "x86" v8_target_cpu == "arm" | |
46 # will use the //build/toolchain/linux:clang_x86 toolchain, but have the | |
47 # same effect as if you specified | |
48 # | |
49 # custom_toolchain="//build/toolchain/linux:clang_x86_v8_arm" | |
50 # | |
51 # As a result, if we didn't take that into account we could | |
52 # accidentally end up building two identical copies of v8. | |
53 # | |
54 # So, we can re-use the default toolchain for the snapshot in these | |
55 # casees, but only when the host is actually capable of running the | |
56 # target code, which at this time means that the target_cpu == x86 | |
57 # or x64. | |
58 v8_snapshot_toolchain = default_toolchain | |
44 } else { | 59 } else { |
45 assert(current_cpu == "arm64" || current_cpu == "x64" || | 60 if (current_cpu == "arm" || current_cpu == "mipsel" || |
46 current_cpu == "mips64el", | 61 current_cpu == "x86") { |
47 "Need environment for this arch: $current_cpu") | 62 _snapshot_cpu = "x86" |
48 _snapshot_cpu = "x64" | 63 } else { |
49 } | 64 assert(current_cpu == "arm64" || current_cpu == "x64" || |
65 current_cpu == "mips64el", | |
66 "Need environment for this arch: $current_cpu") | |
67 _snapshot_cpu = "x64" | |
68 } | |
50 | 69 |
51 if (v8_current_cpu != _snapshot_cpu) { | 70 if (v8_current_cpu != _snapshot_cpu) { |
52 _cpus = "${_snapshot_cpu}_v8_${v8_current_cpu}" | 71 _cpus = "${_snapshot_cpu}_v8_${v8_current_cpu}" |
53 } else { | 72 } else { |
54 _cpus = _snapshot_cpu | 73 _cpus = _snapshot_cpu |
55 } | 74 } |
56 | 75 |
57 if ((host_os == "linux" && current_os == "android") || is_clang) { | 76 if ((host_os == "linux" && current_os == "android") || is_clang) { |
58 v8_snapshot_toolchain = "//build/toolchain/linux:clang_${_cpus}" | 77 v8_snapshot_toolchain = "//build/toolchain/linux:clang_${_cpus}" |
59 } else { | 78 } else { |
60 v8_snapshot_toolchain = "//build/toolchain/linux:${_cpus}" | 79 v8_snapshot_toolchain = "//build/toolchain/linux:${_cpus}" |
80 } | |
61 } | 81 } |
62 } else if (host_os == "mac" && current_os == "win") { | 82 } else if (host_os == "mac" && current_os == "win") { |
63 assert(v8_current_cpu == current_cpu, | 83 assert(v8_current_cpu == current_cpu, |
64 "v8 target must match the regular target on this platform") | 84 "v8 target must match the regular target on this platform") |
65 v8_snapshot_toolchain = "//build/toolchain/mac:clang_$current_cpu" | 85 v8_snapshot_toolchain = "//build/toolchain/mac:clang_$current_cpu" |
66 } else { | 86 } else { |
67 v8_snapshot_toolchain = default_toolchain | 87 v8_snapshot_toolchain = default_toolchain |
68 } | 88 } |
69 } | 89 } |
OLD | NEW |