Do not allow undefined references if bitcode is enabled.
[mono.git] / mono / mini / Makefile.am.in
index f9d17cfb1e31d21244f99c51c7899f5d0c10da5a..7290ba8ab4d8f1615a4365ca7c66b2bf3f860ac4 100755 (executable)
@@ -147,7 +147,7 @@ endif
 
 if LOADED_LLVM
 lib_LTLIBRARIES += libmono-llvm.la
-libmono_llvm_la_SOURCES = mini-llvm.c mini-llvm-cpp.cpp
+libmono_llvm_la_SOURCES = mini-llvm.c mini-llvm-cpp.cpp llvm-jit.cpp
 libmono_llvm_la_LIBADD = $(GLIB_LIBS) $(LLVM_LIBS) $(LLVM_LDFLAGS)
 if PLATFORM_DARWIN
 libmono_llvm_la_LDFLAGS=-Wl,-undefined -Wl,suppress -Wl,-flat_namespace
@@ -243,6 +243,10 @@ mono_sgen_LDADD = \
 
 mono_sgen_LDFLAGS = $(static_flags) -export-dynamic $(monobinldflags) $(monobin_platform_ldflags)
 
+if BITCODE
+libmonoldflags += -no-undefined
+endif
+
 # if SUPPORT_SGEN
 # 
 # mono_LDADD = $(mono_sgen_LDADD)
@@ -363,7 +367,18 @@ else
 llvm_sources = \
        mini-llvm.c             \
        mini-llvm-loaded.c \
-       mini-llvm-cpp.cpp
+       mini-llvm-cpp.cpp \
+       llvm-jit.cpp
+endif
+endif
+
+if ENABLE_LLVM
+llvm_runtime_sources = \
+       llvm-runtime.cpp
+else
+if ENABLE_LLVM_RUNTIME
+llvm_runtime_sources = \
+       llvm-runtime.cpp
 endif
 endif
 
@@ -397,6 +412,7 @@ common_sources = \
        driver.c                \
        debug-mini.c            \
        linear-scan.c           \
+       aot-compiler.h          \
        aot-compiler.c          \
        aot-runtime.c           \
        graph.c                 \
@@ -421,9 +437,12 @@ common_sources = \
        debugger-agent.h        \
        debugger-agent.c        \
        xdebug.c                        \
+       mini-llvm.h                     \
        mini-llvm-cpp.h \
        alias-analysis.c        \
-       mini-cross-helpers.c
+       mini-cross-helpers.c \
+       arch-stubs.c            \
+       llvm-runtime.h
 
 test_sources =                         \
        basic-calls.cs          \
@@ -436,7 +455,7 @@ test_sources =                      \
        basic.cs                \
        exceptions.cs           \
        devirtualization.cs     \
-       iltests.il.in           \
+       iltests.il              \
        test.cs                 \
        generics.cs             \
        generics-variant-types.il\
@@ -536,7 +555,7 @@ os_sources = $(darwin_sources) $(posix_sources)
 monobin_platform_ldflags=-framework CoreFoundation -framework Foundation
 endif
 
-libmini_la_SOURCES = $(common_sources) $(llvm_sources) $(arch_sources) $(os_sources)
+libmini_la_SOURCES = $(common_sources) $(llvm_sources) $(llvm_runtime_sources) $(arch_sources) $(os_sources)
 libmini_la_CFLAGS = $(mono_CFLAGS)
 
 libmonoboehm_2_0_la_SOURCES =
@@ -576,10 +595,6 @@ generics.exe: generics.cs TestDriver.dll generics-variant-types.dll
 %.exe: %.cs TestDriver.dll
        $(MCS) -out:$@ $(CSFLAGS) $< -r:TestDriver.dll
 
-iltests.il: iltests.il.in Makefile.am
-       echo '// DO NOT EDIT: This file has been generated from iltests.il.in' > iltests.il
-       cpp -Darch=$(arch_define) < $(srcdir)/iltests.il.in | sed 's/^#.*//' >> iltests.il
-
 %.exe: %.il
        $(ILASM) -output=$@ $<
 
@@ -657,11 +672,15 @@ endif
 rcheck2: mono $(regtests)
        $(MINI_RUNTIME) --regression $(regtests)
 
+if ARM
+check-seq-points:
+else
 check-seq-points: mono $(regtests)
