Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mVrLW-00029T-3k for pgsql-hackers@arkaria.postgresql.org; Thu, 30 Sep 2021 08:23:14 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mVrLT-000723-Mx for pgsql-hackers@arkaria.postgresql.org; Thu, 30 Sep 2021 08:23:11 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mVrLT-00071v-FG for pgsql-hackers@lists.postgresql.org; Thu, 30 Sep 2021 08:23:11 +0000 Received: from sfr-1.cri.mines-paristech.fr ([77.158.180.225] helo=smtp.cri.ensmp.fr) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mVrLM-0002gW-Ki for pgsql-hackers@lists.postgresql.org; Thu, 30 Sep 2021 08:23:10 +0000 Received: from pseudo (nat-4.mines-paristech.fr [77.158.173.11]) by smtp.cri.ensmp.fr (Postfix) with ESMTPSA id 3E2FBC0024; Thu, 30 Sep 2021 10:25:28 +0200 (CEST) Date: Thu, 30 Sep 2021 10:23:00 +0200 (CEST) From: Fabien COELHO X-X-Sender: fabien@pseudo Reply-To: Fabien COELHO To: Tom Lane cc: Aleksander Alekseev , PostgreSQL Developers Subject: Re: rand48 replacement In-Reply-To: Message-ID: References: <3136e2672d5ab395521bae05a80df469@postgrespro.ru> <3b12e2dea4c3c33665c33b40c95349ef@postgrespro.ru> <8904daa4a916b4990b11d7140e0ff81f@postgrespro.ru> <2520097.1632590602@sss.pgh.pa.us> User-Agent: Alpine 2.22 (DEB 394 2020-01-19) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > Attached v15 also does call srandom if it is there, and fixes yet another > remaining random call. I think that I have now removed all references to "random" from pg source. However, the test still fails on windows, because the linker does not find a global variable when compiling extensions, but it seems to find the functions defined in the very same file... Link: 4130 C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\x86_amd64\link.exe /ERRORREPORT:QUEUE /OUT:".\Release\tablefunc\tablefunc.dll" /INCREMENTAL:NO /NOLOGO Release/postgres/postgres.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /NODEFAULTLIB:libc /DEF:"./Release/tablefunc/tablefunc.def" /MANIFEST /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /manifest:embed /DEBUG /PDB:".\Release\tablefunc\tablefunc.pdb" /SUBSYSTEM:CONSOLE /STACK:"4194304" /TLBID:1 /DYNAMICBASE:NO /NXCOMPAT /IMPLIB:"Release/tablefunc/tablefunc.lib" /MACHINE:X64 /ignore:4197 /DLL .\Release\tablefunc\win32ver.res 4131 .\Release\tablefunc\tablefunc.obj 4132 Creating library Release/tablefunc/tablefunc.lib and object Release/tablefunc/tablefunc.exp 4133 tablefunc.obj : error LNK2001: unresolved external symbol pg_global_prng_state [C:\projects\postgresql\tablefunc.vcxproj] 4134 .\Release\tablefunc\tablefunc.dll : fatal error LNK1120: 1 unresolved externals [C:\projects\postgresql\tablefunc.vcxproj] 4135 Done Building Project "C:\projects\postgresql\tablefunc.vcxproj" (default targets) -- FAILED. The missing symbol is really defined in common/pg_prng.c which AFAICT is linked with postgres. If someone experienced with the windows compilation chain could give a hint of what is needed, I'd appreciate it! -- Fabien.