llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
28.35k stars 11.7k forks source link

Build failure #53930

Open JohnScience opened 2 years ago

JohnScience commented 2 years ago

I needed a source package (as opposed to binary package) so that LLVM package contains not only LLVMConfigExtensions.cmake but also LLVMConfig.cmake that is requested by build files for LLVM-CBE.

Explanation

Build failure log

[8/2321] Linking CXX shared library bin\LTO.dll
FAILED: bin/LTO.dll lib/LTO.lib
cmd.exe /C "cd . && C:\PROGRA~1\LLVM\bin\CLANG_~1.EXE -fuse-ld=lld-link -nostartfiles -nostdlib -Werror=date-time -Werror=unguarded-availability-new -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -ffunction-sections -fdata-sections -O3 -DNDEBUG -D_DLL -D_MT -Xclang --dependent-lib=msvcrt  -Wl,--gc-sections C:/Users/demen/Documents/GitHub/llvm-project/build/tools/lto/LTO.def -shared -o bin\LTO.dll  -Xlinker /MANIFEST:EMBED -Xlinker /implib:lib\LTO.lib -Xlinker /pdb:bin\LTO.pdb -Xlinker /version:0.0 @CMakeFiles\LTO.rsp  && cd ."
lld-link: warning: ignoring unknown argument '--gc-sections'
lld-link: error: C:/Users/demen/Documents/GitHub/llvm-project/build/tools/lto/LTO.def: unknown file type
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
[9/2321] Building CXX object tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/TargetInfo.cpp.obj
In file included from C:/Users/demen/Documents/GitHub/llvm-project/clang/lib/Basic/TargetInfo.cpp:13:
In file included from C:/Users/demen/Documents/GitHub/llvm-project/clang/include\clang/Basic/TargetInfo.h:18:
In file included from C:/Users/demen/Documents/GitHub/llvm-project/clang/include\clang/Basic/CodeGenOptions.h:17:
In file included from C:/Users/demen/Documents/GitHub/llvm-project/clang/include\clang/Basic/Sanitizers.h:19:
In file included from C:/Users/demen/Documents/GitHub/llvm-project/llvm/include\llvm/Support/HashBuilder.h:18:
In file included from C:/Users/demen/Documents/GitHub/llvm-project/llvm/include\llvm/ADT/ArrayRef.h:12:
In file included from C:/Users/demen/Documents/GitHub/llvm-project/llvm/include\llvm/ADT/Hashing.h:47:
In file included from C:/Users/demen/Documents/GitHub/llvm-project/llvm/include\llvm/Support/DataTypes.h:19:
C:/Users/demen/Documents/GitHub/llvm-project/llvm/include\llvm-c/DataTypes.h:62:16: warning: extension used [-Wlanguage-extension-token]
typedef signed __int64 ssize_t;

Output of clang --version

clang version 13.0.0
Target: x86_64-pc-windows-msvc
Thread model: posix
InstalledDir: C:\Program Files\LLVM\bin
Gaochenchang commented 5 months ago

I encountered the same problem on Windows, how do I configure the compilation options?