[SERVER-55737] Evaluate feasibility and impact of removing -rdynamic when using libunwind Created: 02/Apr/21 Updated: 27/Oct/23 Resolved: 27/Oct/23 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Build |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Task | Priority: | Major - P3 |
| Reporter: | Andrew Morrow (Inactive) | Assignee: | [DO NOT ASSIGN] Backlog - Server Development Platform Team (SDP) (Inactive) |
| Resolution: | Won't Do | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||
| Assigned Teams: |
Server Development Platform
|
||||
| Backwards Compatibility: | Fully Compatible | ||||
| Participants: | |||||
| Description |
|
We have for a long time linked all our binaries with the -rdynamic flag. This flag is unnecessary but harmless for shared library builds, and work to apply it only for program builds will be put in place under However, the original intention of adding the -rdynamic flag was to ensure that all symbols were included in the dynamic symbol table so that backtrace_symbols would work. When using libunwind we are no longer required to do so in order to get correct backtraces. The only remaining cases for which we would still need symbols to be exported from the program are those where we intend to look up the symbol via the dl APIs like dlsym or dladdr. This does in fact happen in our codebase, in two places:
We can investigate what it would take to allow explicit export of those few specific functions that must be present in the dynamic symbol table. Both ld.gold and ld.lld offer an --export-dynamic-symbol flag which can be used to export symbols on a per-instance basis. |
| Comments |
| Comment by Githook User [ 09/Apr/21 ] |
|
Author: {'name': 'Andrew Morrow', 'email': 'acm@mongodb.com', 'username': 'acmorrow'}Message: |
| Comment by Githook User [ 09/Apr/21 ] |
|
Author: {'name': 'Andrew Morrow', 'email': 'acm@mongodb.com', 'username': 'acmorrow'}Message: |