@@ -44,23 +44,34 @@ ifeq ($(OS),FreeBSD)
4444FLAGS += -I$(LOCALBASE ) /include
4545endif
4646
47+ # GC source code. It depends on which GC implementation to use.
48+ GC_SRCS := gc-common gc-stacks gc-alloc-profiler gc-heap-snapshot
49+ ifeq ($(WITH_MMTK ) , 1)
50+ GC_SRCS += gc-mmtk
51+ else
52+ GC_SRCS += gc-stock gc-debug gc-pages gc-page-profiler
53+ endif
54+
4755SRCS := \
4856 jltypes gf typemap smallintset ast builtins module interpreter symbol \
4957 dlload sys init task array genericmemory staticdata toplevel jl_uv datatype \
5058 simplevector runtime_intrinsics precompile jloptions mtarraylist \
51- threading scheduler stackwalk gc-common gc-stock gc-mmtk gc-debug gc-pages gc-stacks gc-alloc-profiler gc-page-profiler \
52- method jlapi signal-handling safepoint timing subtype rtutils gc-heap-snapshot \
53- crc32c APInt-C processor ircode opaque_closure codegen-stubs coverage runtime_ccall engine
59+ threading scheduler stackwalk \
60+ method jlapi signal-handling safepoint timing subtype rtutils \
61+ crc32c APInt-C processor ircode opaque_closure codegen-stubs coverage runtime_ccall engine \
62+ $(GC_SRCS )
5463
5564RT_LLVMLINK :=
5665CG_LLVMLINK :=
5766
5867ifeq ($(JULIACODEGEN ) ,LLVM)
68+ GC_CODEGEN_SRCS := llvm-final-gc-lowering llvm-late-gc-lowering llvm-gc-invariant-verifier
5969CODEGEN_SRCS := codegen jitlayers aotcompile debuginfo disasm llvm-simdloop \
60- llvm-final-gc-lowering llvm- pass-helpers llvm-late-gc-lowering llvm-ptls \
61- llvm-lower-handlers llvm-gc-invariant-verifier llvm- propagate-addrspaces \
70+ llvm-pass-helpers llvm-ptls \
71+ llvm-lower-handlers llvm-propagate-addrspaces \
6272 llvm-multiversioning llvm-alloc-opt llvm-alloc-helpers cgmemmgr llvm-remove-addrspaces \
63- llvm-remove-ni llvm-julia-licm llvm-demote-float16 llvm-cpufeatures pipeline llvm_api
73+ llvm-remove-ni llvm-julia-licm llvm-demote-float16 llvm-cpufeatures pipeline llvm_api \
74+ $(GC_CODEGEN_SRCS )
6475FLAGS += -I$(shell $(LLVM_CONFIG_HOST ) --includedir)
6576CG_LLVM_LIBS := all
6677ifeq ($(USE_POLLY ) ,1)
@@ -107,7 +118,12 @@ ifeq ($(USE_SYSTEM_LIBUV),0)
107118UV_HEADERS += uv.h
108119UV_HEADERS += uv/*.h
109120endif
110- PUBLIC_HEADERS := $(BUILDDIR ) /julia_version.h $(wildcard $(SRCDIR ) /support/* .h) $(addprefix $(SRCDIR ) /,work-stealing-queue.h gc-interface.h gc-tls.h gc-tls-common.h gc-tls-mmtk.h julia.h julia_assert.h julia_threads.h julia_fasttls.h julia_locks.h julia_atomics.h jloptions.h)
121+ PUBLIC_HEADERS := $(BUILDDIR ) /julia_version.h $(wildcard $(SRCDIR ) /support/* .h) $(addprefix $(SRCDIR ) /,work-stealing-queue.h gc-interface.h gc-tls-common.h julia.h julia_assert.h julia_threads.h julia_fasttls.h julia_locks.h julia_atomics.h jloptions.h)
122+ ifeq ($(WITH_MMTK ) , 1)
123+ PUBLIC_HEADERS += $(addprefix $(SRCDIR)/,gc-tls-mmtk.h)
124+ else
125+ PUBLIC_HEADERS += $(addprefix $(SRCDIR)/,gc-tls-stock.h)
126+ endif
111127ifeq ($(OS ) ,WINNT)
112128PUBLIC_HEADERS += $(addprefix $(SRCDIR ) /,win32_ucontext.h)
113129endif
0 commit comments