Skip to content

Commit f78c1b9

Browse files
committed
added armv7l support
1 parent 9c28750 commit f78c1b9

File tree

8 files changed

+43
-11
lines changed

8 files changed

+43
-11
lines changed

.devcontainer/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
7070
USER vscode
7171
WORKDIR /home/vscode
7272

73-
# Install Zig (cross-compilation toolchain for amd64, arm64, ppc64le)
73+
# Install Zig (cross-compilation toolchain for amd64, arm64, armv7l, ppc64le, loong64)
7474
# URL format: zig-{ARCH}-linux-{VERSION}.tar.xz (architecture before OS)
7575
RUN echo "Installing Zig ${ZIG_VERSION}..." \
7676
&& ARCH=$(uname -m) \

.devcontainer/devcontainer.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"dockerfile": "Dockerfile",
55
"args": {
66
"NIM_VERSION": "2.2.6",
7+
"NPH_VERSION": "0.6.2",
78
"NIMLANGSERVER_VERSION": "1.12.0",
89
"ZIG_VERSION": "0.15.2",
910
"RISCSTAR_VERSION": "15.2-r1"
@@ -62,6 +63,8 @@
6263

6364
"containerEnv": {
6465
"NIM_VERSION": "2.2.6",
66+
"NPH_VERSION": "0.6.2",
67+
"NIMLANGSERVER_VERSION": "1.12.0",
6568
"ZIG_VERSION": "0.15.2",
6669
"RISCSTAR_VERSION": "15.2-r1",
6770
"EDITOR": "code --wait",

.devcontainer/post-create.sh

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,12 @@ alias jb='just build'
4343
alias jbr='just release'
4444
4545
# Cross-compilation shortcuts (via just)
46-
alias jba='just build-all'
46+
alias jra='just release-all'
4747
alias jbarm='just build-arm64'
48+
alias jbarmv7='just build-armv7l'
4849
alias jbrv='just build-riscv64'
4950
alias jbppc='just build-ppc64le'
51+
alias jbloong='just build-loong64'
5052
5153
# Test shortcuts (via just)
5254
alias jt='just test'
@@ -94,10 +96,12 @@ yabbhelp() {
9496
echo " jbr - just release (optimised static)"
9597
echo ""
9698
echo "Cross-compilation:"
97-
echo " jba - just build-all (all 4 architectures)"
99+
echo " jra - just release-all (all 6 architectures)"
98100
echo " jbarm - just build-arm64"
101+
echo " jbarmv7 - just build-armv7l"
99102
echo " jbrv - just build-riscv64"
100103
echo " jbppc - just build-ppc64le"
104+
echo " jbloong - just build-loong64"
101105
echo ""
102106
echo "Test:"
103107
echo " jt - just test"
@@ -206,7 +210,7 @@ echo "Quick start:"
206210
echo " just - Show all available commands"
207211
echo " just build - Build debug binary"
208212
echo " just release - Build optimised static binary"
209-
echo " just build-all - Cross-compile all architectures"
213+
echo " just release-all - Cross-compile all architectures"
210214
echo " just test - Run tests"
211215
echo " just ci - Run full CI pipeline"
212216
echo " yabbhelp - Show alias shortcuts"

.github/workflows/release.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@
88
# =============================================================================
99
# YABB Release Workflow
1010
# Cross-compiles static binaries for all architectures
11-
# - amd64, arm64, ppc64le: Zig cross-compilation
11+
# - amd64, arm64, armv7l, ppc64le, loong64: Zig cross-compilation
1212
# - riscv64: RISCstar toolchain (Zig's musl has ABI incompatibility)
13+
# Note: armv7l requires NEON (Zig's musl is compiled with NEON optimisations)
1314
# All builds run in parallel on x86_64 runners
1415
# Archives use zstd compression (level 19) for best size
1516
# =============================================================================
@@ -40,6 +41,10 @@ jobs:
4041
target: aarch64-linux-musl
4142
nimcpu: "--cpu:arm64"
4243
march: "-march=armv8-a -mtune=cortex_a72"
44+
- arch: armv7l
45+
target: arm-linux-musleabihf
46+
nimcpu: "--cpu:arm"
47+
march: "-mcpu=baseline"
4348
- arch: riscv64
4449
nimcpu: "--cpu:riscv64"
4550
# Uses RISCstar toolchain instead of Zig (Zig's musl has soft-float ABI)

Install.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ Installation Guide
77
REQUIREMENTS
88
------------
99
- Linux with BTRFS filesystems (source and destination must both be BTRFS)
10+
- Supported architectures: x86_64, aarch64, armv7l, riscv64, ppc64le, loongarch64
1011
- Root access (sudo) for backup operations
1112
- Bash 5.2 or newer (for automatic installer)
1213
- btrfs-progs 5.14 or newer

justfile

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ release: && _clean-cache
154154
case "$ARCH" in
155155
x86_64) nimble releaseAmd64 && cp bin/yabb-linux-amd64 bin/yabb ;;
156156
aarch64) nimble releaseArm64 && cp bin/yabb-linux-arm64 bin/yabb ;;
157+
armv7l) nimble releaseArmv7l && cp bin/yabb-linux-armv7l bin/yabb ;;
157158
riscv64) nimble releaseRiscv64 && cp bin/yabb-linux-riscv64 bin/yabb ;;
158159
ppc64le) nimble releasePpc64le && cp bin/yabb-linux-ppc64le bin/yabb ;;
159160
loongarch64) nimble releaseLoong64 && cp bin/yabb-linux-loong64 bin/yabb ;;
@@ -179,6 +180,12 @@ build-arm64:
179180
@echo "Cross-compiling for ARM64..."
180181
nimble releaseArm64
181182

