PGO errors on native with symbols generated by `wit_bindgen::generate!`
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
- #1577 @carabistouflette による — マージされずにクローズ
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 35/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- rust, wasm
- 領域
- build-system, tooling
調査の方向性
scripts/build、scripts/build-examples、およびドキュメント化されている PGO コマンドを使用して khutulun-dev の失敗を再現し、生成されたリンカー入力を floria-plugins.wit ファイルおよび関連する cargo-pgo issue と比較します。wit_bindgen::generate! によって生成されたシンボルに対する rust-lld エラーなしで PGO ビルドが完了すれば完了です。
索引モデルが issue の本文から書いたものです。
説明
While trying to create a PGO build of a complex program that uses wasmtime as well as wasmtime::component::bindgen I encountered a linker error during the PGO optimization phase:
"/home/xxx/.cargo/target/x86_64-unknown-linux-gnu/release/deps/{libregex-c07ab95555f39da0,libregex_automata-7ee923d5f6c2717f,libaho_corasick-5c8f4fd45dbfd81d,libmemchr-6bf3bd84cc706660,libregex_syntax-29ae9a4cd46cd534,libpuccini_plugin_sdk_tosca_2_0-e5bae6e4238f19b8,libchrono-cdb2d612e7931659,libiana_time_zone-e1ddac5c8d3f6e30,libbase64-bc218090048adb9e,libfloria_plugin_sdk-2d3041ed2aa76b6f,libwit_bindgen-d74a0375665663a5,libwaki-0efdb38898b964aa,libform_urlencoded-b370f73aedd7d6ac,libpercent_encoding-3f263064c2841206,libwit_bindgen-fb809008eb3c2160,libwit_bindgen_rt-0a4c48ecc7933c57,libbitflags-50780dc367a8909d,libhttp-25d9a9cb8324f3c8,libitoa-6dd9b0b770f89707,libbytes-fe6d9b7a8a9571c5,libanyhow-8b765c7e03803d5b,libordered_float-1bbdc6eb007024dd,libserde-6a94ee0c090e296d,libserde_core-67855228a5a4e304,libnum_traits-24fe799717f9791d}.rlib" "<sysroot>/lib/rustlib/x86_64-unknown-linux-gnu/lib/{libstd-*,libpanic_unwind-*,libobject-*,libmemchr-*,libaddr2line-*,libgimli-*,libcfg_if-*,librustc_demangle-*,libstd_detect-*,libhashbrown-*,librustc_std_workspace_alloc-*,libminiz_oxide-*,libadler2-*,libunwind-*,liblibc-*,librustc_std_workspace_core-*,liballoc-*,libcore-*,libcompiler_builtins-*}.rlib" "-Wl,-Bdynamic" "-lgcc_s" "-lutil" "-lrt" "-lpthread" "-lm" "-ldl" "-lc" "-L" "/tmp/rustctoZu3J/raw-dylibs" "-B<sysroot>/lib/rustlib/x86_64-unknown-linux-gnu/bin/gcc-ld" "-fuse-ld=lld" "-Wl,--eh-frame-hdr" "-Wl,-z,noexecstack" "-L" "<sysroot>/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-o" "/home/xxx/.cargo/target/x86_64-unknown-linux-gnu/release/deps/libpuccini_plugin_tosca_2_0.so" "-Wl,--gc-sections" "-shared" "-Wl,-z,relro,-z,now" "-Wl,-O1" "-Wl,--strip-debug" "-nodefaultlibs"
= note: some arguments are omitted. use `--verbose` to show all linker arguments
= note: rust-lld: error: /tmp/rustctoZu3J/list:4: ; expected, but got cabi_post_floria:plugins/dispatch
>>> cabi_post_floria:plugins/dispatch#[method]custom-resource.replica;
>>> ^
collect2: error: ld returned 1 exit status
As you can see, it seems to have something to do with the symbol name for the C ABI. I opened this issue first on cargo-pgo but it's a head-scratcher.
Maybe we can try to figure this out together?
Steps to Reproduce
Not trivial, but the best way is this:
Clone and install the khutulun-dev repository. And then try to PGO Puccini:
cd puccini
scripts/build
scripts/build-examples
PGO=true WASM_PRECOMPILE=false LTO=false scripts/build -r
(We don't actually need to disable Wasm precompile and LTO, but they don't make a different for this bug and this will get you the results faster)
For reference, here is the WIT file used.
Versions and Environment
Wasmtime version or commit: 41.0.0
Operating system: Fedora 43
Architecture: x86-64
- 主要言語
- Rust
- スター
- 1.5k
- フォーク
- 306
- 平均マージ
- 1日 4時間
- マージ済み PR(30日)
- 21
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
bytecodealliance/wit-bindgen のほかの issue
-
gen-rust
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
bytecodealliance/wit-bindgen#1791 ·
メンテナーはふだん 1 日以内に返信
-
gen-rust
難易度 4/5 3〜5日 初心者へのやさしさ 22/100
bytecodealliance/wit-bindgen#1790 ·
メンテナーはふだん 1 日以内に返信
-
gen-rust
難易度 3/5 半日 初心者へのやさしさ 55/100
bytecodealliance/wit-bindgen#1787 ·
メンテナーはふだん 1 日以内に返信
-
gen-c#
難易度 4/5 3〜5日 初心者へのやさしさ 22/100
bytecodealliance/wit-bindgen#1759 ·
メンテナーはふだん 1 日以内に返信
-
Async exports never free the block of indirect parameters対応中かも @Aditya1404Sal が 37 日前に担当しました。 オープンasync
難易度 4/5 3〜5日 初心者へのやさしさ 30/100
bytecodealliance/wit-bindgen#1757 ·
メンテナーはふだん 1 日以内に返信
bytecodealliance/wit-bindgen の issue をすべて見る
似ている issue
-
lane:collections todo:ticket
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 3 日以内に返信
-
bugfix
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
storytold/designcraft#3662 ·
メンテナーはふだん 1 日以内に返信
-
documentation
難易度 1/5 1〜3時間 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信
-
good first issue tooling
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
Nixitov/Riptide-Native#521 ·
メンテナーはふだん 1 日以内に返信