Skip to content

Compilation of version 2.6 windows port with MinGW64 UCRT environment. #540

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 20 commits into from
Oct 15, 2022

Conversation

funny-falcon
Copy link
Collaborator

No description provided.

kulaginm and others added 9 commits July 19, 2022 14:58
for this
* use of crc macros has been split
* places where _TRADITIONAL_CRC32 and _CRC32C are used are explicitly marked
* added two files to ensure compatibility with pg-11
* at the end of pg-11 support, these new files and places where _TRADITIONAL_CRC32 is used can be deleted
@funny-falcon funny-falcon changed the title Compilation of windows port with MinGW64 UCRT environment. Compilation of version 2.6 windows port with MinGW64 UCRT environment. Sep 20, 2022
There's really no need to. But doing it pulls bad dependency.
just small refactoring.
Mingw pthread "implementation" works reasonably well. There's no need
to use emulation.
Mingw's gcc links with winpthread.dll automatically, no need to force
flags.
Postgresql's 'port' library defines custom 'stat' and 'struct stat'.
It conflicts with system one in MinGW. We had to include either one
or another, but not both. It is easier to do if we include 'sys/stat.h'
only once and only in non-win32 environment.
It is hard to consider all 'echo in makefile shell' variants. Mingw's
one doesn't process escape sequence. That is why it is better to use
raw TAB symbol.
- pid_t is 64bit in mingw. Lets cast it to long long in most places on
  I/O.
- int64 should be casted to long long as well
- size_t should be printed as %zu/%zd
- stat functino is imported from pgport, and there's no need to
  redefine it again.
- no need to redeclare `__thread` since gcc work with it well.
- arguments and types in launch agent.
msvcrt's strftime is quite limited, and we had to use pg_strftime.

On the other hand, ucrt's one is capable for most of SU (Single UNIX)
extensions, so we could safely use it.

That means, we restrict windows port to MinGW64 UCRT environment.
I can't find where EACCESS is used in postgres. Nor I can find
where it is defined in Windows.

It is quite strange it worked before, I can't explain it.
@funny-falcon funny-falcon force-pushed the REL_2_6-PBCKP-245-mingw branch from 10b511c to ccee8ab Compare October 14, 2022 17:34
@funny-falcon funny-falcon merged commit e05a8c3 into REL_2_6 Oct 15, 2022
@funny-falcon funny-falcon deleted the REL_2_6-PBCKP-245-mingw branch December 10, 2022 14:05
@Burus Burus added this to the 2.6.0 milestone Dec 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants