Skip to content

A fast 2D and 3D game engine — TypeScript SDK, C++/WebAssembly core, visual editor. Ship one project to web, desktop, WeChat MiniGames, playable ads, and native Android / iOS.

fix(native): the x86_64 Android PhysX library links — no glibc symbol versions on bionic

yhhb86a910d4534
diff --git a/third_party/physx/ESTELLA_PATCHES.md b/third_party/physx/ESTELLA_PATCHES.md
index e7758d66b..6738cb31a 100644
--- a/third_party/physx/ESTELLA_PATCHES.md
+++ b/third_party/physx/ESTELLA_PATCHES.md
@@ -16,7 +16,7 @@ the pthread calls they make. Each change is marked `ESTELLA` in the source.
| File | Change |
|---|---|
-| `include/foundation/PxMath.h` | no glibc `.symver` asm under emscripten |
+| `include/foundation/PxMath.h` | no glibc `.symver` asm under emscripten or on Android (bionic's libm has no `GLIBC_2.2.5` version, so an x86_64 Android link fails on `powf@GLIBC_2.2.5`) |
| `include/foundation/PxThread.h` | `PxSpinLockPause()` is empty under emscripten (no `nop`) |
| `include/foundation/PxHash.h` | the `size_t` hash overload also under emscripten (`size_t` is its own type on wasm32) |
| `source/foundation/unix/FdUnixAtomic.cpp` | `PAUSE()` empty under emscripten |
diff --git a/third_party/physx/include/foundation/PxMath.h b/third_party/physx/include/foundation/PxMath.h
index 4b9135326..f072ae904 100644
--- a/third_party/physx/include/foundation/PxMath.h
+++ b/third_party/physx/include/foundation/PxMath.h
@@ -19,7 +19,7 @@
#pragma warning(pop)
#endif
-#if (PX_LINUX_FAMILY && !PX_ARM_FAMILY && !PX_EMSCRIPTEN) // ESTELLA: no glibc symbol versions in wasm
+#if (PX_LINUX_FAMILY && !PX_ARM_FAMILY && !PX_EMSCRIPTEN && !defined(__ANDROID__)) // ESTELLA: no glibc symbol versions in wasm or on bionic
// Force linking against nothing newer than glibc v2.17 to remain compatible with platforms with older glibc versions
__asm__(".symver expf,expf@GLIBC_2.2.5");
__asm__(".symver powf,powf@GLIBC_2.2.5");