WasmEdge icon indicating copy to clipboard operation
WasmEdge copied to clipboard

bug: link to static lib 0.14.0 encounters undefined reference to `fmtt::v10::***`

Open CaptainVincent opened this issue 8 months ago • 6 comments

Summary

As the title, the new released version of the static library cannot be linked.

Current State

The symbols related to fmt are undefined.

Expected State

Without compile error.

Reproduction steps

  1. When releasing the current Rust SDK, we forgot to update the archives version and checksum. You could use mine for test https://github.com/CaptainVincent/wasmedge-rust-sdk/tree/update-archives
  2. Create a new cargo proj Cargo.toml
[package]
name = "test_wasmedge_static_link"
version = "0.1.0"
edition = "2021"

[dependencies]
wasmedge-sdk = { git = "https://github.com/CaptainVincent/wasmedge-rust-sdk.git", branch = "update-archives" }

[features]
default = ["standalone", "static"]
standalone = ["wasmedge-sdk/standalone"]
static = ["wasmedge-sdk/static"]
wasi_nn = ["wasmedge-sdk/wasi_nn"]

src/main.rs

use wasmedge_sdk::wasi::WasiModule;

fn main() {
    let mut _wasi = WasiModule::create(None, None, Some(vec!["/:/"])).unwrap();
    println!("Hello, world!");
}
  1. run cargo build

Screenshots

None

Any logs you want to share for showing the specific issue

err.log

Components

Rust SDK

WasmEdge Version or Commit you used

0.14.0

Operating system information

Ubuntu 22.04.4 LTS

Hardware Architecture

x86_64

Compiler flags and options

Appendix:

I tried to verify this issue in the pure WasmEdge compile flow using the following flags.

cmake -GNinja -Bbuild -DCMAKE_BUILD_TYPE=Release -DWASMEDGE_BUILD_SHARED_LIB=Off -DWASMEDGE_BUILD_STATIC_LIB=On -DWASMEDGE_LINK_TOOLS_STATIC=On -DWASMEDGE_BUILD_PLUGINS=Off -DWASMEDGE_BUILD_AOT_RUNTIME=OFF

But when I tried to compile the static library and link it to the tool, I encountered the following error, which prevented me from verifying:

ninja: error: '/usr/lib/llvm-11/lib/libPolly.a', needed by 'tools/wasmedge/wasmedgec', missing and no known rule to make it

CaptainVincent avatar Jun 10 '24 06:06 CaptainVincent