Revert "Merge pull request #5330 from alexanderkyte/dedup_mkbundle"
authorAlexander Köplinger <alex.koeplinger@outlook.com>
Wed, 30 Aug 2017 22:41:53 +0000 (00:41 +0200)
committerAlexander Köplinger <alex.koeplinger@outlook.com>
Wed, 30 Aug 2017 22:41:53 +0000 (00:41 +0200)
This reverts commit 9a287c04126d095e7371afee32632febd0dafd93, reversing
changes made to 4a79280b3bef8d5f15da9ddd2a2af3a03e194b03.

It breaks tons of tests.

22 files changed:
configure.ac
man/mkbundle.1
mcs/build/tests.make
mcs/class/Microsoft.Build.Utilities/Makefile
mcs/class/Microsoft.Build/Test/Microsoft.Build.Construction/ProjectRootElementTest.cs
mcs/class/System.IdentityModel/Makefile
mcs/class/System.Security/Makefile
mcs/class/System.ServiceModel/Test/MetadataTests/TestContext.cs
mcs/class/System.Web/Test/System.Web.Caching/CacheItemPriorityQueueTest.cs
mcs/class/System.XML/Test/System.Xml/XmlUrlResolverTests.cs
mcs/class/System/Makefile
mcs/class/System/Test/System.IO.Compression/DeflateStreamTest.cs
mcs/class/System/Test/System.IO.Compression/GzipStreamTest.cs
mcs/class/System/Test/System.Net/HttpWebResponseTest.cs
mcs/class/corlib/Makefile
mcs/class/corlib/Test/System.Reflection/AssemblyNameTest.cs
mcs/class/corlib/Test/System.Reflection/AssemblyTest.cs
mcs/class/corlib/Test/System.Text/UTF8EncodingTest.cs
mcs/tools/Makefile
mcs/tools/mkbundle/mkbundle.cs
mcs/tools/mkbundle/template.c
scripts/ci/run-test-testing_aot_full.sh

index 8ab69e9047276ab0cd779b48c391d83599a20729..ba174a27c1afea4d0f9a898c4e9fc80df8576b39 100644 (file)
@@ -864,8 +864,6 @@ with_cooperative_gc_default=no
 
 INVARIANT_AOT_OPTIONS=nimt-trampolines=2000,ntrampolines=8000,nrgctx-fetch-trampolines=256,ngsharedvt-trampolines=4000
 
-AOT_BUILD_ATTRS=$INVARIANT_AOT_OPTIONS
-
 if test x$cross_compiling = xyes -o x$enable_mcs_build = xno; then
    DISABLE_MCS_DOCS_default=yes
 elif test x$with_runtime_preset = xnet_4_x; then
@@ -892,8 +890,8 @@ elif test x$with_runtime_preset = xfullaot; then
    mono_feature_disable_appdomains='yes'
 
    AOT_BUILD_FLAGS="--runtime=mobile -O=gsharedvt --aot=full,$INVARIANT_AOT_OPTIONS"
+
    AOT_RUN_FLAGS="--runtime=mobile --full-aot"
-   AOT_MODE="full"
 elif test x$with_runtime_preset = xbitcode; then
    DISABLE_MCS_DOCS_default=yes
    with_testing_aot_full_default=yes
@@ -910,7 +908,6 @@ elif test x$with_runtime_preset = xbitcode; then
 
    AOT_BUILD_FLAGS="--runtime=mobile --aot=llvmonly,$INVARIANT_AOT_OPTIONS"
    AOT_RUN_FLAGS="--runtime=mobile --llvmonly"
-   AOT_MODE="llvmonly"
 elif test x$with_runtime_preset = xhybridaot; then
    DISABLE_MCS_DOCS_default=yes
    with_testing_aot_hybrid_default=yes
@@ -938,7 +935,6 @@ elif test x$with_runtime_preset = xwinaot; then
 
    AOT_BUILD_FLAGS="--runtime=mobile --aot=full,$INVARIANT_AOT_OPTIONS"
    AOT_RUN_FLAGS="--runtime=mobile --full-aot"
-   AOT_MODE="llvmonly"
 elif test x$with_runtime_preset = xorbis; then
    DISABLE_MCS_DOCS_default=yes
    with_orbis_default=yes
@@ -952,7 +948,6 @@ elif test x$with_runtime_preset = xorbis; then
 
    AOT_BUILD_FLAGS="--runtime=mobile --aot=full,$INVARIANT_AOT_OPTIONS"
    AOT_RUN_FLAGS="--runtime=mobile --full-aot"
-   AOT_MODE="full"
 elif test x$with_runtime_preset = xunreal; then
    DISABLE_MCS_DOCS_default=yes
    with_unreal_default=yes
@@ -4756,11 +4751,6 @@ fi
     if test "x$AOT_BUILD_FLAGS" != "x" ; then
       echo "AOT_RUN_FLAGS=$AOT_RUN_FLAGS" >> $srcdir/$mcsdir/build/config.make
       echo "AOT_BUILD_FLAGS=$AOT_BUILD_FLAGS" >> $srcdir/$mcsdir/build/config.make
-      echo "AOT_BUILD_ATTRS=$AOT_BUILD_ATTRS" >> $srcdir/$mcsdir/build/config.make
-    fi
-
-    if test "x$AOT_MODE" != "x" ; then
-      echo "AOT_MODE=$AOT_MODE" >> $srcdir/$mcsdir/build/config.make
     fi
 
     if test "x$enable_btls" = "xyes"; then
index 1d9870606bfc1d4018c38d9e6bf980d99b739323..8a738a56f8384e332e678ccc94640c1dbf102d19 100644 (file)
@@ -186,18 +186,6 @@ as precompiled binaries on the Mono distribution server.
 .I "--local-targets"
 Lists all of the available local cross compilation targets.
 .TP
-.I "--cil-strip PATH"
-Provides a CIL stripper that mkbundle will use if able to.
-The intended use is to help reduce file size on AOT.
-.TP
-.I "--in-tree path/to/mono/source/root"
-Provides mkbundle with a mono source repository from which to pull the necessary headers for compilation.
-This allows mkbundle to run out of the project's source tree, useful for working with multiple runtimes and for
-testing without installing.
-.TP
-.I "--managed-linker PATH"
-Provides mkbundle access to a managed linker to preprocess the assemblies.
-.TP
 .I "--machine-config FILE"
 Uses the given FILE as the machine.config file for the generated
 application.   
@@ -318,25 +306,6 @@ causes it to statically link instead.
 Compresses the assemblies before embedding. This results in smaller
 executable files, but increases startup time and requires zlib to be
 installed on the target system.
-
-.SH AOT Options
-These options support an mkbundle using AOT compilation with static linking. A native compiler
-toolchain is required.
-.TP
-.I "--aot-runtime PATH"
-Provide the path to the mono runtime to use for AOTing assemblies.
-.TP
-.I "--aot-dedup"
-(Experimental) Deduplicate AOT'ed methods based on a unique mangling of method names.
-.TP
-.I "--aot-mode MODE"
-MODE can be either "full" or "llvmonly" at this time.
-Currently, mkbundle supports three AOT modes. The default mode (this option unset)
-will AOT methods but will fall back on runtime codegen where it is much faster or offers
-a more full compatibility profile. The "full" setting will generate the necessary stubs to
-not require runtime code generation. The "llvmonly" setting does the same, but forces all codegen
-to go through the llvm backend.
-
 .SH WINDOWS
 If you are using the old embedding on Windows systems, it it necessary
 to have Unix-like toolchain to be installed for \fImkbundle\fP to
index d571d307d4623670fa8d83c051bce790aba51aa7..8ffa784a23aeff1661c912461451be8e75a5445e 100644 (file)
@@ -94,12 +94,8 @@ endif
 
 test_assemblies :=
 
