Austin Schuh | a2503a7 | 2020-12-15 20:57:57 -0800 | [diff] [blame] | 1 | load( |
| 2 | "@bazel_tools//tools/cpp:cc_toolchain_config_lib.bzl", |
Austin Schuh | da9d060 | 2019-09-15 17:29:38 -0700 | [diff] [blame] | 3 | "action_config", |
Austin Schuh | da9d060 | 2019-09-15 17:29:38 -0700 | [diff] [blame] | 4 | "feature", |
Austin Schuh | da9d060 | 2019-09-15 17:29:38 -0700 | [diff] [blame] | 5 | "flag_group", |
| 6 | "flag_set", |
Austin Schuh | da9d060 | 2019-09-15 17:29:38 -0700 | [diff] [blame] | 7 | "tool", |
| 8 | "tool_path", |
Austin Schuh | da9d060 | 2019-09-15 17:29:38 -0700 | [diff] [blame] | 9 | "with_feature_set", |
| 10 | ) |
| 11 | load("@bazel_tools//tools/build_defs/cc:action_names.bzl", "ACTION_NAMES") |
| 12 | |
| 13 | def _impl(ctx): |
Brian Silverman | 4c7235a | 2021-11-17 19:04:37 -0800 | [diff] [blame] | 14 | if ctx.attr.cpu == "rp2040": |
Austin Schuh | 0a96ea3 | 2022-01-01 22:29:30 -0800 | [diff] [blame] | 15 | toolchain_identifier = "rp2040" |
Brian Silverman | 94cab07 | 2022-01-02 23:50:03 -0800 | [diff] [blame] | 16 | elif ctx.attr.cpu == "cortex-m4f": |
Austin Schuh | da9d060 | 2019-09-15 17:29:38 -0700 | [diff] [blame] | 17 | toolchain_identifier = "cortex-m4f" |
Brian Silverman | 94cab07 | 2022-01-02 23:50:03 -0800 | [diff] [blame] | 18 | elif ctx.attr.cpu == "cortex-m4f-k22": |
Austin Schuh | da9d060 | 2019-09-15 17:29:38 -0700 | [diff] [blame] | 19 | toolchain_identifier = "cortex-m4f-k22" |
Brian Silverman | 94cab07 | 2022-01-02 23:50:03 -0800 | [diff] [blame] | 20 | elif ctx.attr.cpu == "roborio": |
Austin Schuh | da9d060 | 2019-09-15 17:29:38 -0700 | [diff] [blame] | 21 | toolchain_identifier = "roborio_linux" |
Austin Schuh | da9d060 | 2019-09-15 17:29:38 -0700 | [diff] [blame] | 22 | else: |
| 23 | fail("Unreachable") |
| 24 | |
Brian Silverman | 33ca369 | 2022-02-06 18:37:17 -0800 | [diff] [blame] | 25 | if (ctx.attr.cpu == "rp2040" or |
| 26 | ctx.attr.cpu == "cortex-m4f" or |
| 27 | ctx.attr.cpu == "cortex-m4f-k22"): |
Austin Schuh | da9d060 | 2019-09-15 17:29:38 -0700 | [diff] [blame] | 28 | host_system_name = "local" |
Brian Silverman | 94cab07 | 2022-01-02 23:50:03 -0800 | [diff] [blame] | 29 | elif ctx.attr.cpu == "roborio": |
Austin Schuh | da9d060 | 2019-09-15 17:29:38 -0700 | [diff] [blame] | 30 | host_system_name = "roborio" |
| 31 | else: |
| 32 | fail("Unreachable") |
| 33 | |
Brian Silverman | 33ca369 | 2022-02-06 18:37:17 -0800 | [diff] [blame] | 34 | if ctx.attr.cpu == "rp2040": |
Austin Schuh | 0a96ea3 | 2022-01-01 22:29:30 -0800 | [diff] [blame] | 35 | target_system_name = "rp2040" |
Brian Silverman | 94cab07 | 2022-01-02 23:50:03 -0800 | [diff] [blame] | 36 | elif ctx.attr.cpu == "cortex-m4f": |
Austin Schuh | da9d060 | 2019-09-15 17:29:38 -0700 | [diff] [blame] | 37 | target_system_name = "cortex-m4f" |
Brian Silverman | 94cab07 | 2022-01-02 23:50:03 -0800 | [diff] [blame] | 38 | elif ctx.attr.cpu == "cortex-m4f-k22": |
Austin Schuh | da9d060 | 2019-09-15 17:29:38 -0700 | [diff] [blame] | 39 | target_system_name = "cortex-m4f-k22" |
Brian Silverman | 94cab07 | 2022-01-02 23:50:03 -0800 | [diff] [blame] | 40 | elif ctx.attr.cpu == "roborio": |
Austin Schuh | da9d060 | 2019-09-15 17:29:38 -0700 | [diff] [blame] | 41 | target_system_name = "roborio" |
| 42 | else: |
| 43 | fail("Unreachable") |
| 44 | |
Brian Silverman | 33ca369 | 2022-02-06 18:37:17 -0800 | [diff] [blame] | 45 | if ctx.attr.cpu == "rp2040": |
Austin Schuh | 0a96ea3 | 2022-01-01 22:29:30 -0800 | [diff] [blame] | 46 | target_cpu = "rp2040" |
Brian Silverman | 94cab07 | 2022-01-02 23:50:03 -0800 | [diff] [blame] | 47 | elif ctx.attr.cpu == "cortex-m4f": |
Austin Schuh | da9d060 | 2019-09-15 17:29:38 -0700 | [diff] [blame] | 48 | target_cpu = "cortex-m4f" |
Brian Silverman | 94cab07 | 2022-01-02 23:50:03 -0800 | [diff] [blame] | 49 | elif ctx.attr.cpu == "cortex-m4f-k22": |
Austin Schuh | da9d060 | 2019-09-15 17:29:38 -0700 | [diff] [blame] | 50 | target_cpu = "cortex-m4f-k22" |
Brian Silverman | 94cab07 | 2022-01-02 23:50:03 -0800 | [diff] [blame] | 51 | elif ctx.attr.cpu == "roborio": |
Austin Schuh | da9d060 | 2019-09-15 17:29:38 -0700 | [diff] [blame] | 52 | target_cpu = "roborio" |
| 53 | else: |
| 54 | fail("Unreachable") |
| 55 | |
Brian Silverman | 33ca369 | 2022-02-06 18:37:17 -0800 | [diff] [blame] | 56 | if ctx.attr.cpu == "rp2040": |
Austin Schuh | 0a96ea3 | 2022-01-01 22:29:30 -0800 | [diff] [blame] | 57 | target_libc = "rp2040" |
Brian Silverman | 94cab07 | 2022-01-02 23:50:03 -0800 | [diff] [blame] | 58 | elif ctx.attr.cpu == "cortex-m4f": |
Austin Schuh | da9d060 | 2019-09-15 17:29:38 -0700 | [diff] [blame] | 59 | target_libc = "cortex-m4f" |
Brian Silverman | 94cab07 | 2022-01-02 23:50:03 -0800 | [diff] [blame] | 60 | elif ctx.attr.cpu == "cortex-m4f-k22": |
Austin Schuh | da9d060 | 2019-09-15 17:29:38 -0700 | [diff] [blame] | 61 | target_libc = "cortex-m4f-k22" |
Brian Silverman | 94cab07 | 2022-01-02 23:50:03 -0800 | [diff] [blame] | 62 | elif ctx.attr.cpu == "roborio": |
Austin Schuh | da9d060 | 2019-09-15 17:29:38 -0700 | [diff] [blame] | 63 | target_libc = "roborio" |
| 64 | else: |
| 65 | fail("Unreachable") |
| 66 | |
Brian Silverman | 33ca369 | 2022-02-06 18:37:17 -0800 | [diff] [blame] | 67 | if (ctx.attr.cpu == "rp2040" or |
| 68 | ctx.attr.cpu == "cortex-m4f" or |
| 69 | ctx.attr.cpu == "cortex-m4f-k22" or |
| 70 | ctx.attr.cpu == "roborio"): |
Austin Schuh | da9d060 | 2019-09-15 17:29:38 -0700 | [diff] [blame] | 71 | compiler = "gcc" |
| 72 | else: |
| 73 | fail("Unreachable") |
| 74 | |
Brian Silverman | 33ca369 | 2022-02-06 18:37:17 -0800 | [diff] [blame] | 75 | if ctx.attr.cpu == "rp2040": |
Austin Schuh | 0a96ea3 | 2022-01-01 22:29:30 -0800 | [diff] [blame] | 76 | abi_version = "rp2040" |
Brian Silverman | 94cab07 | 2022-01-02 23:50:03 -0800 | [diff] [blame] | 77 | elif ctx.attr.cpu == "cortex-m4f": |
Austin Schuh | da9d060 | 2019-09-15 17:29:38 -0700 | [diff] [blame] | 78 | abi_version = "cortex-m4f" |
Brian Silverman | 94cab07 | 2022-01-02 23:50:03 -0800 | [diff] [blame] | 79 | elif ctx.attr.cpu == "cortex-m4f-k22": |
Austin Schuh | da9d060 | 2019-09-15 17:29:38 -0700 | [diff] [blame] | 80 | abi_version = "cortex-m4f-k22" |
Brian Silverman | 94cab07 | 2022-01-02 23:50:03 -0800 | [diff] [blame] | 81 | elif ctx.attr.cpu == "roborio": |
Austin Schuh | da9d060 | 2019-09-15 17:29:38 -0700 | [diff] [blame] | 82 | abi_version = "roborio" |
| 83 | else: |
| 84 | fail("Unreachable") |
| 85 | |
Brian Silverman | 33ca369 | 2022-02-06 18:37:17 -0800 | [diff] [blame] | 86 | if ctx.attr.cpu == "rp2040": |
Austin Schuh | 0a96ea3 | 2022-01-01 22:29:30 -0800 | [diff] [blame] | 87 | abi_libc_version = "rp2040" |
Brian Silverman | 94cab07 | 2022-01-02 23:50:03 -0800 | [diff] [blame] | 88 | elif ctx.attr.cpu == "cortex-m4f": |
Austin Schuh | da9d060 | 2019-09-15 17:29:38 -0700 | [diff] [blame] | 89 | abi_libc_version = "cortex-m4f" |
Brian Silverman | 94cab07 | 2022-01-02 23:50:03 -0800 | [diff] [blame] | 90 | elif ctx.attr.cpu == "cortex-m4f-k22": |
Austin Schuh | da9d060 | 2019-09-15 17:29:38 -0700 | [diff] [blame] | 91 | abi_libc_version = "cortex-m4f-k22" |
Brian Silverman | 94cab07 | 2022-01-02 23:50:03 -0800 | [diff] [blame] | 92 | elif ctx.attr.cpu == "roborio": |
Austin Schuh | da9d060 | 2019-09-15 17:29:38 -0700 | [diff] [blame] | 93 | abi_libc_version = "roborio" |
| 94 | else: |
| 95 | fail("Unreachable") |
| 96 | |
| 97 | cc_target_os = None |
| 98 | |
| 99 | builtin_sysroot = None |
| 100 | |
Austin Schuh | da9d060 | 2019-09-15 17:29:38 -0700 | [diff] [blame] | 101 | all_cpp_compile_actions = [ |
| 102 | ACTION_NAMES.cpp_compile, |
| 103 | ACTION_NAMES.linkstamp_compile, |
| 104 | ACTION_NAMES.cpp_header_parsing, |
| 105 | ACTION_NAMES.cpp_module_compile, |
| 106 | ACTION_NAMES.cpp_module_codegen, |
| 107 | ACTION_NAMES.clif_match, |
| 108 | ] |
| 109 | |
Austin Schuh | da9d060 | 2019-09-15 17:29:38 -0700 | [diff] [blame] | 110 | all_link_actions = [ |
| 111 | ACTION_NAMES.cpp_link_executable, |
| 112 | ACTION_NAMES.cpp_link_dynamic_library, |
| 113 | ACTION_NAMES.cpp_link_nodeps_dynamic_library, |
| 114 | ] |
| 115 | |
Brian Silverman | 94cab07 | 2022-01-02 23:50:03 -0800 | [diff] [blame] | 116 | if ctx.attr.cpu == "roborio": |
Austin Schuh | da9d060 | 2019-09-15 17:29:38 -0700 | [diff] [blame] | 117 | objcopy_embed_data_action = action_config( |
| 118 | action_name = "objcopy_embed_data", |
| 119 | enabled = True, |
| 120 | tools = [ |
| 121 | tool( |
| 122 | path = "arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-objcopy", |
| 123 | ), |
| 124 | ], |
| 125 | ) |
Austin Schuh | 0a96ea3 | 2022-01-01 22:29:30 -0800 | [diff] [blame] | 126 | elif (ctx.attr.cpu == "rp2040" or |
| 127 | ctx.attr.cpu == "cortex-m4f" or |
Austin Schuh | a2503a7 | 2020-12-15 20:57:57 -0800 | [diff] [blame] | 128 | ctx.attr.cpu == "cortex-m4f-k22"): |
Austin Schuh | da9d060 | 2019-09-15 17:29:38 -0700 | [diff] [blame] | 129 | objcopy_embed_data_action = action_config( |
| 130 | action_name = "objcopy_embed_data", |
| 131 | enabled = True, |
| 132 | tools = [tool(path = "gcc_arm_none_eabi/arm-none-eabi-objcopy")], |
| 133 | ) |
| 134 | else: |
| 135 | objcopy_embed_data_action = None |
| 136 | |
Brian Silverman | 33ca369 | 2022-02-06 18:37:17 -0800 | [diff] [blame] | 137 | if (ctx.attr.cpu == "rp2040" or |
| 138 | ctx.attr.cpu == "cortex-m4f" or |
| 139 | ctx.attr.cpu == "cortex-m4f-k22" or |
| 140 | ctx.attr.cpu == "roborio"): |
Austin Schuh | da9d060 | 2019-09-15 17:29:38 -0700 | [diff] [blame] | 141 | action_configs = [objcopy_embed_data_action] |
| 142 | else: |
| 143 | fail("Unreachable") |
| 144 | |
| 145 | opt_post_feature = feature( |
| 146 | name = "opt_post", |
| 147 | flag_sets = [ |
| 148 | flag_set( |
Brian Silverman | 7b53ae1 | 2022-05-22 21:40:57 -0700 | [diff] [blame] | 149 | actions = all_cpp_compile_actions + [ |
Austin Schuh | da9d060 | 2019-09-15 17:29:38 -0700 | [diff] [blame] | 150 | ACTION_NAMES.preprocess_assemble, |
| 151 | ACTION_NAMES.c_compile, |
Austin Schuh | da9d060 | 2019-09-15 17:29:38 -0700 | [diff] [blame] | 152 | ], |
| 153 | flag_groups = [flag_group(flags = ["-DAOS_DEBUG=0"])], |
| 154 | ), |
| 155 | ], |
| 156 | ) |
| 157 | |
| 158 | supports_pic_feature = feature(name = "supports_pic", enabled = True) |
| 159 | |
Brian Silverman | 4c7235a | 2021-11-17 19:04:37 -0800 | [diff] [blame] | 160 | if ctx.attr.cpu == "cortex-m4f-k22": |
Austin Schuh | da9d060 | 2019-09-15 17:29:38 -0700 | [diff] [blame] | 161 | default_compile_flags_feature = feature( |
| 162 | name = "default_compile_flags", |
| 163 | enabled = True, |
| 164 | flag_sets = [ |
| 165 | flag_set( |
| 166 | actions = [ |
| 167 | ACTION_NAMES.assemble, |
| 168 | ACTION_NAMES.preprocess_assemble, |
| 169 | ACTION_NAMES.linkstamp_compile, |
| 170 | ACTION_NAMES.c_compile, |
| 171 | ACTION_NAMES.cpp_compile, |
| 172 | ACTION_NAMES.cpp_header_parsing, |
| 173 | ACTION_NAMES.cpp_module_compile, |
| 174 | ACTION_NAMES.cpp_module_codegen, |
| 175 | ACTION_NAMES.lto_backend, |
| 176 | ACTION_NAMES.clif_match, |
| 177 | ], |
| 178 | flag_groups = [ |
| 179 | flag_group( |
| 180 | flags = [ |
| 181 | "-D__STDC_FORMAT_MACROS", |
| 182 | "-D__STDC_CONSTANT_MACROS", |
| 183 | "-D__STDC_LIMIT_MACROS", |
| 184 | "-D__MK22FX512__", |
| 185 | "-DF_CPU=120000000", |
| 186 | "-Wl,--gc-sections", |
| 187 | "-D__have_long32", |
| 188 | "-fstack-protector", |
| 189 | "-mcpu=cortex-m4", |
| 190 | "-mfpu=fpv4-sp-d16", |
| 191 | "-mthumb", |
| 192 | "-mfloat-abi=hard", |
| 193 | "-fno-strict-aliasing", |
| 194 | "-fmessage-length=80", |
| 195 | "-fmax-errors=20", |
| 196 | "-Wall", |
| 197 | "-Wextra", |
| 198 | "-Wpointer-arith", |
| 199 | "-Wcast-qual", |
| 200 | "-Wwrite-strings", |
| 201 | "-Wtype-limits", |
| 202 | "-Wsign-compare", |
| 203 | "-Wformat=2", |
| 204 | "-Werror", |
| 205 | "-Wstrict-aliasing=2", |
| 206 | "-Wno-misleading-indentation", |
| 207 | "-Wno-int-in-bool-context", |
| 208 | "-Wdouble-promotion", |
| 209 | "-pipe", |
| 210 | "-g", |
| 211 | "-fno-common", |
| 212 | "-ffreestanding", |
| 213 | "-fbuiltin", |
| 214 | ], |
| 215 | ), |
| 216 | ], |
| 217 | ), |
| 218 | flag_set( |
| 219 | actions = [ |
| 220 | ACTION_NAMES.assemble, |
| 221 | ACTION_NAMES.preprocess_assemble, |
| 222 | ACTION_NAMES.linkstamp_compile, |
| 223 | ACTION_NAMES.c_compile, |
| 224 | ACTION_NAMES.cpp_compile, |
| 225 | ACTION_NAMES.cpp_header_parsing, |
| 226 | ACTION_NAMES.cpp_module_compile, |
| 227 | ACTION_NAMES.cpp_module_codegen, |
| 228 | ACTION_NAMES.lto_backend, |
| 229 | ACTION_NAMES.clif_match, |
| 230 | ], |
| 231 | flag_groups = [ |
| 232 | flag_group( |
| 233 | flags = [ |
| 234 | "-O2", |
| 235 | "-finline-functions", |
| 236 | "-ffast-math", |
| 237 | "-funroll-loops", |
| 238 | "-DNDEBUG", |
| 239 | "-ffunction-sections", |
| 240 | ], |
| 241 | ), |
| 242 | ], |
| 243 | with_features = [with_feature_set(features = ["opt"])], |
| 244 | ), |
| 245 | ], |
| 246 | ) |
Brian Silverman | 94cab07 | 2022-01-02 23:50:03 -0800 | [diff] [blame] | 247 | elif ctx.attr.cpu == "cortex-m4f": |
Austin Schuh | da9d060 | 2019-09-15 17:29:38 -0700 | [diff] [blame] | 248 | default_compile_flags_feature = feature( |
| 249 | name = "default_compile_flags", |
| 250 | enabled = True, |
| 251 | flag_sets = [ |
| 252 | flag_set( |
| 253 | actions = [ |
| 254 | ACTION_NAMES.assemble, |
| 255 | ACTION_NAMES.preprocess_assemble, |
| 256 | ACTION_NAMES.linkstamp_compile, |
| 257 | ACTION_NAMES.c_compile, |
| 258 | ACTION_NAMES.cpp_compile, |
| 259 | ACTION_NAMES.cpp_header_parsing, |
| 260 | ACTION_NAMES.cpp_module_compile, |
| 261 | ACTION_NAMES.cpp_module_codegen, |
| 262 | ACTION_NAMES.lto_backend, |
| 263 | ACTION_NAMES.clif_match, |
| 264 | ], |
| 265 | flag_groups = [ |
| 266 | flag_group( |
| 267 | flags = [ |
| 268 | "-D__STDC_FORMAT_MACROS", |
| 269 | "-D__STDC_CONSTANT_MACROS", |
| 270 | "-D__STDC_LIMIT_MACROS", |
| 271 | "-D__MK64FX512__", |
| 272 | "-DF_CPU=120000000", |
| 273 | "-Wl,--gc-sections", |
| 274 | "-D__have_long32", |
| 275 | "-fstack-protector", |
| 276 | "-mcpu=cortex-m4", |
| 277 | "-mfpu=fpv4-sp-d16", |
| 278 | "-mthumb", |
| 279 | "-mfloat-abi=hard", |
| 280 | "-fno-strict-aliasing", |
| 281 | "-fmessage-length=80", |
| 282 | "-fmax-errors=20", |
| 283 | "-Wall", |
| 284 | "-Wextra", |
| 285 | "-Wpointer-arith", |
| 286 | "-Wcast-qual", |
| 287 | "-Wwrite-strings", |
| 288 | "-Wtype-limits", |
| 289 | "-Wsign-compare", |
| 290 | "-Wformat=2", |
| 291 | "-Werror", |
| 292 | "-Wstrict-aliasing=2", |
| 293 | "-Wno-misleading-indentation", |
| 294 | "-Wno-int-in-bool-context", |
| 295 | "-Wdouble-promotion", |
| 296 | "-pipe", |
| 297 | "-g", |
| 298 | "-fno-common", |
| 299 | "-ffreestanding", |
| 300 | "-fbuiltin", |
| 301 | ], |
| 302 | ), |
| 303 | ], |
| 304 | ), |
| 305 | flag_set( |
| 306 | actions = [ |
| 307 | ACTION_NAMES.assemble, |
| 308 | ACTION_NAMES.preprocess_assemble, |
| 309 | ACTION_NAMES.linkstamp_compile, |
| 310 | ACTION_NAMES.c_compile, |
| 311 | ACTION_NAMES.cpp_compile, |
| 312 | ACTION_NAMES.cpp_header_parsing, |
| 313 | ACTION_NAMES.cpp_module_compile, |
| 314 | ACTION_NAMES.cpp_module_codegen, |
| 315 | ACTION_NAMES.lto_backend, |
| 316 | ACTION_NAMES.clif_match, |
| 317 | ], |
| 318 | flag_groups = [ |
| 319 | flag_group( |
| 320 | flags = [ |
| 321 | "-O2", |
| 322 | "-finline-functions", |
| 323 | "-ffast-math", |
| 324 | "-funroll-loops", |
| 325 | "-DNDEBUG", |
| 326 | "-ffunction-sections", |
| 327 | ], |
| 328 | ), |
| 329 | ], |
| 330 | with_features = [with_feature_set(features = ["opt"])], |
| 331 | ), |
| 332 | ], |
| 333 | ) |
Brian Silverman | 94cab07 | 2022-01-02 23:50:03 -0800 | [diff] [blame] | 334 | elif ctx.attr.cpu == "rp2040": |
Austin Schuh | 0a96ea3 | 2022-01-01 22:29:30 -0800 | [diff] [blame] | 335 | default_compile_flags_feature = feature( |
| 336 | name = "default_compile_flags", |
| 337 | enabled = True, |
| 338 | flag_sets = [ |
| 339 | flag_set( |
| 340 | actions = [ |
| 341 | ACTION_NAMES.assemble, |
| 342 | ACTION_NAMES.preprocess_assemble, |
| 343 | ACTION_NAMES.linkstamp_compile, |
| 344 | ACTION_NAMES.c_compile, |
| 345 | ACTION_NAMES.cpp_compile, |
| 346 | ACTION_NAMES.cpp_header_parsing, |
| 347 | ACTION_NAMES.cpp_module_compile, |
| 348 | ACTION_NAMES.cpp_module_codegen, |
| 349 | ACTION_NAMES.lto_backend, |
| 350 | ACTION_NAMES.clif_match, |
| 351 | ], |
| 352 | flag_groups = [ |
| 353 | flag_group( |
| 354 | flags = [ |
| 355 | "-DPICO_BOARD=\"pico\"", |
| 356 | "-DPICO_BUILD=1", |
| 357 | "-DPICO_NO_HARDWARE=0", |
| 358 | "-DPICO_ON_DEVICE=1", |
| 359 | "-D__STDC_FORMAT_MACROS", |
| 360 | "-D__STDC_CONSTANT_MACROS", |
| 361 | "-D__STDC_LIMIT_MACROS", |
| 362 | "-Wl,--gc-sections", |
| 363 | "-fstack-protector", |
| 364 | "-mcpu=cortex-m0plus", |
| 365 | "-mthumb", |
| 366 | "-fno-strict-aliasing", |
| 367 | "-fmessage-length=80", |
| 368 | "-fmax-errors=20", |
| 369 | "-Wall", |
| 370 | "-Wextra", |
| 371 | "-Wpointer-arith", |
| 372 | "-Wcast-qual", |
| 373 | "-Wwrite-strings", |
| 374 | "-Wtype-limits", |
| 375 | "-Wsign-compare", |
| 376 | "-Wformat=2", |
| 377 | "-Werror", |
| 378 | "-Wstrict-aliasing=2", |
| 379 | "-Wno-misleading-indentation", |
| 380 | "-Wno-int-in-bool-context", |
| 381 | "-Wdouble-promotion", |
| 382 | "-pipe", |
| 383 | "-g", |
| 384 | ], |
| 385 | ), |
| 386 | ], |
| 387 | ), |
| 388 | flag_set( |
| 389 | actions = [ |
| 390 | ACTION_NAMES.assemble, |
| 391 | ACTION_NAMES.preprocess_assemble, |
| 392 | ACTION_NAMES.linkstamp_compile, |
| 393 | ACTION_NAMES.c_compile, |
| 394 | ACTION_NAMES.cpp_compile, |
| 395 | ACTION_NAMES.cpp_header_parsing, |
| 396 | ACTION_NAMES.cpp_module_compile, |
| 397 | ACTION_NAMES.cpp_module_codegen, |
| 398 | ACTION_NAMES.lto_backend, |
| 399 | ACTION_NAMES.clif_match, |
| 400 | ], |
| 401 | flag_groups = [ |
| 402 | flag_group( |
| 403 | flags = [ |
| 404 | "-O3", |
| 405 | "-finline-functions", |
| 406 | "-funroll-loops", |
| 407 | "-DNDEBUG", |
| 408 | "-ffunction-sections", |
| 409 | ], |
| 410 | ), |
| 411 | ], |
| 412 | with_features = [with_feature_set(features = ["opt"])], |
| 413 | ), |
| 414 | ], |
| 415 | ) |
Austin Schuh | da9d060 | 2019-09-15 17:29:38 -0700 | [diff] [blame] | 416 | else: |
| 417 | default_compile_flags_feature = None |
| 418 | |
Brian Silverman | 4c7235a | 2021-11-17 19:04:37 -0800 | [diff] [blame] | 419 | if ctx.attr.cpu == "roborio": |
Austin Schuh | da9d060 | 2019-09-15 17:29:38 -0700 | [diff] [blame] | 420 | dbg_feature = feature( |
| 421 | name = "dbg", |
| 422 | flag_sets = [ |
| 423 | flag_set( |
Brian Silverman | 7b53ae1 | 2022-05-22 21:40:57 -0700 | [diff] [blame] | 424 | actions = all_cpp_compile_actions + [ |
Austin Schuh | da9d060 | 2019-09-15 17:29:38 -0700 | [diff] [blame] | 425 | ACTION_NAMES.preprocess_assemble, |
| 426 | ACTION_NAMES.c_compile, |
Austin Schuh | da9d060 | 2019-09-15 17:29:38 -0700 | [diff] [blame] | 427 | ], |
| 428 | flag_groups = [ |
| 429 | flag_group(flags = ["-DAOS_DEBUG=1"]), |
| 430 | flag_group(flags = ["-fno-omit-frame-pointer"]), |
| 431 | ], |
| 432 | ), |
| 433 | ], |
| 434 | ) |
Austin Schuh | 0a96ea3 | 2022-01-01 22:29:30 -0800 | [diff] [blame] | 435 | elif (ctx.attr.cpu == "rp2040" or |
| 436 | ctx.attr.cpu == "cortex-m4f" or |
Austin Schuh | a2503a7 | 2020-12-15 20:57:57 -0800 | [diff] [blame] | 437 | ctx.attr.cpu == "cortex-m4f-k22"): |
Austin Schuh | da9d060 | 2019-09-15 17:29:38 -0700 | [diff] [blame] | 438 | dbg_feature = feature( |
| 439 | name = "dbg", |
| 440 | flag_sets = [ |
| 441 | flag_set( |
Brian Silverman | 7b53ae1 | 2022-05-22 21:40:57 -0700 | [diff] [blame] | 442 | actions = all_cpp_compile_actions + [ |
Austin Schuh | da9d060 | 2019-09-15 17:29:38 -0700 | [diff] [blame] | 443 | ACTION_NAMES.preprocess_assemble, |
| 444 | ACTION_NAMES.c_compile, |
Austin Schuh | da9d060 | 2019-09-15 17:29:38 -0700 | [diff] [blame] | 445 | ], |
| 446 | flag_groups = [flag_group(flags = ["-fno-omit-frame-pointer"])], |
| 447 | ), |
| 448 | ], |
| 449 | implies = ["all_modes"], |
| 450 | ) |
| 451 | else: |
| 452 | dbg_feature = None |
| 453 | |
Brian Silverman | 4c7235a | 2021-11-17 19:04:37 -0800 | [diff] [blame] | 454 | if ctx.attr.cpu == "roborio": |
Austin Schuh | da9d060 | 2019-09-15 17:29:38 -0700 | [diff] [blame] | 455 | fastbuild_feature = feature( |
| 456 | name = "fastbuild", |
| 457 | flag_sets = [ |
| 458 | flag_set( |
Brian Silverman | 7b53ae1 | 2022-05-22 21:40:57 -0700 | [diff] [blame] | 459 | actions = all_cpp_compile_actions + [ |
Austin Schuh | da9d060 | 2019-09-15 17:29:38 -0700 | [diff] [blame] | 460 | ACTION_NAMES.preprocess_assemble, |
| 461 | ACTION_NAMES.c_compile, |
Austin Schuh | da9d060 | 2019-09-15 17:29:38 -0700 | [diff] [blame] | 462 | ], |
| 463 | flag_groups = [flag_group(flags = ["-DAOS_DEBUG=0"])], |
| 464 | ), |
| 465 | ], |
| 466 | ) |
Austin Schuh | 0a96ea3 | 2022-01-01 22:29:30 -0800 | [diff] [blame] | 467 | elif (ctx.attr.cpu == "rp2040" or |
| 468 | ctx.attr.cpu == "cortex-m4f" or |
Austin Schuh | a2503a7 | 2020-12-15 20:57:57 -0800 | [diff] [blame] | 469 | ctx.attr.cpu == "cortex-m4f-k22"): |
Austin Schuh | da9d060 | 2019-09-15 17:29:38 -0700 | [diff] [blame] | 470 | fastbuild_feature = feature(name = "fastbuild", implies = ["all_modes"]) |
| 471 | else: |
| 472 | fastbuild_feature = None |
| 473 | |
| 474 | pie_for_linking_feature = feature( |
| 475 | name = "pie_for_linking", |
| 476 | enabled = True, |
| 477 | flag_sets = [ |
| 478 | flag_set( |
| 479 | actions = [ACTION_NAMES.cpp_link_executable], |
| 480 | flag_groups = [flag_group(flags = ["-pie"])], |
| 481 | ), |
| 482 | ], |
| 483 | ) |
| 484 | |
Brian Silverman | 94cab07 | 2022-01-02 23:50:03 -0800 | [diff] [blame] | 485 | if ctx.attr.cpu == "roborio": |
Austin Schuh | da9d060 | 2019-09-15 17:29:38 -0700 | [diff] [blame] | 486 | opt_feature = feature( |
| 487 | name = "opt", |
| 488 | flag_sets = [ |
| 489 | flag_set( |
| 490 | actions = [ |
| 491 | ACTION_NAMES.assemble, |
| 492 | ACTION_NAMES.preprocess_assemble, |
| 493 | ACTION_NAMES.c_compile, |
| 494 | ACTION_NAMES.cpp_compile, |
| 495 | ACTION_NAMES.cpp_module_compile, |
| 496 | ACTION_NAMES.objc_compile, |
| 497 | ACTION_NAMES.objcpp_compile, |
| 498 | ACTION_NAMES.cpp_header_parsing, |
| 499 | ACTION_NAMES.linkstamp_compile, |
| 500 | ], |
| 501 | flag_groups = [ |
| 502 | flag_group( |
| 503 | flags = [ |
| 504 | "-O2", |
| 505 | "-DNDEBUG", |
| 506 | "-D_FORTIFY_SOURCE=1", |
| 507 | "-ffunction-sections", |
| 508 | "-fdata-sections", |
| 509 | ], |
| 510 | ), |
| 511 | ], |
| 512 | ), |
| 513 | flag_set( |
| 514 | actions = [ |
| 515 | ACTION_NAMES.cpp_link_executable, |
| 516 | ACTION_NAMES.cpp_link_nodeps_dynamic_library, |
| 517 | ACTION_NAMES.cpp_link_dynamic_library, |
| 518 | ], |
| 519 | flag_groups = [flag_group(flags = ["-Wl,--gc-sections"])], |
| 520 | ), |
| 521 | ], |
| 522 | implies = ["opt_post"], |
| 523 | ) |
Austin Schuh | 0a96ea3 | 2022-01-01 22:29:30 -0800 | [diff] [blame] | 524 | elif (ctx.attr.cpu == "rp2040" or |
| 525 | ctx.attr.cpu == "cortex-m4f" or |
Austin Schuh | a2503a7 | 2020-12-15 20:57:57 -0800 | [diff] [blame] | 526 | ctx.attr.cpu == "cortex-m4f-k22"): |
Austin Schuh | da9d060 | 2019-09-15 17:29:38 -0700 | [diff] [blame] | 527 | opt_feature = feature(name = "opt", implies = ["all_modes"]) |
| 528 | else: |
| 529 | opt_feature = None |
| 530 | |
| 531 | pic_feature = feature( |
| 532 | name = "pic", |
| 533 | enabled = True, |
| 534 | flag_sets = [ |
| 535 | flag_set( |
| 536 | actions = [ |
| 537 | ACTION_NAMES.assemble, |
| 538 | ACTION_NAMES.preprocess_assemble, |
| 539 | ACTION_NAMES.linkstamp_compile, |
| 540 | ACTION_NAMES.c_compile, |
| 541 | ACTION_NAMES.cpp_compile, |
| 542 | ACTION_NAMES.cpp_module_codegen, |
| 543 | ACTION_NAMES.cpp_module_compile, |
| 544 | ], |
| 545 | flag_groups = [ |
| 546 | flag_group(flags = ["-fPIC"], expand_if_available = "pic"), |
| 547 | ], |
| 548 | ), |
| 549 | ], |
| 550 | ) |
| 551 | |
Austin Schuh | 0a96ea3 | 2022-01-01 22:29:30 -0800 | [diff] [blame] | 552 | if (ctx.attr.cpu == "rp2040" or |
| 553 | ctx.attr.cpu == "cortex-m4f" or |
Austin Schuh | a2503a7 | 2020-12-15 20:57:57 -0800 | [diff] [blame] | 554 | ctx.attr.cpu == "cortex-m4f-k22"): |
Austin Schuh | da9d060 | 2019-09-15 17:29:38 -0700 | [diff] [blame] | 555 | include_paths_feature = feature( |
| 556 | name = "include_paths", |
| 557 | enabled = True, |
| 558 | flag_sets = [ |
| 559 | flag_set( |
Brian Silverman | 7b53ae1 | 2022-05-22 21:40:57 -0700 | [diff] [blame] | 560 | actions = all_cpp_compile_actions + [ |
Austin Schuh | da9d060 | 2019-09-15 17:29:38 -0700 | [diff] [blame] | 561 | ACTION_NAMES.preprocess_assemble, |
| 562 | ACTION_NAMES.c_compile, |
Austin Schuh | da9d060 | 2019-09-15 17:29:38 -0700 | [diff] [blame] | 563 | ], |
| 564 | flag_groups = [ |
| 565 | flag_group( |
| 566 | flags = ["-iquote", "%{quote_include_paths}"], |
| 567 | iterate_over = "quote_include_paths", |
| 568 | ), |
| 569 | flag_group( |
| 570 | flags = ["-I%{include_paths}"], |
| 571 | iterate_over = "include_paths", |
| 572 | ), |
| 573 | flag_group( |
| 574 | flags = ["-I", "%{system_include_paths}"], |
| 575 | iterate_over = "system_include_paths", |
| 576 | ), |
| 577 | ], |
| 578 | ), |
| 579 | ], |
| 580 | ) |
Brian Silverman | 94cab07 | 2022-01-02 23:50:03 -0800 | [diff] [blame] | 581 | elif ctx.attr.cpu == "roborio": |
Austin Schuh | da9d060 | 2019-09-15 17:29:38 -0700 | [diff] [blame] | 582 | include_paths_feature = feature( |
| 583 | name = "include_paths", |
| 584 | enabled = True, |
| 585 | flag_sets = [ |
| 586 | flag_set( |
Brian Silverman | 7b53ae1 | 2022-05-22 21:40:57 -0700 | [diff] [blame] | 587 | actions = all_cpp_compile_actions + [ |
Austin Schuh | da9d060 | 2019-09-15 17:29:38 -0700 | [diff] [blame] | 588 | ACTION_NAMES.preprocess_assemble, |
| 589 | ACTION_NAMES.c_compile, |
Austin Schuh | da9d060 | 2019-09-15 17:29:38 -0700 | [diff] [blame] | 590 | ], |
| 591 | flag_groups = [ |
| 592 | flag_group( |
| 593 | flags = ["-iquote", "%{quote_include_paths}"], |
| 594 | iterate_over = "quote_include_paths", |
| 595 | ), |
| 596 | flag_group( |
| 597 | flags = ["-I%{include_paths}"], |
| 598 | iterate_over = "include_paths", |
| 599 | ), |
| 600 | flag_group( |
| 601 | flags = ["-isystem", "%{system_include_paths}"], |
| 602 | iterate_over = "system_include_paths", |
| 603 | ), |
| 604 | ], |
| 605 | ), |
| 606 | ], |
| 607 | ) |
| 608 | else: |
| 609 | include_paths_feature = None |
| 610 | |
| 611 | random_seed_feature = feature( |
| 612 | name = "random_seed", |
| 613 | enabled = True, |
| 614 | flag_sets = [ |
| 615 | flag_set( |
| 616 | actions = [ |
| 617 | ACTION_NAMES.cpp_compile, |
| 618 | ACTION_NAMES.cpp_module_codegen, |
| 619 | ACTION_NAMES.cpp_module_compile, |
| 620 | ], |
| 621 | flag_groups = [ |
| 622 | flag_group( |
| 623 | flags = ["-frandom-seed=%{output_file}"], |
| 624 | expand_if_available = "output_file", |
| 625 | ), |
| 626 | ], |
| 627 | ), |
| 628 | ], |
| 629 | ) |
| 630 | |
Brian Silverman | 94cab07 | 2022-01-02 23:50:03 -0800 | [diff] [blame] | 631 | if ctx.attr.cpu == "roborio": |
Austin Schuh | da9d060 | 2019-09-15 17:29:38 -0700 | [diff] [blame] | 632 | default_link_flags_feature = feature( |
| 633 | name = "default_link_flags", |
| 634 | enabled = True, |
| 635 | flag_sets = [ |
| 636 | flag_set( |
| 637 | actions = all_link_actions, |
| 638 | flag_groups = [ |
| 639 | flag_group( |
| 640 | flags = [ |
| 641 | "-lstdc++", |
| 642 | "-Ltools/cpp/arm-frc-linux-gnueabi/libs", |
| 643 | "-no-canonical-prefixes", |
| 644 | "-Wl,-z,relro,-z,now", |
| 645 | "-lm", |
| 646 | "-pass-exit-codes", |
| 647 | "-Wl,--build-id=md5", |
| 648 | "-Wl,--hash-style=gnu", |
| 649 | ], |
| 650 | ), |
| 651 | ], |
| 652 | ), |
| 653 | ], |
| 654 | ) |
Brian Silverman | 94cab07 | 2022-01-02 23:50:03 -0800 | [diff] [blame] | 655 | elif ctx.attr.cpu == "cortex-m4f-k22": |
Austin Schuh | da9d060 | 2019-09-15 17:29:38 -0700 | [diff] [blame] | 656 | default_link_flags_feature = feature( |
| 657 | name = "default_link_flags", |
| 658 | enabled = True, |
| 659 | flag_sets = [ |
| 660 | flag_set( |
| 661 | actions = all_link_actions, |
| 662 | flag_groups = [ |
| 663 | flag_group( |
| 664 | flags = [ |
| 665 | "-no-canonical-prefixes", |
| 666 | "-mcpu=cortex-m4", |
| 667 | "-mfpu=fpv4-sp-d16", |
| 668 | "-mthumb", |
| 669 | "-mfloat-abi=hard", |
| 670 | "-fno-strict-aliasing", |
| 671 | "--specs=nano.specs", |
| 672 | "-lgcc", |
| 673 | "-lstdc++_nano", |
| 674 | "-lm", |
| 675 | "-lc_nano", |
| 676 | "-Tmotors/core/kinetis_512_128.ld", |
| 677 | "-Tmotors/core/kinetis_sections.ld", |
| 678 | ], |
| 679 | ), |
| 680 | ], |
| 681 | ), |
| 682 | flag_set( |
| 683 | actions = all_link_actions, |
| 684 | flag_groups = [flag_group(flags = ["-Wl,--gc-sections"])], |
| 685 | with_features = [with_feature_set(features = ["opt"])], |
| 686 | ), |
| 687 | ], |
| 688 | ) |
Brian Silverman | 94cab07 | 2022-01-02 23:50:03 -0800 | [diff] [blame] | 689 | elif ctx.attr.cpu == "cortex-m4f": |
Austin Schuh | da9d060 | 2019-09-15 17:29:38 -0700 | [diff] [blame] | 690 | default_link_flags_feature = feature( |
| 691 | name = "default_link_flags", |
| 692 | enabled = True, |
| 693 | flag_sets = [ |
| 694 | flag_set( |
| 695 | actions = all_link_actions, |
| 696 | flag_groups = [ |
| 697 | flag_group( |
| 698 | flags = [ |
| 699 | "-no-canonical-prefixes", |
| 700 | "-mcpu=cortex-m4", |
| 701 | "-mfpu=fpv4-sp-d16", |
| 702 | "-mthumb", |
| 703 | "-mfloat-abi=hard", |
| 704 | "-fno-strict-aliasing", |
| 705 | "--specs=nano.specs", |
| 706 | "-lgcc", |
| 707 | "-lstdc++_nano", |
| 708 | "-lm", |
| 709 | "-lc_nano", |
| 710 | "-Tmotors/core/kinetis_512_256.ld", |
| 711 | "-Tmotors/core/kinetis_sections.ld", |
| 712 | ], |
| 713 | ), |
| 714 | ], |
| 715 | ), |
| 716 | flag_set( |
| 717 | actions = all_link_actions, |
| 718 | flag_groups = [flag_group(flags = ["-Wl,--gc-sections"])], |
| 719 | with_features = [with_feature_set(features = ["opt"])], |
| 720 | ), |
| 721 | ], |
| 722 | ) |
Brian Silverman | 94cab07 | 2022-01-02 23:50:03 -0800 | [diff] [blame] | 723 | elif ctx.attr.cpu == "rp2040": |
Austin Schuh | 0a96ea3 | 2022-01-01 22:29:30 -0800 | [diff] [blame] | 724 | default_link_flags_feature = feature( |
| 725 | name = "default_link_flags", |
| 726 | enabled = True, |
| 727 | flag_sets = [ |
| 728 | flag_set( |
| 729 | actions = all_link_actions, |
| 730 | flag_groups = [ |
| 731 | flag_group( |
| 732 | flags = [ |
| 733 | "-no-canonical-prefixes", |
| 734 | "-mcpu=cortex-m0plus", |
| 735 | "-mthumb", |
| 736 | "-fno-strict-aliasing", |
| 737 | "-Wl,--build-id=none", |
| 738 | "--specs=nosys.specs", |
| 739 | "-nostartfiles", |
| 740 | ], |
| 741 | ), |
| 742 | ], |
| 743 | ), |
| 744 | # TODO(austin): I'd love to turn --gc-sections on, but that breaks things. |
| 745 | ], |
| 746 | ) |
Austin Schuh | da9d060 | 2019-09-15 17:29:38 -0700 | [diff] [blame] | 747 | else: |
| 748 | default_link_flags_feature = None |
| 749 | |
Brian Silverman | 94cab07 | 2022-01-02 23:50:03 -0800 | [diff] [blame] | 750 | if ctx.attr.cpu == "roborio": |
Austin Schuh | da9d060 | 2019-09-15 17:29:38 -0700 | [diff] [blame] | 751 | all_modes_feature = feature( |
| 752 | name = "all_modes", |
| 753 | enabled = True, |
| 754 | flag_sets = [ |
| 755 | flag_set( |
| 756 | actions = [ |
| 757 | ACTION_NAMES.preprocess_assemble, |
| 758 | ACTION_NAMES.assemble, |
| 759 | ACTION_NAMES.c_compile, |
| 760 | ], |
| 761 | flag_groups = [flag_group(flags = ["-std=gnu99"])], |
| 762 | ), |
| 763 | flag_set( |
Brian Silverman | 7b53ae1 | 2022-05-22 21:40:57 -0700 | [diff] [blame] | 764 | actions = all_cpp_compile_actions, |
Austin Schuh | da9d060 | 2019-09-15 17:29:38 -0700 | [diff] [blame] | 765 | flag_groups = [ |
| 766 | flag_group( |
James Kuszmaul | 9776b39 | 2023-01-14 14:08:08 -0800 | [diff] [blame] | 767 | flags = ["-std=gnu++20", "-fno-sized-deallocation"], |
Austin Schuh | da9d060 | 2019-09-15 17:29:38 -0700 | [diff] [blame] | 768 | ), |
| 769 | ], |
| 770 | ), |
| 771 | flag_set( |
Brian Silverman | 7b53ae1 | 2022-05-22 21:40:57 -0700 | [diff] [blame] | 772 | actions = all_cpp_compile_actions + [ |
Austin Schuh | da9d060 | 2019-09-15 17:29:38 -0700 | [diff] [blame] | 773 | ACTION_NAMES.preprocess_assemble, |
| 774 | ACTION_NAMES.assemble, |
| 775 | "c++-link", |
Austin Schuh | da9d060 | 2019-09-15 17:29:38 -0700 | [diff] [blame] | 776 | ACTION_NAMES.c_compile, |
| 777 | ], |
| 778 | flag_groups = [flag_group(flags = ["-pthread"])], |
| 779 | ), |
| 780 | ], |
| 781 | ) |
Austin Schuh | 0a96ea3 | 2022-01-01 22:29:30 -0800 | [diff] [blame] | 782 | elif (ctx.attr.cpu == "rp2040" or |
| 783 | ctx.attr.cpu == "cortex-m4f" or |
Austin Schuh | a2503a7 | 2020-12-15 20:57:57 -0800 | [diff] [blame] | 784 | ctx.attr.cpu == "cortex-m4f-k22"): |
Austin Schuh | da9d060 | 2019-09-15 17:29:38 -0700 | [diff] [blame] | 785 | all_modes_feature = feature( |
| 786 | name = "all_modes", |
| 787 | flag_sets = [ |
| 788 | flag_set( |
| 789 | actions = [ |
| 790 | ACTION_NAMES.preprocess_assemble, |
| 791 | ACTION_NAMES.assemble, |
| 792 | ACTION_NAMES.c_compile, |
| 793 | ], |
Austin Schuh | 0a96ea3 | 2022-01-01 22:29:30 -0800 | [diff] [blame] | 794 | flag_groups = [flag_group(flags = ["--std=gnu11"])], |
Austin Schuh | da9d060 | 2019-09-15 17:29:38 -0700 | [diff] [blame] | 795 | ), |
| 796 | flag_set( |
Brian Silverman | 7b53ae1 | 2022-05-22 21:40:57 -0700 | [diff] [blame] | 797 | actions = all_cpp_compile_actions, |
Austin Schuh | da9d060 | 2019-09-15 17:29:38 -0700 | [diff] [blame] | 798 | flag_groups = [ |
| 799 | flag_group( |
| 800 | flags = ["--std=gnu++1z", "-fno-exceptions", "-fno-rtti"], |
| 801 | ), |
| 802 | ], |
| 803 | ), |
| 804 | ], |
| 805 | ) |
Austin Schuh | da9d060 | 2019-09-15 17:29:38 -0700 | [diff] [blame] | 806 | else: |
| 807 | all_modes_feature = None |
| 808 | |
| 809 | supports_dynamic_linker_feature = feature(name = "supports_dynamic_linker", enabled = True) |
| 810 | |
Brian Silverman | 4c7235a | 2021-11-17 19:04:37 -0800 | [diff] [blame] | 811 | if (ctx.attr.cpu == "rp2040" or |
| 812 | ctx.attr.cpu == "cortex-m4f" or |
| 813 | ctx.attr.cpu == "cortex-m4f-k22" or |
| 814 | ctx.attr.cpu == "roborio"): |
Austin Schuh | da9d060 | 2019-09-15 17:29:38 -0700 | [diff] [blame] | 815 | unfiltered_compile_flags_feature = feature( |
| 816 | name = "unfiltered_compile_flags", |
| 817 | enabled = True, |
| 818 | flag_sets = [ |
| 819 | flag_set( |
| 820 | actions = [ |
| 821 | ACTION_NAMES.assemble, |
| 822 | ACTION_NAMES.preprocess_assemble, |
| 823 | ACTION_NAMES.linkstamp_compile, |
| 824 | ACTION_NAMES.c_compile, |
| 825 | ACTION_NAMES.cpp_compile, |
| 826 | ACTION_NAMES.cpp_header_parsing, |
| 827 | ACTION_NAMES.cpp_module_compile, |
| 828 | ACTION_NAMES.cpp_module_codegen, |
| 829 | ACTION_NAMES.lto_backend, |
| 830 | ACTION_NAMES.clif_match, |
| 831 | ], |
| 832 | flag_groups = [ |
| 833 | flag_group( |
| 834 | flags = [ |
| 835 | "-no-canonical-prefixes", |
| 836 | "-Wno-builtin-macro-redefined", |
| 837 | "-D__DATE__=\"redacted\"", |
| 838 | "-D__TIMESTAMP__=\"redacted\"", |
| 839 | "-D__TIME__=\"redacted\"", |
Austin Schuh | da9d060 | 2019-09-15 17:29:38 -0700 | [diff] [blame] | 840 | ], |
| 841 | ), |
| 842 | ], |
| 843 | ), |
| 844 | ], |
| 845 | ) |
| 846 | else: |
| 847 | unfiltered_compile_flags_feature = None |
| 848 | |
| 849 | dependency_file_feature = feature( |
| 850 | name = "dependency_file", |
| 851 | enabled = True, |
| 852 | flag_sets = [ |
| 853 | flag_set( |
| 854 | actions = [ |
| 855 | ACTION_NAMES.assemble, |
| 856 | ACTION_NAMES.preprocess_assemble, |
| 857 | ACTION_NAMES.c_compile, |
| 858 | ACTION_NAMES.cpp_compile, |
| 859 | ACTION_NAMES.cpp_module_compile, |
| 860 | ACTION_NAMES.objc_compile, |
| 861 | ACTION_NAMES.objcpp_compile, |
| 862 | ACTION_NAMES.cpp_header_parsing, |
| 863 | ACTION_NAMES.clif_match, |
| 864 | ], |
| 865 | flag_groups = [ |
| 866 | flag_group( |
| 867 | flags = ["-MD", "-MF", "%{dependency_file}"], |
| 868 | expand_if_available = "dependency_file", |
| 869 | ), |
| 870 | ], |
| 871 | ), |
| 872 | ], |
| 873 | ) |
| 874 | |
Austin Schuh | da9d060 | 2019-09-15 17:29:38 -0700 | [diff] [blame] | 875 | user_compile_flags_feature = feature( |
| 876 | name = "user_compile_flags", |
| 877 | enabled = True, |
| 878 | flag_sets = [ |
| 879 | flag_set( |
| 880 | actions = [ |
| 881 | ACTION_NAMES.assemble, |
| 882 | ACTION_NAMES.preprocess_assemble, |
| 883 | ACTION_NAMES.linkstamp_compile, |
| 884 | ACTION_NAMES.c_compile, |
| 885 | ACTION_NAMES.cpp_compile, |
| 886 | ACTION_NAMES.cpp_header_parsing, |
| 887 | ACTION_NAMES.cpp_module_compile, |
| 888 | ACTION_NAMES.cpp_module_codegen, |
| 889 | ACTION_NAMES.lto_backend, |
| 890 | ACTION_NAMES.clif_match, |
| 891 | ], |
| 892 | flag_groups = [ |
| 893 | flag_group( |
| 894 | flags = ["%{user_compile_flags}"], |
| 895 | iterate_over = "user_compile_flags", |
| 896 | expand_if_available = "user_compile_flags", |
| 897 | ), |
| 898 | ], |
| 899 | ), |
| 900 | ], |
| 901 | ) |
| 902 | |
| 903 | sysroot_feature = feature( |
| 904 | name = "sysroot", |
| 905 | enabled = True, |
| 906 | flag_sets = [ |
| 907 | flag_set( |
| 908 | actions = [ |
| 909 | ACTION_NAMES.preprocess_assemble, |
| 910 | ACTION_NAMES.linkstamp_compile, |
| 911 | ACTION_NAMES.c_compile, |
| 912 | ACTION_NAMES.cpp_compile, |
| 913 | ACTION_NAMES.cpp_header_parsing, |
| 914 | ACTION_NAMES.cpp_module_compile, |
| 915 | ACTION_NAMES.cpp_module_codegen, |
| 916 | ACTION_NAMES.lto_backend, |
| 917 | ACTION_NAMES.clif_match, |
| 918 | ACTION_NAMES.cpp_link_executable, |
| 919 | ACTION_NAMES.cpp_link_dynamic_library, |
| 920 | ACTION_NAMES.cpp_link_nodeps_dynamic_library, |
| 921 | ], |
| 922 | flag_groups = [ |
| 923 | flag_group( |
| 924 | flags = ["--sysroot=%{sysroot}"], |
| 925 | expand_if_available = "sysroot", |
| 926 | ), |
| 927 | ], |
| 928 | ), |
| 929 | ], |
| 930 | ) |
| 931 | |
| 932 | compile_flags1_feature = feature( |
| 933 | name = "compile_flags1", |
| 934 | enabled = True, |
| 935 | flag_sets = [ |
| 936 | flag_set( |
| 937 | actions = [ |
| 938 | ACTION_NAMES.assemble, |
| 939 | ACTION_NAMES.preprocess_assemble, |
| 940 | ACTION_NAMES.c_compile, |
| 941 | ACTION_NAMES.cpp_compile, |
| 942 | ACTION_NAMES.cpp_header_parsing, |
| 943 | ACTION_NAMES.cpp_module_compile, |
| 944 | ACTION_NAMES.cpp_module_codegen, |
| 945 | ACTION_NAMES.lto_backend, |
| 946 | ACTION_NAMES.clif_match, |
| 947 | ], |
| 948 | flag_groups = [ |
| 949 | flag_group( |
| 950 | flags = [ |
James Kuszmaul | 9776b39 | 2023-01-14 14:08:08 -0800 | [diff] [blame] | 951 | "--sysroot=external/arm_frc_linux_gnueabi_repo/arm-nilrt-linux-gnueabi/sysroot", |
Austin Schuh | da9d060 | 2019-09-15 17:29:38 -0700 | [diff] [blame] | 952 | "-nostdinc", |
| 953 | "-isystem", |
James Kuszmaul | 9776b39 | 2023-01-14 14:08:08 -0800 | [diff] [blame] | 954 | "external/arm_frc_linux_gnueabi_repo/arm-nilrt-linux-gnueabi/sysroot/usr/lib/gcc/arm-nilrt-linux-gnueabi/12/include", |
Austin Schuh | da9d060 | 2019-09-15 17:29:38 -0700 | [diff] [blame] | 955 | "-isystem", |
James Kuszmaul | 9776b39 | 2023-01-14 14:08:08 -0800 | [diff] [blame] | 956 | "external/arm_frc_linux_gnueabi_repo/arm-nilrt-linux-gnueabi/sysroot/usr/lib/gcc/arm-nilrt-linux-gnueabi/12/include-fixed", |
Austin Schuh | da9d060 | 2019-09-15 17:29:38 -0700 | [diff] [blame] | 957 | ], |
| 958 | ), |
| 959 | ], |
| 960 | ), |
| 961 | flag_set( |
Brian Silverman | 7b53ae1 | 2022-05-22 21:40:57 -0700 | [diff] [blame] | 962 | actions = all_cpp_compile_actions + [ |
Austin Schuh | da9d060 | 2019-09-15 17:29:38 -0700 | [diff] [blame] | 963 | ACTION_NAMES.assemble, |
| 964 | ACTION_NAMES.preprocess_assemble, |
Austin Schuh | da9d060 | 2019-09-15 17:29:38 -0700 | [diff] [blame] | 965 | ], |
| 966 | flag_groups = [flag_group(flags = ["-fno-canonical-system-headers"])], |
| 967 | ), |
| 968 | flag_set( |
| 969 | actions = [ |
| 970 | ACTION_NAMES.cpp_compile, |
| 971 | ACTION_NAMES.cpp_header_parsing, |
| 972 | ACTION_NAMES.cpp_module_compile, |
| 973 | ACTION_NAMES.cpp_module_codegen, |
| 974 | ], |
| 975 | flag_groups = [ |
| 976 | flag_group( |
| 977 | flags = [ |
| 978 | "-isystem", |
James Kuszmaul | 9776b39 | 2023-01-14 14:08:08 -0800 | [diff] [blame] | 979 | "external/arm_frc_linux_gnueabi_repo/arm-nilrt-linux-gnueabi/sysroot/usr/include/c++/12", |
Austin Schuh | da9d060 | 2019-09-15 17:29:38 -0700 | [diff] [blame] | 980 | "-isystem", |
James Kuszmaul | 9776b39 | 2023-01-14 14:08:08 -0800 | [diff] [blame] | 981 | "external/arm_frc_linux_gnueabi_repo/arm-nilrt-linux-gnueabi/sysroot/usr/include/c++/12/arm-nilrt-linux-gnueabi", |
Austin Schuh | da9d060 | 2019-09-15 17:29:38 -0700 | [diff] [blame] | 982 | "-isystem", |
James Kuszmaul | 9776b39 | 2023-01-14 14:08:08 -0800 | [diff] [blame] | 983 | "external/arm_frc_linux_gnueabi_repo/arm-nilrt-linux-gnueabi/sysroot/usr/include/c++/12/backward", |
Austin Schuh | da9d060 | 2019-09-15 17:29:38 -0700 | [diff] [blame] | 984 | ], |
| 985 | ), |
| 986 | ], |
| 987 | ), |
| 988 | flag_set( |
| 989 | actions = [ |
| 990 | ACTION_NAMES.assemble, |
| 991 | ACTION_NAMES.preprocess_assemble, |
| 992 | ACTION_NAMES.c_compile, |
| 993 | ACTION_NAMES.cpp_compile, |
| 994 | ACTION_NAMES.cpp_header_parsing, |
| 995 | ACTION_NAMES.cpp_module_compile, |
| 996 | ACTION_NAMES.cpp_module_codegen, |
| 997 | ACTION_NAMES.lto_backend, |
| 998 | ACTION_NAMES.clif_match, |
| 999 | ], |
| 1000 | flag_groups = [ |
| 1001 | flag_group( |
| 1002 | flags = [ |
| 1003 | "-isystem", |
James Kuszmaul | 9776b39 | 2023-01-14 14:08:08 -0800 | [diff] [blame] | 1004 | "external/arm_frc_linux_gnueabi_repo/arm-nilrt-linux-gnueabi/sysroot/usr/include", |
Austin Schuh | da9d060 | 2019-09-15 17:29:38 -0700 | [diff] [blame] | 1005 | "-mfpu=neon", |
| 1006 | "-D__STDC_FORMAT_MACROS", |
| 1007 | "-D__STDC_CONSTANT_MACROS", |
| 1008 | "-D__STDC_LIMIT_MACROS", |
| 1009 | "-D_FILE_OFFSET_BITS=64", |
| 1010 | "-DAOS_ARCHITECTURE_arm_frc", |
| 1011 | "-U_FORTIFY_SOURCE", |
| 1012 | "-fstack-protector", |
| 1013 | "-fPIE", |
| 1014 | "-fdiagnostics-color=always", |
| 1015 | "-Wall", |
| 1016 | "-Wextra", |
| 1017 | "-Wpointer-arith", |
| 1018 | "-Wstrict-aliasing", |
| 1019 | "-Wcast-qual", |
| 1020 | "-Wwrite-strings", |
| 1021 | "-Wtype-limits", |
| 1022 | "-Wsign-compare", |
| 1023 | "-Wformat=2", |
| 1024 | "-Werror", |
| 1025 | "-Wunused-local-typedefs", |
| 1026 | "-Wno-psabi", |
| 1027 | "-fno-omit-frame-pointer", |
| 1028 | "-D__has_feature(x)=0", |
| 1029 | "-pipe", |
| 1030 | "-ggdb3", |
| 1031 | ], |
| 1032 | ), |
| 1033 | ], |
| 1034 | ), |
| 1035 | ], |
| 1036 | ) |
| 1037 | |
Austin Schuh | 0a96ea3 | 2022-01-01 22:29:30 -0800 | [diff] [blame] | 1038 | if (ctx.attr.cpu == "rp2040" or |
| 1039 | ctx.attr.cpu == "cortex-m4f" or |
Austin Schuh | a2503a7 | 2020-12-15 20:57:57 -0800 | [diff] [blame] | 1040 | ctx.attr.cpu == "cortex-m4f-k22"): |
Austin Schuh | da9d060 | 2019-09-15 17:29:38 -0700 | [diff] [blame] | 1041 | features = [ |
Austin Schuh | a2503a7 | 2020-12-15 20:57:57 -0800 | [diff] [blame] | 1042 | default_compile_flags_feature, |
| 1043 | default_link_flags_feature, |
| 1044 | dbg_feature, |
| 1045 | opt_feature, |
| 1046 | fastbuild_feature, |
| 1047 | all_modes_feature, |
| 1048 | include_paths_feature, |
Austin Schuh | a2503a7 | 2020-12-15 20:57:57 -0800 | [diff] [blame] | 1049 | user_compile_flags_feature, |
| 1050 | sysroot_feature, |
| 1051 | unfiltered_compile_flags_feature, |
| 1052 | ] |
Brian Silverman | 94cab07 | 2022-01-02 23:50:03 -0800 | [diff] [blame] | 1053 | elif ctx.attr.cpu == "roborio": |
Austin Schuh | da9d060 | 2019-09-15 17:29:38 -0700 | [diff] [blame] | 1054 | features = [ |
Austin Schuh | a2503a7 | 2020-12-15 20:57:57 -0800 | [diff] [blame] | 1055 | default_link_flags_feature, |
| 1056 | compile_flags1_feature, |
| 1057 | opt_feature, |
| 1058 | dependency_file_feature, |
| 1059 | random_seed_feature, |
| 1060 | pic_feature, |
| 1061 | include_paths_feature, |
| 1062 | opt_post_feature, |
| 1063 | dbg_feature, |
| 1064 | fastbuild_feature, |
| 1065 | all_modes_feature, |
| 1066 | pie_for_linking_feature, |
| 1067 | supports_dynamic_linker_feature, |
| 1068 | supports_pic_feature, |
Austin Schuh | a2503a7 | 2020-12-15 20:57:57 -0800 | [diff] [blame] | 1069 | user_compile_flags_feature, |
| 1070 | sysroot_feature, |
| 1071 | unfiltered_compile_flags_feature, |
| 1072 | ] |
Austin Schuh | da9d060 | 2019-09-15 17:29:38 -0700 | [diff] [blame] | 1073 | else: |
| 1074 | fail("Unreachable") |
| 1075 | |
Brian Silverman | 33ca369 | 2022-02-06 18:37:17 -0800 | [diff] [blame] | 1076 | if ctx.attr.cpu == "roborio": |
Austin Schuh | da9d060 | 2019-09-15 17:29:38 -0700 | [diff] [blame] | 1077 | cxx_builtin_include_directories = [ |
James Kuszmaul | 9776b39 | 2023-01-14 14:08:08 -0800 | [diff] [blame] | 1078 | "%package(@arm_frc_linux_gnueabi_repo//arm-nilrt-linux-gnueabi/sysroot/usr/lib/gcc/arm-nilrt-linux-gnueabi/12/include)%", |
| 1079 | "%package(@arm_frc_linux_gnueabi_repo//arm-nilrt-linux-gnueabi/sysroot/usr/lib/gcc/arm-nilrt-linux-gnueabi/12/include-fixed)%", |
| 1080 | "%package(@arm_frc_linux_gnueabi_repo//arm-nilrt-linux-gnueabi/sysroot/usr/include/c++/12/arm-nilrt-linux-gnueabi)%", |
| 1081 | "%package(@arm_frc_linux_gnueabi_repo//arm-nilrt-linux-gnueabi/sysroot/usr/include/c++/12/backward)%", |
Austin Schuh | a2503a7 | 2020-12-15 20:57:57 -0800 | [diff] [blame] | 1082 | ] |
Austin Schuh | 0a96ea3 | 2022-01-01 22:29:30 -0800 | [diff] [blame] | 1083 | elif (ctx.attr.cpu == "rp2040" or |
| 1084 | ctx.attr.cpu == "cortex-m4f" or |
Austin Schuh | a2503a7 | 2020-12-15 20:57:57 -0800 | [diff] [blame] | 1085 | ctx.attr.cpu == "cortex-m4f-k22"): |
Austin Schuh | da9d060 | 2019-09-15 17:29:38 -0700 | [diff] [blame] | 1086 | cxx_builtin_include_directories = [ |
Austin Schuh | a2503a7 | 2020-12-15 20:57:57 -0800 | [diff] [blame] | 1087 | "/usr/lib/gcc/arm-none-eabi/4.8/include", |
| 1088 | "/usr/lib/gcc/arm-none-eabi/4.8/include-fixed", |
| 1089 | "/usr/lib/arm-none-eabi/include", |
| 1090 | "/usr/include/newlib", |
| 1091 | ] |
Austin Schuh | da9d060 | 2019-09-15 17:29:38 -0700 | [diff] [blame] | 1092 | else: |
| 1093 | fail("Unreachable") |
| 1094 | |
| 1095 | artifact_name_patterns = [] |
| 1096 | |
| 1097 | make_variables = [] |
| 1098 | |
Brian Silverman | 94cab07 | 2022-01-02 23:50:03 -0800 | [diff] [blame] | 1099 | if ctx.attr.cpu == "roborio": |
Austin Schuh | da9d060 | 2019-09-15 17:29:38 -0700 | [diff] [blame] | 1100 | tool_paths = [ |
| 1101 | tool_path( |
| 1102 | name = "ar", |
| 1103 | path = "arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-ar", |
| 1104 | ), |
| 1105 | tool_path( |
| 1106 | name = "as", |
| 1107 | path = "arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-as", |
| 1108 | ), |
| 1109 | tool_path( |
| 1110 | name = "compat-ld", |
| 1111 | path = "arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-ld", |
| 1112 | ), |
| 1113 | tool_path( |
| 1114 | name = "cpp", |
| 1115 | path = "arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-cpp", |
| 1116 | ), |
| 1117 | tool_path(name = "dwp", path = "/bin/false"), |
| 1118 | tool_path( |
| 1119 | name = "gcc", |
| 1120 | path = "arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-gcc", |
| 1121 | ), |
| 1122 | tool_path( |
| 1123 | name = "gcov", |
| 1124 | path = "arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-gcov-4.9", |
| 1125 | ), |
| 1126 | tool_path( |
| 1127 | name = "ld", |
| 1128 | path = "arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-ld", |
| 1129 | ), |
| 1130 | tool_path( |
| 1131 | name = "nm", |
| 1132 | path = "arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-nm", |
| 1133 | ), |
| 1134 | tool_path( |
| 1135 | name = "objcopy", |
| 1136 | path = "arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-objcopy", |
| 1137 | ), |
| 1138 | tool_path( |
| 1139 | name = "objdump", |
| 1140 | path = "arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-objdump", |
| 1141 | ), |
| 1142 | tool_path( |
| 1143 | name = "strip", |
| 1144 | path = "arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-strip", |
| 1145 | ), |
| 1146 | ] |
Austin Schuh | 0a96ea3 | 2022-01-01 22:29:30 -0800 | [diff] [blame] | 1147 | elif (ctx.attr.cpu == "rp2040" or |
| 1148 | ctx.attr.cpu == "cortex-m4f" or |
Austin Schuh | a2503a7 | 2020-12-15 20:57:57 -0800 | [diff] [blame] | 1149 | ctx.attr.cpu == "cortex-m4f-k22"): |
Austin Schuh | da9d060 | 2019-09-15 17:29:38 -0700 | [diff] [blame] | 1150 | tool_paths = [ |
| 1151 | tool_path( |
| 1152 | name = "ar", |
| 1153 | path = "gcc_arm_none_eabi/arm-none-eabi-ar", |
| 1154 | ), |
| 1155 | tool_path( |
| 1156 | name = "compat-ld", |
| 1157 | path = "gcc_arm_none_eabi/arm-none-eabi-ld", |
| 1158 | ), |
| 1159 | tool_path( |
| 1160 | name = "cpp", |
| 1161 | path = "gcc_arm_none_eabi/arm-none-eabi-cpp", |
| 1162 | ), |
| 1163 | tool_path( |
| 1164 | name = "dwp", |
| 1165 | path = "gcc_arm_none_eabi/arm-none-eabi-dwp", |
| 1166 | ), |
| 1167 | tool_path( |
| 1168 | name = "gcc", |
| 1169 | path = "gcc_arm_none_eabi/arm-none-eabi-gcc", |
| 1170 | ), |
| 1171 | tool_path( |
| 1172 | name = "gcov", |
| 1173 | path = "gcc_arm_none_eabi/arm-none-eabi-gcov", |
| 1174 | ), |
| 1175 | tool_path( |
| 1176 | name = "ld", |
| 1177 | path = "gcc_arm_none_eabi/arm-none-eabi-ld", |
| 1178 | ), |
| 1179 | tool_path( |
| 1180 | name = "nm", |
| 1181 | path = "gcc_arm_none_eabi/arm-none-eabi-nm", |
| 1182 | ), |
| 1183 | tool_path( |
| 1184 | name = "objcopy", |
| 1185 | path = "gcc_arm_none_eabi/arm-none-eabi-objcopy", |
| 1186 | ), |
| 1187 | tool_path( |
| 1188 | name = "objdump", |
| 1189 | path = "gcc_arm_none_eabi/arm-none-eabi-objdump", |
| 1190 | ), |
| 1191 | tool_path( |
| 1192 | name = "strip", |
| 1193 | path = "gcc_arm_none_eabi/arm-none-eabi-strip", |
| 1194 | ), |
| 1195 | ] |
Austin Schuh | da9d060 | 2019-09-15 17:29:38 -0700 | [diff] [blame] | 1196 | else: |
| 1197 | fail("Unreachable") |
| 1198 | |
Austin Schuh | da9d060 | 2019-09-15 17:29:38 -0700 | [diff] [blame] | 1199 | out = ctx.actions.declare_file(ctx.label.name) |
| 1200 | ctx.actions.write(out, "Fake executable") |
| 1201 | return [ |
| 1202 | cc_common.create_cc_toolchain_config_info( |
| 1203 | ctx = ctx, |
| 1204 | features = features, |
| 1205 | action_configs = action_configs, |
| 1206 | artifact_name_patterns = artifact_name_patterns, |
| 1207 | cxx_builtin_include_directories = cxx_builtin_include_directories, |
| 1208 | toolchain_identifier = toolchain_identifier, |
| 1209 | host_system_name = host_system_name, |
| 1210 | target_system_name = target_system_name, |
| 1211 | target_cpu = target_cpu, |
| 1212 | target_libc = target_libc, |
| 1213 | compiler = compiler, |
| 1214 | abi_version = abi_version, |
| 1215 | abi_libc_version = abi_libc_version, |
| 1216 | tool_paths = tool_paths, |
| 1217 | make_variables = make_variables, |
| 1218 | builtin_sysroot = builtin_sysroot, |
Austin Schuh | a2503a7 | 2020-12-15 20:57:57 -0800 | [diff] [blame] | 1219 | cc_target_os = cc_target_os, |
Austin Schuh | da9d060 | 2019-09-15 17:29:38 -0700 | [diff] [blame] | 1220 | ), |
| 1221 | DefaultInfo( |
| 1222 | executable = out, |
| 1223 | ), |
| 1224 | ] |
Austin Schuh | a2503a7 | 2020-12-15 20:57:57 -0800 | [diff] [blame] | 1225 | |
| 1226 | cc_toolchain_config = rule( |
Austin Schuh | da9d060 | 2019-09-15 17:29:38 -0700 | [diff] [blame] | 1227 | implementation = _impl, |
| 1228 | attrs = { |
Brian Silverman | 33ca369 | 2022-02-06 18:37:17 -0800 | [diff] [blame] | 1229 | "cpu": attr.string(mandatory = True, values = ["cortex-m4f", "cortex-m4f-k22", "roborio", "rp2040"]), |
Austin Schuh | da9d060 | 2019-09-15 17:29:38 -0700 | [diff] [blame] | 1230 | }, |
| 1231 | provides = [CcToolchainConfigInfo], |
| 1232 | executable = True, |
| 1233 | ) |