0

我在 Raspberry Pi 上做了很多编译工作。我正在考虑使用 distcc 来加快速度。

我关注了这篇文章:https ://www.kvaser.com/developer-blog/building-raspberry-pi-using-distcc/

这允许我将 Arch Linux VM 配置为交叉编译器主机,并将我的 Raspberry Pi 配置为客户端。

就网络而言,该设置似乎有效。我可以tcpdump在 Arch 上使用来确认make在 Pi 上运行时,服务器的distcc端口 ( 3632) 会收到大量请求。

该设置似乎也适用于使用交叉编译器。我的Arch Linux 没有安装本机、、、、c++或二进制文件。在没有设置指向交叉编译器的情况下,Pi 抱怨它无法按预期找到二进制文件。cccppg++gccPATHgcc

我看到的问题是,当我尝试编译时Python 3.7.11,我几乎在运行 make 后立即得到了这个:

gcc -pthread -c -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall    -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Wno-cast-function-type -Werror=implicit-function-declaration   -I. -I./Include    -DPy_BUILD_CORE -o Parser/tokenizer.o Parser/tokenizer.c
distcc[31743] ERROR: compile Parser/tokenizer.c on 192.168.1.23 failed
In file included from ./Include/Python.h:34:0,
                 from Parser/tokenizer.c:4:
/usr/include/stdlib.h:140:8: error: unknown type name '_Float32'
/usr/include/stdlib.h:146:8: error: unknown type name '_Float64'
In file included from ./Include/Python.h:34:0,
                 from Parser/tokenizer.c:4:
/usr/include/stdlib.h:158:8: error: unknown type name '_Float32x'
In file included from ./Include/Python.h:34:0,
                 from Parser/tokenizer.c:4:
/usr/include/stdlib.h:233:10: error: unknown type name '_Float32'
/usr/include/stdlib.h:239:10: error: unknown type name '_Float64'
In file included from ./Include/Python.h:34:0,
                 from Parser/tokenizer.c:4:
/usr/include/stdlib.h:251:4: error: unknown type name '_Float32x'
In file included from ./Include/Python.h:34:0,
                 from Parser/tokenizer.c:4:
/usr/include/stdlib.h:316:8: error: unknown type name '_Float32'
/usr/include/stdlib.h:323:8: error: unknown type name '_Float64'
In file included from ./Include/Python.h:34:0,
                 from Parser/tokenizer.c:4:
/usr/include/stdlib.h:337:8: error: unknown type name '_Float32x'
In file included from /usr/include/math.h:389:0,
                 from ./Include/pyport.h:191,
                 from ./Include/Python.h:63,
                 from Parser/tokenizer.c:4:
/usr/include/arm-linux-gnueabihf/bits/mathcalls.h:53:8: error: unknown type name '_Float32'
/usr/include/arm-linux-gnueabihf/bits/mathcalls.h:53:26: error: unknown type name '_Float32'
/usr/include/arm-linux-gnueabihf/bits/mathcalls.h:53:89: error: unknown type name '_Float32'
...

Truncated to adhere to stackoverflow's 30,000 character post limit

...
/usr/include/arm-linux-gnueabihf/bits/mathcalls.h:388:31: error: unknown type name '_Float32x'
/usr/include/arm-linux-gnueabihf/bits/mathcalls.h:388:47: error: unknown type name '_Float32x'
In file included from /usr/include/math.h:616:0,
                 from ./Include/pyport.h:191,
                 from ./Include/Python.h:63,
                 from Parser/tokenizer.c:4:
/usr/include/arm-linux-gnueabihf/bits/mathcalls-narrow.h:24:8: error: unknown type name '_Float32'
/usr/include/arm-linux-gnueabihf/bits/mathcalls-narrow.h:24:29: error: unknown type name '_Float32x'
/usr/include/arm-linux-gnueabihf/bits/mathcalls-narrow.h:24:44: error: unknown type name '_Float32x'
/usr/include/arm-linux-gnueabihf/bits/mathcalls-narrow.h:27:8: error: unknown type name '_Float32'
/usr/include/arm-linux-gnueabihf/bits/mathcalls-narrow.h:27:29: error: unknown type name '_Float32x'
/usr/include/arm-linux-gnueabihf/bits/mathcalls-narrow.h:27:44: error: unknown type name '_Float32x'
/usr/include/arm-linux-gnueabihf/bits/mathcalls-narrow.h:30:8: error: unknown type name '_Float32'
/usr/include/arm-linux-gnueabihf/bits/mathcalls-narrow.h:30:29: error: unknown type name '_Float32x'
/usr/include/arm-linux-gnueabihf/bits/mathcalls-narrow.h:30:44: error: unknown type name '_Float32x'
/usr/include/arm-linux-gnueabihf/bits/mathcalls-narrow.h:33:8: error: unknown type name '_Float32'
/usr/include/arm-linux-gnueabihf/bits/mathcalls-narrow.h:33:29: error: unknown type name '_Float32x'
/usr/include/arm-linux-gnueabihf/bits/mathcalls-narrow.h:33:44: error: unknown type name '_Float32x'
In file included from /usr/include/math.h:626:0,
                 from ./Include/pyport.h:191,
                 from ./Include/Python.h:63,
                 from Parser/tokenizer.c:4:
