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 (v8_current_cpu == v8_target_cpu && current_cpu == target_cpu && | 41 if (current_cpu == "arm" || current_cpu == "mipsel" || |
42 (target_cpu == "x86" || target_cpu == "x64")) { | 42 current_cpu == "x86") { |
43 # Args that are specified by the user can end up having the same | 43 _snapshot_cpu = "x86" |
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 | |
59 } else { | 44 } else { |
60 if (current_cpu == "arm" || current_cpu == "mipsel" || | 45 assert(current_cpu == "arm64" || current_cpu == "x64" || |
61 current_cpu == "x86") { | 46 current_cpu == "mips64el", |
62 _snapshot_cpu = "x86" | 47 "Need environment for this arch: $current_cpu") |
63 } else { | 48 _snapshot_cpu = "x64" |
64 assert(current_cpu == "arm64" || current_cpu == "x64" || | 49 } |
65 current_cpu == "mips64el", | |
66 "Need environment for this arch: $current_cpu") | |
67 _snapshot_cpu = "x64" | |
68 } | |
69 | 50 |
70 if (v8_current_cpu != _snapshot_cpu) { | 51 if (v8_current_cpu != _snapshot_cpu) { |
71 _cpus = "${_snapshot_cpu}_v8_${v8_current_cpu}" | 52 _cpus = "${_snapshot_cpu}_v8_${v8_current_cpu}" |
72 } else { | 53 } else { |
73 _cpus = _snapshot_cpu | 54 _cpus = _snapshot_cpu |
74 } | 55 } |
75 | 56 |
76 if ((host_os == "linux" && current_os == "android") || is_clang) { | 57 if ((host_os == "linux" && current_os == "android") || is_clang) { |
77 v8_snapshot_toolchain = "//build/toolchain/linux:clang_${_cpus}" | 58 v8_snapshot_toolchain = "//build/toolchain/linux:clang_${_cpus}" |
78 } else { | 59 } else { |
79 v8_snapshot_toolchain = "//build/toolchain/linux:${_cpus}" | 60 v8_snapshot_toolchain = "//build/toolchain/linux:${_cpus}" |
80 } | |
81 } | 61 } |
82 } else if (host_os == "mac" && current_os == "win") { | 62 } else if (host_os == "mac" && current_os == "win") { |
83 assert(v8_current_cpu == current_cpu, | 63 assert(v8_current_cpu == current_cpu, |
84 "v8 target must match the regular target on this platform") | 64 "v8 target must match the regular target on this platform") |
85 v8_snapshot_toolchain = "//build/toolchain/mac:clang_$current_cpu" | 65 v8_snapshot_toolchain = "//build/toolchain/mac:clang_$current_cpu" |
86 } else { | 66 } else { |
87 v8_snapshot_toolchain = default_toolchain | 67 v8_snapshot_toolchain = default_toolchain |
88 } | 68 } |
89 } | 69 } |
OLD | NEW |