Overview
Features
Download
Documentation
Community
Add-Ons & Services

Bugs in SharedLibraryTest and build-system

General discussion regarding the development of POCO for contributors.

Bugs in SharedLibraryTest and build-system

Postby devzero » 21 Aug 2009, 19:21

Hi there

The SharedLibraryTest (and the ClassLoaderTest) failed here because dlopen couldn't find the library.
A short test showed that at least a relative path is needed instead of just the filename. So, changing "TestLibrary" to "./TestLibrary" made the test work.
Furthermore it would probably be a good idea (although I didn't test whether this is necessary for the test to succeed) to inject the rpath to the current $(POCO_BASE)/$(LIBDIR) for the test-library. Otherwise the linker will try to open libPocoFoundation from the standard search paths and may (or may not fail) if there is no poco (or an older poco) installed there:

diff -Naur poco-1.3.6_pre20090723-all.orig/Foundation/testsuite/Makefile-TestLibrary poco-1.3.6_pre20090723-all/Foundation/testsuite/Makefile-TestLibrary
--- poco-1.3.6_pre20090723-all.orig/Foundation/testsuite/Makefile-TestLibrary 2009-08-21 09:09:57.955862554 +0200
+++ poco-1.3.6_pre20090723-all/Foundation/testsuite/Makefile-TestLibrary 2009-08-21 18:35:02.802730295 +0200
@@ -14,4 +14,8 @@
target_version = 1
target_libs = PocoFoundation

+# inject the rpath otherwise the TestLibrary searches for the PocoFoundation
+# library in the systems LDPATH (thus loading the lib fails if poco isn't already installed)
+SHLIBFLAGS += -Wl,-rpath,$(LIBPATH)
+
include $(POCO_BASE)/build/rules/dylib

There is also a small bug in the build system caused by not consequently use the LIBDIR var in the main Makefile:
diff -Naur poco-1.3.6_pre20090723-all.orig/Makefile poco-1.3.6_pre20090723-all/Makefile
--- poco-1.3.6_pre20090723-all.orig/Makefile 2009-08-21 09:09:58.035878030 +0200
+++ poco-1.3.6_pre20090723-all/Makefile 2009-08-21 18:35:02.802730295 +0200
@@ -31,7 +31,7 @@

install: libexecs
mkdir -p $(INSTALLDIR)/include/Poco
- mkdir -p $(INSTALLDIR)/lib
+ mkdir -p $(INSTALLDIR)/$(LIBDIR)
mkdir -p $(INSTALLDIR)/bin
for comp in $(COMPONENTS) ; do \
if [ -d "$(POCO_BASE)/$$comp/include" ] ; then \
@@ -41,11 +41,11 @@
find $(POCO_BUILD)/$$comp/bin -perm -700 -type f -exec cp -f {} $(INSTALLDIR)/bin \; ; \
fi ; \
done
- find $(POCO_BUILD)/lib -name "libPoco*" -type f -exec cp -f {} $(INSTALLDIR)/lib \;
- find $(POCO_BUILD)/lib -name "libPoco*" -type l -exec cp -Rf {} $(INSTALLDIR)/lib \;
+ find $(POCO_BUILD)/$(LIBDIR) -name "libPoco*" -type f -exec cp -f {} $(INSTALLDIR)/$(LIBDIR) \;
+ find $(POCO_BUILD)/$(LIBDIR) -name "libPoco*" -type l -exec cp -Rf {} $(INSTALLDIR)/$(LIBDIR) \;



Cheers,
Tiziano
devzero
 
Posts: 2
Joined: 21 Aug 2009, 18:57

Re: Bugs in SharedLibraryTest and build-system

Postby alex » 21 Aug 2009, 22:05

Created SF patch
alex
 
Posts: 1142
Joined: 11 Jul 2006, 16:27
Location: United_States


Return to Contributors

Who is online

Users browsing this forum: No registered users and 1 guest

cron