forked from chrissnell/graywolf
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCross.toml
More file actions
57 lines (52 loc) · 3.21 KB
/
Copy pathCross.toml
File metadata and controls
57 lines (52 loc) · 3.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
[target.aarch64-unknown-linux-gnu]
pre-build = [
"dpkg --add-architecture arm64 && apt-get update && apt-get install -y libasound2-dev:arm64 libudev-dev:arm64 unzip && curl -Lo /tmp/protoc.zip https://github.com/protocolbuffers/protobuf/releases/download/v28.3/protoc-28.3-linux-x86_64.zip && unzip -o /tmp/protoc.zip -d /usr/local bin/protoc && chmod +x /usr/local/bin/protoc && rm /tmp/protoc.zip",
]
# Cross compilation of alsa-sys / udev needs pkg-config to look in the
# target arch's multi-arch directory inside the container. The 0.13.6
# release initially failed with "Package alsa was not found in the
# pkg-config search path" because PKG_CONFIG_ALLOW_CROSS / PATH default
# to unset and pkg-config-rs refuses cross lookups unless the operator
# opts in. Passthrough lets release.yml supply both vars from the host
# runner; the values themselves point at paths that exist inside the
# container after the libasound2-dev:arm64 multi-arch install above.
[target.aarch64-unknown-linux-gnu.env]
passthrough = [
"PKG_CONFIG_ALLOW_CROSS",
"PKG_CONFIG_PATH_aarch64_unknown_linux_gnu",
"CFLAGS_aarch64_unknown_linux_gnu",
]
# 32-bit ARMv6 hard-float for Raspbian on older Raspberry Pi (Pi 1, Pi 2,
# original Pi Zero / Zero W). Cortex-A7 (Pi 2) is ARMv7 but runs ARMv6
# binaries, so a single armv6 build covers all 32-bit Pi models.
[target.arm-unknown-linux-gnueabihf]
pre-build = [
"dpkg --add-architecture armhf && apt-get update && apt-get install -y libasound2-dev:armhf libudev-dev:armhf unzip && curl -Lo /tmp/protoc.zip https://github.com/protocolbuffers/protobuf/releases/download/v28.3/protoc-28.3-linux-x86_64.zip && unzip -o /tmp/protoc.zip -d /usr/local bin/protoc && chmod +x /usr/local/bin/protoc && rm /tmp/protoc.zip",
]
# Same pkg-config cross-lookup story as the aarch64 target above; see
# the note there for context. armhf's multi-arch path differs only in
# triple.
[target.arm-unknown-linux-gnueabihf.env]
passthrough = [
"PKG_CONFIG_ALLOW_CROSS",
"PKG_CONFIG_PATH_arm_unknown_linux_gnueabihf",
"CFLAGS_arm_unknown_linux_gnueabihf",
]
# 32-bit ARMv7-A hard-float (NEON). Same hardfloat ABI and the same
# `arm-linux-gnueabihf` multi-arch tuple as the armv6 target above, so the
# :armhf dev packages and pkg-config dir are identical -- only the Rust
# triple differs. The two builds are kept separate so armv6-only Pi models
# keep a scalar binary while armv7-a boards (Cortex-A7+) get the NEON build;
# the +neon codegen flag lives in .cargo/config.toml, keyed to this triple.
[target.armv7-unknown-linux-gnueabihf]
pre-build = [
"dpkg --add-architecture armhf && apt-get update && apt-get install -y libasound2-dev:armhf libudev-dev:armhf unzip && curl -Lo /tmp/protoc.zip https://github.com/protocolbuffers/protobuf/releases/download/v28.3/protoc-28.3-linux-x86_64.zip && unzip -o /tmp/protoc.zip -d /usr/local bin/protoc && chmod +x /usr/local/bin/protoc && rm /tmp/protoc.zip",
]
# Multi-arch path is shared with armv6 (both are arm-linux-gnueabihf); the
# passthrough env var names are keyed to the Rust triple, so they differ.
[target.armv7-unknown-linux-gnueabihf.env]
passthrough = [
"PKG_CONFIG_ALLOW_CROSS",
"PKG_CONFIG_PATH_armv7_unknown_linux_gnueabihf",
"CFLAGS_armv7_unknown_linux_gnueabihf",
]