-       rm -f TestResults_op_il_seq_point.xml
+       rm -f TestResult-op_il_seq_point.xml
        for i in $(regtests); do $(srcdir)/test_op_il_seq_point.sh $$i || ($(srcdir)/test_op_il_seq_point_headerfooter.sh; exit 1) || exit 1; done
        for i in $(regtests); do $(srcdir)/test_op_il_seq_point.sh $$i --aot || ($(srcdir)/test_op_il_seq_point_headerfooter.sh; exit 1) || exit 1; done
        $(srcdir)/test_op_il_seq_point_headerfooter.sh
+endif
 
 gctest: mono gc-test.exe
        MONO_DEBUG_OPTIONS=clear-nursery-at-gc $(MINI_RUNTIME) --regression gc-test.exe
@@ -698,7 +717,7 @@ FULLAOT_LIBS = \
 fullaotcheck: mono $(fullaot_regtests)
        rm -rf fullaot-tmp
        mkdir fullaot-tmp
-       $(MAKE) fullaot-libs AOT_FLAGS=full
+       $(MAKE) fullaot-libs AOT_FLAGS=full GSHAREDVT=$(GSHAREDVT)
        cp $(regtests) $(fullaot_regtests) generics-variant-types.dll TestDriver.dll fullaot-tmp/
        MONO_PATH=fullaot-tmp $(top_builddir)/runtime/mono-wrapper $(LLVM_AOT_RUNTIME_OPTS) $(GSHAREDVT_RUNTIME_OPTS) --aot=full fullaot-tmp/{generics-variant-types.dll,TestDriver.dll,*.exe} || exit 1
        ln -s $$PWD/mono fullaot-tmp/
@@ -710,12 +729,23 @@ fullaot-libs: $(patsubst %,fullaot-tmp/%.dylib,$(FULLAOT_LIBS))
 fullaot-tmp/%.dylib: $(CLASS)/%
        cp $(CLASS)/$* fullaot-tmp/
        mkdir fullaot-tmp/$*-tmp
-       MONO_PATH=fullaot-tmp/:$(CLASS) $(top_builddir)/runtime/mono-wrapper --aot=$(AOT_FLAGS),temp-path=fullaot-tmp/$*-tmp fullaot-tmp/$*
+       MONO_PATH=fullaot-tmp/:$(CLASS) $(top_builddir)/runtime/mono-wrapper $(if $(GSHAREDVT),-O=gsharedvt) --aot=$(AOT_FLAGS),temp-path=fullaot-tmp/$*-tmp fullaot-tmp/$*
        rm -rf fullaot-tmp/$*-tmp
 
 llvmfullaotcheck:
        $(MAKE) fullaotcheck LLVM=1
 
+llvmonly_regtests = $(fullaot_regtests) gshared.exe
+
+llvmonlycheck: mono $(llvmonly_regtests)
+       rm -rf fullaot-tmp
+       mkdir fullaot-tmp
+       $(MAKE) fullaot-libs AOT_FLAGS=llvmonly
+       cp $(llvmonly_regtests) generics-variant-types.dll TestDriver.dll fullaot-tmp/
+       MONO_PATH=fullaot-tmp $(top_builddir)/runtime/mono-wrapper  --aot=llvmonly fullaot-tmp/{generics-variant-types.dll,TestDriver.dll,*.exe} || exit 1
+       ln -s $$PWD/mono fullaot-tmp/
+       for i in $(llvmonly_regtests); do echo $$i; MONO_PATH=fullaot-tmp $(top_builddir)/runtime/mono-wrapper --llvmonly fullaot-tmp/$$i --exclude '!FULLAOT' --exclude '!BITCODE' $(ARCH_FULLAOT_EXCLUDE) || exit 1; done
+
 gccheck: gc-test.exe
        MONO_GC_PARAMS=stack-mark=precise MONO_GC_DEBUG=clear-at-gc ./mono-sgen gc-test.exe     
 
@@ -743,7 +773,7 @@ docu: mini.sgm
 check-local: rcheck check-seq-points
 
 clean-local:
-       rm -f mono a.out gmon.out *.o buildver-boehm.h buildver-sgen.h test.exe regressionexitcode.out TestResults_op_il_seq_point.xml*
+       rm -f mono a.out gmon.out *.o buildver-boehm.h buildver-sgen.h test.exe regressionexitcode.out TestResult-op_il_seq_point.xml*
 
 pkgconfigdir = $(libdir)/pkgconfig