Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rUTfz-00B98u-7i for pgsql-hackers@arkaria.postgresql.org; Mon, 29 Jan 2024 15:35:59 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1rUTfy-00F6nH-9X for pgsql-hackers@arkaria.postgresql.org; Mon, 29 Jan 2024 15:35:58 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rUTfx-00F6n9-Mp for pgsql-hackers@lists.postgresql.org; Mon, 29 Jan 2024 15:35:58 +0000 Received: from mail-yb1-xb33.google.com ([2607:f8b0:4864:20::b33]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1rUTfu-004MR5-Q1 for pgsql-hackers@lists.postgresql.org; Mon, 29 Jan 2024 15:35:57 +0000 Received: by mail-yb1-xb33.google.com with SMTP id 3f1490d57ef6-db3a09e96daso2389714276.3 for ; Mon, 29 Jan 2024 07:35:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dunslane-net.20230601.gappssmtp.com; s=20230601; t=1706542552; x=1707147352; darn=lists.postgresql.org; h=in-reply-to:from:references:cc:to:content-language:subject :user-agent:mime-version:date:message-id:from:to:cc:subject:date :message-id:reply-to; bh=7vKt0hmgCLcUaKfOPVYwp5VhDwXrPDV3j9RjlZo82nc=; b=ZqvJm9qcZsP821V+IgdpjogFv5HM20+svBp5u6WaRzom1YMFRurI+C+ZlBeZtSYvAd STTD741AbpYOmz+bN7uroSvIOvY89kno+Eb90ZiO7F9VwsPMUv2LnzoAf1xDt3vkQ5JW Lzt/6aFGTgJziZFmlXPJUekk7Uwm4wYkw9TbFO3QZGF1jdCUFCWuv7ycHEdRKGiRfrq4 rWswJ9f7vlgCz44N7krbmHWFD0RJC6A3Xw7EZbOvbj+xoCYGUBMWyQx5JYEVU/0sGdLu IuUMzzLs3XwkEhhVXuNDHkSAKNSp4KGIUq6v/Bt0msxUehIs2kscVLtvf7caV6nhLHHH z2DQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706542552; x=1707147352; h=in-reply-to:from:references:cc:to:content-language:subject :user-agent:mime-version:date:message-id:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=7vKt0hmgCLcUaKfOPVYwp5VhDwXrPDV3j9RjlZo82nc=; b=jzrrMsGvhLw92RiVuMluIz1b43Rb3yTPJIeHj4fTo5fPN4DSI8dxPF4oRvD2h4Ic5u EbcY78Hzh1i+zYdmKhXGTAak8yiV1ZRsDKdH7XIgG+CaK+4Ofr4dfAJa4ycrF7mYnQXN 9JYlh7Z4F3tda+oVXY7Q97NR10/X2DEL30aU1MoDu6rAYRSjgyA0L5NxNogmB3VwMqv2 B8EOPu5glrEfj7eAKN/d/qPiaFrIaK2BfxWvwZkhuKxlEgNVWA1kvB+mJqi501U07ip0 jZq/KCt4JFT6s0HIDdj+g5I3+tbwGr3mLYM5P9gUBp1hUTNphXwge6ErIMWXoWnwg4Vy IIAg== X-Gm-Message-State: AOJu0YxeVHB3Ci2/KVznY0yMBIPzTAvfpSOAemQgPWn8HsD+EdQGgFAJ winbtaoFg4C5fakVL/ZwpfeiUJrnX0azj04+uEDq7gpIB6nk6vLJOVOrtsBghMA= X-Google-Smtp-Source: AGHT+IG/k+DwuhLMTVtXA5ho/o56bypsRX6B1suiT6BQ0poTptoi9d/vex9GcNxAUrVKgnURRcJfsg== X-Received: by 2002:a05:6902:250b:b0:dc2:3fbd:82fe with SMTP id dt11-20020a056902250b00b00dc23fbd82femr3259985ybb.46.1706542552603; Mon, 29 Jan 2024 07:35:52 -0800 (PST) Received: from ?IPV6:2605:a601:91f3:1900::2bb? ([2605:a601:91f3:1900::2bb]) by smtp.googlemail.com with ESMTPSA id h20-20020a05620a10b400b007831f5c6b65sm3217635qkk.47.2024.01.29.07.35.51 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 29 Jan 2024 07:35:52 -0800 (PST) Content-Type: multipart/alternative; boundary="------------cIWyiEb13Ym4gQCSFesUSmqG" Message-ID: <59e1ecbe-a13f-53e6-3781-75851b7e1812@dunslane.net> Date: Mon, 29 Jan 2024 10:35:51 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Subject: Re: [PATCH] Add native windows on arm64 support Content-Language: en-US To: Dave Cramer Cc: Michael Paquier , Anthony Roberts , Peter Eisentraut , Daniel Gustafsson , Tom Lane , Mike Holmes , Andres Freund , Thomas Munro , PostgreSQL Hackers , Lina Iyer References: <70d20b11-8ed8-a34e-32d1-8f3015dd771b@dunslane.net> <5ba3cae0-0375-c3e6-4bce-89165e09bdd3@dunslane.net> <56da7612-9feb-c52f-1441-8fc4e51ca434@dunslane.net> From: Andrew Dunstan In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --------------cIWyiEb13Ym4gQCSFesUSmqG Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 2024-01-26 Fr 09:18, Dave Cramer wrote: > > > On Fri, 26 Jan 2024 at 07:36, Andrew Dunstan wrote: > > > On 2024-01-25 Th 20:32, Michael Paquier wrote: > > On Thu, Jan 25, 2024 at 04:52:30PM -0500, Dave Cramer wrote: > >> On Thu, 25 Jan 2024 at 16:32, Andrew Dunstan > wrote: > >>> On 2024-01-25 Th 16:17, Dave Cramer wrote: > >>> Yeah, I think the default Developer Command Prompt for VS2022 > is set up > >>> for x86 builds. AIUI you should start by executing "vcvarsall > x64_arm64". > >> Yup, now I'm in the same state you are > > Wait a minute here.  Based on [1], x64_arm64 means you can use a x64 > > host and you'll be able to produce ARM64 builds, still these > will not > > be able to run on the host where they were built. How much of the > > patch posted upthread is required to produce such builds?  Basically > > everything from it, I guess, so as build dependencies can be > > satisfied? > > > > [1]: > https://learn.microsoft.com/en-us/cpp/build/building-on-the-command-line?view=msvc-170 > > > If you look at the table here x86 and x64 are the only supported host > architectures. But that's OK, the x64 binaries will run on arm64 (W11 > ARM64 has x64 emulation builtin). If that didn't work Dave and I > would > not have got as far as we have. But you want the x64_arm64 > argument to > vcvarsall so you will get ARM64 output. > > > I've rebuilt it using  x64_arm64 and with the attached (very naive > patch) and I still get an x64 binary :( I am definitely getting ARM64 binaries (e.g. for initdb.exe the Windows on ARM compatibility setting is greyed out) I'll try your patch. cheers andrew -- Andrew Dunstan EDB:https://www.enterprisedb.com --------------cIWyiEb13Ym4gQCSFesUSmqG Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit


On 2024-01-26 Fr 09:18, Dave Cramer wrote:


On Fri, 26 Jan 2024 at 07:36, Andrew Dunstan <andrew@dunslane.net> wrote:

On 2024-01-25 Th 20:32, Michael Paquier wrote:
> On Thu, Jan 25, 2024 at 04:52:30PM -0500, Dave Cramer wrote:
>> On Thu, 25 Jan 2024 at 16:32, Andrew Dunstan <andrew@dunslane.net> wrote:
>>> On 2024-01-25 Th 16:17, Dave Cramer wrote:
>>> Yeah, I think the default Developer Command Prompt for VS2022 is set up
>>> for x86 builds. AIUI you should start by executing "vcvarsall x64_arm64".
>> Yup, now I'm in the same state you are
> Wait a minute here.  Based on [1], x64_arm64 means you can use a x64
> host and you'll be able to produce ARM64 builds, still these will not
> be able to run on the host where they were built.  How much of the
> patch posted upthread is required to produce such builds?  Basically
> everything from it, I guess, so as build dependencies can be
> satisfied?
>
> [1]: https://learn.microsoft.com/en-us/cpp/build/building-on-the-command-line?view=msvc-170


If you look at the table here x86 and x64 are the only supported host
architectures. But that's OK, the x64 binaries will run on arm64 (W11
ARM64 has x64 emulation builtin). If that didn't work Dave and I would
not have got as far as we have. But you want the x64_arm64 argument to
vcvarsall so you will get ARM64 output.

I've rebuilt it using  x64_arm64 and with the attached (very naive patch) and I still get an x64 binary :(


I am definitely getting ARM64 binaries (e.g. for initdb.exe the Windows on ARM compatibility setting is greyed out)


I'll try your patch.


cheers


andrew

--
Andrew Dunstan
EDB: https://www.enterprisedb.com
--------------cIWyiEb13Ym4gQCSFesUSmqG--