summaryrefslogtreecommitdiffstats
path: root/extras/test/ld-preload-test/Makefile
diff options
context:
space:
mode:
authorShehjar Tikoo <shehjart@gluster.com>2009-09-15 01:03:56 +0000
committerAnand V. Avati <avati@dev.gluster.com>2009-09-15 00:01:50 -0700
commita5f0b3d7d1b23053ce9327be91323e92ce554b32 (patch)
treed9aee1e46b23b3b40c26c8da1501fe2d3ac9e5cf /extras/test/ld-preload-test/Makefile
parentad33df39dec4850c249c453822a99b3038b41389 (diff)
extras: Add LD_PRELOAD test tool
This tool allows us to check the sanity of the LD_PRELOAD mechanism so that we can be sure that an application's syscalls will be redirected into booster when that library is LD_PRELOADed. In case of failed syscalls, this tool should be run first to see if the calls are redirected as required. Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 251 (Improve booster debugging through ld-preload testing tool) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=251
Diffstat (limited to 'extras/test/ld-preload-test/Makefile')
-rw-r--r--extras/test/ld-preload-test/Makefile28
1 files changed, 28 insertions, 0 deletions
diff --git a/extras/test/ld-preload-test/Makefile b/extras/test/ld-preload-test/Makefile
new file mode 100644
index 00000000000..97aa016518d
--- /dev/null
+++ b/extras/test/ld-preload-test/Makefile
@@ -0,0 +1,28 @@
+TOOL_CFLAGS32=-g -O0 -Wall
+TOOL_CFLAGS64=-g -O0 -D_GNU_SOURCE -Wall -D_FILE_OFFSET_BITS=64
+LIB_CFLAGS=-g -O0 -fPIC -Wall -shared -ldl
+%LIB_CFLAGS=-g -O0 -D_GNU_SOURCE -fPIC -Wall -shared -D_FILE_OFFSET_BITS=64 -ldl
+
+all: ld-preload-test32 ld-preload-test64 ld-preload-lib
+
+
+copy32:
+ cp ld-preload-test.c test32.c
+
+ld-preload-test32: copy32
+ gcc ${TOOL_CFLAGS32} test32.c -o ld-preload-test32
+ rm -f test32.c
+
+copy64:
+ cp ld-preload-test.c test64.c
+
+ld-preload-test64: copy64
+ gcc ${TOOL_CFLAGS64} test64.c -o ld-preload-test64
+ rm -f test64.c
+
+ld-preload-lib: ld-preload-lib.c
+ gcc ${LIB_CFLAGS} ld-preload-lib.c -o ld-preload-lib.so
+
+clean:
+ rm -f ld-preload-test32 ld-preload-test64 ld-preload-lib.so
+