183+
# Build for ARMv7 Linux (static musl, hard-float, NEON - Debian armhf)
184+
# Note: Zig's musl requires NEON, so this won't run on NEON-less ARMv7 devices
185+
build-armv7l:
186+
@echo "Cross-compiling for ARMv7 (armhf)..."
187+
nimble releaseArmv7l
188+
182189
# Build for RISC-V 64-bit Linux (static musl, lp64d hard-float)
183190
# Uses RISCstar toolchain - works on both x86-64 and ARM64 hosts
184191
build-riscv64:
@@ -195,8 +202,8 @@ build-loong64:
195202
@echo "Cross-compiling for LoongArch64..."
196203
nimble releaseLoong64
197204

198-
# Build all Linux architectures (amd64, arm64, riscv64, ppc64le, loong64)
199-
build-all: build-amd64 build-arm64 build-riscv64 build-ppc64le build-loong64
205+
# Release binaries for all Linux architectures (amd64, arm64, armv7l, riscv64, ppc64le, loong64)
206+
release-all: build-amd64 build-arm64 build-armv7l build-riscv64 build-ppc64le build-loong64
200207
@echo ""
201208
@echo "All architectures built:"
202209
@ls -lh bin/yabb-linux-* 2>/dev/null || echo "No binaries found"
@@ -316,7 +323,7 @@ _clean-cache:
316323
# Clean all build artifacts including binaries
317324
clean:
318325
@echo "Cleaning build artifacts..."
319-
rm -rf bin/yabb bin/yabb-linux-* bin/*.exe
326+
rm -rf bin/yabb bin/yabb-* bin/*.exe
320327
rm -rf nimcache/
321328
rm -rf htmldocs/
322329
rm -f testresults.html

scripts/setup-yabb.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
#
1515
# REQUIREMENTS:
1616
# Bash 5.2+
17-
# Linux (x86_64, aarch64, riscv64, ppc64le, or loongarch64)
17+
# Linux (x86_64, aarch64, riscv64, ppc64le, armv7l or loongarch64)
1818
# curl, tar, zstd, sha256sum, flock
1919
#
2020
# USAGE (please manually verify content first!):
@@ -166,6 +166,7 @@ declare -ra REQUIRED_COMMANDS=(
166166
declare -rA ARCH_MAP=(
167167
[x86_64]="amd64"
168168
[aarch64]="arm64"
169+
[armv7l]="armv7l"
169170
[riscv64]="riscv64"
170171
[ppc64le]="ppc64le"
171172
[loongarch64]="loong64"

yabb.nimble

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#
88
# Package
99

10-
version = "0.4.18"
10+
version = "0.4.19"
1111
author = "Aryan Ameri"
1212
description = "Yet Another BTRFS Backup"
1313
license = "MPL 2.0"
@@ -96,7 +96,7 @@ task test, "Run tests":
9696
exec "testament all"
9797

9898
task clean, "Clean build artifacts":
99-
exec "rm -rf bin/yabb bin/yabb-linux-* nimcache/"
99+
exec "rm -rf bin/yabb bin/yabb-* nimcache/"
100100

101101
# =============================================================================
102102
# Release builds
@@ -127,6 +127,16 @@ task releaseArm64, "Build static binary for ARM64 Linux":
127127
exec "llvm-strip -s bin/yabb-linux-arm64"
128128
echo "Built: bin/yabb-linux-arm64"
129129

130+
task releaseArmv7l, "Build static binary for ARMv7 Linux (armhf)":
131+
# Debian armhf: ARMv7-A + VFPv3 + Thumb-2 + NEON, hard-float EABI
132+
# Uses baseline (most conservative ARMv7-A target without CPU-specific tuning)
133+
# Note: Zig's musl includes NEON-optimised routines, so NEON is required
134+
exec "nim c " & releaseFlags & " " & zigccFlags & " " & "--cpu:arm " &
135+
"--passC:'-target arm-linux-musleabihf' " & "--passL:'-target arm-linux-musleabihf' " &
136+
"--passC:-mcpu=baseline " & ltoFlags & " -o:bin/yabb-linux-armv7l src/yabb.nim"
137+
exec "llvm-strip -s bin/yabb-linux-armv7l"
138+
echo "Built: bin/yabb-linux-armv7l"
139+
130140
task releaseRiscv64, "Build static binary for RISC-V 64-bit Linux":
131141
# Uses RISCstar musl toolchain with lp64d ABI (hard-float)
132142
# Zig's musl uses soft-float which is incompatible with Debian riscv64
@@ -158,6 +168,7 @@ task releaseLoong64, "Build static binary for LoongArch64 Linux":
158168
task releaseAll, "Build static binaries for all Linux architectures":
159169
exec "nimble releaseAmd64"
160170
exec "nimble releaseArm64"
171+
exec "nimble releaseArmv7l"
161172
exec "nimble releaseRiscv64"
162173
exec "nimble releasePpc64le"
163174
exec "nimble releaseLoong64"

0 commit comments

Comments
 (0)