[libcxx-commits] [PATCH] D119410: [libc++][NFC] Work around false positive ODR violations from ASan.

Konstantin Varlamov via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed Feb 9 23:07:07 PST 2022


var-const created this revision.
Herald added a subscriber: arichardson.
var-const requested review of this revision.
Herald added a project: libc++.
Herald added a subscriber: libcxx-commits.
Herald added a reviewer: libc++.

This works around a known issue in ASan. ASan doesn't instrument weak
symbols. Because instrumentation increases object size, the binary can
end up with two versions of the same object, one instrumented and one
not instrumented, with different sizes, which ASan will report as an ODR
violation. In libc++, this affects typeinfo for `std::bad_function_call`
which is emitted as a weak symbol in the test executable and as a strong
symbol in the shared library.

The main open issue for ASan appears to be
https://github.com/google/sanitizers/issues/1017.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D119410

Files:
  libcxx/utils/ci/run-buildbot


Index: libcxx/utils/ci/run-buildbot
===================================================================
--- libcxx/utils/ci/run-buildbot
+++ libcxx/utils/ci/run-buildbot
@@ -310,7 +310,8 @@
     clean
     generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-asan.cmake" \
                    -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \
-                   -DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
+                   -DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in" \
+                   -DCMAKE_CXX_FLAGS="-mllvm -asan-use-private-alias=1"
     check-runtimes
 ;;
 generic-msan)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D119410.407400.patch
Type: text/x-patch
Size: 619 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20220210/46e5b777/attachment-0001.bin>


More information about the libcxx-commits mailing list