summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2011-07-26 20:24:04 +0400
committerIvan Maidanski <ivmai@mail.ru>2011-07-26 20:24:04 +0400
commit483278295142421b2f8794e3c900ac2490439450 (patch)
tree869c3a5bf0c064e5ba53ea136b0eae48d4b536ef /Makefile
parent64040040407b11d8740516fad2438109e7f22c02 (diff)
downloadbdwgc-483278295142421b2f8794e3c900ac2490439450.tar.gz
gc7.0alpha3 tarball importgc7_0alpha3
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile17
1 files changed, 14 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index faa9008f..bbc57b0d 100644
--- a/Makefile
+++ b/Makefile
@@ -40,6 +40,8 @@ CFLAGS= -O -I$(srcdir)/include -I$(AO_INSTALL_DIR)/include -DATOMIC_UNCOLLECTABL
# To build the parallel collector on Linux, add to the above:
# -DGC_LINUX_THREADS -DPARALLEL_MARK -DTHREAD_LOCAL_ALLOC
+# To build the thread-capable preload library that intercepts
+# malloc, add -DGC_USE_DLOPEN_WRAP -DREDIRECT_MALLOC=GC_malloc -fpic
# To build the parallel collector in a static library on HP/UX,
# add to the above:
# -DGC_HPUX_THREADS -DTHREAD_LOCAL_ALLOC -D_POSIX_C_SOURCE=199506L -mt
@@ -237,6 +239,10 @@ HOSTCFLAGS=$(CFLAGS)
# causes the collector some system and pthread calls in a more transparent
# fashion than the usual macro-based approach. Requires GNU ld, and
# currently probably works only with Linux.
+# -DGC_USE_DLOPEN_WRAP causes the collector to redefine malloc and intercepted
+# pthread routines with their real names, and causes it to use dlopen
+# and dlsym to refer to the original versions. This makes it possible to
+# build an LD_PRELOADable malloc replacement library.
# -DTHREAD_LOCAL_ALLOC defines GC_malloc(), GC_malloc_atomic()
# and GC_gcj_malloc() to use a per-thread set of free-lists.
# These then allocate in a way that usually does not involve
@@ -340,10 +346,10 @@ TESTS= tests/test.c tests/test_cpp.cc tests/trace_test.c \
GNU_BUILD_FILES= configure.ac Makefile.am configure acinclude.m4 \
libtool.m4 install-sh configure.host Makefile.in \
aclocal.m4 config.sub config.guess \
- include/Makefile.am include/Makefile.in \
- doc/Makefile.am doc/Makefile.in \
+ include/include.am include/Makefile.in \
+ doc/doc.am doc/Makefile.in \
ltmain.sh mkinstalldirs depcomp missing \
- cord/Makefile.am tests/Makefile.am
+ cord/cord.am tests/tests.am
OTHER_MAKEFILES= OS2_MAKEFILE NT_MAKEFILE NT_THREADS_MAKEFILE gc.mak \
BCC_MAKEFILE EMX_MAKEFILE WCC_MAKEFILE Makefile.dj \
@@ -505,6 +511,11 @@ liblinuxgc.so: $(OBJS) dyn_load.o
gcc -shared -o liblinuxgc.so $(OBJS) dyn_load.o
ln liblinuxgc.so libgc.so
+# Build gctest with dynamic library
+dyn_test:
+ $(CC) $(CFLAGS) -o gctest tests/test.c libgc.so `./threadlibs`
+ ./gctest
+
# Alternative Linux rule. This is preferable, but is likely to break the
# Makefile for some non-linux platforms.
# LIBOBJS= $(patsubst %.o, %.lo, $(OBJS))