forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit3c163a7
committed
PL/Perl portability fix: absorb relevant -D switches from Perl.
The Perl documentation is very clear that stuff calling libperl shouldbe built with the compiler switches shown by Perl's $Config{ccflags}.We'd been ignoring that up to now, and mostly getting away with it,but recent Perl versions contain ABI compatibility cross-checks thatfail on some builds because of this omission. In particular thesizeof(PerlInterpreter) can come out different due to some fields beingadded or removed; which means we have a live ABI hazard that we'd betterfix rather than continuing to sweep it under the rug.However, it still seems like a bad idea to just absorb $Config{ccflags}verbatim. In some environments Perl was built with a different compilerthat doesn't even use the same switch syntax. -D switch syntax is prettyuniversal though, and absorbing Perl's -D switches really ought to beenough to fix the problem.Furthermore, Perl likes to inject stuff like -D_LARGEFILE_SOURCE and-D_FILE_OFFSET_BITS=64 into $Config{ccflags}, which affect libc ABIs onplatforms where they're relevant. Adopting those seems dangerous too.It's unclear whether a build wherein Perl and Postgres have different ideasof sizeof(off_t) etc would work, or whether anyone would care about makingit work. But it's dead certain that having different stdio ABIs incore Postgres and PL/Perl will not work; we've seen that movie before.Therefore, let's also ignore -D switches for symbols beginning withunderscore. The symbols that we actually need to import should be the onesmentioned in perl.h's PL_bincompat_options stanza, and none of those startwith underscore, so this seems likely to work. (If it turns out not towork everywhere, we could consider intersecting the symbols mentioned inPL_bincompat_options with the -D switches. But that will be much morecomplicated, so let's try this way first.)This will need to be back-patched, but first let's see what thebuildfarm makes of it.Ashutosh Sharma, some adjustments by meDiscussion:https://postgr.es/m/CANFyU97OVQ3+Mzfmt3MhuUm5NwPU=-FtbNH5Eb7nZL9ua8=rcA@mail.gmail.com1 parentbebe174 commit3c163a7
File tree
7 files changed
+71
-4
lines changed- config
- contrib/hstore_plperl
- src
- pl/plperl
- tools/msvc
7 files changed
+71
-4
lines changedLines changed: 25 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
49 | 49 |
| |
50 | 50 |
| |
51 | 51 |
| |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
52 | 77 |
| |
53 | 78 |
| |
54 | 79 |
| |
|
Lines changed: 13 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
668 | 668 |
| |
669 | 669 |
| |
670 | 670 |
| |
| 671 | + | |
671 | 672 |
| |
672 | 673 |
| |
673 | 674 |
| |
| |||
7767 | 7768 |
| |
7768 | 7769 |
| |
7769 | 7770 |
| |
| 7771 | + | |
| 7772 | + | |
| 7773 | + | |
| 7774 | + | |
| 7775 | + | |
| 7776 | + | |
| 7777 | + | |
| 7778 | + | |
| 7779 | + | |
| 7780 | + | |
| 7781 | + | |
| 7782 | + | |
7770 | 7783 |
| |
7771 | 7784 |
| |
7772 | 7785 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
938 | 938 |
| |
939 | 939 |
| |
940 | 940 |
| |
| 941 | + | |
941 | 942 |
| |
942 | 943 |
| |
943 | 944 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
38 | 38 |
| |
39 | 39 |
| |
40 | 40 |
| |
41 |
| - | |
| 41 | + |
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
304 | 304 |
| |
305 | 305 |
| |
306 | 306 |
| |
| 307 | + | |
307 | 308 |
| |
308 | 309 |
| |
309 | 310 |
| |
|
Lines changed: 5 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
12 | 12 |
| |
13 | 13 |
| |
14 | 14 |
| |
15 |
| - | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
16 | 20 |
| |
17 | 21 |
| |
18 | 22 |
| |
|
Lines changed: 25 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
517 | 517 |
| |
518 | 518 |
| |
519 | 519 |
| |
520 |
| - | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
521 | 540 |
| |
522 | 541 |
| |
523 | 542 |
| |
| |||
601 | 620 |
| |
602 | 621 |
| |
603 | 622 |
| |
604 |
| - | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
605 | 628 |
| |
606 | 629 |
| |
607 | 630 |
| |
|
0 commit comments
Comments
(0)