[PATCH] Fix PostgreSQL server build and install problems under MSYS2

Started by Guram Dukaover 6 years ago4 messageshackers
Jump to latest
#1Guram Duka
guram.duka@gmail.com

Hi hackers.

I made a patch fixing build and install problems under MSYS2, including
llvmjit.

I have tested this in my environment and it works, of course need more
extensive testing.
Attached is a patch that fixes it. Tag REL_11_5. Easy to adapt for other
versions.

--
Best regards.
Guram Duka.

Attachments:

postgresql-11.5-msys2-v1.patchapplication/octet-stream; name=postgresql-11.5-msys2-v1.patchDownload+75-39
#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Guram Duka (#1)
Re: [PATCH] Fix PostgreSQL server build and install problems under MSYS2

=?UTF-8?B?0JPRg9GA0LDQvCDQlNGD0LrQsA==?= <guram.duka@gmail.com> writes:

I made a patch fixing build and install problems under MSYS2, including
llvmjit.

This seems like it probably breaks a lot of other cases along the way.
Why have you made all these #if tests dependent on defined(__cplusplus)?
That's surely not specific to MSYS2. (I'm a bit bemused by the idea
that our code compiles at all on a C++ compiler; we have not tried
to make the .c files C++-clean. But if it does work, this probably
breaks it for non-Windows cases.)

The GSSAPI changes seem like they might be better considered
separately from the basic problem of getting a working MSYS2 build.

In any case, you need to explain these changes individually,
not expect that we're just going to adopt them without questions.

regards, tom lane

#3Michael Paquier
michael@paquier.xyz
In reply to: Tom Lane (#2)
Re: [PATCH] Fix PostgreSQL server build and install problems under MSYS2

On Mon, Nov 11, 2019 at 10:56:51AM -0500, Tom Lane wrote:

This seems like it probably breaks a lot of other cases along the way.
Why have you made all these #if tests dependent on defined(__cplusplus)?
That's surely not specific to MSYS2. (I'm a bit bemused by the idea
that our code compiles at all on a C++ compiler; we have not tried
to make the .c files C++-clean. But if it does work, this probably
breaks it for non-Windows cases.)

The GSSAPI changes seem like they might be better considered
separately from the basic problem of getting a working MSYS2 build.

Yeah. We have fairywen in the buildfarm but it does not compile with
GSSAPI and LLVM. If we were to do something, it would be better to
separate those changes into minimum, separate patches, with one each
for each library dependency you are trying to fix so as they can be
evaluated separately. We should also have a buildfarm member on that
if some of those changes actually make sense and are
platform-dependent.

In any case, you need to explain these changes individually,
not expect that we're just going to adopt them without questions.

I am doubtful that the changes in c.h, elog.h, win32_port.h,
miscadmin.h and src/backend/jit/llvm/Makefile are actually needed
thanks to fairywen.

+#if defined(HAVE_GSS_API_H) && !defined(GSS_DLLIMP)
+static gss_OID_desc GSS_C_NT_USER_NAME_desc =
+{10, (void *) "\x2a\x86\x48\x86\xf7\x12\x01\x02\x01\x02"};
This also deserves an explanation.
--
Michael
#4Guram Duka
guram.duka@gmail.com
In reply to: Michael Paquier (#3)
Re: [PATCH] Fix PostgreSQL server build and install problems under MSYS2

Thank you for your comments.

1. The #if ... defined(__ cplusplus) is necessary for the successful
compilation of C++ llvmjit code that uses C headers.
2. #if defined(HAVE_GSS_API_H) && !defined(GSS_DLLIMP) is necessary for the
successful link libgss.a provided by MSYS2.
3. Remember that you need to run autoreconf before running configure.
4. Found and fixed a small bug in the patch. Build in environment CentOS
7.7.1908 works. Build in environment MSYS2 gcc 9.2.0 works. Build in
environment Visual Studio Community 2019 works.

The second version of the patch attached.
Waiting for your comments.

--
Best regards.
Guram Duka.

Attachments:

postgresql-11.5-msys2-v2.patchapplication/octet-stream; name=postgresql-11.5-msys2-v2.patchDownload+75-39