我正在我的笔记本电脑上编写c代码,我想使用llvm-clang工具链将其交叉编译为ARM v7架构 .
我使用以下命令并获得以下错误(见下文) . 知道什么是错的吗?
谢谢
-开始 - - - - - - - - - ----------------------------
cmake -G Ninja / home / user / Desktop / llvm / llvm -DCMAKE_CROSSCOMPILING = True -DCMAKE_INSTALL_PREFIX = / home / user / Desktop / llvm / llvm / new_build -DLLVM_TABLEGEN = / usr / bin / host / llvm-tblgen -DCLANG_TABLEGEN = / usr / bin / host / clang-tblgen -DLLVM_DEFAULT_TARGET_TRIPLE = arm-linux-gnueabihf -DLLVM_TARGET_ARCH = ARM -DLLVM_TARGETS_TO_BUILD = ARM -DCMAKE_CXX_FLAGS =' - target armv7a-linux-gnueabihf -mcpu = cortex-a9 -I / usr / arm-linux -gnueabihf / include / c /4.7.2/arm-linux-gnueabihf/ -I / usr / arm-linux-gnueabihf / include / -mfloat-abi = hard -ccc-gcc-name arm-linux-gnueabihf-gcc'
结束 - - - - - - - - - - ------------------------------
错误:
-开始 - - - - - - - - - ----------------------------
CXX编译器标识是Clang 3.5.0 - 使用以下命令检查工作CXX编译器:Ninja - 检查工作CXX编译器使用:Ninja - 在/usr/share/cmake-2.8/Modules/CMakeTestCXXCompiler中损坏的CMake错误 . cmake:54(消息):C编译器“/ usr / bin / clang”无法编译简单的测试程序 .
它失败并带有以下输出:
更改目录:/ home / user / Desktop / llvm / llvm / new_build / CMakeFiles / CMakeTmp
运行Build命令:/ usr / bin / ninja cmTryCompileExec1541562247
[1/2]构建CXX对象
CMakeFiles / cmTryCompileExec1541562247.dir / testCXXCompiler.cxx.o
[2/2]链接CXX可执行文件cmTryCompileExec1541562247
失败:: && / usr / bin / clang -target armv7a-linux-gnueabihf
-mcpu =皮质-A9
-I / usr / arm-linux-gnueabihf / include / c /4.7.2/arm-linux-gnueabihf/
-I / usr / arm-linux-gnueabihf / include / -mfloat-abi = hard -ccc-gcc-name
臂-Linux的gnueabihf-GCC
CMakeFiles / cmTryCompileExec1541562247.dir / testCXXCompiler.cxx.o -o
cmTryCompileExec1541562247 -rdynamic &&:
/ usr / bin / ld:无法识别的仿真模式:armelf_linux_eabi
支持的仿真:elf_x86_64 elf32_x86_64 elf_i386 i386linux elf_l1om
elf_k1om i386pep i386pe
clang:错误:链接器命令失败,退出代码为1(使用-v查看
调用)
忍者:构建停止:子命令失败 .
CMake无法正确生成此项目 .
呼叫堆栈(最近一次呼叫):
CMakeLists.txt:19(项目)
配置不完整,发生错误!
结束 - - - - - - - - - - ------------------------------