1# Copyright 2021 The Pigweed Authors 2# 3# Licensed under the Apache License, Version 2.0 (the "License"); you may not 4# use this file except in compliance with the License. You may obtain a copy of 5# the License at 6# 7# https://www.apache.org/licenses/LICENSE-2.0 8# 9# Unless required by applicable law or agreed to in writing, software 10# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 11# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 12# License for the specific language governing permissions and limitations under 13# the License. 14 15import("//build_overrides/pigweed.gni") 16 17import("$dir_pw_toolchain/clang_tools.gni") 18 19# Specifies the tools used by host Clang toolchains. 20_arm_clang_toolchain = { 21 forward_variables_from(pw_toolchain_clang_tools, "*") 22 23 link_whole_archive = true 24 25 # Enable static analysis for arm clang based toolchains. 26 static_analysis = { 27 enabled = true 28 } 29} 30 31# Configs specific to different architectures. 32_cortex_m0plus = [ 33 "$dir_pw_toolchain/arm_clang:nosys", 34 "$dir_pw_toolchain/arm_clang:cortex_m0plus", 35] 36 37_cortex_m3 = [ 38 "$dir_pw_toolchain/arm_clang:nosys", 39 "$dir_pw_toolchain/arm_clang:cortex_m3", 40] 41 42_cortex_m4 = [ 43 "$dir_pw_toolchain/arm_clang:nosys", 44 "$dir_pw_toolchain/arm_clang:cortex_m4", 45] 46 47_cortex_m4f = [ 48 "$dir_pw_toolchain/arm_clang:nosys", 49 "$dir_pw_toolchain/arm_clang:cortex_m4f", 50] 51 52_cortex_m7 = [ 53 "$dir_pw_toolchain/arm_clang:nosys", 54 "$dir_pw_toolchain/arm_clang:cortex_m7", 55] 56 57_cortex_m7f = [ 58 "$dir_pw_toolchain/arm_clang:nosys", 59 "$dir_pw_toolchain/arm_clang:cortex_m7f", 60] 61 62_cortex_m33 = [ 63 "$dir_pw_toolchain/arm_clang:nosys", 64 "$dir_pw_toolchain/arm_clang:cortex_m33", 65] 66 67_cortex_m33f = [ 68 "$dir_pw_toolchain/arm_clang:nosys", 69 "$dir_pw_toolchain/arm_clang:cortex_m33f", 70] 71 72# Describes ARM clang toolchains for specific targets. 73pw_toolchain_arm_clang = { 74 cortex_m0plus_debug = { 75 name = "arm_clang_cortex_m0plus_debug" 76 forward_variables_from(_arm_clang_toolchain, "*") 77 defaults = { 78 default_configs = _cortex_m0plus + [ "$dir_pw_build:optimize_debugging" ] 79 } 80 } 81 cortex_m0plus_speed_optimized = { 82 name = "arm_clang_cortex_m0plus_speed_optimized" 83 forward_variables_from(_arm_clang_toolchain, "*") 84 defaults = { 85 default_configs = _cortex_m0plus + [ "$dir_pw_build:optimize_speed" ] 86 } 87 } 88 cortex_m0plus_size_optimized = { 89 name = "arm_clang_cortex_m0plus_size_optimized" 90 forward_variables_from(_arm_clang_toolchain, "*") 91 defaults = { 92 default_configs = _cortex_m0plus + [ "$dir_pw_build:optimize_size_clang" ] 93 } 94 } 95 cortex_m3_debug = { 96 name = "arm_clang_cortex_m3_debug" 97 forward_variables_from(_arm_clang_toolchain, "*") 98 defaults = { 99 default_configs = _cortex_m3 + [ "$dir_pw_build:optimize_debugging" ] 100 } 101 } 102 cortex_m3_speed_optimized = { 103 name = "arm_clang_cortex_m3_speed_optimized" 104 forward_variables_from(_arm_clang_toolchain, "*") 105 defaults = { 106 default_configs = _cortex_m3 + [ "$dir_pw_build:optimize_speed" ] 107 } 108 } 109 cortex_m3_size_optimized = { 110 name = "arm_clang_cortex_m3_size_optimized" 111 forward_variables_from(_arm_clang_toolchain, "*") 112 defaults = { 113 default_configs = _cortex_m3 + [ "$dir_pw_build:optimize_size_clang" ] 114 } 115 } 116 cortex_m4_debug = { 117 name = "arm_clang_cortex_m4_debug" 118 forward_variables_from(_arm_clang_toolchain, "*") 119 defaults = { 120 default_configs = _cortex_m4 + [ "$dir_pw_build:optimize_debugging" ] 121 } 122 } 123 cortex_m4_speed_optimized = { 124 name = "arm_clang_cortex_m4_speed_optimized" 125 forward_variables_from(_arm_clang_toolchain, "*") 126 defaults = { 127 default_configs = _cortex_m4 + [ "$dir_pw_build:optimize_speed" ] 128 } 129 } 130 cortex_m4_size_optimized = { 131 name = "arm_clang_cortex_m4_size_optimized" 132 forward_variables_from(_arm_clang_toolchain, "*") 133 defaults = { 134 default_configs = _cortex_m4 + [ "$dir_pw_build:optimize_size_clang" ] 135 } 136 } 137 cortex_m4f_debug = { 138 name = "arm_clang_cortex_m4f_debug" 139 forward_variables_from(_arm_clang_toolchain, "*") 140 defaults = { 141 default_configs = _cortex_m4f + [ "$dir_pw_build:optimize_debugging" ] 142 } 143 } 144 cortex_m4f_speed_optimized = { 145 name = "arm_clang_cortex_m4f_speed_optimized" 146 forward_variables_from(_arm_clang_toolchain, "*") 147 defaults = { 148 default_configs = _cortex_m4f + [ "$dir_pw_build:optimize_speed" ] 149 } 150 } 151 cortex_m4f_size_optimized = { 152 name = "arm_clang_cortex_m4f_size_optimized" 153 forward_variables_from(_arm_clang_toolchain, "*") 154 defaults = { 155 default_configs = _cortex_m4f + [ "$dir_pw_build:optimize_size_clang" ] 156 } 157 } 158 cortex_m7_debug = { 159 name = "arm_clang_cortex_m7_debug" 160 forward_variables_from(_arm_clang_toolchain, "*") 161 defaults = { 162 default_configs = _cortex_m7 + [ "$dir_pw_build:optimize_debugging" ] 163 } 164 } 165 cortex_m7_speed_optimized = { 166 name = "arm_clang_cortex_m7_speed_optimized" 167 forward_variables_from(_arm_clang_toolchain, "*") 168 defaults = { 169 default_configs = _cortex_m7 + [ "$dir_pw_build:optimize_speed" ] 170 } 171 } 172 cortex_m7_size_optimized = { 173 name = "arm_clang_cortex_m7_size_optimized" 174 forward_variables_from(_arm_clang_toolchain, "*") 175 defaults = { 176 default_configs = _cortex_m7 + [ "$dir_pw_build:optimize_size_clang" ] 177 } 178 } 179 cortex_m7f_debug = { 180 name = "arm_clang_cortex_m7f_debug" 181 forward_variables_from(_arm_clang_toolchain, "*") 182 defaults = { 183 default_configs = _cortex_m7f + [ "$dir_pw_build:optimize_debugging" ] 184 } 185 } 186 cortex_m7f_speed_optimized = { 187 name = "arm_clang_cortex_m7f_speed_optimized" 188 forward_variables_from(_arm_clang_toolchain, "*") 189 defaults = { 190 default_configs = _cortex_m7f + [ "$dir_pw_build:optimize_speed" ] 191 } 192 } 193 cortex_m7f_size_optimized = { 194 name = "arm_clang_cortex_m7f_size_optimized" 195 forward_variables_from(_arm_clang_toolchain, "*") 196 defaults = { 197 default_configs = _cortex_m7f + [ "$dir_pw_build:optimize_size_clang" ] 198 } 199 } 200 cortex_m33_debug = { 201 name = "arm_clang_cortex_m33_debug" 202 forward_variables_from(_arm_clang_toolchain, "*") 203 defaults = { 204 default_configs = _cortex_m33 + [ "$dir_pw_build:optimize_debugging" ] 205 } 206 } 207 cortex_m33_speed_optimized = { 208 name = "arm_clang_cortex_m33_speed_optimized" 209 forward_variables_from(_arm_clang_toolchain, "*") 210 defaults = { 211 default_configs = _cortex_m33 + [ "$dir_pw_build:optimize_speed" ] 212 } 213 } 214 cortex_m33_size_optimized = { 215 name = "arm_clang_cortex_m33_size_optimized" 216 forward_variables_from(_arm_clang_toolchain, "*") 217 defaults = { 218 default_configs = _cortex_m33 + [ "$dir_pw_build:optimize_size_clang" ] 219 } 220 } 221 cortex_m33f_debug = { 222 name = "arm_clang_cortex_m33f_debug" 223 forward_variables_from(_arm_clang_toolchain, "*") 224 defaults = { 225 default_configs = _cortex_m33f + [ "$dir_pw_build:optimize_debugging" ] 226 } 227 } 228 cortex_m33f_speed_optimized = { 229 name = "arm_clang_cortex_m33f_speed_optimized" 230 forward_variables_from(_arm_clang_toolchain, "*") 231 defaults = { 232 default_configs = _cortex_m33f + [ "$dir_pw_build:optimize_speed" ] 233 } 234 } 235 cortex_m33f_size_optimized = { 236 name = "arm_clang_cortex_m33f_size_optimized" 237 forward_variables_from(_arm_clang_toolchain, "*") 238 defaults = { 239 default_configs = _cortex_m33f + [ "$dir_pw_build:optimize_size_clang" ] 240 } 241 } 242} 243 244# This list just contains the members of the above scope for convenience to make 245# it trivial to generate all the toolchains in this file via a 246# `generate_toolchains` target. 247pw_toolchain_arm_clang_list = [ 248 pw_toolchain_arm_clang.cortex_m0plus_debug, 249 pw_toolchain_arm_clang.cortex_m0plus_speed_optimized, 250 pw_toolchain_arm_clang.cortex_m0plus_size_optimized, 251 pw_toolchain_arm_clang.cortex_m3_debug, 252 pw_toolchain_arm_clang.cortex_m3_speed_optimized, 253 pw_toolchain_arm_clang.cortex_m3_size_optimized, 254 pw_toolchain_arm_clang.cortex_m4_debug, 255 pw_toolchain_arm_clang.cortex_m4_speed_optimized, 256 pw_toolchain_arm_clang.cortex_m4_size_optimized, 257 pw_toolchain_arm_clang.cortex_m4f_debug, 258 pw_toolchain_arm_clang.cortex_m4f_speed_optimized, 259 pw_toolchain_arm_clang.cortex_m4f_size_optimized, 260 pw_toolchain_arm_clang.cortex_m7_debug, 261 pw_toolchain_arm_clang.cortex_m7_speed_optimized, 262 pw_toolchain_arm_clang.cortex_m7_size_optimized, 263 pw_toolchain_arm_clang.cortex_m7f_debug, 264 pw_toolchain_arm_clang.cortex_m7f_speed_optimized, 265 pw_toolchain_arm_clang.cortex_m7f_size_optimized, 266 pw_toolchain_arm_clang.cortex_m33_debug, 267 pw_toolchain_arm_clang.cortex_m33_speed_optimized, 268 pw_toolchain_arm_clang.cortex_m33_size_optimized, 269 pw_toolchain_arm_clang.cortex_m33f_debug, 270 pw_toolchain_arm_clang.cortex_m33f_speed_optimized, 271 pw_toolchain_arm_clang.cortex_m33f_size_optimized, 272] 273