build(docker): add armv7l cross-compilation support

- Add Dockerfile.linux-armv7l for ARMv7l cross-compilation environment
- Create build-linux-armv7l.sh script to automate the build process
- Update .dockerignore to exclude more build artifacts and temporary files
- Extend README.md with ARMv7l build instructions and target details
This commit is contained in:
2025-11-01 15:05:29 +01:00
parent ffbaef8388
commit dbaa10a848
4 changed files with 297 additions and 2 deletions

View File

@@ -1,16 +1,153 @@
# Version Control
.git
.gitignore
docker-build
.gitattributes
# Build directories and artifacts
build
build-aux/config.guess
build-aux/config.sub
build-aux/depcomp
build-aux/install-sh
build-aux/ltmain.sh
build-aux/missing
build-aux/compile
build-aux/test-driver
build-aux/m4/libtool.m4
build-aux/m4/lt~obsolete.m4
build-aux/m4/ltoptions.m4
build-aux/m4/ltsugar.m4
build-aux/m4/ltversion.m4
dist*
out
releases
db4/
linux-coverage-build
linux-build
win32-build
# Docker build system (avoid recursion)
docker-build
# Compiled binaries and libraries
*.o
*.a
*.so
*.dylib
*.exe
*.app
*.pdb
*.lo
*.la
# Build configuration and cache
config.cache
config.log
config.status
configure
libtool
autom4te.cache/
Makefile
Makefile.in
aclocal.m4
.deps
.dirstamp
.libs
src/config/
src/obj
src/univalue/gen
# Qt specific
src/qt/*.moc
src/qt/moc_*.cpp
src/qt/forms/ui_*.h
src/qt/test/moc*.cpp
src/qt/palladium-qt.config
src/qt/palladium-qt.creator
src/qt/palladium-qt.creator.user
src/qt/palladium-qt.files
src/qt/palladium-qt.includes
*.qm
qrc_*.cpp
Palladium-Qt.app
# Test files and coverage
test/config.ini
test/cache/
*.trs
test_palladium.coverage/
total.coverage/
coverage_percent.txt
*.gcno
*.gcda
*.info
Makefile.test
palladium-qt_test
# Logs and temporary files
*.log
*.tmp
*.temp
*.bak
*.swp
*.swo
*.orig
*.rej
*.patch
!depends/patches/**/*.patch
*.*~*
*~
# Python
__pycache__
*.pyc
.python-version
# Archives and packages
*.tar*
*.zip
*.gz
*.dmg
# IDE and editor files
.vscode/
.idea/
*.sublime-*
.DS_Store
Thumbs.db
desktop.ini
# CI/CD and development tools
.travis.yml
.appveyor.yml
.cirrus.yml
.github/
ci/
.tx/
.style.yapf
# Documentation generation
doc/doxygen/
/doc/doxygen/
# macOS specific
*.background.tiff
background.tiff*
osx_volname
# Windows specific build
build_msvc/
# Clang tools
*.plist
# Generated files
*.json.h
*.raw.h
*.pb.cc
*.pb.h
*.dat
share/setup.nsi
share/qt/Info.plist
libpalladiumconsensus.pc
contrib/devtools/split-debug.sh

View File

@@ -0,0 +1,16 @@
FROM ubuntu:20.04
ENV DEBIAN_FRONTEND=noninteractive TZ=UTC
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential libtool autotools-dev automake autoconf pkg-config \
bsdmainutils python3 curl ca-certificates git unzip zip file rsync \
make cmake patch \
g++-arm-linux-gnueabihf binutils-arm-linux-gnueabihf \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /src
COPY . /src
CMD ["/bin/bash"]

View File

