postgresql-interfaces/psqlodbc GitHub issues and pull requests (mirror)
help / color / mirror / Atom feedFrom: kenjiuno (@kenjiuno) <[email protected]>
To: postgresql-interfaces/psqlodbc <[email protected]>
Subject: Re: [postgresql-interfaces/psqlodbc] issue #36: Request: Add Windows for ARM support
Date: Tue, 06 May 2025 03:00:12 +0000
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
Hi.
Although I'm unsure I can help you, I'll share notes from my memo.
---
I needed to use `meson + ninja` for cross compilation. My PC is `x64`, and the target is `Arm64` (Arm64X).
`meson + msbuild` seems to have a problem: meson system sometimes launches a child msbuild, but important properties like `/p:Configuration=...` are not propagated.
[custom_target() and run_target() fail to execute with VS backend when buildtype is set to release · Issue #8237 · mesonbuild/meson](https://github.com/mesonbuild/meson/issues/8237)
There is a workaround using an environment variable.
```bat
SET CONFIGURATION=Release
```
---
Are you going to link OpenSSL (`Arm64`) into PostgreSQL (`arm64ec`)?
> "C:\repos\postgresql-17.0\build-last-try-4\postgresql.sln" (default target) (1) ->
> "C:\repos\postgresql-17.0\build-last-try-4\src\interfaces\libpq\886b0b2@@[email protected]" (default target) (25) ->
> (Link target) ->
> fe-secure-openssl.c.obj : error LNK2001: unresolved external symbol #GENERAL_NAME_free (EC Symbol) [C:\repos\postgresql-17.0\build-last-try-4\src\interfaces\libpq\886b0b2@@[email protected]]
> fe-secure-openssl.c.obj : error LNK2019: unresolved external symbol GENERAL_NAME_free referenced in function #pgtls_verify_peer_name_matches_certificate_guts (EC Symbol) [C:\repos\postgresql-17.0\build-last-try-4\src\interfaces\libpq\886b0b2@@[email protected]]
> fe-secure-openssl.c.obj : error LNK2019: unresolved external symbol ENGINE_by_id referenced in function #ENGINE_by_id$exit_thunk (EC Symbol) [C:\repos\postgresql-17.0\build-last-try-4\src\interfaces\libpq\886b0b2@@[email protected]]
If you are going to build PostgreSQL (`arm64ec`), you need to prepare OpenSSL (`arm64ec`).
As far as I know, there is no official OpenSSL `arm64ec` binary yet. (It may need to be compiled by self)
---
This `postgres.def` is generated by a wrong `src/tools/msvc_gendef.pl`, where it doesn't recognize `aarch64` yet.
> postgres.def : error LNK2001: unresolved external symbol brin_parallel_build_main [C:\repos\postgresql-17.0\build-last-try-3\src\backend\22e3565@@[email protected]]
Check https://github.com/postgres/postgres/blob/5e2f3df49d4298c6097789364a5a53be172f6e85/src/backend/acces...
This symbol should prefix `_` symbol natively.
```c
/*
* Perform work within a launched parallel process.
*/
void
_brin_parallel_build_main(dsm_segment *seg, shm_toc *toc)
{
// ...
}
```
Fix `src\tools\msvc_gendef.pl`
```patch
src/tools/msvc_gendef.pl | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/tools/msvc_gendef.pl b/src/tools/msvc_gendef.pl
index 404076dbbc..c23320b1d2 100644
--- a/src/tools/msvc_gendef.pl
+++ b/src/tools/msvc_gendef.pl
@@ -122,7 +122,7 @@ sub writedef
# Strip the leading underscore for win32, but not x64
$f =~ s/^_//
- unless ($arch eq "x86_64");
+ unless ($arch eq 'x86_64' || $arch eq 'aarch64');
# Emit just the name if it's a function symbol, or emit the name
# decorated with the DATA option for variables.
@@ -143,7 +143,7 @@ sub writedef
sub usage
{
die("Usage: msvc_gendef.pl --arch <arch> --deffile <deffile> --tempdir <tempdir> files-or-directories\n"
- . " arch: x86 | x86_64\n"
+ . " arch: x86 | x86_64 | aarch64\n"
. " deffile: path of the generated file\n"
. " tempdir: directory for temporary files\n"
. " files or directories: object files or directory containing object files\n"
@@ -160,7 +160,7 @@ GetOptions(
'tempdir:s' => \$tempdir,) or usage();
usage("arch: $arch")
- unless ($arch eq 'x86' || $arch eq 'x86_64');
+ unless ($arch eq 'x86' || $arch eq 'x86_64' || $arch eq 'aarch64');
my @files;
```
Delete generated `BUILDROOT\src\backend\postgres.def` and also build again.
Check `BUILDROOT\src\backend\postgres.def`
Ensure that `_brin_parallel_build_main` exists.

<!--
---
`If I use ninja (and cygwin)`
I used `ninja` bundled with `Strawberry Perl (64-bit) 5.40.0.1-64bit`.
```bat
V:\psqlodbc-for-win10-arm64\postgres>where ninja
C:\Strawberry\c\bin\ninja.exe
```
[Strawberry Perl for Windows](https://strawberryperl.com/)
[PostgreSQL: Documentation: 17: 17.7. Platform-Specific Notes](https://www.postgresql.org/docs/17/installation-platform-notes.html#WINDOWS-REQUIREMENTS)
> 17.7.5.1. Requirements
> The following additional products are required to build PostgreSQL on Windows.
>
> Strawberry Perl
> Strawberry Perl is required to run the build generation scripts. MinGW or Cygwin Perl will not work. It must also be present in the PATH. Binaries can be downloaded from https://strawberryperl.com.
If you are searching for an alternative, this may help.
-->
---
> "C:\repos\psqlodbc\winbuild\platformbuild.vcxproj" (Build target) (1) ->
> "C:\repos\psqlodbc\winbuild\psqlodbc.vcxproj" (Build target) (2) ->
> (Link target) ->
> columninfo.obj : error LNK2001: unresolved external symbol PQfmod (EC Symbol) [C:\repos\psqlodbc\winbuild\psqlodbc.vcxproj]
> columninfo.obj : error LNK2001: unresolved external symbol #PQfmod (EC Symbol) [C:\repos\psqlodbc\winbuild\psqlodbc.vcxproj]
This link target is `Arm64X`?
view thread (31+ messages) latest in thread
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: github://postgresql-interfaces/psqlodbc
Cc: [email protected], [email protected]
Subject: Re: [postgresql-interfaces/psqlodbc] issue #36: Request: Add Windows for ARM support
In-Reply-To: <<[email protected]>>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox