Skip to content

[runtime] Add platform independent version of dladdr() / Dl_info #5969

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

Merged
merged 1 commit into from
Nov 29, 2016

Conversation

spevans
Copy link
Contributor

@spevans spevans commented Nov 29, 2016

With the recent merging of #5944 which adds some fixes for building on windows, and a need to make #5394 not break those changes this PR moves the use of dladdr() and Dl_info into the platform specific implementation files and adds an empty function for Win32.

Currently only tested on Linux and macOS, the Win32 version has not been compile tested. This PR is making the assumption that Win32 doesnt support Dl_info/dladdr(). If that is not the case then it may not be needed.

  • Win32 does not support dlfcn.h, Dl_info or dladdr() so add
    lookupSymbol() as a wrapper for ELF/MachO/Win32

  • Win32 version needs an implementation, currently it just returns
    an error for `cannot lookup address'

- Win32 does not support dlfcn.h, Dl_info or dladdr() so add
  lookupSymbol() as a wrapper for ELF/MachO/Win32

- Win32 version needs an implementation, currently it just returns
  an error for `cannot lookup address'
@spevans
Copy link
Contributor Author

spevans commented Nov 29, 2016

/cc @compnerd @hughbe @jckarter I think this is a better solution than the _swift_dladdr() wrapper in #5394 and I made it a separate PR so that the Win32 devs could check it as well

@jckarter
Copy link
Contributor

Yeah, this makes sense to me.

@jckarter
Copy link
Contributor

@swift-ci Please smoke test

@jckarter jckarter self-assigned this Nov 29, 2016
@jckarter jckarter merged commit d5ba131 into swiftlang:master Nov 29, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants