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 1rUoK8-00D9dV-FD for pgsql-hackers@arkaria.postgresql.org; Tue, 30 Jan 2024 13:38: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 1rUoK7-006C3K-LL for pgsql-hackers@arkaria.postgresql.org; Tue, 30 Jan 2024 13:38:47 +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 1rUoK7-006C33-2s for pgsql-hackers@lists.postgresql.org; Tue, 30 Jan 2024 13:38:47 +0000 Received: from mail-qk1-x72e.google.com ([2607:f8b0:4864:20::72e]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1rUoK4-0049iq-6s for pgsql-hackers@lists.postgresql.org; Tue, 30 Jan 2024 13:38:45 +0000 Received: by mail-qk1-x72e.google.com with SMTP id af79cd13be357-78405c9a152so104026985a.1 for ; Tue, 30 Jan 2024 05:38:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dunslane-net.20230601.gappssmtp.com; s=20230601; t=1706621922; x=1707226722; 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=JIKOtC4/Hh3J1pi8ktAGhAt1TwCWLAVUSxRXtutxRpA=; b=vjscfDEDKMDFv8zXvpPfdXTAwO7yBxupqAzmIqgU4maCX9RZ3uU84pFCnbjlejedTp h9g3wS/pg7cEtLzMGNh1M4IkLW9uQQK7JaH4eXNNQJWtcsZECLJrfm0pHU5MQ/PuhoeW FR2In8IzXomHIJkrdWQEVTPvoT/o1K7f1UZjDoP389/9g3w8zQp70PnuuRNSnwCxf08J HJBQde+yBe44FDI0IXqBPPJHcW9vldn/wOJxqgX9kthRyhK623lfVG7jmtQWh93hPj8l A/seegDjDcLa6jfvspTVkBU4FofurIsM9eRCHagrMvLxoE0sOz2OIzfSGbpI92Aw3tJE fIUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706621922; x=1707226722; 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=JIKOtC4/Hh3J1pi8ktAGhAt1TwCWLAVUSxRXtutxRpA=; b=OtTC3LIShFTGg5BNrobLyMMiBrPpQCECjysde/nhyfZCRB0hG2Y3+IFjb//6AeuJCW d7kVLw6i2fzTSjRbNxQhD4qkXEXX1VvqU/X1yuKr2LNRx3RbkG6oFdSR/qgCfSKBrwq3 bDxnSj17DrmcOepATDnyVuDRcUzyWABvUHHdDt7dAR4Tz8RHTRD9zD9h3/wh6aFHG+uB UW2lEkp8PdPxqHao2L6APP1qcFP3vHr2XJ57kMowVnb5uUJNtGWcKAO6PWfVeP/5zOEl 8bjzXr50Gld1CTqNAON9/zW1IvQjvDRWhaLrzGgmeZ9nA9J3Zxq5bShmRQ2uxJpCMIzl jI3g== X-Gm-Message-State: AOJu0Yy9006IUrUDcEHfUJcoAZDEMDyn4djr1hcjn4fn3a5w9ooqP7zS 7K//MDah6qHASKb5rlFMHb5T7cRexpKrF62ICC5HcyaiAmABg2RAgjRGfrSzo+8= X-Google-Smtp-Source: AGHT+IEUnaZVLvHMDg7QeSRBPCthGX70faE3ZhPT1+NLL7gXJR//w8qICRu/bCkIUQJT41Jd63z3CA== X-Received: by 2002:a05:620a:955:b0:781:ab42:88e7 with SMTP id w21-20020a05620a095500b00781ab4288e7mr6410016qkw.60.1706621922316; Tue, 30 Jan 2024 05:38:42 -0800 (PST) Received: from ?IPV6:2605:a601:91f3:1900::2bb? ([2605:a601:91f3:1900::2bb]) by smtp.googlemail.com with ESMTPSA id u7-20020a05620a022700b00784549af941sm307758qkm.74.2024.01.30.05.38.41 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 30 Jan 2024 05:38:41 -0800 (PST) Content-Type: multipart/alternative; boundary="------------lD55wzyVD07xHSnj7AJeK00a" Message-ID: Date: Tue, 30 Jan 2024 08:38:40 -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> <98c8bcbe-3774-854c-b6a6-1c8e6992a25f@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. --------------lD55wzyVD07xHSnj7AJeK00a Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 2024-01-29 Mo 11:20, Dave Cramer wrote: > > Dave Cramer > www.postgres.rocks > > > On Mon, 29 Jan 2024 at 11:16, Andrew Dunstan wrote: > > > 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 > > > Did you add the latest lock.patch ? > > I'm a bit confused about exactly what needs to be applied. Can you supply a complete patch to be applied to a pristine checkout that will let me build? cheers andrew -- Andrew Dunstan EDB:https://www.enterprisedb.com --------------lD55wzyVD07xHSnj7AJeK00a Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit


On 2024-01-29 Mo 11:20, Dave Cramer wrote:

Dave Cramer


On Mon, 29 Jan 2024 at 11:16, Andrew Dunstan <andrew@dunslane.net> wrote:


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


Did you add the latest lock.patch ?




I'm a bit confused about exactly what needs to be applied. Can you supply a complete patch to be applied to a pristine checkout that will let me build?


cheers


andrew

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