/usr/include/arm-linux-gnueabihf/bits/mathcalls-narrow.h:24:8: error: unknown type name '_Float32'
/usr/include/arm-linux-gnueabihf/bits/mathcalls-narrow.h:24:28: error: unknown type name '_Float64'
/usr/include/arm-linux-gnueabihf/bits/mathcalls-narrow.h:24:42: error: unknown type name '_Float64'
/usr/include/arm-linux-gnueabihf/bits/mathcalls-narrow.h:27:8: error: unknown type name '_Float32'
/usr/include/arm-linux-gnueabihf/bits/mathcalls-narrow.h:27:28: error: unknown type name '_Float64'
/usr/include/arm-linux-gnueabihf/bits/mathcalls-narrow.h:27:42: error: unknown type name '_Float64'
/usr/include/arm-linux-gnueabihf/bits/mathcalls-narrow.h:30:8: error: unknown type name '_Float32'
/usr/include/arm-linux-gnueabihf/bits/mathcalls-narrow.h:30:28: error: unknown type name '_Float64'
/usr/include/arm-linux-gnueabihf/bits/mathcalls-narrow.h:30:42: error: unknown type name '_Float64'
/usr/include/arm-linux-gnueabihf/bits/mathcalls-narrow.h:33:8: error: unknown type name '_Float32'
/usr/include/arm-linux-gnueabihf/bits/mathcalls-narrow.h:33:28: error: unknown type name '_Float64'
/usr/include/arm-linux-gnueabihf/bits/mathcalls-narrow.h:33:42: error: unknown type name '_Float64'
In file included from /usr/include/math.h:666:0,
                 from ./Include/pyport.h:191,
                 from ./Include/Python.h:63,
                 from Parser/tokenizer.c:4:
/usr/include/arm-linux-gnueabihf/bits/mathcalls-narrow.h:24:8: error: unknown type name '_Float32x'
/usr/include/arm-linux-gnueabihf/bits/mathcalls-narrow.h:24:30: error: unknown type name '_Float64'
/usr/include/arm-linux-gnueabihf/bits/mathcalls-narrow.h:24:44: error: unknown type name '_Float64'
/usr/include/arm-linux-gnueabihf/bits/mathcalls-narrow.h:27:8: error: unknown type name '_Float32x'
/usr/include/arm-linux-gnueabihf/bits/mathcalls-narrow.h:27:30: error: unknown type name '_Float64'
/usr/include/arm-linux-gnueabihf/bits/mathcalls-narrow.h:27:44: error: unknown type name '_Float64'
/usr/include/arm-linux-gnueabihf/bits/mathcalls-narrow.h:30:8: error: unknown type name '_Float32x'
/usr/include/arm-linux-gnueabihf/bits/mathcalls-narrow.h:30:30: error: unknown type name '_Float64'
/usr/include/arm-linux-gnueabihf/bits/mathcalls-narrow.h:30:44: error: unknown type name '_Float64'
/usr/include/arm-linux-gnueabihf/bits/mathcalls-narrow.h:33:8: error: unknown type name '_Float32x'
/usr/include/arm-linux-gnueabihf/bits/mathcalls-narrow.h:33:30: error: unknown type name '_Float64'
/usr/include/arm-linux-gnueabihf/bits/mathcalls-narrow.h:33:44: error: unknown type name '_Float64'
In file included from ./Include/unicodeobject.h:107:0,
                 from ./Include/Python.h:99,
                 from Parser/tokenizer.c:4:
/usr/include/wchar.h:396:8: error: unknown type name '_Float32'
/usr/include/wchar.h:401:8: error: unknown type name '_Float64'
In file included from ./Include/unicodeobject.h:107:0,
                 from ./Include/Python.h:99,
                 from Parser/tokenizer.c:4:
/usr/include/wchar.h:411:8: error: unknown type name '_Float32x'
In file included from ./Include/unicodeobject.h:107:0,
                 from ./Include/Python.h:99,
                 from Parser/tokenizer.c:4:
/usr/include/wchar.h:511:8: error: unknown type name '_Float32'
/usr/include/wchar.h:517:8: error: unknown type name '_Float64'
In file included from ./Include/unicodeobject.h:107:0,
                 from ./Include/Python.h:99,
                 from Parser/tokenizer.c:4:
/usr/include/wchar.h:529:8: error: unknown type name '_Float32x'
cc1: warning: unrecognized command line option "-Wno-cast-function-type"
make: *** [Makefile:1652: Parser/tokenizer.o] Error 1

没有distcc,Python 在 Pi 上编译得很好——它只需要很长时间。

主机(Arch Linux)是否缺少一些编译 Python 所需的库?我的印象是它不需要任何东西。

问题是否可能是我的 Raspberry Pi 使用内核5.4.51-v7+,而工具链https://github.com/raspberrypi/tools.git似乎只支持arm-rpi-4.9.3-linux-gnueabihf

我很迷失在这里。任何帮助,将不胜感激。

更新:似乎 distcc 正在工作,但编译失败。也许这解释了它:

在 Debian Buster 中,gcc 编译器和 glibc 已更新到 8.3 版。git://github.com/raspberrypi/tools.git 中的工具链仍然基于旧的 gcc 6 版本。这意味着使用 git://github.com/raspberrypi/tools.git 会导致很多编译错误。

-- https://stackoverflow.com/a/58559140/6423456

这将需要进一步研究。

4

0 回答 0