我正在Ubuntu虚拟机上构建旧版本的LLVM,3.5.1。我从此处下载了源代码( https://relealeases.llvm.org/download。 html#3.5.1 )
下载源代码后,我在此处遵循说明()我制作了一个构建目录,其中我运行了“ $ cmake -g ninja -g ninja -dcmake_build_type = debug ../llvm ../llvm”,以使用忍者来构建它。这是按预期的。
但是,当我尝试运行“ $ cmake -build”时。要实际构建它,它会失败,错误“ CC:错误:未识别的命令行选项” -FCOLOR-DINASTOSTICS'“
对任何帮助都表示赞赏!
我的GCC版本是:( ubuntu 11.2.0-19ubuntu1)11.2.0
这是扩展错误消息
[1/1441] Building C object lib/Support/CMakeFiles/LLVMSupport.dir/ConvertUTF.c.o
FAILED: lib/Support/CMakeFiles/LLVMSupport.dir/ConvertUTF.c.o
/usr/bin/cc -DGTEST_HAS_RTTI=0 -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/isaac/llvm/build/lib/Support -I/home/isaac/llvm/llvm/lib/Support -I/home/isaac/llvm/build/include -I/home/isaac/llvm/llvm/include -fPIC -Wall -W -Wno-unused-parameter -Wwrite-strings -Wmissing-field-initializers -pedantic -Wno-long-long -Wno-comment -fcolor-diagnostics -g -MD -MT lib/Support/CMakeFiles/LLVMSupport.dir/ConvertUTF.c.o -MF lib/Support/CMakeFiles/LLVMSupport.dir/ConvertUTF.c.o.d -o lib/Support/CMakeFiles/LLVMSupport.dir/ConvertUTF.c.o -c /home/isaac/llvm/llvm/lib/Support/ConvertUTF.c
cc: error: unrecognized command-line option 'fcolor-diagnostics'
I'm building an older version of llvm, 3.5.1, on an ubuntu virtual machine. I downloaded the source code from here (https://releases.llvm.org/download.html#3.5.1)
After downloading the source code I followed the instructions here (https://llvm.org/docs/GettingStarted.html) I made a build directory in which I ran "$cmake -G Ninja -DCMAKE_BUILD_TYPE=debug ../llvm" to build it with Ninja. This works as intended.
However when I try to run "$cmake --build ." to actually build it, it fails with the error "cc: error: unrecognized command-line option '-fcolor-diagnostics' "
Any help is appreciated!
My gcc version is: (Ubuntu 11.2.0-19ubuntu1) 11.2.0
Here is the extended error message
[1/1441] Building C object lib/Support/CMakeFiles/LLVMSupport.dir/ConvertUTF.c.o
FAILED: lib/Support/CMakeFiles/LLVMSupport.dir/ConvertUTF.c.o
/usr/bin/cc -DGTEST_HAS_RTTI=0 -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/isaac/llvm/build/lib/Support -I/home/isaac/llvm/llvm/lib/Support -I/home/isaac/llvm/build/include -I/home/isaac/llvm/llvm/include -fPIC -Wall -W -Wno-unused-parameter -Wwrite-strings -Wmissing-field-initializers -pedantic -Wno-long-long -Wno-comment -fcolor-diagnostics -g -MD -MT lib/Support/CMakeFiles/LLVMSupport.dir/ConvertUTF.c.o -MF lib/Support/CMakeFiles/LLVMSupport.dir/ConvertUTF.c.o.d -o lib/Support/CMakeFiles/LLVMSupport.dir/ConvertUTF.c.o -c /home/isaac/llvm/llvm/lib/Support/ConvertUTF.c
cc: error: unrecognized command-line option 'fcolor-diagnostics'
发布评论
评论(1)
在此版本的LLVM中,-fcolor -diengnostics将以Clang作为编译器和忍者作为生成器添加。就是说,由于您使用的是忍者,因此系统的编译器不得支持标志。一项快速测试以防止标志的应用程序跳过忍者并使用默认的makefile生成。尝试
帮助调试,在未反复的URL上使用的入门指令更适合相对较高的LLVM版本。在这种情况下,3.x版本的特定说明会更好。您可以在。不幸的是,在3.x的时间范围内,这些消息来源被分配在存储库中,并捆绑在单独的油粉中。
构建过程与3.x时间范围的主要区别是LLVM源代码的统一(其中LLVM与运行时,Clang,LLDB等组合)。由于统一的来源仍将构建较旧的版本,因此可以跳过多个TARBALL内容的符号链接,同时更易于使用。可以通过克隆 https://github.com/llvm/llvm--------项目并检查标签
llvmorg-3.5.1
。您能否尝试通过使用llvm.org的clang clang进行ubuntu 12.04,预编译LLVM 3.4.2进行启动编译器。该工具是为了使您的工具对齐2与您定位的版本为3.5.1?我还建议使用CMAKE_BUILD_TYPE构建=释放,直到确认良好的构建为止。使用
将足以作为Bootstrap编译器在Clang中交换,该编译器将支持-fcolor -degnostics。
At this version of LLVM, -fcolor-diagnostics gets added with clang as the compiler and Ninja as the generator. That said, since you're using Ninja, your system's compiler must not support the flag. A quick test to prevent the flag's application would be to skip Ninja and use the default Makefile generation. Try using
To help with debugging, the Getting Started instructions at an un-versioned URL are more appropriate for relatively current versions of LLVM. In this situation, version specific instructions for 3.x would be better. You can find version specific instructions at https://releases.llvm.org/3.5.2/docs/GettingStarted.html. Unfortunately, at the 3.x timeframe, the sources were split among repos and bundled in separate tarballs.
The primary difference in the build process from the 3.x timeframe is the unification of the LLVM source code (where LLVM is combined with the runtime, clang, lldb, etc). Since the unified sources will still build older versions, the symlinks of multiple tarball contents can be skipped while being easier to work with. The unified sources for 3.5.1 can be obtained by cloning https://github.com/llvm/llvm-project and checking out tag
llvmorg-3.5.1
.Could you try to bootstrap the compiler by using the compiled clang from llvm.org for Ubuntu 12.04, precompiled LLVM 3.4.2. This tooling is for the purpose of aligning your tools 2with the version you're targeting, 3.5.1? I'd also recommend building with CMAKE_BUILD_TYPE=Release until a good build is confirmed. Using
will be sufficient to swap in clang as the bootstrap compiler which will support the -fcolor-diagnostics.