-
Notifications
You must be signed in to change notification settings - Fork 6
Closed
Labels
Android 🤖Anything related to the Android platform (Gradle, NDK, Android SDK)Anything related to the Android platform (Gradle, NDK, Android SDK)CMake RNOur `cmake` wrapping CLIOur `cmake` wrapping CLI
Description
When building Node-API module dynamic libraries using our react-native-node-api-modules-cmake we're passing -Wl,--allow-shlib-undefined to satisfy the linker when it's missing the Node-API symbols.
This is not great for a couple of reasons:
- We're essentially allowing any symbol to be undefined, which might open up for unresolved symbols other than those from Node-API, which will lead to hard to debug issues for library developers.
- We're postponing the issue until runtime, since
dlopenon Android won't share even global symbols fromlibhermes.sowith the Node-API module dynamic library and it cannot load anyway. It needs to declarelibhermes.so(or whatever .so brings the Node-API symbols) asDT_NEEDED(which is added to the binary automatically when linking against an .so).
Instead, we could build a "fake" libnode.so which would provide failing implementations of all the Node-API symbols. We can use this to link against and then update the DT_NEEDED record in the dynamic library when auto-linking into the Android app, at which point we'd know what library brings the Node-API symbols: For now the only option will be Hermes (engine symbols) in combination with our NodeApiHost (runtime symbols).
Metadata
Metadata
Assignees
Labels
Android 🤖Anything related to the Android platform (Gradle, NDK, Android SDK)Anything related to the Android platform (Gradle, NDK, Android SDK)CMake RNOur `cmake` wrapping CLIOur `cmake` wrapping CLI