|
1
|
# Force the system (Xcode) C/C++ compilers when building on macOS hosts. |
|
2
|
# This avoids picking up Android NDK toolchains from the shell environment. |
|
3
|
[env] |
|
4
|
CXX = { value = "/usr/bin/clang++", force = true } |
|
5
|
CC = { value = "/usr/bin/clang", force = true } |
|
6
|
MACOSX_DEPLOYMENT_TARGET = { value = "14.0", force = true } |
|
7
|
|
|
8
|
# iOS / tvOS builds of `gemm-f16` require ARM full FP16 support for inline |
|
9
|
# NEON instructions like: |
|
10
|
# fmul v0.8h, v1.8h, v2.8h |
|
11
|
# fmla v0.8h, v1.8h, v2.h[0] |
|
12
|
# Without `+fullfp16`, LLVM/Rust rejects those instructions with: |
|
13
|
# error: instruction requires: fullfp16 |
|
14
|
# |
|
15
|
# `+fp16` alone is not sufficient here — `gemm-common` uses arithmetic vector |
|
16
|
# half-precision instructions that specifically require `fullfp16`. |
|
17
|
|
|
18
|
[target.aarch64-apple-darwin] |
|
19
|
rustflags = ["-C", "link-arg=-mmacosx-version-min=14.0"] |
|
20
|
|
|
21
|
[target.x86_64-apple-darwin] |
|
22
|
rustflags = ["-C", "link-arg=-mmacosx-version-min=14.0"] |
|
23
|
|
|
24
|
[target.aarch64-apple-ios] |
|
25
|
rustflags = ["-C", "target-feature=+fullfp16,+fp16"] |
|
26
|
|
|
27
|
[target.aarch64-apple-ios-sim] |
|
28
|
rustflags = ["-C", "target-feature=+fullfp16,+fp16"] |
|
29
|
|
|
30
|
[target.aarch64-apple-tvos] |
|
31
|
rustflags = ["-C", "target-feature=+fullfp16,+fp16"] |
|
32
|
|
|
33
|
[target.aarch64-apple-tvos-sim] |
|
34
|
rustflags = ["-C", "target-feature=+fullfp16,+fp16"] |
|
35
|
|
|
36
|
[target.x86_64-apple-tvos] |
|
37
|
rustflags = ["-C", "target-feature=+fullfp16,+fp16"] |
|
38
|
|
|
39
|
# Android arm64-v8a hits the same `gemm-common` fp16 NEON path as iOS. The |
|
40
|
# aarch64 inline asm (`fmla v0.8h, ...`) requires `fullfp16`, which the default |
|
41
|
# `aarch64-linux-android` target does not enable. gemm still runtime-detects the |
|
42
|
# CPU feature, so enabling it here only allows the instructions to assemble. |
|
43
|
# Only aarch64 needs this; the armv7/x86/x86_64 Android targets never compile |
|
44
|
# the aarch64-gated fp16 SIMD module. |
|
45
|
[target.aarch64-linux-android] |
|
46
|
rustflags = ["-C", "target-feature=+fullfp16,+fp16"] |