Merge pull request #3979 from radical/fix-xbuild-tgt
authorAnkit Jain <radical@gmail.com>
Thu, 17 Nov 2016 18:22:49 +0000 (13:22 -0500)
committerGitHub <noreply@github.com>
Thu, 17 Nov 2016 18:22:49 +0000 (13:22 -0500)
[xbuild] Handle a repeat build of a target, when building through ..

34 files changed:
acceptance-tests/ms-test-suite.mk
external/bockbuild
mcs/build/library.make
mcs/build/rules.make
mcs/class/Mono.Posix/Mono.Unix.Native/Stdlib.cs
mcs/class/Mono.Posix/Mono.Unix/StdioFileStream.cs
mcs/class/System/Mono.Btls/MonoBtlsContext.cs
mcs/class/System/Mono.Btls/MonoBtlsSsl.cs
mcs/class/aot-compiler/Makefile
mcs/class/corlib/System.Security.Cryptography/IncrementalHash.cs
mcs/mcs/membercache.cs
mcs/tests/gtest-640.cs [new file with mode: 0644]
mcs/tests/ver-il-net_4_x.xml
mono/btls/CMakeLists.txt
mono/btls/btls-ssl.c
mono/btls/btls-ssl.h
mono/io-layer/io.c
mono/metadata/class.c
mono/metadata/threads.c
mono/mini/aot-compiler.c
mono/mini/cpu-ppc64.md
mono/mini/method-to-ir.c
mono/mini/mini-runtime.c
mono/mini/mini.c
mono/mini/mini.h
mono/tests/Makefile.am
msvc/monoposixhelper.def
scripts/ci/run-jenkins.sh
scripts/ci/run-test-default.sh
support/map.h
support/stdio.c
support/stdlib.c
tools/offsets-tool/.gitignore
tools/offsets-tool/Makefile

index 318fe2c2328c1afea1642f4ca9ada3d1a3b0faf4..1516dc61db68079b727791a9af45918375955c7a 100644 (file)
@@ -1,6 +1,6 @@
-check-ms-test-suite:
+check-ms-test-suite: $(CLASS)/nunitlite.dll
        @if $(MAKE) validate-ms-test-suite RESET_VERSIONS=1; then \
-               $(MAKE) -C $(MSTESTSUITE_PATH)/conformance build MCS="$(MCS) -debug -t:library -warn:1 -r:nunitlite.dll" && \
+               $(MAKE) -C $(MSTESTSUITE_PATH)/conformance build MCS="$(MCS) -debug -t:library -warn:1 -r:$(CLASS)/nunitlite.dll" && \
                $(MAKE) -C $(MSTESTSUITE_PATH)/conformance run NUNIT-CONSOLE="$(RUNTIME) $(CLASS)/nunit-lite-console.exe -exclude=MonoBug,BadTest -format:nunit2" NUNIT_XML_RESULT="-result:$(abs_top_builddir)/acceptance-tests/TestResult-ms-test-suite-conformance.xml" || EXIT_CODE=1; \
                $(MAKE) -C $(MSTESTSUITE_PATH)/systemruntimebringup build MCS="$(MCS) -debug -warn:1" && \
                $(MAKE) -C $(MSTESTSUITE_PATH)/systemruntimebringup run MONO="$(RUNTIME)" || EXIT_CODE=1; \
@@ -8,3 +8,6 @@ check-ms-test-suite:
        else \
                echo "*** [ms-test-suite] Getting the repository failed, you probably don't have access to this Xamarin-internal resource. Skipping."; \
        fi
+
+$(CLASS)/nunitlite.dll:
+       $(MAKE) -C $(mcs_topdir)/tools/nunit-lite
index cc441a606b409159d1704d5ee78c88e06e0d5332..f42561e9ff8e60483897bb54e2191344556de94e 160000 (submodule)
@@ -1 +1 @@
-Subproject commit cc441a606b409159d1704d5ee78c88e06e0d5332
+Subproject commit f42561e9ff8e60483897bb54e2191344556de94e
index e0c16f48e90558609352e080ed67c54f4e64b43e..e604beb8f75e5cdcf411a963970d3423f2f377c6 100644 (file)
@@ -316,8 +316,6 @@ endif
 library_CLEAN_FILES += $(PROFILE)_aot.log
 
 ifdef PLATFORM_AOT_SUFFIX
-Q_AOT=$(if $(V),,@echo "AOT     [$(PROFILE)] $(notdir $(@))";)
-
 $(the_lib)$(PLATFORM_AOT_SUFFIX): $(the_lib)
        $(Q_AOT) MONO_PATH='$(the_libdir_base)' > $(PROFILE)_$(LIBRARY_NAME)_aot.log 2>&1 $(RUNTIME) $(AOT_BUILD_FLAGS) --debug $(the_lib)
 
index d25eb35f6e8f9a3510bcb3f2fdd6c527538601b0..18e2739bb8686c2a0825af71c4b00c80fac53a49 100644 (file)
@@ -23,6 +23,7 @@ VERSION = 0.93
 Q=$(if $(V),,@)
 # echo -e "\\t" does not work on some systems, so use 5 spaces
 Q_MCS=$(if $(V),,@echo "MCS     [$(intermediate)$(PROFILE)] $(notdir $(@))";)
+Q_AOT=$(if $(V),,@echo "AOT     [$(intermediate)$(PROFILE)] $(notdir $(@))";)
 
 ifndef BUILD_TOOLS_PROFILE
 BUILD_TOOLS_PROFILE = build
@@ -163,7 +164,6 @@ STD_TARGETS = test run-test run-test-ondotnet clean install uninstall doc-update
 $(STD_TARGETS): %: do-%
 
 ifdef PLATFORM_AOT_SUFFIX
-AOT_PROFILE_ASSEMBLIES = $(shell cd $(topdir)/class/lib/$(PROFILE)/ && find . | grep -E '(dll|exe)$$' | grep -v -E 'bare|plaincore|secxml|Facades' | sed 's:\./::g' | tr '\n' ' ')
 
 do-all-aot:
        $(MAKE) do-all TOP_LEVEL_DO=do-all
@@ -174,18 +174,16 @@ do-all-aot:
 # be able to evaluate the .dylibs to make
 ifneq ("$(wildcard $(topdir)/class/lib/$(PROFILE))","")
 
