-
Notifications
You must be signed in to change notification settings - Fork 15.3k
Closed
Closed
Copy link
Labels
cmakeBuild system in general and CMake in particularBuild system in general and CMake in particularcompiler-rt
Description
Surprisingly, it seems the cmake_minimum_required bump from 3.13.4 to 3.20.0 in @mordante's ffb807a is causing some behavior change that makes compiler-rt tests fail to link on Windows.
From the top of https://lab.llvm.org/buildbot/#/builders/127/builds/48120/steps/8/logs/stdio
[58/136] Generating Fuzzer-x86_64-Test.exe
FAILED: projects/compiler-rt/lib/fuzzer/tests/Fuzzer-x86_64-Test.exe C:/b/slave/sanitizer-windows/build/stage1/projects/compiler-rt/lib/fuzzer/tests/Fuzzer-x86_64-Test.exe
cmd.exe /C "cd /D C:\b\slave\sanitizer-windows\build\stage1\projects\compiler-rt\lib\fuzzer\tests && C:\b\slave\sanitizer-windows\build\stage1\.\bin\clang++.exe FuzzerTestObjects.FuzzerUnittest.cpp.x86_64.o FuzzerTestObjects.gtest-all.cc.x86_64.o C:/b/slave/sanitizer-windows/build/stage1/projects/compiler-rt/lib/fuzzer/tests/RTFuzzerTest.x86_64.lib -o C:/b/slave/sanitizer-windows/build/stage1/projects/compiler-rt/lib/fuzzer/tests/./Fuzzer-x86_64-Test.exe --driver-mode=g++ -Wl,-defaultlib:libcmt,-defaultlib:oldnames"
RTFuzzerTest.x86_64.lib(FuzzerIOWindows.cpp.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MT_StaticRelease' in FuzzerTestObjects.FuzzerUnittest.cpp.x86_64.oI can also reproduce this locally. My CMake version is 3.20.21032501-MSVC_2
> cmake -GNinja -DLLVM_ENABLE_PROJECTS="llvm;clang;compiler-rt" -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_ASSERTIONS=ON -DLLVM_TARGETS_TO_BUILD=X86 ..\llvm && ninja check-fuzzer
[...]
[2985/2987] Generating Fuzzer-x86_64-Test.exe
FAILED: projects/compiler-rt/lib/fuzzer/tests/Fuzzer-x86_64-Test.exe
cmd.exe /C "cd /D C:\src\llvm-project\build.nana\projects\compiler-rt\lib\fuzzer\tests && C:\src\llvm-project\build.nana\.\bin\clang++.exe FuzzerTestObjects.FuzzerUnittest.cpp.x86_64.o FuzzerTestObjects.gtest-all.cc.x86_64.o C:/src/llvm-project/build.nana/projects/compiler-rt/lib/fuzzer/tests/RTFuzzerTest.x86_64.lib -o C:/src/llvm-project/build.nana/projects/compiler-rt/lib/fuzzer/tests/./Fuzzer-x86_64-Test.exe --driver-mode=g++ -Wl,-defaultlib:libcmt,-defaultlib:oldnames"
RTFuzzerTest.x86_64.lib(FuzzerIOWindows.cpp.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MT_StaticRelease' in FuzzerTestObjects.FuzzerUnittest.cpp.x86_64.oI thought LLVM builds defauled to /MT (and compiler-rt's cmake files does some flag massaging for it here: https://github.com/llvm/llvm-project/blob/llvmorg-16.0.3/compiler-rt/CMakeLists.txt#L398), but for some reason ffb807a changes that?
If I add -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded, it builds. Maybe that should be added as a default somewhere?
Metadata
Metadata
Assignees
Labels
cmakeBuild system in general and CMake in particularBuild system in general and CMake in particularcompiler-rt