multilib patch adds unconditional -ldl, it should have checked for this using configure instead. This breaks on FreeBSD (and OpenBSD), where dl is part of libc.
@hwoarang: you've committed the patch that breaks. I've given you lots of time. Perhaps this disappeared under your radar because it wasn't assigned to you. You've got until 04-09-2011 and then I'll drop your patch if you haven't fix the breakage.
Sorry, I forgot about this. You can remove my patch ( or I can do it for you ) since I don't know how to satisfy your request
Well, you know how to check for a library with configure, right? So just check if -ldl is necessary, store it in LDLIBS or something and use it instead of hardcoded -ldl.
Yes but the actual multilib patch is a bit more complicated than that. I will have a look as soon as possible but I given the fact that I am not that familiar with autotools, I would suggest you to remove it until I provide a correct solution to that problem
I suggest to work on it together then, so we don't have to drop it, thereby introducing a new bug.
In Makefile.am you just add -ldl to chrpath_LDADD (libtool var). Since Makefile.am is processed by automake, it ends up as a Makefile.in file, which gets expanded by configure. So, you can: - use chrpath_LDADD = @LDLIBS@ and have configure expand it, or - use chrpath_LDADD = $(LDLIBS) and have autoconf/make define a variable for it in configure, AC_SUBST(LDLIBS), see http://www.gnu.org/s/hello/manual/autoconf/Setting-Output-Variables.html this is the proper way to do it So, what's left then, is to define the check in configure.ac that actually sets LDLIBS (shell variable) inside configure to the right value (-ldl on Linux) before calling AC_SUBST(LDLIBS). Simplest approach would be to make a simple case statement based on $host or $host_os (set by configure after AC_CANONICAL_HOST). A bit more neat would be to use AC_SEARCH_LIBS([dlopen], [dl] [LDLIBS="-ldl"]), which just checks if -ldl is necessary to use the function dlopen, see http://www.gnu.org/s/hello/manual/autoconf/Libraries.html. Because AC_SEARCH_LIBS actually modifies the value of LIBS, you may actually drop the entire LDADD stuff, or (cleaner) make sure you restore the original LIBS after the AC_SEARCH_LIBS function.
Thank you so much for your help. I will rework my patch and post it here for review as soon as I am done.
Created attachment 284907 [details, diff] chrpath-0.13-libdl-1.patch this patch schould correct the libdl detection on bsd and unix systems. i can't test it but it schould work
Heh, Darwin doesn't need -ldl, it's in libSystem (libc). If you prefer to take the switch statement way, fine with me, the only platforms I know which need -ldl for dlopen are Linux and Solaris, but it may be others as well.
i have taken the ld from this http://svn.cherokee-project.com/filedetails.php?repname=Cherokee&path=%2Fcherokee%2Ftrunk%2Fconfigure.in
how about something like this? % diff -u configure.ac{.orig,} --- configure.ac.orig 2011-08-28 20:28:52.000000000 +0200 +++ configure.ac 2011-08-28 20:31:48.000000000 +0200 @@ -31,6 +31,15 @@ dnl Checks for library functions. AC_CHECK_FUNCS(getopt_long) +dnl See if we need -ldl on this platform for dlopen +LDLIBS= +save_LIBS="$LIBS" +LIBS= +AC_SEARCH_LIBS([dlopen], [dl] [LDLIBS="-ldl"]) +LIBS="${save_LIBS}" +AC_SUBST([LDLIBS]) + + if eval "test x$GCC = xyes"; then for flag in \ -ansi \
(In reply to comment #11) > how about something like this? > its simpler
I am going offline until the 5th of September so give me some more time to create the full patch unless you come up with it on your own :)
If you combine my snippet with Mario's one you've got the full patch, IMO. Should be a 5 minute job. :)
Created attachment 285017 [details, diff] complete patch I tried to merge your patches. I came up with this patch. But it does not seem to work on my box. It fails due to undefined symbols in dlopen,dlsym etc. It is a bit hard for me to work on this issue because I won't have access to my boxes until the 5th and I am trying to fix this bug on my mobile phone :/
ok, can you attach your configure output and config.log, then I'll take it from here.
Created attachment 285019 [details] config.log
Created attachment 285021 [details] build.log
+AC_SEARCH_LIBS([dlopen], [dl] [LDLIBS="-ldl"]) hehe, you forgot the , there, so LDLIBS isn't assigned to :) The check works as expected though.
(ok, I forgot it in my snippet :p)
Ah right. Correct. I will revbump (and remove old ebuild+patch) when I find a decent 3G signal to connect to that box :)
OK this *should* be fixed in -r2. Old ebuild removed. thank you very much for you help.