-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix undefined symbol error in version script #55363
Conversation
lld 17 and above by default error if symbols listed in the version script are undefined. Julia has a few of these, as some symbols are defined conditionally in Julia (e.g. based on OS), others perhaps have been removed from Julia and other seem to be defined in other libraries. Further the version script is used in linking three times, each time linking together different objects and so having different symbols defined. Adding `-Wl,--undefined-version` is not a great solution as passing that to ld < 2.40 errors and there doesn't seem to be a great way to check if a linker supports this flag. I don't know how to get around these errors for symbols like `_IO_stdin_used` which Julia doesn't define and it seems to matter whether or not they are exported, see https://libc-alpha.sourceware.narkive.com/SevIQmU3/io-stdin-used-stripped-by-version-scripts. So I've converted all undefined symbols into wildcards to work around the error.
Did you simply add I wonder if applying this too widely might hide some issues? I.e. if a symbol truly is gone, and we just forgot to remove it from the version script then it might be good if on some platform we get an error, so that we can remove it (though it would be better if the error just showed on all platforms, otherwise "fringe" platforms suffer unfairly from "bugs" accidentally introduced by devs on the most active platforms). That said, overall I'd like to approach these things pragmatically: this seems to resolve a real issue for people and I don't see any major downside, so I'd just apply it (and if somebody has a better idea: they are welcome to submit a PR improving things further). |
I did add |
Can you please rebase? There's a conflict in the expmap 🥲 |
lld 17 and above by default error if symbols listed in the version script are undefined. Julia has a few of these, as some symbols are defined conditionally in Julia (e.g. based on OS), others perhaps have been removed from Julia and other seem to be defined in other libraries. Further the version script is used in linking three times, each time linking together different objects and so having different symbols defined.
Adding
-Wl,--undefined-version
is not a great solution as passing that to ld < 2.40 errors and there doesn't seem to be a great way to check if a linker supports this flag.I don't know how to get around these errors for symbols like
_IO_stdin_used
which Julia doesn't define and it seems to matter whether or not they are exported, see https://libc-alpha.sourceware.narkive.com/SevIQmU3/io-stdin-used-stripped-by-version-scripts. So I've converted all undefined symbols into wildcards to work around the error.Fixes #50414, fixes #54533 and replaces #55319.