Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,14 @@ http_archive(
strip_prefix = "pico-examples-sdk-1.4.0",
sha256 = "a07789d702f8e6034c42e04a3f9dda7ada4ae7c8e8d320c6be6675090c007861",
)

# Hermetic toolchain
git_repository(
name = "arm_none_eabi",
commit = "4f3f31d629259e65e98b3aa7d8cb8c916cf7e03c",
remote = "https://github.com/hexdae/bazel-arm-none-eabi",
)

load("@arm_none_eabi//:deps.bzl", "arm_none_eabi_deps")

arm_none_eabi_deps()
3 changes: 2 additions & 1 deletion pico/BUILD.pico-sdk
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,9 @@ genrule(
name = "bs2_default_bin",
srcs = ["bs2_default.elf"],
outs = ["bs2_default.bin"],
cmd = "$(OBJCOPY) -O binary $< $@",
cmd = "$(execpath @arm_none_eabi//:objcopy) -O binary $< $@",
toolchains = ["@bazel_tools//tools/cpp:current_cc_toolchain"],
tools = ["@arm_none_eabi//:objcopy"],
)

cc_binary(
Expand Down
8 changes: 1 addition & 7 deletions pico/repositories.bzl
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe")
load("//toolchain/private:defs.bzl", "gcc_arm_embedded_toolchain")

def rules_pico_dependencies():
maybe(
Expand Down Expand Up @@ -39,10 +38,5 @@ def rules_pico_dependencies():
sha256 = "329f125f681b9adbfc89fff716026a6c3dbe517f172451dd04ceb91b10e7c5e1",
)

maybe(
gcc_arm_embedded_toolchain,
name = "gcc-arm-embedded",
)

def rules_pico_toolchains():
native.register_toolchains("//toolchain:gcc-pico")
native.register_toolchains("//toolchain:gcc-pico_linux_x86_64")
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bazel query "@rules_pico//toolchain:*"

@rules_pico//toolchain:BUILD
@rules_pico//toolchain:cc_toolchain_darwin_x86_64_gcc-pico
@rules_pico//toolchain:cc_toolchain_linux_aarch64_gcc-pico
@rules_pico//toolchain:cc_toolchain_linux_x86_64_gcc-pico
@rules_pico//toolchain:cc_toolchain_windows_x86_64_gcc-pico
@rules_pico//toolchain:config_darwin_x86_64_gcc-pico
@rules_pico//toolchain:config_linux_aarch64_gcc-pico
@rules_pico//toolchain:config_linux_x86_64_gcc-pico
@rules_pico//toolchain:config_windows_x86_64_gcc-pico
@rules_pico//toolchain:empty
@rules_pico//toolchain:gcc-pico_darwin_x86_64
@rules_pico//toolchain:gcc-pico_linux_aarch64
@rules_pico//toolchain:gcc-pico_linux_x86_64
@rules_pico//toolchain:gcc-pico_windows_x86_64

Lots of generated targets. I just picked the one I wanted; I imagine something fancier is needed here.

1 change: 0 additions & 1 deletion platforms/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,4 @@ platform(
"@platforms//cpu:armv6-m",
"@koro-platforms//cxx:14",
],
target_platform = True,
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm using latest Bazel 7.0.0 and this option wasn't recognized; seemed safe to remove?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its been a while since I worked on this and it looks like things have changed in the meantime. I'm currently using bazel 5.4.1. I'll try to figure out if this is needed.

)
6 changes: 2 additions & 4 deletions toolchain/BUILD
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
load(":defs.bzl", "gcc_embedded_toolchain")
load("@arm_none_eabi//toolchain:toolchain.bzl", "arm_none_eabi_toolchain")

package(default_visibility = ["//visibility:public"])

filegroup(name = "empty")

gcc_embedded_toolchain(
arm_none_eabi_toolchain(
name = "gcc-pico",
copts = [
"-mcpu=cortex-m0plus",
Expand Down
28 changes: 0 additions & 28 deletions toolchain/defs.bzl

This file was deleted.

Empty file removed toolchain/private/BUILD
Empty file.
251 changes: 0 additions & 251 deletions toolchain/private/cc_toolchain_config.bzl.tpl

This file was deleted.

45 changes: 0 additions & 45 deletions toolchain/private/defs.bzl

This file was deleted.

Loading