Re: Trying to build x86 version on windows using meson

From: Andres Freund <andres(at)anarazel(dot)de>
To: Dave Cramer <davecramer(at)gmail(dot)com>
Cc: Peter Eisentraut <peter(at)eisentraut(dot)org>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Trying to build x86 version on windows using meson
Date: 2024-03-21 16:51:37
Message-ID: 20240321165137.3rdhvm35w4hjp3x3@awork3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On 2024-03-21 07:11:23 -0400, Dave Cramer wrote:
> It seems that attempting to cross-compile on an ARM machine might be asking
> too much as the use cases are pretty limited.

It for sure is if you don't even provide the precise commands and logs of a
failed run...

> So the impetus for this is that folks require 32bit versions of psqlODBC.
> Unfortunately EDB is no longer distributing a 32 bit windows version.
>
> All I really need is a 32bit libpq. This seems like a much smaller lift.
> Suggestions ?

FWIW, I can cross compile postgres from linux to 32bit windows without an
issue. If you really just need a 32bit libpq, that might actually be easier.

cd /tmp/ && rm -rf /tmp/meson-w32 && m setup --buildtype debug -Dcassert=true -Db_pch=true --cross-file ~/src/meson/cross/linux-mingw-w64-32bit.txt /tmp/meson-w32 ~/src/postgresql && cd /tmp/meson-w32 && ninja

file src/interfaces/libpq/libpq.dll
src/interfaces/libpq/libpq.dll: PE32 executable (DLL) (console) Intel 80386, for MS Windows, 19 sections

You'd need a windows openssl to actually have a useful libpq, but that should
be fairly simple.

There are two warnings that I think point to us doing something wrong, but they're not affecting libpq:

[1585/1945 42 81%] Linking target src/bin/pgevent/pgevent.dll
/usr/bin/i686-w64-mingw32-ld: warning: resolving _DllRegisterServer by linking to _DllRegisterServer(at)0
Use --enable-stdcall-fixup to disable these warnings
Use --disable-stdcall-fixup to disable these fixups
/usr/bin/i686-w64-mingw32-ld: warning: resolving _DllUnregisterServer by linking to _DllUnregisterServer(at)0

Greetings,

Andres Freund

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Maxim Orlov 2024-03-21 16:58:28 Refactoring of pg_resetwal/t/001_basic.pl
Previous Message Alvaro Herrera 2024-03-21 16:42:58 Re: documentation structure