Prevent generation of dependency on _cxa_guard for static initialization
authorserge-sans-paille <sguelton@redhat.com>
Fri, 14 May 2021 09:45:10 +0000 (11:45 +0200)
committerserge-sans-paille <sguelton@redhat.com>
Wed, 9 Jun 2021 07:38:59 +0000 (09:38 +0200)
commit414482751452e54710f16bae58458c66298aaf69
treebcc668e0092891cd093deaaa849545b5df2ed066
parent699231ab3c7dd8f028d868b103481fa901f3c721
Prevent generation of dependency on _cxa_guard for static initialization

This fixes an issue introduced by https://reviews.llvm.org/D70662

Function-scope static initialization are guarded in C++, so we should probably
not use it because it introduces a dependency on __cxa_guard* symbols.
In the context of clang, libasan is linked statically, and it currently needs to
the odd situation where compiling C code with clang and asan requires -lstdc++

Differential Revision: https://reviews.llvm.org/D102475
compiler-rt/lib/sanitizer_common/sanitizer_posix_libcdep.cpp