Skip to content

Commit 500f03b

Browse files
committed
WIP ACTUALLY WORKS
1 parent 31a203e commit 500f03b

4 files changed

Lines changed: 35 additions & 6 deletions

File tree

environment_setup/setup_software.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ host_software_packages=(
7575
libffi-dev # needed to use _ctypes in Python3
7676
libssl-dev # needed to build Python 3 with ssl support
7777
openssl # possibly also necessary for ssl in Python 3
78-
sshpass #used to remotely ssh into robots via Ansible
78+
sshpass # used to remotely ssh into robots via Ansible
7979
unzip # installing tigers autoref
8080
xvfb # used for CI to run GUI applications
8181
)

environment_setup/setup_software_mac.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ host_software_packages=(
3232
node@20
3333
go@1.24
3434
clang-format@20
35+
sshpass # used to remotely ssh into robots via Ansible
3536
)
3637

3738
for pkg in "${host_software_packages[@]}"; do

src/extlibs/macos_robot_gcc.BUILD

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
package(default_visibility = ["//visibility:public"])
2+
3+
# The prebuilt messense aarch64-unknown-linux-gnu toolchain (Homebrew), exposed
4+
# as Bazel inputs so its binaries (gcc, ld, as, ...) are staged into the sandbox
5+
# when cross-compiling robot firmware on macOS.
6+
filegroup(
7+
name = "everything",
8+
srcs = glob(["**"]),
9+
)
Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,26 @@
11
#!/bin/bash --norc
22

3-
# The prebuilt messense aarch64-unknown-linux-gnu toolchain ships only the BFD
4-
# linker (ld/ld.bfd) — no ld.gold. The shared cc_toolchain config adds
5-
# -fuse-ld=gold, so append -fuse-ld=bfd (last one wins) to use the linker that
6-
# actually exists. Ignored for non-link (compile) invocations.
7-
exec /opt/homebrew/Cellar/aarch64-unknown-linux-gnu/15.2.0/toolchain/bin/aarch64-unknown-linux-gnu-gcc "$@" -fuse-ld=bfd
3+
# Wrapper around the prebuilt messense aarch64-unknown-linux-gnu GCC 15.2.0,
4+
# applying two robot-deployment fix-ups (both no-ops for compile-only calls):
5+
#
6+
# * Static C++ runtime: this toolchain is GCC 15, newer than the robot's system
7+
# libstdc++, so a dynamic libstdc++ dependency requires GLIBCXX/CXXABI symbol
8+
# versions the robot doesn't have. Bazel passes an explicit `-lstdc++`, which
9+
# `-static-libstdc++` does NOT intercept, so rewrite it to the static archive
10+
# (`-l:libstdc++.a`). `-static-libgcc` covers libgcc.
11+
#
12+
# * `-fuse-ld=bfd`: messense ships only the BFD linker (no ld.gold), but the
13+
# shared cc_toolchain config adds `-fuse-ld=gold`; appending bfd wins.
14+
15+
TC=/opt/homebrew/Cellar/aarch64-unknown-linux-gnu/15.2.0/toolchain
16+
17+
args=()
18+
for a in "$@"; do
19+
if [ "$a" = "-lstdc++" ]; then
20+
args+=("-l:libstdc++.a")
21+
else
22+
args+=("$a")
23+
fi
24+
done
25+
26+
exec "$TC/bin/aarch64-unknown-linux-gnu-gcc" "${args[@]}" -fuse-ld=bfd -static-libgcc

0 commit comments

Comments
 (0)