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-23 00:03:36
Message-ID: 20240323000336.eepe6hmiglapzmp6@awork3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On 2024-03-21 13:17:44 -0400, Dave Cramer wrote:
> Attached correct log file

Hm. So there's something a bit odd:

> Build started at 2024-03-21T13:07:08.707715
> Main binary: C:\Program Files\Meson\meson.exe
> Build Options: '-Dextra_include_dirs=c:\Program Files\OpenSSL-Win64\include' -Derrorlogs=True '-Dextra_lib_dirs=c:\Program Files\OpenSSL-win64' '-Dprefix=c:\postgres86'
> Python system: Windows
> The Meson build system
> Version: 1.3.1
> Source dir: C:\Users\davec\projects\postgresql
> Build dir: C:\Users\davec\projects\postgresql\build
> Build type: native build

So meson thinks this is a native build, not a cross build. But then later
realizes that generated binaries and the current platform aren't the same. And
thus errors out.

The line numbers don't match my tree, but I think what's failing is the
sizeof() check. Which has support for cross builds, but it only uses that
(slower) path if it knows that a cross build is being used.

I suggest actually telling meson to cross compile. I don't quite know what
properties you're going to need, but something like the following (put it in a
file, point meson to it wity --cross-file) might give you a start:

[properties]
needs_exe_wrapper = false

[binaries]
c = 'cl'
cpp = 'cl'
ar = 'lib'
windres = 'rc'

[host_machine]
system = 'windows'
cpu_family = 'x86_64'
cpu = 'x86_64'
endian = 'little'

Greetings,

Andres Freund

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Jeff Davis 2024-03-23 00:17:12 Re: New Table Access Methods for Multi and Single Inserts
Previous Message Tom Lane 2024-03-22 23:34:15 Re: session username in default psql prompt?