pastebin - collaborative debugging tool
rovema.kpaste.net RSS

Difference between
modified post a0452 by Anonymous on Mon 10th Jul 2023 15:22
original post 9fe by Anonymous on Mon 1st Aug 2022 16:32
Download diff
Show old version | new version | both versions

    
1-
--- /dev/null	2022-07-25 11:42:10.933510077 +0200
1+
+ for i in pthread_mutex_attr_util/*
2-
+++ pthread_interceptor/Makefile	2022-08-01 15:09:58.790413283 +0200
2+
+ diff -u /dev/null pthread_mutex_attr_util/Makefile
3-
@@ -0,0 +1,53 @@
3+
--- /dev/null	2023-07-10 02:44:06.720465928 +0200
4+
+++ pthread_mutex_attr_util/Makefile	2023-07-10 16:10:28.308408997 +0200
46
+#
5-
+# Makefile for LD_PRELOAD pthreadinterceptor
7+
+# Makefile for LD_PRELOAD pthread_mutex_attr_util
68
+#
9+
+# Written by Roland Mainz <roland.mainz@nrubsig.org>
810
+#
11+
+
914
+# ToDo:
1015
+# - cleanup (this Makefile is horrible and should actually use macros)
1116
+# - build 32bit and 64bit at the same time
1217
+#
1318
+
19+
+SHELL=/bin/ksh93
1421
+CSTDFLAGS=-std=c17
1522
+CARCHFLAGS=-m32 # -m32 or -m64
1623
+CC=gcc # gcc or clang
1724
+
1825
+#
1926
+# misc
2027
+#
21-
+all:	run_test pthr_inter_binaries.tar.bz2
28+
+all:	tests pthread_mutex_attr_util_binaries.tar.bz2
2229
+
2330
+clean:
24-
+	rm -f *.o *.so test1 pthr_inter_binaries.tar.bz2
31+
+	rm -f \
32+
+		*.o \
2537
+
2638
+#
27-
+# build LD_PRELOAD function interceptor
39+
+# build shared library object for LD_PRELOAD
2840
+#
29-
+pthread_interceptor.o: pthread_interceptor.c
41+
+pthread_mutex_attr_util.o: pthread_mutex_attr_util.c
30-
+	$(CC) $(CSTDFLAGS) $(CARCHFLAGS) -Wall -g pthread_interceptor.c -fPIC -rdynamic -c -o pthread_interceptor.o
42+
+	$(CC) $(CSTDFLAGS) $(CARCHFLAGS) -Wall -g pthread_mutex_attr_util.c -fPIC -rdynamic -c -o pthread_mutex_attr_util.o
31-
+pthread_interceptor.so: pthread_interceptor.o
43+
+pthread_mutex_attr_util.so: pthread_mutex_attr_util.o
32-
+	$(CC) $(CSTDFLAGS) $(CARCHFLAGS) -Wall -g pthread_interceptor.o -fPIC -rdynamic -shared -ldl -lpthread -o pthread_interceptor.so
44+
+	$(CC) $(CSTDFLAGS) $(CARCHFLAGS) -Wall -g pthread_mutex_attr_util.o -fPIC -rdynamic -shared -ldl -lpthread -o pthread_mutex_attr_util.so
3345
+
3446
+#
47+
+# compile wrapper script
3648
+#
49+
+pthread_mutex_attr_util_wrapper: pthread_mutex_attr_util_wrapper.ksh
3752
+
38-
+# -rdynamic is required so that we get accurate function names
53+
+#
39-
+# from |backtrace()|&co
54+
+# tests
55+
+#
4256
+
43-
+run_test: test1 pthread_interceptor.so pthread_interceptor_wrapper.ksh
57+
+# -rdynamic is required for gcc so that we get accurate function
58+
+# names from |backtrace()|&co
4463
+	@printf "# Begin tests.\n"
45-
+	ksh93 pthread_interceptor_wrapper.ksh ./test1
64+
+	./pthread_mutex_attr_util_wrapper ./test1
4665
+	@printf "# End tests.\n"
4766
+
4867
+#
4968
+# package binaries
5069
+#
51-
+pthr_inter_binaries.tar.bz2: pthread_interceptor.so pthread_interceptor_wrapper.ksh
70+
+pthread_mutex_attr_util_binaries.tar.bz2: \
52-
+	tar -cvf - pthread_interceptor.so pthread_interceptor_wrapper.ksh | \
71+
+	pthread_mutex_attr_util.so \
53-
+		bzip2 -9 >"pthr_inter_binaries.tar.bz2"
72+
+	pthread_mutex_attr_util_wrapper \
73+
+	pthread_mutex_attr_util_wrapper.ksh \
5480
+
81+
+# EOF.

Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.

Syntax highlighting:

To highlight particular lines, prefix each line with {%HIGHLIGHT}




All content is user-submitted.
The administrators of this site (kpaste.net) are not responsible for their content.
Abuse reports should be emailed to us at