Revert "[runtime] Avoid building a separate static library, use the shared object...
authorAlexander Köplinger <alex.koeplinger@outlook.com>
Wed, 9 Aug 2017 18:04:55 +0000 (20:04 +0200)
committerAlexander Köplinger <alex.koeplinger@outlook.com>
Wed, 9 Aug 2017 18:06:37 +0000 (20:06 +0200)
This reverts commit 56a1881bff83365978e7eb30d18da8809b56c1e2.

It caused a consistent test error on ARM64:
https://jenkins.mono-project.com/job/test-mono-mainline-linux/label=debian-8-arm64/2810/testReport/regression-tests/dummy/MonoTests_regressions_100percentsuccess/

mono/dis/Makefile.am
mono/metadata/Makefile.am
mono/mini/Makefile.am.in
mono/mini/mini.h
mono/sgen/Makefile.am
tools/monograph/Makefile.am
tools/pedump/Makefile.am

index 40a57191cc4039790ac81d5ef84f5708534fa2e4..06085362c54484072e624443e2c11b6a9dc573c3 100644 (file)
@@ -5,10 +5,10 @@ export HOST_CC
 endif
 
 if SUPPORT_SGEN
-metadata_lib=$(top_builddir)/mono/metadata/libmonoruntimesgen.la
-gc_lib=$(top_builddir)/mono/sgen/libmonosgen.la
+metadata_lib=$(top_builddir)/mono/metadata/libmonoruntimesgen-static.la
+gc_lib=$(top_builddir)/mono/sgen/libmonosgen-static.la
 else
-metadata_lib=$(top_builddir)/mono/metadata/libmonoruntime.la
+metadata_lib=$(top_builddir)/mono/metadata/libmonoruntime-static.la
 gc_lib=$(LIBGC_STATIC_LIBS)
 endif
 
index 2f760792a510e13512f905ef39e1034a57f111e0..95867a3e4ca4fe233f645b950b6b8e59fbd8fac8 100644 (file)
@@ -63,6 +63,10 @@ if PLATFORM_ANDROID
 platform_sources += ../../support/libm/complex.c
 endif
 
+#
+# libtool is not capable of creating static/shared versions of the same
+# convenience lib, so we have to do it ourselves
+#
 if SUPPORT_SGEN
 if DISABLE_EXECUTABLES
 shared_sgen_libraries = libmonoruntimesgen.la 
@@ -71,7 +75,7 @@ if SHARED_MONO
 shared_sgen_libraries = libmonoruntimesgen.la 
 endif
 endif
-sgen_libraries = $(shared_sgen_libraries)
+sgen_libraries = $(shared_sgen_libraries) libmonoruntimesgen-static.la 
 endif
 
 if SUPPORT_BOEHM
@@ -82,7 +86,7 @@ if SHARED_MONO
 shared_boehm_libraries = libmonoruntime.la
 endif
 endif
-boehm_libraries = $(shared_boehm_libraries)
+boehm_libraries = $(shared_boehm_libraries) libmonoruntime-static.la
 endif
 
 if DISABLE_EXECUTABLES
