Skip to content

[OpenMP] asan doesn't work when offload to host #75651

Open
@ye-luo

Description

@ye-luo

Currently app doesn't link when OpenMP offload to host and address sanitizer are both turned on.

$ clang++ -fopenmp -fopenmp-targets=x86_64-pc-linux-gnu -fsanitize=address main.cpp
/usr/bin/ld: /tmp/main-6e59bc-x86_64-pc-linux-gnu--d95d92.o: in function `asan.module_ctor':
main.cpp:(.text.asan.module_ctor[asan.module_ctor]+0x5): undefined reference to `__asan_init'
/usr/bin/ld: main.cpp:(.text.asan.module_ctor[asan.module_ctor]+0xa): undefined reference to `__asan_version_mismatch_check_v8'
/usr/bin/ld: main.cpp:(.text.asan.module_ctor[asan.module_ctor]+0x24): undefined reference to `__asan_register_elf_globals'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
/scratch3/packages/llvm/master-nightly/bin/clang-linker-wrapper: error: 'clang' failed
clang++: error: linker command failed with exit code 1 (use -v to see invocation)

main.cpp

int main() {}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions