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
Link to libdl on non-BSD POSIX systems. #941
Conversation
The alternative would be to put this linker command in dmd.conf for Linux and OSX. |
It wouldn't work (I did try that). This has to be passed here or linking will fail (which is the reason those other libraries (libm, libpthread, librt, etc) are also added to the command line in the function I modified). |
@@ -384,6 +384,12 @@ int runLINK() | |||
// argv.push((void *)"-ldruntime"); | |||
argv.push((char *)"-lpthread"); | |||
argv.push((char *)"-lm"); | |||
|
|||
#if !__FreeBSD__ && !__OpenBSD__ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please make it a positive list
#if linux || __sun&&__SVR4
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
This is indeed needed when libdl functions are used from druntime/phobos. |
I'm closing this for now, since it won't be relevant until we have a proper shared runtime. |
I think we should merge it now. It's a correct change even though the issue only arises with the unfinished Runtime.loadLibrary. |
Add feature for testing diagnostic bugs
Somewhat delayed, but reopening this in case we do want to merge it. |
Poking this to make the auto tester run it on OS X machines. |
ping on this? |
Up to @dawgfoto if we merge this now or later, I guess. |
I think it would be best to fix this issue in a more general way (as being discussed in #497) instead of adding more hardcoded linker options in the compiler sources. |
Needed for: dlang/druntime#211