Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit146cb38

Browse files
committed
Work around issues in MinGW-64's setjmp/longjmp support.
It's hard to avoid the conclusion that there is something wrong withsetjmp/longjmp on MinGW-64, as we have seen failures come and go afterentirely-unrelated-looking changes in our own code. Other projectssuch as Ruby have given up and started using gcc's setjmp/longjmpbuiltins on that platform; this patch just follows that lead.Note that this is a pretty fundamental ABI break for functionscontainining either setjmp or longjmp, so we can't really considera back-patch.Per reports from Regina Obe and Heath Lord, as well as recent failureson buildfarm member walleye, and less-recent failures on fairywren.Juan José Santamaría FlechaDiscussion:https://postgr.es/m/000401d716a0$1ed0fc70$5c72f550$@pcorp.usDiscussion:https://postgr.es/m/CA+BEBhvHhM-Bn628pf-LsjqRh3Ang7qCSBG0Ga+7KwhGqrNUPw@mail.gmail.comDiscussion:https://postgr.es/m/f1caef93-9640-022e-9211-bbe8755a56b0@2ndQuadrant.com
1 parenteeb60e4 commit146cb38

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

‎src/include/c.h

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1335,14 +1335,21 @@ extern unsigned long long strtoull(const char *str, char **endptr, int base);
13351335

13361336
/*
13371337
* When there is no sigsetjmp, its functionality is provided by plain
1338-
* setjmp. Incidentally, nothing provides setjmp's functionality in
1339-
* that case. We now support the case only on Windows.
1338+
* setjmp. We now support the case only on Windows. However, it seems
1339+
* that MinGW-64 has some longstanding issues in its setjmp support,
1340+
* so on that toolchain we cheat and use gcc's builtins.
13401341
*/
13411342
#ifdefWIN32
1343+
#ifdef__MINGW64__
1344+
typedefintptr_tsigjmp_buf[5];
1345+
#definesigsetjmp(x,y) __builtin_setjmp(x)
1346+
#definesiglongjmp __builtin_longjmp
1347+
#else/* !__MINGW64__ */
13421348
#definesigjmp_buf jmp_buf
13431349
#definesigsetjmp(x,y) setjmp(x)
13441350
#definesiglongjmp longjmp
1345-
#endif
1351+
#endif/* __MINGW64__ */
1352+
#endif/* WIN32 */
13461353

13471354
/* EXEC_BACKEND defines */
13481355
#ifdefEXEC_BACKEND

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp