Link to libdl on non-BSD POSIX systems. #941

Closed
wants to merge 2 commits into
from

Projects

None yet

6 participants

@alexrp
Member
alexrp commented May 11, 2012

Needed for: dlang/druntime#211

@complexmath
Member

The alternative would be to put this linker command in dmd.conf for Linux and OSX.

@alexrp
Member
alexrp commented May 11, 2012

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).

@MartinNowak MartinNowak commented on the diff May 21, 2012
src/link.c
@@ -384,6 +384,12 @@ int runLINK()
// argv.push((void *)"-ldruntime");
argv.push((char *)"-lpthread");
argv.push((char *)"-lm");
+
+#if !__FreeBSD__ && !__OpenBSD__
@MartinNowak
MartinNowak May 21, 2012 Member

Please make it a positive list
#if linux || __sun&&__SVR4.

@MartinNowak
Member

This is indeed needed when libdl functions are used from druntime/phobos.
So I think we should merge it when the issue is fixed.

@alexrp
Member
alexrp commented Jun 11, 2012

I'm closing this for now, since it won't be relevant until we have a proper shared runtime.

@alexrp alexrp closed this Jun 11, 2012
@MartinNowak
Member

I think we should merge it now. It's a correct change even though the issue only arises with the unfinished Runtime.loadLibrary.

@alexrp
Member
alexrp commented Aug 19, 2012

Somewhat delayed, but reopening this in case we do want to merge it.

@alexrp alexrp reopened this Aug 19, 2012
@alexrp
Member
alexrp commented Sep 13, 2012

Poking this to make the auto tester run it on OS X machines.

@andralex
Member

ping on this?

@alexrp
Member
alexrp commented Sep 25, 2012

Up to @dawgfoto if we merge this now or later, I guess.

@llucax
Contributor
llucax commented Oct 6, 2012

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.

@alexrp alexrp closed this Jan 31, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment