Needed for: dlang/druntime#211
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).
Please make it a positive list
#if linux || __sun&&__SVR4.
#if linux || __sun&&__SVR4
This is indeed needed when libdl functions are used from druntime/phobos.
So I think we should merge it when the issue is fixed.
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.
Merge pull request #1088 from 9rnsr/test_diagnostic_bugs
Add feature for testing diagnostic bugs
Link to libdl on non-BSD POSIX systems.
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.