Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable support for other ARM GNU Toolchains, add arm-none-linux-gnueabihf toolchain #30

Merged
merged 23 commits into from
Mar 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
345bf59
Manage 'target constraints' instead of just compatible cpus
AmateurECE Mar 2, 2024
d50437c
Rename module to arm_gnu_toolchain
AmateurECE Mar 2, 2024
65bee28
Custom repo rule to templatize compiler BUILD
AmateurECE Mar 3, 2024
502847c
Make cc_arm_none_eabi_config generic
AmateurECE Mar 4, 2024
cd02104
Abstract generic logic from arm_none_eabi_toolchain
AmateurECE Mar 4, 2024
cbd28b6
Genericize arm_none_eabi_deps and repo BUILD templates
AmateurECE Mar 4, 2024
a6090ea
Rename module extension to arm_toolchain and tag classes
AmateurECE Mar 4, 2024
2110aee
Introduce the arm-none-linux-gnueabihf toolchain
AmateurECE Mar 4, 2024
fa2cec3
Create an example using arm-none-linux-gnueabihf toolchain
AmateurECE Mar 4, 2024
c49bf36
Fix issue that caused tools to be resolved incorrectly
AmateurECE Mar 4, 2024
853daf1
Make toolchain rules public
AmateurECE Mar 5, 2024
7e3652c
Hotfix for toolchain selection issue.
AmateurECE Mar 9, 2024
543b3c5
Use MSV to select the version of the toolchain
AmateurECE Mar 14, 2024
2d9a101
Consolidate templates for generated repos
AmateurECE Mar 16, 2024
4d1793e
Fix various custom toolchain issues
AmateurECE Mar 16, 2024
1fc5bae
Slightly reorganize examples
AmateurECE Mar 16, 2024
a758855
Fix linux toolchain for mingw-i686
AmateurECE Mar 16, 2024
c9d353c
CI: use --output_user_root to avoid max path length limitation
AmateurECE Mar 17, 2024
dcfe27f
Use rules_cc for many definitions previously provided by bazel_tools
AmateurECE Mar 17, 2024
6acba69
Document Windows path length issues in README.md
AmateurECE Mar 17, 2024
ffe8ec3
examples/arm-linux: Link to libc and libstdc++ by default
AmateurECE Mar 17, 2024
6876b0e
non-functional: Bump arm-none-eabi version to 13.2.1 in a few places
AmateurECE Mar 17, 2024
13b0b90
arm-linux: Default include_std to true
AmateurECE Mar 25, 2024
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
4 changes: 2 additions & 2 deletions .github/workflows/mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- uses: actions/checkout@v2
- name: Build examples
run: |
bazelisk build //examples/...
bazelisk build //examples/arm-none/...
- name: Bazel backwards compatibility
run: |
USE_BAZEL_VERSION=6.4.0 bazelisk build //examples/...
USE_BAZEL_VERSION=6.4.0 bazelisk build //examples/arm-none/...
4 changes: 2 additions & 2 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ jobs:
- uses: actions/checkout@v2
- name: Build examples
run: |
bazelisk build //examples/...
bazelisk --output_user_root=C:/bzl build //examples/...
- name: Bazel backwards compatibility
run: |
$Env:USE_BAZEL_VERSION = "6.4.0"
bazelisk build //examples/...
bazelisk --output_user_root=C:/bzl build //examples/...
26 changes: 0 additions & 26 deletions BUILD
Original file line number Diff line number Diff line change
@@ -1,26 +0,0 @@
# BUILD

load("//toolchain:toolchain.bzl", "hosts", "tools")

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

TOOLS = tools + ["bin"]

[
config_setting(
name = host,
constraint_values = constraint_values,
)
for host, constraint_values in hosts.items()
]

[
filegroup(
name = tool,
srcs = select({
host: ["@arm_none_eabi_{}//:{}".format(host, tool)]
for host in hosts.keys()
}),
)
for tool in TOOLS
]
26 changes: 21 additions & 5 deletions MODULE.bazel
Original file line number Diff line number Diff line change
@@ -1,31 +1,47 @@
module(
name = "arm_none_eabi",
name = "arm_gnu_toolchain",
version = "1.0.0",
compatibility_level = 1,
)

bazel_dep(name = "platforms", version = "0.0.8")
bazel_dep(name = "rules_cc", version = "0.0.9")

arm_none_eabi_gcc = use_extension("@arm_none_eabi//:extensions.bzl", "arm_none_eabi")
arm_none_eabi_gcc.toolchain(version = "9.2.1")
arm_toolchain = use_extension("@arm_gnu_toolchain//:extensions.bzl", "arm_toolchain")
# NOTE: It's important that we update these versions whenever a new toolchain
# version is added--otherwise the Minimum Selected Version algorithm in the
# module extension will select the version here if a consumer attempts to use
# the newer toolchain.
arm_toolchain.arm_none_eabi(version = "13.2.1")
use_repo(
arm_none_eabi_gcc,
arm_toolchain,
"arm_none_eabi",
"arm_none_eabi_darwin_x86_64",
"arm_none_eabi_linux_aarch64",
"arm_none_eabi_linux_x86_64",
"arm_none_eabi_windows_x86_64",
)

arm_toolchain.arm_none_linux_gnueabihf(version = "13.2.1")
use_repo(
arm_toolchain,
"arm_none_linux_gnueabihf",
"arm_none_linux_gnueabihf_linux_aarch64",
"arm_none_linux_gnueabihf_linux_x86_64",
"arm_none_linux_gnueabihf_windows_x86_64",
)

# DEV ONLY (not needed for release)
bazel_dep(name = "aspect_bazel_lib", version = "2.0.0", dev_dependency = True)
bazel_dep(name = "bazel_skylib", version = "1.5.0", dev_dependency = True)

register_toolchains(
"@arm_none_eabi//toolchain:all",
"@arm_none_linux_gnueabihf//toolchain:all",
dev_dependency = True,
)

register_toolchains(
"@arm_none_eabi//examples/custom/toolchain:all",
"@arm_gnu_toolchain//examples/arm-none/custom/toolchain:all",
dev_dependency = True,
)
Loading
Loading