Skip to content

Commit

Permalink
Enable builds for armv6 target
Browse files Browse the repository at this point in the history
Related to balena-os#560

Enable builds for the armv6 target.

* **Cross.toml**: Add `arm-unknown-linux-gnueabihf` target with necessary environment variables for cross-compiling libdbus.
* **Cargo.toml**: Add environment variables for cross-compiling libdbus for the armv6 target under `[target.arm-unknown-linux-gnueabihf.env]`.
* **Dockerfile.template**: Add `arm-unknown-linux-gnueabihf` target for the armv6 architecture in the `case` statement.
* **.github/workflows/flowzone.yml**: Add `arm-unknown-linux-gnueabihf` target to the `cargo_targets` list.
  • Loading branch information
vishwamartur committed Dec 2, 2024
1 parent c8e6f29 commit 14e4940
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/flowzone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,5 @@ jobs:
aarch64-unknown-linux-gnu,
armv7-unknown-linux-gnueabihf,
x86_64-unknown-linux-gnu,
i686-unknown-linux-gnu
i686-unknown-linux-gnu,
arm-unknown-linux-gnueabihf
7 changes: 7 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,10 @@ default-features = false

[profile.release]
lto = true

[target.arm-unknown-linux-gnueabihf.env]
passthrough = [
"RUSTFLAGS=-L /usr/arm-linux-gnueabihf/lib/ -L /usr/lib/arm-linux-gnueabihf/",
"PKG_CONFIG_PATH=/usr/lib/arm-linux-gnueabihf/pkgconfig/",
"PKG_CONFIG_ALLOW_CROSS=true"
]
9 changes: 8 additions & 1 deletion Cross.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,11 @@
pre-build = [
"dpkg --add-architecture $CROSS_DEB_ARCH",
"apt-get update && apt-get install --assume-yes libdbus-1-dev:$CROSS_DEB_ARCH"
]
]

[target.arm-unknown-linux-gnueabihf.env]
passthrough = [
"RUSTFLAGS=-L /usr/arm-linux-gnueabihf/lib/ -L /usr/lib/arm-linux-gnueabihf/",
"PKG_CONFIG_PATH=/usr/lib/arm-linux-gnueabihf/pkgconfig/",
"PKG_CONFIG_ALLOW_CROSS=true"
]
4 changes: 3 additions & 1 deletion Dockerfile.template
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ RUN \
BINARY_ARCH_NAME="x86_64-unknown-linux-gnu" ;;\
"armv7hf") \
BINARY_ARCH_NAME="armv7-unknown-linux-gnueabihf" ;;\
"armv6") \
BINARY_ARCH_NAME="arm-unknown-linux-gnueabihf" ;;\
*) \
echo >&2 "error: unsupported architecture ($BALENA_ARCH)"; exit 1 ;; \
esac;\
Expand All @@ -33,4 +35,4 @@ RUN \

COPY scripts/start.sh .

CMD ["bash", "start.sh"]
CMD ["bash", "start.sh"]

0 comments on commit 14e4940

Please sign in to comment.