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 1rUUJV-00BCu9-2v for pgsql-hackers@arkaria.postgresql.org; Mon, 29 Jan 2024 16:16:49 +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 1rUUJU-00FOjl-30 for pgsql-hackers@arkaria.postgresql.org; Mon, 29 Jan 2024 16:16:48 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rUUJT-00FOjd-LQ for pgsql-hackers@lists.postgresql.org; Mon, 29 Jan 2024 16:16:47 +0000 Received: from mail-qk1-x733.google.com ([2607:f8b0:4864:20::733]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1rUUJQ-003zjU-QQ for pgsql-hackers@lists.postgresql.org; Mon, 29 Jan 2024 16:16:46 +0000 Received: by mail-qk1-x733.google.com with SMTP id af79cd13be357-783f27300b1so148860685a.1 for ; Mon, 29 Jan 2024 08:16:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dunslane-net.20230601.gappssmtp.com; s=20230601; t=1706545003; x=1707149803; darn=lists.postgresql.org; h=in-reply-to:subject:from:references:cc:to:content-language :user-agent:mime-version:date:message-id:from:to:cc:subject:date :message-id:reply-to; bh=2XaY2bUa6Hu7I5v2421FDpDavdvG6nVZQ2SyfpxXt24=; b=Vbfqa3Zv65NqD8BQJtyR8+UtOukXCocHTcq7kMfZNp6HWHPAB9jwaZMJNnLXYCZKyY 5relLd4ukN8l8twqA3YF34pSSxKsONdjUmvVzkeqeKddDpv/eskgXQNUJoQHbTQWhze7 O65Ro5URHxw4KLLtgp7MpMk9yAkqfkHpNq1raw3aneW1ryjPb4yfUPf0r+QWY8BkPQE7 ubnrLzono3Z1DCgASCdW8rQht9HCNA/nWwK9aXhkNcGFYIjPJUjuFsDSxoH9aMUm7FC1 eDkLBz0vfCzpNFpbOR+kMrlVb+FCLrODEIxAN4+38ZDrLj/Oz0a980AZQ2/qWBSOoA+6 GBFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706545003; x=1707149803; h=in-reply-to:subject:from:references:cc:to:content-language :user-agent:mime-version:date:message-id:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=2XaY2bUa6Hu7I5v2421FDpDavdvG6nVZQ2SyfpxXt24=; b=gBz3Ar8onmNRaoS0r+JGpMbTDXwqNVB3T7rpiiMxC10fzXyqsQNMnRnvILmBDyEO1p VahvYV4RDzcYURHX78eD4NSG0TH9+r6eyWC1UtdaAOEuwSjDJn7dXggN8OGxHM92QcLT ZrHzy4/suOzVZsoWjueywEv4WhwUc5vOwdG+vykoRKkwHSJ41vmBDMYW9owGZ/9/PAD/ oxVEOdsJtTy3ET5Mzvj87fhv3Iq0w7y2chUDDgRWP+raQX76kjtUtNJM7taWUB2wMVfN y4qnWrtkVt9rdNsotTGOnP9/95NUy6kPVzPNdAr96lKFRI0x+0Btkkwe2kSuecWzZ3PU Sn3w== X-Gm-Message-State: AOJu0YxIesHiqeGQUc/eeVj/ELeY6MYQLOX3Uwe7UHmZ/7l30G3+8NBU GNkV+ZkSw2IW3yfJ4Oc7P2AUAq8kwCOV7hajX/Lpb0hG36OmbLUkAVAJpvDOXHw= X-Google-Smtp-Source: AGHT+IG/zO89jsLm1/ckL+FzjjY1yFr8OHYW6y7WX4VDP/+nA8LB0FUSd4yhDvWxph3/2+jNw1yEPg== X-Received: by 2002:a05:6214:5001:b0:686:abe7:9ba0 with SMTP id jo1-20020a056214500100b00686abe79ba0mr8122331qvb.101.1706545003221; Mon, 29 Jan 2024 08:16:43 -0800 (PST) Received: from ?IPV6:2605:a601:91f3:1900::2bb? ([2605:a601:91f3:1900::2bb]) by smtp.googlemail.com with ESMTPSA id 12-20020ad45b8c000000b0068c501d0766sm958258qvp.41.2024.01.29.08.16.42 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 29 Jan 2024 08:16:42 -0800 (PST) Content-Type: multipart/alternative; boundary="------------uQv8E4KYqbXp7kP9kEe6P1Os" Message-ID: <98c8bcbe-3774-854c-b6a6-1c8e6992a25f@dunslane.net> Date: Mon, 29 Jan 2024 11:16:41 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 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 Subject: Re: [PATCH] Add native windows on arm64 support 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. --------------uQv8E4KYqbXp7kP9kEe6P1Os 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 :( With this patch I still get a build error, but it's different :-) [1406/2088] "link" @src/backend/postgres.exe.rsp FAILED: src/backend/postgres.exe src/backend/postgres.pdb "link" @src/backend/postgres.exe.rsp    Creating library src\backend\postgres.exe.lib storage_lmgr_s_lock.c.obj : error LNK2019: unresolved external symbol spin_delay referenced in function perform_spin_delay src\backend\postgres.exe : fatal error LNK1120: 1 unresolved externals cheers andrew -- Andrew Dunstan EDB:https://www.enterprisedb.com --------------uQv8E4KYqbXp7kP9kEe6P1Os 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 :(


With this patch I still get a build error, but it's different :-)


[1406/2088] "link" @src/backend/postgres.exe.rsp
FAILED: src/backend/postgres.exe src/backend/postgres.pdb
"link" @src/backend/postgres.exe.rsp
   Creating library src\backend\postgres.exe.lib

storage_lmgr_s_lock.c.obj : error LNK2019: unresolved external symbol spin_delay referenced in function perform_spin_delay

src\backend\postgres.exe : fatal error LNK1120: 1 unresolved externals


cheers


andrew

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