Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Patch the "SONAME" when building for Android

オープン
#14 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
38/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
android, typescript

調査の方向性

packages/host/src/node/prebuilds/android.ts と packages/host/src/node/cli/android.ts の TODOs から始め、Android ライブラリの名前が変更され、インストールされる仕組みを追跡してください。名前を変更したライブラリとその依存ライブラリの両方について、結果として得られる ELF メタデータを検証してください。SONAME と DT_NEEDED のエントリが、ビルド後に実際に存在するファイル名を参照していれば完了です。

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
TypeScript
スター
188
フォーク
10
平均マージ
2日 17時間
マージ済み PR(30日)
3

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

callstackincubator/react-native-node-api のほかの issue

callstackincubator/react-native-node-api の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。