Open wmyyy opened 2 years ago
Here are the errors I got when following your receipe:
...
C:\Users\bellenot\git\master\interpreter\llvm\src\include\llvm/Support/Compiler.h(408,11): fatal error C1083:
Cannot open include file: 'sanitizer/asan_interface.h': No such file or directory (compiling source file C:\
Users\bellenot\git\master\interpreter\llvm\src\tools\clang\utils\TableGen\ClangAttrEmitter.cpp) [C:\Users\bel
lenot\build\x86\sanitizer\interpreter\llvm\src\tools\clang\utils\TableGen\obj.clang-tblgen.vcxproj]
C:\Users\bellenot\git\master\interpreter\llvm\src\include\llvm/Support/Compiler.h(408,11): fatal error C1083:
Cannot open include file: 'sanitizer/asan_interface.h': No such file or directory (compiling source file C:\
Users\bellenot\git\master\interpreter\llvm\src\tools\clang\utils\TableGen\ClangASTNodesEmitter.cpp) [C:\Users
\bellenot\build\x86\sanitizer\interpreter\llvm\src\tools\clang\utils\TableGen\obj.clang-tblgen.vcxproj]
C:\Users\bellenot\git\master\interpreter\llvm\src\include\llvm/Support/Compiler.h(408,11): fatal error C1083:
Cannot open include file: 'sanitizer/asan_interface.h': No such file or directory (compiling source file C:\
Users\bellenot\git\master\interpreter\llvm\src\tools\clang\utils\TableGen\ClangSACheckersEmitter.cpp) [C:\Use
rs\bellenot\build\x86\sanitizer\interpreter\llvm\src\tools\clang\utils\TableGen\obj.clang-tblgen.vcxproj]
C:\Users\bellenot\git\master\interpreter\llvm\src\include\llvm/Support/Compiler.h(408,11): fatal error C1083:
Cannot open include file: 'sanitizer/asan_interface.h': No such file or directory (compiling source file C:\
Users\bellenot\git\master\interpreter\llvm\src\tools\clang\utils\TableGen\ClangCommentCommandInfoEmitter.cpp)
[C:\Users\bellenot\build\x86\sanitizer\interpreter\llvm\src\tools\clang\utils\TableGen\obj.clang-tblgen.vcxp
roj]
C:\Users\bellenot\git\master\interpreter\llvm\src\include\llvm/Support/Compiler.h(408,11): fatal error C1083:
Cannot open include file: 'sanitizer/asan_interface.h': No such file or directory (compiling source file C:\
Users\bellenot\git\master\interpreter\llvm\src\tools\clang\utils\TableGen\NeonEmitter.cpp) [C:\Users\bellenot
\build\x86\sanitizer\interpreter\llvm\src\tools\clang\utils\TableGen\obj.clang-tblgen.vcxproj]
C:\Users\bellenot\git\master\interpreter\llvm\src\include\llvm/Support/Compiler.h(408,11): fatal error C1083:
Cannot open include file: 'sanitizer/asan_interface.h': No such file or directory (compiling source file C:\
Users\bellenot\git\master\interpreter\llvm\src\tools\clang\utils\TableGen\ClangDiagnosticsEmitter.cpp) [C:\Us
ers\bellenot\build\x86\sanitizer\interpreter\llvm\src\tools\clang\utils\TableGen\obj.clang-tblgen.vcxproj]
C:\Users\bellenot\git\master\interpreter\llvm\src\include\llvm/Support/Compiler.h(408,11): fatal error C1083:
Cannot open include file: 'sanitizer/asan_interface.h': No such file or directory (compiling source file C:\
Users\bellenot\git\master\interpreter\llvm\src\tools\clang\utils\TableGen\ClangOpenCLBuiltinEmitter.cpp) [C:\
Users\bellenot\build\x86\sanitizer\interpreter\llvm\src\tools\clang\utils\TableGen\obj.clang-tblgen.vcxproj]
C:\Users\bellenot\git\master\interpreter\llvm\src\include\llvm/Support/Compiler.h(408,11): fatal error C1083:
Cannot open include file: 'sanitizer/asan_interface.h': No such file or directory (compiling source file C:\
Users\bellenot\git\master\interpreter\llvm\src\tools\clang\utils\TableGen\ClangOptionDocEmitter.cpp) [C:\User
s\bellenot\build\x86\sanitizer\interpreter\llvm\src\tools\clang\utils\TableGen\obj.clang-tblgen.vcxproj]
C:\Users\bellenot\git\master\interpreter\llvm\src\include\llvm/Support/Compiler.h(408,11): fatal error C1083:
Cannot open include file: 'sanitizer/asan_interface.h': No such file or directory (compiling source file C:\
Users\bellenot\git\master\interpreter\llvm\src\tools\clang\utils\TableGen\ClangDataCollectorsEmitter.cpp) [C:
\Users\bellenot\build\x86\sanitizer\interpreter\llvm\src\tools\clang\utils\TableGen\obj.clang-tblgen.vcxproj]
C:\Users\bellenot\git\master\interpreter\llvm\src\include\llvm/Support/Compiler.h(408,11): fatal error C1083:
Cannot open include file: 'sanitizer/asan_interface.h': No such file or directory (compiling source file C:\
Users\bellenot\git\master\interpreter\llvm\src\tools\clang\utils\TableGen\ClangCommentHTMLNamedCharacterRefer
enceEmitter.cpp) [C:\Users\bellenot\build\x86\sanitizer\interpreter\llvm\src\tools\clang\utils\TableGen\obj.c
lang-tblgen.vcxproj]
C:\Users\bellenot\git\master\interpreter\llvm\src\include\llvm/Support/Compiler.h(408,11): fatal error C1083:
Cannot open include file: 'sanitizer/asan_interface.h': No such file or directory (compiling source file C:\
Users\bellenot\git\master\interpreter\llvm\src\tools\clang\utils\TableGen\TableGen.cpp) [C:\Users\bellenot\bu
ild\x86\sanitizer\interpreter\llvm\src\tools\clang\utils\TableGen\obj.clang-tblgen.vcxproj]
C:\Users\bellenot\git\master\interpreter\llvm\src\include\llvm/Support/Compiler.h(408,11): fatal error C1083:
Cannot open include file: 'sanitizer/asan_interface.h': No such file or directory (compiling source file C:\
Users\bellenot\git\master\interpreter\llvm\src\tools\clang\utils\TableGen\ClangCommentHTMLTagsEmitter.cpp) [C
:\Users\bellenot\build\x86\sanitizer\interpreter\llvm\src\tools\clang\utils\TableGen\obj.clang-tblgen.vcxproj
...
@wmyyy so I can't build with ASAN on Windows (see errors above). But it's weird that you don't have the same errors. And about the "The items cannot be built in parallel.", it's fine, it's only an informative message
@wmyyy so I can't build with ASAN on Windows (see errors above). But it's weird that you don't have the same errors. And about the "The items cannot be built in parallel.", it's fine, it's only an informative message
Hi @bellenot, Very sorry for the late response, could you please check if you install "C++ Address Sanitizer" components in Visual studio?
Thanks
@wmyyy Good point. I'll try and let you know
@wmyyy I just checked and I have the "C++ Address Sanitizer" component in Visual studio.
Hi @bellenot, Can you check if you installed these two components as well? If it still not work, can you try to set include path? for example: set INCLUDE=C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.29.30133\crt\src;%INCLUDE%
Thanks
Still no luck, even when adding
set INCLUDE="C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\Llvm\lib\clang\12.0.0\include";%INCLUDE%
I still have the following error:
C:\Users\bellenot\git\master\interpreter\llvm\src\include\llvm/Support/Compiler.h(408,11): fatal error C1083:
Cannot open include file: 'sanitizer/asan_interface.h': No such file or directory
I'll investigate more. And BTW, I see that:
set _LINK_= /InferASanLibs /incremental:no /debug
and then
cmake --build . --config Release
So you compile in release mode and link in debug mode? Really?
Hi bellenot, link option /debug creates debugging information for the executable. And this option is not really required, you can ignore it.
OK, back to this. For the record, the working syntax (for me) is:
set _CL_= /fsanitize=address /wd5072 /I"C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.32.31326\crt\src" & set _LINK_= /InferASanLibs /incremental:no /debug
set ASAN_OPTIONS=detect_odr_violation=0
And at the end of the build I got:
Generating tutorials/hsimple.root
C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets
(245,5): error MSB8066: Custom build for 'C:\Users\sftnight\build\x64\ASAN\CMakeFiles\c6c09d13817678206ffac31
1bf59f66e\hsimple.root.rule;C:\Users\sftnight\build\x64\ASAN\CMakeFiles\9f4ed4473669458dfc17172b1f87108d\hsim
ple.rule' exited with code -1073741515. [C:\Users\sftnight\build\x64\ASAN\hsimple.vcxproj]
Done Building Project "C:\Users\sftnight\build\x64\ASAN\hsimple.vcxproj" (default targets) -- FAILED.
Done Building Project "C:\Users\sftnight\build\x64\ASAN\ALL_BUILD.vcxproj" (default targets) -- FAILED.
Build FAILED.
So not the same error with VS 2022 (64 bit). Will try in Debug mode and let you know. And since the errors are different between VS 2019 and 2022, I suspect an incompatibility between LLVM/Clang and Visual Studio. We'll see how it goes after the LLVM upgrade.
So I can reproduce the error in 32 bit mode. But the 64 bit mode fails as previously reported. Le's see how it goes after the LLVM upgrade.
Hi @bellenot . LLVM is now at version 16: is this still an issue? Can it be closed?
Hi @bellenot . LLVM is now at version 16: is this still an issue? Can it be closed?
I'll try
So it still fails with LLVM 16
Describe the bug
Hi All,
I have follow below steps to build root project with msvc on AddressSanitizer mode, but hit below errors. And I have seen "WARNING "Address sanitizer builds only tested with gcc and Clang" on CMakeLists. So I am not sure if root support asan mode with msvc. Could you please help have a look and confirm it? Thanks a lot!
(The error message shows "The items cannot be built in parallel." but I have tried build single parallel still hit this error) Error:
To Reproduce
git clone https://github.com/root-project/root.git root_src
mkdir root_build && cd root_build
cmake -G"Visual Studio 16 2019" -A Win32 -Dtesting=ON -Droottest=ON ../root_src
set _CL_= /fsanitize=address /GS- /wd5072 & set _LINK_= /InferASanLibs /incremental:no /debug
(please make sure use to inclose CL and LINK, since will style text Italic here )set ASAN_OPTIONS=detect_odr_violation=0
cmake --build . --config Release
Setup