-test_lib_dir = $(topdir)/class/lib/$(PROFILE)/tests
-
-test_lib_output = $(topdir)/class/lib/$(PROFILE)/tests/$(test_lib)
-
 ifdef HAVE_CS_TESTS
-test_assemblies += $(test_lib_output)
+test_assemblies += $(test_lib)
 endif
 
 ifdef test_assemblies
@@ -126,8 +122,8 @@ LABELS_ARG = -labels
 endif
 
 ifdef ALWAYS_AOT
-test-local-aot-compile: $(topdir)/build/deps/nunit-$(PROFILE).stamp $(test_assemblies)
-       make -C $(topdir)/class aot-all-profile
+test-local-aot-compile: $(topdir)/build/deps/nunit-$(PROFILE).stamp
+       PATH="$(TEST_RUNTIME_WRAPPERS_PATH):$(PATH)" MONO_REGISTRY_PATH="$(HOME)/.mono/registry" MONO_TESTS_IN_PROGRESS="yes" $(TEST_RUNTIME) $(RUNTIME_FLAGS) $(AOT_BUILD_FLAGS) $(test_assemblies)
 
 else
 test-local-aot-compile: $(topdir)/build/deps/nunit-$(PROFILE).stamp
@@ -145,53 +141,10 @@ ifdef TEST_NUNITLITE_APP_CONFIG_RUNTIME
        sed -i -e "/__INSERT_CUSTOM_APP_CONFIG_RUNTIME__/r $(TEST_NUNITLITE_APP_CONFIG_RUNTIME)" $(NUNITLITE_CONFIG_FILE)
 endif
 
