gpt4 book ai didi

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

转载 作者:可可西里 更新时间:2023-11-01 11:51:37 25 4
gpt4 key购买 nike

在 Windows 系统上遇到一些关于 cmake 和 gcc-4.9.1 的问题,并花了 2 个多小时用 clang 构建 llvm 之后,我遇到了一个非常好的错误,我似乎找不到相关信息。我已根据文档完成所有操作,这里是 make 给我的讲故事的错误消息:

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 --版本

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++ --版本

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.

制作-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

最佳答案

在深入研究这个问题后,我成功地构建了它。对于在 Windows 上使用 gcc 编译 llvm&clang 时可能遇到此错误的任何人:http://reviews.llvm.org/D5476#5e5fbd1d当然,您可以通过使用来自他们 SVN 的源代码而不是从 http://llvm.org/releases/download.html#3.5 下载最新的稳定版本来避免这个问题。

关于windows - 使用 GCC-4.9.1_x64 编译 Clang 时命令语法不正确,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27947099/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com