forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitb6c7cfa
committed
Restore proper linkage of pg_char_to_encoding() and friends.
Back in the 8.3 era we discovered that it was problematic iflibpq.so had encoding ID assignments different from the backend,which is possible because on some platforms libpq.so might beof a different major version from the calling programs.psql should use libpq's assignments, but initdb has to use thebackend's, else it will put wrong values into pg_database.The solution devised in commit8468146 relied on giving initdbits own copy of encnames.c rather than relying on the functionsexported by libpq. Later, that metamorphosed into ensuring thatlibpgcommon got linked before libpq -- which made things OK forinitdb but broke psql. We didn't notice for lack of any changesin enum pg_enc since then. Commit06843df reversed that, fixingthe latent bug in psql but adding one in initdb. The meson buildinfrastructure is also not being sufficiently careful about linkorder, and trying to make it so would be equally fragile.Hence, let's use a new scheme based on giving the libpq-exportedsymbols different real names than the same functions exported fromlibpgcommon.a or libpgcommon_srv.a. (We could distinguish thosetwo cases as well, but there seems no need to.) libpq gets theofficial names to avoid an ABI break for libpq clients, while theother cases use #define's to make the real names "xxx_private"rather than "xxx". By controlling where the #define's areapplied, we can force any particular client program to use oneset or the other of the encnames.c functions.We cannot back-patch this, since it'd be an ABI break for backendloadable modules, but there seems little need to. We're justtrying to ensure that the world is safe for hypothetical futureadditions to enum pg_enc.In passing this should fix "duplicate symbol" linker warningsthat we've been seeing on AIX buildfarm members since commit06843df. It's not very clear why that linker is complainingnow, when there were strictly *more* duplicates visible before,but in any case this should remove the reason for complaint.Patch by me; thanks to Andres Freund for review.Discussion:https://postgr.es/m/2385119.1696354473@sss.pgh.pa.us1 parente8c334c commitb6c7cfa
File tree
5 files changed
+41
-9
lines changed- src
- bin/initdb
- common
- include/mb
5 files changed
+41
-9
lines changedLines changed: 4 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
16 | 16 |
| |
17 | 17 |
| |
18 | 18 |
| |
19 |
| - | |
20 |
| - | |
21 | 19 |
| |
22 | 20 |
| |
23 |
| - | |
24 |
| - | |
25 |
| - | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
26 | 25 |
| |
27 | 26 |
| |
28 | 27 |
| |
|
Lines changed: 5 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
7 | 7 |
| |
8 | 8 |
| |
9 | 9 |
| |
10 |
| - | |
11 |
| - | |
12 | 10 |
| |
13 | 11 |
| |
14 | 12 |
| |
| |||
18 | 16 |
| |
19 | 17 |
| |
20 | 18 |
| |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
21 | 24 |
| |
22 | 25 |
| |
23 | 26 |
| |
|
Lines changed: 7 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
140 | 140 |
| |
141 | 141 |
| |
142 | 142 |
| |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
143 | 150 |
| |
144 | 151 |
| |
145 | 152 |
| |
|
Lines changed: 5 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
112 | 112 |
| |
113 | 113 |
| |
114 | 114 |
| |
115 |
| - | |
116 |
| - | |
| 115 | + | |
| 116 | + | |
117 | 117 |
| |
118 | 118 |
| |
119 | 119 |
| |
| |||
131 | 131 |
| |
132 | 132 |
| |
133 | 133 |
| |
| 134 | + | |
| 135 | + | |
| 136 | + | |
134 | 137 |
| |
135 | 138 |
| |
136 | 139 |
| |
|
Lines changed: 20 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
13 | 13 |
| |
14 | 14 |
| |
15 | 15 |
| |
| 16 | + | |
| 17 | + | |
| 18 | + | |
16 | 19 |
| |
17 | 20 |
| |
18 | 21 |
| |
| |||
562 | 565 |
| |
563 | 566 |
| |
564 | 567 |
| |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
565 | 585 |
| |
566 | 586 |
| |
567 | 587 |
| |
|
0 commit comments
Comments
(0)