@@ -10,6 +10,13 @@ All builds use:
- **Host Architecture**: x86_64 (AMD64)
- **Build Method**: Cross-compilation for target platforms
## Supported Target Architectures
- **Linux x86_64**: Native Linux 64-bit binaries
- **Linux aarch64**: ARM64 binaries for Raspberry Pi 4+ and modern ARM devices
- **Linux ARMv7l**: 32-bit ARM binaries for Raspberry Pi 2/3, Pi Zero, and older ARM devices
- **Windows x86_64**: Windows executables via MinGW-w64 cross-compilation
## Linux x86_64 Build
### Overview
@@ -135,6 +142,81 @@ docker run --rm -it -v "$(pwd)/../build/linux-aarch64":/out palladium-builder:li
**Docker build issues:** Ensure Docker has sufficient resources and the daemon is running
## Linux ARMv7l Build
### Overview
This build creates Linux ARMv7l (32-bit ARM) binaries specifically designed for older ARM-based devices and single board computers. The build process uses cross-compilation in a Docker container:
1. **Builds a Docker image** (`palladium-builder:linux-armv7l-ubuntu20.04`) containing ARMv7l cross-compilation toolchain
2. **Copies the entire repository** into the container during image build
3. **Cross-compiles for ARMv7l** using the `depends` system with `arm-linux-gnueabihf` target
4. **Outputs binaries** to a mounted volume for host access
### Quick Start
```bash
cd docker-build
chmod +x build-linux-armv7l.sh
./build-linux-armv7l.sh
```
ARMv7l binaries will be available in `../build/armv7l/` directory.
### Prerequisites
- Docker installed and running ([installation guide](https://docs.docker.com/get-docker/))
- Sufficient disk space for the build process (at least 12 GB free)
- Internet connection for downloading dependencies and ARMv7l cross-compilation toolchain
### Target Devices
This build is optimized for:
- **Raspberry Pi 2** and **Raspberry Pi 3** (32-bit mode)
- **Raspberry Pi Zero** and **Zero W**
- Older ARM-based single board computers (BeagleBone, etc.)
- ARMv7l Linux embedded devices
- 32-bit ARM servers and workstations
### Produced Binaries
The following ARMv7l binaries are built and copied to the output directory:
- `palladiumd`: Main daemon
- `palladium-cli`: Command-line client
- `palladium-tx`: Transaction utility
- `palladium-wallet`: Wallet utility
- `palladium-qt`: GUI application (if Qt dependencies are available)
### Output Directory
Binaries are placed in: `../build/armv7l/` (relative to the docker-build directory)
### Cross-Compilation Details
- **Target Triple**: `arm-linux-gnueabihf`
- **Toolchain**: GCC ARM cross-compiler with hard-float ABI
- **Dependencies**: Built using the `depends` system for ARMv7l target
- **Configuration**: Uses `CONFIG_SITE` for proper cross-compilation setup
- **ABI**: Hard-float (gnueabihf) for better performance on modern ARM devices
### Troubleshooting
**Permission errors:** The build script automatically handles file permissions using host UID/GID
**Build failed:** Run interactive container for debugging:
```bash
docker run --rm -it -v "$(pwd)/../build/armv7l":/out palladium-builder:linux-armv7l-ubuntu20.04 bash
```
**Cross-compilation issues:** Ensure the ARM cross-compilation toolchain is properly installed in the container
**Missing binaries:** Check that the configure script detected the ARMv7l target correctly
**Docker build issues:** Ensure Docker has sufficient resources and the daemon is running
**Performance considerations:** ARMv7l builds may take longer to execute on target devices compared to ARM64 builds
## Windows x86_64 Build
### Overview

View File

@@ -0,0 +1,60 @@
#!/usr/bin/env bash
set -euo pipefail
IMAGE_NAME="palladium-builder:linux-armv7l-ubuntu20.04"
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
REPO_DIR="$(cd "${SCRIPT_DIR}/.." && pwd)"
OUT_DIR="${REPO_DIR}/build/armv7l"
HOST_TRIPLE="arm-linux-gnueabihf"
HOST_UID="$(id -u)"
HOST_GID="$(id -g)"
echo "[*] Building Docker image including the ENTIRE repository (COPY . /src)..."
docker build --platform=linux/amd64 \
-t "$IMAGE_NAME" \
-f "${SCRIPT_DIR}/Dockerfile.linux-armv7l" \
"${REPO_DIR}"
mkdir -p "${OUT_DIR}"
echo "[*] Starting container: build COMPLETED in container; mounting ONLY the output..."
docker run --rm --platform=linux/amd64 \
-e HOST_UID="${HOST_UID}" -e HOST_GID="${HOST_GID}" \
-v "${OUT_DIR}":/out \
"$IMAGE_NAME" \
bash -c "
set -euo pipefail
cd /src
echo '[*] depends (HOST=${HOST_TRIPLE})...'
cd depends && make HOST=${HOST_TRIPLE} -j\$(nproc) && cd ..
echo '[*] autogen/configure...'
[[ -x ./autogen.sh ]] && ./autogen.sh
[[ -f ./configure ]] || { echo 'configure not found: autogen failed'; exit 1; }
./configure --prefix=\$PWD/depends/${HOST_TRIPLE} \
--host=${HOST_TRIPLE} \
--enable-glibc-back-compat \
--enable-reduce-exports \
CC=${HOST_TRIPLE}-gcc CXX=${HOST_TRIPLE}-g++ \
AR=${HOST_TRIPLE}-ar RANLIB=${HOST_TRIPLE}-ranlib STRIP=${HOST_TRIPLE}-strip \
LDFLAGS='-static-libstdc++'
echo '[*] make...'
make -j\$(nproc)
echo '[*] copy binaries to /out...'
mkdir -p /out
for b in src/palladiumd src/palladium-cli src/palladium-tx src/palladium-wallet src/qt/palladium-qt; do
[[ -f \"\$b\" ]] && install -m 0755 \"\$b\" /out/
done
# Add permissions to host user
chown -R \${HOST_UID:-0}:\${HOST_GID:-0} /out
echo '[*] build COMPLETED (all binaries in container) → /out'
"
echo "[*] ARMv7l binaries available in: ${OUT_DIR}"