Edit

kc3-lang/libffi/testsuite/emscripten/node-tests.sh

Branch :

  • Show log

    Commit

  • Author : Kleis Auke Wolthuizen
    Date : 2025-01-31 21:41:56
    Hash : adfe4489
    Message : Emscripten: remove support for `-sWASM_BIGINT=0` (#874) * Emscripten: cleanup * Emscripten: remove support for `-sWASM_BIGINT=0` * Emscripten: remove redundant CircleCI config * Emscripten: modernize CI * Ensure test helper methods are static Similar to #644. * Fix test failures in `cls_multi_{s,u}shortchar`

  • testsuite/emscripten/node-tests.sh
  • #!/bin/bash
    
    if ! [ -x "$(command -v emcc)" ]; then
      echo "Error: emcc could not be found." >&2
      exit 1
    fi
    
    # Common compiler flags
    export CFLAGS="-fPIC $EXTRA_CFLAGS"
    export CXXFLAGS="$CFLAGS -sNO_DISABLE_EXCEPTION_CATCHING $EXTRA_CXXFLAGS"
    export LDFLAGS="-sEXPORTED_FUNCTIONS=_main,_malloc,_free -sALLOW_TABLE_GROWTH -sASSERTIONS -sNO_DISABLE_EXCEPTION_CATCHING -sWASM_BIGINT"
    
    # Specific variables for cross-compilation
    export CHOST="wasm32-unknown-linux" # wasm32-unknown-emscripten
    
    autoreconf -fiv
    emconfigure ./configure --prefix="$(pwd)/target" --host=$CHOST --enable-static --disable-shared \
      --disable-builddir --disable-multi-os-directory --disable-raw-api --disable-docs ||
      (cat config.log && exit 1)
    make
    
    EMMAKEN_JUST_CONFIGURE=1 emmake make check \
      RUNTESTFLAGS="LDFLAGS_FOR_TARGET='$LDFLAGS'" || (cat testsuite/libffi.log && exit 1)