@@ -29,6 +29,10 @@ ifeq ($(USECLANG),1)
29
29
FLAGS += -Wno-return-type-c-linkage -Wno-atomic-alignment
30
30
endif
31
31
32
+ ifneq (${MMTK_PLAN},None)
33
+ FLAGS += -I$(MMTK_API_INC )
34
+ endif
35
+
32
36
FLAGS += -DJL_BUILD_ARCH='"$(ARCH ) "'
33
37
ifeq ($(OS ) ,WINNT)
34
38
FLAGS += -DJL_BUILD_UNAME='"NT"'
@@ -40,23 +44,41 @@ ifeq ($(OS),FreeBSD)
40
44
FLAGS += -I$(LOCALBASE ) /include
41
45
endif
42
46
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
+ ifneq (${MMTK_PLAN},None)
50
+ GC_SRCS += gc-mmtk
51
+ else
52
+ GC_SRCS += gc-stock gc-debug gc-pages gc-page-profiler
53
+ endif
54
+
43
55
SRCS := \
44
56
jltypes gf typemap smallintset ast builtins module interpreter symbol \
45
57
dlload sys init task array genericmemory staticdata toplevel jl_uv datatype \
46
58
simplevector runtime_intrinsics precompile jloptions mtarraylist \
47
- threading scheduler stackwalk gc-common gc-stock gc-debug gc-pages gc-stacks gc-alloc-profiler gc-page-profiler method \
48
- jlapi signal-handling safepoint timing subtype rtutils gc-heap-snapshot \
49
- 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 )
50
63
51
64
RT_LLVMLINK :=
52
65
CG_LLVMLINK :=
53
66
54
67
ifeq ($(JULIACODEGEN ) ,LLVM)
68
+ # Currently these files are used by both GCs. But we should make the list specific to stock, and MMTk should have its own implementation.
69
+ GC_CODEGEN_SRCS := llvm-final-gc-lowering llvm-late-gc-lowering llvm-gc-invariant-verifier
70
+ ifneq (${MMTK_PLAN},None)
71
+ FLAGS += -I$(MMTK_API_INC )
72
+ GC_CODEGEN_SRCS += llvm-late-gc-lowering-mmtk
73
+ else
74
+ GC_CODEGEN_SRCS += llvm-late-gc-lowering-stock
75
+ endif
55
76
CODEGEN_SRCS := codegen jitlayers aotcompile debuginfo disasm llvm-simdloop \
56
- llvm-final-gc-lowering llvm- pass-helpers llvm-late-gc-lowering llvm-ptls \
57
- llvm-lower-handlers llvm-gc-invariant-verifier llvm- propagate-addrspaces \
77
+ llvm-pass-helpers llvm-ptls \
78
+ llvm-lower-handlers llvm-propagate-addrspaces \
58
79
llvm-multiversioning llvm-alloc-opt llvm-alloc-helpers cgmemmgr llvm-remove-addrspaces \
59
- llvm-remove-ni llvm-julia-licm llvm-demote-float16 llvm-cpufeatures pipeline llvm_api
80
+ llvm-remove-ni llvm-julia-licm llvm-demote-float16 llvm-cpufeatures pipeline llvm_api \
81
+ $(GC_CODEGEN_SRCS )
60
82
FLAGS += -I$(shell $(LLVM_CONFIG_HOST ) --includedir)
61
83
CG_LLVM_LIBS := all
62
84
ifeq ($(USE_POLLY ) ,1)
@@ -99,7 +121,12 @@ ifeq ($(USE_SYSTEM_LIBUV),0)
99
121
UV_HEADERS += uv.h
100
122
UV_HEADERS += uv/*.h
101
123
endif
102
- 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 julia.h julia_assert.h julia_threads.h julia_fasttls.h julia_locks.h julia_atomics.h jloptions.h)
124
+ 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)
125
+ ifneq (${MMTK_PLAN},None)
126
+ PUBLIC_HEADERS += $(addprefix $(SRCDIR)/,gc-tls-mmtk.h)
127
+ else
128
+ PUBLIC_HEADERS += $(addprefix $(SRCDIR)/,gc-tls-stock.h)
129
+ endif
103
130
ifeq ($(OS ) ,WINNT)
104
131
PUBLIC_HEADERS += $(addprefix $(SRCDIR ) /,win32_ucontext.h)
105
132
endif
@@ -164,8 +191,8 @@ LIBJULIA_PATH_REL := libjulia
164
191
endif
165
192
166
193
COMMON_LIBPATHS := -L$(build_libdir ) -L$(build_shlibdir )
167
- RT_LIBS := $(WHOLE_ARCHIVE ) $(LIBUV ) $(WHOLE_ARCHIVE ) $(LIBUTF8PROC ) $(NO_WHOLE_ARCHIVE ) $(LIBUNWIND ) $(RT_LLVMLINK ) $(OSLIBS ) $(LIBTRACYCLIENT ) $(LIBITTAPI )
168
- CG_LIBS := $(LIBUNWIND ) $(CG_LLVMLINK ) $(OSLIBS ) $(LIBTRACYCLIENT ) $(LIBITTAPI )
194
+ RT_LIBS := $(WHOLE_ARCHIVE ) $(LIBUV ) $(WHOLE_ARCHIVE ) $(LIBUTF8PROC ) $(NO_WHOLE_ARCHIVE ) $(LIBUNWIND ) $(RT_LLVMLINK ) $(OSLIBS ) $(LIBTRACYCLIENT ) $(LIBITTAPI ) $( MMTK_LIB )
195
+ CG_LIBS := $(LIBUNWIND ) $(CG_LLVMLINK ) $(OSLIBS ) $(LIBTRACYCLIENT ) $(LIBITTAPI ) $( MMTK_LIB )
169
196
RT_DEBUG_LIBS := $(COMMON_LIBPATHS ) $(WHOLE_ARCHIVE ) $(BUILDDIR ) /flisp/libflisp-debug.a $(WHOLE_ARCHIVE ) $(BUILDDIR ) /support/libsupport-debug.a -ljulia-debug $(RT_LIBS )
170
197
CG_DEBUG_LIBS := $(COMMON_LIBPATHS ) $(CG_LIBS ) -ljulia-debug -ljulia-internal-debug
171
198
RT_RELEASE_LIBS := $(COMMON_LIBPATHS ) $(WHOLE_ARCHIVE ) $(BUILDDIR ) /flisp/libflisp.a $(WHOLE_ARCHIVE ) $(BUILDDIR ) /support/libsupport.a -ljulia $(RT_LIBS )
@@ -314,6 +341,7 @@ $(BUILDDIR)/debuginfo.o $(BUILDDIR)/debuginfo.dbg.obj: $(addprefix $(SRCDIR)/,de
314
341
$(BUILDDIR ) /disasm.o $(BUILDDIR ) /disasm.dbg.obj : $(SRCDIR ) /debuginfo.h $(SRCDIR ) /processor.h
315
342
$(BUILDDIR ) /gc-debug.o $(BUILDDIR ) /gc-debug.dbg.obj : $(SRCDIR ) /gc-common.h $(SRCDIR ) /gc-stock.h
316
343
$(BUILDDIR ) /gc-pages.o $(BUILDDIR ) /gc-pages.dbg.obj : $(SRCDIR ) /gc-common.h $(SRCDIR ) /gc-stock.h
344
+ $(BUILDDIR ) /gc-mmtk.o $(BUILDDIR ) /gc-mmtk.dbg.obj : $(SRCDIR ) /gc-common.h $(SRCDIR ) /gc-heap-snapshot.h $(SRCDIR ) /gc-alloc-profiler.h
317
345
$(BUILDDIR ) /gc-stacks.o $(BUILDDIR ) /gc-stacks.dbg.obj : $(SRCDIR ) /gc-common.h $(SRCDIR ) /gc-stock.h
318
346
$(BUILDDIR ) /gc-stock.o $(BUILDDIR ) /gc.dbg.obj : $(SRCDIR ) /gc-common.h $(SRCDIR ) /gc-stock.h $(SRCDIR ) /gc-heap-snapshot.h $(SRCDIR ) /gc-alloc-profiler.h $(SRCDIR ) /gc-page-profiler.h
319
347
$(BUILDDIR ) /gc-heap-snapshot.o $(BUILDDIR ) /gc-heap-snapshot.dbg.obj : $(SRCDIR ) /gc-heap-snapshot.h
0 commit comments