Skip to content

Commit d623319

Browse files
committed
fix armv7-unknown-linux-gnueabihf
1 parent 1bdac3f commit d623319

File tree

2 files changed

+53
-6
lines changed

2 files changed

+53
-6
lines changed

.cargo/config.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ rustflags = ["-C", "target-feature=-crt-static"]
44
[target.x86_64-pc-windows-msvc]
55
rustflags = ["-C", "target-feature=+crt-static"]
66
[target.armv7-unknown-linux-gnueabihf]
7-
linker = "arm-linux-gnueabihf-gcc"
7+
linker = "arm-linux-gnueabihf-gcc"
8+
rustflags = ["-C", "link-arg=-Wl,--sysroot=/usr/arm-linux-gnueabihf"]

.github/workflows/CI.yml

Lines changed: 51 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,57 @@ jobs:
9292
yarn build --target aarch64-unknown-linux-gnu
9393
- host: ubuntu-latest
9494
target: armv7-unknown-linux-gnueabihf
95-
build: yarn build --target armv7-unknown-linux-gnueabihf
95+
docker: 'ubuntu:22.04'
96+
build: |
97+
# -x prints each command before running it. -e stops on first error.
98+
set -e -x
99+
100+
echo "--- 1. Installing System Dependencies ---"
101+
export DEBIAN_FRONTEND=noninteractive
102+
apt-get update -y
103+
apt-get install -y \
104+
build-essential curl ca-certificates git pkg-config libssl-dev \
105+
nodejs npm \
106+
cmake nasm libclang-dev \
107+
gcc-arm-linux-gnueabihf # <-- The PACKAGE NAME
108+
109+
echo "--- 2. Installing Node.js v22 and Yarn ---"
110+
# Use NodeSource to get a modern version of Node.js
111+
curl -fsSL https://deb.nodesource.com/setup_22.x | bash -
112+
apt-get install -y nodejs
113+
# Verify Node.js version
114+
node -v
115+
# Install Yarn globally
116+
npm install -g yarn
117+
118+
119+
echo "--- 3. Verifying Cross-Compiler Installation ---"
120+
# This command MUST succeed and print a path.
121+
which arm-linux-gnueabihf-gcc # <-- The COMMAND NAME
122+
123+
echo "--- 4. Installing Rust Toolchain ---"
124+
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
125+
# Add cargo to the PATH for the rest of this script
126+
. "$HOME/.cargo/env"
127+
rustup target add armv7-unknown-linux-gnueabihf
128+
129+
echo "--- 5. Creating Cargo Config (The Right Way) ---"
130+
# This is the most reliable way to configure Cargo.
131+
mkdir -p .cargo
132+
cat << EOF > .cargo/config.toml
133+
[target.armv7-unknown-linux-gnueabihf]
134+
linker = "arm-linux-gnueabihf-gcc" # <-- Use the correct COMMAND NAME
135+
EOF
136+
cat .cargo/config.toml # Print the file to be sure
137+
138+
echo "--- 6. Configuring Bindgen ---"
139+
# This is still required for aws-lc-sys
140+
export BINDGEN_EXTRA_CLANG_ARGS="--target=armv7-unknown-linux-gnueabihf --sysroot=/usr/arm-linux-gnueabihf"
141+
142+
echo "--- 7. Running The Build ---"
143+
# We now have a perfectly configured, isolated environment.
144+
yarn install
145+
yarn build --target armv7-unknown-linux-gnueabihf
96146
- host: ubuntu-latest
97147
target: aarch64-linux-android
98148
build: yarn build --target aarch64-linux-android
@@ -156,10 +206,6 @@ jobs:
156206
with:
157207
node-version: 22
158208
cache: yarn
159-
- name: Setup Zig
160-
uses: goto-bus-stop/setup-zig@v2
161-
with:
162-
version: 0.11.0
163209
- name: Install NASM
164210
if: runner.os == 'Windows'
165211
run: choco install nasm

0 commit comments

Comments
 (0)