Skip to contentSkip to conversation

cclass: fix .so loading file

PATCH New Christian Brunner 1 participant 1 message Aug 2, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cclass: fix .so loading file

Quoted 22 lines · Sage Weil
Quoted 4 lines · Christian Brunner

Hi,

in the following I'll send a few fixes and additions for the rpm spec file. Please commit the patches that you like to the repository.

Thanks, committing now.

There's one other pitfall I ran into with the debs... by default symbols are stripped from all binaries, but the libcls_rbd.so shared object needs to _not_ be stripped, or else the class loading doesn't work. I have no idea where/when/if this is done during the rpmbuild. The version in the built package should look like so:

$ nm .libs/libcls_rbd.so
000000000000797d T __cls_init
000000000020ce50 D __cls_name
000000000020ce7c B __cls_name__rbd
000000000020ce78 B __cls_ver__1_1
000000000020ce48 D __cls_ver_maj
000000000020ce4c D __cls_ver_min
Quoted 2 lines

Thanks-
sage

Hi Sage,

shared objects are not stript on our system. So I can't reproduce this.

The only thing I've found, is that the *.so files are included in the -devel rpm. This leads to the fact that the 'find' in cclass doesn't return any files. I'd suggest the attached change in the script.

Christian

---
 src/cclass.in |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
src/cclass.in +1 -1
index 69513fa..1a2a807 100755
@@ -85,7 +85,7 @@ load() {
 }
 
 load_all() {
-	all=`find $libdir -name 'libcls_*.so'`;
+	all=`find $libdir -name 'libcls_*.so*' -type f`;
 	if [ -n "$all" ]; then
 		for fn in $all; do
 			echo Loading class: $fn: `$BINDIR/cclsinfo $fn`
Signature · 1 line
1.7.0.4