Skip to content

Commit f5cbfb1

Browse files
troibejwnrt
authored andcommitted
Use fixed architecture names in toolchain wrapper
`uname -m` seems to not be available in some sandboxed environments. This error only occurred after an hour of CI tests on the main opentitan repo.
1 parent 5da2ea3 commit f5cbfb1

File tree

25 files changed

+56
-11
lines changed

25 files changed

+56
-11
lines changed

toolchains/lowrisc_rv32imcb/BUILD.bazel

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ HOST_ARCHS = [
2323
[filegroup(
2424
name = "compiler_components" + host_arch,
2525
srcs = [
26-
"//toolchains/lowrisc_rv32imcb/wrappers:all",
26+
"//toolchains/lowrisc_rv32imcb/wrappers_{}:all".format(host_arch),
2727
"@lowrisc_rv32imcb_{}_files//:all".format(host_arch),
2828
],
2929
) for host_arch in HOST_ARCHS]
@@ -43,15 +43,15 @@ HOST_ARCHS = [
4343
},
4444
substitutions = device.substitutions,
4545
tools = {
46-
"ar": "wrappers/ar",
47-
"cpp": "wrappers/cpp",
48-
"gcc": "wrappers/clang",
49-
"gcov": "wrappers/gcov",
50-
"ld": "wrappers/ld",
51-
"nm": "wrappers/nm",
52-
"objcopy": "wrappers/objcopy",
53-
"objdump": "wrappers/objdump",
54-
"strip": "wrappers/strip",
46+
"ar": "wrappers_{}/ar".format(host_arch),
47+
"cpp": "wrappers_{}/cpp".format(host_arch),
48+
"gcc": "wrappers_{}/clang".format(host_arch),
49+
"gcov": "wrappers_{}/gcov".format(host_arch),
50+
"ld": "wrappers_{}/ld".format(host_arch),
51+
"nm": "wrappers_{}/nm".format(host_arch),
52+
"objcopy": "wrappers_{}/objcopy".format(host_arch),
53+
"objdump": "wrappers_{}/objdump".format(host_arch),
54+
"strip": "wrappers_{}/strip",
5555
},
5656
) for device in DEVICES]
5757
for host_arch in HOST_ARCHS

toolchains/lowrisc_rv32imcb/wrappers/driver.sh renamed to toolchains/lowrisc_rv32imcb/wrappers_aarch64/driver.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# SPDX-License-Identifier: Apache-2.0
55

66
PROG=${0##*/}
7-
TOOLCHAIN="lowrisc_rv32imcb_$(uname -m)_files"
7+
TOOLCHAIN="lowrisc_rv32imcb_aarch64_files"
88
PREFIX="riscv32-unknown-elf"
99

1010
ARGS=()
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package(default_visibility = ["//visibility:public"])
2+
3+
exports_files(glob(["*"]))
4+
5+
filegroup(
6+
name = "all",
7+
srcs = [
8+
"ar",
9+
"clang",
10+
"cpp",
11+
"gcc",
12+
"gcov",
13+
"ld",
14+
"nm",
15+
"objcopy",
16+
"objdump",
17+
"strip",
18+
],
19+
)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
driver.sh
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
driver.sh
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
driver.sh
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/bin/bash --norc
2+
# Copyright lowRISC contributors.
3+
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
4+
# SPDX-License-Identifier: Apache-2.0
5+
6+
PROG=${0##*/}
7+
TOOLCHAIN="lowrisc_rv32imcb_x86_64_files"
8+
PREFIX="riscv32-unknown-elf"
9+
10+
ARGS=()
11+
POSTARGS=()
12+
13+
exec "external/${TOOLCHAIN}/bin/${PREFIX}-${PROG}" \
14+
"${ARGS[@]}" \
15+
"$@"\
16+
"${POSTARGS[@]}"
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
driver.sh
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
driver.sh
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
driver.sh
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
driver.sh
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
driver.sh
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
driver.sh
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
driver.sh

0 commit comments

Comments
 (0)