You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CLAUDE.md
+41-10Lines changed: 41 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -42,15 +42,46 @@ git commit -m "Upgrade CUDA from 13.2 to 13.3"
42
42
43
43
Current Android minimum API level: **28** (Android 9.0 Pie)
44
44
45
-
To change the minimum API level, update the following **three** places:
46
-
47
-
1.**`CMakeLists.txt`** — the `add_compile_definitions(__ANDROID_API__=28)` line (controls which NDK header symbols are exposed).
48
-
2.**`.github/workflows/publish.yml`** — `-DANDROID_PLATFORM=android-28` in both the `crosscompile-android-aarch64` and `crosscompile-android-aarch64-opencl` job steps.
49
-
3.**`CLAUDE.md`** (this file) — the "Current Android minimum API level" line above and the `-DANDROID_PLATFORM` values in the local sanity-build examples.
50
-
51
-
Also update the minimum-API note in **`README.md`** (the `[!NOTE]` block near the Android classifier entries and the "Importing in Android" section).
52
-
53
-
**Why API 28?**`mtmd-helper.cpp` (part of the upstream llama.cpp `mtmd` multimodal library) includes `vendor/sheredom/subprocess.h`, which calls `posix_spawn`, `posix_spawnp`, and `posix_spawn_file_actions_*`. The Android NDK headers only expose those declarations when `__ANDROID_API__ >= 28`. The symbols exist in `libc.so` at all API levels; the define only gates their header visibility.
45
+
This is enforced through bionic's **weak-symbol** mechanism, *not* by bumping
46
+
`__ANDROID_API__` or passing `-DANDROID_PLATFORM`. See "How the API gate is
47
+
satisfied" below for why. To change anything here, update:
48
+
49
+
1.**`CMakeLists.txt`** — the `add_compile_definitions(__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__)`
50
+
block and its Android-detection guard (`OS_NAME MATCHES "Android"` etc.).
51
+
2.**`CLAUDE.md`** (this file) — the "Current Android minimum API level" line above.
52
+
3.**`README.md`** — the minimum-API note (the `[!NOTE]` block near the Android
53
+
classifier entries and the "Importing in Android" section).
54
+
55
+
**Why API 28?**`mtmd-helper.cpp` (part of the upstream llama.cpp `mtmd`
56
+
multimodal library) includes `vendor/sheredom/subprocess.h`, which calls
57
+
`posix_spawn`, `posix_spawnp`, and `posix_spawn_file_actions_*`. Bionic only
58
+
exposes those `<spawn.h>` declarations once the minimum SDK is ≥ 28 (and
59
+
`getifaddrs`/`freeifaddrs` in `<ifaddrs.h>`, used by cpp-httplib, at ≥ 24). The
60
+
symbols exist in `libc.so` at all API levels; bionic only hides the
61
+
*declarations* below the introducing API.
62
+
63
+
**How the API gate is satisfied (important — the obvious fixes do not work).**
64
+
The CI cross-compiler is the `dockcross-android-arm64` image, which is **not**
65
+
the Google NDK CMake toolchain — it is a Debian-style cross-clang at
0 commit comments