无法为 ARM 交叉编译 postgresql 12.2

Unable to cross compile postgresql 12.2 for ARM

希望得到一些帮助,从 ARM 的源代码交叉编译 postgresql。我正在尝试在 X86_64 Ubuntu 18.04.4 上构建库。 我正在使用传递 autoconf 以下参数:

CC=arm-linux-gnueabihf-gcc CXX=arm-linux-gnueabihf-g++ AR=arm-linux-gnueabihf-ar RANLIB=arm-linux-gnueabihf-ranlib ../configure --host=arm-linux-gnueabihf --without-readline --without-zlib

当我 运行 使用 postgresql 版本 9.6.2 配置上述参数时,它成功了,我能够正确地构建库。 但是,我想使用最新版本,目前是 V 12.2.

当我 运行 使用 V 12.2 执行上述命令时,我收到以下错误消息:

// a bunch of successfull output from autoconf before error message...
checking for /dev/urandom... configure: error: cannot check for file existence when cross compiling

有什么解决办法吗?这是他们的 autoconf 中的错误,还是我这边做错了什么?

根据 configure.in,您应该能够覆盖检查:

./configure USE_DEV_URANDOM=1 ...

然后将构建 PostgreSQL 以使用 /dev/urandom,而不检查构建主机上是否存在该文件。