source: trunk/src/gcc/boehm-gc/Makefile.direct@ 1124

Last change on this file since 1124 was 2, checked in by bird, 23 years ago

Initial revision

  • Property cvs2svn:cvs-rev set to 1.1
  • Property svn:eol-style set to native
  • Property svn:executable set to *
File size: 29.2 KB
Line 
1# This is the original manually generated Makefile. It may still be used
2# to build the collector.
3#
4# Primary targets:
5# gc.a - builds basic library
6# c++ - adds C++ interface to library
7# cords - adds cords (heavyweight strings) to library
8# test - prints porting information, then builds basic version of gc.a,
9# and runs some tests of collector and cords. Does not add cords or
10# c++ interface to gc.a
11# cord/de - builds dumb editor based on cords.
12ABI_FLAG=
13CC=cc $(ABI_FLAG)
14CXX=g++ $(ABI_FLAG)
15AS=as $(ABI_FLAG)
16# The above doesn't work with gas, which doesn't run cpp.
17# Define AS as `gcc -c -x assembler-with-cpp' instead.
18# Under Irix 6, you will have to specify the ABI (-o32, -n32, or -64)
19# if you use something other than the default ABI on your machine.
20
21# Redefining srcdir allows object code for the nonPCR version of the collector
22# to be generated in different directories.
23srcdir= .
24VPATH= $(srcdir)
25
26CFLAGS= -O -I$(srcdir)/include -DATOMIC_UNCOLLECTABLE -DNO_SIGNALS -DNO_EXECUTE_PERMISSION -DSILENT -DALL_INTERIOR_POINTERS
27
28# To build the parallel collector on Linux, add to the above:
29# -DGC_LINUX_THREADS -DPARALLEL_MARK -DTHREAD_LOCAL_ALLOC
30# To build the parallel collector n a static library on HP/UX, add to the above:
31# -DGC_HPUX_THREADS -DPARALLEL_MARK -DTHREAD_LOCAL_ALLOC -DUSE_HPUX_TLS -D_POSIX_C_SOURCE=199506L
32
33# HOSTCC and HOSTCFLAGS are used to build executables that will be run as
34# part of the build process, i.e. on the build machine. These will usually
35# be the same as CC and CFLAGS, except in a cross-compilation environment.
36# Note that HOSTCFLAGS should include any -D flags that affect thread support.
37HOSTCC=$(CC)
38HOSTCFLAGS=$(CFLAGS)
39
40# For dynamic library builds, it may be necessary to add flags to generate
41# PIC code, e.g. -fPIC on Linux.
42
43# Setjmp_test may yield overly optimistic results when compiled
44# without optimization.
45
46# These define arguments influence the collector configuration:
47# -DSILENT disables statistics printing, and improves performance.
48# -DFIND_LEAK causes GC_find_leak to be initially set.
49# This causes the collector to assume that all inaccessible
50# objects should have been explicitly deallocated, and reports exceptions.
51# Finalization and the test program are not usable in this mode.
52# -DGC_SOLARIS_THREADS enables support for Solaris (thr_) threads.
53# (Clients should also define GC_SOLARIS_THREADS and then include
54# gc.h before performing thr_ or dl* or GC_ operations.)
55# Must also define -D_REENTRANT.
56# -DGC_SOLARIS_PTHREADS enables support for Solaris pthreads.
57# Define SOLARIS_THREADS as well.
58# -DGC_IRIX_THREADS enables support for Irix pthreads. See README.irix.
59# -DGC_HPUX_THREADS enables support for HP/UX 11 pthreads.
60# Also requires -D_REENTRANT or -D_POSIX_C_SOURCE=199506L. See README.hp.
61# -DGC_LINUX_THREADS enables support for Xavier Leroy's Linux threads.
62# see README.linux. -D_REENTRANT may also be required.
63# -DALL_INTERIOR_POINTERS allows all pointers to the interior
64# of objects to be recognized. (See gc_priv.h for consequences.)
65# Alternatively, GC_all_interior_pointers can be set at process
66# initialization time.
67# -DSMALL_CONFIG tries to tune the collector for small heap sizes,
68# usually causing it to use less space in such situations.
69# Incremental collection no longer works in this case.
70# -DLARGE_CONFIG tunes the collector for unusually large heaps.
71# Necessary for heaps larger than about 500 MB on most machines.
72# Recommended for heaps larger than about 64 MB.
73# -DDONT_ADD_BYTE_AT_END is meaningful only with -DALL_INTERIOR_POINTERS or
74# GC_all_interior_pointers = 1. Normally -DALL_INTERIOR_POINTERS
75# causes all objects to be padded so that pointers just past the end of
76# an object can be recognized. This can be expensive. (The padding
77# is normally more than one byte due to alignment constraints.)
78# -DDONT_ADD_BYTE_AT_END disables the padding.
79# -DNO_SIGNALS does not disable signals during critical parts of
80# the GC process. This is no less correct than many malloc
81# implementations, and it sometimes has a significant performance
82# impact. However, it is dangerous for many not-quite-ANSI C
83# programs that call things like printf in asynchronous signal handlers.
84# This is on by default. Turning it off has not been extensively tested with
85# compilers that reorder stores. It should have been.
86# -DNO_EXECUTE_PERMISSION may cause some or all of the heap to not
87# have execute permission, i.e. it may be impossible to execute
88# code from the heap. Currently this only affects the incremental
89# collector on UNIX machines. It may greatly improve its performance,
90# since this may avoid some expensive cache synchronization.
91# -DGC_NO_OPERATOR_NEW_ARRAY declares that the C++ compiler does not support
92# the new syntax "operator new[]" for allocating and deleting arrays.
93# See gc_cpp.h for details. No effect on the C part of the collector.
94# This is defined implicitly in a few environments. Must also be defined
95# by clients that use gc_cpp.h.
96# -DREDIRECT_MALLOC=X causes malloc, realloc, and free to be
97# defined as aliases for X, GC_realloc, and GC_free, respectively.
98# Calloc and strdup are redefined in terms of the new malloc. X should
99# be either GC_malloc or GC_malloc_uncollectable, or
100# GC_debug_malloc_replacement. (The latter invokes GC_debug_malloc
101# with dummy source location information, but still results in
102# properly remembered call stacks on Linux/X86 and Solaris/SPARC.)
103# The former is occasionally useful for working around leaks in code
104# you don't want to (or can't) look at. It may not work for
105# existing code, but it often does. Neither works on all platforms,
106# since some ports use malloc or calloc to obtain system memory.
107# (Probably works for UNIX, and win32.) If you build with DBG_HDRS_ALL,
108# you should only use GC_debug_malloc_replacement as a malloc
109# replacement.
110# -DREDIRECT_REALLOC=X causes GC_realloc to be redirected to X.
111# The canonical use is -DREDIRECT_REALLOC=GC_debug_realloc_replacement,
112# together with -DREDIRECT_MALLOC=GC_debug_malloc_replacement to
113# generate leak reports with call stacks for both malloc and realloc.
114# -DIGNORE_FREE turns calls to free into a noop. Only useful with
115# -DREDIRECT_MALLOC.
116# -DNO_DEBUGGING removes GC_dump and the debugging routines it calls.
117# Reduces code size slightly at the expense of debuggability.
118# -DJAVA_FINALIZATION makes it somewhat safer to finalize objects out of
119# order by specifying a nonstandard finalization mark procedure (see
120# finalize.c). Objects reachable from finalizable objects will be marked
121# in a sepearte postpass, and hence their memory won't be reclaimed.
122# Not recommended unless you are implementing a language that specifies
123# these semantics. Since 5.0, determines only only the initial value
124# of GC_java_finalization variable.
125# -DFINALIZE_ON_DEMAND causes finalizers to be run only in response
126# to explicit GC_invoke_finalizers() calls.
127# In 5.0 this became runtime adjustable, and this only determines the
128# initial value of GC_finalize_on_demand.
129# -DATOMIC_UNCOLLECTABLE includes code for GC_malloc_atomic_uncollectable.
130# This is useful if either the vendor malloc implementation is poor,
131# or if REDIRECT_MALLOC is used.
132# -DHBLKSIZE=ddd, where ddd is a power of 2 between 512 and 16384, explicitly
133# sets the heap block size. Each heap block is devoted to a single size and
134# kind of object. For the incremental collector it makes sense to match
135# the most likely page size. Otherwise large values result in more
136# fragmentation, but generally better performance for large heaps.
137# -DUSE_MMAP use MMAP instead of sbrk to get new memory.
138# Works for Solaris and Irix.
139# -DUSE_MUNMAP causes memory to be returned to the OS under the right
140# circumstances. This currently disables VM-based incremental collection.
141# This is currently experimental, and works only under some Unix,
142# Linux and Windows versions.
143# -DMMAP_STACKS (for Solaris threads) Use mmap from /dev/zero rather than
144# GC_scratch_alloc() to get stack memory.
145# -DPRINT_BLACK_LIST Whenever a black list entry is added, i.e. whenever
146# the garbage collector detects a value that looks almost, but not quite,
147# like a pointer, print both the address containing the value, and the
148# value of the near-bogus-pointer. Can be used to identifiy regions of
149# memory that are likely to contribute misidentified pointers.
150# -DKEEP_BACK_PTRS Add code to save back pointers in debugging headers
151# for objects allocated with the debugging allocator. If all objects
152# through GC_MALLOC with GC_DEBUG defined, this allows the client
153# to determine how particular or randomly chosen objects are reachable
154# for debugging/profiling purposes. The gc_backptr.h interface is
155# implemented only if this is defined.
156# -DGC_ASSERTIONS Enable some internal GC assertion checking. Currently
157# this facility is only used in a few places. It is intended primarily
158# for debugging of the garbage collector itself, but could also
159# -DDBG_HDRS_ALL Make sure that all objects have debug headers. Increases
160# the reliability (from 99.9999% to 100%) of some of the debugging
161# code (especially KEEP_BACK_PTRS). Makes -DSHORT_DBG_HDRS possible.
162# Assumes that all client allocation is done through debugging
163# allocators.
164# -DSHORT_DBG_HDRS Assume that all objects have debug headers. Shorten
165# the headers to minimize object size, at the expense of checking for
166# writes past the end of an object. This is intended for environments
167# in which most client code is written in a "safe" language, such as
168# Scheme or Java. Assumes that all client allocation is done using
169# the GC_debug_ functions, or through the macros that expand to these,
170# or by redirecting malloc to GC_debug_malloc_replacement.
171# (Also eliminates the field for the requested object size.)
172# occasionally be useful for debugging of client code. Slows down the
173# collector somewhat, but not drastically.
174# -DSAVE_CALL_COUNT=<n> Set the number of call frames saved with objects
175# allocated through the debugging interface. Affects the amount of
176# information generated in leak reports. Only matters on platforms
177# on which we can quickly generate call stacks, currently Linux/(X86 & SPARC)
178# and Solaris/SPARC and platforms that provide execinfo.h.
179# Default is zero. On X86, client
180# code should NOT be compiled with -fomit-frame-pointer.
181# -DSAVE_CALL_NARGS=<n> Set the number of functions arguments to be
182# saved with each call frame. Default is zero. Ignored if we
183# don't know how to retrieve arguments on the platform.
184# -DCHECKSUMS reports on erroneously clear dirty bits, and unexpectedly
185# altered stubborn objects, at substantial performance cost.
186# Use only for debugging of the incremental collector.
187# -DGC_GCJ_SUPPORT includes support for gcj (and possibly other systems
188# that include a pointer to a type descriptor in each allocated object).
189# Building this way requires an ANSI C compiler.
190# -DUSE_I686_PREFETCH causes the collector to issue Pentium III style
191# prefetch instructions. No effect except on X86 Linux platforms.
192# Assumes a very recent gcc-compatible compiler and assembler.
193# (Gas prefetcht0 support was added around May 1999.)
194# Empirically the code appears to still run correctly on Pentium II
195# processors, though with no performance benefit. May not run on other
196# X86 processors? In some cases this improves performance by
197# 15% or so.