我想使用 distcc 将代码从我的 Mac 编译到一堆 Linux 主机,但我不知道如何让所有东西都“对齐”。我已经成功地使用了从 Mac 到 Mac 的 distcc,所以我对如何设置有一个大致的了解。
我正在使用 Clang 4.0 并在 Mac 和 Linux 上安装并运行它。以下命令在没有distcc
开头的情况下编译良好,但在添加 distcc 后,我得到以下问题:
distcc /Users/xaxxon/Downloads/clang+llvm-4.0.0-x86_64-apple-darwin/bin/clang++ -I/usr/local/include -I/Users/xaxxon/v8toolkit/./include -I/Users/xaxxon/v8/include -stdlib=libc++ -g -Werror=return-type -g -std=gnu++1z -o CMakeFiles/v8toolkit_static.dir/src/v8toolkit.cpp.o -c /Users/xaxxon/v8toolkit/src/v8toolkit.cpp
我不确定 Linux 上使用的是什么编译器,也不知道如何找出答案。它可能会选择 GCC 而不是 Clang。
我首先担心的是:
clang: warning: argument unused during compilation: '-stdlib=libc++'
我的第一个错误是:
In file included from /Users/xaxxon/v8toolkit/src/v8toolkit.cpp:5:
In file included from /usr/include/assert.h:44:
In file included from /Users/xaxxon/Downloads/clang+llvm-4.0.0-x86_64-apple-darwin/bin/../include/c++/v1/stdlib.h:94:
/usr/include/stdlib.h:250:20: error: blocks support disabled - compile with -fblocks or pick a deployment target that supports them
int atexit_b(void (^)(void)) __attribute__((availability(macosx,introduced=10.6)));
我得到的下一个错误(如果我手动添加-fblocks
到编译命令(在本机 Mac 版本上不需要)将成为第一个错误)是:
/Users/xaxxon/Downloads/clang+llvm-4.0.0-x86_64-apple-darwin/bin/../include/c++/v1/__tuple:289:13: error: unknown type name '__type_pack_element'
typedef __type_pack_element<_Ip, _Types...> type;
^
/Users/xaxxon/Downloads/clang+llvm-4.0.0-x86_64-apple-darwin/bin/../include/c++/v1/__tuple:289:32: error: expected member name or ';' after declaration specifiers
typedef __type_pack_element<_Ip, _Types...> type;
~~~~~~~~~~~~~~~~~~~~~~~~~~~^
/Users/xaxxon/Downloads/clang+llvm-4.0.0-x86_64-apple-darwin/bin/../include/c++/v1/__tuple:356:43: error: use of undeclared identifier '__type_pack_element'
typename _ApplyFn::template __apply<__type_pack_element<_Idx, _Types...>>...
^
/Users/xaxxon/Downloads/clang+llvm-4.0.0-x86_64-apple-darwin/bin/../include/c++/v1/__tuple:357:6: error: expected a type
>;
我不明白我是在做一些根本错误的事情,还是我遗漏了一些小东西,这使得 Linux 编译器的行为有所不同。
我只是确保在 Linux 上的 Clang 在同一个命名目录中,现在只得到-fblocks
和unused during compilation -stdlib=libc++
问题。
我可以编译所有内容(尽管有警告),但是当它链接时,我得到:
ld: warning: ignoring file CMakeFiles/v8toolkit_shared.dir/src/debugger.cpp.o, file was built for
unsupported file format ( 0x7F 0x45 0x4C 0x46 0x02 0x01 0x01 0x00 0x00 0x00
0x00 0x00 0x00 0x00 0x00 0x00 ) which is not the architecture being linked
(x86_64): CMakeFiles/v8toolkit_shared.dir/src/debugger.cpp.o