-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCross.toml
More file actions
95 lines (85 loc) · 4.04 KB
/
Cross.toml
File metadata and controls
95 lines (85 loc) · 4.04 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# Cross.toml - Configuration for cross-compilation
# Install protoc 28.3 (same version as mise config) in all cross Docker images
#
# IMPORTANT: Cross-compilation runs ON x86_64 hosts, so protoc must be x86_64
# even when cross-compiling FOR ARM targets. Protoc runs during build.rs,
# which executes on the host, not the target architecture.
#
# NOTE: We install clang-14 because bindgen 0.72+ requires clang 11+
# (uses clang_Type_getValueType which was added in clang 11).
# The default cross images have clang 10 which is too old.
[build.env]
passthrough = ["PROTOC"]
# All targets use x86_64 protoc because cross builds run on x86_64 hosts
[target.x86_64-unknown-linux-gnu]
pre-build = [
"apt-get update && apt-get install -y curl unzip wget gnupg software-properties-common",
"wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -",
"add-apt-repository 'deb http://apt.llvm.org/focal/ llvm-toolchain-focal-14 main'",
"apt-get update && apt-get install -y clang-14 libclang-14-dev",
"ln -sf /usr/bin/clang-14 /usr/bin/clang",
"curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v28.3/protoc-28.3-linux-x86_64.zip",
"unzip protoc-28.3-linux-x86_64.zip -d /usr/local",
"chmod +x /usr/local/bin/protoc",
"rm protoc-28.3-linux-x86_64.zip",
]
[target.x86_64-unknown-linux-gnu.env]
passthrough = [
"LIBCLANG_PATH=/usr/lib/llvm-14/lib",
"LLVM_CONFIG_PATH=/usr/bin/llvm-config-14",
]
[target.x86_64-unknown-linux-musl]
pre-build = [
"apt-get update && apt-get install -y curl unzip wget gnupg software-properties-common",
"wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -",
"add-apt-repository 'deb http://apt.llvm.org/focal/ llvm-toolchain-focal-14 main'",
"apt-get update && apt-get install -y clang-14 libclang-14-dev",
"ln -sf /usr/bin/clang-14 /usr/bin/clang",
"curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v28.3/protoc-28.3-linux-x86_64.zip",
"unzip protoc-28.3-linux-x86_64.zip -d /usr/local",
"chmod +x /usr/local/bin/protoc",
"rm protoc-28.3-linux-x86_64.zip",
]
[target.x86_64-unknown-linux-musl.env]
passthrough = [
"LIBCLANG_PATH=/usr/lib/llvm-14/lib",
"LLVM_CONFIG_PATH=/usr/bin/llvm-config-14",
]
[target.aarch64-unknown-linux-gnu]
pre-build = [
"apt-get update && apt-get install -y curl unzip wget gnupg software-properties-common",
"wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -",
"add-apt-repository 'deb http://apt.llvm.org/focal/ llvm-toolchain-focal-14 main'",
"apt-get update && apt-get install -y clang-14 libclang-14-dev",
"ln -sf /usr/bin/clang-14 /usr/bin/clang",
"curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v28.3/protoc-28.3-linux-x86_64.zip",
"unzip protoc-28.3-linux-x86_64.zip -d /usr/local",
"chmod +x /usr/local/bin/protoc",
"rm protoc-28.3-linux-x86_64.zip",
]
[target.aarch64-unknown-linux-gnu.env]
passthrough = [
"LIBCLANG_PATH=/usr/lib/llvm-14/lib",
"LLVM_CONFIG_PATH=/usr/bin/llvm-config-14",
]
[target.aarch64-unknown-linux-musl]
pre-build = [
"apt-get update && apt-get install -y curl unzip wget gnupg software-properties-common",
"wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -",
"add-apt-repository 'deb http://apt.llvm.org/focal/ llvm-toolchain-focal-14 main'",
"apt-get update && apt-get install -y clang-14 libclang-14-dev",
"ln -sf /usr/bin/clang-14 /usr/bin/clang",
"curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v28.3/protoc-28.3-linux-x86_64.zip",
"unzip protoc-28.3-linux-x86_64.zip -d /usr/local",
"chmod +x /usr/local/bin/protoc",
"rm protoc-28.3-linux-x86_64.zip",
]
[target.aarch64-unknown-linux-musl.env]
passthrough = [
"LIBCLANG_PATH=/usr/lib/llvm-14/lib",
"LLVM_CONFIG_PATH=/usr/bin/llvm-config-14",
]
# ARMv7 targets are disabled because rquickjs doesn't have pre-built bindings for them
# Uncomment when/if rquickjs adds armv7 support
# [target.armv7-unknown-linux-gnueabihf]
# [target.armv7-unknown-linux-musleabihf]