forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commite3d77ea
committed
Prevent mis-linking of src/port and src/common functions on *BSD.
On ELF-based platforms (and maybe others?) it's possible for a sharedlibrary, when dynamically loaded into the backend, to call the backendversions of src/port and src/common functions rather than the frontendversions that are actually linked into the shlib. This is the causeof bug #15367 from Jeremy Evans, and is likely to lead to more problemsin future; it's accidental that we've failed to notice any bad effectsup to now.The recommended way to fix this on ELF-based platforms is to use alinker "version script" that makes the shlib's versions of the functionslocal. (Apparently, -Bsymbolic would fix it as well, but with otherside effects that we don't want.) Doing so has the additional benefitthat we can make sure the shlib only exposes the symbols that are meantto be part of its API, and not ones that are just for cross-filereferences within the shlib. So we'd already been using a versionscript for libpq on popular platforms, but it's now apparent that it'snecessary for correctness on every ELF-based platform.Hence, add appropriate logic to the openbsd, freebsd, and netbsd stanzasof Makefile.shlib; this is just a copy-and-paste from the linux stanza.There may be additional work to do if commited0cdf0 reveals that theproblem exists elsewhere, but this is all that is known to be neededright now.Back-patch to v10 where SCRAM support came in. The problem is ancient,but analysis suggests that there were no really severe consequencesin older branches. Hence, I won't take the risk of such a large changein the build process for older branches.In passing, remove a rather opaque comment about -Bsymbolic; I don'tthink it's very on-point about why we don't use that, if indeed that'swhat it's talking about at all.Patch by me; thanks to Andrew Gierth for helping to diagnose the problem,and for additional testing.Discussion:https://postgr.es/m/153626613985.23143.4743626885618266803@wrigleys.postgresql.org1 parentcf98467 commite3d77ea
1 file changed
+15
-5
lines changedLines changed: 15 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
64 | 64 |
| |
65 | 65 |
| |
66 | 66 |
| |
67 |
| - | |
68 |
| - | |
69 |
| - | |
70 |
| - | |
71 |
| - | |
72 | 67 |
| |
73 | 68 |
| |
74 | 69 |
| |
| |||
149 | 144 |
| |
150 | 145 |
| |
151 | 146 |
| |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
152 | 152 |
| |
153 | 153 |
| |
154 | 154 |
| |
| |||
164 | 164 |
| |
165 | 165 |
| |
166 | 166 |
| |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
167 | 172 |
| |
168 | 173 |
| |
169 | 174 |
| |
| |||
178 | 183 |
| |
179 | 184 |
| |
180 | 185 |
| |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
181 | 191 |
| |
182 | 192 |
| |
183 | 193 |
| |
|
0 commit comments
Comments
(0)