Skip to content

Commit 37e9b2f

Browse files
authored
update @toolchain_arm_gnu for additional toolchain config opts (#57)
Now that the PR adding additional toolchain config opts (e.g. `cxxopts`) has been merged, update `@toolchain_arm_gnu` to use a reference from upstream instead of a fork. Change-Id: I1d4c0494da0cf5c5407b9f924451b848899b24f7
1 parent c510c6c commit 37e9b2f

File tree

3 files changed

+42
-37
lines changed

3 files changed

+42
-37
lines changed

MODULE.bazel

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,16 @@ bazel_dep(
2020
version = "0.13.0",
2121
)
2222

23-
TOOLCHAINS_ARM_GNU_COMMIT = "5012bfb601600cfbae5322cbc2acfbed41c52e0f"
23+
TOOLCHAINS_ARM_GNU_COMMIT = "1abff3e6a5f894d0545654800ee0db6ea24a76a3"
2424

2525
archive_override(
2626
module_name = "toolchains_arm_gnu",
27-
integrity = "sha256-wOFizsEMZk1SX+m+39HXoU5yY+3R0VYyqH2g6FTRzdo=",
28-
strip_prefix = "bazel-arm-none-eabi-{commit}".format(
27+
integrity = "sha256-surv16TjyDtSebSX8fdj85TVnC8wGjIthEk3uHlKvFs=",
28+
strip_prefix = "toolchains_arm_gnu-{commit}".format(
2929
commit = TOOLCHAINS_ARM_GNU_COMMIT,
3030
),
3131
urls = [
32-
"https://github.com/oliverlee/bazel-arm-none-eabi/archive/{commit}.tar.gz".format(
32+
"https://github.com/hexdae/toolchains_arm_gnu/archive/{commit}.tar.gz".format(
3333
commit = TOOLCHAINS_ARM_GNU_COMMIT,
3434
),
3535
],
@@ -46,7 +46,7 @@ use_repo(
4646
)
4747

4848
register_toolchains(
49-
"//toolchain:all",
49+
"//toolchain:lm3s6965evb_toolchain",
5050
"//:qemu_test_runner_toolchain",
5151
)
5252

MODULE.bazel.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

toolchain/BUILD.bazel

Lines changed: 36 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -27,49 +27,42 @@ cc_library(
2727
alwayslink = True,
2828
)
2929

30+
_warning_opts = [
31+
"-Werror",
32+
"-Wall",
33+
"-Wextra",
34+
"-Wpedantic",
35+
"-Wconversion",
36+
"-Wnon-virtual-dtor",
37+
"-Wold-style-cast",
38+
"-Wcast-align",
39+
"-Wunused",
40+
"-Woverloaded-virtual",
41+
"-Wmisleading-indentation",
42+
"-Wnull-dereference",
43+
"-Wdouble-promotion",
44+
"-Wformat=2",
45+
"-Wimplicit-fallthrough",
46+
"-Wextra-semi",
47+
"-Wunreachable-code",
48+
]
49+
3050
[
3151
arm_none_eabi_toolchain(
3252
name = "{board}_toolchain".format(board = board.name),
3353
additional_link_libraries = [
3454
"//board/{board}:memory_region".format(board = board.name),
3555
":start_{cpu}".format(cpu = board.cpu),
3656
],
37-
copts = [
38-
"-mcpu={cpu}".format(cpu = board.cpu),
39-
"-mthumb",
40-
"-mfloat-abi=soft",
57+
copts = common_opts + [
4158
"-fdiagnostics-color",
42-
"-fno-exceptions",
4359
"-fno-use-cxa-atexit",
44-
"-specs=nano.specs",
45-
"-Werror",
46-
"-Wall",
47-
"-Wextra",
48-
"-Wpedantic",
49-
"-Wconversion",
50-
"-Wnon-virtual-dtor",
51-
"-Wold-style-cast",
52-
"-Wcast-align",
53-
"-Wunused",
54-
"-Woverloaded-virtual",
55-
"-Wmisleading-indentation",
56-
"-Wnull-dereference",
57-
"-Wdouble-promotion",
58-
"-Wformat=2",
59-
"-Wimplicit-fallthrough",
60-
"-Wextra-semi",
61-
"-Wunreachable-code",
6260
],
63-
cxxopts = [
61+
cxxopts = _warning_opts + [
6462
"-std=c++20",
6563
"-ffreestanding",
6664
],
67-
linkopts = [
68-
"-mcpu={cpu}".format(cpu = board.cpu),
69-
"-mthumb",
70-
"-mfloat-abi=soft",
71-
"-fno-exceptions",
72-
"-specs=nano.specs",
65+
linkopts = common_opts + [
7366
"-Wl,--gc-sections",
7467
"-Wl,--fatal-warnings",
7568
],
@@ -80,5 +73,17 @@ cc_library(
8073
],
8174
visibility = ["//visibility:public"],
8275
)
83-
for board in BOARDS
76+
for board, common_opts in [
77+
(
78+
board,
79+
[
80+
"-mcpu={cpu}".format(cpu = board.cpu),
81+
"-mthumb",
82+
"-mfloat-abi=soft",
83+
"-fno-exceptions",
84+
"-specs=nano.specs",
85+
],
86+
)
87+
for board in BOARDS
88+
]
8489
]

0 commit comments

Comments
 (0)