-AOT_PROFILE_ASSEMBLIES_CMD = cd $(topdir)/class/lib/$(PROFILE)/ && find . | grep -E '(dll|exe)$$' | grep -v -E 'bare|plaincore|secxml|Facades|ilasm' | sed 's:\./::g' | tr '\n' ' '
-AOT_PROFILE_ASSEMBLIES_CMD_SAFE = $(AOT_PROFILE_ASSEMBLIES_CMD) || true
-AOT_PROFILE_ASSEMBLIES = $(shell $(AOT_PROFILE_ASSEMBLIES_CMD_SAFE))
+AOT_PROFILE_ASSEMBLIES := $(sort $(patsubst .//%,%,$(filter-out %bare% %plaincore% %secxml% %Facades% %ilasm%,$(filter %.dll %.exe,$(wildcard $(topdir)/class/lib/$(PROFILE)/*)))))
 
 # This can run in parallel
 .PHONY: aot-all-profile
-aot-all-profile: $(patsubst %,$(topdir)/class/lib/$(PROFILE)/%$(PLATFORM_AOT_SUFFIX),$(AOT_PROFILE_ASSEMBLIES))
+aot-all-profile: $(patsubst %,%$(PLATFORM_AOT_SUFFIX),$(AOT_PROFILE_ASSEMBLIES))
 
-$(topdir)/class/lib/$(PROFILE)/%$(PLATFORM_AOT_SUFFIX): $(topdir)/class/lib/$(PROFILE)/%
-       @ mkdir -p $(topdir)/class/lib/$(PROFILE)/$*_bitcode_tmp
-       @echo "AOT     [$(PROFILE)] AOT $* " && cd $(topdir)/class/lib/$(PROFILE)/ && MONO_PATH="." $(RUNTIME) $(RUNTIME_FLAGS) $(AOT_BUILD_FLAGS),temp-path=$*_bitcode_tmp $* >> $(PROFILE)-aot.log
-       @ rm -rf $(topdir)/class/lib/$(PROFILE)/$*_bitcode_tmp
+%$(PLATFORM_AOT_SUFFIX): %
+       @ mkdir -p $*_bitcode_tmp
+       $(Q_AOT) MONO_PATH="$(dir $*)" $(RUNTIME) $(RUNTIME_FLAGS) $(AOT_BUILD_FLAGS),temp-path=$*_bitcode_tmp --verbose $* > $@.aot-log
+       @ rm -rf $*_bitcode_tmp
 
 endif #ifneq ("$(wildcard $(topdir)/class/lib/$(PROFILE))","")
 
index e4c34cba317f28629d885cb370e536fc3cabb29f..86cdb7126fe305d62a5283fc7bed694d3ec264b2 100644 (file)
@@ -675,7 +675,8 @@ namespace Mono.Unix.Native {
                                [MarshalAs (UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(FileNameMarshaler))]
                                string newpath);
 
-               [DllImport (LIBC, CallingConvention=CallingConvention.Cdecl, SetLastError=true)]
+               [DllImport (MPH, CallingConvention=CallingConvention.Cdecl,
+                               SetLastError=true, EntryPoint="Mono_Posix_Stdlib_tmpfile")]
                public static extern IntPtr tmpfile ();
 
                private static object tmpnam_lock = new object ();
@@ -704,18 +705,22 @@ namespace Mono.Unix.Native {
                        }
                }
 
-               [DllImport (LIBC, CallingConvention=CallingConvention.Cdecl, SetLastError=true)]
+               [DllImport (MPH, CallingConvention=CallingConvention.Cdecl,
+                               SetLastError=true, EntryPoint="Mono_Posix_Stdlib_fclose")]
                public static extern int fclose (IntPtr stream);
 
-               [DllImport (LIBC, CallingConvention=CallingConvention.Cdecl, SetLastError=true)]
+               [DllImport (MPH, CallingConvention=CallingConvention.Cdecl,
+                               SetLastError=true, EntryPoint="Mono_Posix_Stdlib_fflush")]
                public static extern int fflush (IntPtr stream);
 
-               [DllImport (LIBC, CallingConvention=CallingConvention.Cdecl, SetLastError=true)]
+               [DllImport (MPH, CallingConvention=CallingConvention.Cdecl,
+                               SetLastError=true, EntryPoint="Mono_Posix_Stdlib_fopen")]
                public static extern IntPtr fopen (
                                [MarshalAs (UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(FileNameMarshaler))]
                                string path, string mode);
 
-               [DllImport (LIBC, CallingConvention=CallingConvention.Cdecl, SetLastError=true)]
+               [DllImport (MPH, CallingConvention=CallingConvention.Cdecl,
+                               SetLastError=true, EntryPoint="Mono_Posix_Stdlib_freopen")]
                public static extern IntPtr freopen (
                                [MarshalAs (UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(FileNameMarshaler))]
                                string path, string mode, IntPtr stream);
@@ -741,8 +746,8 @@ namespace Mono.Unix.Native {
                        return setvbuf (stream, (IntPtr) buf, mode, size);
                }
 
-               [DllImport (LIBC, CallingConvention=CallingConvention.Cdecl,
-                               EntryPoint="fprintf")]
+               [DllImport (MPH, CallingConvention=CallingConvention.Cdecl,
+                               EntryPoint="Mono_Posix_Stdlib_fprintf")]
                private static extern int sys_fprintf (IntPtr stream, string format, string message);
 
                public static int fprintf (IntPtr stream, string message)
@@ -846,11 +851,12 @@ namespace Mono.Unix.Native {
                 *    vsscanf(3)
                 */
 
-               [DllImport (LIBC, CallingConvention=CallingConvention.Cdecl, SetLastError=true)]
+               [DllImport (MPH, CallingConvention=CallingConvention.Cdecl,
+                               SetLastError=true, EntryPoint="Mono_Posix_Stdlib_fgetc")]
                public static extern int fgetc (IntPtr stream);
 
-               [DllImport (LIBC, CallingConvention=CallingConvention.Cdecl,
-                               SetLastError=true, EntryPoint="fgets")]
+               [DllImport (MPH, CallingConvention=CallingConvention.Cdecl,
+                               SetLastError=true, EntryPoint="Mono_Posix_Stdlib_fgets")]
                private static extern IntPtr sys_fgets (StringBuilder sb, int size, IntPtr stream);
 
                public static StringBuilder fgets (StringBuilder sb, int size, IntPtr stream)
@@ -866,22 +872,28 @@ namespace Mono.Unix.Native {
                        return fgets (sb, sb.Capacity, stream);
                }
 
-               [DllImport (LIBC, CallingConvention=CallingConvention.Cdecl, SetLastError=true)]
+               [DllImport (MPH, CallingConvention=CallingConvention.Cdecl,
+                               SetLastError=true, EntryPoint="Mono_Posix_Stdlib_fputc")]
                public static extern int fputc (int c, IntPtr stream);
 
-               [DllImport (LIBC, CallingConvention=CallingConvention.Cdecl, SetLastError=true)]
+               [DllImport (MPH, CallingConvention=CallingConvention.Cdecl,
+                               SetLastError=true, EntryPoint="Mono_Posix_Stdlib_fputs")]
                public static extern int fputs (string s, IntPtr stream);
 
-               [DllImport (LIBC, CallingConvention=CallingConvention.Cdecl, SetLastError=true)]
-               public static extern int getc (IntPtr stream);
+               public static int getc (IntPtr stream)
+               {
+                       return fgetc (stream);
+               }
 
                [DllImport (LIBC, CallingConvention=CallingConvention.Cdecl, SetLastError=true)]
                public static extern int getchar ();
 
                /* SKIP: gets(3) */
 
-               [DllImport (LIBC, CallingConvention=CallingConvention.Cdecl, SetLastError=true)]
-               public static extern int putc (int c, IntPtr stream);
+               public static int putc (int c, IntPtr stream)
+               {
+                       return fputc (c, stream);
+               }
 
                [DllImport (LIBC, CallingConvention=CallingConvention.Cdecl, SetLastError=true)]
                public static extern int putchar (int c);
@@ -889,7 +901,8 @@ namespace Mono.Unix.Native {
                [DllImport (LIBC, CallingConvention=CallingConvention.Cdecl, SetLastError=true)]
                public static extern int puts (string s);
 
-               [DllImport (LIBC, CallingConvention=CallingConvention.Cdecl, SetLastError=true)]
+               [DllImport (MPH, CallingConvention=CallingConvention.Cdecl,
+                               SetLastError=true, EntryPoint="Mono_Posix_Stdlib_ungetc")]
                public static extern int ungetc (int c, IntPtr stream);
 
                [CLSCompliant (false)]
@@ -993,10 +1006,12 @@ namespace Mono.Unix.Native {
                                SetLastError=true, EntryPoint="Mono_Posix_Stdlib_clearerr")]
                public static extern int clearerr (IntPtr stream);
 
-               [DllImport (LIBC, CallingConvention=CallingConvention.Cdecl)]
+               [DllImport (MPH, CallingConvention=CallingConvention.Cdecl,
+                               SetLastError=true, EntryPoint="Mono_Posix_Stdlib_feof")]
                public static extern int feof (IntPtr stream);
 
-               [DllImport (LIBC, CallingConvention=CallingConvention.Cdecl)]
+               [DllImport (MPH, CallingConvention=CallingConvention.Cdecl,
+                               SetLastError=true, EntryPoint="Mono_Posix_Stdlib_ferror")]
                public static extern int ferror (IntPtr stream);
 
                [DllImport (MPH, CallingConvention=CallingConvention.Cdecl, 
@@ -1050,7 +1065,8 @@ namespace Mono.Unix.Native {
                                SetLastError=true, EntryPoint="Mono_Posix_Stdlib_calloc")]
                public static extern IntPtr calloc (ulong nmemb, ulong size);
 
-               [DllImport (LIBC, CallingConvention=CallingConvention.Cdecl)]
+               [DllImport (MPH, CallingConvention=CallingConvention.Cdecl,
+                               EntryPoint="Mono_Posix_Stdlib_free")]
                public static extern void free (IntPtr ptr);
 
                // malloc(3):
index 7eed08157b0748ff075ad7bcc362aa8709d4b74a..1d0ef97e9f7e5aeb081304271e8211a586084abe 100644 (file)
@@ -60,35 +60,43 @@ namespace Mono.Unix {
 
                public StdioFileStream (string path)
                {
+                       if (path == null)
+                               throw new ArgumentNullException ("path");
                        InitStream (Fopen (path, "rb"), true);
                }
 
                public StdioFileStream (string path, string mode)
                {
+                       if (path == null)
+                               throw new ArgumentNullException ("path");
                        InitStream (Fopen (path, mode), true);
                }
 
                public StdioFileStream (string path, FileMode mode)
                {
+                       if (path == null)
+                               throw new ArgumentNullException ("path");
                        InitStream (Fopen (path, ToFopenMode (path, mode)), true);
                }
 
                public StdioFileStream (string path, FileAccess access)
                {
+                       if (path == null)
+                               throw new ArgumentNullException ("path");
                        InitStream (Fopen (path, ToFopenMode (path, access)), true);
                        InitCanReadWrite (access);
                }
 
                public StdioFileStream (string path, FileMode mode, FileAccess access)
                {
+                       if (path == null)
+                               throw new ArgumentNullException ("path");
                        InitStream (Fopen (path, ToFopenMode (path, mode, access)), true);
                        InitCanReadWrite (access);
                }
 
                private static IntPtr Fopen (string path, string mode)
                {
-                       if (path == null)
-                               throw new ArgumentNullException ("path");
                        if (path.Length == 0)
                                throw new ArgumentException ("path");
                        if (mode == null)
index 051656ce0536f5bff3e4a82fc9f2ed76d344f823..343ecc47e45759d2347c4e8d98b6e019eb3e8a6e 100644 (file)
@@ -270,11 +270,13 @@ namespace Mono.Btls
 
                        var cipher = (CipherSuiteCode)ssl.GetCipher ();
                        var protocol = (TlsProtocolCode)ssl.GetVersion ();
+                       var serverName = ssl.GetServerName ();
                        Debug ("GET CONNECTION INFO: {0:x}:{0} {1:x}:{1} {2}", cipher, protocol, (TlsProtocolCode)protocol);
 
                        connectionInfo = new MonoTlsConnectionInfo {
                                CipherSuiteCode = cipher,
-                               ProtocolVersion = GetProtocol (protocol)
+                               ProtocolVersion = GetProtocol (protocol),
+                               PeerDomainName = serverName
                        };
                }
 
index d7510901357fdb925c7cd32cd7df98e6794cf912..8ef902f3a1ce41404460b053a85b8df59ed44063 100644 (file)
@@ -124,6 +124,9 @@ namespace Mono.Btls
                [DllImport (BTLS_DYLIB)]
                extern static int mono_btls_ssl_set_server_name (IntPtr handle, IntPtr name);
 
+               [DllImport (BTLS_DYLIB)]
+               extern static IntPtr mono_btls_ssl_get_server_name (IntPtr handle);
+
                static BoringSslHandle Create_internal (MonoBtlsSslCtx ctx)
                {
                        var handle = mono_btls_ssl_new (ctx.Handle.DangerousGetHandle ());
@@ -409,6 +412,16 @@ namespace Mono.Btls
                        }
                }
 
+               public string GetServerName ()
+               {
+                       CheckThrow ();
+                       var namePtr = mono_btls_ssl_get_server_name (
+                               Handle.DangerousGetHandle ());
+                       if (namePtr == IntPtr.Zero)
+                               return null;
+                       return Marshal.PtrToStringAnsi (namePtr);
+               }
+
                protected override void Close ()
                {
                        mono_btls_ssl_close (Handle.DangerousGetHandle ());
index 3f22e653c194bb21bb73162180d68468beb1be8e..f01e0b18164ae532270648e0c0d9ca2a3144a347 100644 (file)
@@ -28,7 +28,6 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)
 ifndef SKIP_AOT
 
 ifdef PLATFORM_AOT_SUFFIX
-Q_AOT=$(if $(V),,@echo "AOT     [$(PROFILE)] $(notdir $(@))";)
 $(mcs_aot_image): $(mcs_exe) $(mscorlib_dll) $(runtime_dep)
        $(Q_AOT) MONO_PATH='$(the_libdir)' > $(PROFILE)_aot.log 2>&1 $(RUNTIME) --aot=bind-to-runtime-version,outfile=$(mcs_aot_image) --debug $(mcs_exe) || cat $(PROFILE)_aot.log || (cat $(PROFILE)_aot.log; exit 1)
 
index d52ed93facf33d27df5138f04fb8b40406d786b8..14c895e597a9cd4a1297218e0c03a649bd95296d 100644 (file)
@@ -32,7 +32,7 @@ namespace System.Security.Cryptography
 {
     public sealed class IncrementalHash : IDisposable
     {
-        public IncrementalHash () { }
+        private IncrementalHash () { }
         public HashAlgorithmName AlgorithmName { get { throw new NotImplementedException (); } }
         public void AppendData (byte[] data) { }
         public void AppendData (byte[] data, int offset, int count) { }
index 27b7f586932c7d01e355f5bc2745512d5cb07a1a..d3b0f86d8164bd2338d66fe6ca7a8df689bf07cc 100644 (file)
@@ -1024,6 +1024,7 @@ namespace Mono.CSharp {
                                                                                shared_list = false;
                                                                                prev = new List<MemberSpec> (found.Count + 1);
                                                                                prev.AddRange (found);
+                                                                               found = prev;
                                                                        } else {
                                                                                prev = (List<MemberSpec>) found;
                                                                        }
diff --git a/mcs/tests/gtest-640.cs b/mcs/tests/gtest-640.cs
new file mode 100644 (file)
index 0000000..2aeebb4
--- /dev/null
@@ -0,0 +1,39 @@
+using System;
+
+public struct Test
+{
+       public static Test op_Addition<T>(Test p1, T p2)
+       {
+               throw new ApplicationException ();
+       }
+
+       public static int op_Addition<T>(T p1, int p2)
+       {
+               throw new ApplicationException ();
+       }
+
+       public static Test operator +(Test p1, Test p2)
+       {
+               throw new ApplicationException ();
+       }
+
+       public static long operator +(Test p1, int p2)
+       {
+               return 4;
+       }
+}
+
+public class Program
+{
+       public static int Main ()
+       {
+               var t = new Test ();
+
+               int p2 = 20;
+               var res = t + p2;
+               if (res != 4)
+                       return 1;
+
+               return 0;
+       }
+}
\ No newline at end of file
index 7df1a90869f6c5f7214af565f80b61175578bc42..ddb13732d045f93741bf1e5899a1ef29903e6590 100644 (file)
       </method>
     </type>
   </test>
+  <test name="gtest-640.cs">
+    <type name="Test">
+      <method name="Test op_Addition[T](Test, T)" attrs="150">
+        <size>7</size>
+      </method>
+      <method name="Int32 op_Addition[T](T, Int32)" attrs="150">
+        <size>7</size>
+      </method>
+      <method name="Test op_Addition(Test, Test)" attrs="2198">
+        <size>7</size>
+      </method>
+      <method name="Int64 op_Addition(Test, Int32)" attrs="2198">
+        <size>11</size>
+      </method>
+    </type>
+    <type name="Program">
+      <method name="Int32 Main()" attrs="150">
+        <size>44</size>
+      </method>
+      <method name="Void .ctor()" attrs="6278">
+        <size>7</size>
+      </method>
+    </type>
+  </test>
   <test name="gtest-anontype-01.cs">
     <type name="Test">
       <method name="Int32 Main()" attrs="150">
index 7c3fb3d2c72fe03d751753e5f811c2793ae03e30..41ad49155e0d8442d2ca07c152436841d9d03e77 100644 (file)
@@ -22,7 +22,13 @@ if (NOT "${BTLS_ARCH}" STREQUAL "")
        message (WARNING "SET ARCH: ${BTLS_ARCH}")
        set (CMAKE_SYSTEM_PROCESSOR "${BTLS_ARCH}")
 endif ()
+if (BUILD_DYNAMIC_BTLS)
+set (C_CXX_FLAGS "-Wall -Wsign-compare -Wmissing-field-initializers -fPIC -ggdb -fvisibility=hidden")
+elseif (BUILD_SHARED_LIBS)
+set (C_CXX_FLAGS "-Wall -Wsign-compare -Wmissing-field-initializers -fPIC -ggdb -fvisibility=hidden")
+else ()
 set (C_CXX_FLAGS "-Wall -Wsign-compare -Wmissing-field-initializers -ggdb -fvisibility=hidden")
+endif()
 set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${C_CXX_FLAGS} ${BTLS_CFLAGS}")
 set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${C_CXX_FLAGS} ${BTLS_CFLAGS}")
 set (CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} ${BTLS_CFLAGS}")
index f18d6c19247d968557f054379b1a22e1d54b2571..dda74ec4b5eae5788dd0015565be95f576f9ef5c 100644 (file)
@@ -207,3 +207,9 @@ mono_btls_ssl_set_server_name (MonoBtlsSsl *ptr, const char *name)
 {
        return SSL_set_tlsext_host_name (ptr->ssl, name);
 }
+
+MONO_API const char *
+mono_btls_ssl_get_server_name (MonoBtlsSsl *ptr)
+{
+       return SSL_get_servername (ptr->ssl, TLSEXT_NAMETYPE_host_name);
+}
index 10da4364881a7fc51177e9224278e09dfe0d2640..98b017340e1b1a956da2bafdaf056e5bd3c0b33b 100644 (file)
@@ -77,6 +77,9 @@ mono_btls_ssl_set_verify_param (MonoBtlsSsl *ptr, const MonoBtlsX509VerifyParam
 int
 mono_btls_ssl_set_server_name (MonoBtlsSsl *ptr, const char *name);
 
+const char *
+mono_btls_ssl_get_server_name (MonoBtlsSsl *ptr);
+
 void
 mono_btls_ssl_destroy (MonoBtlsSsl *ptr);
 
index c0f25fcd98a69d89a4ab5d7aea386caadc62481c..70a374557dd3a9a16f32956790699accd6efdfb7 100644 (file)
@@ -1764,7 +1764,12 @@ gpointer CreateFile(const gunichar2 *name, guint32 fileaccess,
        if (attrs & FILE_FLAG_RANDOM_ACCESS)
                posix_fadvise (fd, 0, 0, POSIX_FADV_RANDOM);
 #endif
-       
+
+#ifdef F_RDAHEAD
+       if (attrs & FILE_FLAG_SEQUENTIAL_SCAN)
+               fcntl(fd, F_RDAHEAD, 1);
+#endif
+
 #ifndef S_ISFIFO
 #define S_ISFIFO(m) ((m & S_IFIFO) != 0)
 #endif
index 3f54ba7397c04d4e32e998a530b0d2a32b7bfd1c..f8f2d7dca8a5c400cbd210ce77153f7ff3e08d9c 100644 (file)
@@ -1688,6 +1688,9 @@ mono_class_init_sizes (MonoClass *klass)
        MonoCachedClassInfo cached_info;
        gboolean has_cached_info;
 
+       if (klass->size_inited)
+               return;
+
        has_cached_info = mono_class_get_cached_class_info (klass, &cached_info);
 
        init_sizes_with_info (klass, has_cached_info ? &cached_info : NULL);
@@ -2090,6 +2093,17 @@ mono_class_layout_fields (MonoClass *klass, int base_instance_size, int packing_
        mono_loader_lock ();
        if (klass->instance_size && !klass->image->dynamic) {
                /* Might be already set using cached info */
+               if (klass->instance_size != instance_size) {
+                       /* Emit info to help debugging */
+                       g_print ("%d %d %d %d\n", klass->instance_size, instance_size, klass->blittable, blittable);
+                       g_print ("%d %d %d %d\n", klass->has_references, has_references, klass->packing_size, packing_size);
+                       g_print ("%d %d\n", klass->min_align, min_align);
+                       for (i = 0; i < top; ++i) {
+                               field = &klass->fields [i];
+                               if (!(field->type->attrs & FIELD_ATTRIBUTE_STATIC))
+                                       printf ("  %d %d\n", klass->fields [i].offset, field_offsets [i]);
+                       }
+               }
                g_assert (klass->instance_size == instance_size);
        } else {
                klass->instance_size = instance_size;
index 83ac3dd994b2e47ec5e10becd6e65abd8495a717..51d7ccac064356305041fc2d2e62afb63ccedff6 100644 (file)
@@ -140,12 +140,12 @@ static StaticDataInfo context_static_info;
 /* The hash of existing threads (key is thread ID, value is
  * MonoInternalThread*) that need joining before exit
  */
-static MonoGHashTable *threads=NULL;
+static MonoGHashTable *threads;
 
 /* List of app context GC handles.
  * Added to from ves_icall_System_Runtime_Remoting_Contexts_Context_RegisterContext ().
  */
-static GHashTable *contexts = NULL;
+static GHashTable *contexts;
 
 /* Cleanup queue for contexts. */
 static MonoReferenceQueue *context_queue;
@@ -155,7 +155,7 @@ static MonoReferenceQueue *context_queue;
  * When mono_thread_attach_internal is called for a thread, it will be removed from this hash table.
  * Protected by mono_threads_lock ().
  */
-static MonoGHashTable *threads_starting_up = NULL;
+static MonoGHashTable *threads_starting_up;
 
 /* The TLS key that holds the MonoObject assigned to each thread */
 static MonoNativeTlsKey current_object_key;
@@ -165,6 +165,15 @@ static MonoNativeTlsKey current_object_key;
 static GHashTable *joinable_threads;
 static int joinable_thread_count;
 
+#define thread_wait_lock() mono_os_mutex_lock (&thread_wait_mutex)
+#define thread_wait_unlock() mono_os_mutex_unlock (&thread_wait_mutex)
+static mono_mutex_t thread_wait_mutex;
+/* Used to wait for a thread to be joined or to change state */
+/* Used to wait for njoined_threads to increase or for background_change to become true */
+static mono_cond_t thread_wait_cond;
+static int njoined_threads;
+static gboolean background_changed;
+
 #ifdef MONO_HAVE_FAST_TLS
 /* we need to use both the Tls* functions and __thread because
  * the gc needs to see all the threads 
@@ -214,8 +223,10 @@ static mono_mutex_t interlocked_mutex;
 /* global count of thread interruptions requested */
 static gint32 thread_interruption_requested = 0;
 
+#ifdef HOST_WIN32
 /* Event signaled when a thread changes its background mode */
 static MonoOSEvent background_change_event;
+#endif
 
 static gboolean shutting_down = FALSE;
 
@@ -2072,6 +2083,18 @@ ves_icall_System_Threading_Thread_MemoryBarrier (void)
        mono_memory_barrier ();
 }
 
+static void
+signal_background_change (void)
+{
+       thread_wait_lock ();
+       background_changed = TRUE;
+       mono_os_cond_signal (&thread_wait_cond);
+       thread_wait_unlock ();
+#ifdef HOST_WIN32
+       mono_os_event_set (&background_change_event);
+#endif
+}
+
 void
 ves_icall_System_Threading_Thread_ClrState (MonoInternalThread* this_obj, guint32 state)
 {
@@ -2082,7 +2105,7 @@ ves_icall_System_Threading_Thread_ClrState (MonoInternalThread* this_obj, guint3
                 * be notified, since it has to rebuild the list of threads to
                 * wait for.
                 */
-               mono_os_event_set (&background_change_event);
+               signal_background_change ();
        }
 }
 
@@ -2096,7 +2119,7 @@ ves_icall_System_Threading_Thread_SetState (MonoInternalThread* this_obj, guint3
                 * be notified, since it has to rebuild the list of threads to
                 * wait for.
                 */
-               mono_os_event_set (&background_change_event);
+               signal_background_change ();
        }
 }
 
@@ -2856,8 +2879,13 @@ void mono_thread_init (MonoThreadStartCB start_cb,
 
        mono_os_mutex_init_recursive(&interlocked_mutex);
        mono_os_mutex_init_recursive(&joinable_threads_mutex);
+
+       mono_os_mutex_init_recursive(&thread_wait_mutex);
+       mono_os_cond_init(&thread_wait_cond);
        
+#ifdef HOST_WIN32
        mono_os_event_init (&background_change_event, FALSE);
+#endif
        
        mono_init_static_data_info (&thread_static_info);
        mono_init_static_data_info (&context_static_info);
@@ -2889,7 +2917,9 @@ void mono_thread_cleanup (void)
        mono_os_mutex_destroy (&interlocked_mutex);
        mono_os_mutex_destroy (&delayed_free_table_mutex);
        mono_os_mutex_destroy (&small_id_mutex);
+#ifdef HOST_WIN32
        mono_os_event_destroy (&background_change_event);
+#endif
 #endif
 
        mono_native_tls_free (current_object_key);
@@ -2919,19 +2949,56 @@ static void print_tids (gpointer key, gpointer value, gpointer user)
        g_message ("Waiting for: %p", key);
 }
 
-struct wait_data 
-{
+typedef struct {
+       int njoined;
        MonoThreadHandle *handles[MONO_W32HANDLE_MAXIMUM_WAIT_OBJECTS];
        MonoInternalThread *threads[MONO_W32HANDLE_MAXIMUM_WAIT_OBJECTS];
        guint32 num;
-};
+} WaitData;
 
+/*
+ * wait_for_tids:
+ *
+ * Wait until either:
+ * - wait->num threads are joined
+ * - @check_state_change is TRUE and a thread changes background state
+ * - timeout elapses
+ */
 static void
-wait_for_tids (struct wait_data *wait, guint32 timeout, gboolean check_state_change)
+wait_for_tids (WaitData *wait, guint32 timeout, gboolean check_state_change)
 {
+#ifndef HOST_WIN32
+       /*
+        * Its is complicated to wait for a given set of threads, so we wait for a given
+        * number of threads instead, the caller needs to call us until the set of threads
+        * it is waiting for are terminated.
+        */
+       gboolean finished = FALSE;
+       gint64 start = mono_msec_ticks ();
+       while (!finished) {
+               thread_wait_lock ();
+               if (njoined_threads >= wait->njoined + wait->num || (check_state_change && background_changed)) {
+                       finished = TRUE;
+               } else {
+                       int res = mono_os_cond_timedwait (&thread_wait_cond, &thread_wait_mutex, timeout);
+                       if (res)
+                               finished = TRUE;
+                       if (timeout != INFINITE) {
+                               gint64 now = mono_msec_ticks ();
+                               if (now - start >= timeout) {
+                                       finished = TRUE;
+                               } else {
+                                       timeout -= now - start;
+                                       start = now;
+                               }
+                       }
+               }
+               thread_wait_unlock ();
+       }
+#else
        guint32 i;
        MonoThreadInfoWaitRet ret;
-       
+
        THREAD_DEBUG (g_message("%s: %d threads to wait for in this batch", __func__, wait->num));
 
        /* Add the thread state change event, so it wakes
@@ -2966,87 +3033,102 @@ wait_for_tids (struct wait_data *wait, guint32 timeout, gboolean check_state_cha
                        g_error ("%s: failed to call mono_thread_detach_internal on thread %p, InternalThread: %p", __func__, internal->tid, internal);
                mono_threads_unlock ();
        }
+#endif
+}
+
+static void
+init_wait_data (WaitData *wait)
+{
+       /* This is used calculate the number of joined threads in wait_for_tids () */
+       thread_wait_lock ();
+       wait->njoined = njoined_threads;
+       thread_wait_unlock ();
+       wait->num = 0;
+       /* We must zero all InternalThread pointers to avoid making the GC unhappy. */
+       memset (wait->threads, 0, MONO_W32HANDLE_MAXIMUM_WAIT_OBJECTS * SIZEOF_VOID_P);
 }
 
-static void build_wait_tids (gpointer key, gpointer value, gpointer user)
+static void
+add_wait_thread (WaitData *wait, MonoInternalThread *thread)
 {
-       struct wait_data *wait=(struct wait_data *)user;
+#ifdef HOST_WIN32
+       /* These are not used by the wait_for_tids () code on unix */
+       wait->handles [wait->num] = mono_threads_open_thread_handle (thread->handle);
+#endif
+       wait->threads [wait->num] = thread;
+       wait->num++;
+}
 
-       if(wait->num<MONO_W32HANDLE_MAXIMUM_WAIT_OBJECTS - 1) {
-               MonoInternalThread *thread=(MonoInternalThread *)value;
+static void
+build_wait_tids (gpointer key, gpointer value, gpointer user)
+{
+       WaitData *wait = (WaitData *)user;
+       MonoInternalThread *thread = (MonoInternalThread *)value;
 
-               /* Ignore background threads, we abort them later */
-               /* Do not lock here since it is not needed and the caller holds threads_lock */
-               if (thread->state & ThreadState_Background) {
-                       THREAD_DEBUG (g_message ("%s: ignoring background thread %"G_GSIZE_FORMAT, __func__, (gsize)thread->tid));
-                       return; /* just leave, ignore */
-               }
+       if (wait->num >= MONO_W32HANDLE_MAXIMUM_WAIT_OBJECTS - 1) {
+               /* Just ignore the rest, we can't do anything with
+                * them yet
+                */
+               return;
+       }
+
+       /* Ignore background threads, we abort them later */
+       /* Do not lock here since it is not needed and the caller holds threads_lock */
+       if (thread->state & ThreadState_Background) {
+               THREAD_DEBUG (g_message ("%s: ignoring background thread %"G_GSIZE_FORMAT, __func__, (gsize)thread->tid));
+               return; /* just leave, ignore */
+       }
                
-               if (mono_gc_is_finalizer_internal_thread (thread)) {
-                       THREAD_DEBUG (g_message ("%s: ignoring finalizer thread %"G_GSIZE_FORMAT, __func__, (gsize)thread->tid));
-                       return;
-               }
+       if (mono_gc_is_finalizer_internal_thread (thread)) {
+               THREAD_DEBUG (g_message ("%s: ignoring finalizer thread %"G_GSIZE_FORMAT, __func__, (gsize)thread->tid));
+               return;
+       }
 
-               if (thread == mono_thread_internal_current ()) {
-                       THREAD_DEBUG (g_message ("%s: ignoring current thread %"G_GSIZE_FORMAT, __func__, (gsize)thread->tid));
-                       return;
-               }
+       if (thread == mono_thread_internal_current ()) {
+               THREAD_DEBUG (g_message ("%s: ignoring current thread %"G_GSIZE_FORMAT, __func__, (gsize)thread->tid));
+               return;
+       }
 
-               if (mono_thread_get_main () && (thread == mono_thread_get_main ()->internal_thread)) {
-                       THREAD_DEBUG (g_message ("%s: ignoring main thread %"G_GSIZE_FORMAT, __func__, (gsize)thread->tid));
-                       return;
-               }
+       if (mono_thread_get_main () && (thread == mono_thread_get_main ()->internal_thread)) {
+               THREAD_DEBUG (g_message ("%s: ignoring main thread %"G_GSIZE_FORMAT, __func__, (gsize)thread->tid));
+               return;
+       }
 
-               if (thread->flags & MONO_THREAD_FLAG_DONT_MANAGE) {
-                       THREAD_DEBUG (g_message ("%s: ignoring thread %" G_GSIZE_FORMAT "with DONT_MANAGE flag set.", __func__, (gsize)thread->tid));
-                       return;
-               }
+       if (thread->flags & MONO_THREAD_FLAG_DONT_MANAGE) {
+               THREAD_DEBUG (g_message ("%s: ignoring thread %" G_GSIZE_FORMAT "with DONT_MANAGE flag set.", __func__, (gsize)thread->tid));
+               return;
+       }
 
-               THREAD_DEBUG (g_message ("%s: Invoking mono_thread_manage callback on thread %p", __func__, thread));
-               if ((thread->manage_callback == NULL) || (thread->manage_callback (thread->root_domain_thread) == TRUE)) {
-                       wait->handles[wait->num]=mono_threads_open_thread_handle (thread->handle);
-                       wait->threads[wait->num]=thread;
-                       wait->num++;
+       THREAD_DEBUG (g_message ("%s: Invoking mono_thread_manage callback on thread %p", __func__, thread));
+       if ((thread->manage_callback == NULL) || (thread->manage_callback (thread->root_domain_thread) == TRUE)) {
+               add_wait_thread (wait, thread);
 
-                       THREAD_DEBUG (g_message ("%s: adding thread %"G_GSIZE_FORMAT, __func__, (gsize)thread->tid));
-               } else {
-                       THREAD_DEBUG (g_message ("%s: ignoring (because of callback) thread %"G_GSIZE_FORMAT, __func__, (gsize)thread->tid));
-               }
-               
-               
+               THREAD_DEBUG (g_message ("%s: adding thread %"G_GSIZE_FORMAT, __func__, (gsize)thread->tid));
        } else {
-               /* Just ignore the rest, we can't do anything with
-                * them yet
-                */
+               THREAD_DEBUG (g_message ("%s: ignoring (because of callback) thread %"G_GSIZE_FORMAT, __func__, (gsize)thread->tid));
        }
 }
 
-static gboolean
-remove_and_abort_threads (gpointer key, gpointer value, gpointer user)
+static void
+collect_and_abort_threads (gpointer key, gpointer value, gpointer user)
 {
-       struct wait_data *wait=(struct wait_data *)user;
+       WaitData *wait = (WaitData *)user;
        MonoNativeThreadId self = mono_native_thread_id_get ();
        MonoInternalThread *thread = (MonoInternalThread *)value;
 
        if (wait->num >= MONO_W32HANDLE_MAXIMUM_WAIT_OBJECTS)
-               return FALSE;
+               return;
 
        /* The finalizer thread is not a background thread */
        if (!mono_native_thread_id_equals (thread_get_tid (thread), self)
             && (thread->state & ThreadState_Background) != 0
-            && (thread->flags & MONO_THREAD_FLAG_DONT_MANAGE) == 0
-       ) {
-               wait->handles[wait->num] = mono_threads_open_thread_handle (thread->handle);
-               wait->threads[wait->num] = thread;
-               wait->num++;
+               && (thread->flags & MONO_THREAD_FLAG_DONT_MANAGE) == 0) {
+               add_wait_thread (wait, thread);
 
                THREAD_DEBUG (g_print ("%s: Aborting id: %"G_GSIZE_FORMAT"\n", __func__, (gsize)thread->tid));
                mono_thread_internal_abort (thread);
-               return TRUE;
+               return;
        }
-
-       return !mono_native_thread_id_equals (thread_get_tid (thread), self)
-               && !mono_gc_is_finalizer_internal_thread (thread);
 }
 
 /** 
@@ -3092,18 +3174,19 @@ mono_threads_set_shutting_down (void)
                 * interrupt the main thread if it is waiting for all
                 * the other threads.
                 */
-               mono_os_event_set (&background_change_event);
+               signal_background_change ();
                
                mono_threads_unlock ();
        }
 }
 
-void mono_thread_manage (void)
+void
+mono_thread_manage (void)
 {
-       struct wait_data wait_data;
-       struct wait_data *wait = &wait_data;
+       WaitData wait_data;
+       WaitData *wait = &wait_data;
 
-       memset (wait, 0, sizeof (struct wait_data));
+       memset (wait, 0, sizeof (WaitData));
        /* join each thread that's still running */
        THREAD_DEBUG (g_message ("%s: Joining each running thread...", __func__));
        
@@ -3125,17 +3208,18 @@ void mono_thread_manage (void)
                THREAD_DEBUG (g_message ("%s: There are %d threads to join", __func__, mono_g_hash_table_size (threads));
                        mono_g_hash_table_foreach (threads, print_tids, NULL));
        
+#ifdef HOST_WIN32
                mono_os_event_reset (&background_change_event);
-               wait->num=0;
-               /* We must zero all InternalThread pointers to avoid making the GC unhappy. */
-               memset (wait->threads, 0, MONO_W32HANDLE_MAXIMUM_WAIT_OBJECTS * SIZEOF_VOID_P);
+#endif
+               background_changed = FALSE;
+               init_wait_data (wait);
                mono_g_hash_table_foreach (threads, build_wait_tids, wait);
                mono_threads_unlock ();
                if (wait->num > 0)
                        /* Something to wait for */
                        wait_for_tids (wait, INFINITE, TRUE);
                THREAD_DEBUG (g_message ("%s: I have %d threads after waiting.", __func__, wait->num));
-       } while(wait->num>0);
+       } while (wait->num > 0);
 
        /* Mono is shutting down, so just wait for the end */
        if (!mono_runtime_try_shutdown ()) {
@@ -3151,10 +3235,8 @@ void mono_thread_manage (void)
        do {
                mono_threads_lock ();
 
-               wait->num = 0;
-               /*We must zero all InternalThread pointers to avoid making the GC unhappy.*/
-               memset (wait->threads, 0, MONO_W32HANDLE_MAXIMUM_WAIT_OBJECTS * SIZEOF_VOID_P);
-               mono_g_hash_table_foreach_remove (threads, remove_and_abort_threads, wait);
+               init_wait_data (wait);
+               mono_g_hash_table_foreach (threads, collect_and_abort_threads, wait);
 
                mono_threads_unlock ();
 
@@ -3177,7 +3259,7 @@ static void
 collect_threads_for_suspend (gpointer key, gpointer value, gpointer user_data)
 {
        MonoInternalThread *thread = (MonoInternalThread*)value;
-       struct wait_data *wait = (struct wait_data*)user_data;
+       WaitData *wait = (WaitData*)user_data;
 
        /* 
         * We try to exclude threads early, to avoid running into the MONO_W32HANDLE_MAXIMUM_WAIT_OBJECTS
@@ -3188,9 +3270,9 @@ collect_threads_for_suspend (gpointer key, gpointer value, gpointer user_data)
                (thread->state & ThreadState_Stopped) != 0)
                return;
 
-       if (wait->num<MONO_W32HANDLE_MAXIMUM_WAIT_OBJECTS) {
-               wait->handles [wait->num] = mono_threads_open_thread_handle (thread->handle);
-               wait->threads [wait->num] = thread;
+       if (wait->num < MONO_W32HANDLE_MAXIMUM_WAIT_OBJECTS) {
+               wait->handles[wait->num] = mono_threads_open_thread_handle (thread->handle);
+               wait->threads[wait->num] = thread;
                wait->num++;
        }
 }
@@ -3201,16 +3283,17 @@ collect_threads_for_suspend (gpointer key, gpointer value, gpointer user_data)
  *  Suspend all managed threads except the finalizer thread and this thread. It is
  * not possible to resume them later.
  */
-void mono_thread_suspend_all_other_threads (void)
+void
+mono_thread_suspend_all_other_threads (void)
 {
-       struct wait_data wait_data;
-       struct wait_data *wait = &wait_data;
+       WaitData wait_data;
+       WaitData *wait = &wait_data;
        int i;
        MonoNativeThreadId self = mono_native_thread_id_get ();
        guint32 eventidx = 0;
        gboolean starting, finished;
 
-       memset (wait, 0, sizeof (struct wait_data));
+       memset (wait, 0, sizeof (WaitData));
        /*
         * The other threads could be in an arbitrary state at this point, i.e.
         * they could be starting up, shutting down etc. This means that there could be
@@ -3236,9 +3319,7 @@ void mono_thread_suspend_all_other_threads (void)
                 * Make a copy of the hashtable since we can't do anything with
                 * threads while threads_mutex is held.
                 */
-               wait->num = 0;
-               /*We must zero all InternalThread pointers to avoid making the GC unhappy.*/
-               memset (wait->threads, 0, MONO_W32HANDLE_MAXIMUM_WAIT_OBJECTS * SIZEOF_VOID_P);
+               init_wait_data (wait);
                mono_threads_lock ();
                mono_g_hash_table_foreach (threads, collect_threads_for_suspend, wait);
                mono_threads_unlock ();
@@ -3702,7 +3783,7 @@ mono_thread_has_appdomain_ref (MonoThread *thread, MonoDomain *domain)
 }
 
 typedef struct abort_appdomain_data {
-       struct wait_data wait;
+       WaitData wait;
        MonoDomain *domain;
 } abort_appdomain_data;
 
@@ -3716,10 +3797,8 @@ collect_appdomain_thread (gpointer key, gpointer value, gpointer user_data)
        if (mono_thread_internal_has_appdomain_ref (thread, domain)) {
                /* printf ("ABORTING THREAD %p BECAUSE IT REFERENCES DOMAIN %s.\n", thread->tid, domain->friendly_name); */
 
-               if(data->wait.num<MONO_W32HANDLE_MAXIMUM_WAIT_OBJECTS) {
-                       data->wait.handles [data->wait.num] = mono_threads_open_thread_handle (thread->handle);
-                       data->wait.threads [data->wait.num] = thread;
-                       data->wait.num++;
+               if (data->wait.num < MONO_W32HANDLE_MAXIMUM_WAIT_OBJECTS) {
+                       add_wait_thread (&data->wait, thread);
                } else {
                        /* Just ignore the rest, we can't do anything with
                         * them yet
@@ -3752,7 +3831,7 @@ mono_threads_abort_appdomain_threads (MonoDomain *domain, int timeout)
                mono_threads_lock ();
 
                user_data.domain = domain;
-               user_data.wait.num = 0;
+               init_wait_data (&user_data.wait);
                /* This shouldn't take any locks */
                mono_g_hash_table_foreach (threads, collect_appdomain_thread, &user_data);
                mono_threads_unlock ();
@@ -4919,6 +4998,10 @@ mono_threads_join_threads (void)
                                /* This shouldn't block */
                                mono_native_thread_join (thread);
                                MONO_EXIT_GC_SAFE;
+                               thread_wait_lock ();
+                               njoined_threads ++;
+                               mono_os_cond_signal (&thread_wait_cond);
+                               thread_wait_unlock ();
                        }
                } else {
                        break;
index 08ce2f067011cbd3024c0e9945fd235b803cf5fd..6c30c8f5bd11d92bf78f9c95192070ef72b52487 100644 (file)
@@ -7527,6 +7527,8 @@ compile_method (MonoAotCompile *acfg, MonoMethod *method)
                flags = (JitFlags)(flags | JIT_FLAG_LLVM_ONLY | JIT_FLAG_EXPLICIT_NULL_CHECKS);
        if (acfg->aot_opts.no_direct_calls)
                flags = (JitFlags)(flags | JIT_FLAG_NO_DIRECT_ICALLS);
+       if (acfg->aot_opts.direct_pinvoke)
+               flags = (JitFlags)(flags | JIT_FLAG_DIRECT_PINVOKE);
 
        jit_timer = mono_time_track_start ();
        cfg = mini_method_compile (method, acfg->opts, mono_get_root_domain (), flags, 0, index);
index d786bbad8fcc36e2a293eb5670aabf76360f42b6..846e1cd51410471e354a30ca42333def627dc127 100644 (file)
@@ -45,7 +45,7 @@
 #
 # See the code in mini-x86.c for more details on how the specifiers are used.
 #
-tailcall: len:120 clob:c
+tailcall: len:124 clob:c
 memory_barrier: len:4
 nop: len:4
 relaxed_nop: len:4
index ee0535ec2529562119ce7996fffbe64c4477361c..de0e58ab1799364ea5c1c77f129066f37d9835c1 100644 (file)
@@ -12579,7 +12579,17 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
                                cmethod = (MonoMethod *)mono_method_get_wrapper_data (method, token);
 
                                if (cfg->compile_aot) {
-                                       EMIT_NEW_AOTCONST (cfg, ins, MONO_PATCH_INFO_ICALL_ADDR, cmethod);
+                                       if (cfg->direct_pinvoke && ip + 6 < end && (ip [6] == CEE_POP)) {
+                                               /*
+                                                * This is generated by emit_native_wrapper () to resolve the pinvoke address
+                                                * before the call, its not needed when using direct pinvoke.
+                                                * This is not an optimization, but its used to avoid looking up pinvokes
+                                                * on platforms which don't support dlopen ().
+                                                */
+                                               EMIT_NEW_PCONST (cfg, ins, NULL);
+                                       } else {
+                                               EMIT_NEW_AOTCONST (cfg, ins, MONO_PATCH_INFO_ICALL_ADDR, cmethod);
+                                       }
                                } else {
                                        ptr = mono_lookup_internal_call (cmethod);
                                        g_assert (ptr);
index 572048ff5ff8b401b415ab6ba0fe9de8e88cc02f..77b4bb21415055645f74797cf80e24f8cc3aa600 100644 (file)
@@ -253,6 +253,8 @@ mono_print_method_from_ip (void *ip)
        MonoGenericSharingContext*gsctx;
        const char *shared_type;
 
+       if (!domain)
+               domain = mono_get_root_domain ();
        ji = mini_jit_info_table_find_ext (domain, (char *)ip, TRUE, &target_domain);
        if (ji && ji->is_trampoline) {
                MonoTrampInfo *tinfo = (MonoTrampInfo *)ji->d.tramp_info;
index e94e9fc18c00e59ca5c5b38e0295d461819bbe4c..5b42ca510f34ffa07def506ffdb86ffff3612339 100644 (file)
@@ -3315,6 +3315,7 @@ mini_method_compile (MonoMethod *method, guint32 opts, MonoDomain *domain, JitFl
        cfg->soft_breakpoints = debug_options.soft_breakpoints;
        cfg->check_pinvoke_callconv = debug_options.check_pinvoke_callconv;
        cfg->disable_direct_icalls = disable_direct_icalls;
+       cfg->direct_pinvoke = (flags & JIT_FLAG_DIRECT_PINVOKE) != 0;
        if (try_generic_shared)
                cfg->gshared = TRUE;
        cfg->compile_llvm = try_llvm;
index 1d4184ee09c37b27229fcf76bd41e634d3416a56..9e6f8f7523f5702fccc496b9433cd0abc5a02422 100644 (file)
@@ -1513,12 +1513,14 @@ typedef enum {
        JIT_FLAG_FULL_AOT = (1 << 2),
        /* Whenever to compile with LLVM */
        JIT_FLAG_LLVM = (1 << 3),
-       /* Whenever to disable direct calls to direct calls to icall functions */
+       /* Whenever to disable direct calls to icall functions */
        JIT_FLAG_NO_DIRECT_ICALLS = (1 << 4),
        /* Emit explicit null checks */
        JIT_FLAG_EXPLICIT_NULL_CHECKS = (1 << 5),
        /* Whenever to compile in llvm-only mode */
        JIT_FLAG_LLVM_ONLY = (1 << 6),
+       /* Whenever calls to pinvoke functions are made directly */
+       JIT_FLAG_DIRECT_PINVOKE = (1 << 7)
 } JitFlags;
 
 /* Bit-fields in the MonoBasicBlock.region */
@@ -1688,6 +1690,7 @@ typedef struct {
        guint            disable_out_of_line_bblocks : 1;
        guint            disable_direct_icalls : 1;
        guint            disable_gc_safe_points : 1;
+       guint            direct_pinvoke : 1;
        guint            create_lmf_var : 1;
        /*
         * When this is set, the code to push/pop the LMF from the LMF stack is generated as IR
index be0d6876966fd4a471f88723843a4c98ac16dcae..3e3ef31f47e241080430c1174943a1a54e59e12d 100644 (file)
@@ -531,7 +531,11 @@ endif
 
 if POWERPC64
 # FIXME: These tests hang/fail for unknown reasons
-PLATFORM_DISABLED_TESTS=monitor.exe threadpool-exceptions5.exe
+PLATFORM_DISABLED_TESTS=monitor.exe threadpool-exceptions5.exe appdomain-thread-abort.exe appdomain-unload.exe \
+       pinvoke2.exe pinvoke3.exe pinvoke11.exe threadpool-exceptions7.exe winx64structs.exe bug-10127.exe pinvoke_ppcc.exe \
+       pinvoke_ppcs.exe pinvoke_ppci.exe pinvoke_ppcf.exe pinvoke_ppcd.exe abort-cctor.exe \
+       sgen-domain-unload-2.exe sgen-weakref-stress.exe sgen-cementing-stress.exe sgen-new-threads-dont-join-stw.exe \
+       sgen-new-threads-dont-join-stw-2.exe sgen-new-threads-collect.exe sgen-bridge.exe
 endif
 
 if ARM
@@ -690,12 +694,16 @@ endif
 # delegate-invoke.exe depends on 929c6bc9b6d76a273f251e6f5dfacac36e9c38bd which was
 # reverted.
 # bug-Xamarin-5278.exe got broken by 5d26590e79da139a284459299aee95c25f4cd835
+# bug-45841-fpstack-exceptions.exe: https://bugzilla.xamarin.com/show_bug.cgi?id=47053
+# appdomain-thread-abort.exe: https://bugzilla.xamarin.com/show_bug.cgi?id=47054
 DISABLED_TESTS=                        \
        delegate-async-exception.exe    \
        bug-348522.2.exe        \
        bug-459094.exe \
        delegate-invoke.exe \
        bug-Xamarin-5278.exe \
+       bug-45841-fpstack-exceptions.exe \
+       appdomain-thread-abort.exe \
        $(PLATFORM_DISABLED_TESTS) \
        $(EXTRA_DISABLED_TESTS) \
        $(COOP_DISABLED_TESTS) \
@@ -1084,12 +1092,14 @@ testbundle: console.exe
 
 EXTRA_DIST += load-missing.il t-missing.cs load-exceptions.cs
 test-type-load: $(TEST_DRIVER_DEPEND)
+if !POWERPC64
        @$(ILASM) /dll /output:load-missing.dll $(srcdir)/load-missing.il > /dev/null
        @$(MCS) -t:library -out:t.dll -d:FOUND $(srcdir)/t-missing.cs
        @$(MCS) -r:TestDriver.dll -r:load-missing.dll -r:t.dll -out:load-exceptions.exe $(srcdir)/load-exceptions.cs
        @$(MCS) -t:library -out:t.dll $(srcdir)/t-missing.cs
        @echo "Testing load-exception.exe..."
        @$(RUNTIME) load-exceptions.exe > load-exceptions.exe.stdout 2> load-exceptions.exe.stderr
+endif
 
 EXTRA_DIST += test-multi-netmodule-1-netmodule.cs test-multi-netmodule-2-dll1.cs test-multi-netmodule-3-dll2.cs test-multi-netmodule-4-exe.cs
 test-multi-netmodule:
@@ -1172,21 +1182,21 @@ sgen-regular-tests: $(SGEN_REGULAR_TESTS)
        $(MAKE) sgen-regular-tests-ms-conc-split-clear-at-gc
 
 sgen-regular-tests-ms: $(SGEN_REGULAR_TESTS) test-runner.exe
-       MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="" MONO_GC_PARAMS="major=marksweep" $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name $@ --timeout 900 $(SGEN_REGULAR_TESTS)
+       MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="" MONO_GC_PARAMS="major=marksweep" $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name $@ --disabled "$(DISABLED_TESTS)" --timeout 900 $(SGEN_REGULAR_TESTS)
 sgen-regular-tests-ms-conc: $(SGEN_REGULAR_TESTS) test-runner.exe
-       MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="" MONO_GC_PARAMS="major=marksweep-conc" $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name $@ --timeout 900 $(SGEN_REGULAR_TESTS)
+       MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="" MONO_GC_PARAMS="major=marksweep-conc" $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name $@ --disabled "$(DISABLED_TESTS)" --timeout 900 $(SGEN_REGULAR_TESTS)
 sgen-regular-tests-ms-conc-split: $(SGEN_REGULAR_TESTS) test-runner.exe
-       MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="" MONO_GC_PARAMS="major=marksweep-conc,minor=split" $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name $@ --timeout 900 $(SGEN_REGULAR_TESTS)
+       MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="" MONO_GC_PARAMS="major=marksweep-conc,minor=split" $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name $@ --disabled "$(DISABLED_TESTS)" --timeout 900 $(SGEN_REGULAR_TESTS)
 sgen-regular-tests-ms-split: $(SGEN_REGULAR_TESTS) test-runner.exe
-       MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="" MONO_GC_PARAMS="major=marksweep,minor=split" $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name $@ --timeout 900 $(SGEN_REGULAR_TESTS)
+       MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="" MONO_GC_PARAMS="major=marksweep,minor=split" $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name $@ --disabled "$(DISABLED_TESTS)" --timeout 900 $(SGEN_REGULAR_TESTS)
 sgen-regular-tests-ms-conc-split-95: $(SGEN_REGULAR_TESTS) test-runner.exe
-       MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="" MONO_GC_PARAMS="major=marksweep-conc,minor=split,alloc-ratio=95" $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name $@ --timeout 900 $(SGEN_REGULAR_TESTS)
+       MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="" MONO_GC_PARAMS="major=marksweep-conc,minor=split,alloc-ratio=95" $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name $@ --disabled "$(DISABLED_TESTS)" --timeout 900 $(SGEN_REGULAR_TESTS)
 sgen-regular-tests-ms-clear-at-gc: $(SGEN_REGULAR_TESTS) test-runner.exe
-       MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="clear-at-gc" MONO_GC_PARAMS="major=marksweep" $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name $@ --timeout 900 $(SGEN_REGULAR_TESTS)
+       MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="clear-at-gc" MONO_GC_PARAMS="major=marksweep" $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name $@ --disabled "$(DISABLED_TESTS)" --timeout 900 $(SGEN_REGULAR_TESTS)
 sgen-regular-tests-ms-conc-clear-at-gc: $(SGEN_REGULAR_TESTS) test-runner.exe
-       MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="clear-at-gc" MONO_GC_PARAMS="major=marksweep-conc" $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name $@ --timeout 900 $(SGEN_REGULAR_TESTS)
+       MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="clear-at-gc" MONO_GC_PARAMS="major=marksweep-conc" $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name $@ --disabled "$(DISABLED_TESTS)" --timeout 900 $(SGEN_REGULAR_TESTS)
 sgen-regular-tests-ms-conc-split-clear-at-gc: $(SGEN_REGULAR_TESTS) test-runner.exe
-       MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="clear-at-gc" MONO_GC_PARAMS="major=marksweep-conc,minor=split" $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name $@ --timeout 900 $(SGEN_REGULAR_TESTS)
+       MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="clear-at-gc" MONO_GC_PARAMS="major=marksweep-conc,minor=split" $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name $@ --disabled "$(DISABLED_TESTS)" --timeout 900 $(SGEN_REGULAR_TESTS)
 
 SGEN_TOGGLEREF_TESTS=  \
        sgen-toggleref.exe
@@ -1202,21 +1212,21 @@ sgen-toggleref-tests: $(SGEN_TOGGLEREF_TESTS)
        $(MAKE) sgen-toggleref-tests-ms-split-clear-at-gc
 
 sgen-toggleref-tests-plain: $(SGEN_TOGGLEREF_TESTS) test-runner.exe
-       MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="" MONO_GC_PARAMS="toggleref-test" $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name $@ --timeout 900 $(SGEN_TOGGLEREF_TESTS)
+       MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="" MONO_GC_PARAMS="toggleref-test" $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name $@ --disabled "$(DISABLED_TESTS)" --timeout 900 $(SGEN_TOGGLEREF_TESTS)
 sgen-toggleref-tests-ms-conc: $(SGEN_TOGGLEREF_TESTS) test-runner.exe
-       MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="" MONO_GC_PARAMS="toggleref-test,major=marksweep-conc" $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name $@ --timeout 900 $(SGEN_TOGGLEREF_TESTS)
+       MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="" MONO_GC_PARAMS="toggleref-test,major=marksweep-conc" $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name $@ --disabled "$(DISABLED_TESTS)" --timeout 900 $(SGEN_TOGGLEREF_TESTS)
 sgen-toggleref-tests-ms-conc-split: $(SGEN_TOGGLEREF_TESTS) test-runner.exe
-       MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="" MONO_GC_PARAMS="toggleref-test,major=marksweep-conc,minor=split" $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name $@ --timeout 900 $(SGEN_TOGGLEREF_TESTS)
+       MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="" MONO_GC_PARAMS="toggleref-test,major=marksweep-conc,minor=split" $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name $@ --disabled "$(DISABLED_TESTS)" --timeout 900 $(SGEN_TOGGLEREF_TESTS)
 sgen-toggleref-tests-ms-split: $(SGEN_TOGGLEREF_TESTS) test-runner.exe
-       MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="" MONO_GC_PARAMS="toggleref-test,minor=split" $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name $@ --timeout 900 $(SGEN_TOGGLEREF_TESTS)
+       MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="" MONO_GC_PARAMS="toggleref-test,minor=split" $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name $@ --disabled "$(DISABLED_TESTS)" --timeout 900 $(SGEN_TOGGLEREF_TESTS)
 sgen-toggleref-tests-ms-split-95: $(SGEN_TOGGLEREF_TESTS) test-runner.exe
-       MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="" MONO_GC_PARAMS="toggleref-test,minor=split,alloc-ratio=95" $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name $@ --timeout 900 $(SGEN_TOGGLEREF_TESTS)
+       MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="" MONO_GC_PARAMS="toggleref-test,minor=split,alloc-ratio=95" $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name $@ --disabled "$(DISABLED_TESTS)" --timeout 900 $(SGEN_TOGGLEREF_TESTS)
 sgen-toggleref-tests-plain-clear-at-gc: $(SGEN_TOGGLEREF_TESTS) test-runner.exe
-       MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="clear-at-gc" MONO_GC_PARAMS="toggleref-test" $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name $@ --timeout 900 $(SGEN_TOGGLEREF_TESTS)
+       MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="clear-at-gc" MONO_GC_PARAMS="toggleref-test" $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name $@ --disabled "$(DISABLED_TESTS)" --timeout 900 $(SGEN_TOGGLEREF_TESTS)
 sgen-toggleref-tests-ms-conc-clear-at-gc: $(SGEN_TOGGLEREF_TESTS) test-runner.exe
-       MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="clear-at-gc" MONO_GC_PARAMS="toggleref-test,major=marksweep-conc" $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name $@ --timeout 900 $(SGEN_TOGGLEREF_TESTS)
+       MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="clear-at-gc" MONO_GC_PARAMS="toggleref-test,major=marksweep-conc" $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name $@ --disabled "$(DISABLED_TESTS)" --timeout 900 $(SGEN_TOGGLEREF_TESTS)
 sgen-toggleref-tests-ms-split-clear-at-gc: $(SGEN_TOGGLEREF_TESTS) test-runner.exe
-       MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="clear-at-gc" MONO_GC_PARAMS="toggleref-test,minor=split" $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name $@ --timeout 900 $(SGEN_TOGGLEREF_TESTS)
+       MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="clear-at-gc" MONO_GC_PARAMS="toggleref-test,minor=split" $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name $@ --disabled "$(DISABLED_TESTS)" --timeout 900 $(SGEN_TOGGLEREF_TESTS)
 
 SGEN_BRIDGE_TESTS=     \
        sgen-bridge.exe \
@@ -1233,21 +1243,21 @@ sgen-bridge-tests: $(SGEN_BRIDGE_TESTS)
        $(MAKE) sgen-bridge-tests-ms-split-tarjan-bridge
 
 sgen-bridge-tests-plain: $(SGEN_BRIDGE_TESTS) test-runner.exe
-       MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="bridge=Bridge" MONO_GC_PARAMS="" $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name $@ --timeout 900 $(SGEN_BRIDGE_TESTS)
+       MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="bridge=Bridge" MONO_GC_PARAMS="" $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name $@ --disabled "$(DISABLED_TESTS)" --timeout 900 $(SGEN_BRIDGE_TESTS)
 sgen-bridge-tests-ms-conc: $(SGEN_BRIDGE_TESTS) test-runner.exe
-       MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="bridge=Bridge" MONO_GC_PARAMS="major=marksweep-conc" $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name $@ --timeout 900 $(SGEN_BRIDGE_TESTS)
+       MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="bridge=Bridge" MONO_GC_PARAMS="major=marksweep-conc" $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name $@ --disabled "$(DISABLED_TESTS)" --timeout 900 $(SGEN_BRIDGE_TESTS)
 sgen-bridge-tests-ms-split: $(SGEN_BRIDGE_TESTS) test-runner.exe
-       MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="bridge=Bridge" MONO_GC_PARAMS="minor=split" $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name $@ --timeout 900 $(SGEN_BRIDGE_TESTS)
+       MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="bridge=Bridge" MONO_GC_PARAMS="minor=split" $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name $@ --disabled "$(DISABLED_TESTS)" --timeout 900 $(SGEN_BRIDGE_TESTS)
 sgen-bridge-tests-plain-new-bridge: $(SGEN_BRIDGE_TESTS) test-runner.exe
-       MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="bridge=Bridge" MONO_GC_PARAMS="bridge-implementation=new" $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name $@ --timeout 900 $(SGEN_BRIDGE_TESTS)
+       MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="bridge=Bridge" MONO_GC_PARAMS="bridge-implementation=new" $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name $@ --disabled "$(DISABLED_TESTS)" --timeout 900 $(SGEN_BRIDGE_TESTS)
 sgen-bridge-tests-ms-conc-new-bridge: $(SGEN_BRIDGE_TESTS) test-runner.exe
-       MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="bridge=Bridge" MONO_GC_PARAMS="bridge-implementation=new,major=marksweep-conc" $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name $@ --timeout 900 $(SGEN_BRIDGE_TESTS)
+       MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="bridge=Bridge" MONO_GC_PARAMS="bridge-implementation=new,major=marksweep-conc" $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name $@ --disabled "$(DISABLED_TESTS)" --timeout 900 $(SGEN_BRIDGE_TESTS)
 sgen-bridge-tests-ms-split-new-bridge: $(SGEN_BRIDGE_TESTS) test-runner.exe
-       MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="bridge=Bridge" MONO_GC_PARAMS="bridge-implementation=new,minor=split" $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name $@ --timeout 900 $(SGEN_BRIDGE_TESTS)
+       MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="bridge=Bridge" MONO_GC_PARAMS="bridge-implementation=new,minor=split" $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name $@ --disabled "$(DISABLED_TESTS)" --timeout 900 $(SGEN_BRIDGE_TESTS)
 sgen-bridge-tests-plain-tarjan-bridge: $(SGEN_BRIDGE_TESTS) test-runner.exe
-       MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="bridge=Bridge" MONO_GC_PARAMS="bridge-implementation=tarjan" $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name $@ --timeout 900 $(SGEN_BRIDGE_TESTS)
+       MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="bridge=Bridge" MONO_GC_PARAMS="bridge-implementation=tarjan" $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name $@ --disabled "$(DISABLED_TESTS)" --timeout 900 $(SGEN_BRIDGE_TESTS)
 sgen-bridge-tests-ms-split-tarjan-bridge: $(SGEN_BRIDGE_TESTS) test-runner.exe
-       MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="bridge=Bridge" MONO_GC_PARAMS="bridge-implementation=tarjan,minor=split" $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name $@ --timeout 900 $(SGEN_BRIDGE_TESTS)
+       MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="bridge=Bridge" MONO_GC_PARAMS="bridge-implementation=tarjan,minor=split" $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name $@ --disabled "$(DISABLED_TESTS)" --timeout 900 $(SGEN_BRIDGE_TESTS)
 
 SGEN_BRIDGE2_TESTS=    \
        sgen-bridge-xref.exe
@@ -1263,21 +1273,21 @@ sgen-bridge2-tests: $(SGEN_BRIDGE2_TESTS)
        $(MAKE) sgen-bridge2-tests-ms-split-tarjan-bridge
 
 sgen-bridge2-tests-plain: $(SGEN_BRIDGE2_TESTS) test-runner.exe
-       MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="bridge=2Bridge" MONO_GC_PARAMS="" $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name $@ --timeout 900 $(SGEN_BRIDGE2_TESTS)
+       MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="bridge=2Bridge" MONO_GC_PARAMS="" $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name $@ --disabled "$(DISABLED_TESTS)" --timeout 900 $(SGEN_BRIDGE2_TESTS)
 sgen-bridge2-tests-ms-conc: $(SGEN_BRIDGE2_TESTS) test-runner.exe
-       MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="bridge=2Bridge" MONO_GC_PARAMS="major=marksweep-conc" $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name $@ --timeout 900 $(SGEN_BRIDGE2_TESTS)
+       MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="bridge=2Bridge" MONO_GC_PARAMS="major=marksweep-conc" $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name $@ --disabled "$(DISABLED_TESTS)" --timeout 900 $(SGEN_BRIDGE2_TESTS)
 sgen-bridge2-tests-ms-split: $(SGEN_BRIDGE2_TESTS) test-runner.exe
-       MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="bridge=2Bridge" MONO_GC_PARAMS="minor=split" $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name $@ --timeout 900 $(SGEN_BRIDGE2_TESTS)
+       MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="bridge=2Bridge" MONO_GC_PARAMS="minor=split" $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name $@ --disabled "$(DISABLED_TESTS)" --timeout 900 $(SGEN_BRIDGE2_TESTS)
 sgen-bridge2-tests-plain-new-bridge: $(SGEN_BRIDGE2_TESTS) test-runner.exe
-       MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="bridge=2Bridge" MONO_GC_PARAMS="bridge-implementation=new" $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name $@ --timeout 900 $(SGEN_BRIDGE2_TESTS)
+       MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="bridge=2Bridge" MONO_GC_PARAMS="bridge-implementation=new" $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name $@ --disabled "$(DISABLED_TESTS)" --timeout 900 $(SGEN_BRIDGE2_TESTS)
 sgen-bridge2-tests-ms-conc-new-bridge: $(SGEN_BRIDGE2_TESTS) test-runner.exe
-       MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="bridge=2Bridge" MONO_GC_PARAMS="bridge-implementation=new,major=marksweep-conc" $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name $@ --timeout 900 $(SGEN_BRIDGE2_TESTS)
+       MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="bridge=2Bridge" MONO_GC_PARAMS="bridge-implementation=new,major=marksweep-conc" $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name $@ --disabled "$(DISABLED_TESTS)" --timeout 900 $(SGEN_BRIDGE2_TESTS)
 sgen-bridge2-tests-ms-split-new-bridge: $(SGEN_BRIDGE2_TESTS) test-runner.exe
-       MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="bridge=2Bridge" MONO_GC_PARAMS="bridge-implementation=new,minor=split" $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name $@ --timeout 900 $(SGEN_BRIDGE2_TESTS)
+       MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="bridge=2Bridge" MONO_GC_PARAMS="bridge-implementation=new,minor=split" $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name $@ --disabled "$(DISABLED_TESTS)" --timeout 900 $(SGEN_BRIDGE2_TESTS)
 sgen-bridge2-tests-plain-tarjan-bridge: $(SGEN_BRIDGE2_TESTS) test-runner.exe
-       MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="bridge=2Bridge" MONO_GC_PARAMS="bridge-implementation=tarjan" $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name $@ --timeout 900 $(SGEN_BRIDGE2_TESTS)
+       MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="bridge=2Bridge" MONO_GC_PARAMS="bridge-implementation=tarjan" $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name $@ --disabled "$(DISABLED_TESTS)" --timeout 900 $(SGEN_BRIDGE2_TESTS)
 sgen-bridge2-tests-ms-split-tarjan-bridge: $(SGEN_BRIDGE2_TESTS) test-runner.exe
-       MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="bridge=2Bridge" MONO_GC_PARAMS="bridge-implementation=tarjan,minor=split" $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name $@ --timeout 900 $(SGEN_BRIDGE2_TESTS)
+       MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="bridge=2Bridge" MONO_GC_PARAMS="bridge-implementation=tarjan,minor=split" $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name $@ --disabled "$(DISABLED_TESTS)" --timeout 900 $(SGEN_BRIDGE2_TESTS)
 
 SGEN_BRIDGE3_TESTS=    \
        sgen-bridge-gchandle.exe
@@ -1683,7 +1693,7 @@ PROCESS_STRESS_TESTS=     \
                process-leak.exe
 
 test-process-stress: $(PROCESS_STRESS_TESTS) test-runner.exe
-       $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name $@ --timeout 600 $(PROCESS_STRESS_TESTS)
+       $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name $@ --disabled "$(DISABLED_TESTS)" --timeout 600 $(PROCESS_STRESS_TESTS)
 
 coreclr-gcstress:
        $(MAKE) -C $(mono_build_root)/acceptance-tests coreclr-gcstress
index 027280d5a91a2549a63e5564db72035a76070536..bd2ac9f5a8389707eaae5efecb3c7b31d977f2bc 100644 (file)
@@ -49,8 +49,20 @@ Mono_Posix_Stdlib__IOLBF
 Mono_Posix_Stdlib__IONBF\r
 Mono_Posix_Stdlib_calloc\r
 Mono_Posix_Stdlib_clearerr\r
+Mono_Posix_Stdlib_fclose\r
+Mono_Posix_Stdlib_feof\r
+Mono_Posix_Stdlib_ferror\r
+Mono_Posix_Stdlib_fflush\r
+Mono_Posix_Stdlib_fgetc\r
 Mono_Posix_Stdlib_fgetpos\r
+Mono_Posix_Stdlib_fgets\r
+Mono_Posix_Stdlib_fopen\r
+Mono_Posix_Stdlib_fprintf\r
+Mono_Posix_Stdlib_fputc\r
+Mono_Posix_Stdlib_fputs\r
 Mono_Posix_Stdlib_fread\r
+Mono_Posix_Stdlib_free\r
+Mono_Posix_Stdlib_freopen\r
 Mono_Posix_Stdlib_fseek\r
 Mono_Posix_Stdlib_fsetpos\r
 Mono_Posix_Stdlib_ftell\r
@@ -65,6 +77,8 @@ Mono_Posix_Stdlib_stderr
 Mono_Posix_Stdlib_stdin\r
 Mono_Posix_Stdlib_stdout\r
 Mono_Posix_Stdlib_strlen\r
+Mono_Posix_Stdlib_tmpfile\r
+Mono_Posix_Stdlib_ungetc\r
 Mono_Posix_ToAccessModes\r
 Mono_Posix_ToConfstrName\r
 Mono_Posix_ToDirectoryNotifyFlags\r
index fed23f7b1ba304b180df33525ffe72ed69831ae0..fab38f5bd4ecfc856a81fd88627fc08b8db552c9 100755 (executable)
@@ -38,6 +38,8 @@ if [ -x "/usr/bin/dpkg-architecture" ];
        then
        EXTRA_CONF_FLAGS="$EXTRA_CONF_FLAGS --host=`/usr/bin/dpkg-architecture -qDEB_HOST_GNU_TYPE`"
        #force build arch = dpkg arch, sometimes misdetected
+       mkdir -p ~/.config/.mono/
+       wget -qO- https://download.mono-project.com/test/new-certs.tgz| tar zx -C ~/.config/.mono/
 fi
 
 
index 5f0767219f8ab2300666f59f05788c27919e122e..3d9ac611c269a5a3f52e74e4b3162c722c46f657 100755 (executable)
@@ -6,14 +6,14 @@ ${TESTCMD} --label=mini --timeout=5m make -w -C mono/mini -k check check-seq-poi
 ${TESTCMD} --label=compile-runtime-tests --timeout=20m make -w -C mono/tests -j4 tests
 ${TESTCMD} --label=runtime --timeout=160m make -w -C mono/tests -k test-wrench V=1 CI=1 CI_PR=${ghprbPullId}
 ${TESTCMD} --label=runtime-unit-tests --timeout=5m make -w -C mono/unit-tests -k check
-${TESTCMD} --label=corlib --timeout=30m make -w -C mcs/class/corlib run-test
+if [[ ${label} == 'debian-8-ppc64el' ]]; then ${TESTCMD} --label=corlib --skip; else ${TESTCMD} --label=corlib --timeout=30m make -w -C mcs/class/corlib run-test; fi
 ${TESTCMD} --label=verify --timeout=15m make -w -C runtime mcs-compileall
 ${TESTCMD} --label=profiler --timeout=30m make -w -C mono/profiler -k check
 ${TESTCMD} --label=compiler --timeout=30m make -w -C mcs/tests run-test
 ${TESTCMD} --label=compiler-errors --timeout=30m make -w -C mcs/errors run-test
 ${TESTCMD} --label=System --timeout=10m bash -c "export MONO_TLS_PROVIDER=legacy && make -w -C mcs/class/System run-test"
 if [[ ${label} == osx-* ]]; then ${TESTCMD} --label=System-btls --timeout=10m bash -c "export MONO_TLS_PROVIDER=btls && make -w -C mcs/class/System run-test"; fi
-${TESTCMD} --label=System.XML --timeout=5m make -w -C mcs/class/System.XML run-test
+if [[ ${label} == 'debian-8-ppc64el' ]]; then ${TESTCMD} --label=System.XML --skip; else ${TESTCMD} --label=System.XML --timeout=5m make -w -C mcs/class/System.XML run-test; fi
 ${TESTCMD} --label=Mono.Security --timeout=5m make -w -C mcs/class/Mono.Security run-test
 ${TESTCMD} --label=System.Security --timeout=5m make -w -C mcs/class/System.Security run-test
 if [[ ${label} == w* ]]
@@ -50,7 +50,7 @@ ${TESTCMD} --label=System.Configuration --timeout=5m make -w -C mcs/class/System
 ${TESTCMD} --label=System.Transactions --timeout=5m make -w -C mcs/class/System.Transactions run-test
 ${TESTCMD} --label=System.Web.Extensions --timeout=5m make -w -C mcs/class/System.Web.Extensions run-test
 ${TESTCMD} --label=System.Core --timeout=15m make -w -C mcs/class/System.Core run-test
-if [[ -n "${ghprbPullId}" ]] && [[ ${label} == w* ]]; then ${TESTCMD} --label=symbolicate --skip; else ${TESTCMD} --label=symbolicate --timeout=60m make -w -C mcs/tools/mono-symbolicate check; fi
+if [[ -n "${ghprbPullId}" && ${label} == w* || ${label} == 'debian-8-ppc64el' ]]; then ${TESTCMD} --label=symbolicate --skip; else ${TESTCMD} --label=symbolicate --timeout=60m make -w -C mcs/tools/mono-symbolicate check; fi
 ${TESTCMD} --label=System.Xml.Linq --timeout=5m make -w -C mcs/class/System.Xml.Linq run-test
 ${TESTCMD} --label=System.Data.DSE --timeout=5m make -w -C mcs/class/System.Data.DataSetExtensions run-test
 ${TESTCMD} --label=System.Web.Abstractions --timeout=5m make -w -C mcs/class/System.Web.Abstractions run-test
@@ -74,7 +74,7 @@ ${TESTCMD} --label=System.Xaml --timeout=5m make -w -C mcs/class/System.Xaml run
 ${TESTCMD} --label=System.Net.Http --timeout=5m make -w -C mcs/class/System.Net.Http run-test
 ${TESTCMD} --label=System.Json --timeout=5m make -w -C mcs/class/System.Json run-test
 ${TESTCMD} --label=System.Threading.Tasks.Dataflow --timeout=5m make -w -C mcs/class/System.Threading.Tasks.Dataflow run-test
-${TESTCMD} --label=Mono.Debugger.Soft --timeout=5m make -w -C mcs/class/Mono.Debugger.Soft run-test
+if [[ ${label} == 'debian-8-ppc64el' ]]; then ${TESTCMD} --label=Mono.Debugger.Soft --skip; else ${TESTCMD} --label=Mono.Debugger.Soft --timeout=5m make -w -C mcs/class/Mono.Debugger.Soft run-test; fi
 ${TESTCMD} --label=Microsoft.Build --timeout=5m make -w -C mcs/class/Microsoft.Build run-test
 ${TESTCMD} --label=monodoc --timeout=10m make -w -C mcs/tools/mdoc run-test
 ${TESTCMD} --label=Microsoft.Build-12 --timeout=10m make -w -C mcs/class/Microsoft.Build run-test PROFILE=xbuild_12
index ccd221b106a219d161e744e9e6f42828089f7130..8c6ef5000f2fc22c8dea1fac92404d3e2284ba74 100644 (file)
@@ -2181,10 +2181,24 @@ int Mono_Posix_Stdlib_MB_CUR_MAX (void);
 int Mono_Posix_Stdlib_perror (const char* s, int err);
 int Mono_Posix_Stdlib_RAND_MAX (void);
 void* Mono_Posix_Stdlib_realloc (void* ptr, guint64 size);
+void Mono_Posix_Stdlib_free (void* p);
 int Mono_Posix_Stdlib_rewind (void* stream);
 int Mono_Posix_Stdlib_setbuf (void* stream, void* buf);
 void Mono_Posix_Stdlib_SetLastError (int error);
 int Mono_Posix_Stdlib_setvbuf (void* stream, void* buf, int mode, guint64 size);
+void* Mono_Posix_Stdlib_fopen (char* path, char* mode);
+void* Mono_Posix_Stdlib_freopen (char* path, char* mode, void *stream);
+gint32 Mono_Posix_Stdlib_fprintf (void* stream, char* format, char *message);
+gint32 Mono_Posix_Stdlib_fgetc (void* stream);
+char* Mono_Posix_Stdlib_fgets (char* str, gint32 size, void* stream);
+gint32 Mono_Posix_Stdlib_fputc (gint32 c, void* stream);
+gint32 Mono_Posix_Stdlib_fputs (char* s, void* stream);
+gint32 Mono_Posix_Stdlib_fclose (void* stream);
+gint32 Mono_Posix_Stdlib_fflush (void* stream);
+void* Mono_Posix_Stdlib_tmpfile (void);
+gint32 Mono_Posix_Stdlib_ungetc (gint32 c, void* stream);
+gint32 Mono_Posix_Stdlib_feof (void* stream);
+gint32 Mono_Posix_Stdlib_ferror (void* stream);
 void* Mono_Posix_Stdlib_SIG_DFL (void);
 void* Mono_Posix_Stdlib_SIG_ERR (void);
 void* Mono_Posix_Stdlib_SIG_IGN (void);
index e5b54da47b909f222d3664480c522d34d40ca1f8..b914dfdb1d098ec4d4518fd5b28f13b770200b2c 100644 (file)
@@ -142,6 +142,12 @@ Mono_Posix_Stdlib_TMP_MAX (void)
        return TMP_MAX;
 }
 
+void*
+Mono_Posix_Stdlib_tmpfile (void)
+{
+       return tmpfile ();
+}
+
 gint32
 Mono_Posix_Stdlib_setvbuf (void* stream, void *buf, int mode, mph_size_t size)
 {
@@ -156,6 +162,60 @@ Mono_Posix_Stdlib_setbuf (void* stream, void* buf)
        return 0;
 }
 
+void*
+Mono_Posix_Stdlib_fopen (char* path, char* mode)
+{
+       return fopen (path, mode);
+}
+
+void*
+Mono_Posix_Stdlib_freopen (char* path, char* mode, void *stream)
+{
+       return freopen (path, mode, stream);
+}
+
+gint32
+Mono_Posix_Stdlib_fprintf (void* stream, char* format, char *message)
+{
+       return fprintf (stream, format, message);
+}
+
+gint32
+Mono_Posix_Stdlib_fgetc (void* stream)
+{
+       return fgetc (stream);
+}
+
+char*
+Mono_Posix_Stdlib_fgets (char* str, gint32 size, void* stream)
+{
+       return fgets (str, size, stream);
+}
+
+gint32
+Mono_Posix_Stdlib_fputc (gint32 c, void* stream)
+{
+       return fputc (c, stream);
+}
+
+gint32
+Mono_Posix_Stdlib_fputs (char* s, void* stream)
+{
+       return fputs (s, stream);
+}
+
+gint32
+Mono_Posix_Stdlib_fclose (void* stream)
+{
+       return fclose (stream);
+}
+
+gint32
+Mono_Posix_Stdlib_fflush (void* stream)
+{
+       return fflush (stream);
+}
+
 gint32
 Mono_Posix_Stdlib_fseek (void* stream, gint64 offset, int origin)
 {
@@ -207,6 +267,24 @@ Mono_Posix_Stdlib_clearerr (void* stream)
        return 0;
 }
 
+gint32
+Mono_Posix_Stdlib_ungetc (gint32 c, void* stream)
+{
+       return ungetc (c, stream);
+}
+
+gint32
+Mono_Posix_Stdlib_feof (void* stream)
+{
+       return feof (stream);
+}
+
+gint32
+Mono_Posix_Stdlib_ferror (void* stream)
+{
+       return ferror (stream);
+}
+
 int
 Mono_Posix_Stdlib_perror (const char* s, int err)
 {
index 0c4358a51402d3d7b2b577db88eef64497857af2..077a85e58f56388f1ab9357ccbfbc5f2ba8cdc4f 100644 (file)
@@ -72,6 +72,12 @@ Mono_Posix_Stdlib_realloc (void* ptr, mph_size_t size)
        return realloc (ptr, (size_t) size);
 }
 
+void
+Mono_Posix_Stdlib_free (void* p)
+{
+       free (p);
+}
+
 G_END_DECLS
 
 /*
index 61a0f8df9c00e1a1741c267488fe1ae3ee9c5e49..afc98f0d6b8c4483567b7da9c196e2d55b3decec 100644 (file)
@@ -1,4 +1,4 @@
-.stamp-clone
+.stamp-clone-*
 CppSharp
 *.exe
 *.h
index 37909156cee069bd22496d34967a1aac901f55d6..4869bf291724bf41151719a4ca70023d19843e7b 100644 (file)
@@ -36,12 +36,12 @@ SRC_ROOT = ../..
 
 MONO_OPTIONS_SRC = $(SRC_ROOT)/mcs/class/Mono.Options/Mono.Options/Options.cs
 
-.stamp-clone:
-       @if [ ! -d $(CPPSHARP_BASE_DIR) ]; then \
-               git clone -b 60f763a9 --depth 1 git://github.com/xamarin/CppSharpBinaries.git $(CPPSHARP_BASE_DIR) && touch $@; \
-       fi
+HASH=60f763a9
+.stamp-clone-$(HASH):
+       rm -Rf $(CPPSHARP_BASE_DIR)
+       git clone -b $(HASH) --depth 1 git://github.com/xamarin/CppSharpBinaries.git $(CPPSHARP_BASE_DIR) && touch $@
 
-MonoAotOffsetsDumper.exe: .stamp-clone MonoAotOffsetsDumper.cs $(MONO_OPTIONS_SRC)
+MonoAotOffsetsDumper.exe: .stamp-clone-$(HASH) MonoAotOffsetsDumper.cs $(MONO_OPTIONS_SRC)
        mcs MonoAotOffsetsDumper.cs /debug /nowarn:0436 $(MONO_OPTIONS_SRC) $(CPPSHARP_REFS)
 
 .PHONY: clean