Skip to content

Could emscripten report the usage of unsupported features in object files? #27213

Description

@sbc100

Imagine you have a larger project made up the whole lot of libraries and object files.

If any one of them uses a feature that is not supported by the target engines it would be nice the linker could report it.

The linker (wasm-ld) does support --features to limit the features used. Perhaps emsripten could construct a superset of all supported features (based on target engines) and pass that the linker.

For example:

 $ emcc ~/test/hello.c  -Wl,--features=foo
wasm-ld: error: Target feature 'call-indirect-overlong' used by /tmp/emscripten_temp_y8l17itj/hello.o is not allowed.
wasm-ld: error: Target feature 'nontrapping-fptoint' used by /tmp/emscripten_temp_y8l17itj/hello.o is not allowed.
wasm-ld: error: Target feature 'mutable-globals' used by /tmp/emscripten_temp_y8l17itj/hello.o is not allowed.
wasm-ld: error: Target feature 'reference-types' used by /tmp/emscripten_temp_y8l17itj/hello.o is not allowed.
wasm-ld: error: Target feature 'bulk-memory' used by /tmp/emscripten_temp_y8l17itj/hello.o is not allowed.
wasm-ld: error: Target feature 'multivalue' used by /tmp/emscripten_temp_y8l17itj/hello.o is not allowed.
wasm-ld: error: Target feature 'sign-ext' used by /tmp/emscripten_temp_y8l17itj/hello.o is not allowed.
wasm-ld: error: Target feature 'bulk-memory-opt' used by /tmp/emscripten_temp_y8l17itj/hello.o is not allowed.
emcc: error: '/usr/local/google/home/sbc/dev/wasm/llvm-build/bin/wasm-ld -o a.out.wasm /tmp/tmpomytea90libemscripten_js_symbols.so -Bstatic --strip-debug --export=emscripten_stack_get_end --export=emscripten_stack_get_free --export=emscripten_stack_get_base --export=emscripten_stack_get_current --export=emscripten_stack_init --export=_emscripten_stack_alloc --export=__wasm_call_ctors --export=_emscripten_stack_restore --export-if-defined=__start_em_asm --export-if-defined=__stop_em_asm --export-if-defined=__start_em_lib_deps --export-if-defined=__stop_em_lib_deps --export-if-defined=__start_em_js --export-if-defined=__stop_em_js --export-if-defined=main --export-if-defined=__main_argc_argv --export-if-defined=fflush --export-table -z stack-size=65536 --no-growable-memory --initial-heap=16777216 --no-entry --stack-first --table-base=1 /tmp/emscripten_temp_y8l17itj/hello.o --features=foo -L/usr/local/google/home/sbc/dev/wasm/emscripten/cache/sysroot/lib/wasm32-emscripten -L/usr/local/google/home/sbc/dev/wasm/emscripten/src/lib -lGL-getprocaddr -lal -lhtml5 -lstubs-debug -lnoexit -lc-debug -ldlmalloc-debug -lclang_rt.builtins -lc++-debug-noexcept -lc++abi-debug-noexcept -lsockets -mllvm -combiner-global-alias-analysis=false -mllvm -enable-emscripten-sjlj -mllvm -disable-lsr' failed (returned 1)

See WebAssembly/wabt#2779

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions