首页
论坛
课程
招聘
Windows 平台下编译llvm pass报错

编译环境:

1
2
3
4
5
6
7
8
9
10
11
> clang -v
clang version 12.0.1
Target: i686-pc-windows-msvc
Thread model: posix
InstalledDir: C:\Program Files (x86)\LLVM\bin
 
> cmake -version
cmake version 3.20.21032501-MSVC_2
 
> Ninja --version
1.10.2

项目:
https://github.com/bluesadi/Pluto-Obfuscator.git
报错日志:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
PS C:\Users\xxx\Desktop\Pluto-Obfuscator\Build> cmake -G "Ninja" ..\Transforms
-- The C compiler identification is Clang 12.0.1 with GNU-like command-line
-- The CXX compiler identification is Clang 12.0.1 with GNU-like command-line
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - failed
-- Check for working C compiler: C:/Program Files (x86)/LLVM/bin/clang.exe
-- Check for working C compiler: C:/Program Files (x86)/LLVM/bin/clang.exe - broken
CMake Error at C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.20/Modules/CMakeTestCCompiler.cmake:66 (message):
  The C compiler
 
    "C:/Program Files (x86)/LLVM/bin/clang.exe"
 
  is not able to compile a simple test program.
 
  It fails with the following output:
 
    Change Dir: C:/Users/xxx/Desktop/Pluto-Obfuscator/Build/CMakeFiles/CMakeTmp
 
    Run Build Command(s):C:/PROGRA~2/MICROS~2/2019/COMMUN~1/Common7/IDE/COMMON~1/MICROS~1/CMake/Ninja/ninja.exe cmTC_5c887 && [1/2] Building C object CMakeFiles/cmTC_5c887.dir/testCCompiler.c.obj
    [2/2] Linking C executable cmTC_5c887.exe
    FAILED: cmTC_5c887.exe
    cmd.exe /C "cd . && C:\PROGRA~2\LLVM\bin\clang.exe -fuse-ld=lld-link -nostartfiles -nostdlib -g -Xclang -gcodeview -O0 -D_DEBUG -D_DLL -D_MT -Xclang --dependent-lib=msvcrtd -Xlinker /subsystem:console CMakeFiles/cmTC_5c887.dir/testCCompiler.c.obj -o cmTC_5c887.exe -Xlinker /implib:cmTC_5c887.lib -Xlinker /pdb:cmTC_5c887.pdb -Xlinker /version:0.0   -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32 -loldnames && cd ."
    clang: error: unable to execute command: program not executable
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    ninja: build stopped: subcommand failed.
 
 
 
 
 
  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:1 (project)
 
 
-- Configuring incomplete, errors occurred!
See also "C:/Users/xxx/Desktop/Pluto-Obfuscator/Build/CMakeFiles/CMakeOutput.log".
See also "C:/Users/xxx/Desktop/Pluto-Obfuscator/Build/CMakeFiles/CMakeError.log".

在官方社区找到了个老的帖子,但他们也没有给具体方案:
https://gitlab.kitware.com/cmake/cmake/-/issues/18476

收藏
2条回答
34r7hm4n 2023-1-3
购买课程后即可查看全部回答,立即购买