forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit089480c
committed
Default to hidden visibility for extension libraries where possible
Until now postgres built extension libraries with global visibility, i.e.exporting all symbols. On the one platform where that behavior is notnatively available, namely windows, we emulate it by analyzing the input filesto the shared library and exporting all the symbols therein.Not exporting all symbols is actually desirable, as it can improve loadingspeed, reduces the likelihood of symbol conflicts and can improve intraextension library function call performance. It also makes the non-windowsbuilds more similar to windows builds.Additionally, with meson implementing the export-all-symbols behavior forwindows, turns out to be more verbose than desirable.This patch adds support for hiding symbols by default and, to counteract that,explicit symbol visibility annotation for compilers that support__attribute__((visibility("default"))) and -fvisibility=hidden. That isexpected to be most, if not all, compilers except msvc (for which we alreadysupport explicit symbol export annotations).Now that extension library symbols are explicitly exported, we don't need toexport all symbols on windows anymore, hence remove that behavior fromsrc/tools/msvc. The supporting code can't be removed, as we still need toexport all symbols from the main postgres binary.Author: Andres Freund <andres@anarazel.de>Author: Tom Lane <tgl@sss.pgh.pa.us>Discussion:https://postgr.es/m/20211101020311.av6hphdl6xbjbuif@alap3.anarazel.de1 parentfd4bad1 commit089480c
File tree
9 files changed
+198
-12
lines changed- src
- include
- makefiles
- tools/msvc
9 files changed
+198
-12
lines changedconfigure
100755
100644
Lines changed: 152 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
741 | 741 |
| |
742 | 742 |
| |
743 | 743 |
| |
| 744 | + | |
| 745 | + | |
744 | 746 |
| |
745 | 747 |
| |
746 | 748 |
| |
| |||
6302 | 6304 |
| |
6303 | 6305 |
| |
6304 | 6306 |
| |
| 6307 | + | |
| 6308 | + | |
| 6309 | + | |
| 6310 | + | |
| 6311 | + | |
| 6312 | + | |
| 6313 | + | |
| 6314 | + | |
| 6315 | + | |
| 6316 | + | |
| 6317 | + | |
| 6318 | + | |
| 6319 | + | |
| 6320 | + | |
| 6321 | + | |
| 6322 | + | |
| 6323 | + | |
| 6324 | + | |
| 6325 | + | |
| 6326 | + | |
| 6327 | + | |
| 6328 | + | |
| 6329 | + | |
| 6330 | + | |
| 6331 | + | |
| 6332 | + | |
| 6333 | + | |
| 6334 | + | |
| 6335 | + | |
| 6336 | + | |
| 6337 | + | |
| 6338 | + | |
| 6339 | + | |
| 6340 | + | |
| 6341 | + | |
| 6342 | + | |
| 6343 | + | |
| 6344 | + | |
| 6345 | + | |
| 6346 | + | |
| 6347 | + | |
| 6348 | + | |
| 6349 | + | |
| 6350 | + | |
| 6351 | + | |
| 6352 | + | |
| 6353 | + | |
| 6354 | + | |
| 6355 | + | |
| 6356 | + | |
| 6357 | + | |
| 6358 | + | |
| 6359 | + | |
| 6360 | + | |
| 6361 | + | |
| 6362 | + | |
| 6363 | + | |
| 6364 | + | |
| 6365 | + | |
| 6366 | + | |
| 6367 | + | |
| 6368 | + | |
| 6369 | + | |
| 6370 | + | |
| 6371 | + | |
| 6372 | + | |
| 6373 | + | |
| 6374 | + | |
| 6375 | + | |
| 6376 | + | |
| 6377 | + | |
| 6378 | + | |
| 6379 | + | |
| 6380 | + | |
| 6381 | + | |
| 6382 | + | |
| 6383 | + | |
| 6384 | + | |
| 6385 | + | |
| 6386 | + | |
| 6387 | + | |
| 6388 | + | |
| 6389 | + | |
| 6390 | + | |
| 6391 | + | |
| 6392 | + | |
| 6393 | + | |
| 6394 | + | |
| 6395 | + | |
| 6396 | + | |
| 6397 | + | |
| 6398 | + | |
| 6399 | + | |
| 6400 | + | |
| 6401 | + | |
| 6402 | + | |
| 6403 | + | |
| 6404 | + | |
| 6405 | + | |
| 6406 | + | |
| 6407 | + | |
| 6408 | + | |
| 6409 | + | |
| 6410 | + | |
| 6411 | + | |
| 6412 | + | |
| 6413 | + | |
| 6414 | + | |
| 6415 | + | |
| 6416 | + | |
| 6417 | + | |
| 6418 | + | |
| 6419 | + | |
| 6420 | + | |
| 6421 | + | |
| 6422 | + | |
| 6423 | + | |
| 6424 | + | |
| 6425 | + | |
| 6426 | + | |
| 6427 | + | |
| 6428 | + | |
| 6429 | + | |
| 6430 | + | |
| 6431 | + | |
| 6432 | + | |
| 6433 | + | |
| 6434 | + | |
| 6435 | + | |
| 6436 | + | |
| 6437 | + | |
| 6438 | + | |
| 6439 | + | |
| 6440 | + | |
| 6441 | + | |
| 6442 | + | |
| 6443 | + | |
| 6444 | + | |
| 6445 | + | |
| 6446 | + | |
| 6447 | + | |
| 6448 | + | |
| 6449 | + | |
| 6450 | + | |
| 6451 | + | |
| 6452 | + | |
| 6453 | + | |
| 6454 | + | |
6305 | 6455 |
| |
6306 | 6456 |
| |
6307 | 6457 |
| |
| |||
6860 | 7010 |
| |
6861 | 7011 |
| |
6862 | 7012 |
| |
| 7013 | + | |
| 7014 | + | |
6863 | 7015 |
| |
6864 | 7016 |
| |
6865 | 7017 |
| |
|
Lines changed: 13 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
525 | 525 |
| |
526 | 526 |
| |
527 | 527 |
| |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
528 | 539 |
| |
529 | 540 |
| |
530 | 541 |
| |
| |||
573 | 584 |
| |
574 | 585 |
| |
575 | 586 |
| |
| 587 | + | |
| 588 | + | |
576 | 589 |
| |
577 | 590 |
| |
578 | 591 |
| |
|
Lines changed: 3 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
258 | 258 |
| |
259 | 259 |
| |
260 | 260 |
| |
| 261 | + | |
| 262 | + | |
| 263 | + | |
261 | 264 |
| |
262 | 265 |
| |
263 | 266 |
| |
|
Lines changed: 13 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
218 | 218 |
| |
219 | 219 |
| |
220 | 220 |
| |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
221 | 234 |
| |
222 | 235 |
| |
223 | 236 |
| |
|
Lines changed: 9 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1347 | 1347 |
| |
1348 | 1348 |
| |
1349 | 1349 |
| |
1350 |
| - | |
1351 |
| - | |
1352 |
| - | |
1353 |
| - | |
| 1350 | + | |
| 1351 | + | |
| 1352 | + | |
| 1353 | + | |
| 1354 | + | |
1354 | 1355 |
| |
1355 | 1356 |
| |
| 1357 | + | |
| 1358 | + | |
| 1359 | + | |
1356 | 1360 |
| |
1357 | 1361 |
| |
| 1362 | + | |
1358 | 1363 |
| |
1359 | 1364 |
| |
1360 | 1365 |
| |
|
Lines changed: 3 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
700 | 700 |
| |
701 | 701 |
| |
702 | 702 |
| |
| 703 | + | |
| 704 | + | |
| 705 | + | |
703 | 706 |
| |
704 | 707 |
| |
705 | 708 |
| |
|
Lines changed: 4 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
101 | 101 |
| |
102 | 102 |
| |
103 | 103 |
| |
| 104 | + | |
104 | 105 |
| |
105 |
| - | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
106 | 109 |
| |
107 | 110 |
| |
108 | 111 |
| |
|
Lines changed: 0 additions & 7 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
419 | 419 |
| |
420 | 420 |
| |
421 | 421 |
| |
422 |
| - | |
423 |
| - | |
424 |
| - | |
425 |
| - | |
426 |
| - | |
427 |
| - | |
428 |
| - | |
429 | 422 |
| |
430 | 423 |
| |
431 | 424 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
429 | 429 |
| |
430 | 430 |
| |
431 | 431 |
| |
| 432 | + | |
432 | 433 |
| |
433 | 434 |
| |
434 | 435 |
| |
|
0 commit comments
Comments
(0)