-ifdef PLATFORM_AOT_SUFFIX
-
-DEDUP_DUMMY_CS=$(topdir)/class/lib/$(PROFILE)/DummyInflated.cs
-DEDUP_DUMMY=$(topdir)/class/lib/$(PROFILE)/DummyInflated.dll
-
-$(DEDUP_DUMMY):
-       echo " // Empty Assembly \n\n" > $(DEDUP_DUMMY_CS)
-       $(CSCOMPILE) -t:library -out:$(DEDUP_DUMMY) $(DEDUP_DUMMY_CS) 
-       rm $(DEDUP_DUMMY_CS)
-
-MKBUNDLE_TEST_BIN = $(TEST_HARNESS).static
-MKBUNDLE_EXE = $(topdir)/class/lib/$(PROFILE)/mkbundle.exe
-# Pattern based on the one in AOT_PROFILE_ASSEMBLIES 
-# It's easier if you read it backwards.
-# What we do here is get the files in the profile directory that end in "test.dll" or are prefixed with nunit (filter)
-# and then strip out everything that we expect to live outside the top level (filter-out)
-TEST_ASSEMBLIES:=$(sort $(patsubst .//%,%,$(filter-out %.exe.static %.dll.dll %.exe.dll %bare% %plaincore% %secxml% %Facades% %ilasm%,$(filter %.dll,$(wildcard $(topdir)/class/lib/$(PROFILE)/tests/*)))))
-
-$(MKBUNDLE_EXE): $(topdir)/tools/mkbundle/mkbundle.cs
-       make -C $(topdir)/tools/mkbundle
-
-mkbundle-all-tests:
-       $(Q_AOT) $(MAKE) -C $(topdir)/class do-test
-       $(Q_AOT) $(MAKE) -C $(topdir)/tools/mkbundle
-       $(Q_AOT) $(MAKE) $(MKBUNDLE_TEST_BIN) # recursive make re-computes variables for TEST_ASSEMBLIES
-
-ifdef MKBUNDLE_DEDUP
-MKBUNDLE_DEDUP_COND := $(DEDUP_DUMMY)
-DEDUP_ARGS=--aot-dedup $(DEDUP_DUMMY)
-endif
-
-$(MKBUNDLE_TEST_BIN): $(TEST_ASSEMBLIES) $(TEST_HARNESS) $(MKBUNDLE_EXE) $(MKBUNDLE_DEDUP_COND)
-       $(Q_AOT) MONO_PATH="$(topdir)/class/lib/$(BUILD_TOOLS_PROFILE)" PKG_CONFIG_PATH="$(topdir)/../data" $(RUNTIME) $(RUNTIME_FLAGS) $(MKBUNDLE_EXE) -L $(topdir)/class/lib/$(PROFILE) -v --deps $(TEST_HARNESS) $(TEST_ASSEMBLIES) -o $(MKBUNDLE_TEST_BIN) --aot-mode $(AOT_MODE) --aot-runtime $(RUNTIME) --aot-args $(AOT_BUILD_ATTRS) --in-tree $(topdir)/.. --managed-linker $(topdir)/class/lib/$(BUILD_TOOLS_PROFILE)/monolinker.exe --config $(topdir)/../data/config --i18n all $(DEDUP_ARGS) --keeptemp
-
-endif # PLATFORM_AOT_SUFFIX
-
-ifneq ($(wildcard $(MKBUNDLE_TEST_BIN)),)
-TEST_HARNESS_EXEC=$(MKBUNDLE_TEST_BIN)
-TEST_HARNESS_EXCLUDES:=$(TEST_HARNESS_EXCLUDES),StaticLinkedAotNotWorking
-else 
-TEST_HARNESS_EXEC=$(TEST_RUNTIME) $(RUNTIME_FLAGS) $(AOT_RUN_FLAGS) $(TEST_HARNESS) 
-endif
-
 ## FIXME: i18n problem in the 'sed' command below
 run-test-lib: test-local test-local-aot-compile patch-nunitlite-appconfig
        ok=:; \
-       PATH="$(TEST_RUNTIME_WRAPPERS_PATH):$(PATH)" MONO_REGISTRY_PATH="$(HOME)/.mono/registry" MONO_TESTS_IN_PROGRESS="yes" $(TEST_HARNESS_EXEC) $(test_assemblies) $(NOSHADOW_FLAG) $(TEST_HARNESS_FLAGS) $(LOCAL_TEST_HARNESS_FLAGS) $(TEST_HARNESS_EXCLUDES) $(LABELS_ARG) -format:nunit2 -result:TestResult-$(PROFILE).xml $(FIXTURE_ARG) $(TESTNAME_ARG)|| ok=false; \
+       PATH="$(TEST_RUNTIME_WRAPPERS_PATH):$(PATH)" MONO_REGISTRY_PATH="$(HOME)/.mono/registry" MONO_TESTS_IN_PROGRESS="yes" $(TEST_RUNTIME) $(RUNTIME_FLAGS) $(AOT_RUN_FLAGS) $(TEST_HARNESS) $(test_assemblies) $(NOSHADOW_FLAG) $(TEST_HARNESS_FLAGS) $(LOCAL_TEST_HARNESS_FLAGS) $(TEST_HARNESS_EXCLUDES) $(LABELS_ARG) -format:nunit2 -result:TestResult-$(PROFILE).xml $(FIXTURE_ARG) $(TESTNAME_ARG)|| ok=false; \
        if [ ! -f "TestResult-$(PROFILE).xml" ]; then echo "<?xml version='1.0' encoding='utf-8'?><test-results failures='1' total='1' not-run='0' name='bcl-tests' date='$$(date +%F)' time='$$(date +%T)'><test-suite name='$(strip $(test_assemblies))' success='False' time='0'><results><test-case name='crash' executed='True' success='False' time='0'><failure><message>The test runner didn't produce a test result XML, probably due to a crash of the runtime. Check the log for more details.</message><stack-trace></stack-trace></failure></test-case></results></test-suite></test-results>" > TestResult-$(PROFILE).xml; fi; \
        $$ok
 
@@ -213,10 +166,7 @@ endif
 
 ifdef HAVE_CS_TESTS
 
-$(test_lib_dir):
-       mkdir -p $@
-
-$(test_lib_output): $(the_assembly) $(test_response) $(test_nunit_dep) $(test_lib_dir)
+$(test_lib): $(the_assembly) $(test_response) $(test_nunit_dep)
        $(TEST_COMPILE) $(LIBRARY_FLAGS) -target:library -out:$@ $(test_flags) $(LOCAL_TEST_COMPILER_ONDOTNET_FLAGS) @$(test_response)
 
 test_response_preprocessed = $(test_response)_preprocessed
@@ -236,7 +186,7 @@ $(test_makefrag): $(test_response)
 
 -include $(test_makefrag)
 
-build-test-lib: $(test_lib_output)
+build-test-lib: $(test_lib)
        @echo Building testing lib
 
 endif
index 7d4f990ef8e9627fa6d8398a450d8a0949aceb31..0a3f0d2ed47662454ee613193dc5b4fda871d8dd 100644 (file)
@@ -30,4 +30,4 @@ CLEAN_FILES += $(TEST_RESX_RESOURCES)
 $(TEST_RESX_RESOURCES): %.resources: %.resx
        $(RESGEN) $< || cp $@.prebuilt $@
 
-$(test_lib_output): $(TEST_RESX_RESOURCES) $(test_lib_dir)
+$(test_lib): $(TEST_RESX_RESOURCES)
index 8a0a2991f24c5a0a7ae7df315f2bc8d360d7ae98..2fbb9f18587853bd786d5125f7e73cd2a2a68e7f 100644 (file)
@@ -30,13 +30,8 @@ namespace MonoTests.Microsoft.Build.Construction
                        var xml = XmlReader.Create (new StringReader (empty_project_xml), null, "file:///foo.xml");
                        // This creator does not fill FullPath...
                        var root = ProjectRootElement.Create (xml);
-
-                       // Expected to run from mcs/class/lib/profile
-                       var dir_name = Path.GetDirectoryName (new Uri (GetType ().Assembly.CodeBase).LocalPath);
-                       var namespace_path = Path.Combine (Directory.GetParent (dir_name).Parent.FullName, "Microsoft.Build");
-
                        Assert.IsNull (root.FullPath, "#2");
-                       Assert.AreEqual (namespace_path, root.DirectoryPath, "#3");
+                       Assert.AreEqual (Path.GetDirectoryName (new Uri (GetType ().Assembly.CodeBase).LocalPath), root.DirectoryPath, "#3");
                }
 
                [Test]
@@ -44,11 +39,7 @@ namespace MonoTests.Microsoft.Build.Construction
                {
                        var root = ProjectRootElement.Create ();
                        root.FullPath = "test" + Path.DirectorySeparatorChar + "foo.xml";
-
-                       // Expected to run from mcs/class/lib/profile
-                       var dir_name = Path.GetDirectoryName (new Uri (GetType ().Assembly.CodeBase).LocalPath);
-                       var namespace_path = Path.Combine (Directory.GetParent (dir_name).Parent.FullName, "Microsoft.Build");
-                       var full = Path.Combine (namespace_path, "test", "foo.xml");
+                       var full = Path.Combine (Path.GetDirectoryName (new Uri (GetType ().Assembly.CodeBase).LocalPath), "test", "foo.xml");
                        Assert.AreEqual (full, root.FullPath, "#1");
                        Assert.AreEqual (Path.GetDirectoryName (full), root.DirectoryPath, "#1");
                }
index 000c536c02d52fbc0831a0b8666523ee47f0e2c7..aad3b05831f44dd5b595f33c61fd7d1d776ca24f 100644 (file)
@@ -31,10 +31,6 @@ endif
 
 TEST_MCS_FLAGS = $(LIB_MCS_FLAGS)
 
-ifdef MOBILE_PROFILE
-NO_TEST = yes
-endif
-
 EXTRA_DISTFILES = \
        Test/Resources/test.cer \
        Test/Resources/test_neg_serial.cer \
index 2257ab09539ffbe1be5386921188d0382d2e39e1..ae2de1a637046792e606012f5a547294f48ade72 100644 (file)
@@ -28,10 +28,6 @@ EXTRA_DISTFILES = \
 
 RESX_RESOURCE_STRING = ../../../external/corefx/src/System.Security.Cryptography.Xml/src/Resources/Strings.resx
 
-ifdef MOBILE_PROFILE
-NO_TEST = yes
-endif
-
 include ../../build/library.make
 
 $(build_lib): $(secxml_libdir)/System.dll $(MONO_SECURITY_DLL)
index fb0e2b3609e201b2fe70420c7dbcc0bb8e867e8f..be7bdb27bd4c38f11b01338b219fe558f010a61d 100644 (file)
@@ -138,10 +138,7 @@ namespace MonoTests.System.ServiceModel.MetadataTests {
                        if (!name.EndsWith (".xml"))
                                name = name + ".xml";
                        var uri = new Uri (asm.CodeBase);
-                       // Run from mcs/class/lib/<profile>
                        var path = Path.GetDirectoryName (uri.AbsolutePath);
-                       path = Directory.GetParent (path).Parent.FullName;
-                       path = Path.Combine (path, "System.ServiceModel");
                        path = Path.Combine (path, "Test");
                        path = Path.Combine (path, "MetadataTests");
                        path = Path.Combine (path, "Resources");
@@ -175,8 +172,6 @@ namespace MonoTests.System.ServiceModel.MetadataTests {
                                name = name + ".config";
                        var uri = new Uri (asm.CodeBase);
                        var path = Path.GetDirectoryName (uri.AbsolutePath);
-                       path = Directory.GetParent (path).Parent.FullName;
-                       path = Path.Combine (path, "System.ServiceModel");
                        path = Path.Combine (path, "Test");
                        path = Path.Combine (path, "MetadataTests");
                        path = Path.Combine (path, "Resources");
index 3e1c6d2e5d4ee69f228291c9a52fc90fd40b3618..b9754e7e84ae71fc7f1fe99212851ee93e7d3546 100644 (file)
@@ -91,10 +91,12 @@ namespace MonoTests.System.Web.Caching
 
                static CacheItemPriorityQueueTest ()
                {
-                       // Assumes this is compiled into mcs/class/lib/<profile>
-                       string class_dir = Directory.GetParent (Path.GetDirectoryName (Assembly.GetExecutingAssembly ().Location)).Parent.FullName;
-                       string system_web_dir = Path.Combine (class_dir, "System.Web", "Test", "System.Web.Caching");
-                       dataDir = Path.Combine (system_web_dir, DATA_DIR);
+                       dataDir =
+                               Path.Combine (
+                                       Path.Combine (
+                                               Path.Combine (Path.GetDirectoryName (Assembly.GetExecutingAssembly ().Location), "Test"),
+                                               "System.Web.Caching"),
+                                       DATA_DIR);
                }
                
                void RunTest (string testsFileName, string listFileName)
index 6926379c96a82185fc75974e15b93607425e4093..f637e8cc326abd7c019506a39af0ed43e59ad850 100644 (file)
@@ -97,7 +97,6 @@ namespace MonoTests.System.Xml
                }\r
 \r
                [Test]\r
-               [Category ("StaticLinkedAotNotWorking")] // Can't find .dll files when bundled in .exe\r
                public void TestAsync ()\r
                {\r
                        var loc = Assembly.GetExecutingAssembly ().Location;\r
index 125abbda448ba1e2743967728e9f4f89ecc00b2b..7a7647521db988500f37329a3f74d10eabcbccab 100644 (file)
@@ -177,7 +177,7 @@ $(the_libdir_base)System.Configuration.dll:
 
 $(build_lib): $(CYCLIC_DEP_FILES)
 
-$(test_lib_output): $(TEST_RESOURCES) $(test_lib_dir)
+$(test_lib): $(TEST_RESOURCES)
 
 CLEAN_FILES = $(test_lib).config $(bare_libdir)/System.dll $(secxml_libdir)/System.dll $(bare_libdir)/System.dll.mdb $(secxml_libdir)/System.dll.mdb
 
index 3681b5cc25c1af680e836b7236a9939754e78871..1aa78a9d99368a75faa4bee76c1c0eecb03e35f8 100644 (file)
@@ -46,7 +46,6 @@ namespace MonoTests.System.IO.Compression
 
                [Test]
                [ExpectedException (typeof (ArgumentNullException))]
-               [Category ("StaticLinkedAotNotWorking")] // Native MPH loading issues
                public void Constructor_Null ()
                {
                        DeflateStream ds = new DeflateStream (null, CompressionMode.Compress);
@@ -54,14 +53,12 @@ namespace MonoTests.System.IO.Compression
 
                [Test]
                [ExpectedException (typeof (ArgumentException))]
-               [Category ("StaticLinkedAotNotWorking")] // Native MPH loading issues
                public void Constructor_InvalidCompressionMode ()
                {
                        DeflateStream ds = new DeflateStream (new MemoryStream (), (CompressionMode)Int32.MinValue);
                }
 
                [Test]
-               [Category ("StaticLinkedAotNotWorking")] // Native MPH loading issues
                public void CheckCompressDecompress ()
                {
                        byte [] data = new byte[100000];
@@ -84,7 +81,6 @@ namespace MonoTests.System.IO.Compression
                }
 
                [Test]
-               [Category ("StaticLinkedAotNotWorking")] // Native MPH loading issues
                public void CheckDecompress ()
                {
                        MemoryStream backing = new MemoryStream (compressed_data);
@@ -96,7 +92,6 @@ namespace MonoTests.System.IO.Compression
 
                // https://bugzilla.xamarin.com/show_bug.cgi?id=22346
                [Test]
-               [Category ("StaticLinkedAotNotWorking")] // Native MPH loading issues
                public void CheckEmptyRead ()
                {
                        byte [] dummy = new byte[1];
@@ -107,7 +102,6 @@ namespace MonoTests.System.IO.Compression
                }
 
                [Test]
-               [Category ("StaticLinkedAotNotWorking")] // Native MPH loading issues
                [ExpectedException (typeof (ArgumentNullException))]
                public void CheckNullRead ()
                {
@@ -117,7 +111,6 @@ namespace MonoTests.System.IO.Compression
                }
 
                [Test]
-               [Category ("StaticLinkedAotNotWorking")] // Native MPH loading issues
                [ExpectedException (typeof (InvalidOperationException))]
                public void CheckCompressingRead ()
                {
@@ -128,7 +121,6 @@ namespace MonoTests.System.IO.Compression
                }
 
                [Test]
-               [Category ("StaticLinkedAotNotWorking")] // Native MPH loading issues
                [ExpectedException (typeof (ArgumentException))]
                public void CheckRangeRead ()
                {
@@ -140,7 +132,6 @@ namespace MonoTests.System.IO.Compression
 
 #if !MOBILE
                [Test]
-               [Category ("StaticLinkedAotNotWorking")] // Native MPH loading issues
                [Category("NotWorking")]
                [ExpectedException (typeof (InvalidDataException))]
                public void CheckInvalidDataRead ()
@@ -154,7 +145,6 @@ namespace MonoTests.System.IO.Compression
 #endif
 
                [Test]
-               [Category ("StaticLinkedAotNotWorking")] // Native MPH loading issues
                [ExpectedException (typeof (ObjectDisposedException))]
                public void CheckClosedRead ()
                {
@@ -166,7 +156,6 @@ namespace MonoTests.System.IO.Compression
                }
 
                [Test]
-               [Category ("StaticLinkedAotNotWorking")] // Native MPH loading issues
                [ExpectedException (typeof (ObjectDisposedException))]
                public void CheckClosedFlush ()
                {
@@ -177,7 +166,6 @@ namespace MonoTests.System.IO.Compression
                }
 
                [Test]
-               [Category ("StaticLinkedAotNotWorking")] // Native MPH loading issues
                [ExpectedException (typeof (NotSupportedException))]
                public void CheckSeek ()
                {
@@ -187,7 +175,6 @@ namespace MonoTests.System.IO.Compression
                }
 
                [Test]
-               [Category ("StaticLinkedAotNotWorking")] // Native MPH loading issues
                [ExpectedException (typeof (NotSupportedException))]
                public void CheckSetLength ()
                {
@@ -197,7 +184,6 @@ namespace MonoTests.System.IO.Compression
                }
 
                [Test]
-               [Category ("StaticLinkedAotNotWorking")] // Native MPH loading issues
                public void CheckGetCanSeekProp ()
                {
                        MemoryStream backing = new MemoryStream (compressed_data);
@@ -218,7 +204,6 @@ namespace MonoTests.System.IO.Compression
                }
 
                [Test]
-               [Category ("StaticLinkedAotNotWorking")] // Native MPH loading issues
                public void CheckGetCanReadProp ()
                {
                        MemoryStream backing = new MemoryStream (compressed_data);
@@ -239,7 +224,6 @@ namespace MonoTests.System.IO.Compression
                }
 
                [Test]
-               [Category ("StaticLinkedAotNotWorking")] // Native MPH loading issues
                public void CheckGetCanWriteProp ()
                {
                        MemoryStream backing = new MemoryStream ();
@@ -260,7 +244,6 @@ namespace MonoTests.System.IO.Compression
                }
 
                [Test]
-               [Category ("StaticLinkedAotNotWorking")] // Native MPH loading issues
                [ExpectedException (typeof (NotSupportedException))]
                public void CheckSetLengthProp ()
                {
@@ -270,7 +253,6 @@ namespace MonoTests.System.IO.Compression
                }
 
                [Test]
-               [Category ("StaticLinkedAotNotWorking")] // Native MPH loading issues
                [ExpectedException (typeof (NotSupportedException))]
                public void CheckGetLengthProp ()
                {
@@ -280,7 +262,6 @@ namespace MonoTests.System.IO.Compression
                }
 
                [Test]
-               [Category ("StaticLinkedAotNotWorking")] // Native MPH loading issues
                [ExpectedException (typeof (NotSupportedException))]
                public void CheckGetPositionProp ()
                {
@@ -290,7 +271,6 @@ namespace MonoTests.System.IO.Compression
                }
 
                [Test]
-               [Category ("StaticLinkedAotNotWorking")] // Native MPH loading issues
                public void DisposeTest ()
                {
                        MemoryStream backing = new MemoryStream (compressed_data);
@@ -304,7 +284,6 @@ namespace MonoTests.System.IO.Compression
 
 
                [Test]
-               [Category ("StaticLinkedAotNotWorking")] // Native MPH loading issues
                public void JunkAtTheEnd ()
                {
                        // Write a deflated stream, then some additional data...
@@ -351,7 +330,6 @@ namespace MonoTests.System.IO.Compression
                }
 
                [Test]
-               [Category ("StaticLinkedAotNotWorking")] // Native MPH loading issues
                public void Bug19313 ()
                {
                        byte [] buffer  = new byte [512];
@@ -366,7 +344,6 @@ namespace MonoTests.System.IO.Compression
                }
 
                [Test]
-               [Category ("StaticLinkedAotNotWorking")] // Native MPH loading issues
                public void CheckNet45Overloads () // Xambug #21982
                {
                        MemoryStream dataStream = GenerateStreamFromString("Hello");
@@ -385,7 +362,6 @@ namespace MonoTests.System.IO.Compression
                }
 
                [Test]
-               [Category ("StaticLinkedAotNotWorking")] // Native MPH loading issues
                [ExpectedException (typeof (ArgumentException))]
                public void CheckBufferOverrun ()
                {
@@ -398,7 +374,6 @@ namespace MonoTests.System.IO.Compression
                }
 
                [Test]
-               [Category ("StaticLinkedAotNotWorking")] // Native MPH loading issues
                public void Bug28777_EmptyFlush ()
                {
                        MemoryStream backing = new MemoryStream ();
@@ -409,7 +384,6 @@ namespace MonoTests.System.IO.Compression
                }
                
                [Test]
-               [Category ("StaticLinkedAotNotWorking")] // Native MPH loading issues
                public void Bug28777_DoubleFlush ()
                {
                        byte[] buffer = new byte [4096];
@@ -423,7 +397,6 @@ namespace MonoTests.System.IO.Compression
                }
 
                [Test]
-               [Category ("StaticLinkedAotNotWorking")] // Native MPH loading issues
                public void Bug34916_Inflate ()
                {
                        var base64String = @"H4sIAAAAAAAAA6yVu27bQBBF/4VtZGHeD3ZJmhTp5C5IIUiEIcCWDEUugiD/nmEQwYRNURFAsuFwd2exZ++d+farud89davT+um5aRsC1DuEO+R7lJayRV9m5gegFqBZNB83m5fjevOzadGWUPHjaXd62XYVEy3Z04wiMTKIX0dfV0G/6FO3Pu72D/+iL916W9GbOV/X58SaS6zEKKyoGUA1eNg/nLfF2jUEBBNMtT4Wzeq567Z9HkZkE1Osf93msN/+WO32m+7zsavsh30/BUU8fy+uUCC+QIHpPQW1RAXkEGWUmSnUy2iUYSMYOGpARYViiIHcqY5kExS8rg2vY8gLGEjeYsClBVE4ORQHz3kxsEF4iS01xzBIZkgYQcYQQ7C54LQaIrxWn5+4ioT1BiRQN8Fh6MrOPjOS9Eh3M8YRJJQMZioJkUODFA8RNJ9AYuYBNyGJW5D0oi3/EpZ3dWYk5X5PN81RJGJgDATMQ5X02nFS1imVlMGvu0XwBg5/K1hY1U8tecxcNDy1/FAnG+OAQSi9PliHRaNUiuoxQYFB6T8oyAUKEu9LJ6oipbr1spyZArhWX6qbi7EOUrs7SCAoDNVgzKagMlUz+q6DQ4N8/yM=";
@@ -442,7 +415,6 @@ namespace MonoTests.System.IO.Compression
                }
 
                [Test]
-               [Category ("StaticLinkedAotNotWorking")] // Native MPH loading issues
                public void Bug44994_Inflate()
                {
                        var base64String = @"7cWxCQAgDACwpeBjgqsgXiHU0fd9QzBLErX1EQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADepcxcuU/atm3btm3btm3btm3btm3btm3btm3btm3btm3btm3btm3btm3btm3btm3btm3btm3btm3btm3btm3btm3btm3btm3btm3btm3btm3btm3btm3btm3btm3btm37zy8=";
@@ -462,7 +434,6 @@ namespace MonoTests.System.IO.Compression
                }
 
                [Test]
-               [Category ("StaticLinkedAotNotWorking")] // Native MPH loading issues
                [Category ("MobileNotWorking")]
                public void Bug44994_InflateByteByByte()
                {
index 243c30ebe1057c261b47e9284b3df981e95feb18..47a740ca14ace19a3450a045a7720c6cabe83cf7 100644 (file)
@@ -44,7 +44,6 @@ namespace MonoTests.System.IO.Compression
                }
 
                [Test]
-               [Category ("StaticLinkedAotNotWorking")] // Native MPH loading issues
                [ExpectedException (typeof (ArgumentNullException))]
                public void Constructor_Null ()
                {
@@ -52,7 +51,6 @@ namespace MonoTests.System.IO.Compression
                }
 
                [Test]
-               [Category ("StaticLinkedAotNotWorking")] // Native MPH loading issues
                [ExpectedException (typeof (ArgumentException))]
                public void Constructor_InvalidCompressionMode ()
                {
@@ -60,7 +58,6 @@ namespace MonoTests.System.IO.Compression
                }
 
                [Test]
-               [Category ("StaticLinkedAotNotWorking")] // Native MPH loading issues
                public void CheckCompressDecompress ()
                {
                        byte [] data = new byte[100000];
@@ -83,7 +80,6 @@ namespace MonoTests.System.IO.Compression
                }
 
                [Test]
-               [Category ("StaticLinkedAotNotWorking")] // Native MPH loading issues
                public void CheckDecompress ()
                {
                        byte [] data = {0x1f, 0x8b, 0x08, 0x08, 0x70, 0xbb, 0x5d, 0x41, 0x00, 0x03, 0x74, 0x65, 0x73, 0x74, 0x00, 0xf3, 0x48, 0xcd, 0xc9, 0xc9, 0xe7, 0x02, 0x00, 0x16, 0x35, 0x96, 0x31, 0x06, 0x00, 0x00, 0x00 };
@@ -95,7 +91,6 @@ namespace MonoTests.System.IO.Compression
                }
 
                [Test]
-               [Category ("StaticLinkedAotNotWorking")] // Native MPH loading issues
                [ExpectedException (typeof (ArgumentNullException))]
                public void CheckNullRead ()
                {
@@ -106,7 +101,6 @@ namespace MonoTests.System.IO.Compression
                }
 
                [Test]
-               [Category ("StaticLinkedAotNotWorking")] // Native MPH loading issues
                [ExpectedException (typeof (InvalidOperationException))]
                public void CheckCompressingRead ()
                {
@@ -117,7 +111,6 @@ namespace MonoTests.System.IO.Compression
                }
 
                [Test]
-               [Category ("StaticLinkedAotNotWorking")] // Native MPH loading issues
                [ExpectedException (typeof (ArgumentException))]
                public void CheckRangeRead ()
                {
@@ -130,7 +123,6 @@ namespace MonoTests.System.IO.Compression
 
 #if !MOBILE
                [Test]
-               [Category ("StaticLinkedAotNotWorking")] // Native MPH loading issues
                [Category("NotWorking")]
                public void CheckInvalidDataRead ()
                {
@@ -147,7 +139,6 @@ namespace MonoTests.System.IO.Compression
 #endif
 
                [Test]
-               [Category ("StaticLinkedAotNotWorking")] // Native MPH loading issues
                public void CheckClosedRead ()
                {
                        byte [] dummy = new byte[20];
@@ -162,7 +153,6 @@ namespace MonoTests.System.IO.Compression
                }
 
                [Test]
-               [Category ("StaticLinkedAotNotWorking")] // Native MPH loading issues
                [ExpectedException (typeof (ObjectDisposedException))]
                public void CheckClosedFlush ()
                {
@@ -173,7 +163,6 @@ namespace MonoTests.System.IO.Compression
                }
 
                [Test]
-               [Category ("StaticLinkedAotNotWorking")] // Native MPH loading issues
                [ExpectedException (typeof (NotSupportedException))]
                public void CheckSeek ()
                {
@@ -183,7 +172,6 @@ namespace MonoTests.System.IO.Compression
                }
 
                [Test]
-               [Category ("StaticLinkedAotNotWorking")] // Native MPH loading issues
                [ExpectedException (typeof (NotSupportedException))]
                public void CheckSetLength ()
                {
@@ -193,7 +181,6 @@ namespace MonoTests.System.IO.Compression
                }
 
                [Test]
-               [Category ("StaticLinkedAotNotWorking")] // Native MPH loading issues
                public void CheckGetCanSeekProp ()
                {
                        MemoryStream backing = new MemoryStream (compressed_data);
@@ -214,7 +201,6 @@ namespace MonoTests.System.IO.Compression
                }
 
                [Test]
-               [Category ("StaticLinkedAotNotWorking")] // Native MPH loading issues
                public void CheckGetCanReadProp ()
                {
                        MemoryStream backing = new MemoryStream (compressed_data);
@@ -235,7 +221,6 @@ namespace MonoTests.System.IO.Compression
                }
 
                [Test]
-               [Category ("StaticLinkedAotNotWorking")] // Native MPH loading issues
                public void CheckGetCanWriteProp ()
                {
                        MemoryStream backing = new MemoryStream (compressed_data);
@@ -256,7 +241,6 @@ namespace MonoTests.System.IO.Compression
                }
 
                [Test]
-               [Category ("StaticLinkedAotNotWorking")] // Native MPH loading issues
                [ExpectedException (typeof (NotSupportedException))]
                public void CheckSetLengthProp ()
                {
@@ -266,7 +250,6 @@ namespace MonoTests.System.IO.Compression
                }
 
                [Test]
-               [Category ("StaticLinkedAotNotWorking")] // Native MPH loading issues
                [ExpectedException (typeof (NotSupportedException))]
                public void CheckGetLengthProp ()
                {
@@ -276,7 +259,6 @@ namespace MonoTests.System.IO.Compression
                }
 
                [Test]
-               [Category ("StaticLinkedAotNotWorking")] // Native MPH loading issues
                [ExpectedException (typeof (NotSupportedException))]
                public void CheckGetPositionProp ()
                {
@@ -286,7 +268,6 @@ namespace MonoTests.System.IO.Compression
                }
 
                [Test]
-               [Category ("StaticLinkedAotNotWorking")] // Native MPH loading issues
                public void DisposeTest ()
                {
                        MemoryStream backing = new MemoryStream (compressed_data);
@@ -296,7 +277,6 @@ namespace MonoTests.System.IO.Compression
                }
 
                [Test]
-               [Category ("StaticLinkedAotNotWorking")] // Native MPH loading issues
                public void DisposeOrderTest ()
                {
                        var fs = new MemoryStream();
@@ -324,7 +304,6 @@ namespace MonoTests.System.IO.Compression
                }
 
                [Test]
-               [Category ("StaticLinkedAotNotWorking")] // Native MPH loading issues
                public void CheckNet45Overloads () // Xambug #21982
                {
                        MemoryStream dataStream = GenerateStreamFromString("Hello");
index b35c8e7a5959fb8f8f2898165665c45a91e70a37..ffa7f6359e5cd5ec17d70cc0701ff96b41e6d76f 100644 (file)
@@ -1220,7 +1220,6 @@ namespace MonoTests.System.Net
 
 
                [Test]
-               [Category ("StaticLinkedAotNotWorking")] // Native MPH loading issues
 #if FEATURE_NO_BSD_SOCKETS
                [ExpectedException (typeof (PlatformNotSupportedException))]
 #endif
index 8a0453f6e7954f5b971602f6cbe9eab18042b180..131443e8c2ed2c8efab728dc5f46080af5bf745a 100644 (file)
@@ -158,7 +158,7 @@ TEST_RESOURCES = $(TEST_RESX_RESOURCES) $(TEST_RESX_RESOURCES_SATELITE)
 satellite_assembly1 = es-ES/$(patsubst %.dll,%.resources.dll,$(test_lib))
 satellite_assembly2 = nn-NO/$(patsubst %.dll,%.resources.dll,$(test_lib))
 
-$(test_lib_output): $(TEST_RESOURCES) $(satellite_assembly1) $(satellite_assembly2) $(test_lib_dir)
+$(test_lib): $(TEST_RESOURCES) $(satellite_assembly1) $(satellite_assembly2) 
 
 $(satellite_assembly1): Test/resources/culture-es-ES.cs Test/resources/Resources.es-ES.resources
        @mkdir -p es-ES
index 12f7602d6b0863c6fc752bae2cc7dc1fafe8cfef..ceac114da7162b26a38bebe2d929b454118bee24 100644 (file)
@@ -1111,7 +1111,6 @@ public class AssemblyNameTest {
 
        [Test]
        [Category ("AndroidNotWorking")] // Accessing assemblies by asm.Location is not supported
-       [Category ("StaticLinkedAotNotWorking")] // Can't find .dll files when bundled in .exe
        public void GetAssemblyName_CodeBase ()
        {
                Assembly execAssembly = Assembly.GetExecutingAssembly ();
index d8bbbeb169c09ad09f4ef3272961113f79f53f62..b3a9ba8012726d237f2048468e8fee5e77fee8a7 100644 (file)
@@ -322,7 +322,6 @@ namespace MonoTests.System.Reflection
 
                [Test]
                [Category ("AndroidNotWorking")] // Assemblies in Xamarin.Android cannot be accessed as FileStream
-               [Category ("StaticLinkedAotNotWorking")] // Can't find .dll files when bundled in .exe
                public void GetFiles_False ()
                {
                        Assembly corlib = typeof (int).Assembly;
@@ -336,7 +335,6 @@ namespace MonoTests.System.Reflection
 
                [Test]
                [Category ("AndroidNotWorking")] // Assemblies in Xamarin.Android cannot be accessed as FileStream
-               [Category ("StaticLinkedAotNotWorking")] // Can't find .dll files when bundled in .exe
                public void GetFiles_True ()
                {
                        Assembly corlib = typeof (int).Assembly;
index c073cb546aea8cdca6e51b8864fb6ac3c5bab911..12de999dc5b6372937898c66fdfa1c8d7805b088 100644 (file)
@@ -1043,9 +1043,7 @@ namespace MonoTests.System.Text
                [Category ("MobileNotWorking")]
                public void Bug415628 ()
                {
-                       DirectoryInfo bcl_output_dir = Directory.GetParent (Path.GetDirectoryName (Assembly.GetExecutingAssembly ().Location));
-                       string namespace_dir = Path.Combine (bcl_output_dir.Parent.FullName, "corlib");
-                       using (var f = File.Open (Path.Combine (namespace_dir, "Test/resources/415628.bin"), FileMode.Open)) {
+                       using (var f = File.Open (Path.Combine (Path.GetDirectoryName (Assembly.GetExecutingAssembly ().Location), "Test/resources/415628.bin"), FileMode.Open)) {
                                BinaryReader br = new BinaryReader (f);
                                byte [] buf = br.ReadBytes (8000);
                                Encoding.UTF8.GetString(buf);
index 5fe9c2b40bc173a74d66399b3796910ec2f56f24..ec1f2bd2d514a3108a0ac3bff2b5b6b97a0d822e 100644 (file)
@@ -49,7 +49,7 @@ net_4_5_dirs := \
        mono-symbolicate        \
        linker-analyzer
 
-build_SUBDIRS = resgen gacutil security culevel cil-stringreplacer commoncryptogenerator resx2sr linker cil-strip
+build_SUBDIRS = resgen gacutil security culevel cil-stringreplacer commoncryptogenerator resx2sr linker
 net_4_5_SUBDIRS = gacutil
 net_4_x_SUBDIRS = gacutil
 net_4_5_PARALLEL_SUBDIRS = $(net_4_5_dirs)
index fe7121c470239a841e604852947b6a36121a60a5..9a80f57f7feff53722a085f060c53b58451c26d4 100755 (executable)
@@ -40,11 +40,8 @@ class MakeBundle {
        static string output = "a.out";
        static string object_out = null;
        static List<string> link_paths = new List<string> ();
-       static List<string> aot_paths = new List<string> ();
-       static List<string> aot_names = new List<string> ();
        static Dictionary<string,string> libraries = new Dictionary<string,string> ();
        static bool autodeps = false;
-       static string in_tree = null;
        static bool keeptemp = false;
        static bool compile_only = false;
        static bool static_link = false;
@@ -65,27 +62,7 @@ class MakeBundle {
        static string fetch_target = null;
        static bool custom_mode = true;
        static string embedded_options = null;
-
-       static string runtime_bin = null;
-
-       static string runtime {
-               get {
-                       if (runtime_bin == null && IsUnix)
-                               runtime_bin = Process.GetCurrentProcess().MainModule.FileName;
-                       return runtime_bin;
-               }
-
-               set { runtime_bin = value; }
-       }
-       
-       static bool aot_compile = false;
-       static string aot_args = "static";
-       static DirectoryInfo aot_temp_dir = null;
-       static string aot_mode = "";
-       static string aot_runtime = null;
-       static string aot_dedup_assembly = null;
-       static string cil_strip_path = null;
-       static string managed_linker_path = null;
+       static string runtime = null;
        static string sdk_path = null;
        static string lib_path = null;
        static Dictionary<string,string> environment = new Dictionary<string,string>();
@@ -374,78 +351,6 @@ class MakeBundle {
                        case "--bundled-header":
                                bundled_header = true;
                                break;
-                       case "--in-tree":
-                               if (i+1 == top) {
-                                       Console.WriteLine ("Usage: --in-tree <path/to/headers> ");
-                                       return 1;
-                               }
-                               in_tree = args [++i];
-                               break;
-                       case "--managed-linker":
-                               if (i+1 == top) {
-                                       Console.WriteLine ("Usage: --managed-linker <path/to/exe> ");
-                                       return 1;
-                               }
-                               managed_linker_path = args [++i];
-                               break;
-                       case "--cil-strip":
-                               if (i+1 == top) {
-                                       Console.WriteLine ("Usage: --cil-strip <path/to/exe> ");
-                                       return 1;
-                               }
-                               cil_strip_path = args [++i];
-                               break;
-                       case "--aot-runtime":
-                               if (i+1 == top) {
-                                       Console.WriteLine ("Usage: --aot-runtime <path/to/runtime> ");
-                                       return 1;
-                               }
-                               aot_runtime = args [++i];
-                               aot_compile = true;
-                               static_link = true;
-                               break;
-                       case "--aot-dedup":
-                               if (i+1 == top) {
-                                       Console.WriteLine ("Usage: --aot-dedup <container_dll> ");
-                                       return 1;
-                               }
-                               var rel_path = args [++i];
-                               var asm = LoadAssembly (rel_path);
-                               if (asm != null)
-                                       aot_dedup_assembly = new Uri(asm.CodeBase).LocalPath;
-
-                               sources.Add (rel_path);
-                               aot_compile = true;
-                               static_link = true;
-                               break;
-                       case "--aot-mode":
-                               if (i+1 == top) {
-                                       Console.WriteLine ("Need string of aot mode (full, llvmonly). Omit for normal AOT.");
-                                       return 1;
-                               }
-
-                               aot_mode = args [++i];
-                               if (aot_mode != "full" && aot_mode != "llvmonly") {
-                                       Console.WriteLine ("Need string of aot mode (full, llvmonly). Omit for normal AOT.");
-                                       return 1;
-                               }
-
-                               aot_compile = true;
-                               static_link = true;
-                               break;
-                       case "--aot-args":
-                               if (i+1 == top) {
-                                       Console.WriteLine ("AOT arguments are passed as a comma-delimited list");
-                                       return 1;
-                               }
-                               if (args [i + 1].Contains ("outfile")) {
-                                       Console.WriteLine ("Per-aot-output arguments (ex: outfile, llvm-outfile) cannot be given");
-                                       return 1;
-                               }
-                               aot_args = String.Format("static,{0}", args [++i]);
-                               aot_compile = true;
-                               static_link = true;
-                               break;
                        default:
                                sources.Add (args [i]);
                                break;
@@ -506,12 +411,6 @@ class MakeBundle {
                foreach (string file in assemblies)
                        if (!QueueAssembly (files, file))
                                return 1;
-
-               PreprocessAssemblies (assemblies, files);
-
-               if (aot_compile)
-                       AotCompile (files);
-
                if (custom_mode)
                        GenerateBundles (files);
                else 
@@ -638,6 +537,7 @@ class MakeBundle {
                                        Console.WriteLine ("At {0:x} with input {1}", package.Position, fileStream.Length);
                                fileStream.CopyTo (package);
                                package.Position = package.Position + (align - (package.Position % align));
+
                                return (int) ret;
                        }
                }
@@ -646,6 +546,7 @@ class MakeBundle {
                {
                        var p = package.Position;
                        var size = AddFile (fname);
+                       
                        locations [entry] = Tuple.Create(p, size);
                }
 
@@ -729,8 +630,12 @@ class MakeBundle {
        static bool GeneratePackage (List<string> files)
        {
                if (runtime == null){
-                       Error ("You must specify at least one runtime with --runtime or --cross");
-                       Environment.Exit (1);
+                       if (IsUnix)
+                               runtime = Process.GetCurrentProcess().MainModule.FileName;
+                       else {
+                               Error ("You must specify at least one runtime with --runtime or --cross");
+                               Environment.Exit (1);
+                       }
                }
                if (!File.Exists (runtime)){
                        Error ($"The specified runtime at {runtime} does not exist");
@@ -814,11 +719,6 @@ void          mono_register_config_for_assembly (const char* assembly_name, cons
                        } else {
                                tc.WriteLine ("#include <mono/metadata/mono-config.h>");
                                tc.WriteLine ("#include <mono/metadata/assembly.h>\n");
-
-                               if (in_tree != null)
-                                       tc.WriteLine ("#include <mono/mini/jit.h>\n");
-                               else
-                                       tc.WriteLine ("#include <mono/jit/jit.h>\n");
                        }
 
                        if (compress) {
@@ -959,7 +859,6 @@ void          mono_register_config_for_assembly (const char* assembly_name, cons
                        }
                        ts.Close ();
 
-                       // Managed assemblies baked in
                        if (compress)
                                tc.WriteLine ("\nstatic const CompressedAssembly *compressed [] = {");
                        else
@@ -969,37 +868,6 @@ void          mono_register_config_for_assembly (const char* assembly_name, cons
                                tc.WriteLine ("\t&{0},", c);
                        }
                        tc.WriteLine ("\tNULL\n};\n");
-
-
-                       // AOT baked in plus loader
-                       foreach (string asm in aot_names){
-                               tc.WriteLine ("\textern const void *mono_aot_module_{0}_info;", asm);
-                       }
-
-                       tc.WriteLine ("\nstatic void install_aot_modules (void) {\n");
-                       foreach (string asm in aot_names){
-                               tc.WriteLine ("\tmono_aot_register_module (mono_aot_module_{0}_info);\n", asm);
-                       }
-
-                       string enum_aot_mode;
-                       switch (aot_mode) {
-                       case "full": 
-                               enum_aot_mode = "MONO_AOT_MODE_FULL";
-                               break;
-                       case "llvmonly": 
-                               enum_aot_mode = "MONO_AOT_MODE_LLVMONLY";
-                               break;
-                       case "": 
-                               enum_aot_mode = "MONO_AOT_MODE_NORMAL";
-                               break;
-                       default:
-                               throw new Exception ("Unsupported AOT mode");
-                       }
-                       tc.WriteLine ("\tmono_jit_set_aot_mode ({0});", enum_aot_mode);
-
-                       tc.WriteLine ("\n}\n");
-
-
                        tc.WriteLine ("static char *image_name = \"{0}\";", prog);
 
                        if (ctor_func != null) {
@@ -1145,27 +1013,15 @@ void          mono_register_config_for_assembly (const char* assembly_name, cons
                                        debugging = "-ggdb";
                                if (static_link)
                                {
-                                       string platform_libs;
                                        string smonolib;
-                                       if (style == "osx") {
+                                       if (style == "osx")
                                                smonolib = "`pkg-config --variable=libdir mono-2`/libmono-2.0.a ";
-                                               platform_libs = "-liconv -framework Foundation ";
-                                       } else {
+                                       else
                                                smonolib = "-Wl,-Bstatic -lmono-2.0 -Wl,-Bdynamic ";
-                                               platform_libs = "";
-                                       }
-
-                                       string in_tree_include = "";
-                                       
-                                       if (in_tree != null) {
-                                               smonolib = String.Format ("{0}/mono/mini/.libs/libmonosgen-2.0.a", in_tree);
-                                               in_tree_include = String.Format (" -I{0} ", in_tree);
-                                       }
-
-                                       cmd = String.Format("{4} -o '{2}' -Wall `pkg-config --cflags mono-2` {7} {0} {3} " +
-                                               "`pkg-config --libs-only-L mono-2` {5} {6} " + platform_libs +
-                                               "`pkg-config --libs-only-l mono-2 | sed -e \"s/\\-lmono-2.0 //\"` {1} -g ",
-                                               temp_c, temp_o, output, zlib, cc, smonolib, String.Join (" ", aot_paths), in_tree_include);
+                                       cmd = String.Format("{4} -o '{2}' -Wall `pkg-config --cflags mono-2` {0} {3} " +
+                                               "`pkg-config --libs-only-L mono-2` " + smonolib +
+                                               "`pkg-config --libs-only-l mono-2 | sed -e \"s/\\-lmono-2.0 //\"` {1}",
+                                               temp_c, temp_o, output, zlib, cc);
                                }
                                else
                                {
@@ -1188,8 +1044,6 @@ void          mono_register_config_for_assembly (const char* assembly_name, cons
                                if (!compile_only){
                                        File.Delete (temp_c);
                                }
-                               if (aot_temp_dir != null)
-                                       aot_temp_dir.Delete (true);
                                File.Delete (temp_s);
                        }
                }
@@ -1477,137 +1331,6 @@ void          mono_register_config_for_assembly (const char* assembly_name, cons
                }
        }
 
-
-       static string EncodeAotSymbol (string symbol)
-       {
-               var sb = new StringBuilder ();
-               /* This mimics what the aot-compiler does */
-               foreach (var b in System.Text.Encoding.UTF8.GetBytes (symbol)) {
-                       char c = (char) b;
-                       if ((c >= '0' && c <= '9') ||
-                               (c >= 'a' && c <= 'z') ||
-                               (c >= 'A' && c <= 'Z')) {
-                               sb.Append (c);
-                               continue;
-                       }
-                       sb.Append ('_');
-               }
-               return sb.ToString ();
-       }
-
-       static void AotCompile (List<string> files)
-       {
-               if (aot_runtime == null)
-                       aot_runtime = runtime;
-
-               if (aot_runtime == null) {
-                       Error ("You must specify at least one aot runtime with --runtime or --cross or --aot_runtime when AOT compiling");
-                       Environment.Exit (1);
-               }
-
-               var aot_mode_string = "";
-               if (aot_mode != null)
-                       aot_mode_string = "," + aot_mode;
-
-               var dedup_mode_string = "";
-               StringBuilder all_assemblies = null;
-               if (aot_dedup_assembly != null) {
-                       dedup_mode_string = ",dedup-skip";
-                       all_assemblies = new StringBuilder("");
-               }
-
-               Console.WriteLine ("Aoting files:");
-
-               for (int i=0; i < files.Count; i++) {
-                       var file_name = files [i];
-                       string path = LocateFile (new Uri (file_name).LocalPath);
-                       string outPath = String.Format ("{0}.aot_out", path);
-                       aot_paths.Add (outPath);
-                       var name = System.Reflection.Assembly.LoadFrom(path).GetName().Name;
-                       aot_names.Add (EncodeAotSymbol (name));
-
-                       if (aot_dedup_assembly != null) {
-                               all_assemblies.Append (path);
-                               all_assemblies.Append (" ");
-                               Execute (String.Format ("MONO_PATH={0} {1} --aot={2},outfile={3}{4}{5} {6}",
-                                       Path.GetDirectoryName (path), aot_runtime, aot_args, outPath, aot_mode_string, dedup_mode_string, path));
-                       } else {
-                               Execute (String.Format ("MONO_PATH={0} {1} --aot={2},outfile={3}{4} {5}",
-                                       Path.GetDirectoryName (path), aot_runtime, aot_args, outPath, aot_mode_string, path));
-                       }
-               }
-               if (aot_dedup_assembly != null) {
-                       var filePath = new Uri (aot_dedup_assembly).LocalPath;
-                       string path = LocateFile (filePath);
-                       dedup_mode_string = String.Format (",dedup-include={0}", Path.GetFileName(filePath));
-                       string outPath = String.Format ("{0}.aot_out", path);
-                       Execute (String.Format ("MONO_PATH={7} {0} --aot={1},outfile={2}{3}{4} {5} {6}",
-                               aot_runtime, aot_args, outPath, aot_mode_string, dedup_mode_string, path, all_assemblies.ToString (), Path.GetDirectoryName (path)));
-               }
-
-               if ((aot_mode == "full" || aot_mode == "llvmonly") && cil_strip_path != null) {
-                       for (int i=0; i < files.Count; i++) {
-                               var in_name = new Uri (files [i]).LocalPath;
-                               var cmd = String.Format ("{0} {1} {2}", aot_runtime, cil_strip_path, in_name);
-                               Execute (cmd);
-                       }
-               }
-       }
-
-       static void LinkManaged (List <string> files, string outDir)
-       {
-               if (managed_linker_path == null)
-                       return;
-
-               var paths = new StringBuilder ("");
-               foreach (var file in files) {
-                       paths.Append (" -a  ");
-                       paths.Append (new Uri (file).LocalPath);
-               }
-
-               var cmd = String.Format ("{0} {1} -b true -out {2} {3} -c link -p copy ", runtime, managed_linker_path, outDir, paths.ToString ());
-               Execute (cmd);
-       }
-
-       static void PreprocessAssemblies (List <string> chosenFiles, List <string> files)
-       {
-               if (aot_mode == "" || (cil_strip_path == null && managed_linker_path == null))
-                       return;
-
-               var temp_dir_name = Path.Combine(Directory.GetCurrentDirectory(), "temp_assemblies");
-               aot_temp_dir = new DirectoryInfo (temp_dir_name);
-               if (aot_temp_dir.Exists) {
-                       Console.WriteLine ("Removing previous build cache at {0}", temp_dir_name);
-                       aot_temp_dir.Delete (true);
-               }
-               aot_temp_dir.Create ();
-
-               //if (managed_linker_path != null) {
-                       //LinkManaged (chosenFiles, temp_dir);
-
-                       //// Replace list with new list of files
-                       //files.Clear ();
-                       //Console.WriteLine ("Iterating {0}", temp_dir);
-                       //aot_temp_dir = new DirectoryInfo (temp_dir);
-                       //foreach (var file in aot_temp_dir.GetFiles ()) {
-                               //files.Append (String.Format ("file:///{0}", file));
-                               //Console.WriteLine (String.Format ("file:///{0}", file));
-                       //}
-                       //return;
-               //}
-
-               // Fix file references
-               for (int i=0; i < files.Count; i++) {
-                       var in_name = new Uri (files [i]).LocalPath;
-                       var out_name = Path.Combine (temp_dir_name, Path.GetFileName (in_name));
-                       File.Copy (in_name, out_name);
-                       files [i] = out_name;
-                       if (in_name == aot_dedup_assembly)
-                               aot_dedup_assembly = out_name;
-               }
-       }
-
-
        static void Execute (string cmdLine)
        {
                if (IsUnix) {
index 243ba3fbfe2189e201f328a515bf55a819a36647..7d4aaea14ffdb94f638151d06a6dc39c55ddba85 100644 (file)
@@ -2,6 +2,4 @@ void mono_mkbundle_init ()
 {
        install_dll_config_files ();
        mono_register_bundled_assemblies(bundled);
-
-       install_aot_modules ();
 }
index b706210add30a16ffbdb42219dd7eedd0ff1474f..ccd228b57afc85ea3afff58e3cd1dd1fa748d2fd 100755 (executable)
@@ -1,10 +1,5 @@
 #!/bin/bash -e
 
-if test -n "${MONO_STATIC_AOT}";
-then
-${TESTCMD} --label=mkbundle --timeout=25m make -j 4 -w -C mcs/class/corlib -k mkbundle-all-tests
-fi
-
 if test -n "${MONO_LLVMONLY}";
 then
 ${TESTCMD} --label=mini --timeout=25m make -j 4 -w -C mono/mini -k llvmonlycheck