@@ -313,6 +317,16 @@ libmonoruntimesgen_la_SOURCES = $(common_sources) $(gc_dependent_sources) $(sgen
 libmonoruntimesgen_la_CFLAGS = $(SGEN_DEFINES)
 libmonoruntimesgen_la_LIBADD = libmonoruntime-config.la
 
+libmonoruntime_static_la_SOURCES = $(libmonoruntime_la_SOURCES)
+libmonoruntime_static_la_LDFLAGS = -static
+libmonoruntime_static_la_CFLAGS = $(BOEHM_DEFINES)
+libmonoruntime_static_la_LIBADD = $(bundle_obj) libmonoruntime-config.la
+
+libmonoruntimesgen_static_la_SOURCES = $(libmonoruntimesgen_la_SOURCES)
+libmonoruntimesgen_static_la_LDFLAGS = -static
+libmonoruntimesgen_static_la_CFLAGS = $(SGEN_DEFINES)
+libmonoruntimesgen_static_la_LIBADD = libmonoruntime-config.la
+
 libmonoruntimeincludedir = $(includedir)/mono-$(API_VER)/mono/metadata
 
 libmonoruntimeinclude_HEADERS = \
index c739de5371f868131cae4d2e61cc1540b16e2c03..848f75d3fe1544ed2dedbd459355d7c30a563280 100755 (executable)
@@ -30,6 +30,18 @@ sgen_libs = \
        $(monodir)/mono/utils/libmonoutils.la \
        $(GLIB_LIBS) $(LIBICONV)
 
+boehm_static_libs=     \
+       $(monodir)/mono/metadata/libmonoruntime-static.la       \
+       $(monodir)/mono/utils/libmonoutils.la \
+       $(GLIB_LIBS) $(LIBICONV) \
+       $(libgc_static_libs)
+
+sgen_static_libs = \
+       $(monodir)/mono/metadata/libmonoruntimesgen-static.la   \
+       $(monodir)/mono/sgen/libmonosgen-static.la      \
+       $(monodir)/mono/utils/libmonoutils.la \
+       $(GLIB_LIBS) $(LIBICONV)
+
 if FULL_AOT_TESTS
 # if the tests are going to run with framework assemblies compiled with
 # -d:MOBILE, tell the runtime to remap framework assemblies using the mobile
@@ -85,12 +97,12 @@ endif
 if SUPPORT_SGEN
 sgen_binaries = mono-sgen
 sgen_libraries = libmonosgen-2.0.la
-sgen_static_libraries = libmini.la $(sgen_libs)
+sgen_static_libraries = libmini-static.la $(sgen_static_libs)
 endif
 
 if SUPPORT_BOEHM
 boehm_libraries = libmonoboehm-2.0.la
-boehm_static_libraries = libmini.la $(boehm_libs)
+boehm_static_libraries = libmini-static.la $(boehm_static_libs)
 boehm_binaries  = mono-boehm
 endif
 
@@ -149,7 +161,7 @@ endif
 if DISABLE_EXECUTABLES
 noinst_LTLIBRARIES = $(mini_common_lib)
 else
-noinst_LTLIBRARIES = $(mini_common_lib)
+noinst_LTLIBRARIES = $(mini_common_lib) libmini-static.la
 endif
 
 if LOADED_LLVM
@@ -183,12 +195,20 @@ mono_sgen_CFLAGS = $(AM_CFLAGS)
 # We build this after libmono was built so it contains the date when the final
 # link was done
 if SUPPORT_BOEHM
-buildver-boehm.h: libmini.la $(monodir)/mono/metadata/libmonoruntime.la
+if DISABLE_EXECUTABLES
+buildver-boehm.h: libmini-static.la $(monodir)/mono/metadata/libmonoruntime.la
+else
+buildver-boehm.h: libmini-static.la $(monodir)/mono/metadata/libmonoruntime-static.la
+endif
        @echo "const char *build_date = \"`date`\";" > buildver-boehm.h
 mono_boehm-main.$(OBJEXT): buildver-boehm.h
 endif
 
-buildver-sgen.h: libmini.la $(monodir)/mono/metadata/libmonoruntimesgen.la $(monodir)/mono/sgen/libmonosgen.la
+if DISABLE_EXECUTABLES
+buildver-sgen.h: libmini-static.la $(monodir)/mono/metadata/libmonoruntimesgen.la $(monodir)/mono/sgen/libmonosgen.la
+else
+buildver-sgen.h: libmini-static.la $(monodir)/mono/metadata/libmonoruntimesgen-static.la $(monodir)/mono/sgen/libmonosgen-static.la
+endif
        @echo "const char *build_date = \"`date`\";" > buildver-sgen.h
 mono_sgen-main-sgen.$(OBJEXT): buildver-sgen.h
 main-sgen.$(OBJEXT): buildver-sgen.h
@@ -600,10 +620,6 @@ os_sources = $(darwin_sources) $(posix_sources)
 monobin_platform_ldflags=-framework CoreFoundation -framework Foundation
 endif
 
-#
-# This library is shared between mono and mono-sgen, since the code in mini/ doesn't contain
-# compile time dependencies on boehm/sgen.
-#
 libmini_la_SOURCES = $(common_sources) $(llvm_sources) $(llvm_runtime_sources) $(interp_sources) $(arch_sources) $(os_sources)
 libmini_la_CFLAGS = $(mono_CFLAGS)
 
@@ -617,6 +633,15 @@ libmonosgen_2_0_la_CFLAGS = $(mono_sgen_CFLAGS)
 libmonosgen_2_0_la_LIBADD = libmini.la $(sgen_libs) $(LIBMONO_DTRACE_OBJECT) $(LLVMMONOF)
 libmonosgen_2_0_la_LDFLAGS = $(libmonoldflags) $(monobin_platform_ldflags)
 
+#
+# This library is shared between mono and mono-sgen, since the code in mini/ doesn't contain
+# compile time dependencies on boehm/sgen.
+#
+libmini_static_la_SOURCES = $(libmini_la_SOURCES)
+libmini_static_la_CFLAGS = $(AM_CFLAGS)
+libmini_static_la_LDFLAGS = -static
+libmini_static_la_LIBADD = $(MONO_DTRACE_OBJECT)
+
 libmonoincludedir = $(includedir)/mono-$(API_VER)/mono/jit
 
 libmonoinclude_HEADERS = jit.h
index 4a019761f7e0dbe970ddd84ffc385e84f0700804..7ce873a38ce7b6bdb0f42d9830c4329fa4d4f844 100644 (file)
@@ -552,7 +552,7 @@ extern MonoMethodDesc *mono_break_at_bb_method;
 extern int mono_break_at_bb_bb_num;
 extern gboolean mono_verify_all;
 extern gboolean mono_do_x86_stack_align;
-extern MONO_API const char *mono_build_date;
+extern const char *mono_build_date;
 extern gboolean mono_do_signal_chaining;
 extern gboolean mono_do_crash_chaining;
 extern MONO_API gboolean mono_use_llvm;
index 542bd836b4a4c60324638eba228b96d9d8ea7d4e..6027f7839a7faebb48ac492b3b10b15966b7d38a 100644 (file)
@@ -8,7 +8,7 @@ if SHARED_MONO
 shared_libraries = libmonosgen.la
 endif
 endif
-libraries = $(shared_libraries)
+libraries = $(shared_libraries) libmonosgen-static.la
 endif
 
 if DISABLE_EXECUTABLES
@@ -72,3 +72,7 @@ monosgen_sources = \
 
 libmonosgen_la_SOURCES = $(monosgen_sources)
 libmonosgen_la_CFLAGS = $(SGEN_DEFINES)
+
+libmonosgen_static_la_SOURCES = $(libmonosgen_la_SOURCES)
+libmonosgen_static_la_CFLAGS = $(SGEN_DEFINES)
+libmonosgen_static_la_LDFLAGS = -static
index 13976c5a85be028250d4281af657f8f562e7168b..1a53e3772b7a01686881710930f90104034ccfda 100644 (file)
@@ -7,7 +7,7 @@ if DISABLE_EXECUTABLES
 runtime_lib=$(top_builddir)/mono/mini/$(LIBMONO_LA) $(static_libs)
 else
 static_libs=   \
-       $(top_builddir)/mono/metadata/libmonoruntimesgen.la     \
+       $(top_builddir)/mono/metadata/libmonoruntimesgen-static.la      \
        $(top_builddir)/mono/utils/libmonoutils.la \
        $(GLIB_LIBS) $(LIBICONV) \
        $(LIBGC_STATIC_LIBS)
index 30d8afd431e8b7d0d83069becf6390932ae85d1c..4fb8260abdb5eabf4910592d391487d1e3310721 100644 (file)
@@ -17,8 +17,8 @@ pedump_SOURCES =              \
        pedump.c
 
 pedump_LDADD =                         \
-       $(top_builddir)/mono/metadata/libmonoruntimesgen.la \
-       $(top_builddir)/mono/sgen/libmonosgen.la \
+       $(top_builddir)/mono/metadata/libmonoruntimesgen-static.la \
+       $(top_builddir)/mono/sgen/libmonosgen-static.la \
        $(top_builddir)/mono/utils/libmonoutils.la \
        $(LLVM_LIBS)                    \
        $(LLVM_LDFLAGS)                 \