使用GCC-4.9.1_x64编译Clang时,该命令的语法不正确

时间:2015-01-14 15:54:40

标签: windows gcc cmake clang

在Windows系统上遇到有关cmake和gcc-4.9.1的一些问题后,花了2个多小时用clang构建llvm我得到了一个非常好的错误,我似乎无法找到相关信息。我根据文档做了所有事情,这里的故事出纳员错误信息让我:

Scanning dependencies of target LTO_exports
[ 69%] Creating export file for LTO
The syntax of the command is incorrect.
make[2]: *** [tools/lto/LTO.def] Error 1
make[1]: *** [tools/lto/CMakeFiles/LTO_exports.dir/all] Error 2
make: *** [all] Error 2

这就是全部,没有其他细节可用。我已经检查了LTO.def文件,因为它引用了该文件。该文件包含一个条目:" EXPORTS [CR] [LF]"。 LTO_exports.dir / all包含以下文件:

build.make
cmake_clean.cmake
depend.internal
depend.make
DependInfo.cmake
progress.make

我根本没有碰过这些文件。在实际使用make之前,我使用了以下cmake命令。

C:\LLVM_Binaries>cmake -G"MinGW Makefiles" -DCMAKE_C_COMPILER="C:/MinGW/bin/gcc.exe" -DCMAKE_CXX_COMPILER="C:/MinGW/bin/g++.exe" -DCMAKE_MAKE_PROGRAM="C:/MinGW/bin/make.exe" -DCMAKE_BUILD_TYPE=Release ..\LLVM

此处还有gcc g ++和make的详细信息: gcc --version

gcc (GCC) 4.9.1
Copyright (C) 2014 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

g ++ --version

g++ (GCC) 4.9.1
Copyright (C) 2014 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

make -v

GNU Make 3.82
Built for x86_64-w64-mingw32
This program is built by Equation Solution <http://www.Equation.com>
for Windows.
Copyright (C) 2010  Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

其他人遇到过这个问题并设法在64位Windows操作系统上使用clang构建llvm?

@Edit(make VERBOSE = 1的输出)

Scanning dependencies of target LTO_exports
make[2]: Leaving directory `C:/LLVM_Binaries'
make -f tools\lto\CMakeFiles\LTO_exports.dir\build.make tools/lto/CMakeFiles/LTO_exports.dir/build
make[2]: Entering directory `C:/LLVM_Binaries'
"C:\Program Files (x86)\CMake\bin\cmake.exe" -E cmake_progress_report C:\LLVM_Binaries\CMakeFiles
[ 69%] Creating export file for LTO
cd /d C:\LLVM_Binaries\tools\lto && "C:\Program Files (x86)\CMake\bin\cmake.exe" -E echo EXPORTS > LTO.def
cd /d C:\LLVM_Binaries\tools\lto && type C:/LLVM/tools/lto/lto.exports >> LTO.def
The syntax of the command is incorrect.
make[2]: *** [tools/lto/LTO.def] Error 1
make[2]: Leaving directory `C:/LLVM_Binaries'
make[1]: *** [tools/lto/CMakeFiles/LTO_exports.dir/all] Error 2
make[1]: Leaving directory `C:/LLVM_Binaries'
make: *** [all] Error 2

2 个答案:

答案 0 :(得分:3)

在深入挖掘这个问题之后,我已经成功构建了它。对于在使用gcc编译llvm&amp; clang时可能会出现此错误的任何人:http://reviews.llvm.org/D5476#5e5fbd1d 当然,您可以通过使用SVN中的来源而不是从http://llvm.org/releases/download.html#3.5下载最新的稳定版本来避免此问题

答案 1 :(得分:-1)

在运行cmake之前是否运行了配置文件?

sh ./configure

如果这不起作用,请尝试使用32位版本的编译器。如果可行,则可以通过编译GCC 32位交叉编译器来构建64位。

你也可以试试Cygwin - 也许这可能会有所帮助。或者如果你真的陷入困境,你可以回溯并从终端运行有问题的命令,而不是makefile。