Commit 39426f6
committed
Android: build/runtime fixes for modern Clang + ETDump path override
Three small fixes needed to build and run ExecuTorch Android on hosts with
Apple Clang 21 and on devices where /data/local/tmp isn't app-writable:
1. Workaround flatcc's vendored CMakeLists.txt hitting -Werror on new Clang
warnings (-Wimplicit-int-conversion-on-negation,
-Wunterminated-string-initialization). Passes FLATCC_ALLOW_WERROR=OFF
into both the top-level flatcc CMake build and the flatcc_ep
ExternalProject.
2. scripts/build_android_library.sh was setting EXECUTORCH_ENABLE_EVENT_TRACER
from $EXECUTORCH_ANDROID_PROFILING but never forwarding the separate
-DEXECUTORCH_ANDROID_PROFILING define that gates ETDumpGen allocation in
extension/android/jni/jni_layer.cpp. As a result, the event tracer was
compiled in but the JNI never attached it, and Module.etdump() always
returned false.
3. Add Module.etdump(String outputPath) / etdumpTo() JNI method so apps can
write the ETDump into their own filesDir. The existing etdump()
hardcodes /data/local/tmp/result.etdump, which is not app-writable on
modern Android (Pixel 9 / API 36 returns EACCES). The new overload
factors the write path through a shared etdump_to_path() helper;
etdump() now delegates to it with the legacy path.1 parent 369f5ca commit 39426f6
4 files changed
Lines changed: 46 additions & 5 deletions
File tree
- extension/android
- executorch_android/src/main/java/org/pytorch/executorch
- jni
- scripts
- third-party
Lines changed: 22 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
265 | 265 | | |
266 | 266 | | |
267 | 267 | | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
268 | 290 | | |
269 | 291 | | |
270 | 292 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
472 | 472 | | |
473 | 473 | | |
474 | 474 | | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
475 | 484 | | |
476 | 485 | | |
477 | 486 | | |
478 | 487 | | |
479 | 488 | | |
480 | 489 | | |
481 | | - | |
482 | | - | |
| 490 | + | |
483 | 491 | | |
484 | | - | |
| 492 | + | |
| 493 | + | |
485 | 494 | | |
486 | 495 | | |
487 | 496 | | |
488 | 497 | | |
489 | 498 | | |
490 | | - | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
491 | 502 | | |
492 | 503 | | |
493 | | - | |
| 504 | + | |
494 | 505 | | |
495 | 506 | | |
496 | 507 | | |
497 | 508 | | |
498 | 509 | | |
499 | 510 | | |
500 | 511 | | |
| 512 | + | |
| 513 | + | |
501 | 514 | | |
502 | 515 | | |
503 | 516 | | |
504 | 517 | | |
| 518 | + | |
| 519 | + | |
505 | 520 | | |
506 | 521 | | |
507 | 522 | | |
| |||
571 | 586 | | |
572 | 587 | | |
573 | 588 | | |
| 589 | + | |
574 | 590 | | |
575 | 591 | | |
576 | 592 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| 43 | + | |
43 | 44 | | |
44 | 45 | | |
45 | 46 | | |
| |||
51 | 52 | | |
52 | 53 | | |
53 | 54 | | |
| 55 | + | |
54 | 56 | | |
55 | 57 | | |
56 | 58 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
| 94 | + | |
94 | 95 | | |
95 | 96 | | |
96 | 97 | | |
| |||
0 commit comments