From: SourceForge.net <no...@so...> - 2012-11-08 13:19:41
|
Bugs item #3397938, was opened at 2011-08-25 03:24 Message generated for change (Settings changed) made by dkf You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110894&aid=3397938&group_id=10894 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. >Category: 40. Dynamic Loading Group: development: 8.6b3 Status: Open Resolution: None Priority: 5 Private: No Submitted By: Ulrich Ring (uring) Assigned to: Jan Nijtmans (nijtmans) Summary: load fails due to RTLD_LOCAL Initial Comment: after switching from tcl8.6b1 to tcl8.6b2 many of our apps are failing at startup when loading extensions, for example: > tclsh8.6 % load ./libfoo.so % load ./libbar.so ...error: symbol lookup error: undefined symbol: ..... this happens, because (a) libbar references a symbol which is defined in libfoo and (b) because dlopen() in tclLoadDl.c passes the flag RTLD_LOCAL (instead of RTLD_GLOBAL). this seems to be a known problem, discussed for example in bug #3216070. I understand the reasons why you came up with this change. But from a rather naive point of view it causes a severe incompatibility, stopping the many apps here which are built upon the above mentioned dependencies. At present I see the following options: (a) hacking tclLoadDl.c back to using RTDL_GLOBAL; not an approach I were happy with. Instead I'd prefer a compile option like -DLOAD_GLOBAL. (b) getting an option "-global" in tcl8.6b3, though this needs changing all "load .. " commands. (c) changing the link of libbar.so introducing an implicit depenency "-lfoo". don't know how portable this advice ist. here (linux, SuSE 11.4, binutils-2.21-13.1.x86_64) it seems to work. What do you suggest to get around this load-failures? ---------------------------------------------------------------------- Comment By: Jan Nijtmans (nijtmans) Date: 2012-11-08 04:19 Message: See: <http://www.tcl.tk/cgi-bin/tct/tip/416> Even though (c) is the recommended - portable - solution (using RTDL_GLOBAL is not portable anyway), I think the TIP explains pretty well when the -global flag could be used and what the danger is. ---------------------------------------------------------------------- Comment By: Jan Nijtmans (nijtmans) Date: 2011-09-21 05:47 Message: > I want to see documents take shape > to help the Tcl user migrating to 8.6 on how > ... Remark: The change regarding RTLD_GLOBAL was done in Tcl 8.5 as well, so it has nothing to do with the migration to 8.6. In my option, it's a build problem, specifying an extra "-l" option should fix it, as option (c) mentioned above. On some platforms (e.g. Windows, AIX) this "-l" option should be there, otherwise the extension does not even compile. most ELF systems are more tolerant. If you want to be totally platform independant, use stubs, but on most modern systems just indicating on the command line which other libraries this library depends on should work just as well. Yes, there should be better documents on this (so keeping this issue open). ---------------------------------------------------------------------- Comment By: Don Porter (dgp) Date: 2011-08-26 08:49 Message: For background on the issues here see Tickets 1961211 and 3216070. Are there others? I'm not well-suited to weigh in on the matter, but from watching the back and forth on it, it looks like a situation where there is no one correct answer to suit everyone. Any choice will leave someone with the need to make adjustments. But don't take my word. Review the history. ---------------------------------------------------------------------- Comment By: Don Porter (dgp) Date: 2011-08-26 08:41 Message: Re-opened. At the least, this points out that I failed to flag this incompatibility in the release notes, and will want to do better on that for 8.6.0. As I mentioned on TCLCORE regarding plans for 8.6b3 and beyond, I want to see documents take shape to help the Tcl user migrating to 8.6 on how they can take advantage of the changes in it. Do we have such guidance for this issue? If so, where is it? ---------------------------------------------------------------------- Comment By: Alexandre Ferrieux (ferrieux) Date: 2011-08-25 08:26 Message: What's the place to look for documentation of such ABI breakage ? ---------------------------------------------------------------------- Comment By: Jan Nijtmans (nijtmans) Date: 2011-08-25 03:54 Message: Well, the Issue tracker is not meant to ask questions, but anyway here is the anwer: (c) is the 'right' solution, and it works on all systems using ELF. If you want to make it portable, use TEA to build your libbar.so, then SHLIB_LD_LIBS is set to ${LIBS} for most systems and empty for systems that don't support it. Hope this helps, Jan Nijtmans ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110894&aid=3397938&group_id=10894 |