From: <se...@in...> - 2004-07-14 18:39:19
|
On Wed, 2004-07-14 at 11:16, Grzegorz Jakacki wrote: > Grigorenko Dmitriy wrote: > > Hello > > > > I checked which library is used by occ. > > > > H:\cygwin\home\Dima\opencxx-2.7\src>cygcheck occ > > Found: .\occ.exe > > occ.exe > > h:\cygwin\bin\cygltdl-3.dll > > h:\cygwin\bin\cygwin1.dll > > H:\WINDOWS\System32\ADVAPI32.DLL > > H:\WINDOWS\System32\ntdll.dll > > H:\WINDOWS\System32\KERNEL32.dll > > H:\WINDOWS\System32\RPCRT4.dll > > > > Yes, this is exactly the information that was needed. > > As you see when occ.exe is loaded the dynamic linker will pick the > global cygltdl.dll; > > > It couses sigsegv when cygltdl-3.dll builds from opencxx/libltdl. > > In case of native cygltdl-3.dll using it`s ok. > > I suppose that the version of ltdl in opencxx/libltdl is different > from your system-wide version. The problem is that ld sets function > offsets in occ.exe according to the layout of opencxx/cygltdl-3.dll, > but at load-time /cygwin/bin/cygltdl-3.dll is linked dynamically > and there is a mismatch between offsets and entries > in /cygwin/bin/cygltdl-3.dll I suspect two problems - When libtool package is install, the make tool must not compile anything in the libltdl subdirectory. Even less, link to produce a static and/or shared libraries. a) Usely two packages are provided, that is libtool-lib and libtool. libtool-lib package provides cygltdl-3.dll, that is for user libtool provide the Software Development Kit, that is for developer. b) the subdirectory libltdl in cvs is not for cygwin. neither the bootstrap script enough powerfull to detect your platform. Present alternative is to - delete the libltdl subdirectory - in top_srcdir execute foolwing equivalent cli command, $ libtoolize --automake --copy --ltdl What is desired, option --ltdl ask to copy your platform ltdl.h and ltdl.c in libltdl subdirectory. c) step b) is *not* supposed to be required. but may be require to do test or check. We have hardwire dependency in the Makefile. Solution, removed them diff -u -r1.7.2.1 Makefile.am --- opencxx/Makefile.am 11 Jul 2004 02:07:32 -0000 1.7.2.1 +++ opencxx/Makefile.am 12 Jul 2004 19:28:08 -0000 @@ -44,13 +44,13 @@ occ_SOURCES = MetaclassPreregistration.cc occ_LDADD = libocc.la occ_LDFLAGS = -export-dynamic -INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/libltdl +INCLUDES = -I$(top_srcdir) $(INCLTDL) lib_LTLIBRARIES = libocc.la libocc_la_SOURCES = empty_libocc.cc libocc_la_LIBADD = \ opencxx/libocc_mop.la \ - libltdl/libltdl.la \ + $(LIBLTDL) \ $(libgc) include_HEADERS = mop.h diff -u -r1.2.2.2 Makefile.am --- opencxx/opencxx/Makefile.am 11 Jul 2004 02:07:32 -0000 1.2.2.2 +++ opencxx/opencxx/Makefile.am 12 Jul 2004 19:34:12 -0000 @@ -119,7 +119,7 @@ EXTRA_DIST = \ parser/ptree-gen.in -INCLUDES = -I$(builddir) -I$(top_srcdir) -I$(top_srcdir)/libltdl +INCLUDES = -I$(builddir) -I$(top_srcdir) $(INCLTDL) lib_LTLIBRARIES = \ libocc_mop.la \ @@ -227,7 +227,7 @@ parser_test_LDADD = \ libparser-test.la \ libocc_parser.la \ - ../libltdl/libltdl.la + $(LIBLTDL) ################################################################### > > Why does it make libltdl instead of using the native one? see above > I had problems on Compile Farm --- the version of libtool installed > there system-wide was too old and crashed with libgc. So I decided > to force occ to use the libltdl bundled with OpenC++. solutions, link static library libltdl.a > > How can it be fixed? ./configure --with-ltdl=/my/path/libltdl we need to verified that your build does it correctly. > (1) On Linux you can tell the dynamic linker where to look for > shared libraries by setting the environment variable LD_LIBRARY_PATH. > There must be a way to tell this to cygwin dynamic linker also. > This will instruct dynamic linker to pick > opencxx/libltdl/cygltdl-3.dll, not the system-wide one. this presuppose that both libraries even if not at the same location are in fact identical. You must prove me, that they are(see above libtoolize -ltdl option). > (2) Another solution would be to make OpenC++ by default use > system-wide cygltdl.dll on Cygwin, as anyway there is no Cygwin on > Compile Farm. This requires modifying configure.in/Makefile.am, so > that it does not use libltdl if it is installed. The key point that > needs to be changed is --enable-ltdl-install in Makefile.am, > because it forces installation of libltdl.so/cygltdl-3.dll This does not resolve the Compile farm problem, because you must not be authorized to replace system library. > even if it is already present. Means, the Compile Farm must ensure equivalence to OCC=LD_PRELOAD=/my/path/libldlt.so.3 /my/path/occ > (3) Ultimate solution, which I think is the way to go in the long > term, would be to > > - remove libltdl from OpenC++ at all we keep it, it is our development reference. Others mechanisms provided way around this. > - add --with-libltdl=DIR to ./configure > > Then OpenC++ will use system-wide libltdl by default. Verified that libltdl provide a known working library. if not, two choice used static or ensure that the ld utility know how to find the shared library. That is, - add LIBDIR to the `LD_LIBRARY_PATH' environment variable during execution - add LIBDIR to the `LD_RUN_PATH' environment variable during linking - use the `-Wl,--rpath -Wl,LIBDIR' linker flag - have your system administrator add LIBDIR to `/etc/ld.so.conf' - LD_PRELOAD mechanism. where LIBDIR=/my/path/opencxx/libtool/.libs/libltdl.so > On Compile Farm the tests build would be configured with > > ./configure --with-libltdl=PATH_TO_RECENT_VERSION_OF_LIBLTDL. > > If you could help with implementing (2) or (3), please do. |