Search code examples
linuxpostgresqlcross-compilingautoconf

Unable to cross compile postgresql 12.2 for ARM


Hoping to get some help cross compiling postgresql from source for ARM. I am trying to build the library on X86_64 Ubuntu 18.04.4. I am using passing autoconf the following arguments:

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

When I run configure with the above arguments with postgresql release 9.6.2, it succeeds and I am able to build the library properly. However, I would like to use the latest release, which is currently V 12.2.

When I run the above command with V 12.2, I get the following error message:

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

Any ideas how to fix this? Is this a bug in their autoconf, or am I doing something wrong on my side?


Solution

  • According to configure.in, you should be able to override the check:

    ./configure USE_DEV_URANDOM=1 ...
    

    Then PostgreSQL will be built to use /dev/urandom without checking for the file's existence on the build host.