Skip to content

SDK should support Undefined Behavior Sanitizer #552

@whitequark

Description

@whitequark

Per llvm/llvm-project#151015 (comment).

Currently it results in a linker error:

$ /opt/wasi-sdk/bin/clang -fsanitize=undefined test.c
wasm-ld: error: /tmp/test-1cf416.o: undefined symbol: __ubsan_handle_pointer_overflow
wasm-ld: error: /tmp/test-1cf416.o: undefined symbol: __ubsan_handle_type_mismatch_v1
clang: error: linker command failed with exit code 1 (use -v to see invocation)

This is because sanitizer runtimes are turned off:

-DCOMPILER_RT_BUILD_SANITIZERS=OFF

I tried turning them on and that causes a cascade of failures, not the least a bunch of fuzzer headers appearing in include-all.c; some of which don't compile and some introduce new symbols. How should I proceed? I could add them to the find command with exclusions but there's like 15 new headers.

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