Re: Issues cross-compiling libpq 14.x to MacOS armv8

From: Daniel Gustafsson <daniel(at)yesql(dot)se>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Vincas Dargis <vindrg(at)gmail(dot)com>, pgsql-general <pgsql-general(at)lists(dot)postgresql(dot)org>, Magnus Hagander <magnus(at)hagander(dot)net>, Michael Paquier <michael(at)paquier(dot)xyz>
Subject: Re: Issues cross-compiling libpq 14.x to MacOS armv8
Date: 2021-11-30 20:53:16
Message-ID: 47B78E57-3D0F-4616-BF52-C07FA76AF0A7@yesql.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> On 30 Nov 2021, at 20:59, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>
> Vincas Dargis <vindrg(at)gmail(dot)com> writes:
>> checking which random number source to use... /dev/urandom
>> checking for /dev/urandom...
>> configure: error: cannot check for file existence when cross compiling
>
> Hmm ... this evidently stems from 16f96c74d.
>
> AFAICS this is the only test in our configure script that is a hard
> fail when cross-compiling, and I don't see a reason for it to be that.
> We could just assume that /dev/urandom will be available --- that's no
> worse than a lot of the other optimistic assumptions that configure
> makes in that mode.

Agreed, I don't see a problem with that. I'm not terribly familiar with
supporting cross compilation in autoconf, would a reasonable approach be to
just remove the check altogether like the below sketch?

diff --git a/configure.ac b/configure.ac
index a5c10b8d56..80fe0de38d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2289,13 +2289,6 @@ elif test x"$PORTNAME" = x"win32" ; then
AC_MSG_RESULT([Windows native])
else
AC_MSG_RESULT([/dev/urandom])
- AC_CHECK_FILE([/dev/urandom], [], [])
-
- if test x"$ac_cv_file__dev_urandom" = x"no" ; then
- AC_MSG_ERROR([
-no source of strong random numbers was found
-PostgreSQL can use OpenSSL, native Windows API or /dev/urandom as a source of random numbers.])
- fi
fi

--
Daniel Gustafsson https://vmware.com/

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2021-11-30 21:04:02 Re: Issues cross-compiling libpq 14.x to MacOS armv8
Previous Message David Gauthier 2021-11-30 20:40:10 Wildcarding json keys in json query