Hacktoberfest 2026: as issues que os mantenedores marcaram para outubro, abertas e boas para iniciantes. Ver issues do Hacktoberfest

Patch the "SONAME" when building for Android

Aberta
#14 0 comentários 0 reações 0 responsáveis Ver no GitHub

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
4/5
Tempo estimado
3-5 dias
Facilidade para iniciantes
38/100
Tipo de issue
Bug
Clareza
Razoavelmente clara
Status de atividade
Estagnada
Stack de tecnologia
android, typescript
Domínio
build-system, mobile

Direção de pesquisa

Comece pelos TODOs em packages/host/src/node/prebuilds/android.ts e packages/host/src/node/cli/android.ts e, em seguida, rastreie como as bibliotecas Android são renomeadas e instaladas. Verifique os metadados ELF resultantes tanto para as bibliotecas renomeadas quanto para suas dependentes; está concluído quando as entradas SONAME e DT_NEEDED fizerem referência a nomes de arquivo que realmente existam após o build.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

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.

Linguagem predominante
TypeScript
Estrelas
188
Forks
10
Merge médio
2d 17h
PRs com merge (30d)
3

Guia de contribuição

Nenhum guia de contribuição indexado para este repositório

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de callstackincubator/react-native-node-api

Todas as issues de callstackincubator/react-native-node-api

Issues semelhantes

Mais issues de TypeScript

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.