path: root/booster/src/
diff options
authorShehjar Tikoo <>2009-06-29 09:38:29 +0000
committerAnand V. Avati <>2009-06-29 10:51:16 -0700
commita3ece0caa52ad2eacf8a8691aaca53295cde972f (patch)
tree8bcb7740cc75f36fb499ac1febb3cfa8e2f1c817 /booster/src/
parent304e4274ca9b0339539581c5413e3339078c1182 (diff)
booster: Fix build problems with various libtool versions
We've been facing a problem on some test systems where the is built by libtool as an executable rather than a dynamically loadable library. This problem is probably caused by it seeing a _init function in the source. This is the name of the libc initiliazation function so it could be the source of the problem. In any case, ld-preloadable libraries must not have a function called _init, instead they need to have __attribute ((constructor)) as the attribute for any and all functions the library wants executed before the program's main(). Our earlier approach was inherently problematic. This commit also cleans up the booster Makefile for better build behaviour. Credit: Harsha. Signed-off-by: Anand V. Avati <>
Diffstat (limited to 'booster/src/')
1 files changed, 14 insertions, 11 deletions
diff --git a/booster/src/ b/booster/src/
index a5158591..6402c8d7 100644
--- a/booster/src/
+++ b/booster/src/
@@ -1,18 +1,21 @@
-xlatordir = $(libdir)/glusterfs/$(PACKAGE_VERSION)/xlator/performance
-ldpreload_PROGRAMS =
+ldpreload_LTLIBRARIES =
ldpreloaddir = $(libdir)/glusterfs/
noinst_HEADERS = booster_fstab.h booster-fd.h
-glusterfs_booster_so_SOURCES = booster.c booster_stat.c booster_fstab.c booster-fd.c
-glusterfs_booster_so_CFLAGS = -I$(top_srcdir)/libglusterfsclient/src/ -D_GNU_SOURCE -D$(GF_HOST_OS) -fPIC -Wall \
- -pthread $(GF_BOOSTER_CFLAGS)
-glusterfs_booster_so_CPPFLAGS = -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE \
+libglusterfs_booster_la_SOURCES = booster.c booster_stat.c booster_fstab.c booster-fd.c
+libglusterfs_booster_la_CFLAGS = -I$(top_srcdir)/libglusterfsclient/src/ -D_GNU_SOURCE -D$(GF_HOST_OS) -fPIC -Wall \
+ -pthread $(GF_BOOSTER_CFLAGS) -shared -nostartfiles
+libglusterfs_booster_la_CPPFLAGS = -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE \
-I$(top_srcdir)/libglusterfsclient/src \
-I$(top_srcdir)/libglusterfs/src -DDATADIR=\"$(localstatedir)\" \
-glusterfs_booster_so_LDFLAGS = -shared -nostartfiles
-glusterfs_booster_so_LDADD = -L$(top_builddir)/libglusterfs/src -lglusterfs \
- -L$(top_builddir)/libglusterfsclient/src -lglusterfsclient
+libglusterfs_booster_la_LDFLAGS = -module -avoidversion
+libglusterfs_booster_la_LIBADD = $(top_builddir)/libglusterfs/src/ $(top_builddir)/libglusterfsclient/src/
+ rm -f $(DESTDIR)$(ldpreloaddir)/
+ ln -sf $(DESTDIR)$(ldpreloaddir)/