@@ -29,6 +29,10 @@ ifeq ($(USECLANG),1)
2929FLAGS += -Wno-return-type-c-linkage -Wno-atomic-alignment
3030endif
3131
32+ ifeq ($(WITH_MMTK ) , 1)
33+ FLAGS += -I$(MMTK_API_INC )
34+ endif
35+
3236FLAGS += -DJL_BUILD_ARCH='"$(ARCH ) "'
3337ifeq ($(OS ) ,WINNT)
3438FLAGS += -DJL_BUILD_UNAME='"NT"'
@@ -44,8 +48,8 @@ SRCS := \
4448 jltypes gf typemap smallintset ast builtins module interpreter symbol \
4549 dlload sys init task array genericmemory staticdata toplevel jl_uv datatype \
4650 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 \
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 \
4953 crc32c APInt-C processor ircode opaque_closure codegen-stubs coverage runtime_ccall engine
5054
5155RT_LLVMLINK :=
@@ -103,7 +107,7 @@ ifeq ($(USE_SYSTEM_LIBUV),0)
103107UV_HEADERS += uv.h
104108UV_HEADERS += uv/*.h
105109endif
106- 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)
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)
107111ifeq ($(OS ) ,WINNT)
108112PUBLIC_HEADERS += $(addprefix $(SRCDIR ) /,win32_ucontext.h)
109113endif
@@ -168,8 +172,8 @@ LIBJULIA_PATH_REL := libjulia
168172endif
169173
170174COMMON_LIBPATHS := -L$(build_libdir ) -L$(build_shlibdir )
171- RT_LIBS := $(WHOLE_ARCHIVE ) $(LIBUV ) $(WHOLE_ARCHIVE ) $(LIBUTF8PROC ) $(NO_WHOLE_ARCHIVE ) $(LIBUNWIND ) $(RT_LLVMLINK ) $(OSLIBS ) $(LIBTRACYCLIENT ) $(LIBITTAPI )
172- CG_LIBS := $(LIBUNWIND ) $(CG_LLVMLINK ) $(OSLIBS ) $(LIBTRACYCLIENT ) $(LIBITTAPI )
175+ RT_LIBS := $(WHOLE_ARCHIVE ) $(LIBUV ) $(WHOLE_ARCHIVE ) $(LIBUTF8PROC ) $(NO_WHOLE_ARCHIVE ) $(LIBUNWIND ) $(RT_LLVMLINK ) $(OSLIBS ) $(LIBTRACYCLIENT ) $(LIBITTAPI ) $( MMTK_LIB )
176+ CG_LIBS := $(LIBUNWIND ) $(CG_LLVMLINK ) $(OSLIBS ) $(LIBTRACYCLIENT ) $(LIBITTAPI ) $( MMTK_LIB )
173177RT_DEBUG_LIBS := $(COMMON_LIBPATHS ) $(WHOLE_ARCHIVE ) $(BUILDDIR ) /flisp/libflisp-debug.a $(WHOLE_ARCHIVE ) $(BUILDDIR ) /support/libsupport-debug.a -ljulia-debug $(RT_LIBS )
174178CG_DEBUG_LIBS := $(COMMON_LIBPATHS ) $(CG_LIBS ) -ljulia-debug -ljulia-internal-debug
175179RT_RELEASE_LIBS := $(COMMON_LIBPATHS ) $(WHOLE_ARCHIVE ) $(BUILDDIR ) /flisp/libflisp.a $(WHOLE_ARCHIVE ) $(BUILDDIR ) /support/libsupport.a -ljulia $(RT_LIBS )
@@ -226,6 +230,12 @@ $(BUILDDIR)/%.h.gen : $(SRCDIR)/%.d
226230 sed ' s/JULIA_/JL_PROBE_/' $@ > $@ .tmp
227231 mv $@ .tmp $@
228232
233+ # Compile files from the binding side and copy so file into lib folder
234+ ifeq ($(WITH_MMTK ) , 1)
235+ $(MMTK_LIB_DST ) : $(MMTK_LIB_SRC )
236+ @$(call PRINT_MMTK, cp $< $@ )
237+ endif
238+
229239$(BUILDDIR ) /jl_internal_funcs.inc : $(SRCDIR ) /jl_exported_funcs.inc
230240 # Generate `.inc` file that contains a list of `#define` macros to rename functions defined in `libjulia-internal`
231241 # to have a `ijl_` prefix instead of `jl_`, to denote that they are coming from `libjulia-internal`. This avoids
@@ -318,6 +328,7 @@ $(BUILDDIR)/debuginfo.o $(BUILDDIR)/debuginfo.dbg.obj: $(addprefix $(SRCDIR)/,de
318328$(BUILDDIR ) /disasm.o $(BUILDDIR ) /disasm.dbg.obj : $(SRCDIR ) /debuginfo.h $(SRCDIR ) /processor.h
319329$(BUILDDIR ) /gc-debug.o $(BUILDDIR ) /gc-debug.dbg.obj : $(SRCDIR ) /gc-common.h $(SRCDIR ) /gc-stock.h
320330$(BUILDDIR ) /gc-pages.o $(BUILDDIR ) /gc-pages.dbg.obj : $(SRCDIR ) /gc-common.h $(SRCDIR ) /gc-stock.h
331+ $(BUILDDIR ) /gc-mmtk.o $(BUILDDIR ) /gc-mmtk.dbg.obj : $(SRCDIR ) /gc-common.h $(SRCDIR ) /gc-heap-snapshot.h $(SRCDIR ) /gc-alloc-profiler.h
321332$(BUILDDIR ) /gc-stacks.o $(BUILDDIR ) /gc-stacks.dbg.obj : $(SRCDIR ) /gc-common.h $(SRCDIR ) /gc-stock.h
322333$(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
323334$(BUILDDIR ) /gc-heap-snapshot.o $(BUILDDIR ) /gc-heap-snapshot.dbg.obj : $(SRCDIR ) /gc-heap-snapshot.h
@@ -390,13 +401,13 @@ $(BUILDDIR)/julia.expmap: $(SRCDIR)/julia.expmap.in $(JULIAHOME)/VERSION $(LLVM_
390401 sed < ' $<' > ' $@' -e " s/@JULIA_SHLIB_SYMBOL_VERSION@/JL_LIBJULIA_$( SOMAJOR) /" \
391402 -e " s/@LLVM_SHLIB_SYMBOL_VERSION@/$( LLVM_SHLIB_SYMBOL_VERSION) /"
392403
393- $(build_shlibdir ) /libjulia-internal.$(JL_MAJOR_MINOR_SHLIB_EXT ) : $(BUILDDIR ) /julia.expmap $(OBJS ) $(BUILDDIR ) /flisp/libflisp.a $(BUILDDIR ) /support/libsupport.a $(LIBUV )
404+ $(build_shlibdir ) /libjulia-internal.$(JL_MAJOR_MINOR_SHLIB_EXT ) : $(BUILDDIR ) /julia.expmap $(OBJS ) $(MMTK_LIB_DST ) $( BUILDDIR ) /flisp/libflisp.a $(BUILDDIR ) /support/libsupport.a $(LIBUV )
394405 @$(call PRINT_LINK, $(CXXLD ) $(call IMPLIB_FLAGS,$@ ) $(JCXXFLAGS ) $(JL_CXXFLAGS ) $(CXXLDFLAGS ) $(SHIPFLAGS ) $(OBJS ) $(RPATH_LIB ) -o $@ \
395406 $(JLDFLAGS ) $(BOLT_LDFLAGS ) $(JLIBLDFLAGS ) $(RT_RELEASE_LIBS ) $(call SONAME_FLAGS,libjulia-internal.$(JL_MAJOR_SHLIB_EXT ) ) )
396407 @$(INSTALL_NAME_CMD ) libjulia-internal.$(SHLIB_EXT ) $@
397408 $(DSYMUTIL ) $@
398409
399- $(build_shlibdir ) /libjulia-internal-debug.$(JL_MAJOR_MINOR_SHLIB_EXT ) : $(BUILDDIR ) /julia.expmap $(DOBJS ) $(BUILDDIR ) /flisp/libflisp-debug.a $(BUILDDIR ) /support/libsupport-debug.a $(LIBUV )
410+ $(build_shlibdir ) /libjulia-internal-debug.$(JL_MAJOR_MINOR_SHLIB_EXT ) : $(BUILDDIR ) /julia.expmap $(DOBJS ) $(MMTK_LIB_DST ) $( BUILDDIR ) /flisp/libflisp-debug.a $(BUILDDIR ) /support/libsupport-debug.a $(LIBUV )
400411 @$(call PRINT_LINK, $(CXXLD ) $(call IMPLIB_FLAGS,$@ ) $(JCXXFLAGS ) $(JL_CXXFLAGS ) $(CXXLDFLAGS ) $(DEBUGFLAGS ) $(DOBJS ) $(RPATH_LIB ) -o $@ \
401412 $(JLDFLAGS ) $(JLIBLDFLAGS ) $(RT_DEBUG_LIBS ) $(call SONAME_FLAGS,libjulia-internal-debug.$(JL_MAJOR_SHLIB_EXT ) ) )
402413 @$(INSTALL_NAME_CMD ) libjulia-internal-debug.$(SHLIB_EXT ) $@
0 commit comments