Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Patch the "SONAME" when building for Android

Aperta
#14 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
38/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
android, typescript

Direzione di ricerca

Inizia dai TODOs in packages/host/src/node/prebuilds/android.ts e packages/host/src/node/cli/android.ts, quindi traccia il modo in cui le librerie Android vengono rinominate e installate. Verifica i metadati ELF risultanti sia per le librerie rinominate sia per le relative dipendenze; il lavoro è completato quando le voci SONAME e DT_NEEDED fanno riferimento a nomi di file che esistono effettivamente dopo il build.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Android 🤖 CMake RN good first issue

When we're building for Android we rename the dynamic library files but, we don't update the SONAME which should be updatable by running /toolchains/llvm/prebuilt//bin/llvm-objcopy --set-soname=libnewname.so liboriginal.so


The two TODOs in the tree that track this

Adding permalinks (against 29a527d) since both halves of the renaming problem are marked in the source but only the first was described above.

1. The renamed library's own SONAMEprebuilds/android.ts copies the library to lib<name>.so and leaves its install path pointing at the pre-rename name:

https://github.com/callstackincubator/react-native-node-api/blob/29a527d87fa8cb965b0048b1b4c1cff2b0eab281/packages/host/src/node/prebuilds/android.ts#L62-L65

This is what the issue describes — llvm-objcopy --set-soname.

2. The DT_NEEDED entries of libraries that depend on a renamed one — the companion problem, marked separately in cli/android.ts:

https://github.com/callstackincubator/react-native-node-api/blob/29a527d87fa8cb965b0048b1b4c1cff2b0eab281/packages/host/src/node/cli/android.ts#L46-L52

Fixing only the SONAME is not enough when one addon links against another: the dependent library's DT_NEEDED still names the original library, so the dynamic linker looks for a file that no longer exists under that name. llvm-objcopy does not rewrite DT_NEEDED; patchelf --replace-needed <old> <new> does, or the entries can be patched directly.

Both are the same underlying cause — we rename files after the linker has already baked the old names into the ELF headers — so they are probably best fixed together.

Lingua principale
TypeScript
Stelle
188
Fork
10
Merge medio
2g 17h
PR unite (30g)
3

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di callstackincubator/react-native-node-api

Tutte le issue di callstackincubator/react-native-node-api

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.