Skip to content

Signature mismatch for frexpf in wasm-opt with Memory64=1 #23997

@shinji-TH

Description

@shinji-TH

Hi,

I'm encountering the following error when I tried to use the function frexpf with the flag -sMemory64=1

[wasm-validator error in function std::__2::__math::frexp\5babi:ne190106\5d\28float\2c\20int*\29] call param types must match, on
(call $signature_mismatch:frexpf
 (local.get $5)
 (local.get $8)
)
(on argument 1)
Fatal: error validating input
emcc: error: '/home/yapt/public_repo/emsdk/upstream/bin/wasm-opt --print-function-map /home/yapt/EmscriptenTestProjSkeleton/build/index.wasm --mvp-features --enable-bulk-memory --enable-bulk-memory-opt --enable-call-indirect-overlong --enable-memory64 --enable-multivalue --enable-mutable-globals --enable-nontrapping-float-to-int --enable-reference-types --enable-sign-ext' failed (returned 1)

main.cpp

#include <stdio.h>
#include <math.h>

int main(void){
    float val = 3.14159265359;
    int e = 0;
    val = static_cast<float>(frexp(val,&e) * 256.0/val);
    printf("e value: %d, val:%f\n", e, val);

    return 0;
}

flags used

  -g
  -O0
  --profiling
  -s ASSERTIONS=1
  -s SAFE_HEAP=0
  --profiling-funcs
  -s ERROR_ON_UNDEFINED_SYMBOLS=0
  -lnodefs.js
  -std=c++20
  -D_LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR
  -s INCLUDE_FULL_LIBRARY=0
  -fstrict-aliasing
  -fPIC
  -s WASM_BIGINT=1
  -s FETCH=1
  -s FETCH_SUPPORT_INDEXEDDB=0
  -Wno-deprecated-builtins
  -s WASM=1
  -s ALLOW_MEMORY_GROWTH=1 
  -s EVAL_CTORS=0
  -s MAIN_MODULE=2
  -s AUTOLOAD_DYLIBS=0
  -s NO_EXIT_RUNTIME=0
  -s INLINING_LIMIT=1
  -s FORCE_FILESYSTEM=1
  --emit-symbol-map
  -s LEGACY_GL_EMULATION=0
  -s INITIAL_MEMORY=1000MB
  -s ENVIRONMENT=web,worker
  -s USE_SDL=0
  -s STRICT=0
  -s ALLOW_UNIMPLEMENTED_SYSCALLS=1
  -s SPLIT_MODULE=1
  -s USE_ICU=1
  -s EXPORTED_RUNTIME_METHODS=['allocate','writeArrayToMemory']
  -s EXPORTED_FUNCTIONS=__Znwm
  -s MEMORY64=1
  -s VERBOSE

emcc version

emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 4.0.6 (1ddaae4d2d6dfbb678ecc193bc988820d1fc4633)
clang version 21.0.0git (https:/github.com/llvm/llvm-project 4775e6d9099467df9363e1a3cd5950cc3d2fde05)
Target: wasm32-unknown-emscripten
Thread model: posix
InstalledDir: /home/yapt/public_repo/emsdk/upstream/bin

I also tried reducing the amount of flags, to see if there are any differences.
However it seem I encounter runtime errors instead
Image

Any suggestion to resolve this error? Thanks!!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions