## Description I'm getting Cargo build errors when trying to use wamr-rust-sdk on Windows 11, while targeting arm (thumbv8). ```bash failed to run custom build command for `wamr-sys v1.0.0 (https://github.com/bytecodealliance/wamr-rust-sdk?tag=v1.1.0#b03ec603)` ``` The build fails during CMAKE configuration with a threading detection error: ```bash error: failed to run custom build command for `wamr-sys v1.0.0 (https://github.com/bytecodealliance/wamr-rust-sdk?tag=v1.1.0#b03ec603)` Caused by: process didn't exit successfully: `C:\Users\Jarvis\Projects\fn-toolkit-usb-proxy\target\debug\build\wamr-sys-2c712a94bba3824d\build-script-build` (exit code: 101) --- stdout cargo:rerun-if-env-changed=WAMR_BUILD_PLATFORM cargo:rerun-if-env-changed=WAMR_SHARED_PLATFORM_CONFIG cargo:rerun-if-env-changed=CARGO_FEATURE_ESP_IDF CMAKE_TOOLCHAIN_FILE_thumbv8m.main-none-eabihf = None CMAKE_TOOLCHAIN_FILE_thumbv8m.main_none_eabihf = None TARGET_CMAKE_TOOLCHAIN_FILE = None CMAKE_TOOLCHAIN_FILE = None CMAKE_GENERATOR_thumbv8m.main-none-eabihf = None CMAKE_GENERATOR_thumbv8m.main_none_eabihf = None TARGET_CMAKE_GENERATOR = None CMAKE_GENERATOR = None CMAKE_PREFIX_PATH_thumbv8m.main-none-eabihf = None CMAKE_PREFIX_PATH_thumbv8m.main_none_eabihf = None TARGET_CMAKE_PREFIX_PATH = None CMAKE_PREFIX_PATH = None CMAKE_thumbv8m.main-none-eabihf = None CMAKE_thumbv8m.main_none_eabihf = None TARGET_CMAKE = None CMAKE = None running: "cmake" "C:\\Users\\Jarvis\\.cargo\\git\\checkouts\\wamr-rust-sdk-1b1ad4ab4e779715\\b03ec60\\crates\\wamr-sys\\wasm-micro-runtime" "-DWAMR_BUILD_AOT=1" "-DWAMR_BUILD_INTERP=1" "-DWAMR_BUILD_FAST_INTERP=1" "-DWAMR_BUILD_JIT=0" "-DWAMR_BUILD_BULK_MEMORY=1" "-DWAMR_BUILD_REF_TYPES=1" "-DWAMR_BUILD_SIMD=1" "-DWAMR_BUILD_LIBC_WASI=1" "-DWAMR_BUILD_LIBC_BUILTIN=0" "-DWAMR_DISABLE_HW_BOUND_CHECK=1" "-DWAMR_BUILD_MULTI_MODULE=0" "-DWAMR_BUILD_DUMP_CALL_STACK=0" "-DWAMR_BUILD_CUSTOM_NAME_SECTION=0" "-DWAMR_BUILD_LOAD_CUSTOM_SECTION=0" "-DWAMR_BUILD_PLATFORM=windows" "-DCMAKE_SYSTEM_NAME=Generic" "-DCMAKE_SYSTEM_PROCESSOR=arm" "-DCMAKE_INSTALL_PREFIX=C:\\Users\\Jarvis\\Projects\\fn-toolkit-usb-proxy\\target\\thumbv8m.main-none-eabihf\\debug\\build\\wamr-sys-1f0a5142d69f697e\\out" "-DCMAKE_C_FLAGS= -ffunction-sections -fdata-sections -mfloat-abi=hard -mthumb -march=armv8-m.main -mfpu=fpv5-sp-d16" "-DCMAKE_CXX_FLAGS= -ffunction-sections -fdata-sections -mfloat-abi=hard -mthumb -march=armv8-m.main -mfpu=fpv5-sp-d16" "-DCMAKE_ASM_FLAGS= -ffunction-sections -fdata-sections -mfloat-abi=hard -mthumb -march=armv8-m.main -mfpu=fpv5-sp-d16" "-DCMAKE_BUILD_TYPE=Debug" -- Configuring incomplete, errors occurred! --- stderr CMake Deprecation Warning at CMakeLists.txt:4 (cmake_minimum_required): Compatibility with CMake < 3.10 will be removed from a future version of CMake. Update the VERSION argument <min> value. Or, use the <min>...<max> syntax to tell CMake that the project requires at least <min> but has been updated to work with policies introduced by <max> or earlier. -- Build Configurations: Build as target X86_64 CMAKE_BUILD_TYPE Debug WAMR Interpreter enabled WAMR AOT enabled WAMR Fast JIT disabled WAMR LLVM ORC JIT disabled Libc builtin disabled Libc WASI enabled Fast interpreter enabled Multiple modules disabled Bulk memory feature enabled Hardware boundary check disabled Wakeup of blocking operations enabled SIMD enabled Reference types enabled GC performance profiling disabled Module instance context enabled Quick AOT/JIT entries enabled AOT intrinsics enabled CMake Error at C:/Program Files/CMake/share/cmake-4.0/Modules/FindPackageHandleStandardArgs.cmake:227 (message): Could NOT find Threads (missing: Threads_FOUND) Call Stack (most recent call first): C:/Program Files/CMake/share/cmake-4.0/Modules/FindPackageHandleStandardArgs.cmake:591 (_FPHSA_FAILURE_MESSAGE) C:/Program Files/CMake/share/cmake-4.0/Modules/FindThreads.cmake:226 (find_package_handle_standard_args) CMakeLists.txt:146 (find_package) thread 'main' panicked at C:\Users\Jarvis\.cargo\registry\src\index.crates.io-1949cf8c6b5b557f\cmake-0.1.54\src\lib.rs:1119:5: command did not execute successfully, got: exit code: 1 build script failed, must exit now stack backtrace: 0: std::panicking::begin_panic_handler at /rustc/05f9846f893b09a1be1fc8560e33fc3c815cfecb/library\std\src\panicking.rs:695 1: core::panicking::panic_fmt at /rustc/05f9846f893b09a1be1fc8560e33fc3c815cfecb/library\core\src\panicking.rs:75 2: cmake::fail at C:\Users\Jarvis\.cargo\registry\src\index.crates.io-1949cf8c6b5b557f\cmake-0.1.54\src\lib.rs:1119 3: cmake::run at C:\Users\Jarvis\.cargo\registry\src\index.crates.io-1949cf8c6b5b557f\cmake-0.1.54\src\lib.rs:1097 4: cmake::Config::build at C:\Users\Jarvis\.cargo\registry\src\index.crates.io-1949cf8c6b5b557f\cmake-0.1.54\src\lib.rs:821 5: build_script_build::main at .\build.rs:102 6: core::ops::function::FnOnce::call_once<void (*)(),tuple$<> > at C:\Users\Jarvis\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\core\src\ops\function.rs:250 7: core::hint::black_box at C:\Users\Jarvis\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\core\src\hint.rs:477 note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace. ``` ## Environment * OS: Windows 11 * Target: thumbv8m.main-none-eabihf (RP2350 ARM Cortex-M33) * WAMR version: v1.1.0 * CMAKE version: 4.0 * ARM Toolchain: arm-gnu-toolchain-14.3.rel1-mingw-w64-x86_64-arm-none-eabi.exe * Build tools: CMAKE and ARM GCC properly installed and in PATH ## Problem Analysis The issue seems to occur because: * CMAKE detects wrong target: Despite setting WAMR_BUILD_TARGET and cross-compilation flags, CMAKE still reports "Build as target X86_64" instead of ARM (is this correct?). * Threading requirement: WAMR's CMakeLists.txt unconditionally calls find_package(Threads REQUIRED) at line 146, even for embedded targets that don't support threading. * ARM toolchain lacks pthread: The bare-metal ARM toolchain (arm-none-eabi-gcc) was built with --disable-threads and doesn't include pthread support, which is expected for embedded targets ## Setup Cargo.toml ```toml wamr-rust-sdk = { git = "https://github.com/bytecodealliance/wamr-rust-sdk", tag = "v1.1.0" } ``` .cargo/config.toml ```toml [target.'cfg(all(target_arch = "arm", target_os = "none"))'] runner = "probe-rs run --chip RP235x --protocol swd --speed 16000" [build] target = "thumbv8m.main-none-eabihf" [env] # WAMR configuration WAMR_BUILD_PLATFORM = "windows" WAMR_BUILD_TARGET = "thumb" CMAKE_POLICY_VERSION_MINIMUM = "3.5" ``` ## Use Case Building firmware for RP2350 microcontroller with WASM runtime support for executing AOT-compiled AssemblyScript functions. Any guidance would be greatly appreciated! 🙇