HomePhabricator

[NewPM] Port tsan

Description

[NewPM] Port tsan

A straightforward port of tsan to the new PM, following the same path
as D55647.

Differential Revision: https://reviews.llvm.org/D56433

Details

Committed
pfaffeJan 8 2019, 11:21 AM
Differential Revision
D56433: [NewPM] Port tsan
Parents
rL350646: [x86] add tests for PR40243; NFC
Branches
Unknown
Tags
Unknown

Event Timeline

jgorbe added a subscriber: jgorbe.Jan 8 2019, 11:55 AM

Hi,

I think this change just broke the clang build:

[1488/2413] Building CXX object tools/clang/lib/CodeGen/CMakeFiles/clangCodeGen.dir/BackendUtil.cpp.o
FAILED: tools/clang/lib/CodeGen/CMakeFiles/clangCodeGen.dir/BackendUtil.cpp.o 
/usr/local/google/home/jgorbe/local/bin/clang++   -DGTEST_HAS_RTTI=0 -D_DEBUG -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Itools/clang/lib/CodeGen -I/usr/local/google/home/jgorbe/code/llvm/clang/lib/CodeGen -I/usr/local/google/home/jgorbe/code/llvm/clang/include -Itools/clang/include -I/usr/include/libxml2 -Iinclude -I/usr/local/google/home/jgorbe/code/llvm/llvm/include -fPIC -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -std=c++11 -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wstring-conversion -fdiagnostics-color -ffunction-sections -fdata-sections -fno-common -Woverloaded-virtual -Wno-nested-anon-types -O3    -UNDEBUG  -fno-exceptions -fno-rtti -MD -MT tools/clang/lib/CodeGen/CMakeFiles/clangCodeGen.dir/BackendUtil.cpp.o -MF tools/clang/lib/CodeGen/CMakeFiles/clangCodeGen.dir/BackendUtil.cpp.o.d -o tools/clang/lib/CodeGen/CMakeFiles/clangCodeGen.dir/BackendUtil.cpp.o -c /usr/local/google/home/jgorbe/code/llvm/clang/lib/CodeGen/BackendUtil.cpp
/usr/local/google/home/jgorbe/code/llvm/clang/lib/CodeGen/BackendUtil.cpp:308:10: error: use of undeclared identifier 'createThreadSanitizerPass'; did you mean 'createHWAddressSanitizerPass'?
  PM.add(createThreadSanitizerPass());
         ^~~~~~~~~~~~~~~~~~~~~~~~~
         createHWAddressSanitizerPass
/usr/local/google/home/jgorbe/code/llvm/llvm/include/llvm/Transforms/Instrumentation.h:155:15: note: 'createHWAddressSanitizerPass' declared here
FunctionPass *createHWAddressSanitizerPass(bool CompileKernel = false,
              ^
1 error generated.
fhahn added a subscriber: fhahn.Jan 9 2019, 3:20 AM

It looks like this patch may have broken some bots on green dragon, e.g lots of ThreadSanitizer and UBSan-ThreadSanitizer-x86_64 tests stared failing after this went in: http://green.lab.llvm.org/green/job/clang-stage1-configure-RA/52725/

I am working on reproducing it locally, but it would be great if you could have a look.

fhahn added a comment.Jan 9 2019, 5:38 AM

One of the errors with TSan and this patch on macOS is the following while running binaries compiled with TSan:

dyld: initializer function 0x109edf810 not in mapped image for /builds/tools/clang/runtime/compiler-rt-bins/test/tsan/X86_64HConfig/Output/simple_stack.c.tmp

I've reverted the patch for now in rL350719 and rC350718.

fhahn added a comment.Jan 9 2019, 7:16 AM

The bot is back to passing after reverting: http://green.lab.llvm.org/green/job/clang-stage1-configure-RA/52757/. Please let me know if you have trouble reproducing the failure.