case "$host" in
*-mingw*|*-*-cygwin*)
AC_DEFINE(DISABLE_PORTABILITY,1,[Disable the io-portability layer])
- AC_DEFINE(PLATFORM_NO_SYMLINKS,1,[This platform does not support symlinks])
+ AC_DEFINE(HOST_NO_SYMLINKS,1,[This platform does not support symlinks])
host_win32=yes
mono_cv_clang=no
if test "x$cross_compiling" = "xno"; then
CPPFLAGS="$CPPFLAGS -D_REENTRANT -DGC_NETBSD_THREADS -D_GNU_SOURCE"
libmono_cflags="-D_REENTRANT"
LDFLAGS="$LDFLAGS -pthread"
- CPPFLAGS="$CPPFLAGS -DPLATFORM_BSD"
+ CPPFLAGS="$CPPFLAGS -DHOST_BSD"
libmono_ldflags="-pthread"
need_link_unlink=yes
libdl="-ldl"
LDFLAGS="$LDFLAGS $PTHREAD_LIBS -L/usr/local/lib"
libmono_ldflags="$PTHREAD_LIBS"
fi
- CPPFLAGS="$CPPFLAGS -DPLATFORM_BSD"
+ CPPFLAGS="$CPPFLAGS -DHOST_BSD"
need_link_unlink=yes
AC_DEFINE(PTHREAD_POINTER_ID, 1, [pthread is a pointer])
libdl=
with_sgen_default_concurrent=yes
;;
*-*-*openbsd*)
- CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE -DGC_OPENBSD_THREADS -DPLATFORM_BSD -D_REENTRANT -DUSE_MMAP"
+ CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE -DGC_OPENBSD_THREADS -DHOST_BSD -D_REENTRANT -DUSE_MMAP"
if test "x$disable_munmap" != "xyes"; then
CPPFLAGS="$CPPFLAGS -DUSE_MUNMAP"
fi
;;
*-*-linux-android*)
platform_android=yes
- AC_DEFINE(PLATFORM_ANDROID,1,[Targeting the Android platform])
+ AC_DEFINE(HOST_ANDROID,1,[Targeting the Android platform])
AC_DEFINE(TARGET_ANDROID,1,[Targeting the Android platform])
CPPFLAGS="$CPPFLAGS -DGC_LINUX_THREADS -D_GNU_SOURCE -D_REENTRANT -DUSE_MMAP"
use_sigposix=yes
;;
*-*-solaris*)
- CPPFLAGS="$CPPFLAGS -DGC_SOLARIS_THREADS -DGC_SOLARIS_PTHREADS -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -DUSE_MMAP -DUSE_MUNMAP -DPLATFORM_SOLARIS"
+ CPPFLAGS="$CPPFLAGS -DGC_SOLARIS_THREADS -DGC_SOLARIS_PTHREADS -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -DUSE_MMAP -DUSE_MUNMAP -DHOST_SOLARIS"
need_link_unlink=yes
libmono_cflags="-D_REENTRANT"
libgc_threads=pthreads
parallel_mark="Disabled_Currently_Hangs_On_MacOSX"
host_darwin=yes
target_mach=yes
- CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE -DGC_MACOSX_THREADS -DPLATFORM_MACOSX -DUSE_MMAP -DUSE_MUNMAP"
+ CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE -DGC_MACOSX_THREADS -DUSE_MMAP -DUSE_MUNMAP"
libmono_cflags="-D_THREAD_SAFE"
need_link_unlink=yes
AC_DEFINE(PTHREAD_POINTER_ID)
AC_DEFINE(TARGET_WIN32, 1, [Target Platform is Win32])
fi
+if test x$host_darwin = xyes; then
+ AC_DEFINE(HOST_DARWIN, 1, [Host Platform is Darwin])
+fi
+
# Defined for all targets/platforms using classic Windows API support.
AC_DEFINE(HAVE_CLASSIC_WINAPI_SUPPORT, 1, [Use classic Windows API support])
AC_DEFINE(HAVE_UWP_WINAPI_SUPPORT, 0, [Don't use UWP Windows API support])
AC_SUBST(extra_runtime_ldflags)
AM_CONDITIONAL(HOST_WIN32, test x$host_win32 = xyes)
AM_CONDITIONAL(TARGET_WIN32, test x$target_win32 = xyes)
-AM_CONDITIONAL(PLATFORM_LINUX, echo x$target_os | grep -q linux)
-AM_CONDITIONAL(PLATFORM_DARWIN, test x$host_darwin = xyes)
-AM_CONDITIONAL(PLATFORM_SIGPOSIX, test x$use_sigposix = xyes)
-AM_CONDITIONAL(PLATFORM_ANDROID, test x$platform_android = xyes)
+AM_CONDITIONAL(HOST_LINUX, echo x$target_os | grep -q linux)
+AM_CONDITIONAL(HOST_DARWIN, test x$host_darwin = xyes)
+AM_CONDITIONAL(HOST_SIGPOSIX, test x$use_sigposix = xyes)
+AM_CONDITIONAL(HOST_ANDROID, test x$platform_android = xyes)
-if test -z "$PLATFORM_DARWIN_TRUE"; then :
+if test -z "$HOST_DARWIN_TRUE"; then :
PLATFORM_AOT_SUFFIX=.dylib
fi
-if test -z "$PLATFORM_LINUX_TRUE"; then :
+if test -z "$HOST_LINUX_TRUE"; then :
PLATFORM_AOT_SUFFIX=.so
fi
-Subproject commit 2563306d41f7f7fa30421c629d0f3b60b08b1169
+Subproject commit bf03a7c5cf6b692fa662f1568ad66de35166b8ea
-Subproject commit 47f82456814a05b077e31b58d66c1e4c640aac79
+Subproject commit 141e6a55feee9052e347c424aff09b156e0d5497
# if defined(__GLIBC__)&& __GLIBC__>=2
# define SEARCH_FOR_DATA_START
# else /* !GLIBC2 */
-# if defined(PLATFORM_ANDROID)
+# if defined(HOST_ANDROID)
# define __environ environ
# endif
extern char **__environ;
# include <features.h>
# if defined(__GLIBC__) && __GLIBC__ >= 2
# define SEARCH_FOR_DATA_START
-# elif defined(PLATFORM_ANDROID)
+# elif defined(HOST_ANDROID)
# define SEARCH_FOR_DATA_START
# else
extern char **__environ;
/* guaranteed to be dead, but we may */
/* not yet have registered the join.) */
pthread_t id;
-#ifdef PLATFORM_ANDROID
+#ifdef HOST_ANDROID
pid_t kernel_id;
#endif
/* Extra bookkeeping information the stopping code uses */
pthread_t GC_stopping_thread;
int GC_stopping_pid;
-#ifdef PLATFORM_ANDROID
+#ifdef HOST_ANDROID
static
int android_thread_kill(pid_t tid, int sig)
{
GC_printf1("Sending suspend signal to 0x%lx\n", p -> id);
#endif
-#ifndef PLATFORM_ANDROID
+#ifndef HOST_ANDROID
result = pthread_kill(p -> id, SIG_SUSPEND);
#else
result = android_thread_kill(p -> kernel_id, SIG_SUSPEND);
GC_printf1("Sending restart signal to 0x%lx\n", p -> id);
#endif
-#ifndef PLATFORM_ANDROID
+#ifndef HOST_ANDROID
result = pthread_kill(p -> id, SIG_THR_RESTART);
#else
result = android_thread_kill(p -> kernel_id, SIG_THR_RESTART);
}
if (result == 0) return(0);
result -> id = id;
-#ifdef PLATFORM_ANDROID
+#ifdef HOST_ANDROID
result -> kernel_id = gettid();
#endif
result -> next = GC_threads[hv];
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.SqlClient.SqlBulkCopyColumnMappingCollection))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.SqlClient.SqlBulkCopyOptions))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.SqlClient.SqlClientFactory))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.SqlClient.SqlClientMetaDataCollectionNames))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.SqlClient.SqlCommand))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.SqlClient.SqlConnection))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Data.SqlClient.SqlConnectionStringBuilder))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.CngProvider))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.CngUIPolicy))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.CngUIProtectionLevels))]
+// TODO: [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.DSACng))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.ECDsaCng))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.ECKeyXmlFormat))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.RSACng))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.TripleDESCng))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.Channels.WebSocketTransportUsage))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.HttpBindingBase))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.HttpClientCredentialType))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.HttpProxyCredentialType))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.HttpTransportSecurity))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.NetHttpBinding))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.ServiceModel.NetHttpsBinding))]
{
}
+ protected SafeNCryptHandle (IntPtr handle, System.Runtime.InteropServices.SafeHandle parentHandle)
+ : base (false)
+ {
+ throw new NotImplementedException ();
+ }
+
public override bool IsInvalid { get { throw new NotImplementedException (); } }
protected override bool ReleaseHandle ()
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+using System;
+
namespace Microsoft.Win32.SafeHandles
{
public sealed class SafeNCryptKeyHandle : SafeNCryptHandle
{
}
+ public SafeNCryptKeyHandle (IntPtr handle, System.Runtime.InteropServices.SafeHandle parentHandle)
+ : base (handle, parentHandle)
+ {
+
+ }
+
protected override bool ReleaseNativeHandle ()
{
return false;
../referencesource/System.Core/System/Security/Cryptography/ECDiffieHellmanPublicKey.cs
../referencesource/System.Core/System/Security/Cryptography/ECDsa.cs
../referencesource/System.Core/System/Security/Cryptography/ECDsaCng.cs
+../referencesource/System.Core/System/Security/Cryptography/ECKeyXmlFormat.cs
../referencesource/System.Core/System/Security/Cryptography/NCryptNative.cs
../referencesource/System.Core/System/Security/Cryptography/RsaCng.cs
../referencesource/System.Core/System/Security/Cryptography/AesManaged.cs
../referencesource/System.Core/System/Security/Cryptography/ECDiffieHellman.cs
-../referencesource/System.Core/System/Security/Cryptography/ECKeyXmlFormat.cs
../referencesource/System.Core/System/threading/ReaderWriterLockSlim/LockRecursionException.cs
targetHost = targetHost.Substring (0, pos);
}
- var policy = SecPolicy.CreateSslPolicy (!serverMode, targetHost);
- var trust = new SecTrust (certificates, policy);
-
- if (validator.Settings.TrustAnchors != null) {
- var status = trust.SetAnchorCertificates (validator.Settings.TrustAnchors);
- if (status != SecStatusCode.Success)
- throw new InvalidOperationException (status.ToString ());
- trust.SetAnchorCertificatesOnly (false);
- }
-
- if (validator.Settings.CertificateValidationTime != null) {
- var status = trust.SetVerifyDate (validator.Settings.CertificateValidationTime.Value);
- if (status != SecStatusCode.Success)
- throw new InvalidOperationException (status.ToString ());
+ using (var policy = SecPolicy.CreateSslPolicy (!serverMode, targetHost))
+ using (var trust = new SecTrust (certificates, policy)) {
+ if (validator.Settings.TrustAnchors != null) {
+ var status = trust.SetAnchorCertificates (validator.Settings.TrustAnchors);
+ if (status != SecStatusCode.Success)
+ throw new InvalidOperationException (status.ToString ());
+ trust.SetAnchorCertificatesOnly (false);
+ }
+
+ if (validator.Settings.CertificateValidationTime != null) {
+ var status = trust.SetVerifyDate (validator.Settings.CertificateValidationTime.Value);
+ if (status != SecStatusCode.Success)
+ throw new InvalidOperationException (status.ToString ());
+ }
+
+ var result = trust.Evaluate ();
+ if (result == SecTrustResult.Unspecified)
+ return true;
+
+ errors |= MonoSslPolicyErrors.RemoteCertificateChainErrors;
+ return false;
}
-
- var result = trust.Evaluate ();
- if (result == SecTrustResult.Unspecified)
- return true;
-
- errors |= MonoSslPolicyErrors.RemoteCertificateChainErrors;
- return false;
}
}
}
*
*/
- var trust = GetPeerTrust (!IsServer);
- X509CertificateCollection certificates;
+ bool ok;
+ SecTrust trust = null;
+ X509CertificateCollection certificates = null;
- if (trust == null || trust.Count == 0) {
- remoteCertificate = null;
- if (!IsServer)
- throw new TlsException (AlertDescription.CertificateUnknown);
- certificates = null;
- } else {
- if (trust.Count > 1)
- Debug ("WARNING: Got multiple certificates in SecTrust!");
+ try {
+ trust = GetPeerTrust (!IsServer);
- certificates = new X509CertificateCollection ();
- for (int i = 0; i < trust.Count; i++)
- certificates.Add (trust [(IntPtr)i].ToX509Certificate ());
+ if (trust == null || trust.Count == 0) {
+ remoteCertificate = null;
+ if (!IsServer)
+ throw new TlsException (AlertDescription.CertificateUnknown);
+ certificates = null;
+ } else {
+ if (trust.Count > 1)
+ Debug ("WARNING: Got multiple certificates in SecTrust!");
- remoteCertificate = certificates [0];
- Debug ("Got peer trust: {0}", remoteCertificate);
- }
+ certificates = new X509CertificateCollection ();
+ for (int i = 0; i < trust.Count; i++)
+ certificates.Add (trust.GetCertificate (i));
+
+ remoteCertificate = new X509Certificate (certificates [0]);
+ Debug ("Got peer trust: {0}", remoteCertificate);
+ }
- bool ok;
- try {
ok = ValidateCertificate (certificates);
} catch (Exception ex) {
Debug ("Certificate validation failed: {0}", ex);
throw new TlsException (AlertDescription.CertificateUnknown, "Certificate validation threw exception.");
+ } finally {
+ if (trust != null)
+ trust.Dispose ();
+ if (certificates != null) {
+ for (int i = 0; i < certificates.Count; i++)
+ certificates [i].Dispose ();
+ }
}
if (!ok)
if (value == IntPtr.Zero)
throw new TlsException (AlertDescription.CertificateUnknown);
}
- return (value == IntPtr.Zero) ? null : new SecTrust (value);
+ return (value == IntPtr.Zero) ? null : new SecTrust (value, true);
}
#endregion
foreach (var certificate in certificates)
array [i++] = new SecCertificate (certificate);
Initialize (array, policy);
+ for (i = 0; i < array.Length; i++)
+ array [i].Dispose ();
}
void Initialize (SecCertificate[] array, SecPolicy policy)
}
}
+ internal X509Certificate GetCertificate (int index)
+ {
+ if (handle == IntPtr.Zero)
+ throw new ObjectDisposedException ("SecTrust");
+ if (index < 0 || index >= Count)
+ throw new ArgumentOutOfRangeException ("index");
+
+ var ptr = SecTrustGetCertificateAtIndex (handle, (IntPtr)index);
+ return new X509Certificate (ptr);
+ }
+
[DllImport (AppleTlsContext.SecurityLibrary)]
extern static SecStatusCode /* OSStatus */ SecTrustSetAnchorCertificates (IntPtr /* SecTrustRef */ trust, IntPtr /* CFArrayRef */ anchorCertificates);
object socketLock = new object ();
IWebConnectionState state;
WebExceptionStatus status;
- WaitCallback initConn;
bool keepAlive;
byte [] buffer;
EventHandler abortHandler;
throw new NotImplementedException ();
}
+ public CngAlgorithm HashAlgorithm { get; set; }
+
public CngKey Key {
get {
throw new NotImplementedException ();
public override bool VerifyHash(byte[] hash, byte[] signature) {
throw new NotImplementedException();
}
+
+ public void FromXmlString (string xml, ECKeyXmlFormat format) {
+ throw new NotImplementedException();
+ }
+
+ public byte[] SignData (byte[] data) {
+ throw new NotImplementedException();
+ }
+
+ public byte[] SignData (System.IO.Stream data) {
+ throw new NotImplementedException();
+ }
+
+ public byte[] SignData (byte[] data, int offset, int count) {
+ throw new NotImplementedException();
+ }
+
+ public string ToXmlString (ECKeyXmlFormat format) {
+ throw new NotImplementedException();
+ }
+
+ public bool VerifyData (byte[] data, byte[] signature) {
+ throw new NotImplementedException();
+ }
+
+ public bool VerifyData (System.IO.Stream data, byte[] signature) {
+ throw new NotImplementedException();
+ }
+
+ public bool VerifyData (byte[] data, int offset, int count, byte[] signature) {
+ throw new NotImplementedException();
+ }
#else
private static KeySizes[] s_legalKeySizes = new KeySizes[] { new KeySizes(256, 384, 128), new KeySizes(521, 521, 0) };
return true;
try {
Assembly a = universe.LoadFile (path);
+ if (a == null) {
+ Error ("Unable to to load assembly `{0}'", path);
+ return false;
+ }
foreach (AssemblyName an in a.GetReferencedAssemblies ()) {
a = LoadAssembly (an.Name);
+ if (a == null) {
+ Error ("Unable to load assembly `{0}' referenced by `{1}'", an.Name, path);
+ return false;
+ }
+
if (!QueueAssembly (files, a.CodeBase))
return false;
}
PORTABLE_TARGETS_SRC:=data/Portable/Targets
PCL5_FX_SRC:=data/Portable/Frameworks/v5.0
+DENIED_ASSEMBLY_LIST_SRC=data/deniedAssembliesList.txt
NETFRAMEWORK_DIR=$(mono_libdir)/mono/xbuild-frameworks/.NETFramework
PCL5_FX_DIR=$(mono_libdir)/mono/xbuild-frameworks/.NETPortable/v5.0
install-versioned-files: install-bin-data install-nuget-imports
#install files that are only installed once across all xbuild versions
-install-global-files: install-frameworks install-web-targets install-pcl-targets install-pcl5-framework install-nuget-targets
+install-global-files: install-frameworks install-web-targets install-pcl-targets install-pcl5-framework install-nuget-targets install-msbuild-specific-files
install-bin-data:
$(MKINSTALLDIRS) $(DESTDIR)$(XBUILD_BIN_DIR)/MSBuild
$(INSTALL_DATA) "$(PCL5_FX_SRC)/ASP.NET Core 1.0.xml" "$(DESTDIR)$(PCL5_FX_DIR)/SupportedFrameworks/ASP.NET Core 1.0.xml"
$(INSTALL_DATA) "$(PCL5_FX_SRC)/Windows Universal 10.0.xml" "$(DESTDIR)$(PCL5_FX_DIR)/SupportedFrameworks/Windows Universal 10.0.xml"
+install-msbuild-specific-files:
+ $(MKINSTALLDIRS) $(DESTDIR)$(mono_libdir)/mono/xbuild
+ $(INSTALL_DATA) $(DENIED_ASSEMBLY_LIST_SRC) $(DESTDIR)$(mono_libdir)/mono/xbuild
+
EXTRA_DISTFILES = \
data/xbuild.rsp \
data/xbuild.exe.config.in \
"data/Portable/Frameworks/v5.0/ASP.NET Core 1.0.xml" \
"data/Portable/Frameworks/v5.0/FrameworkList.xml" \
"data/Portable/Frameworks/v5.0/Windows Universal 10.0.xml" \
+ data/deniedAssembliesList.txt \
frameworks/net_2.0.xml \
frameworks/net_3.0.xml \
frameworks/net_3.5.xml \
--- /dev/null
+System.Globalization.Extensions.dll,475DBF02-9F68-44F1-8FB5-C9F69F1BD2B1,4,0,0,0
+System.Globalization.Extensions.dll,5FCD54F0-4B97-4259-875D-30E481F02EA2,4,0,1,0
+System.Globalization.Extensions.dll,E9FCFF5B-4DE1-4BDC-9CE8-08C640FC78CC,4,0,2,0
+System.IO.Compression.dll,44FCA06C-A510-4B3E-BDBF-D08D697EF65A,4,1,0,0
+System.IO.Compression.dll,3A58A219-266B-47C3-8BE8-4E4F394147AB,4,1,2,0
+System.Net.Http.dll,269B562C-CC15-4736-B1B1-68D4A43CAA98,4,1,0,0
+System.Net.Http.dll,EA2EC6DC-51DD-479C-BFC2-E713FB9E7E47,4,1,0,1
+System.Net.Http.dll,C0E04D9C-70CF-48A6-A179-FBFD8CE69FD0,4,1,1,0
+System.Net.Http.dll,817F01C3-4011-477D-890A-98232B85553D,4,1,1,0
+System.Net.Http.dll,09D4A140-061C-4884-9B63-22067E841931,4,1,1,1
+System.Reflection.DispatchProxy.dll,E40AFEB4-CABE-4124-8412-B46AB79C92FD,4,0,0,0
+System.Reflection.DispatchProxy.dll,2A69F0AD-B86B-40F2-8E4C-5B671E47479F,4,0,1,0
+System.Reflection.DispatchProxy.dll,D4E8D2DB-BD65-4168-99EA-D2C1BDEBF9CC,4,0,2,0
+System.Runtime.InteropServices.RuntimeInformation.dll,F13660F8-9D0D-419F-BA4E-315693DD26EA,4,0,0,0
+System.Runtime.InteropServices.RuntimeInformation.dll,DD91439F-3167-478E-BD2C-BF9C036A1395,4,0,1,0
+System.Text.Encoding.CodePages.dll,C142254F-DEB5-46A7-AE43-6F10320D1D1F,4,0,1,0
+System.Text.Encoding.CodePages.dll,FD178CD4-EF4F-44D5-9C3F-812B1E25126B,4,0,2,0
+System.Threading.Overlapped.dll,9F5D4F09-787A-458A-BA08-553AA71470F1,4,0,0,0
+System.Threading.Overlapped.dll,FCBD003B-2BB4-4940-BAEF-63AF520C2336,4,0,1,0
+System.Threading.Overlapped.dll,87697E71-D192-4F0B-BAD4-02BBC7793005,4,0,2,0
$(GLIB_LIBS) \
$(LIBICONV)
-if PLATFORM_DARWIN
+if HOST_DARWIN
monodis_LDFLAGS=-framework CoreFoundation -framework Foundation
endif
if HOST_WIN32
libeglib_la_LIBADD = -lm $(LIBICONV) -lpsapi
else
-if PLATFORM_ANDROID
+if HOST_ANDROID
libeglib_la_LIBADD = -llog
endif
endif
exit (0);
}
-#if PLATFORM_ANDROID
+#if HOST_ANDROID
#include <android/log.h>
static android_LogPriority
platform_sources = $(unix_sources)
endif
-if PLATFORM_ANDROID
+if HOST_ANDROID
platform_sources += ../../support/libm/complex.c
endif
#include <sys/stat.h>
#endif
-#ifdef PLATFORM_MACOSX
+#ifdef HOST_DARWIN
#include <mach-o/dyld.h>
#endif
void
mono_set_rootdir (void)
{
-#if defined(HOST_WIN32) || (defined(PLATFORM_MACOSX) && !defined(TARGET_ARM))
+#if defined(HOST_WIN32) || (defined(HOST_DARWIN) && !defined(TARGET_ARM))
gchar *bindir, *installdir, *root, *name, *resolvedname, *config;
#ifdef HOST_WIN32
#define THREAD_LOCAL_ALLOC 1
#include "private/pthread_support.h"
-#if defined(PLATFORM_MACOSX) && defined(HAVE_PTHREAD_GET_STACKADDR_NP)
+#if defined(HOST_DARWIN) && defined(HAVE_PTHREAD_GET_STACKADDR_NP)
void *pthread_get_stackaddr_np(pthread_t);
#endif
default_push_other_roots = GC_push_other_roots;
GC_push_other_roots = mono_push_other_roots;
-#if !defined(PLATFORM_ANDROID)
+#if !defined(HOST_ANDROID)
/* If GC_no_dls is set to true, GC_find_limit is not called. This causes a seg fault on Android. */
GC_no_dls = TRUE;
#endif
HANDLES(ICALL(NDNS_2, "GetHostByName_internal(string,string&,string[]&,string[]&,int)", ves_icall_System_Net_Dns_GetHostByName_internal))
HANDLES(ICALL(NDNS_3, "GetHostName_internal(string&)", ves_icall_System_Net_Dns_GetHostName_internal))
-#if defined(PLATFORM_MACOSX) || defined(PLATFORM_BSD)
+#if defined(HOST_DARWIN) || defined(HOST_BSD)
ICALL_TYPE(MAC_IFACE_PROPS, "System.Net.NetworkInformation.MacOsIPInterfaceProperties", MAC_IFACE_PROPS_1)
ICALL(MAC_IFACE_PROPS_1, "ParseRouteInfo_internal", ves_icall_System_Net_NetworkInformation_MacOsIPInterfaceProperties_ParseRouteInfo_internal)
#endif
This is to be removed once a proper fix is shipped through nuget.
+Please keep this in sync with mcs/tools/xbuild/data/deniedAssembliesList.txt
+If any assemblies are added/removed, then this should be regenerated with:
+
+ $ mono tools/nuget-hash-extractor/nuget-hash-extractor.exe nugets guids_for_msbuild > mcs/tools/xbuild/data/deniedAssembliesList.txt
+
*/
typedef enum {
static gboolean
is_absolute_path (const char *path)
{
-#ifdef PLATFORM_MACOSX
+#ifdef HOST_DARWIN
if (!strncmp (path, "@executable_path/", 17) || !strncmp (path, "@loader_path/", 13) ||
!strncmp (path, "@rpath/", 7))
return TRUE;
static int
dump_os (void)
{
-#if defined (PLATFORM_WIN32)
+#if defined (HOST_WIN32)
g_print ("#ifdef TARGET_WIN32\n");
-#elif defined (PLATFORM_ANDROID)
+#elif defined (HOST_ANDROID)
g_print ("#ifdef TARGET_ANDROID\n");
-#elif defined (PLATFORM_MACOSX)
+#elif defined (HOST_DARWIN)
g_print ("#ifdef TARGET_OSX\n");
#elif defined (PLATFORM_IOS)
g_print ("#ifdef TARGET_IOS\n");
* Ben Woods (woodsb02@gmail.com)
*/
-#if defined(PLATFORM_MACOSX) || defined(PLATFORM_BSD)
-
#include <config.h>
+
+#if defined(HOST_DARWIN) || defined(HOST_BSD)
#include <sys/socket.h>
#include <net/if.h>
#include <net/if_dl.h>
return 0;
}
-#endif /* #if defined(PLATFORM_MACOSX) || defined(PLATFORM_BSD) */
+#endif /* #if defined(HOST_DARWIN) || defined(HOST_BSD) */
#ifndef __MONO_ROUTE_H__
#define __MONO_ROUTE_H__
-#if defined(PLATFORM_MACOSX) || defined(PLATFORM_BSD)
+#if defined(HOST_DARWIN) || defined(HOST_BSD)
#include <sys/socket.h>
/* Category icalls */
extern MonoBoolean ves_icall_System_Net_NetworkInformation_MacOsIPInterfaceProperties_ParseRouteInfo_internal (MonoString *iface, MonoArray **gw_addr_list);
-#endif /* #if defined(PLATFORM_MACOSX) || defined(PLATFORM_BSD) */
+#endif /* #if defined(HOST_DARWIN) || defined(HOST_BSD) */
#endif /* __MONO_ROUTE_H__ */
worker.limit_worker_min = threads_count;
-#if defined (PLATFORM_ANDROID) || defined (HOST_IOS)
+#if defined (HOST_ANDROID) || defined (HOST_IOS)
worker.limit_worker_max = CLAMP (threads_count * 100, MIN (threads_count, 200), MAX (threads_count, 200));
#else
worker.limit_worker_max = threads_count * 100;
#include <objbase.h>
#endif
-#if defined(PLATFORM_ANDROID) && !defined(TARGET_ARM64) && !defined(TARGET_AMD64)
+#if defined(HOST_ANDROID) && !defined(TARGET_ARM64) && !defined(TARGET_AMD64)
#define USE_TKILL_ON_ANDROID 1
#endif
-#ifdef PLATFORM_ANDROID
+#ifdef HOST_ANDROID
#include <errno.h>
#ifdef USE_TKILL_ON_ANDROID
mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: moving fd %d by %" G_GINT64_FORMAT " bytes from %d", __func__, ((MonoFDHandle*) filehandle)->fd, offset, whence);
-#ifdef PLATFORM_ANDROID
+#ifdef HOST_ANDROID
/* bionic doesn't support -D_FILE_OFFSET_BITS=64 */
MONO_ENTER_GC_SAFE;
newpos=lseek64(((MonoFDHandle*) filehandle)->fd, offset, whence);
} _wapi_drive_type;
static _wapi_drive_type _wapi_drive_types[] = {
-#if PLATFORM_MACOSX
+#if HOST_DARWIN
{ DRIVE_REMOTE, "afp" },
{ DRIVE_REMOTE, "autofs" },
{ DRIVE_CDROM, "cddafs" },
}
#endif
-#if defined (PLATFORM_MACOSX) || defined (__linux__)
+#if defined (HOST_DARWIN) || defined (__linux__)
static guint32
GetDriveTypeFromPath (const gchar *utf8_root_path_name)
{
MONO_EXIT_GC_SAFE;
if (res == -1)
return DRIVE_UNKNOWN;
-#if PLATFORM_MACOSX
+#if HOST_DARWIN
return _wapi_get_drive_type (buf.f_fstypename);
#else
return _wapi_get_drive_type (buf.f_type);
return (drive_type);
}
-#if defined (PLATFORM_MACOSX) || defined (__linux__) || defined(PLATFORM_BSD) || defined(__FreeBSD_kernel__) || defined(__HAIKU__)
+#if defined (HOST_DARWIN) || defined (__linux__) || defined(HOST_BSD) || defined(__FreeBSD_kernel__) || defined(__HAIKU__)
static gchar*
get_fstypename (gchar *utfpath)
{
-#if defined (PLATFORM_MACOSX) || defined (__linux__)
+#if defined (HOST_DARWIN) || defined (__linux__)
struct statfs stat;
#if __linux__
_wapi_drive_type *current;
MONO_EXIT_GC_SAFE;
if (statfs_res == -1)
return NULL;
-#if PLATFORM_MACOSX
+#if HOST_DARWIN
return g_strdup (stat.f_fstypename);
#else
current = &_wapi_drive_types[0];
#include <unistd.h>
-#ifdef PLATFORM_SOLARIS
+#ifdef HOST_SOLARIS
/* procfs.h cannot be included if this define is set, but it seems to work fine if it is undefined */
#if _FILE_OFFSET_BITS == 64
#undef _FILE_OFFSET_BITS
gchar buf[256];
gchar *ret = NULL;
-#if defined(PLATFORM_SOLARIS)
+#if defined(HOST_SOLARIS)
filename = g_strdup_printf ("/proc/%d/psinfo", pid);
if ((fp = fopen (filename, "r")) != NULL) {
struct psinfo info;
* FOR EXCLUSIVE USE BY w32process-unix.c
*/
-#if defined(PLATFORM_MACOSX)
+#if defined(HOST_DARWIN)
#define USE_OSX_BACKEND
#elif (defined(__OpenBSD__) || defined(__FreeBSD__)) && defined(HAVE_LINK_H)
#define USE_BSD_BACKEND
{
#if defined(HOST_WATCHOS)
return TRUE; // TODO: Rewrite using sysctl
-#elif defined(PLATFORM_MACOSX) || defined(__OpenBSD__) || defined(__FreeBSD__)
+#elif defined(HOST_DARWIN) || defined(__OpenBSD__) || defined(__FreeBSD__)
if (pid == 0)
return FALSE;
if (kill (pid, 0) == 0)
goto done;
}
-#ifdef PLATFORM_MACOSX
+#ifdef HOST_DARWIN
handler = g_strdup ("/usr/bin/open");
#else
/*
return SOCKET_ERROR;
}
-#if defined (PLATFORM_MACOSX)
+#if defined (HOST_DARWIN)
// ioctl (socket, FIONREAD, XXX) returns the size of
// the UDP header as well on Darwin.
//
if HOST_WIN32
libmonoldflags=-no-undefined -avoid-version -Wl,--kill-at $(monoldflags)
else
-if PLATFORM_ANDROID
+if HOST_ANDROID
libmonoldflags= -avoid-version $(monoldflags)
else
libmonoldflags=$(monoldflags) -version-info 1:0:0
lib_LTLIBRARIES += libmono-llvm.la
libmono_llvm_la_SOURCES = mini-llvm.c mini-llvm-cpp.cpp llvm-jit.cpp
libmono_llvm_la_LIBADD = $(GLIB_LIBS) $(LLVM_LIBS) $(LLVM_LDFLAGS)
-if PLATFORM_DARWIN
+if HOST_DARWIN
libmono_llvm_la_LDFLAGS=-Wl,-undefined -Wl,suppress -Wl,-flat_namespace
else
libmono_llvm_la_LIBADD += $(top_builddir)/mono/mini/libmonoboehm-$(API_VER).la $(boehm_libs)
monobin_platform_ldflags=
endif
-if PLATFORM_SIGPOSIX
+if HOST_SIGPOSIX
os_sources = $(posix_sources)
monobin_platform_ldflags=
endif
-if PLATFORM_DARWIN
+if HOST_DARWIN
os_sources = $(darwin_sources) $(posix_sources)
#monobin_platform_ldflags=-sectcreate __TEXT __info_plist $(top_srcdir)/mono/mini/Info.plist -framework CoreFoundation -framework Foundation
monobin_platform_ldflags=-framework CoreFoundation -framework Foundation
void
mono_aot_handle_pagefault (void *ptr)
{
-#ifndef PLATFORM_WIN32
+#ifndef HOST_WIN32
guint8* start = (guint8*)ROUND_DOWN (((gssize)ptr), mono_pagesize ());
int res;
#include <ws2tcpip.h>
#endif
-#ifdef PLATFORM_ANDROID
+#ifdef HOST_ANDROID
#include <linux/in.h>
#include <linux/tcp.h>
#include <sys/endian.h>
#define DEBUG(level,s) do { if (G_UNLIKELY ((level) <= log_level)) { s; fflush (log_file); } } while (0)
-#ifdef PLATFORM_ANDROID
+#ifdef HOST_ANDROID
#define DEBUG_PRINTF(level, ...) do { if (G_UNLIKELY ((level) <= log_level)) { g_print (__VA_ARGS__); } } while (0)
#else
#define DEBUG_PRINTF(level, ...) do { if (G_UNLIKELY ((level) <= log_level)) { fprintf (log_file, __VA_ARGS__); fflush (log_file); } } while (0)
return agent_config.enabled;
}
-#if defined(PLATFORM_ANDROID) || defined(TARGET_ANDROID)
+#if defined(HOST_ANDROID) || defined(TARGET_ANDROID)
void
mono_debugger_agent_unhandled_exception (MonoException *exc)
{
void
mono_debugger_agent_free_domain_info (MonoDomain *domain);
-#if defined(PLATFORM_ANDROID) || defined(TARGET_ANDROID)
+#if defined(HOST_ANDROID) || defined(TARGET_ANDROID)
void
mono_debugger_agent_unhandled_exception (MonoException *exc);
#endif
#include <string.h>
#ifndef MONO_CROSS_COMPILE
-#ifdef PLATFORM_ANDROID
+#ifdef HOST_ANDROID
#include <asm/sigcontext.h>
-#endif /* def PLATFORM_ANDROID */
+#endif /* def HOST_ANDROID */
#endif
#ifdef HAVE_UCONTEXT_H
IL_0018: ldloc.0
ret
}
+
+ .field private static int32 byte_val
+ .field private static int32 short_val
+
+ .method static int32 widen_arguments (unsigned int8 a, int8 b, int16 c, unsigned int16 d) cil managed noinlining
+ {
+ .maxstack 4
+ ldsfld int32 Tests::byte_val
+ starg.s 0
+ ldarg.0
+ ldc.i4 128 //0x80
+ beq L_0
+
+ ldc.i4.1
+ ret
+L_0:
+ ldsfld int32 Tests::byte_val
+ starg.s 1
+ ldarg.1
+ ldc.i4 -128 //-0x80
+ beq L_1
+
+ ldc.i4.2
+ ret
+
+L_1:
+ ldsfld int32 Tests::short_val
+ starg.s 2
+ ldarg.2
+ ldc.i4 -32768 //-0x8000
+ beq L_2
+
+ ldc.i4.3
+ ret
+
+L_2:
+ ldsfld int32 Tests::short_val
+ starg.s 3
+ ldarg.3
+ ldc.i4 32768 //0x8000
+ beq L_3
+
+ ldc.i4.4
+ ret
+
+L_3:
+ ldc.i4.0
+ ret
+ }
+
+ .method public static int32 test_0_implicit_widen_of_argument_stores () cil managed
+ {
+ .maxstack 5
+ /*
+ This test verifies that storing an I4 value from the evail stack into a local variable triggers proper widening.
+ The values are picked so storing them have different values depending on the sign'ness of the local variable.
+ */
+ ldc.i4 0x180
+ stsfld int32 Tests::byte_val
+ ldc.i4 0x18000
+ stsfld int32 Tests::short_val
+
+ ldc.i4.0
+ ldc.i4.0
+ ldc.i4.0
+ ldc.i4.0
+ call int32 Tests::widen_arguments (unsigned int8 a, int8 b, int16 c, unsigned int16 d)
+ ret
+ }
+
+ .method public static int32 test_0_implicit_widen_of_local_stores () cil managed
+ {
+ .maxstack 4
+ .locals init (
+ unsigned int8 V_0,
+ int8 V_1,
+ int16 V_2,
+ unsigned int16 V_3)
+
+ /*
+ This test verifies that storing an I4 value from the evail stack into a local variable triggers proper widening.
+ The values are picked so storing them have different values depending on the sign'ness of the local variable.
+ */
+ ldc.i4 0x180
+ stsfld int32 Tests::byte_val
+ ldc.i4 0x18000
+ stsfld int32 Tests::short_val
+
+ ldsfld int32 Tests::byte_val
+ stloc.0
+ ldloc.0
+ ldc.i4 128 //0x80
+ beq L_0
+
+ ldc.i4.1
+ ret
+L_0:
+ ldsfld int32 Tests::byte_val
+ stloc.1
+ ldloc.1
+ ldc.i4 -128 //-0x80
+ beq L_1
+
+ ldc.i4.2
+ ret
+L_1:
+ ldsfld int32 Tests::short_val
+ stloc.2
+ ldloc.2
+ ldc.i4 -32768 //-0x8000
+ beq L_2
+
+ ldc.i4.3
+ ret
+L_2:
+ ldsfld int32 Tests::short_val
+ stloc.3
+ ldloc.3
+ ldc.i4 32768 //0x8000
+ beq L_3
+
+ ldc.i4.4
+ ret
+L_3:
+ ldc.i4.0
+ ret
+ }
}
cfg->headers_to_free = g_slist_prepend_mempool (cfg->mempool, cfg->headers_to_free, header);
}
+static guint32
+mono_type_to_stloc_coerce (MonoType *type)
+{
+ if (type->byref)
+ return 0;
+
+ type = mini_get_underlying_type (type);
+handle_enum:
+ switch (type->type) {
+ case MONO_TYPE_I1:
+ return OP_ICONV_TO_I1;
+ case MONO_TYPE_U1:
+ return OP_ICONV_TO_U1;
+ case MONO_TYPE_I2:
+ return OP_ICONV_TO_I2;
+ case MONO_TYPE_U2:
+ return OP_ICONV_TO_U2;
+ case MONO_TYPE_I4:
+ case MONO_TYPE_U4:
+ case MONO_TYPE_I:
+ case MONO_TYPE_U:
+ case MONO_TYPE_PTR:
+ case MONO_TYPE_FNPTR:
+ case MONO_TYPE_CLASS:
+ case MONO_TYPE_STRING:
+ case MONO_TYPE_OBJECT:
+ case MONO_TYPE_SZARRAY:
+ case MONO_TYPE_ARRAY:
+ case MONO_TYPE_I8:
+ case MONO_TYPE_U8:
+ case MONO_TYPE_R4:
+ case MONO_TYPE_R8:
+ case MONO_TYPE_TYPEDBYREF:
+ case MONO_TYPE_GENERICINST:
+ return 0;
+ case MONO_TYPE_VALUETYPE:
+ if (type->data.klass->enumtype) {
+ type = mono_class_enum_basetype (type->data.klass);
+ goto handle_enum;
+ }
+ return 0;
+ case MONO_TYPE_VAR:
+ case MONO_TYPE_MVAR: //TODO I believe we don't need to handle gsharedvt as there won't be match and, for example, u1 is not covariant to u32
+ return 0;
+ default:
+ g_error ("unknown type 0x%02x in mono_type_to_stloc_coerce", type->type);
+ }
+ return -1;
+}
+
static void
emit_stloc_ir (MonoCompile *cfg, MonoInst **sp, MonoMethodHeader *header, int n)
{
MonoInst *ins;
+ guint32 coerce_op = mono_type_to_stloc_coerce (header->locals [n]);
+
+ if (coerce_op) {
+ if (cfg->cbb->last_ins == sp [0] && sp [0]->opcode == coerce_op) {
+ if (cfg->verbose_level > 2)
+ printf ("Found existing coercing is enough for stloc\n");
+ } else {
+ MONO_INST_NEW (cfg, ins, coerce_op);
+ ins->dreg = alloc_ireg (cfg);
+ ins->sreg1 = sp [0]->dreg;
+ ins->type = STACK_I4;
+ ins->klass = mono_class_from_mono_type (header->locals [n]);
+ MONO_ADD_INS (cfg->cbb, ins);
+ *sp = mono_decompose_opcode (cfg, ins);
+ }
+ }
+
+
guint32 opcode = mono_type_to_regmove (cfg, header->locals [n]);
if ((opcode == OP_MOVE) && cfg->cbb->last_ins == sp [0] &&
((sp [0]->opcode == OP_ICONST) || (sp [0]->opcode == OP_I8CONST))) {
}
}
+static void
+emit_starg_ir (MonoCompile *cfg, MonoInst **sp, int n)
+{
+ MonoInst *ins;
+ guint32 coerce_op = mono_type_to_stloc_coerce (cfg->arg_types [n]);
+
+ if (coerce_op) {
+ if (cfg->cbb->last_ins == sp [0] && sp [0]->opcode == coerce_op) {
+ if (cfg->verbose_level > 2)
+ printf ("Found existing coercing is enough for starg\n");
+ } else {
+ MONO_INST_NEW (cfg, ins, coerce_op);
+ ins->dreg = alloc_ireg (cfg);
+ ins->sreg1 = sp [0]->dreg;
+ ins->type = STACK_I4;
+ ins->klass = mono_class_from_mono_type (cfg->arg_types [n]);
+ MONO_ADD_INS (cfg->cbb, ins);
+ *sp = mono_decompose_opcode (cfg, ins);
+ }
+ }
+
+ EMIT_NEW_ARGSTORE (cfg, ins, n, *sp);
+}
+
/*
* ldloca inhibits many optimizations so try to get rid of it in common
* cases.
CHECK_ARG (n);
if (!dont_verify_stloc && target_type_is_incompatible (cfg, param_types [ip [1]], *sp))
UNVERIFIED;
- EMIT_NEW_ARGSTORE (cfg, ins, n, *sp);
+ emit_starg_ir (cfg, sp, n);
ip += 2;
break;
case CEE_LDLOC_S:
CHECK_ARG (n);
if (!dont_verify_stloc && target_type_is_incompatible (cfg, param_types [n], *sp))
UNVERIFIED;
- EMIT_NEW_ARGSTORE (cfg, ins, n, *sp);
+ emit_starg_ir (cfg, sp, n);
ip += 4;
break;
case CEE_LDLOC:
return code;
}
-#if defined(__ARM_EABI__) && defined(__linux__) && !defined(PLATFORM_ANDROID) && !defined(MONO_CROSS_COMPILE)
+#if defined(__ARM_EABI__) && defined(__linux__) && !defined(HOST_ANDROID) && !defined(MONO_CROSS_COMPILE)
#define HAVE_AEABI_READ_TP 1
#endif
* glibc fork acquires some locks, so if the crash happened inside malloc/free,
* it will deadlock. Call the syscall directly instead.
*/
-#if defined(PLATFORM_ANDROID)
+#if defined(HOST_ANDROID)
/* SYS_fork is defined to be __NR_fork which is not defined in some ndk versions */
g_assert_not_reached ();
-#elif !defined(PLATFORM_MACOSX) && defined(SYS_fork)
+#elif !defined(HOST_DARWIN) && defined(SYS_fork)
pid = (pid_t) syscall (SYS_fork);
-#elif defined(PLATFORM_MACOSX) && HAVE_FORK
+#elif defined(HOST_DARWIN) && HAVE_FORK
pid = (pid_t) fork ();
#else
g_assert_not_reached ();
#endif
}
#else
-#ifdef PLATFORM_ANDROID
+#ifdef HOST_ANDROID
/* set DUMPABLE for this process so debuggerd can attach with ptrace(2), see:
* https://android.googlesource.com/platform/bionic/+/151da681000c07da3c24cd30a3279b1ca017f452/linker/debugger.cpp#206
* this has changed on later versions of Android. Also, we don't want to
if (!mono_do_crash_chaining) {
/*Android abort is a fluke, it doesn't abort, it triggers another segv. */
-#if defined (PLATFORM_ANDROID)
+#if defined (HOST_ANDROID)
exit (-1);
#else
abort ();
mono_runtime_printf ("%s", text->str);
-#if PLATFORM_WIN32 && TARGET_WIN32 && _DEBUG
+#if HOST_WIN32 && TARGET_WIN32 && _DEBUG
OutputDebugStringA(text->str);
#endif
/*
* LOCKING: loader lock
*/
-#if defined(PLATFORM_ANDROID) && defined(TARGET_ARM)
+#if defined(HOST_ANDROID) && defined(TARGET_ARM)
/* work around for HW bug on Nexus9 when running on armv7 */
#ifdef __clang__
static __attribute__ ((optnone)) void
#include "jit-icalls.h"
-#ifdef PLATFORM_MACOSX
+#ifdef HOST_DARWIN
#include <mach/mach.h>
#include <mach/mach_time.h>
#include <mach/clock.h>
return FALSE;
}
-#ifndef PLATFORM_MACOSX
+#ifndef HOST_DARWIN
void
mono_runtime_install_handlers (void)
{
#ifdef MONO_ARCH_SIGSEGV_ON_ALTSTACK
/*Apple likes to deliver SIGBUS for *0 */
-#ifdef PLATFORM_MACOSX
+#ifdef HOST_DARWIN
if (signo == SIGSEGV || signo == SIGBUS) {
#else
if (signo == SIGSEGV) {
add_signal_handler (SIGSEGV, mono_sigsegv_signal_handler, 0);
}
-#ifndef PLATFORM_MACOSX
+#ifndef HOST_DARWIN
void
mono_runtime_install_handlers (void)
{
static volatile gint32 sampling_thread_running;
-#ifdef PLATFORM_MACOSX
+#ifdef HOST_DARWIN
static clock_serv_t sampling_clock_service;
mono_profiler_sampling_thread_post ();
-#ifndef PLATFORM_MACOSX
+#ifndef HOST_DARWIN
/*
* There is a slight problem when we're using CLOCK_PROCESS_CPUTIME_ID: If
* we're shutting down and there's largely no activity in the process other
* get us a 100% sampling rate. However, this may interfere with the GC's
* STW logic. Could perhaps be solved by taking the suspend lock.
*/
-#if defined (USE_POSIX_BACKEND) && defined (SIGRTMIN) && !defined (PLATFORM_ANDROID)
+#if defined (USE_POSIX_BACKEND) && defined (SIGRTMIN) && !defined (HOST_ANDROID)
/* Just take the first real-time signal we can get. */
profiler_signal = mono_threads_suspend_search_alternative_signal ();
#else
memset (argv, 0, sizeof (char*) * 10);
-#if defined(PLATFORM_MACOSX)
+#if defined(HOST_DARWIN)
if (native_stack_with_lldb (crashed_pid, argv, commands, commands_filename))
goto exec;
#endif
if (native_stack_with_gdb (crashed_pid, argv, commands, commands_filename))
goto exec;
-#if !defined(PLATFORM_MACOSX)
+#if !defined(HOST_DARWIN)
if (native_stack_with_lldb (crashed_pid, argv, commands, commands_filename))
goto exec;
#endif
mono_add_internal_call ("Mono.Runtime::mono_runtime_cleanup_handlers",
mono_runtime_cleanup_handlers);
-#if defined(PLATFORM_ANDROID) || defined(TARGET_ANDROID)
+#if defined(HOST_ANDROID) || defined(TARGET_ANDROID)
mono_add_internal_call ("System.Diagnostics.Debugger::Mono_UnhandledException_internal",
mono_debugger_agent_unhandled_exception);
#endif
cfg->llvm_only = (flags & JIT_FLAG_LLVM_ONLY) != 0;
cfg->backend = current_backend;
-#ifdef PLATFORM_ANDROID
+#ifdef HOST_ANDROID
if (cfg->method->wrapper_type != MONO_WRAPPER_NONE) {
/* FIXME: Why is this needed */
cfg->gen_seq_points = FALSE;
#define mono_simd_shuffle_mask(a,b,c,d) ((a) | ((b) << 2) | ((c) << 4) | ((d) << 6))
/* Remap printf to g_print (we use a mix of these in the mini code) */
-#ifdef PLATFORM_ANDROID
+#ifdef HOST_ANDROID
#define printf g_print
#endif
#include <mono/utils/mono-memory-model.h>
#include "trace.h"
-#if defined (PLATFORM_ANDROID) || (defined (TARGET_IOS) && defined (TARGET_IOS))
+#if defined (HOST_ANDROID) || (defined (TARGET_IOS) && defined (TARGET_IOS))
# undef printf
# define printf(...) g_log("mono", G_LOG_LEVEL_MESSAGE, __VA_ARGS__)
# undef fprintf
suppressiondir = $(datadir)/mono-$(API_VER)/mono/profiler
suppression_DATA = mono-profiler-log.suppression
-if PLATFORM_DARWIN
+if HOST_DARWIN
if BITCODE
prof_ldflags = -no-undefined
else
libmono_dep = $(monodir)/mono/mini/$(LIBMONO_LA)
endif
-if PLATFORM_ANDROID
+if HOST_ANDROID
prof_ldflags = -avoid-version
endif
#endif
/* gcc 4.2.1 from xcode4 crashes on sgen_card_table_get_card_address () when this is enabled */
-#if defined(PLATFORM_MACOSX)
+#if defined(HOST_DARWIN)
#if MONO_GNUC_VERSION <= 40300
#undef PREFETCH_CARDS
#endif
#
# Test that no symbols are missed in eglib-remap.h
#
-if PLATFORM_LINUX
+if HOST_LINUX
test-platform: test-eglib-remap
else
-if PLATFORM_DARWIN
+if HOST_DARWIN
test-platform: test-eglib-remap
endif
endif
test_cflags = $(AM_CFLAGS) $(SGEN_DEFINES)
test_ldadd = libtestlib.la \
$(LIBGC_LIBS) $(GLIB_LIBS) -lm $(LIBICONV)
-if PLATFORM_DARWIN
+if HOST_DARWIN
test_ldflags = -framework CoreFoundation -framework Foundation
endif
#define MONO_EMPTY_SOURCE_FILE(x)
#endif
-#if !defined(_MSC_VER) && !defined(PLATFORM_SOLARIS) && !defined(_WIN32) && !defined(__CYGWIN__) && !defined(MONOTOUCH) && HAVE_VISIBILITY_HIDDEN
+#if !defined(_MSC_VER) && !defined(HOST_SOLARIS) && !defined(_WIN32) && !defined(__CYGWIN__) && !defined(MONOTOUCH) && HAVE_VISIBILITY_HIDDEN
#if MONO_LLVM_LOADED
#define MONO_LLVM_INTERNAL MONO_API
#else
void *
mono_dl_open_file (const char *file, int flags)
{
-#ifdef PLATFORM_ANDROID
+#ifdef HOST_ANDROID
/* Bionic doesn't support NULL filenames */
if (!file)
return NULL;
#include "mono/utils/mono-hwcap.h"
-#if defined(HAVE_SYS_AUXV_H) && !defined(PLATFORM_ANDROID)
+#if defined(HAVE_SYS_AUXV_H) && !defined(HOST_ANDROID)
#include <sys/auxv.h>
#elif defined(__APPLE__)
#include <mach/machine.h>
void
mono_hwcap_arch_init (void)
{
-#if defined(HAVE_SYS_AUXV_H) && !defined(PLATFORM_ANDROID)
+#if defined(HAVE_SYS_AUXV_H) && !defined(HOST_ANDROID)
unsigned long hwcap;
unsigned long platform;
*/
#include <config.h>
-#if defined (PLATFORM_ANDROID)
+#if defined (HOST_ANDROID)
#include <android/log.h>
#include "mono-logger-internals.h"
#endif /* !__GNUC__ */
-#if defined (PLATFORM_ANDROID) || (defined (TARGET_IOS) && defined (TARGET_IOS))
+#if defined (HOST_ANDROID) || (defined (TARGET_IOS) && defined (TARGET_IOS))
#define mono_gc_printf(gc_log_file, format, ...) g_log ("mono-gc", G_LOG_LEVEL_MESSAGE, format, ##__VA_ARGS__)
#define mono_runtime_printf(format, ...) g_log ("mono-rt", G_LOG_LEVEL_MESSAGE, format "\n", ##__VA_ARGS__)
void mono_log_write_logfile (const char *, GLogLevelFlags, mono_bool, const char *);
void mono_log_close_logfile (void);
-#if PLATFORM_ANDROID
+#if HOST_ANDROID
void mono_log_open_logcat (const char *path, void *userData);
void mono_log_write_logcat (const char *log_domain, GLogLevelFlags level, mono_bool hdr, const char *message);
void mono_log_close_logcat (void);
if(level_stack == NULL)
mono_trace_init();
-#if PLATFORM_ANDROID
+#if HOST_ANDROID
logger.opener = mono_log_open_logcat;
logger.writer = mono_log_write_logcat;
logger.closer = mono_log_close_logcat;
#if !defined(HOST_WIN32)
-#if !defined(CLOCK_MONOTONIC) || defined(PLATFORM_MACOSX) || defined(PLATFORM_ANDROID)
+#if !defined(CLOCK_MONOTONIC) || defined(HOST_DARWIN) || defined(HOST_ANDROID)
#define BROKEN_CLOCK_SOURCE
#endif
* This ensures that the path that we store points to the final file
* not a path to a symlink.
*/
-#if !defined(PLATFORM_NO_SYMLINKS)
+#if !defined(HOST_NO_SYMLINKS)
static gchar *
resolve_symlink (const char *path)
{
gchar *
mono_path_resolve_symlinks (const char *path)
{
-#if defined(PLATFORM_NO_SYMLINKS)
+#if defined(HOST_NO_SYMLINKS)
return mono_path_canonicalize (path);
#else
gchar **split = g_strsplit (path, G_DIR_SEPARATOR_S, -1);
int
mono_cpu_count (void)
{
-#ifdef PLATFORM_ANDROID
+#ifdef HOST_ANDROID
/* Android tries really hard to save power by powering off CPUs on SMP phones which
* means the normal way to query cpu count returns a wrong value with userspace API.
* Instead we use /sys entries to query the actual hardware CPU count.
* * use sched_getaffinity (+ fallback to _SC_NPROCESSORS_ONLN in case of error) on x86. This
* ensures we're inline with what OpenJDK [4] and CoreCLR [5] do
* * use _SC_NPROCESSORS_CONF exclusively on ARM (I think we could eventually even get rid of
- * the PLATFORM_ANDROID special case)
+ * the HOST_ANDROID special case)
*
* Helpful links:
*
int
mono_atexit (void (*func)(void))
{
-#ifdef PLATFORM_ANDROID
+#ifdef HOST_ANDROID
/* Some versions of android libc doesn't define atexit () */
return 0;
#else
#define __MONO_MONO_SIGCONTEXT_H__
#include <config.h>
-#if defined(PLATFORM_ANDROID)
+#if defined(HOST_ANDROID)
#include <asm/sigcontext.h>
#endif
#define UCONTEXT_REG_ESI(ctx) (((ucontext_t*)(ctx))->sc_esi)
#define UCONTEXT_REG_EDI(ctx) (((ucontext_t*)(ctx))->sc_edi)
#define UCONTEXT_REG_EIP(ctx) (((ucontext_t*)(ctx))->sc_eip)
-#elif defined(PLATFORM_SOLARIS)
+#elif defined(HOST_SOLARIS)
#define UCONTEXT_REG_EAX(ctx) (((ucontext_t*)(ctx))->uc_mcontext.gregs [EAX])
#define UCONTEXT_REG_EBX(ctx) (((ucontext_t*)(ctx))->uc_mcontext.gregs [EBX])
#define UCONTEXT_REG_ECX(ctx) (((ucontext_t*)(ctx))->uc_mcontext.gregs [ECX])
#define UCONTEXT_REG_EIP(ctx) (((ucontext_t*)(ctx))->uc_mcontext.gregs [EIP])
#else
-#if defined(PLATFORM_ANDROID) && !defined(HAVE_UCONTEXT_H)
+#if defined(HOST_ANDROID) && !defined(HAVE_UCONTEXT_H)
/* No ucontext.h as of NDK v6b */
typedef int greg_t;
#define NGREG 19
#include <config.h>
-#if defined(PLATFORM_ANDROID)
+#if defined(HOST_ANDROID)
#include <pthread.h>
#include <stdio.h>
#include <config.h>
-#if (defined(__linux__) && !defined(PLATFORM_ANDROID)) || defined(__FreeBSD_kernel__)
+#if (defined(__linux__) && !defined(HOST_ANDROID)) || defined(__FreeBSD_kernel__)
#include <mono/utils/mono-threads.h>
#include <pthread.h>
static int
abort_signal_get (void)
{
-#if defined(PLATFORM_ANDROID)
+#if defined(HOST_ANDROID)
return SIGTTIN;
#elif defined (SIGRTMIN)
static int abort_signum = -1;
static int
suspend_signal_get (void)
{
-#if defined(PLATFORM_ANDROID)
+#if defined(HOST_ANDROID)
return SIGPWR;
#elif defined (SIGRTMIN)
static int suspend_signum = -1;
static int
restart_signal_get (void)
{
-#if defined(PLATFORM_ANDROID)
+#if defined(HOST_ANDROID)
return SIGXCPU;
#elif defined (SIGRTMIN)
static int restart_signum = -1;
On 32bits arm Android, signals with values >=32 are not usable as their headers ship a broken sigset_t.
See 5005c6f3fbc1da584c6a550281689cc23f59fe6d for more details.
*/
-#ifdef PLATFORM_ANDROID
+#ifdef HOST_ANDROID
g_assert (suspend_signal_num < 32);
g_assert (restart_signal_num < 32);
g_assert (abort_signal_num < 32);
#include <errno.h>
-#if defined(PLATFORM_ANDROID) && !defined(TARGET_ARM64) && !defined(TARGET_AMD64)
+#if defined(HOST_ANDROID) && !defined(TARGET_ARM64) && !defined(TARGET_AMD64)
#define USE_TKILL_ON_ANDROID 1
#endif
void
mono_threads_suspend_register (MonoThreadInfo *info)
{
-#if defined (PLATFORM_ANDROID)
+#if defined (HOST_ANDROID)
info->native_handle = gettid ();
#endif
}
} while (1);
} else {
int ret;
-#if defined (__linux__) && !defined(PLATFORM_ANDROID)
+#if defined (__linux__) && !defined(HOST_ANDROID)
struct timespec start, target;
/* Use clock_nanosleep () to prevent time drifting problems when nanosleep () is interrupted by signals */
#include <sys/sysctl.h>
#endif
-#if defined(PLATFORM_MACOSX)
+#if defined(HOST_DARWIN)
#include <mach/mach.h>
#include <mach/mach_time.h>
#endif
mono_100ns_ticks (void)
{
struct timeval tv;
-#if defined(PLATFORM_MACOSX)
+#if defined(HOST_DARWIN)
/* http://developer.apple.com/library/mac/#qa/qa1398/_index.html */
static mach_timebase_info_data_t timebase;
guint64 now = mach_absolute_time ();
class MSBuild (GitHubPackage):
def __init__ (self):
GitHubPackage.__init__ (self, 'mono', 'msbuild', '15.4',
- revision = 'e497ddc04f507d9d8b6db399c3cff975cd4529de')
+ revision = 'c907a5182a101624eb58e73fb24f97666abf477a')
def build (self):
self.sh ('./cibuild.sh --scope Compile --target Mono --host Mono --config Release')
/chktrust
/cilc
/crlupdate
+/csi
/csharp
/csharp2
/disco
mph_return_if_size_t_overflow (n);
/* first, check for valid errnum */
-#if PLATFORM_ANDROID
+#if HOST_ANDROID
/* Android NDK defines _GNU_SOURCE but strerror_r follows the XSI semantics
* not the GNU one. XSI version returns an integer, as opposed to the GNU one
* which returns pointer to the buffer.
* OS X doesn't define MAP_ANONYMOUS, but it does define MAP_ANON.
* Alias them to fix: https://bugzilla.xamarin.com/show_bug.cgi?id=3419
*/
-#ifdef PLATFORM_MACOSX
+#ifdef HOST_DARWIN
#ifndef MAP_ANONYMOUS
#define MAP_ANONYMOUS MAP_ANON
#endif /* ndef MAP_ANONYMOUS */
-#endif /* ndef PLATFORM_MACOSX */
+#endif /* ndef HOST_DARWIN */
/*
* XATTR_AUTO is a synonym for 0 within XattrFlags, but most systems don't
#define _XOPEN_SOURCE 600
#endif
-#ifdef PLATFORM_MACOSX
+#ifdef HOST_DARWIN
/* For mincore () */
#define _DARWIN_C_SOURCE
#endif
_offset = *offset;
-#if defined(PLATFORM_MACOSX) || defined(PLATFORM_BSD)
+#if defined(HOST_DARWIN) || defined(HOST_BSD)
/* The BSD version has 6 arguments */
g_assert_not_reached ();
#else
/* Android implements truncate, but doesn't declare it.
* Result is a warning during compilation, so skip it.
*/
-#ifndef PLATFORM_ANDROID
+#ifndef HOST_ANDROID
gint32
Mono_Posix_Syscall_truncate (const char *path, mph_off_t length)
{
$(LIBICONV) \
-lm
-if PLATFORM_DARWIN
+if HOST_DARWIN
monograph_LDFLAGS=-framework CoreFoundation
endif
download: .download_stamp_file
-run: download nuget-hash-extractor.exe exec-ver exec-asm
+run: download nuget-hash-extractor.exe exec-ver exec-asm exec-msbuild
run-asm: download nuget-hash-extractor.exe exec-asm
exec-asm:
mono nuget-hash-extractor.exe nugets asm
+exec-msbuild:
+ mono nuget-hash-extractor.exe nugets guids_for_msbuild
+
run-ver: download nuget-hash-extractor.exe exec-ver
exec-ver:
mkdir nugets
+##
+## Following are nugets which have net4* implementation but that implementation is Windows specific and won’t work on Mono or
+## with any profile derived from Mono net_4_x profile like Xamarin.Mac. This is due to no TFM for Mono or Xamarin.Mac which
+## would allow us to customize the behaviors.
+##
+## We don’t want to fix all broken nugets we only focus on few system-like that are likely to be used by broad audience and
+## we have working implementation available in one of Mono assemblies.
+##
+## PLEASE keep this in sync with mcs/tools/xbuild/data/deniedAssembliesList.txt
+##
+## If any nugets are added or removed here, then make sure to regenerate the above file with:
+##
+## $ mono nuget-hash-extractor.exe nugets guids_for_msbuild > ../../mcs/tools/xbuild/data/deniedAssembliesList.txt
+##
+
#System.Runtime.InteropServices.RuntimeInformation
wget https://www.nuget.org/api/v2/package/System.Runtime.InteropServices.RuntimeInformation/4.3.0 -O nugets/system.runtime.interopservices.runtimeinformation.4.3.0.nupkg
wget https://www.nuget.org/api/v2/package/System.Runtime.InteropServices.RuntimeInformation/4.0.0 -O nugets/system.runtime.interopservices.runtimeinformation.4.0.0.nupkg
wget https://www.nuget.org/api/v2/package/System.Net.Http/4.0.0 -O nugets/system.net.http.4.0.0.nupkg
#System.Text.Encoding.CodePages
+wget https://www.nuget.org/api/v2/package/System.Text.Encoding.CodePages/4.4.0 -O nugets/system.text.encoding.codepages.4.4.0.nupkg
wget https://www.nuget.org/api/v2/package/System.Text.Encoding.CodePages/4.3.0 -O nugets/system.text.encoding.codepages.4.3.0.nupkg
wget https://www.nuget.org/api/v2/package/System.Text.Encoding.CodePages/4.0.1 -O nugets/system.text.encoding.codepages.4.0.1.nupkg
wget https://www.nuget.org/api/v2/package/System.Text.Encoding.CodePages/4.0.0 -O nugets/system.text.encoding.codepages.4.0.0.nupkg
-#System.Reflection.DispatchProxy
-wget https://www.nuget.org/api/v2/package/System.Reflection.DispatchProxy/4.3.0 -O nugets/system.reflection.dispatchproxy.4.3.0.nupkg
-wget https://www.nuget.org/api/v2/package/System.Reflection.DispatchProxy/4.0.1 -O nugets/system.reflection.dispatchproxy.4.0.1.nupkg
-wget https://www.nuget.org/api/v2/package/System.Reflection.DispatchProxy/4.0.0 -O nugets/system.reflection.dispatchproxy.4.0.0.nupkg
-
#System.Threading.Overlapped
wget https://www.nuget.org/api/v2/package/System.Threading.Overlapped/4.3.0 -O nugets/system.threading.overlapped.4.3.0.nupkg
wget https://www.nuget.org/api/v2/package/System.Threading.Overlapped/4.0.1 -O nugets/system.threading.overlapped.4.0.1.nupkg
wget https://www.nuget.org/api/v2/package/System.Threading.Overlapped/4.0.0 -O nugets/system.threading.overlapped.4.0.0.nupkg
-#System.Security.Cryptography.OpenSsl when .net 4.6.2 + 1 is out
-
touch .download_stamp_file
});*/
foreach (var target in AndroidTargets)
- target.Defines.AddRange (new string[] { "PLATFORM_ANDROID",
+ target.Defines.AddRange (new string[] { "HOST_ANDROID",
"TARGET_ANDROID", "MONO_CROSS_COMPILE", "USE_MONO_CTX"
});
}
});
foreach (var target in iOSTargets) {
- target.Defines.AddRange (new string[] { "PLATFORM_DARWIN",
+ target.Defines.AddRange (new string[] { "HOST_DARWIN",
"TARGET_IOS", "TARGET_MACH", "MONO_CROSS_COMPILE", "USE_MONO_CTX",
"_XOPEN_SOURCE"
});
});
foreach (var target in DarwinTargets) {
- target.Defines.AddRange (new string[] { "PLATFORM_DARWIN",
+ target.Defines.AddRange (new string[] { "HOST_DARWIN",
"TARGET_IOS", "TARGET_MACH", "MONO_CROSS_COMPILE", "USE_MONO_CTX",
"_XOPEN_SOURCE"
});
$(GLIB_LIBS) \
$(LIBICONV)
-if PLATFORM_DARWIN
+if HOST_DARWIN
pedump_LDFLAGS=-framework CoreFoundation -framework Foundation
endif
#define DISABLE_PORTABILITY 1
/* Windows does not have symlinks */
-#define PLATFORM_NO_SYMLINKS 1
+#define HOST_NO_SYMLINKS 1
/* String of disabled features */
#define DISABLED_FEATURES "none"