From 73ee7591e8d7ad20da67a68c7cc45781dc984ba3 Mon Sep 17 00:00:00 2001 From: "Xamarin Public Jenkins (auto-signing)" Date: Tue, 10 Dec 2019 18:00:56 +0000 Subject: [PATCH] Imported Upstream version 6.8.0.73 Former-commit-id: d18deab1b47cfd3ad8cba82b3f37d00eec2170af --- Makefile.am | 7 +- Makefile.in | 8 +- acceptance-tests/Makefile.in.REMOVED.git-id | 2 +- config.h.in | 6 + configure.REMOVED.git-id | 2 +- configure.ac.REMOVED.git-id | 2 +- data/Makefile.in | 1 + data/net_2_0/Browsers/Makefile.in | 1 + data/net_2_0/Makefile.in | 1 + data/net_4_0/Browsers/Makefile.in | 1 + data/net_4_0/Makefile.in | 1 + data/net_4_5/Browsers/Makefile.in | 1 + data/net_4_5/Makefile.in | 1 + docs/Makefile.in | 1 + docs/deploy/mono-api-gc.html | 56 +- docs/deploy/mono-api-object.html | 7 +- docs/deploy/mono-api-reflection.html | 2 +- docs/deploy/mono-api-threads.html | 3 + docs/deploy/mono-api-unsorted.html | 2 +- docs/sources/mono-api-gc.html | 6 + .../monodroid/Mono.Posix.cs.REMOVED.git-id | 2 +- .../monodroid/Mono.Security.cs.REMOVED.git-id | 2 +- .../monodroid/System.cs.REMOVED.git-id | 2 +- .../monodroid/mscorlib.cs.REMOVED.git-id | 2 +- .../monotouch/Mono.Security.cs.REMOVED.git-id | 2 +- .../profiles/monotouch/System.Net.Http.cs | 54 +- .../monotouch/System.cs.REMOVED.git-id | 2 +- .../monotouch/mscorlib.cs.REMOVED.git-id | 2 +- .../net_4_x/Mono.Cecil.cs.REMOVED.git-id | 2 +- .../net_4_x/Mono.Posix.cs.REMOVED.git-id | 2 +- .../net_4_x/Mono.Security.cs.REMOVED.git-id | 2 +- .../profiles/net_4_x/System.cs.REMOVED.git-id | 2 +- .../net_4_x/mscorlib.cs.REMOVED.git-id | 2 +- external/bockbuild/bockbuild/package.py | 1 + external/bockbuild/packages/gtk-sharp.py | 2 +- external/cecil/.azure-pipelines.yml | 38 - external/cecil/.github/workflows/main.yml | 35 + external/cecil/.gitignore | 2 + external/cecil/Mono.Cecil.PE/ImageReader.cs | 2 +- external/cecil/Mono.Cecil.nunit | 2 +- external/cecil/Mono.Cecil/AssemblyWriter.cs | 8 +- external/cecil/Mono.Cecil/ModuleDefinition.cs | 16 + external/cecil/Mono.Cecil/VariantType.cs | 2 + .../CryptoConvert.cs | 46 + .../CryptoService.cs | 42 +- .../Mono.Cecil.Tests/CompilationService.cs | 3 + .../Test/Mono.Cecil.Tests/PortablePdbTests.cs | 37 + .../pdb/Microsoft.Cci.Pdb/BitAccess.cs | 16 +- .../symbols/pdb/Microsoft.Cci.Pdb/BitSet.cs | 11 +- .../symbols/pdb/Microsoft.Cci.Pdb/CvInfo.cs | 30 +- .../pdb/Microsoft.Cci.Pdb/DataStream.cs | 11 +- .../pdb/Microsoft.Cci.Pdb/DbiDbgHdr.cs | 11 +- .../pdb/Microsoft.Cci.Pdb/DbiHeader.cs | 11 +- .../pdb/Microsoft.Cci.Pdb/DbiModuleInfo.cs | 11 +- .../pdb/Microsoft.Cci.Pdb/DbiSecCon.cs | 11 +- .../pdb/Microsoft.Cci.Pdb/IntHashTable.cs | 27 +- .../pdb/Microsoft.Cci.Pdb/Interfaces.cs | 10 +- .../symbols/pdb/Microsoft.Cci.Pdb/LICENSE | 35 +- .../pdb/Microsoft.Cci.Pdb/MsfDirectory.cs | 11 +- .../pdb/Microsoft.Cci.Pdb/PdbConstant.cs | 22 +- .../Microsoft.Cci.Pdb/PdbDebugException.cs | 11 +- .../pdb/Microsoft.Cci.Pdb/PdbException.cs | 11 +- .../symbols/pdb/Microsoft.Cci.Pdb/PdbFile.cs | 131 +- .../pdb/Microsoft.Cci.Pdb/PdbFileHeader.cs | 55 +- .../pdb/Microsoft.Cci.Pdb/PdbFunction.cs | 116 +- .../symbols/pdb/Microsoft.Cci.Pdb/PdbInfo.cs | 43 + .../symbols/pdb/Microsoft.Cci.Pdb/PdbLine.cs | 11 +- .../symbols/pdb/Microsoft.Cci.Pdb/PdbLines.cs | 11 +- .../pdb/Microsoft.Cci.Pdb/PdbReader.cs | 11 +- .../symbols/pdb/Microsoft.Cci.Pdb/PdbScope.cs | 20 +- .../symbols/pdb/Microsoft.Cci.Pdb/PdbSlot.cs | 19 +- .../pdb/Microsoft.Cci.Pdb/PdbSource.cs | 17 +- .../pdb/Microsoft.Cci.Pdb/PdbTokenLine.cs | 11 +- .../SourceLocationProvider.cs | 15 +- .../ISymUnmanagedDocumentWriter.cs | 3 + .../pdb/Mono.Cecil.Pdb/NativePdbReader.cs | 19 +- .../pdb/Mono.Cecil.Pdb/NativePdbWriter.cs | 3 + .../pdb/Mono.Cecil.Pdb/SymDocumentWriter.cs | 20 +- .../symbols/pdb/Mono.Cecil.Pdb/SymWriter.cs | 48 +- .../pdb/Test/Mono.Cecil.Tests/PdbTests.cs | 6 +- .../Unix/System.Native/Interop.ReadDir.cs | 10 +- .../Unix/System.Native/Interop.Stat.cs | 1 + .../Unix/System.Native/Interop.LChflags.cs | 26 + .../Unix/System.Native/Interop.Stat.cs | 1 + .../src/Native/Unix/Common/pal_config.h.in | 2 + .../src/Native/Unix/System.Native/pal_io.c | 28 + .../src/Native/Unix/System.Native/pal_io.h | 23 + .../src/System.IO.FileSystem.csproj | 3 + .../IO/Enumeration/FileSystemEntry.Unix.cs | 7 +- .../src/System/IO/FileStatus.Unix.cs | 32 +- .../tests/Base/FileGetSetAttributes.cs | 35 +- .../ErrorHandlingTests.netcoreapp.cs | 37 + .../System.IO.FileSystem/tests/File/Create.cs | 27 + .../tests/FileInfo/GetSetAttributes.cs | 13 + .../tests/FileStream/LockUnlock.cs | 2 +- .../Linq/Parallel/Scheduling/Scheduling.cs | 6 + .../Net/Http/Headers/UriHeaderParser.cs | 9 + external/linker/eng/Version.Details.xml | 4 +- external/linker/eng/Versions.props | 9 +- external/linker/eng/azure-pipelines.yml | 9 +- external/linker/eng/common/build.ps1 | 4 + external/linker/eng/common/darc-init.ps1 | 6 +- external/linker/eng/common/darc-init.sh | 8 +- .../common/enable-cross-org-publishing.ps1 | 6 + .../linker/eng/common/init-tools-native.ps1 | 1 + .../eng/common/native/CommonLibrary.psm1 | 2 + .../common/performance/perfhelixpublish.proj | 29 +- .../common/performance/performance-setup.ps1 | 23 +- .../common/performance/performance-setup.sh | 80 +- .../common/post-build/darc-gather-drop.ps1 | 10 + .../common/post-build/dotnetsymbol-init.ps1 | 29 - .../common/post-build/sourcelink-cli-init.ps1 | 29 - .../post-build/sourcelink-validation.ps1 | 84 +- .../common/post-build/symbols-validation.ps1 | 20 +- .../eng/common/sdl/execute-all-sdl-tools.ps1 | 69 +- .../common/sdl/extract-artifact-packages.ps1 | 7 + external/linker/eng/common/sdl/init-sdl.ps1 | 3 + .../linker/eng/common/sdl/packages.config | 4 +- external/linker/eng/common/sdl/run-sdl.ps1 | 34 +- .../eng/common/templates/job/execute-sdl.yml | 25 +- .../linker/eng/common/templates/job/job.yml | 139 +- .../eng/common/templates/job/performance.yml | 6 +- .../templates/job/publish-build-assets.yml | 7 + .../linker/eng/common/templates/jobs/jobs.yml | 74 +- .../channels/internal-servicing.yml | 147 - .../post-build/channels/netcore-dev-31.yml | 132 + .../post-build/channels/netcore-dev-5.yml | 140 +- .../channels/netcore-internal-30.yml | 142 + .../channels/netcore-release-30.yml | 132 + .../channels/netcore-release-31.yml | 132 + .../channels/netcore-tools-latest.yml | 140 +- .../channels/public-dev-release.yml | 148 - .../post-build/channels/public-release.yml | 147 - .../channels/public-validation-release.yml | 102 +- .../templates/post-build/common-variables.yml | 37 +- .../templates/post-build/post-build.yml | 83 +- .../common/templates/steps/promote-build.yml | 13 + external/linker/eng/common/tools.ps1 | 16 +- external/linker/eng/common/tools.sh | 27 +- external/linker/global.json | 4 +- external/linker/src/ILLink.Tasks/LinkTask.cs | 2 + .../src/linker/Linker.Steps/MarkStep.cs | 406 +- .../src/linker/Linker.Steps/OutputStep.cs | 36 +- .../PreserveDependencyLookupStep.cs | 13 + .../linker/Linker.Steps/ResolveFromXmlStep.cs | 3 +- .../src/linker/Linker.Steps/SweepStep.cs | 430 ++- .../linker/src/linker/Linker/Annotations.cs | 2 + .../src/linker/Linker/AssemblyResolver.cs | 3 +- external/linker/src/linker/Linker/Driver.cs | 14 +- .../linker/src/linker/Linker/KnownMembers.cs | 9 + .../linker/src/linker/Linker/LinkContext.cs | 4 + .../src/linker/Linker/OutputException.cs | 17 + .../linker/Linker/TypeReferenceExtensions.cs | 6 + .../linker/src/tuner/Mono.Tuner/Dispatcher.cs | 54 +- .../Microsoft.Managed.EditorConfig.targets | 13 - ...uild.Tasks.CodeAnalysis.dll.REMOVED.git-id | 1 + .../3.5.0}/Microsoft.CSharp.Core.targets | 0 ...icrosoft.CodeAnalysis.CSharp.Scripting.dll | Bin 31096 -> 31104 bytes ...oft.CodeAnalysis.CSharp.dll.REMOVED.git-id | 1 + ....CodeAnalysis.Scripting.dll.REMOVED.git-id | 1 + ...odeAnalysis.VisualBasic.dll.REMOVED.git-id | 1 + .../Microsoft.CodeAnalysis.dll.REMOVED.git-id | 1 + ...aSymReader.Native.amd64.dll.REMOVED.git-id | 1 + ...DiaSymReader.Native.x86.dll.REMOVED.git-id | 1 + .../3.5.0}/Microsoft.Managed.Core.targets | 0 .../3.5.0}/Microsoft.VisualBasic.Core.targets | 0 .../3.5.0/System.Buffers.dll | Bin 0 -> 27992 bytes ...m.Collections.Immutable.dll.REMOVED.git-id | 0 .../3.5.0}/System.Memory.dll.REMOVED.git-id | 0 ...System.Numerics.Vectors.dll.REMOVED.git-id | 1 + ...tem.Reflection.Metadata.dll.REMOVED.git-id | 0 ...System.Runtime.CompilerServices.Unsafe.dll | Bin ...Text.Encoding.CodePages.dll.REMOVED.git-id | 1 + .../System.Threading.Tasks.Extensions.dll | Bin .../3.5.0}/VBCSCompiler.exe | Bin 89168 -> 88960 bytes .../3.5.0}/VBCSCompiler.exe.config | 6 +- .../Microsoft.Net.Compilers/3.5.0}/csc.exe | Bin 56896 -> 56688 bytes .../3.5.0}/csc.exe.config | 4 +- .../Microsoft.Net.Compilers/3.5.0}/csc.rsp | 0 .../Microsoft.Net.Compilers/3.5.0}/csi.exe | Bin 16448 -> 16448 bytes .../3.5.0}/csi.exe.config | 8 +- .../Microsoft.Net.Compilers/3.5.0}/csi.rsp | 0 .../Microsoft.Net.Compilers/3.5.0}/vbc.exe | Bin 56896 -> 56688 bytes .../3.5.0}/vbc.exe.config | 4 +- .../Microsoft.Net.Compilers/3.5.0}/vbc.rsp | 0 ikvm-native/Makefile.in | 16 +- llvm/Makefile.am | 6 + llvm/Makefile.in | 5 +- llvm/build.mk | 2 +- m4/Makefile.in | 1 + man/Makefile.in | 1 + man/mono.1 | 17 + mcs/build/README.makefiles.md | 2 - mcs/build/README.platforms | 8 - mcs/build/common/Consts.cs | 4 +- mcs/build/config-default.make | 2 - .../linux_net_4_x_Mono.Posix_test.dll.sources | 1 + mcs/build/platforms/linux.make | 17 - mcs/build/platforms/macos.make | 17 - mcs/build/platforms/unix.make | 18 - mcs/build/platforms/win32.make | 12 - mcs/build/profiles/net_4_x.make | 4 +- mcs/build/rules.make | 8 +- mcs/build/start-compiler-server.sh | 2 +- .../Mono.Debugger.Soft/Test/dtest-app.cs | 12 + .../Test/dtest.cs.REMOVED.git-id | 2 +- .../Mono.Attach/VirtualMachine.cs | 1 + .../RabbitMQMessagingProvider.cs | 23 +- .../Mono.Posix/Mono.Posix_test.dll.sources | 1 + .../Syscall.cs.REMOVED.git-id | 2 +- .../Test/Mono.Unix.Native/OFDLockTest.cs | 133 + .../Mono.Profiler.Log/LogEnums.cs | 1 + .../CertificateValidationHelper.cs | 8 - .../Mono.Security.Interface/IMonoSslStream.cs | 57 +- .../MonoTlsProvider.cs | 32 - .../MonoTlsProviderFactory.cs | 3 +- .../TlsClientCertificate.cs | 149 - .../TlsClientCertificateVerify.cs | 220 -- .../TlsClientFinished.cs | 87 - .../TlsClientHello.cs | 139 - .../TlsClientKeyExchange.cs | 98 - .../TlsServerCertificate.cs | 450 --- .../TlsServerCertificateRequest.cs | 111 - .../TlsServerFinished.cs | 102 - .../TlsServerHello.cs | 150 - .../TlsServerHelloDone.cs | 52 - .../TlsServerKeyExchange.cs | 121 - .../TlsClientCertificate.cs | 276 -- .../TlsClientCertificateVerify.cs | 86 - .../TlsClientFinished.cs | 88 - .../TlsClientHello.cs | 152 - .../TlsClientKeyExchange.cs | 116 - .../TlsServerCertificate.cs | 74 - .../TlsServerCertificateRequest.cs | 107 - .../TlsServerFinished.cs | 75 - .../TlsServerHello.cs | 122 - .../TlsServerHelloDone.cs | 52 - .../TlsServerKeyExchange.cs | 110 - .../ClientCertificateType.cs | 38 - .../HandshakeMessage.cs | 170 - .../HandshakeType.cs | 44 - .../Mono.Security.Protocol.Tls/Alert.cs | 265 -- .../CipherAlgorithmType.cs | 45 - .../Mono.Security.Protocol.Tls/CipherSuite.cs | 594 --- .../CipherSuiteCollection.cs | 130 - .../CipherSuiteFactory.cs | 199 - .../ClientContext.cs | 82 - .../ClientRecordProtocol.cs | 195 - .../ClientSessionCache.cs | 254 -- .../Mono.Security.Protocol.Tls/ContentType.cs | 37 - .../Mono.Security.Protocol.Tls/Context.cs | 519 --- .../Mono.Security.Protocol.Tls/DebugHelper.cs | 95 - .../ExchangeAlgorithmType.cs | 43 - .../HandshakeState.cs | 36 - .../HashAlgorithmType.cs | 41 - .../HttpsClientStream.cs | 122 - .../Mono.Security.Protocol.Tls/MD5SHA1.cs | 146 - .../RSASslSignatureDeformatter.cs | 108 - .../RSASslSignatureFormatter.cs | 105 - .../RecordProtocol.cs | 965 ----- .../SecurityCompressionType.cs | 42 - .../SecurityProtocolType.cs | 46 - .../ServerContext.cs | 118 - .../ServerRecordProtocol.cs | 173 - .../SslCipherSuite.cs | 251 -- .../SslClientStream.cs | 659 ---- .../SslHandshakeHash.cs | 185 - .../SslServerStream.cs | 332 -- .../SslStreamBase.cs | 1224 ------ .../TlsCipherSuite.cs | 152 - .../TlsClientSettings.cs | 124 - .../TlsException.cs | 93 - .../TlsServerSettings.cs | 129 - .../Mono.Security.Protocol.Tls/TlsStream.cs | 274 -- .../Mono.Security/Mono.Security.dll.sources | 60 +- .../common_System.Core.dll.sources | 2 + ...net_4_x_System.Drawing.dll.exclude.sources | 2 + .../win32_net_4_x_System.Drawing.dll.sources | 4 + .../System.Net.Http/ByteArrayContent.cs | 2 +- .../System.Net.Http/HttpClient.cs | 7 +- .../System.Net.Http/HttpClient.macios.cs | 6 - .../HttpClientHandler.platformnotsupported.cs | 179 - .../System.Net.Http/HttpClientHandler.xi.cs | 148 + .../System.Net.Http/HttpContent.cs | 7 +- .../System.Net.Http/MultipartContent.cs | 4 +- .../System.Net.Http/StreamContent.cs | 2 +- .../HttpHeaderValueCollection.cs | 4 + .../HttpHeadersTest.cs | 2 + .../Test/System.Net.Http/HttpClientTest.cs | 4 + .../System.Net.Http/HttpRequestMessageTest.cs | 8 + .../HttpResponseMessageTest.cs | 4 + .../corefx/ReadOnlyMemoryContent.cs | 2 +- ...otouch_System.Net.Http.dll.exclude.sources | 1 + .../monotouch_System.Net.Http.dll.sources | 2 +- ...uch_tv_System.Net.Http.dll.exclude.sources | 1 + .../monotouch_tv_System.Net.Http.dll.sources | 3 +- ..._watch_System.Net.Http.dll.exclude.sources | 7 - ...onotouch_watch_System.Net.Http.dll.sources | 35 +- .../System.Net.Http/socketshandler.sources | 2 - ...xammac_System.Net.Http.dll.exclude.sources | 1 + .../xammac_System.Net.Http.dll.sources | 2 +- ...et_4_5_System.Net.Http.dll.exclude.sources | 1 + ...xammac_net_4_5_System.Net.Http.dll.sources | 2 +- .../Test/ActivationTests.cs | 19 +- .../Test/GenericTest.cs | 1 + .../Test/HttpBugTests.cs | 34 +- .../Test/RemotingServicesTest.cs | 47 +- .../System.Runtime.Remoting/Test/TcpCalls.cs | 11 +- .../System.Runtime.Serialization.dll.sources | 2 + .../InternalWindowManager.cs | 2 + .../ThemeWin32Classic.cs.REMOVED.git-id | 2 +- .../TreeNodeCollection.cs | 63 +- .../System.Xaml/System.Xaml/XamlXmlReader.cs | 27 +- .../Test/System.Xaml/XamlXmlReaderTest.cs | 7 + .../Mono.AppleTls/AppleCertificateHelper.cs | 10 +- .../System/Mono.AppleTls/AppleTlsProvider.cs | 15 +- .../System/Mono.AppleTls/AppleTlsStream.cs | 2 +- .../System/Mono.Btls/MonoBtlsProvider.cs | 29 +- mcs/class/System/Mono.Btls/MonoBtlsStream.cs | 2 +- .../System/Mono.Btls/X509PalImpl.Btls.cs | 2 +- .../ChainValidationHelper.cs | 22 +- .../Mono.Net.Security/LegacySslStream.cs | 645 ---- .../Mono.Net.Security/LegacyTlsProvider.cs | 108 - .../MobileAuthenticatedStream.cs | 135 +- .../Mono.Net.Security/MobileTlsContext.cs | 4 +- .../Mono.Net.Security/MobileTlsProvider.cs | 48 + .../MonoTlsProviderFactory.cs | 91 +- .../System/Mono.Net.Security/MonoTlsStream.cs | 22 +- .../Mono.Net.Security/NoReflectionHelper.cs | 2 +- .../System/Mono/SystemCertificateProvider.cs | 2 +- .../System/System.IO/FileSystemWatcher.cs | 2 +- .../FileSystemWatcher.platformnotsupported.cs | 163 + .../System/System.Net.Mail/SmtpClient.cs | 4 +- .../Win32IPGlobalProperties.cs | 22 +- .../System/System.Net.Security/SslStream.cs | 80 +- mcs/class/System/System.Net.Sockets/Socket.cs | 165 +- .../SocketAsyncEventArgs.cs | 116 +- .../System.Net.Sockets/SocketAsyncResult.cs | 2 +- mcs/class/System/System.Net/HttpWebRequest.cs | 6 +- mcs/class/System/System.Net/ServicePoint.cs | 5 - .../ServicePoint.platformnotsupported.cs | 6 - mcs/class/System/System.Net/WebConnection.cs | 16 +- mcs/class/System/System_xtest.dll.sources | 3 + .../BlockingCollectionTests.cs | 1 + .../ConcurrentBagTests.cs | 2 + .../Test/System.IO/FileSystemWatcherTest.cs | 28 +- .../System.Net.NetworkInformation/PingTest.cs | 3 + .../IPv6MulticastOptionTest.cs | 1 + .../System.Net.Sockets/MulticastOptionTest.cs | 1 + .../SocketTest.cs.REMOVED.git-id | 2 +- .../Test/System.Net/FileWebRequestTest.cs | 1 + .../Test/System.Net/FileWebResponseTest.cs | 1 + .../Test/System.Net/HttpListener2Test.cs | 5 + .../HttpWebRequestTest.cs.REMOVED.git-id | 2 +- .../System/Test/System.Net/WebRequestTest.cs | 4 +- .../RegexBugs_Long.cs.REMOVED.git-id | 2 +- .../System/Test/System.Timers/TimerTest.cs | 1 + mcs/class/System/common.sources | 10 +- mcs/class/System/common_networking.sources | 3 +- mcs/class/System/corefx/NetworkStream.cs | 18 + .../System/corefx/SocketAsyncEventArgs.cs | 169 + mcs/class/System/fsw.pns.sources | 1 + ...uch_watch_System_xtest.dll.exclude.sources | 3 + .../System/orbis_System.dll.exclude.sources | 1 + .../System/wasm_System.dll.exclude.sources | 3 + mcs/class/System/wasm_System.dll.sources | 1 + .../wasm_System_xtest.dll.exclude.sources | 3 + mcs/class/corlib/Makefile | 2 + mcs/class/corlib/Mono/Runtime.cs | 9 +- mcs/class/corlib/ReferenceSources/Buffer.cs | 2 +- mcs/class/corlib/ReferenceSources/Type.cs | 30 + mcs/class/corlib/System.IO/MonoIOError.cs | 4 +- mcs/class/corlib/System.IO/Path.cs | 2 +- .../System.Reflection/MethodInfo.cs} | 70 +- .../System.Runtime.InteropServices/Marshal.cs | 5 +- .../_MethodInfo.cs | 107 +- .../System.Runtime.InteropServices/_Type.cs | 344 +- .../SiteIdentityPermission.cs | 2 +- .../ApplicationTrustEnumerator.cs | 35 +- .../corlib/System.Threading/Interlocked.cs | 80 +- mcs/class/corlib/System.Threading/Thread.cs | 14 +- mcs/class/corlib/System/AppDomain.cs | 2 +- mcs/class/corlib/System/AppDomainSetup.cs | 6 +- mcs/class/corlib/System/CStreamWriter.cs | 6 + mcs/class/corlib/System/TimeZoneInfo.cs | 7 +- .../Test/Mono/MonoNativePlatformType.cs | 1 + .../SiteIdentityPermissionTest.cs | 1 + .../corlib/Test/System/AppDomainSetupTest.cs | 19 + mcs/class/corlib/Test/System/AttributeTest.cs | 35 + .../corlib/Test/System/TimeZoneInfoTest.cs | 117 +- mcs/class/corlib/Test/System/TimeZoneTest.cs | 2 +- mcs/class/corlib/corefx/MethodInfo.cs | 6 - mcs/class/corlib/corefx/SR.cs.REMOVED.git-id | 2 +- .../corlib/corlib.dll.sources.REMOVED.git-id | 2 +- .../corlib/unix_build_corlib.dll.sources | 1 + .../Facades/netstandard.dll.REMOVED.git-id | 1 - .../Mono.Cecil.dll.REMOVED.git-id | 1 - .../Mono.Security.dll.REMOVED.git-id | 1 - .../System.Configuration.dll.REMOVED.git-id | 1 - .../System.Core.dll.REMOVED.git-id | 1 - .../System.IO.Compression.dll.REMOVED.git-id | 1 - .../System.Numerics.dll.REMOVED.git-id | 1 - .../System.Xml.dll.REMOVED.git-id | 1 - .../System.dll.REMOVED.git-id | 1 - .../mcs.exe.REMOVED.git-id | 1 - .../mscorlib.dll.REMOVED.git-id | 1 - .../Facades/System.Collections.Concurrent.dll | Bin .../Facades/System.Collections.dll | Bin .../Facades/System.Diagnostics.Debug.dll | Bin .../System.Diagnostics.FileVersionInfo.dll | Bin .../Facades/System.Diagnostics.Tools.dll | Bin .../Facades/System.Dynamic.Runtime.dll | Bin .../Facades/System.Globalization.dll | Bin .../System.IO.FileSystem.Primitives.dll | Bin .../Facades/System.IO.FileSystem.dll | Bin .../Facades/System.IO.dll | Bin .../Facades/System.Linq.Expressions.dll | Bin .../Facades/System.Linq.dll | Bin .../Facades/System.Reflection.Extensions.dll | Bin .../Facades/System.Reflection.Primitives.dll | Bin .../Facades/System.Reflection.dll | Bin .../System.Resources.ResourceManager.dll | Bin .../Facades/System.Runtime.Extensions.dll | Bin .../System.Runtime.InteropServices.dll | Bin .../Facades/System.Runtime.Numerics.dll | Bin .../Facades/System.Runtime.dll | Bin ...ystem.Security.Cryptography.Algorithms.dll | Bin ...ystem.Security.Cryptography.Primitives.dll | Bin .../System.Text.Encoding.CodePages.dll | Bin .../System.Text.Encoding.Extensions.dll | Bin .../Facades/System.Text.Encoding.dll | Bin .../System.Threading.Tasks.Parallel.dll | Bin .../Facades/System.Threading.Tasks.dll | Bin .../Facades/System.Threading.dll | Bin .../Facades/System.ValueTuple.dll | Bin .../Facades/System.Xml.ReaderWriter.dll | Bin .../Facades/System.Xml.XDocument.dll | Bin .../Facades/netstandard.dll.REMOVED.git-id | 1 + .../Mono.Cecil.dll.REMOVED.git-id | 1 + .../Mono.Security.dll.REMOVED.git-id | 1 + .../System.Configuration.dll.REMOVED.git-id | 1 + .../System.Core.dll.REMOVED.git-id | 1 + .../System.IO.Compression.dll.REMOVED.git-id | 1 + .../System.Numerics.dll.REMOVED.git-id | 1 + .../System.Security.dll.REMOVED.git-id | 0 .../System.Xml.Linq.dll.REMOVED.git-id | 0 .../System.Xml.dll.REMOVED.git-id | 1 + .../System.dll.REMOVED.git-id | 1 + .../mcs.exe.REMOVED.git-id | 1 + .../mscorlib.dll.REMOVED.git-id | 1 + .../Facades/netstandard.dll.REMOVED.git-id | 1 - .../Mono.Cecil.dll.REMOVED.git-id | 1 - .../Mono.Security.dll.REMOVED.git-id | 1 - .../System.Configuration.dll.REMOVED.git-id | 1 - .../System.Core.dll.REMOVED.git-id | 1 - .../System.IO.Compression.dll.REMOVED.git-id | 1 - .../System.Numerics.dll.REMOVED.git-id | 1 - .../System.Xml.dll.REMOVED.git-id | 1 - .../System.dll.REMOVED.git-id | 1 - .../mcs.exe.REMOVED.git-id | 1 - .../mscorlib.dll.REMOVED.git-id | 1 - .../Facades/System.Collections.Concurrent.dll | Bin .../Facades/System.Collections.dll | Bin .../Facades/System.Diagnostics.Debug.dll | Bin .../System.Diagnostics.FileVersionInfo.dll | Bin .../Facades/System.Diagnostics.Tools.dll | Bin .../Facades/System.Dynamic.Runtime.dll | Bin .../Facades/System.Globalization.dll | Bin .../System.IO.FileSystem.Primitives.dll | Bin .../Facades/System.IO.FileSystem.dll | Bin .../Facades/System.IO.dll | Bin .../Facades/System.Linq.Expressions.dll | Bin .../Facades/System.Linq.dll | Bin .../Facades/System.Reflection.Extensions.dll | Bin .../Facades/System.Reflection.Primitives.dll | Bin .../Facades/System.Reflection.dll | Bin .../System.Resources.ResourceManager.dll | Bin .../Facades/System.Runtime.Extensions.dll | Bin .../System.Runtime.InteropServices.dll | Bin .../Facades/System.Runtime.Numerics.dll | Bin .../Facades/System.Runtime.dll | Bin ...ystem.Security.Cryptography.Algorithms.dll | Bin ...ystem.Security.Cryptography.Primitives.dll | Bin .../System.Text.Encoding.CodePages.dll | Bin .../System.Text.Encoding.Extensions.dll | Bin .../Facades/System.Text.Encoding.dll | Bin .../System.Threading.Tasks.Parallel.dll | Bin .../Facades/System.Threading.Tasks.dll | Bin .../Facades/System.Threading.dll | Bin .../Facades/System.ValueTuple.dll | Bin .../Facades/System.Xml.ReaderWriter.dll | Bin .../Facades/System.Xml.XDocument.dll | Bin .../Facades/netstandard.dll.REMOVED.git-id | 1 + .../Mono.Cecil.dll.REMOVED.git-id | 1 + .../Mono.Security.dll.REMOVED.git-id | 1 + .../System.Configuration.dll.REMOVED.git-id | 1 + .../System.Core.dll.REMOVED.git-id | 1 + .../System.IO.Compression.dll.REMOVED.git-id | 1 + .../System.Numerics.dll.REMOVED.git-id | 1 + .../System.Security.dll.REMOVED.git-id | 0 .../System.Xml.Linq.dll.REMOVED.git-id | 0 .../System.Xml.dll.REMOVED.git-id | 1 + .../System.dll.REMOVED.git-id | 1 + .../mcs.exe.REMOVED.git-id | 1 + .../mscorlib.dll.REMOVED.git-id | 1 + .../Facades/netstandard.dll.REMOVED.git-id | 1 - .../Mono.Cecil.dll.REMOVED.git-id | 1 - .../Mono.Security.dll.REMOVED.git-id | 1 - .../System.Configuration.dll.REMOVED.git-id | 1 - .../System.Core.dll.REMOVED.git-id | 1 - .../System.IO.Compression.dll.REMOVED.git-id | 1 - .../System.Numerics.dll.REMOVED.git-id | 1 - .../System.Xml.dll.REMOVED.git-id | 1 - .../System.dll.REMOVED.git-id | 1 - .../mcs.exe.REMOVED.git-id | 1 - .../mscorlib.dll.REMOVED.git-id | 1 - .../Facades/System.Collections.Concurrent.dll | Bin .../Facades/System.Collections.dll | Bin .../Facades/System.Diagnostics.Debug.dll | Bin .../System.Diagnostics.FileVersionInfo.dll | Bin .../Facades/System.Diagnostics.Tools.dll | Bin .../Facades/System.Dynamic.Runtime.dll | Bin .../Facades/System.Globalization.dll | Bin .../System.IO.FileSystem.Primitives.dll | Bin .../Facades/System.IO.FileSystem.dll | Bin .../Facades/System.IO.dll | Bin .../Facades/System.Linq.Expressions.dll | Bin .../Facades/System.Linq.dll | Bin .../Facades/System.Reflection.Extensions.dll | Bin .../Facades/System.Reflection.Primitives.dll | Bin .../Facades/System.Reflection.dll | Bin .../System.Resources.ResourceManager.dll | Bin .../Facades/System.Runtime.Extensions.dll | Bin .../System.Runtime.InteropServices.dll | Bin .../Facades/System.Runtime.Numerics.dll | Bin .../Facades/System.Runtime.dll | Bin ...ystem.Security.Cryptography.Algorithms.dll | Bin ...ystem.Security.Cryptography.Primitives.dll | Bin .../System.Text.Encoding.CodePages.dll | Bin .../System.Text.Encoding.Extensions.dll | Bin .../Facades/System.Text.Encoding.dll | Bin .../System.Threading.Tasks.Parallel.dll | Bin .../Facades/System.Threading.Tasks.dll | Bin .../Facades/System.Threading.dll | Bin .../Facades/System.ValueTuple.dll | Bin .../Facades/System.Xml.ReaderWriter.dll | Bin .../Facades/System.Xml.XDocument.dll | Bin .../Facades/netstandard.dll.REMOVED.git-id | 1 + .../Mono.Cecil.dll.REMOVED.git-id | 1 + .../Mono.Security.dll.REMOVED.git-id | 1 + .../System.Configuration.dll.REMOVED.git-id | 1 + .../System.Core.dll.REMOVED.git-id | 1 + .../System.IO.Compression.dll.REMOVED.git-id | 1 + .../System.Numerics.dll.REMOVED.git-id | 1 + .../System.Security.dll.REMOVED.git-id | 0 .../System.Xml.Linq.dll.REMOVED.git-id | 0 .../System.Xml.dll.REMOVED.git-id | 1 + .../System.dll.REMOVED.git-id | 1 + .../mcs.exe.REMOVED.git-id | 1 + .../mscorlib.dll.REMOVED.git-id | 1 + .../Facades/netstandard.dll.REMOVED.git-id | 1 - .../Mono.Cecil.dll.REMOVED.git-id | 1 - .../Mono.Security.dll.REMOVED.git-id | 1 - .../System.Configuration.dll.REMOVED.git-id | 1 - .../System.Core.dll.REMOVED.git-id | 1 - .../System.IO.Compression.dll.REMOVED.git-id | 1 - .../System.Numerics.dll.REMOVED.git-id | 1 - .../System.Xml.dll.REMOVED.git-id | 1 - .../System.dll.REMOVED.git-id | 1 - .../mcs.exe.REMOVED.git-id | 1 - .../mscorlib.dll.REMOVED.git-id | 1 - .../Facades/System.Collections.Concurrent.dll | Bin .../Facades/System.Collections.dll | Bin .../Facades/System.Diagnostics.Debug.dll | Bin .../System.Diagnostics.FileVersionInfo.dll | Bin .../Facades/System.Diagnostics.Tools.dll | Bin .../Facades/System.Dynamic.Runtime.dll | Bin .../Facades/System.Globalization.dll | Bin .../System.IO.FileSystem.Primitives.dll | Bin .../Facades/System.IO.FileSystem.dll | Bin .../Facades/System.IO.dll | Bin .../Facades/System.Linq.Expressions.dll | Bin .../Facades/System.Linq.dll | Bin .../Facades/System.Reflection.Extensions.dll | Bin .../Facades/System.Reflection.Primitives.dll | Bin .../Facades/System.Reflection.dll | Bin .../System.Resources.ResourceManager.dll | Bin .../Facades/System.Runtime.Extensions.dll | Bin .../System.Runtime.InteropServices.dll | Bin .../Facades/System.Runtime.Numerics.dll | Bin .../Facades/System.Runtime.dll | Bin ...ystem.Security.Cryptography.Algorithms.dll | Bin ...ystem.Security.Cryptography.Primitives.dll | Bin .../System.Text.Encoding.CodePages.dll | Bin .../System.Text.Encoding.Extensions.dll | Bin .../Facades/System.Text.Encoding.dll | Bin .../System.Threading.Tasks.Parallel.dll | Bin .../Facades/System.Threading.Tasks.dll | Bin .../Facades/System.Threading.dll | Bin .../Facades/System.ValueTuple.dll | Bin .../Facades/System.Xml.ReaderWriter.dll | Bin .../Facades/System.Xml.XDocument.dll | Bin .../Facades/netstandard.dll.REMOVED.git-id | 1 + .../Mono.Cecil.dll.REMOVED.git-id | 1 + .../Mono.Security.dll.REMOVED.git-id | 1 + .../System.Configuration.dll.REMOVED.git-id | 1 + .../System.Core.dll.REMOVED.git-id | 1 + .../System.IO.Compression.dll.REMOVED.git-id | 1 + .../System.Numerics.dll.REMOVED.git-id | 1 + .../System.Security.dll.REMOVED.git-id | 0 .../System.Xml.Linq.dll.REMOVED.git-id | 0 .../System.Xml.dll.REMOVED.git-id | 1 + .../System.dll.REMOVED.git-id | 1 + .../mcs.exe.REMOVED.git-id | 1 + .../mscorlib.dll.REMOVED.git-id | 1 + .../Serialization/PrimitiveDataContract.cs | 84 + .../Net/Sockets/Socket.cs.REMOVED.git-id | 2 +- .../compilerservices/YieldAwaitable.cs | 4 +- mcs/jay/Makefile | 9 + mcs/packages/Makefile | 1 - ...uild.Tasks.CodeAnalysis.dll.REMOVED.git-id | 1 - ...oft.CodeAnalysis.CSharp.dll.REMOVED.git-id | 1 - ....CodeAnalysis.Scripting.dll.REMOVED.git-id | 1 - ...odeAnalysis.VisualBasic.dll.REMOVED.git-id | 1 - .../Microsoft.CodeAnalysis.dll.REMOVED.git-id | 1 - .../Microsoft.Managed.EditorConfig.targets | 13 - ...uild.Tasks.CodeAnalysis.dll.REMOVED.git-id | 1 + .../3.5.0/Microsoft.CSharp.Core.targets | 146 + ...icrosoft.CodeAnalysis.CSharp.Scripting.dll | Bin 0 -> 31104 bytes ...oft.CodeAnalysis.CSharp.dll.REMOVED.git-id | 1 + ....CodeAnalysis.Scripting.dll.REMOVED.git-id | 1 + ...odeAnalysis.VisualBasic.dll.REMOVED.git-id | 1 + .../Microsoft.CodeAnalysis.dll.REMOVED.git-id | 1 + .../3.5.0/Microsoft.Managed.Core.targets | 169 + .../3.5.0/Microsoft.VisualBasic.Core.targets | 136 + ...m.Collections.Immutable.dll.REMOVED.git-id | 1 + .../3.5.0/System.Memory.dll.REMOVED.git-id | 1 + ...tem.Reflection.Metadata.dll.REMOVED.git-id | 1 + ...System.Runtime.CompilerServices.Unsafe.dll | Bin 0 -> 23600 bytes .../System.Threading.Tasks.Extensions.dll | Bin 0 -> 33048 bytes .../3.5.0/VBCSCompiler.exe | Bin 0 -> 88960 bytes .../3.5.0/VBCSCompiler.exe.config | 83 + .../Microsoft.Net.Compilers/3.5.0/csc.exe | Bin 0 -> 56688 bytes .../3.5.0/csc.exe.config | 72 + .../Microsoft.Net.Compilers/3.5.0/csc.rsp | 46 + .../Microsoft.Net.Compilers/3.5.0/csi.exe | Bin 0 -> 16448 bytes .../3.5.0/csi.exe.config | 82 + .../Microsoft.Net.Compilers/3.5.0/csi.rsp | 15 + .../Microsoft.Net.Compilers/3.5.0/vbc.exe | Bin 0 -> 56688 bytes .../3.5.0/vbc.exe.config | 72 + .../Microsoft.Net.Compilers/3.5.0/vbc.rsp | 55 + mcs/tools/aprofutil/Program.cs | 67 +- mcs/tools/linker/Makefile | 11 +- mcs/tools/linker/monolinker.exe.sources | 1 + mcs/tools/mkbundle/bundle-mono-api.inc | 2 +- mcs/tools/mkbundle/template_common.inc | 6 - mk/Makefile.in | 1 + mono/Makefile.in | 1 + mono/arch/Makefile.in | 1 + mono/arch/amd64/Makefile.in | 1 + mono/arch/amd64/amd64-codegen.h | 3 + mono/arch/arm/Makefile.in | 1 + mono/arch/arm64/Makefile.in | 1 + mono/arch/mips/Makefile.in | 16 +- mono/arch/ppc/Makefile.in | 1 + mono/arch/riscv/Makefile.in | 16 +- mono/arch/s390x/Makefile.in | 16 +- mono/arch/s390x/s390x-codegen.h | 64 +- mono/arch/s390x/tramp.c | 8 +- mono/arch/sparc/Makefile.in | 1 + mono/arch/x86/Makefile.in | 1 + mono/arch/x86/x86-codegen.h | 82 +- mono/benchmark/Makefile.in | 1 + mono/btls/Makefile.in | 1 + mono/btls/btls-pkcs12.c | 4 +- mono/cil/Makefile.in | 1 + mono/dis/Makefile.am | 29 + mono/dis/Makefile.in | 179 +- mono/dis/dump.c | 17 +- mono/dis/get.c.REMOVED.git-id | 2 +- mono/dis/main.c | 47 +- mono/eglib/Makefile.am | 24 +- mono/eglib/Makefile.in | 209 +- mono/eglib/eglib-remap.h | 1 + mono/eglib/gfile-posix.c | 2 +- mono/eglib/gfile-win32.c | 7 +- mono/eglib/glib.h | 65 +- mono/eglib/glist.c | 4 +- mono/eglib/gmisc-win32.c | 5 +- mono/eglib/gmodule-unix.c | 3 + mono/eglib/gmodule-win32.c | 155 + mono/eglib/gpath.c | 4 +- mono/eglib/gptrarray.c | 2 +- mono/eglib/gslist.c | 6 +- mono/eglib/gspawn.c | 21 +- mono/eglib/gstr.c | 79 +- mono/eglib/test/Makefile.am | 19 +- mono/eglib/test/Makefile.in | 58 +- mono/eglib/test/file.c | 2 +- mono/eglib/test/module.c | 101 + mono/eglib/test/path.c | 40 +- mono/eglib/test/string-util.c | 20 +- mono/metadata/Makefile.am | 26 +- mono/metadata/Makefile.in.REMOVED.git-id | 2 +- mono/metadata/appdomain.c | 3348 ----------------- mono/metadata/appdomain.c.REMOVED.git-id | 1 + mono/metadata/appdomain.h | 2 +- mono/metadata/assembly-internals.h | 30 +- mono/metadata/assembly-load-context.c | 61 +- mono/metadata/assembly.c.REMOVED.git-id | 2 +- mono/metadata/assembly.h | 14 +- mono/metadata/attach.c | 141 +- mono/metadata/boehm-gc.c | 388 +- mono/metadata/class-init.c.REMOVED.git-id | 2 +- mono/metadata/class-internals.h | 35 +- mono/metadata/class.c.REMOVED.git-id | 2 +- mono/metadata/cominterop.c.REMOVED.git-id | 2 +- mono/metadata/console-unix.c | 25 +- mono/metadata/coree.c | 25 +- mono/metadata/custom-attrs-internals.h | 3 + mono/metadata/custom-attrs.c | 73 +- mono/metadata/debug-mono-ppdb.c | 2 +- mono/metadata/domain-internals.h | 5 +- mono/metadata/domain.c | 7 +- mono/metadata/dynamic-image.c | 8 +- mono/metadata/environment.c | 3 +- mono/metadata/exception.c | 2 +- mono/metadata/external-only.c | 60 +- mono/metadata/gc-internals.h | 2 + mono/metadata/gc.c | 10 +- mono/metadata/handle-decl.h | 1 + mono/metadata/handle.c | 31 +- mono/metadata/handle.h | 78 +- mono/metadata/icall-decl.h | 8 +- mono/metadata/icall-def.h.REMOVED.git-id | 2 +- mono/metadata/icall-table.c | 2 +- mono/metadata/icall-table.h | 23 +- mono/metadata/icall.c.REMOVED.git-id | 2 +- mono/metadata/image.c | 26 +- mono/metadata/jit-icall-reg.h | 2 + mono/metadata/loader-internals.h | 17 +- mono/metadata/loader.c | 59 +- mono/metadata/marshal-ilgen.c.REMOVED.git-id | 2 +- mono/metadata/marshal.c.REMOVED.git-id | 2 +- mono/metadata/marshal.h | 23 +- mono/metadata/metadata-internals.h | 86 +- .../metadata/metadata-verify.c.REMOVED.git-id | 2 +- mono/metadata/metadata.c.REMOVED.git-id | 2 +- mono/metadata/metadata.h | 8 +- mono/metadata/monitor.c | 154 +- mono/metadata/monitor.h | 30 +- mono/metadata/mono-basic-block.c | 4 +- mono/metadata/mono-conc-hash.c | 6 +- mono/metadata/mono-config.c | 8 +- mono/metadata/mono-debug.c | 16 +- mono/metadata/mono-endian.h | 40 +- mono/metadata/mono-gc.h | 4 + mono/metadata/mono-hash.c | 6 +- mono/metadata/mono-perfcounters.c | 10 + mono/metadata/mono-ptr-array.h | 2 +- mono/metadata/mono-route.c | 120 +- mono/metadata/mono-route.h | 32 - mono/metadata/mono-security.c | 20 +- mono/metadata/null-gc-handles.c | 6 +- mono/metadata/null-gc.c | 11 +- mono/metadata/object-internals.h | 100 +- mono/metadata/object-offsets.h | 8 +- mono/metadata/object.c.REMOVED.git-id | 2 +- mono/metadata/object.h | 2 +- mono/metadata/profiler-private.h | 10 +- mono/metadata/profiler.c | 2 +- mono/metadata/rand.c | 8 + mono/metadata/reflection-internals.h | 2 +- mono/metadata/reflection.c.REMOVED.git-id | 2 +- mono/metadata/remoting.c | 8 +- mono/metadata/runtime.c | 2 +- mono/metadata/security-core-clr.c | 2 +- mono/metadata/sgen-bridge.c | 4 +- mono/metadata/sgen-mono-ilgen.c | 4 +- mono/metadata/sgen-mono.c | 189 +- mono/metadata/sgen-mono.h | 2 +- mono/metadata/sgen-stw.c | 22 +- mono/metadata/sgen-tarjan-bridge.c | 4 +- mono/metadata/sgen-toggleref.c | 10 + mono/metadata/sre-encode.c | 2 +- mono/metadata/sre-save.c.REMOVED.git-id | 2 +- mono/metadata/sre.c.REMOVED.git-id | 2 +- mono/metadata/threadpool-io-poll.c | 4 +- mono/metadata/threadpool-io.c | 19 +- mono/metadata/threadpool-io.h | 4 +- mono/metadata/threadpool-netcore.c | 625 +++ mono/metadata/threadpool-worker-default.c | 111 +- mono/metadata/threadpool-worker-wasm.c | 12 + mono/metadata/threadpool-worker.h | 8 + mono/metadata/threadpool.c | 44 +- mono/metadata/threads-types.h | 43 +- mono/metadata/threads.c.REMOVED.git-id | 2 +- mono/metadata/threads.h | 6 +- mono/metadata/verify.c.REMOVED.git-id | 2 +- mono/metadata/w32event-unix.c | 2 + mono/metadata/w32file-unix.c.REMOVED.git-id | 2 +- mono/metadata/w32handle.c | 2 +- .../metadata/w32process-unix.c.REMOVED.git-id | 2 +- mono/metadata/w32process-win32.c | 64 +- mono/metadata/w32process.c | 4 + mono/metadata/w32socket-unix.c | 2 + mono/metadata/w32socket.c | 48 +- mono/metadata/w32subset.h | 8 - mono/mini/Makefile.am | 67 +- mono/mini/Makefile.am.in | 67 +- mono/mini/Makefile.in.REMOVED.git-id | 2 +- mono/mini/abcremoval.c | 103 +- mono/mini/abcremoval.h | 19 + mono/mini/alias-analysis.c | 10 +- mono/mini/aot-compiler.c.REMOVED.git-id | 2 +- mono/mini/aot-compiler.h | 5 +- mono/mini/aot-runtime-wasm.c | 2 +- mono/mini/aot-runtime.c.REMOVED.git-id | 2 +- mono/mini/aot-runtime.h | 2 +- mono/mini/aot-tests.cs | 1 - mono/mini/calls.c | 16 +- mono/mini/cfold.c | 44 +- mono/mini/cpu-amd64.md | 5 + mono/mini/debug-mini.c | 6 +- mono/mini/debugger-agent.c.REMOVED.git-id | 2 +- mono/mini/debugger-engine.c | 4 +- mono/mini/decompose.c | 6 +- mono/mini/dominators.c | 2 +- mono/mini/driver.c | 64 +- mono/mini/dwarfwriter.c | 36 +- mono/mini/ee.h | 6 +- mono/mini/exceptions-amd64.c | 37 +- mono/mini/exceptions-s390x.c | 6 +- mono/mini/exceptions-x86.c | 48 +- mono/mini/exceptions.cs | 1 - mono/mini/iltests.il | 126 + mono/mini/image-writer.c | 6 +- mono/mini/interp-stubs.c | 13 +- mono/mini/interp/interp-internals.h | 83 +- mono/mini/interp/interp.c.REMOVED.git-id | 2 +- mono/mini/interp/mintops.c | 71 +- mono/mini/interp/mintops.def | 1405 +++---- mono/mini/interp/mintops.h | 34 +- mono/mini/interp/transform.c.REMOVED.git-id | 2 +- mono/mini/intrinsics.c | 246 +- mono/mini/ir-emit.h | 54 +- mono/mini/jit-icalls.c | 18 +- mono/mini/jit.h | 7 +- mono/mini/linear-scan.c | 2 +- mono/mini/liveness.c | 12 +- mono/mini/lldb.c | 24 +- mono/mini/llvm-jit.cpp | 95 +- mono/mini/llvm-jit.h | 4 +- mono/mini/llvmonly-runtime.c | 2 +- mono/mini/local-propagation.c | 8 +- mono/mini/main-core.c | 18 +- mono/mini/main.c | 26 +- mono/mini/memory-access.c | 14 +- mono/mini/method-to-ir.c.REMOVED.git-id | 2 +- mono/mini/mini-amd64-gsharedvt.c | 8 +- mono/mini/mini-amd64.c.REMOVED.git-id | 2 +- mono/mini/mini-amd64.h | 4 +- mono/mini/mini-arm-gsharedvt.c | 6 +- mono/mini/mini-arm.c.REMOVED.git-id | 2 +- mono/mini/mini-arm64-gsharedvt.c | 8 +- mono/mini/mini-arm64.c.REMOVED.git-id | 2 +- mono/mini/mini-arm64.h | 2 - mono/mini/mini-codegen.c | 35 +- mono/mini/mini-exceptions.c.REMOVED.git-id | 2 +- mono/mini/mini-gc.c | 36 +- .../mini-generic-sharing.c.REMOVED.git-id | 2 +- mono/mini/mini-llvm-cpp.cpp | 84 +- mono/mini/mini-llvm-cpp.h | 29 +- mono/mini/mini-llvm.c.REMOVED.git-id | 2 +- mono/mini/mini-llvm.h | 1 + mono/mini/mini-mips.c.REMOVED.git-id | 2 +- mono/mini/mini-native-types.c | 35 +- mono/mini/mini-ops.h | 70 + mono/mini/mini-posix.c | 14 +- mono/mini/mini-ppc.c.REMOVED.git-id | 2 +- mono/mini/mini-runtime.c.REMOVED.git-id | 2 +- mono/mini/mini-runtime.h | 9 +- mono/mini/mini-s390x.c.REMOVED.git-id | 2 +- mono/mini/mini-sparc.c.REMOVED.git-id | 2 +- mono/mini/mini-trampolines.c | 20 +- mono/mini/mini-wasm-debugger.c | 2 +- mono/mini/mini-x86.c.REMOVED.git-id | 2 +- mono/mini/mini-x86.h | 8 +- mono/mini/mini.c.REMOVED.git-id | 2 +- mono/mini/mini.h.REMOVED.git-id | 2 +- mono/mini/seq-points.c | 5 +- mono/mini/simd-intrinsics-netcore.c | 940 +++++ mono/mini/simd-intrinsics.c | 11 +- mono/mini/simd-methods-netcore.h | 40 + mono/mini/ssa.c | 10 +- mono/mini/trace.c | 79 +- mono/mini/tramp-amd64-gsharedvt.c | 8 +- mono/mini/tramp-amd64.c | 36 +- mono/mini/tramp-arm-gsharedvt.c | 2 +- mono/mini/tramp-arm.c | 2 +- mono/mini/tramp-s390x.c | 1 + mono/mini/tramp-x86-gsharedvt.c | 2 +- mono/mini/tramp-x86.c | 42 +- mono/mini/type-checking.c | 12 +- mono/mini/unwind.c | 33 +- mono/mini/version.h | 2 +- mono/native/Makefile.am | 19 +- mono/native/Makefile.in.REMOVED.git-id | 2 +- mono/native/mono-native-platform.h | 1 + mono/profiler/Makefile.am | 17 + mono/profiler/Makefile.in | 89 +- mono/profiler/aot.c | 11 +- mono/profiler/log.c.REMOVED.git-id | 2 +- mono/profiler/mprof-report.c.REMOVED.git-id | 2 +- mono/profiler/proftest-pinvokes.c | 40 + mono/profiler/ptestrunner.pl | 8 +- mono/profiler/test-pinvokes.cs | 38 + mono/sgen/Makefile.am | 16 + mono/sgen/Makefile.in | 242 +- mono/sgen/sgen-alloc.c | 61 +- mono/sgen/sgen-cardtable.c | 8 +- mono/sgen/sgen-client.h | 1 + mono/sgen/sgen-debug.c | 5 +- mono/sgen/sgen-fin-weak-hash.c | 6 +- mono/sgen/sgen-gc.c.REMOVED.git-id | 2 +- mono/sgen/sgen-gc.h | 17 +- mono/sgen/sgen-gchandles.c | 89 +- mono/sgen/sgen-internal.c | 1 + mono/sgen/sgen-marksweep.c | 16 +- mono/sgen/sgen-memory-governor.c | 2 +- mono/sgen/sgen-nursery-allocator.c | 7 +- mono/sgen/sgen-simple-nursery.c | 4 +- mono/sgen/sgen-split-nursery.c | 6 +- mono/tests/Makefile.am.REMOVED.git-id | 2 +- mono/tests/Makefile.in.REMOVED.git-id | 2 +- .../tests/assembly-load-reference/Makefile.in | 1 + mono/tests/cominterop.cs | 172 +- mono/tests/dim-generic.cs | 34 + mono/tests/fullaot-mixed/Makefile.am | 8 +- mono/tests/fullaot-mixed/Makefile.in | 5 +- mono/tests/gc-descriptors/Makefile.in | 1 + mono/tests/libtest.c.REMOVED.git-id | 2 +- mono/tests/llvmonly-mixed/Makefile.in | 1 + mono/tests/testing_gac/Makefile.am | 8 +- mono/tests/testing_gac/Makefile.in | 14 +- mono/tests/winx64structs.cs | 50 + mono/unit-tests/Makefile.am | 36 +- mono/unit-tests/Makefile.in | 146 +- mono/unit-tests/test-conc-hashtable.c | 14 +- mono/unit-tests/test-embed-invoke.c | 7 + mono/unit-tests/test-mono-callspec.c | 15 +- mono/unit-tests/test-mono-embed.c | 7 + mono/unit-tests/test-mono-linked-list-set.c | 2 +- mono/unit-tests/test-mono-string.c | 4 +- mono/unit-tests/test-sgen-qsort.c | 2 +- mono/utils/Makefile.am | 26 +- mono/utils/Makefile.in.REMOVED.git-id | 2 +- mono/utils/checked-build.c | 6 +- mono/utils/hazard-pointer.c | 2 +- mono/utils/jemalloc/Makefile.in | 1 + mono/utils/mono-codeman.c | 155 +- mono/utils/mono-compiler.h | 11 +- mono/utils/mono-context.h | 19 +- mono/utils/mono-dl.c | 12 +- mono/utils/mono-error-internals.h | 55 +- mono/utils/mono-error.c | 14 +- mono/utils/mono-error.h | 10 +- mono/utils/mono-hwcap-vars.h | 3 + mono/utils/mono-hwcap-x86.c | 11 + mono/utils/mono-io-portability.c | 4 +- mono/utils/mono-linked-list-set.c | 2 +- mono/utils/mono-log-common.c | 4 +- mono/utils/mono-log-windows.c | 4 +- mono/utils/mono-merp.c | 4 +- mono/utils/mono-os-wait-win32.c | 2 +- mono/utils/mono-path.c | 4 +- mono/utils/mono-sigcontext.h | 1 + mono/utils/mono-state.c | 12 + mono/utils/mono-threads-api.h | 18 +- mono/utils/mono-threads-coop.c | 15 +- mono/utils/mono-threads-coop.h | 17 +- mono/utils/mono-threads-state-machine.c | 6 +- mono/utils/mono-threads-wasm.c | 12 +- mono/utils/mono-threads-windows.c | 11 +- mono/utils/mono-threads.c | 23 +- mono/utils/mono-threads.h | 21 +- mono/utils/mono-windows-thread-name.c | 16 +- mono/utils/monobitset.c | 6 +- mono/utils/networking-posix.c | 2 + mono/utils/networking.h | 1 + mono/utils/strenc.c | 14 +- msvc/Makefile.am | 67 + msvc/Makefile.in | 67 + msvc/libmono-dynamic.vcxproj | 6 + msvc/libmono-static.vcxproj | 6 + msvc/mono.sln | 19 +- msvc/monow.vcxproj | 223 ++ netcore/Makefile | 275 ++ netcore/corerun/Makefile.am | 7 + netcore/corerun/Makefile.in | 816 ++++ netcore/corerun/coreclrhost.h | 125 + netcore/corerun/corerun.cpp | 162 + netcore/corerun/coreruncommon.cpp | 520 +++ netcore/corerun/coreruncommon.h | 56 + po/Makefile.in | 1 + po/mcs/de.gmo | Bin 5406 -> 5406 bytes po/mcs/de.po.REMOVED.git-id | 2 +- po/mcs/es.gmo | Bin 16329 -> 16329 bytes po/mcs/es.po.REMOVED.git-id | 2 +- po/mcs/ja.gmo | Bin 20863 -> 20863 bytes po/mcs/ja.po.REMOVED.git-id | 2 +- po/mcs/mcs.pot | 4 +- po/mcs/pt_BR.gmo | Bin 72806 -> 72806 bytes po/mcs/pt_BR.po.REMOVED.git-id | 2 +- runtime/Makefile.in | 1 + samples/Makefile.in | 1 + samples/embed/test-invoke.c | 44 +- samples/embed/test.cs | 8 +- samples/embed/teste.c | 38 +- scripts/Makefile.in | 1 + scripts/csc.in | 2 +- scripts/csi.in | 2 +- scripts/mono-package-runtime | 2 +- scripts/vbc.in | 2 +- support/Makefile.am | 15 + support/Makefile.in | 484 +-- support/map.c.REMOVED.git-id | 2 +- support/map.h.REMOVED.git-id | 2 +- support/minizip/ioapi.c | 2 +- support/signal.c | 10 +- support/sys-socket.c | 6 +- support/sys-stat.c | 2 +- support/sys-time.c | 2 +- tools/Makefile.in | 1 + tools/locale-builder/Makefile.in | 1 + tools/mono-hang-watchdog/Makefile.am | 7 + tools/mono-hang-watchdog/Makefile.in | 28 +- tools/pedump/Makefile.am | 28 + tools/pedump/Makefile.in | 86 +- tools/pedump/pedump.c | 29 +- tools/sgen/Makefile.am | 8 + tools/sgen/Makefile.in | 103 +- tools/sgen/sgen-grep-binprot.c | 2 +- 1043 files changed, 16271 insertions(+), 22080 deletions(-) delete mode 100644 external/cecil/.azure-pipelines.yml create mode 100644 external/cecil/.github/workflows/main.yml create mode 100644 external/cecil/symbols/pdb/Microsoft.Cci.Pdb/PdbInfo.cs create mode 100644 external/corefx/src/Common/src/Interop/Unix/System.Native/Interop.LChflags.cs create mode 100644 external/linker/eng/common/enable-cross-org-publishing.ps1 delete mode 100644 external/linker/eng/common/post-build/dotnetsymbol-init.ps1 delete mode 100644 external/linker/eng/common/post-build/sourcelink-cli-init.ps1 delete mode 100644 external/linker/eng/common/templates/post-build/channels/internal-servicing.yml create mode 100644 external/linker/eng/common/templates/post-build/channels/netcore-dev-31.yml create mode 100644 external/linker/eng/common/templates/post-build/channels/netcore-internal-30.yml create mode 100644 external/linker/eng/common/templates/post-build/channels/netcore-release-30.yml create mode 100644 external/linker/eng/common/templates/post-build/channels/netcore-release-31.yml delete mode 100644 external/linker/eng/common/templates/post-build/channels/public-dev-release.yml delete mode 100644 external/linker/eng/common/templates/post-build/channels/public-release.yml create mode 100644 external/linker/eng/common/templates/steps/promote-build.yml create mode 100644 external/linker/src/linker/Linker/OutputException.cs delete mode 100644 external/roslyn-binaries/Microsoft.Net.Compilers/3.4.0/Microsoft.Managed.EditorConfig.targets create mode 100644 external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/Microsoft.Build.Tasks.CodeAnalysis.dll.REMOVED.git-id rename {mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.4.0 => external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0}/Microsoft.CSharp.Core.targets (100%) rename {mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.4.0 => external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0}/Microsoft.CodeAnalysis.CSharp.Scripting.dll (78%) create mode 100644 external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/Microsoft.CodeAnalysis.CSharp.dll.REMOVED.git-id create mode 100644 external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/Microsoft.CodeAnalysis.Scripting.dll.REMOVED.git-id create mode 100644 external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/Microsoft.CodeAnalysis.VisualBasic.dll.REMOVED.git-id create mode 100644 external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/Microsoft.CodeAnalysis.dll.REMOVED.git-id create mode 100644 external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/Microsoft.DiaSymReader.Native.amd64.dll.REMOVED.git-id create mode 100644 external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/Microsoft.DiaSymReader.Native.x86.dll.REMOVED.git-id rename {mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.4.0 => external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0}/Microsoft.Managed.Core.targets (100%) rename {mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.4.0 => external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0}/Microsoft.VisualBasic.Core.targets (100%) create mode 100644 external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/System.Buffers.dll rename {mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.4.0 => external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0}/System.Collections.Immutable.dll.REMOVED.git-id (100%) rename {mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.4.0 => external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0}/System.Memory.dll.REMOVED.git-id (100%) create mode 100644 external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/System.Numerics.Vectors.dll.REMOVED.git-id rename {mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.4.0 => external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0}/System.Reflection.Metadata.dll.REMOVED.git-id (100%) rename {mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.4.0 => external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0}/System.Runtime.CompilerServices.Unsafe.dll (100%) create mode 100644 external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/System.Text.Encoding.CodePages.dll.REMOVED.git-id rename {mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.4.0 => external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0}/System.Threading.Tasks.Extensions.dll (100%) rename {mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.4.0 => external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0}/VBCSCompiler.exe (91%) rename {mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.4.0 => external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0}/VBCSCompiler.exe.config (94%) rename {mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.4.0 => external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0}/csc.exe (87%) rename {mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.4.0 => external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0}/csc.exe.config (95%) rename {mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.4.0 => external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0}/csc.rsp (100%) rename {mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.4.0 => external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0}/csi.exe (62%) rename {mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.4.0 => external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0}/csi.exe.config (93%) rename {mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.4.0 => external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0}/csi.rsp (100%) rename {mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.4.0 => external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0}/vbc.exe (87%) rename {mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.4.0 => external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0}/vbc.exe.config (95%) rename {mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.4.0 => external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0}/vbc.rsp (100%) create mode 100644 mcs/class/Mono.Posix/Test/Mono.Unix.Native/OFDLockTest.cs delete mode 100644 mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsClientCertificate.cs delete mode 100644 mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsClientCertificateVerify.cs delete mode 100644 mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsClientFinished.cs delete mode 100644 mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsClientHello.cs delete mode 100644 mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsClientKeyExchange.cs delete mode 100644 mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerCertificate.cs delete mode 100644 mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerCertificateRequest.cs delete mode 100644 mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerFinished.cs delete mode 100644 mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerHello.cs delete mode 100644 mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerHelloDone.cs delete mode 100644 mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerKeyExchange.cs delete mode 100644 mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsClientCertificate.cs delete mode 100644 mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsClientCertificateVerify.cs delete mode 100644 mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsClientFinished.cs delete mode 100644 mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsClientHello.cs delete mode 100644 mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsClientKeyExchange.cs delete mode 100644 mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsServerCertificate.cs delete mode 100644 mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsServerCertificateRequest.cs delete mode 100644 mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsServerFinished.cs delete mode 100644 mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsServerHello.cs delete mode 100644 mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsServerHelloDone.cs delete mode 100644 mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsServerKeyExchange.cs delete mode 100644 mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake/ClientCertificateType.cs delete mode 100644 mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake/HandshakeMessage.cs delete mode 100644 mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake/HandshakeType.cs delete mode 100644 mcs/class/Mono.Security/Mono.Security.Protocol.Tls/Alert.cs delete mode 100644 mcs/class/Mono.Security/Mono.Security.Protocol.Tls/CipherAlgorithmType.cs delete mode 100644 mcs/class/Mono.Security/Mono.Security.Protocol.Tls/CipherSuite.cs delete mode 100644 mcs/class/Mono.Security/Mono.Security.Protocol.Tls/CipherSuiteCollection.cs delete mode 100644 mcs/class/Mono.Security/Mono.Security.Protocol.Tls/CipherSuiteFactory.cs delete mode 100644 mcs/class/Mono.Security/Mono.Security.Protocol.Tls/ClientContext.cs delete mode 100644 mcs/class/Mono.Security/Mono.Security.Protocol.Tls/ClientRecordProtocol.cs delete mode 100644 mcs/class/Mono.Security/Mono.Security.Protocol.Tls/ClientSessionCache.cs delete mode 100644 mcs/class/Mono.Security/Mono.Security.Protocol.Tls/ContentType.cs delete mode 100644 mcs/class/Mono.Security/Mono.Security.Protocol.Tls/Context.cs delete mode 100644 mcs/class/Mono.Security/Mono.Security.Protocol.Tls/DebugHelper.cs delete mode 100644 mcs/class/Mono.Security/Mono.Security.Protocol.Tls/ExchangeAlgorithmType.cs delete mode 100644 mcs/class/Mono.Security/Mono.Security.Protocol.Tls/HandshakeState.cs delete mode 100644 mcs/class/Mono.Security/Mono.Security.Protocol.Tls/HashAlgorithmType.cs delete mode 100644 mcs/class/Mono.Security/Mono.Security.Protocol.Tls/HttpsClientStream.cs delete mode 100644 mcs/class/Mono.Security/Mono.Security.Protocol.Tls/MD5SHA1.cs delete mode 100644 mcs/class/Mono.Security/Mono.Security.Protocol.Tls/RSASslSignatureDeformatter.cs delete mode 100644 mcs/class/Mono.Security/Mono.Security.Protocol.Tls/RSASslSignatureFormatter.cs delete mode 100644 mcs/class/Mono.Security/Mono.Security.Protocol.Tls/RecordProtocol.cs delete mode 100644 mcs/class/Mono.Security/Mono.Security.Protocol.Tls/SecurityCompressionType.cs delete mode 100644 mcs/class/Mono.Security/Mono.Security.Protocol.Tls/SecurityProtocolType.cs delete mode 100644 mcs/class/Mono.Security/Mono.Security.Protocol.Tls/ServerContext.cs delete mode 100644 mcs/class/Mono.Security/Mono.Security.Protocol.Tls/ServerRecordProtocol.cs delete mode 100644 mcs/class/Mono.Security/Mono.Security.Protocol.Tls/SslCipherSuite.cs delete mode 100644 mcs/class/Mono.Security/Mono.Security.Protocol.Tls/SslClientStream.cs delete mode 100644 mcs/class/Mono.Security/Mono.Security.Protocol.Tls/SslHandshakeHash.cs delete mode 100644 mcs/class/Mono.Security/Mono.Security.Protocol.Tls/SslServerStream.cs delete mode 100644 mcs/class/Mono.Security/Mono.Security.Protocol.Tls/SslStreamBase.cs delete mode 100644 mcs/class/Mono.Security/Mono.Security.Protocol.Tls/TlsCipherSuite.cs delete mode 100644 mcs/class/Mono.Security/Mono.Security.Protocol.Tls/TlsClientSettings.cs delete mode 100644 mcs/class/Mono.Security/Mono.Security.Protocol.Tls/TlsException.cs delete mode 100644 mcs/class/Mono.Security/Mono.Security.Protocol.Tls/TlsServerSettings.cs delete mode 100644 mcs/class/Mono.Security/Mono.Security.Protocol.Tls/TlsStream.cs create mode 100644 mcs/class/System.Drawing/win32_net_4_x_System.Drawing.dll.exclude.sources create mode 100644 mcs/class/System.Drawing/win32_net_4_x_System.Drawing.dll.sources delete mode 100644 mcs/class/System.Net.Http/System.Net.Http/HttpClientHandler.platformnotsupported.cs create mode 100644 mcs/class/System.Net.Http/System.Net.Http/HttpClientHandler.xi.cs create mode 100644 mcs/class/System.Net.Http/monotouch_System.Net.Http.dll.exclude.sources create mode 100644 mcs/class/System.Net.Http/monotouch_tv_System.Net.Http.dll.exclude.sources delete mode 100644 mcs/class/System.Net.Http/monotouch_watch_System.Net.Http.dll.exclude.sources create mode 100644 mcs/class/System.Net.Http/xammac_System.Net.Http.dll.exclude.sources create mode 100644 mcs/class/System.Net.Http/xammac_net_4_5_System.Net.Http.dll.exclude.sources delete mode 100644 mcs/class/System/Mono.Net.Security/LegacySslStream.cs delete mode 100644 mcs/class/System/Mono.Net.Security/LegacyTlsProvider.cs create mode 100644 mcs/class/System/Mono.Net.Security/MobileTlsProvider.cs create mode 100644 mcs/class/System/System.IO/FileSystemWatcher.platformnotsupported.cs create mode 100644 mcs/class/System/corefx/NetworkStream.cs create mode 100644 mcs/class/System/corefx/SocketAsyncEventArgs.cs create mode 100644 mcs/class/System/fsw.pns.sources create mode 100644 mcs/class/System/wasm_System.dll.exclude.sources rename mcs/class/{Mono.Security/Mono.Security.Protocol.Tls/SecurityParameters.cs => corlib/System.Reflection/MethodInfo.cs} (52%) delete mode 100644 mcs/class/corlib/corefx/MethodInfo.cs delete mode 100644 mcs/class/lib/monolite-linux/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/netstandard.dll.REMOVED.git-id delete mode 100644 mcs/class/lib/monolite-linux/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Mono.Cecil.dll.REMOVED.git-id delete mode 100644 mcs/class/lib/monolite-linux/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Mono.Security.dll.REMOVED.git-id delete mode 100644 mcs/class/lib/monolite-linux/A144A63D-652C-4CCF-A9EE-8E5A091547F1/System.Configuration.dll.REMOVED.git-id delete mode 100644 mcs/class/lib/monolite-linux/A144A63D-652C-4CCF-A9EE-8E5A091547F1/System.Core.dll.REMOVED.git-id delete mode 100644 mcs/class/lib/monolite-linux/A144A63D-652C-4CCF-A9EE-8E5A091547F1/System.IO.Compression.dll.REMOVED.git-id delete mode 100644 mcs/class/lib/monolite-linux/A144A63D-652C-4CCF-A9EE-8E5A091547F1/System.Numerics.dll.REMOVED.git-id delete mode 100644 mcs/class/lib/monolite-linux/A144A63D-652C-4CCF-A9EE-8E5A091547F1/System.Xml.dll.REMOVED.git-id delete mode 100644 mcs/class/lib/monolite-linux/A144A63D-652C-4CCF-A9EE-8E5A091547F1/System.dll.REMOVED.git-id delete mode 100644 mcs/class/lib/monolite-linux/A144A63D-652C-4CCF-A9EE-8E5A091547F1/mcs.exe.REMOVED.git-id delete mode 100644 mcs/class/lib/monolite-linux/A144A63D-652C-4CCF-A9EE-8E5A091547F1/mscorlib.dll.REMOVED.git-id rename mcs/class/lib/monolite-linux/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/Facades/System.Collections.Concurrent.dll (100%) rename mcs/class/lib/monolite-linux/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/Facades/System.Collections.dll (100%) rename mcs/class/lib/monolite-linux/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/Facades/System.Diagnostics.Debug.dll (100%) rename mcs/class/lib/monolite-linux/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/Facades/System.Diagnostics.FileVersionInfo.dll (100%) rename mcs/class/lib/monolite-linux/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/Facades/System.Diagnostics.Tools.dll (100%) rename mcs/class/lib/monolite-linux/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/Facades/System.Dynamic.Runtime.dll (100%) rename mcs/class/lib/monolite-linux/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/Facades/System.Globalization.dll (100%) rename mcs/class/lib/monolite-linux/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/Facades/System.IO.FileSystem.Primitives.dll (100%) rename mcs/class/lib/monolite-linux/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/Facades/System.IO.FileSystem.dll (100%) rename mcs/class/lib/monolite-linux/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/Facades/System.IO.dll (100%) rename mcs/class/lib/monolite-linux/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/Facades/System.Linq.Expressions.dll (100%) rename mcs/class/lib/monolite-linux/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/Facades/System.Linq.dll (100%) rename mcs/class/lib/monolite-linux/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/Facades/System.Reflection.Extensions.dll (100%) rename mcs/class/lib/monolite-linux/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/Facades/System.Reflection.Primitives.dll (100%) rename mcs/class/lib/monolite-linux/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/Facades/System.Reflection.dll (100%) rename mcs/class/lib/monolite-linux/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/Facades/System.Resources.ResourceManager.dll (100%) rename mcs/class/lib/monolite-linux/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/Facades/System.Runtime.Extensions.dll (100%) rename mcs/class/lib/monolite-linux/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/Facades/System.Runtime.InteropServices.dll (100%) rename mcs/class/lib/monolite-linux/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/Facades/System.Runtime.Numerics.dll (100%) rename mcs/class/lib/monolite-linux/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/Facades/System.Runtime.dll (100%) rename mcs/class/lib/monolite-linux/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/Facades/System.Security.Cryptography.Algorithms.dll (100%) rename mcs/class/lib/monolite-linux/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/Facades/System.Security.Cryptography.Primitives.dll (100%) rename mcs/class/lib/monolite-linux/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/Facades/System.Text.Encoding.CodePages.dll (100%) rename mcs/class/lib/monolite-linux/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/Facades/System.Text.Encoding.Extensions.dll (100%) rename mcs/class/lib/monolite-linux/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/Facades/System.Text.Encoding.dll (100%) rename mcs/class/lib/monolite-linux/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/Facades/System.Threading.Tasks.Parallel.dll (100%) rename mcs/class/lib/monolite-linux/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/Facades/System.Threading.Tasks.dll (100%) rename mcs/class/lib/monolite-linux/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/Facades/System.Threading.dll (100%) rename mcs/class/lib/monolite-linux/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/Facades/System.ValueTuple.dll (100%) rename mcs/class/lib/monolite-linux/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/Facades/System.Xml.ReaderWriter.dll (100%) rename mcs/class/lib/monolite-linux/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/Facades/System.Xml.XDocument.dll (100%) create mode 100644 mcs/class/lib/monolite-linux/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/netstandard.dll.REMOVED.git-id create mode 100644 mcs/class/lib/monolite-linux/ABB721D6-116A-4555-B4FD-9248146D2051/Mono.Cecil.dll.REMOVED.git-id create mode 100644 mcs/class/lib/monolite-linux/ABB721D6-116A-4555-B4FD-9248146D2051/Mono.Security.dll.REMOVED.git-id create mode 100644 mcs/class/lib/monolite-linux/ABB721D6-116A-4555-B4FD-9248146D2051/System.Configuration.dll.REMOVED.git-id create mode 100644 mcs/class/lib/monolite-linux/ABB721D6-116A-4555-B4FD-9248146D2051/System.Core.dll.REMOVED.git-id create mode 100644 mcs/class/lib/monolite-linux/ABB721D6-116A-4555-B4FD-9248146D2051/System.IO.Compression.dll.REMOVED.git-id create mode 100644 mcs/class/lib/monolite-linux/ABB721D6-116A-4555-B4FD-9248146D2051/System.Numerics.dll.REMOVED.git-id rename mcs/class/lib/monolite-linux/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/System.Security.dll.REMOVED.git-id (100%) rename mcs/class/lib/monolite-linux/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/System.Xml.Linq.dll.REMOVED.git-id (100%) create mode 100644 mcs/class/lib/monolite-linux/ABB721D6-116A-4555-B4FD-9248146D2051/System.Xml.dll.REMOVED.git-id create mode 100644 mcs/class/lib/monolite-linux/ABB721D6-116A-4555-B4FD-9248146D2051/System.dll.REMOVED.git-id create mode 100644 mcs/class/lib/monolite-linux/ABB721D6-116A-4555-B4FD-9248146D2051/mcs.exe.REMOVED.git-id create mode 100644 mcs/class/lib/monolite-linux/ABB721D6-116A-4555-B4FD-9248146D2051/mscorlib.dll.REMOVED.git-id delete mode 100644 mcs/class/lib/monolite-macos/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/netstandard.dll.REMOVED.git-id delete mode 100644 mcs/class/lib/monolite-macos/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Mono.Cecil.dll.REMOVED.git-id delete mode 100644 mcs/class/lib/monolite-macos/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Mono.Security.dll.REMOVED.git-id delete mode 100644 mcs/class/lib/monolite-macos/A144A63D-652C-4CCF-A9EE-8E5A091547F1/System.Configuration.dll.REMOVED.git-id delete mode 100644 mcs/class/lib/monolite-macos/A144A63D-652C-4CCF-A9EE-8E5A091547F1/System.Core.dll.REMOVED.git-id delete mode 100644 mcs/class/lib/monolite-macos/A144A63D-652C-4CCF-A9EE-8E5A091547F1/System.IO.Compression.dll.REMOVED.git-id delete mode 100644 mcs/class/lib/monolite-macos/A144A63D-652C-4CCF-A9EE-8E5A091547F1/System.Numerics.dll.REMOVED.git-id delete mode 100644 mcs/class/lib/monolite-macos/A144A63D-652C-4CCF-A9EE-8E5A091547F1/System.Xml.dll.REMOVED.git-id delete mode 100644 mcs/class/lib/monolite-macos/A144A63D-652C-4CCF-A9EE-8E5A091547F1/System.dll.REMOVED.git-id delete mode 100644 mcs/class/lib/monolite-macos/A144A63D-652C-4CCF-A9EE-8E5A091547F1/mcs.exe.REMOVED.git-id delete mode 100644 mcs/class/lib/monolite-macos/A144A63D-652C-4CCF-A9EE-8E5A091547F1/mscorlib.dll.REMOVED.git-id rename mcs/class/lib/monolite-macos/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/Facades/System.Collections.Concurrent.dll (100%) rename mcs/class/lib/monolite-macos/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/Facades/System.Collections.dll (100%) rename mcs/class/lib/monolite-macos/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/Facades/System.Diagnostics.Debug.dll (100%) rename mcs/class/lib/monolite-macos/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/Facades/System.Diagnostics.FileVersionInfo.dll (100%) rename mcs/class/lib/monolite-macos/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/Facades/System.Diagnostics.Tools.dll (100%) rename mcs/class/lib/monolite-macos/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/Facades/System.Dynamic.Runtime.dll (100%) rename mcs/class/lib/monolite-macos/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/Facades/System.Globalization.dll (100%) rename mcs/class/lib/monolite-macos/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/Facades/System.IO.FileSystem.Primitives.dll (100%) rename mcs/class/lib/monolite-macos/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/Facades/System.IO.FileSystem.dll (100%) rename mcs/class/lib/monolite-macos/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/Facades/System.IO.dll (100%) rename mcs/class/lib/monolite-macos/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/Facades/System.Linq.Expressions.dll (100%) rename mcs/class/lib/monolite-macos/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/Facades/System.Linq.dll (100%) rename mcs/class/lib/monolite-macos/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/Facades/System.Reflection.Extensions.dll (100%) rename mcs/class/lib/monolite-macos/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/Facades/System.Reflection.Primitives.dll (100%) rename mcs/class/lib/monolite-macos/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/Facades/System.Reflection.dll (100%) rename mcs/class/lib/monolite-macos/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/Facades/System.Resources.ResourceManager.dll (100%) rename mcs/class/lib/monolite-macos/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/Facades/System.Runtime.Extensions.dll (100%) rename mcs/class/lib/monolite-macos/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/Facades/System.Runtime.InteropServices.dll (100%) rename mcs/class/lib/monolite-macos/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/Facades/System.Runtime.Numerics.dll (100%) rename mcs/class/lib/monolite-macos/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/Facades/System.Runtime.dll (100%) rename mcs/class/lib/monolite-macos/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/Facades/System.Security.Cryptography.Algorithms.dll (100%) rename mcs/class/lib/monolite-macos/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/Facades/System.Security.Cryptography.Primitives.dll (100%) rename mcs/class/lib/monolite-macos/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/Facades/System.Text.Encoding.CodePages.dll (100%) rename mcs/class/lib/monolite-macos/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/Facades/System.Text.Encoding.Extensions.dll (100%) rename mcs/class/lib/monolite-macos/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/Facades/System.Text.Encoding.dll (100%) rename mcs/class/lib/monolite-macos/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/Facades/System.Threading.Tasks.Parallel.dll (100%) rename mcs/class/lib/monolite-macos/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/Facades/System.Threading.Tasks.dll (100%) rename mcs/class/lib/monolite-macos/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/Facades/System.Threading.dll (100%) rename mcs/class/lib/monolite-macos/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/Facades/System.ValueTuple.dll (100%) rename mcs/class/lib/monolite-macos/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/Facades/System.Xml.ReaderWriter.dll (100%) rename mcs/class/lib/monolite-macos/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/Facades/System.Xml.XDocument.dll (100%) create mode 100644 mcs/class/lib/monolite-macos/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/netstandard.dll.REMOVED.git-id create mode 100644 mcs/class/lib/monolite-macos/ABB721D6-116A-4555-B4FD-9248146D2051/Mono.Cecil.dll.REMOVED.git-id create mode 100644 mcs/class/lib/monolite-macos/ABB721D6-116A-4555-B4FD-9248146D2051/Mono.Security.dll.REMOVED.git-id create mode 100644 mcs/class/lib/monolite-macos/ABB721D6-116A-4555-B4FD-9248146D2051/System.Configuration.dll.REMOVED.git-id create mode 100644 mcs/class/lib/monolite-macos/ABB721D6-116A-4555-B4FD-9248146D2051/System.Core.dll.REMOVED.git-id create mode 100644 mcs/class/lib/monolite-macos/ABB721D6-116A-4555-B4FD-9248146D2051/System.IO.Compression.dll.REMOVED.git-id create mode 100644 mcs/class/lib/monolite-macos/ABB721D6-116A-4555-B4FD-9248146D2051/System.Numerics.dll.REMOVED.git-id rename mcs/class/lib/monolite-macos/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/System.Security.dll.REMOVED.git-id (100%) rename mcs/class/lib/monolite-macos/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/System.Xml.Linq.dll.REMOVED.git-id (100%) create mode 100644 mcs/class/lib/monolite-macos/ABB721D6-116A-4555-B4FD-9248146D2051/System.Xml.dll.REMOVED.git-id create mode 100644 mcs/class/lib/monolite-macos/ABB721D6-116A-4555-B4FD-9248146D2051/System.dll.REMOVED.git-id create mode 100644 mcs/class/lib/monolite-macos/ABB721D6-116A-4555-B4FD-9248146D2051/mcs.exe.REMOVED.git-id create mode 100644 mcs/class/lib/monolite-macos/ABB721D6-116A-4555-B4FD-9248146D2051/mscorlib.dll.REMOVED.git-id delete mode 100644 mcs/class/lib/monolite-unix/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/netstandard.dll.REMOVED.git-id delete mode 100644 mcs/class/lib/monolite-unix/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Mono.Cecil.dll.REMOVED.git-id delete mode 100644 mcs/class/lib/monolite-unix/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Mono.Security.dll.REMOVED.git-id delete mode 100644 mcs/class/lib/monolite-unix/A144A63D-652C-4CCF-A9EE-8E5A091547F1/System.Configuration.dll.REMOVED.git-id delete mode 100644 mcs/class/lib/monolite-unix/A144A63D-652C-4CCF-A9EE-8E5A091547F1/System.Core.dll.REMOVED.git-id delete mode 100644 mcs/class/lib/monolite-unix/A144A63D-652C-4CCF-A9EE-8E5A091547F1/System.IO.Compression.dll.REMOVED.git-id delete mode 100644 mcs/class/lib/monolite-unix/A144A63D-652C-4CCF-A9EE-8E5A091547F1/System.Numerics.dll.REMOVED.git-id delete mode 100644 mcs/class/lib/monolite-unix/A144A63D-652C-4CCF-A9EE-8E5A091547F1/System.Xml.dll.REMOVED.git-id delete mode 100644 mcs/class/lib/monolite-unix/A144A63D-652C-4CCF-A9EE-8E5A091547F1/System.dll.REMOVED.git-id delete mode 100644 mcs/class/lib/monolite-unix/A144A63D-652C-4CCF-A9EE-8E5A091547F1/mcs.exe.REMOVED.git-id delete mode 100644 mcs/class/lib/monolite-unix/A144A63D-652C-4CCF-A9EE-8E5A091547F1/mscorlib.dll.REMOVED.git-id rename mcs/class/lib/monolite-unix/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/Facades/System.Collections.Concurrent.dll (100%) rename mcs/class/lib/monolite-unix/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/Facades/System.Collections.dll (100%) rename mcs/class/lib/monolite-unix/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/Facades/System.Diagnostics.Debug.dll (100%) rename mcs/class/lib/monolite-unix/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/Facades/System.Diagnostics.FileVersionInfo.dll (100%) rename mcs/class/lib/monolite-unix/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/Facades/System.Diagnostics.Tools.dll (100%) rename mcs/class/lib/monolite-unix/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/Facades/System.Dynamic.Runtime.dll (100%) rename mcs/class/lib/monolite-unix/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/Facades/System.Globalization.dll (100%) rename mcs/class/lib/monolite-unix/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/Facades/System.IO.FileSystem.Primitives.dll (100%) rename mcs/class/lib/monolite-unix/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/Facades/System.IO.FileSystem.dll (100%) rename mcs/class/lib/monolite-unix/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/Facades/System.IO.dll (100%) rename mcs/class/lib/monolite-unix/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/Facades/System.Linq.Expressions.dll (100%) rename mcs/class/lib/monolite-unix/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/Facades/System.Linq.dll (100%) rename mcs/class/lib/monolite-unix/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/Facades/System.Reflection.Extensions.dll (100%) rename mcs/class/lib/monolite-unix/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/Facades/System.Reflection.Primitives.dll (100%) rename mcs/class/lib/monolite-unix/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/Facades/System.Reflection.dll (100%) rename mcs/class/lib/monolite-unix/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/Facades/System.Resources.ResourceManager.dll (100%) rename mcs/class/lib/monolite-unix/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/Facades/System.Runtime.Extensions.dll (100%) rename mcs/class/lib/monolite-unix/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/Facades/System.Runtime.InteropServices.dll (100%) rename mcs/class/lib/monolite-unix/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/Facades/System.Runtime.Numerics.dll (100%) rename mcs/class/lib/monolite-unix/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/Facades/System.Runtime.dll (100%) rename mcs/class/lib/monolite-unix/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/Facades/System.Security.Cryptography.Algorithms.dll (100%) rename mcs/class/lib/monolite-unix/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/Facades/System.Security.Cryptography.Primitives.dll (100%) rename mcs/class/lib/monolite-unix/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/Facades/System.Text.Encoding.CodePages.dll (100%) rename mcs/class/lib/monolite-unix/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/Facades/System.Text.Encoding.Extensions.dll (100%) rename mcs/class/lib/monolite-unix/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/Facades/System.Text.Encoding.dll (100%) rename mcs/class/lib/monolite-unix/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/Facades/System.Threading.Tasks.Parallel.dll (100%) rename mcs/class/lib/monolite-unix/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/Facades/System.Threading.Tasks.dll (100%) rename mcs/class/lib/monolite-unix/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/Facades/System.Threading.dll (100%) rename mcs/class/lib/monolite-unix/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/Facades/System.ValueTuple.dll (100%) rename mcs/class/lib/monolite-unix/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/Facades/System.Xml.ReaderWriter.dll (100%) rename mcs/class/lib/monolite-unix/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/Facades/System.Xml.XDocument.dll (100%) create mode 100644 mcs/class/lib/monolite-unix/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/netstandard.dll.REMOVED.git-id create mode 100644 mcs/class/lib/monolite-unix/ABB721D6-116A-4555-B4FD-9248146D2051/Mono.Cecil.dll.REMOVED.git-id create mode 100644 mcs/class/lib/monolite-unix/ABB721D6-116A-4555-B4FD-9248146D2051/Mono.Security.dll.REMOVED.git-id create mode 100644 mcs/class/lib/monolite-unix/ABB721D6-116A-4555-B4FD-9248146D2051/System.Configuration.dll.REMOVED.git-id create mode 100644 mcs/class/lib/monolite-unix/ABB721D6-116A-4555-B4FD-9248146D2051/System.Core.dll.REMOVED.git-id create mode 100644 mcs/class/lib/monolite-unix/ABB721D6-116A-4555-B4FD-9248146D2051/System.IO.Compression.dll.REMOVED.git-id create mode 100644 mcs/class/lib/monolite-unix/ABB721D6-116A-4555-B4FD-9248146D2051/System.Numerics.dll.REMOVED.git-id rename mcs/class/lib/monolite-unix/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/System.Security.dll.REMOVED.git-id (100%) rename mcs/class/lib/monolite-unix/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/System.Xml.Linq.dll.REMOVED.git-id (100%) create mode 100644 mcs/class/lib/monolite-unix/ABB721D6-116A-4555-B4FD-9248146D2051/System.Xml.dll.REMOVED.git-id create mode 100644 mcs/class/lib/monolite-unix/ABB721D6-116A-4555-B4FD-9248146D2051/System.dll.REMOVED.git-id create mode 100644 mcs/class/lib/monolite-unix/ABB721D6-116A-4555-B4FD-9248146D2051/mcs.exe.REMOVED.git-id create mode 100644 mcs/class/lib/monolite-unix/ABB721D6-116A-4555-B4FD-9248146D2051/mscorlib.dll.REMOVED.git-id delete mode 100644 mcs/class/lib/monolite-win32/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/netstandard.dll.REMOVED.git-id delete mode 100644 mcs/class/lib/monolite-win32/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Mono.Cecil.dll.REMOVED.git-id delete mode 100644 mcs/class/lib/monolite-win32/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Mono.Security.dll.REMOVED.git-id delete mode 100644 mcs/class/lib/monolite-win32/A144A63D-652C-4CCF-A9EE-8E5A091547F1/System.Configuration.dll.REMOVED.git-id delete mode 100644 mcs/class/lib/monolite-win32/A144A63D-652C-4CCF-A9EE-8E5A091547F1/System.Core.dll.REMOVED.git-id delete mode 100644 mcs/class/lib/monolite-win32/A144A63D-652C-4CCF-A9EE-8E5A091547F1/System.IO.Compression.dll.REMOVED.git-id delete mode 100644 mcs/class/lib/monolite-win32/A144A63D-652C-4CCF-A9EE-8E5A091547F1/System.Numerics.dll.REMOVED.git-id delete mode 100644 mcs/class/lib/monolite-win32/A144A63D-652C-4CCF-A9EE-8E5A091547F1/System.Xml.dll.REMOVED.git-id delete mode 100644 mcs/class/lib/monolite-win32/A144A63D-652C-4CCF-A9EE-8E5A091547F1/System.dll.REMOVED.git-id delete mode 100644 mcs/class/lib/monolite-win32/A144A63D-652C-4CCF-A9EE-8E5A091547F1/mcs.exe.REMOVED.git-id delete mode 100644 mcs/class/lib/monolite-win32/A144A63D-652C-4CCF-A9EE-8E5A091547F1/mscorlib.dll.REMOVED.git-id rename mcs/class/lib/monolite-win32/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/Facades/System.Collections.Concurrent.dll (100%) rename mcs/class/lib/monolite-win32/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/Facades/System.Collections.dll (100%) rename mcs/class/lib/monolite-win32/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/Facades/System.Diagnostics.Debug.dll (100%) rename mcs/class/lib/monolite-win32/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/Facades/System.Diagnostics.FileVersionInfo.dll (100%) rename mcs/class/lib/monolite-win32/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/Facades/System.Diagnostics.Tools.dll (100%) rename mcs/class/lib/monolite-win32/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/Facades/System.Dynamic.Runtime.dll (100%) rename mcs/class/lib/monolite-win32/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/Facades/System.Globalization.dll (100%) rename mcs/class/lib/monolite-win32/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/Facades/System.IO.FileSystem.Primitives.dll (100%) rename mcs/class/lib/monolite-win32/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/Facades/System.IO.FileSystem.dll (100%) rename mcs/class/lib/monolite-win32/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/Facades/System.IO.dll (100%) rename mcs/class/lib/monolite-win32/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/Facades/System.Linq.Expressions.dll (100%) rename mcs/class/lib/monolite-win32/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/Facades/System.Linq.dll (100%) rename mcs/class/lib/monolite-win32/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/Facades/System.Reflection.Extensions.dll (100%) rename mcs/class/lib/monolite-win32/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/Facades/System.Reflection.Primitives.dll (100%) rename mcs/class/lib/monolite-win32/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/Facades/System.Reflection.dll (100%) rename mcs/class/lib/monolite-win32/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/Facades/System.Resources.ResourceManager.dll (100%) rename mcs/class/lib/monolite-win32/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/Facades/System.Runtime.Extensions.dll (100%) rename mcs/class/lib/monolite-win32/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/Facades/System.Runtime.InteropServices.dll (100%) rename mcs/class/lib/monolite-win32/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/Facades/System.Runtime.Numerics.dll (100%) rename mcs/class/lib/monolite-win32/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/Facades/System.Runtime.dll (100%) rename mcs/class/lib/monolite-win32/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/Facades/System.Security.Cryptography.Algorithms.dll (100%) rename mcs/class/lib/monolite-win32/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/Facades/System.Security.Cryptography.Primitives.dll (100%) rename mcs/class/lib/monolite-win32/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/Facades/System.Text.Encoding.CodePages.dll (100%) rename mcs/class/lib/monolite-win32/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/Facades/System.Text.Encoding.Extensions.dll (100%) rename mcs/class/lib/monolite-win32/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/Facades/System.Text.Encoding.dll (100%) rename mcs/class/lib/monolite-win32/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/Facades/System.Threading.Tasks.Parallel.dll (100%) rename mcs/class/lib/monolite-win32/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/Facades/System.Threading.Tasks.dll (100%) rename mcs/class/lib/monolite-win32/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/Facades/System.Threading.dll (100%) rename mcs/class/lib/monolite-win32/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/Facades/System.ValueTuple.dll (100%) rename mcs/class/lib/monolite-win32/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/Facades/System.Xml.ReaderWriter.dll (100%) rename mcs/class/lib/monolite-win32/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/Facades/System.Xml.XDocument.dll (100%) create mode 100644 mcs/class/lib/monolite-win32/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/netstandard.dll.REMOVED.git-id create mode 100644 mcs/class/lib/monolite-win32/ABB721D6-116A-4555-B4FD-9248146D2051/Mono.Cecil.dll.REMOVED.git-id create mode 100644 mcs/class/lib/monolite-win32/ABB721D6-116A-4555-B4FD-9248146D2051/Mono.Security.dll.REMOVED.git-id create mode 100644 mcs/class/lib/monolite-win32/ABB721D6-116A-4555-B4FD-9248146D2051/System.Configuration.dll.REMOVED.git-id create mode 100644 mcs/class/lib/monolite-win32/ABB721D6-116A-4555-B4FD-9248146D2051/System.Core.dll.REMOVED.git-id create mode 100644 mcs/class/lib/monolite-win32/ABB721D6-116A-4555-B4FD-9248146D2051/System.IO.Compression.dll.REMOVED.git-id create mode 100644 mcs/class/lib/monolite-win32/ABB721D6-116A-4555-B4FD-9248146D2051/System.Numerics.dll.REMOVED.git-id rename mcs/class/lib/monolite-win32/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/System.Security.dll.REMOVED.git-id (100%) rename mcs/class/lib/monolite-win32/{A144A63D-652C-4CCF-A9EE-8E5A091547F1 => ABB721D6-116A-4555-B4FD-9248146D2051}/System.Xml.Linq.dll.REMOVED.git-id (100%) create mode 100644 mcs/class/lib/monolite-win32/ABB721D6-116A-4555-B4FD-9248146D2051/System.Xml.dll.REMOVED.git-id create mode 100644 mcs/class/lib/monolite-win32/ABB721D6-116A-4555-B4FD-9248146D2051/System.dll.REMOVED.git-id create mode 100644 mcs/class/lib/monolite-win32/ABB721D6-116A-4555-B4FD-9248146D2051/mcs.exe.REMOVED.git-id create mode 100644 mcs/class/lib/monolite-win32/ABB721D6-116A-4555-B4FD-9248146D2051/mscorlib.dll.REMOVED.git-id delete mode 100644 mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.4.0/Microsoft.Build.Tasks.CodeAnalysis.dll.REMOVED.git-id delete mode 100644 mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.4.0/Microsoft.CodeAnalysis.CSharp.dll.REMOVED.git-id delete mode 100644 mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.4.0/Microsoft.CodeAnalysis.Scripting.dll.REMOVED.git-id delete mode 100644 mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.4.0/Microsoft.CodeAnalysis.VisualBasic.dll.REMOVED.git-id delete mode 100644 mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.4.0/Microsoft.CodeAnalysis.dll.REMOVED.git-id delete mode 100644 mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.4.0/Microsoft.Managed.EditorConfig.targets create mode 100644 mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/Microsoft.Build.Tasks.CodeAnalysis.dll.REMOVED.git-id create mode 100644 mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/Microsoft.CSharp.Core.targets create mode 100644 mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/Microsoft.CodeAnalysis.CSharp.Scripting.dll create mode 100644 mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/Microsoft.CodeAnalysis.CSharp.dll.REMOVED.git-id create mode 100644 mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/Microsoft.CodeAnalysis.Scripting.dll.REMOVED.git-id create mode 100644 mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/Microsoft.CodeAnalysis.VisualBasic.dll.REMOVED.git-id create mode 100644 mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/Microsoft.CodeAnalysis.dll.REMOVED.git-id create mode 100644 mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/Microsoft.Managed.Core.targets create mode 100644 mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/Microsoft.VisualBasic.Core.targets create mode 100644 mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/System.Collections.Immutable.dll.REMOVED.git-id create mode 100644 mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/System.Memory.dll.REMOVED.git-id create mode 100644 mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/System.Reflection.Metadata.dll.REMOVED.git-id create mode 100644 mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/System.Runtime.CompilerServices.Unsafe.dll create mode 100644 mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/System.Threading.Tasks.Extensions.dll create mode 100644 mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/VBCSCompiler.exe create mode 100644 mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/VBCSCompiler.exe.config create mode 100644 mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/csc.exe create mode 100644 mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/csc.exe.config create mode 100644 mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/csc.rsp create mode 100644 mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/csi.exe create mode 100644 mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/csi.exe.config create mode 100644 mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/csi.rsp create mode 100644 mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/vbc.exe create mode 100644 mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/vbc.exe.config create mode 100644 mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/vbc.rsp delete mode 100644 mono/metadata/appdomain.c create mode 100644 mono/metadata/appdomain.c.REMOVED.git-id delete mode 100644 mono/metadata/mono-route.h create mode 100644 mono/metadata/threadpool-netcore.c create mode 100644 mono/mini/simd-intrinsics-netcore.c create mode 100644 mono/mini/simd-methods-netcore.h create mode 100644 mono/profiler/proftest-pinvokes.c create mode 100644 mono/profiler/test-pinvokes.cs create mode 100644 mono/tests/dim-generic.cs create mode 100644 mono/unit-tests/test-embed-invoke.c create mode 100644 mono/unit-tests/test-mono-embed.c create mode 100644 msvc/monow.vcxproj create mode 100644 netcore/Makefile create mode 100644 netcore/corerun/Makefile.am create mode 100644 netcore/corerun/Makefile.in create mode 100644 netcore/corerun/coreclrhost.h create mode 100644 netcore/corerun/corerun.cpp create mode 100644 netcore/corerun/coreruncommon.cpp create mode 100644 netcore/corerun/coreruncommon.h diff --git a/Makefile.am b/Makefile.am index 93b7fa53ad..816a2b4e58 100644 --- a/Makefile.am +++ b/Makefile.am @@ -21,14 +21,14 @@ endif if ENABLE_NETCORE update_submodules = -SUBDIRS = mk llvm mono runtime netcore +SUBDIRS = mk llvm mono runtime netcore netcore/corerun else update_submodules = update_submodules SUBDIRS = $(build_with_msvc) mk po $(libgc_dir) llvm mono $(ikvm_native_dir) support data runtime scripts man samples $(tools_dir) $(build_without_msvc) $(docs_dir) acceptance-tests endif # Keep in sync with SUBDIRS -DIST_SUBDIRS = $(build_with_msvc) m4 mk po $(libgc_dir) llvm mono ikvm-native support data runtime scripts man samples tools $(build_without_msvc) docs acceptance-tests netcore +DIST_SUBDIRS = $(build_with_msvc) m4 mk po $(libgc_dir) llvm mono ikvm-native support data runtime scripts man samples tools $(build_without_msvc) docs acceptance-tests netcore netcore/corerun all: $(update_submodules) @@ -46,9 +46,10 @@ EXTRA_DIST= \ winconfig.h \ code_of_conduct.md \ external \ + netcore/Makefile \ mcs/class/referencesource -DISTCHECK_CONFIGURE_FLAGS = EXTERNAL_MCS=false EXTERNAL_RUNTIME=false +DISTCHECK_CONFIGURE_FLAGS = EXTERNAL_RUNTIME=false # Distribute the 'mcs' tree too GIT_DIR ?= $(srcdir)/.git diff --git a/Makefile.in b/Makefile.in index 8acc9fa26a..deb56b5438 100644 --- a/Makefile.in +++ b/Makefile.in @@ -301,6 +301,7 @@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTERP_CFLAGS = @INTERP_CFLAGS@ INTL = @INTL@ INVARIANT_AOT_OPTIONS = @INVARIANT_AOT_OPTIONS@ JEMALLOC_AUTOCONF_FLAGS = @JEMALLOC_AUTOCONF_FLAGS@ @@ -503,10 +504,10 @@ MONOTOUCH_SUBDIRS = $(libgc_dir) mono @ENABLE_NETCORE_FALSE@update_submodules = update_submodules @ENABLE_NETCORE_TRUE@update_submodules = @ENABLE_NETCORE_FALSE@SUBDIRS = $(build_with_msvc) mk po $(libgc_dir) llvm mono $(ikvm_native_dir) support data runtime scripts man samples $(tools_dir) $(build_without_msvc) $(docs_dir) acceptance-tests -@ENABLE_NETCORE_TRUE@SUBDIRS = mk llvm mono runtime netcore +@ENABLE_NETCORE_TRUE@SUBDIRS = mk llvm mono runtime netcore netcore/corerun # Keep in sync with SUBDIRS -DIST_SUBDIRS = $(build_with_msvc) m4 mk po $(libgc_dir) llvm mono ikvm-native support data runtime scripts man samples tools $(build_without_msvc) docs acceptance-tests netcore +DIST_SUBDIRS = $(build_with_msvc) m4 mk po $(libgc_dir) llvm mono ikvm-native support data runtime scripts man samples tools $(build_without_msvc) docs acceptance-tests netcore netcore/corerun EXTRA_DIST = \ README.md \ LICENSE \ @@ -516,9 +517,10 @@ EXTRA_DIST = \ winconfig.h \ code_of_conduct.md \ external \ + netcore/Makefile \ mcs/class/referencesource -DISTCHECK_CONFIGURE_FLAGS = EXTERNAL_MCS=false EXTERNAL_RUNTIME=false +DISTCHECK_CONFIGURE_FLAGS = EXTERNAL_RUNTIME=false pkgconfigdir = $(libdir)/pkgconfig noinst_DATA = mono-uninstalled.pc DISTCLEANFILES = mono-uninstalled.pc diff --git a/acceptance-tests/Makefile.in.REMOVED.git-id b/acceptance-tests/Makefile.in.REMOVED.git-id index 3c4ee217ed..c14476ea8f 100644 --- a/acceptance-tests/Makefile.in.REMOVED.git-id +++ b/acceptance-tests/Makefile.in.REMOVED.git-id @@ -1 +1 @@ -472b93a07fd7c07ed8c5b43beb68961486a1f729 \ No newline at end of file +930a27e684805f373e65684b696c1512bf0f1a15 \ No newline at end of file diff --git a/config.h.in b/config.h.in index b786da8f21..2ab91c8098 100644 --- a/config.h.in +++ b/config.h.in @@ -620,6 +620,9 @@ /* Have large file support */ #undef HAVE_LARGE_FILE_SUPPORT +/* lchflags */ +#undef HAVE_LCHFLAGS + /* Define to 1 if you have the `iconv' library (-liconv). */ #undef HAVE_LIBICONV @@ -975,6 +978,9 @@ /* struct stat.st_birthtimespec */ #undef HAVE_STAT_BIRTHTIME +/* struct stat.st_flags */ +#undef HAVE_STAT_FLAGS + /* struct stat.st_atimensec */ #undef HAVE_STAT_NSEC diff --git a/configure.REMOVED.git-id b/configure.REMOVED.git-id index d9094874e5..dadb5cc8cb 100644 --- a/configure.REMOVED.git-id +++ b/configure.REMOVED.git-id @@ -1 +1 @@ -30bc3192fe7c329d0c0e0ce80f458d396d8bbe69 \ No newline at end of file +b8ba159bbd60b12015a3c0ea74f7436213e62335 \ No newline at end of file diff --git a/configure.ac.REMOVED.git-id b/configure.ac.REMOVED.git-id index 4fe6a5f7d5..f5a8683e49 100644 --- a/configure.ac.REMOVED.git-id +++ b/configure.ac.REMOVED.git-id @@ -1 +1 @@ -1b5c1decda620ceb7c24a9921ab6459634cf4bae \ No newline at end of file +612e6f088c12dc8b2912628d2cfa6e5dcbe28a40 \ No newline at end of file diff --git a/data/Makefile.in b/data/Makefile.in index eeb9809418..a1e24fcf35 100644 --- a/data/Makefile.in +++ b/data/Makefile.in @@ -323,6 +323,7 @@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTERP_CFLAGS = @INTERP_CFLAGS@ INTL = @INTL@ INVARIANT_AOT_OPTIONS = @INVARIANT_AOT_OPTIONS@ JEMALLOC_AUTOCONF_FLAGS = @JEMALLOC_AUTOCONF_FLAGS@ diff --git a/data/net_2_0/Browsers/Makefile.in b/data/net_2_0/Browsers/Makefile.in index 901c7e9d5a..7ed6b6bfdc 100644 --- a/data/net_2_0/Browsers/Makefile.in +++ b/data/net_2_0/Browsers/Makefile.in @@ -244,6 +244,7 @@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTERP_CFLAGS = @INTERP_CFLAGS@ INTL = @INTL@ INVARIANT_AOT_OPTIONS = @INVARIANT_AOT_OPTIONS@ JEMALLOC_AUTOCONF_FLAGS = @JEMALLOC_AUTOCONF_FLAGS@ diff --git a/data/net_2_0/Makefile.in b/data/net_2_0/Makefile.in index 82721b218d..892fe1c0e7 100644 --- a/data/net_2_0/Makefile.in +++ b/data/net_2_0/Makefile.in @@ -304,6 +304,7 @@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTERP_CFLAGS = @INTERP_CFLAGS@ INTL = @INTL@ INVARIANT_AOT_OPTIONS = @INVARIANT_AOT_OPTIONS@ JEMALLOC_AUTOCONF_FLAGS = @JEMALLOC_AUTOCONF_FLAGS@ diff --git a/data/net_4_0/Browsers/Makefile.in b/data/net_4_0/Browsers/Makefile.in index d117197164..47e9b40bfc 100644 --- a/data/net_4_0/Browsers/Makefile.in +++ b/data/net_4_0/Browsers/Makefile.in @@ -244,6 +244,7 @@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTERP_CFLAGS = @INTERP_CFLAGS@ INTL = @INTL@ INVARIANT_AOT_OPTIONS = @INVARIANT_AOT_OPTIONS@ JEMALLOC_AUTOCONF_FLAGS = @JEMALLOC_AUTOCONF_FLAGS@ diff --git a/data/net_4_0/Makefile.in b/data/net_4_0/Makefile.in index b5f3e8ce4a..d8dc33c6fe 100644 --- a/data/net_4_0/Makefile.in +++ b/data/net_4_0/Makefile.in @@ -304,6 +304,7 @@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTERP_CFLAGS = @INTERP_CFLAGS@ INTL = @INTL@ INVARIANT_AOT_OPTIONS = @INVARIANT_AOT_OPTIONS@ JEMALLOC_AUTOCONF_FLAGS = @JEMALLOC_AUTOCONF_FLAGS@ diff --git a/data/net_4_5/Browsers/Makefile.in b/data/net_4_5/Browsers/Makefile.in index 3b95dc52a6..3a52dcb7d6 100644 --- a/data/net_4_5/Browsers/Makefile.in +++ b/data/net_4_5/Browsers/Makefile.in @@ -244,6 +244,7 @@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTERP_CFLAGS = @INTERP_CFLAGS@ INTL = @INTL@ INVARIANT_AOT_OPTIONS = @INVARIANT_AOT_OPTIONS@ JEMALLOC_AUTOCONF_FLAGS = @JEMALLOC_AUTOCONF_FLAGS@ diff --git a/data/net_4_5/Makefile.in b/data/net_4_5/Makefile.in index 46f7788b35..7ea14a5380 100644 --- a/data/net_4_5/Makefile.in +++ b/data/net_4_5/Makefile.in @@ -304,6 +304,7 @@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTERP_CFLAGS = @INTERP_CFLAGS@ INTL = @INTL@ INVARIANT_AOT_OPTIONS = @INVARIANT_AOT_OPTIONS@ JEMALLOC_AUTOCONF_FLAGS = @JEMALLOC_AUTOCONF_FLAGS@ diff --git a/docs/Makefile.in b/docs/Makefile.in index 81c40df41a..a4c88f0bf9 100644 --- a/docs/Makefile.in +++ b/docs/Makefile.in @@ -245,6 +245,7 @@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTERP_CFLAGS = @INTERP_CFLAGS@ INTL = @INTL@ INVARIANT_AOT_OPTIONS = @INVARIANT_AOT_OPTIONS@ JEMALLOC_AUTOCONF_FLAGS = @JEMALLOC_AUTOCONF_FLAGS@ diff --git a/docs/deploy/mono-api-gc.html b/docs/deploy/mono-api-gc.html index be6f26b7a0..a16dffeab2 100644 --- a/docs/deploy/mono-api-gc.html +++ b/docs/deploy/mono-api-gc.html @@ -621,6 +621,12 @@ mono_gc_wait_for_bridge_processing (void)

Write Barriers

+

SGen is a concurrent and generational GC, features which require + tracking changes to the state of the heap. This is achieved through + write barriers. Whenever native code is changing the state of the + heap by storing references into another managed object, it needs to + do it using this write barrier API. + @@ -632,8 +638,16 @@ mono_gc_wait_for_bridge_processing (void)

Syntax
-
mono_gc_wbarrier_arrayref_copy
+
void +mono_gc_wbarrier_arrayref_copy (void* dest_ptr, /*const*/ void* src_ptr, int count) + +

+

Parameters
+
dest_ptr destination slot address
src_ptr source slot address
count number of references to copy
Description
+
+ Copies count references from one array to another, executing a write + barrier if needed.
@@ -647,8 +661,15 @@ mono_gc_wait_for_bridge_processing (void)
Syntax
-
mono_gc_wbarrier_generic_nostore
+
void +mono_gc_wbarrier_generic_nostore (void* ptr) + +

+

Description
+
+ Executes a write barrier for an address, informing the GC that + the reference stored at that address has been changed.
@@ -667,6 +688,11 @@ mono_gc_wbarrier_generic_store (void* ptr, MonoObject* value)

+

Parameters
+
ptr address of field
obj object to store
Description
+
+ Stores the value object inside the field represented by ptr, + executing a write barrier if needed.
@@ -680,8 +706,15 @@ mono_gc_wbarrier_generic_store (void* ptr, MonoObject* value)
Syntax
-
mono_gc_wbarrier_generic_store_atomic
+
void +mono_gc_wbarrier_generic_store_atomic (void *ptr, MonoObject *value) + +

+

Description
+
+ Same as mono_gc_wbarrier_generic_store but performs the store + as an atomic operation with release semantics.
@@ -700,10 +733,11 @@ mono_gc_wbarrier_object_copy (MonoObject* obj, MonoObject *src)

-

Description
+
Parameters
+
obj destination object
src source object
Description
-

- Write barrier to call when obj is the result of a clone or copy of an object.

+ Copies contents of src to obj, executing any necessary write + barriers. @@ -722,6 +756,11 @@ mono_gc_wbarrier_set_arrayref (MonoArray *arr, void* slot_ptr, MonoObject* value

+

Parameters
+
arr array containing the destination slot
slot_ptr address of slot inside the array
value reference to the object to be stored
Description
+
+ Stores an object reference inside an array of objects, executing a write + barrier if needed.
@@ -740,5 +779,10 @@ mono_gc_wbarrier_set_field (MonoObject *obj, void* field_ptr, MonoObject* value)

+

Parameters
+
obj object containing the destination field
field_ptr address of field inside the object
value reference to the object to be stored
Description
+
+ Stores an object reference inside another object, executing a write barrier + if needed.
diff --git a/docs/deploy/mono-api-object.html b/docs/deploy/mono-api-object.html index ce198eb5c6..66c21320e8 100644 --- a/docs/deploy/mono-api-object.html +++ b/docs/deploy/mono-api-object.html @@ -959,9 +959,12 @@ mono_array_length (MonoArray *array)
with elements of size sizeof(type) to the provided value.

- This macro does not attempt to perform type checking or bounds checking. + This macro does not attempt to perform type checking or bounds checking + and it doesn't execute any write barriers.

- Use this to set value types in a MonoArray.

+ Use this to set value types in a MonoArray. This shouldn't be used if + the copied value types contain references. Use mono_gc_wbarrier_value_copy + instead when also copying references. diff --git a/docs/deploy/mono-api-reflection.html b/docs/deploy/mono-api-reflection.html index 8c4c5e34b5..f2953815ae 100644 --- a/docs/deploy/mono-api-reflection.html +++ b/docs/deploy/mono-api-reflection.html @@ -267,7 +267,7 @@ mono_reflection_free_type_info (MonoTypeNameParse *info)
Syntax
MonoArray* -mono_reflection_get_custom_attrs_blob (MonoReflectionAssembly *assembly, MonoObject *ctor, MonoArray *ctorArgs, MonoArray *properties, MonoArray *propValues, MonoArray *fields, MonoArray* fieldValues) +mono_reflection_get_custom_attrs_blob (MonoReflectionAssembly *assembly, MonoObject *ctor, MonoArray *ctorArgs, MonoArray *properties, MonoArray *propValues, MonoArray *fields, MonoArray* fieldValues)

diff --git a/docs/deploy/mono-api-threads.html b/docs/deploy/mono-api-threads.html index fad7f8935d..2df8a33d49 100644 --- a/docs/deploy/mono-api-threads.html +++ b/docs/deploy/mono-api-threads.html @@ -377,6 +377,9 @@ mono_thread_manage (void)

+

Description
+
+

diff --git a/docs/deploy/mono-api-unsorted.html b/docs/deploy/mono-api-unsorted.html index 2636f26daf..254ec88b17 100644 --- a/docs/deploy/mono-api-unsorted.html +++ b/docs/deploy/mono-api-unsorted.html @@ -740,7 +740,7 @@ mono_runtime_object_init (MonoObject *this_obj)
Syntax
void -mono_runtime_quit () +mono_runtime_quit (void)

diff --git a/docs/sources/mono-api-gc.html b/docs/sources/mono-api-gc.html index cddef0364c..be5837eedc 100644 --- a/docs/sources/mono-api-gc.html +++ b/docs/sources/mono-api-gc.html @@ -109,6 +109,12 @@ typedef struct {

Write Barriers

+

SGen is a concurrent and generational GC, features which require + tracking changes to the state of the heap. This is achieved through + write barriers. Whenever native code is changing the state of the + heap by storing references into another managed object, it needs to + do it using this write barrier API. +

mono_gc_wbarrier_arrayref_copy

mono_gc_wbarrier_generic_nostore

mono_gc_wbarrier_generic_store

diff --git a/external/api-snapshot/profiles/monodroid/Mono.Posix.cs.REMOVED.git-id b/external/api-snapshot/profiles/monodroid/Mono.Posix.cs.REMOVED.git-id index d69b2945e4..976a6a4daa 100644 --- a/external/api-snapshot/profiles/monodroid/Mono.Posix.cs.REMOVED.git-id +++ b/external/api-snapshot/profiles/monodroid/Mono.Posix.cs.REMOVED.git-id @@ -1 +1 @@ -675faa3a855f9b309b9764157c4f30f3a2eef014 \ No newline at end of file +23a53f6a657256c50759b9c4f4b3f27827d21a79 \ No newline at end of file diff --git a/external/api-snapshot/profiles/monodroid/Mono.Security.cs.REMOVED.git-id b/external/api-snapshot/profiles/monodroid/Mono.Security.cs.REMOVED.git-id index a79307e232..c26c4c169b 100644 --- a/external/api-snapshot/profiles/monodroid/Mono.Security.cs.REMOVED.git-id +++ b/external/api-snapshot/profiles/monodroid/Mono.Security.cs.REMOVED.git-id @@ -1 +1 @@ -072b075c7d65a7754b26747e60ce1daab71dc0c1 \ No newline at end of file +ee94acf7f8f15010d1417f44b9131319ac821155 \ No newline at end of file diff --git a/external/api-snapshot/profiles/monodroid/System.cs.REMOVED.git-id b/external/api-snapshot/profiles/monodroid/System.cs.REMOVED.git-id index 02514d45e1..59c7712756 100644 --- a/external/api-snapshot/profiles/monodroid/System.cs.REMOVED.git-id +++ b/external/api-snapshot/profiles/monodroid/System.cs.REMOVED.git-id @@ -1 +1 @@ -8de80e92b25690f3c330c1a77f4211e145e371ce \ No newline at end of file +3e8933930502d0d8ded2c9654341153068d92d73 \ No newline at end of file diff --git a/external/api-snapshot/profiles/monodroid/mscorlib.cs.REMOVED.git-id b/external/api-snapshot/profiles/monodroid/mscorlib.cs.REMOVED.git-id index be78f03b62..0d02ab47cc 100644 --- a/external/api-snapshot/profiles/monodroid/mscorlib.cs.REMOVED.git-id +++ b/external/api-snapshot/profiles/monodroid/mscorlib.cs.REMOVED.git-id @@ -1 +1 @@ -4eab3daf447a9db125e2b7d24282b35b14aa7f64 \ No newline at end of file +68d28c31b98019e06fa4ba81b96365aad2004da1 \ No newline at end of file diff --git a/external/api-snapshot/profiles/monotouch/Mono.Security.cs.REMOVED.git-id b/external/api-snapshot/profiles/monotouch/Mono.Security.cs.REMOVED.git-id index 5a24def022..eeb4a4d33f 100644 --- a/external/api-snapshot/profiles/monotouch/Mono.Security.cs.REMOVED.git-id +++ b/external/api-snapshot/profiles/monotouch/Mono.Security.cs.REMOVED.git-id @@ -1 +1 @@ -6b337acd79c5f1288e336dd395d2b0508a4b167e \ No newline at end of file +b0e3f98db76152ae1cf353af732450926d11f876 \ No newline at end of file diff --git a/external/api-snapshot/profiles/monotouch/System.Net.Http.cs b/external/api-snapshot/profiles/monotouch/System.Net.Http.cs index b56a900918..b6feeae5c6 100644 --- a/external/api-snapshot/profiles/monotouch/System.Net.Http.cs +++ b/external/api-snapshot/profiles/monotouch/System.Net.Http.cs @@ -30,7 +30,7 @@ namespace System.Net.Http public ByteArrayContent(byte[] content) { } public ByteArrayContent(byte[] content, int offset, int count) { } protected override System.Threading.Tasks.Task CreateContentReadStreamAsync() { throw null; } - protected internal override System.Threading.Tasks.Task SerializeToStreamAsync(System.IO.Stream stream, System.Net.TransportContext context) { throw null; } + protected override System.Threading.Tasks.Task SerializeToStreamAsync(System.IO.Stream stream, System.Net.TransportContext context) { throw null; } protected internal override bool TryComputeLength(out long length) { throw null; } } public enum ClientCertificateOption @@ -145,7 +145,7 @@ namespace System.Net.Http public System.Threading.Tasks.Task ReadAsByteArrayAsync() { throw null; } public System.Threading.Tasks.Task ReadAsStreamAsync() { throw null; } public System.Threading.Tasks.Task ReadAsStringAsync() { throw null; } - protected internal abstract System.Threading.Tasks.Task SerializeToStreamAsync(System.IO.Stream stream, System.Net.TransportContext context); + protected abstract System.Threading.Tasks.Task SerializeToStreamAsync(System.IO.Stream stream, System.Net.TransportContext context); protected internal abstract bool TryComputeLength(out long length); } public abstract partial class HttpMessageHandler : System.IDisposable @@ -235,9 +235,10 @@ namespace System.Net.Http public MultipartContent(string subtype) { } public MultipartContent(string subtype, string boundary) { } public virtual void Add(System.Net.Http.HttpContent content) { } + protected override System.Threading.Tasks.Task CreateContentReadStreamAsync() { throw null; } protected override void Dispose(bool disposing) { } public System.Collections.Generic.IEnumerator GetEnumerator() { throw null; } - protected internal override System.Threading.Tasks.Task SerializeToStreamAsync(System.IO.Stream stream, System.Net.TransportContext context) { throw null; } + protected override System.Threading.Tasks.Task SerializeToStreamAsync(System.IO.Stream stream, System.Net.TransportContext context) { throw null; } System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } protected internal override bool TryComputeLength(out long length) { throw null; } } @@ -252,16 +253,43 @@ namespace System.Net.Http public sealed partial class ReadOnlyMemoryContent : System.Net.Http.HttpContent { public ReadOnlyMemoryContent(System.ReadOnlyMemory content) { } - protected internal override System.Threading.Tasks.Task SerializeToStreamAsync(System.IO.Stream stream, System.Net.TransportContext context) { throw null; } + protected override System.Threading.Tasks.Task CreateContentReadStreamAsync() { throw null; } + protected override System.Threading.Tasks.Task SerializeToStreamAsync(System.IO.Stream stream, System.Net.TransportContext context) { throw null; } protected internal override bool TryComputeLength(out long length) { throw null; } } + public sealed partial class SocketsHttpHandler : System.Net.Http.HttpMessageHandler, System.IDisposable + { + public SocketsHttpHandler() { } + public bool AllowAutoRedirect { get { throw null; } set { } } + public System.Net.DecompressionMethods AutomaticDecompression { get { throw null; } set { } } + public System.TimeSpan ConnectTimeout { get { throw null; } set { } } + public System.Net.CookieContainer CookieContainer { get { throw null; } set { } } + public System.Net.ICredentials Credentials { get { throw null; } set { } } + public System.Net.ICredentials DefaultProxyCredentials { get { throw null; } set { } } + public System.TimeSpan Expect100ContinueTimeout { get { throw null; } set { } } + public int MaxAutomaticRedirections { get { throw null; } set { } } + public int MaxConnectionsPerServer { get { throw null; } set { } } + public int MaxResponseDrainSize { get { throw null; } set { } } + public int MaxResponseHeadersLength { get { throw null; } set { } } + public System.TimeSpan PooledConnectionIdleTimeout { get { throw null; } set { } } + public System.TimeSpan PooledConnectionLifetime { get { throw null; } set { } } + public bool PreAuthenticate { get { throw null; } set { } } + public System.Collections.Generic.IDictionary Properties { get { throw null; } } + public System.Net.IWebProxy Proxy { get { throw null; } set { } } + public System.TimeSpan ResponseDrainTimeout { get { throw null; } set { } } + public System.Net.Security.SslClientAuthenticationOptions SslOptions { get { throw null; } set { } } + public bool UseCookies { get { throw null; } set { } } + public bool UseProxy { get { throw null; } set { } } + protected override void Dispose(bool disposing) { } + protected internal override System.Threading.Tasks.Task SendAsync(System.Net.Http.HttpRequestMessage request, System.Threading.CancellationToken cancellationToken) { throw null; } + } public partial class StreamContent : System.Net.Http.HttpContent { public StreamContent(System.IO.Stream content) { } public StreamContent(System.IO.Stream content, int bufferSize) { } protected override System.Threading.Tasks.Task CreateContentReadStreamAsync() { throw null; } protected override void Dispose(bool disposing) { } - protected internal override System.Threading.Tasks.Task SerializeToStreamAsync(System.IO.Stream stream, System.Net.TransportContext context) { throw null; } + protected override System.Threading.Tasks.Task SerializeToStreamAsync(System.IO.Stream stream, System.Net.TransportContext context) { throw null; } protected internal override bool TryComputeLength(out long length) { throw null; } } public partial class StringContent : System.Net.Http.ByteArrayContent @@ -484,17 +512,18 @@ namespace System.Net.Http.Headers public override string ToString() { throw null; } public static bool TryParse(string input, out System.Net.Http.Headers.MediaTypeHeaderValue parsedValue) { throw null; } } - public sealed partial class MediaTypeWithQualityHeaderValue : System.Net.Http.Headers.MediaTypeHeaderValue + public sealed partial class MediaTypeWithQualityHeaderValue : System.Net.Http.Headers.MediaTypeHeaderValue, System.ICloneable { - public MediaTypeWithQualityHeaderValue(string mediaType) : base (default(string)) { } - public MediaTypeWithQualityHeaderValue(string mediaType, double quality) : base (default(string)) { } + public MediaTypeWithQualityHeaderValue(string mediaType) : base (default(System.Net.Http.Headers.MediaTypeHeaderValue)) { } + public MediaTypeWithQualityHeaderValue(string mediaType, double quality) : base (default(System.Net.Http.Headers.MediaTypeHeaderValue)) { } public System.Nullable Quality { get { throw null; } set { } } public static new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue Parse(string input) { throw null; } + object System.ICloneable.Clone() { throw null; } public static bool TryParse(string input, out System.Net.Http.Headers.MediaTypeWithQualityHeaderValue parsedValue) { throw null; } } public partial class NameValueHeaderValue : System.ICloneable { - protected internal NameValueHeaderValue(System.Net.Http.Headers.NameValueHeaderValue source) { } + protected NameValueHeaderValue(System.Net.Http.Headers.NameValueHeaderValue source) { } public NameValueHeaderValue(string name) { } public NameValueHeaderValue(string name, string value) { } public string Name { get { throw null; } } @@ -622,12 +651,13 @@ namespace System.Net.Http.Headers public override string ToString() { throw null; } public static bool TryParse(string input, out System.Net.Http.Headers.TransferCodingHeaderValue parsedValue) { throw null; } } - public sealed partial class TransferCodingWithQualityHeaderValue : System.Net.Http.Headers.TransferCodingHeaderValue + public sealed partial class TransferCodingWithQualityHeaderValue : System.Net.Http.Headers.TransferCodingHeaderValue, System.ICloneable { - public TransferCodingWithQualityHeaderValue(string value) : base (default(string)) { } - public TransferCodingWithQualityHeaderValue(string value, double quality) : base (default(string)) { } + public TransferCodingWithQualityHeaderValue(string value) : base (default(System.Net.Http.Headers.TransferCodingHeaderValue)) { } + public TransferCodingWithQualityHeaderValue(string value, double quality) : base (default(System.Net.Http.Headers.TransferCodingHeaderValue)) { } public System.Nullable Quality { get { throw null; } set { } } public static new System.Net.Http.Headers.TransferCodingWithQualityHeaderValue Parse(string input) { throw null; } + object System.ICloneable.Clone() { throw null; } public static bool TryParse(string input, out System.Net.Http.Headers.TransferCodingWithQualityHeaderValue parsedValue) { throw null; } } public partial class ViaHeaderValue : System.ICloneable diff --git a/external/api-snapshot/profiles/monotouch/System.cs.REMOVED.git-id b/external/api-snapshot/profiles/monotouch/System.cs.REMOVED.git-id index 9f7c5de575..1a3d088996 100644 --- a/external/api-snapshot/profiles/monotouch/System.cs.REMOVED.git-id +++ b/external/api-snapshot/profiles/monotouch/System.cs.REMOVED.git-id @@ -1 +1 @@ -a5b17251bf1b4f417ac562f2e9c98d4073d0ff5b \ No newline at end of file +ed1414ca828ee9519a6607ede29370c74a68f69b \ No newline at end of file diff --git a/external/api-snapshot/profiles/monotouch/mscorlib.cs.REMOVED.git-id b/external/api-snapshot/profiles/monotouch/mscorlib.cs.REMOVED.git-id index f24f4f7eec..6827879741 100644 --- a/external/api-snapshot/profiles/monotouch/mscorlib.cs.REMOVED.git-id +++ b/external/api-snapshot/profiles/monotouch/mscorlib.cs.REMOVED.git-id @@ -1 +1 @@ -90d02a101ed04da6a18a169ddf1ec2799c16fcdf \ No newline at end of file +3d86cbc178ecc58c1640325d9c50613a8db0a299 \ No newline at end of file diff --git a/external/api-snapshot/profiles/net_4_x/Mono.Cecil.cs.REMOVED.git-id b/external/api-snapshot/profiles/net_4_x/Mono.Cecil.cs.REMOVED.git-id index 4d4632683f..9187b400da 100644 --- a/external/api-snapshot/profiles/net_4_x/Mono.Cecil.cs.REMOVED.git-id +++ b/external/api-snapshot/profiles/net_4_x/Mono.Cecil.cs.REMOVED.git-id @@ -1 +1 @@ -e1f35668ff12c7719a94dbad1f42fe4317d3f553 \ No newline at end of file +7d65de02df2ecf34d5528debc47da5e04ca08c3c \ No newline at end of file diff --git a/external/api-snapshot/profiles/net_4_x/Mono.Posix.cs.REMOVED.git-id b/external/api-snapshot/profiles/net_4_x/Mono.Posix.cs.REMOVED.git-id index 86a1099081..69d07a1379 100644 --- a/external/api-snapshot/profiles/net_4_x/Mono.Posix.cs.REMOVED.git-id +++ b/external/api-snapshot/profiles/net_4_x/Mono.Posix.cs.REMOVED.git-id @@ -1 +1 @@ -703aeb84b7f468abb1a4821829683c566a004026 \ No newline at end of file +d4965059d547194b07315ea2eccdd9324bcfbf8c \ No newline at end of file diff --git a/external/api-snapshot/profiles/net_4_x/Mono.Security.cs.REMOVED.git-id b/external/api-snapshot/profiles/net_4_x/Mono.Security.cs.REMOVED.git-id index cc5dde6300..8a7f6d973f 100644 --- a/external/api-snapshot/profiles/net_4_x/Mono.Security.cs.REMOVED.git-id +++ b/external/api-snapshot/profiles/net_4_x/Mono.Security.cs.REMOVED.git-id @@ -1 +1 @@ -80b79ba367d12c121332316fea3dcc10f9ac278f \ No newline at end of file +46468e5b458af1df7c4d502ad8f5c2a83527e649 \ No newline at end of file diff --git a/external/api-snapshot/profiles/net_4_x/System.cs.REMOVED.git-id b/external/api-snapshot/profiles/net_4_x/System.cs.REMOVED.git-id index 440d61809e..c73899ad47 100644 --- a/external/api-snapshot/profiles/net_4_x/System.cs.REMOVED.git-id +++ b/external/api-snapshot/profiles/net_4_x/System.cs.REMOVED.git-id @@ -1 +1 @@ -00725101599ebd8c039e531859320754cb521f2e \ No newline at end of file +d22c0752cbf3a18e72df8083ab5354f346c648f8 \ No newline at end of file diff --git a/external/api-snapshot/profiles/net_4_x/mscorlib.cs.REMOVED.git-id b/external/api-snapshot/profiles/net_4_x/mscorlib.cs.REMOVED.git-id index 37000fb77b..8997fa21b0 100644 --- a/external/api-snapshot/profiles/net_4_x/mscorlib.cs.REMOVED.git-id +++ b/external/api-snapshot/profiles/net_4_x/mscorlib.cs.REMOVED.git-id @@ -1 +1 @@ -03f0d6f3e5645ad55d73b26135212076a5119877 \ No newline at end of file +422a5ed0cc55c2bd8c7a4e5ab98f378ce5d8aded \ No newline at end of file diff --git a/external/bockbuild/bockbuild/package.py b/external/bockbuild/bockbuild/package.py index 183580db03..7d73206824 100644 --- a/external/bockbuild/bockbuild/package.py +++ b/external/bockbuild/bockbuild/package.py @@ -878,6 +878,7 @@ class Package: elif orig_suffix is not None: suffixed = os.path.join( dest_dir, reldir, add_suffix(filename, orig_suffix)) + trace(dest_orig_file) trace(suffixed) shutil.move(dest_orig_file, suffixed) os.symlink(os.path.basename(suffixed), dest_orig_file) diff --git a/external/bockbuild/packages/gtk-sharp.py b/external/bockbuild/packages/gtk-sharp.py index 0760dee19c..68b320603a 100644 --- a/external/bockbuild/packages/gtk-sharp.py +++ b/external/bockbuild/packages/gtk-sharp.py @@ -4,7 +4,7 @@ class GtkSharp212ReleasePackage (Package): Package.__init__(self, 'gtk-sharp', sources=['git://github.com/mono/gtk-sharp.git'], git_branch='gtk-sharp-2-12-branch', - revision='dedce8ddbe37ae467f18ff785255e04fd9ccd782', + revision='76a9a14ad72b75b66fdda12fab1532c2e5318cc5', override_properties={ 'configure': './bootstrap-2.12 --prefix=%{package_prefix}', } diff --git a/external/cecil/.azure-pipelines.yml b/external/cecil/.azure-pipelines.yml deleted file mode 100644 index f463b22cf1..0000000000 --- a/external/cecil/.azure-pipelines.yml +++ /dev/null @@ -1,38 +0,0 @@ -trigger: -- master - -pr: -- master - -jobs: -- job: Linux - pool: - vmImage: 'ubuntu-16.04' - steps: - - script: | - dotnet build -c Debug Mono.Cecil.sln - displayName: 'Build' - - script: | - dotnet test --no-build -c Debug -f netcoreapp2.1 Mono.Cecil.sln - displayName: 'Test .NET Core' - - task: NuGetToolInstaller@0 - displayName: 'Install nuget' - - task: NuGetCommand@2 - inputs: - command: 'custom' - arguments: 'install NUnit.Console -Version 3.9.0 -OutputDirectory ./packages' - displayName: 'Get NUnit.Console' - - script: | - mono ./packages/NUnit.ConsoleRunner.3.9.0/tools/nunit3-console.exe ./Mono.Cecil.nunit - displayName: 'Test .NET 4.0 using Mono' - -- job: Windows - pool: - vmImage: 'vs2017-win2016' - steps: - - script: | - dotnet build -c Debug Mono.Cecil.sln - displayName: 'Build' - - script: | - dotnet test --no-build -c Debug Mono.Cecil.sln - displayName: 'Test' diff --git a/external/cecil/.github/workflows/main.yml b/external/cecil/.github/workflows/main.yml new file mode 100644 index 0000000000..589e5cd32f --- /dev/null +++ b/external/cecil/.github/workflows/main.yml @@ -0,0 +1,35 @@ +name: CI + +on: + push: + branches: + - master + - release/* + pull_request: + branches: + - master + - release/* + +jobs: + windows: + runs-on: windows-latest + steps: + - uses: actions/checkout@v1 + - name: Build + run: dotnet build -c Debug Mono.Cecil.sln + - name: Test + run: dotnet test --no-build -c Debug Mono.Cecil.sln + linux: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - name: Build + run: dotnet build -c Debug Mono.Cecil.sln + - name: Test .NET Core + run: dotnet test --no-build -c Debug Mono.Cecil.sln + - name: Get NuGet + run: curl -o ./nuget.exe https://dist.nuget.org/win-x86-commandline/latest/nuget.exe + - name: Get NUnit.Console + run: mono ./nuget.exe install NUnit.Console -Version 3.9.0 -OutputDirectory ./packages + - name: Test .NET 4.0 using Mono + run: mono ./packages/NUnit.ConsoleRunner.3.9.0/tools/nunit3-console.exe ./Mono.Cecil.nunit diff --git a/external/cecil/.gitignore b/external/cecil/.gitignore index b369ea1f92..956178e315 100644 --- a/external/cecil/.gitignore +++ b/external/cecil/.gitignore @@ -14,3 +14,5 @@ TestResults project.lock.json .vs/ .idea/ +packages/* +nuget.exe diff --git a/external/cecil/Mono.Cecil.PE/ImageReader.cs b/external/cecil/Mono.Cecil.PE/ImageReader.cs index 6fb5e1c023..9731ba90bc 100644 --- a/external/cecil/Mono.Cecil.PE/ImageReader.cs +++ b/external/cecil/Mono.Cecil.PE/ImageReader.cs @@ -350,7 +350,7 @@ namespace Mono.Cecil.PE { PointerToRawData = ReadInt32 (), }; - if (directory.PointerToRawData == 0) { + if (directory.PointerToRawData == 0 || directory.SizeOfData < 0) { entries [i] = new ImageDebugHeaderEntry (directory, Empty.Array); continue; } diff --git a/external/cecil/Mono.Cecil.nunit b/external/cecil/Mono.Cecil.nunit index 4ea9a9646e..2acfc126ce 100644 --- a/external/cecil/Mono.Cecil.nunit +++ b/external/cecil/Mono.Cecil.nunit @@ -1,6 +1,6 @@ - + diff --git a/external/cecil/Mono.Cecil/AssemblyWriter.cs b/external/cecil/Mono.Cecil/AssemblyWriter.cs index d6cf5c2f13..b359ddf512 100644 --- a/external/cecil/Mono.Cecil/AssemblyWriter.cs +++ b/external/cecil/Mono.Cecil/AssemblyWriter.cs @@ -102,8 +102,8 @@ namespace Mono.Cecil { if (symbol_writer_provider == null && parameters.WriteSymbols) symbol_writer_provider = new DefaultSymbolWriterProvider (); - if (parameters.StrongNameKeyPair != null && name != null) { - name.PublicKey = parameters.StrongNameKeyPair.PublicKey; + if (parameters.HasStrongNameKey && name != null) { + name.PublicKey = CryptoService.GetPublicKey (parameters); module.Attributes |= ModuleAttributes.StrongNameSigned; } @@ -125,8 +125,8 @@ namespace Mono.Cecil { stream.value.SetLength (0); writer.WriteImage (); - if (parameters.StrongNameKeyPair != null) - CryptoService.StrongName (stream.value, writer, parameters.StrongNameKeyPair); + if (parameters.HasStrongNameKey) + CryptoService.StrongName (stream.value, writer, parameters); } } finally { module.metadata_builder = null; diff --git a/external/cecil/Mono.Cecil/ModuleDefinition.cs b/external/cecil/Mono.Cecil/ModuleDefinition.cs index 6b4e596034..81b74c4c2e 100644 --- a/external/cecil/Mono.Cecil/ModuleDefinition.cs +++ b/external/cecil/Mono.Cecil/ModuleDefinition.cs @@ -199,6 +199,8 @@ namespace Mono.Cecil { Stream symbol_stream; ISymbolWriterProvider symbol_writer_provider; bool write_symbols; + byte [] key_blob; + string key_container; SR.StrongNameKeyPair key_pair; public uint? Timestamp { @@ -221,6 +223,20 @@ namespace Mono.Cecil { set { write_symbols = value; } } + public bool HasStrongNameKey { + get { return key_pair != null || key_blob != null || key_container != null; } + } + + public byte [] StrongNameKeyBlob { + get { return key_blob; } + set { key_blob = value; } + } + + public string StrongNameKeyContainer { + get { return key_container; } + set { key_container = value; } + } + public SR.StrongNameKeyPair StrongNameKeyPair { get { return key_pair; } set { key_pair = value; } diff --git a/external/cecil/Mono.Cecil/VariantType.cs b/external/cecil/Mono.Cecil/VariantType.cs index 81aa7fa4a3..c5e222df45 100644 --- a/external/cecil/Mono.Cecil/VariantType.cs +++ b/external/cecil/Mono.Cecil/VariantType.cs @@ -29,6 +29,8 @@ namespace Mono.Cecil { UI1 = 17, UI2 = 18, UI4 = 19, + I8 = 20, + UI8 = 21, Int = 22, UInt = 23 } diff --git a/external/cecil/Mono.Security.Cryptography/CryptoConvert.cs b/external/cecil/Mono.Security.Cryptography/CryptoConvert.cs index a37d3b90c1..cd68f99e2d 100644 --- a/external/cecil/Mono.Security.Cryptography/CryptoConvert.cs +++ b/external/cecil/Mono.Security.Cryptography/CryptoConvert.cs @@ -44,6 +44,16 @@ namespace Mono.Security.Cryptography { return (uint)((bytes [offset+3] << 24) | (bytes [offset+2] << 16) | (bytes [offset+1] << 8) | bytes [offset]); } + static private byte [] GetBytesLE (int val) + { + return new byte [] { + (byte) (val & 0xff), + (byte) ((val >> 8) & 0xff), + (byte) ((val >> 16) & 0xff), + (byte) ((val >> 24) & 0xff) + }; + } + static private byte[] Trim (byte[] array) { for (int i=0; i < array.Length; i++) { @@ -240,5 +250,41 @@ namespace Mono.Security.Cryptography { } throw new CryptographicException ("Unknown blob format."); } + + static public byte[] ToCapiPublicKeyBlob (RSA rsa) + { + RSAParameters p = rsa.ExportParameters (false); + int keyLength = p.Modulus.Length; // in bytes + byte[] blob = new byte [20 + keyLength]; + + blob [0] = 0x06; // Type - PUBLICKEYBLOB (0x06) + blob [1] = 0x02; // Version - Always CUR_BLOB_VERSION (0x02) + // [2], [3] // RESERVED - Always 0 + blob [5] = 0x24; // ALGID - Always 00 24 00 00 (for CALG_RSA_SIGN) + blob [8] = 0x52; // Magic - RSA1 (ASCII in hex) + blob [9] = 0x53; + blob [10] = 0x41; + blob [11] = 0x31; + + byte[] bitlen = GetBytesLE (keyLength << 3); + blob [12] = bitlen [0]; // bitlen + blob [13] = bitlen [1]; + blob [14] = bitlen [2]; + blob [15] = bitlen [3]; + + // public exponent (DWORD) + int pos = 16; + int n = p.Exponent.Length; + while (n > 0) + blob [pos++] = p.Exponent [--n]; + // modulus + pos = 20; + byte[] part = p.Modulus; + int len = part.Length; + Array.Reverse (part, 0, len); + Buffer.BlockCopy (part, 0, blob, pos, len); + pos += len; + return blob; + } } } diff --git a/external/cecil/Mono.Security.Cryptography/CryptoService.cs b/external/cecil/Mono.Security.Cryptography/CryptoService.cs index 7a4198b5c8..dd9613fe0a 100644 --- a/external/cecil/Mono.Security.Cryptography/CryptoService.cs +++ b/external/cecil/Mono.Security.Cryptography/CryptoService.cs @@ -26,11 +26,33 @@ namespace Mono.Cecil { static class CryptoService { - public static void StrongName (Stream stream, ImageWriter writer, StrongNameKeyPair key_pair) + public static byte [] GetPublicKey (WriterParameters parameters) + { + using (var rsa = parameters.CreateRSA ()) { + var cspBlob = CryptoConvert.ToCapiPublicKeyBlob (rsa); + var publicKey = new byte [12 + cspBlob.Length]; + Buffer.BlockCopy (cspBlob, 0, publicKey, 12, cspBlob.Length); + // The first 12 bytes are documented at: + // http://msdn.microsoft.com/library/en-us/cprefadd/html/grfungethashfromfile.asp + // ALG_ID - Signature + publicKey [1] = 36; + // ALG_ID - Hash + publicKey [4] = 4; + publicKey [5] = 128; + // Length of Public Key (in bytes) + publicKey [8] = (byte) (cspBlob.Length >> 0); + publicKey [9] = (byte) (cspBlob.Length >> 8); + publicKey [10] = (byte) (cspBlob.Length >> 16); + publicKey [11] = (byte) (cspBlob.Length >> 24); + return publicKey; + } + } + + public static void StrongName (Stream stream, ImageWriter writer, WriterParameters parameters) { int strong_name_pointer; - var strong_name = CreateStrongName (key_pair, HashStream (stream, writer, out strong_name_pointer)); + var strong_name = CreateStrongName (parameters, HashStream (stream, writer, out strong_name_pointer)); PatchStrongName (stream, strong_name_pointer, strong_name); } @@ -40,11 +62,11 @@ namespace Mono.Cecil { stream.Write (strong_name, 0, strong_name.Length); } - static byte [] CreateStrongName (StrongNameKeyPair key_pair, byte [] hash) + static byte [] CreateStrongName (WriterParameters parameters, byte [] hash) { const string hash_algo = "SHA1"; - using (var rsa = key_pair.CreateRSA ()) { + using (var rsa = parameters.CreateRSA ()) { var formatter = new RSAPKCS1SignatureFormatter (rsa); formatter.SetHashAlgorithm (hash_algo); @@ -74,7 +96,6 @@ namespace Mono.Cecil { var sha1 = new SHA1Managed (); var buffer = new byte [buffer_size]; using (var crypto_stream = new CryptoStream (Stream.Null, sha1, CryptoStreamMode.Write)) { - stream.Seek (0, SeekOrigin.Begin); CopyStreamChunk (stream, crypto_stream, buffer, header_size); @@ -125,7 +146,7 @@ namespace Mono.Cecil { using (var crypto_stream = new CryptoStream (Stream.Null, sha1, CryptoStreamMode.Write)) { for (int i = 0; i < buffers.Length; i++) { - crypto_stream.Write (buffers [0].buffer, 0, buffers [0].length); + crypto_stream.Write (buffers [i].buffer, 0, buffers [i].length); } } @@ -148,12 +169,17 @@ namespace Mono.Cecil { static partial class Mixin { - public static RSA CreateRSA (this StrongNameKeyPair key_pair) + public static RSA CreateRSA (this WriterParameters writer_parameters) { byte [] key; string key_container; - if (!TryGetKeyContainer (key_pair, out key, out key_container)) + if (writer_parameters.StrongNameKeyBlob != null) + return CryptoConvert.FromCapiKeyBlob (writer_parameters.StrongNameKeyBlob); + + if (writer_parameters.StrongNameKeyContainer != null) + key_container = writer_parameters.StrongNameKeyContainer; + else if (!TryGetKeyContainer (writer_parameters.StrongNameKeyPair, out key, out key_container)) return CryptoConvert.FromCapiKeyBlob (key); var parameters = new CspParameters { diff --git a/external/cecil/Test/Mono.Cecil.Tests/CompilationService.cs b/external/cecil/Test/Mono.Cecil.Tests/CompilationService.cs index 681db51b35..0c9d35c1b3 100644 --- a/external/cecil/Test/Mono.Cecil.Tests/CompilationService.cs +++ b/external/cecil/Test/Mono.Cecil.Tests/CompilationService.cs @@ -354,6 +354,9 @@ namespace Mono.Cecil.Tests { static string WinSdkTool (string tool) { var sdks = new [] { + @"Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools", + @"Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.7.2 Tools", + @"Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.7.1 Tools", @"Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.7 Tools", @"Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6.2 Tools", @"Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6.1 Tools", diff --git a/external/cecil/Test/Mono.Cecil.Tests/PortablePdbTests.cs b/external/cecil/Test/Mono.Cecil.Tests/PortablePdbTests.cs index 6e1efbc908..e741865fa6 100644 --- a/external/cecil/Test/Mono.Cecil.Tests/PortablePdbTests.cs +++ b/external/cecil/Test/Mono.Cecil.Tests/PortablePdbTests.cs @@ -683,5 +683,42 @@ class Program using (var module = ModuleDefinition.ReadModule (destination, new ReaderParameters { SymbolReaderProvider = new PortablePdbReaderProvider () })) { } } + + [Test] + public void DoubleWriteAndReadAgainModuleWithDeterministicMvid () + { + Guid mvid1_in, mvid1_out, mvid2_in, mvid2_out; + + { + const string resource = "foo.dll"; + string destination = Path.GetTempFileName (); + + using (var module = GetResourceModule (resource, new ReaderParameters { })) { + mvid1_in = module.Mvid; + module.Write (destination, new WriterParameters { DeterministicMvid = true }); + } + + using (var module = ModuleDefinition.ReadModule (destination, new ReaderParameters { })) { + mvid1_out = module.Mvid; + } + } + + { + const string resource = "hello2.exe"; + string destination = Path.GetTempFileName (); + + using (var module = GetResourceModule (resource, new ReaderParameters { })) { + mvid2_in = module.Mvid; + module.Write (destination, new WriterParameters { DeterministicMvid = true }); + } + + using (var module = ModuleDefinition.ReadModule (destination, new ReaderParameters { })) { + mvid2_out = module.Mvid; + } + } + + Assert.AreNotEqual (mvid1_in, mvid2_in); + Assert.AreNotEqual (mvid1_out, mvid2_out); + } } } diff --git a/external/cecil/symbols/pdb/Microsoft.Cci.Pdb/BitAccess.cs b/external/cecil/symbols/pdb/Microsoft.Cci.Pdb/BitAccess.cs index d92a5b7491..fce6373a39 100644 --- a/external/cecil/symbols/pdb/Microsoft.Cci.Pdb/BitAccess.cs +++ b/external/cecil/symbols/pdb/Microsoft.Cci.Pdb/BitAccess.cs @@ -1,13 +1,6 @@ -//----------------------------------------------------------------------------- -// // Copyright (c) Microsoft. All rights reserved. -// This code is licensed under the Microsoft Public License. -// THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY -// IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR -// PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. -// -//----------------------------------------------------------------------------- +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + using System; using System.IO; using System.Text; @@ -19,6 +12,11 @@ namespace Microsoft.Cci.Pdb { this.buffer = new byte[capacity]; } + internal BitAccess(byte[] buffer) { + this.buffer = buffer; + offset = 0; + } + internal byte[] Buffer { get { return buffer; } } diff --git a/external/cecil/symbols/pdb/Microsoft.Cci.Pdb/BitSet.cs b/external/cecil/symbols/pdb/Microsoft.Cci.Pdb/BitSet.cs index 6719131719..2a6dff2588 100644 --- a/external/cecil/symbols/pdb/Microsoft.Cci.Pdb/BitSet.cs +++ b/external/cecil/symbols/pdb/Microsoft.Cci.Pdb/BitSet.cs @@ -1,13 +1,6 @@ -//----------------------------------------------------------------------------- -// // Copyright (c) Microsoft. All rights reserved. -// This code is licensed under the Microsoft Public License. -// THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY -// IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR -// PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. -// -//----------------------------------------------------------------------------- +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + using System; namespace Microsoft.Cci.Pdb { diff --git a/external/cecil/symbols/pdb/Microsoft.Cci.Pdb/CvInfo.cs b/external/cecil/symbols/pdb/Microsoft.Cci.Pdb/CvInfo.cs index 49c51ce1a0..153201cb89 100644 --- a/external/cecil/symbols/pdb/Microsoft.Cci.Pdb/CvInfo.cs +++ b/external/cecil/symbols/pdb/Microsoft.Cci.Pdb/CvInfo.cs @@ -1,32 +1,6 @@ -//----------------------------------------------------------------------------- -// // Copyright (c) Microsoft. All rights reserved. -// This code is licensed under the Microsoft Public License. -// THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY -// IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR -// PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. -// -//----------------------------------------------------------------------------- -// -// File: CvInfo.cs -// -// Generic CodeView information definitions -// -// Structures, constants, etc. for accessing and interpreting -// CodeView information. -// -// The master copy of this file resides in the langapi project (in C++). -// All Microsoft projects are required to use the master copy without -// modification. Modification of the master version or a copy -// without consultation with all parties concerned is extremely -// risky. -// -// When this file is modified, the corresponding documentation file -// omfdeb.doc in the langapi project must be updated. -// -// This is a read-only copy of the C++ file converted to C#. -// +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + using System; namespace Microsoft.Cci.Pdb { diff --git a/external/cecil/symbols/pdb/Microsoft.Cci.Pdb/DataStream.cs b/external/cecil/symbols/pdb/Microsoft.Cci.Pdb/DataStream.cs index 48a1851651..8f7ab4b09e 100644 --- a/external/cecil/symbols/pdb/Microsoft.Cci.Pdb/DataStream.cs +++ b/external/cecil/symbols/pdb/Microsoft.Cci.Pdb/DataStream.cs @@ -1,13 +1,6 @@ -//----------------------------------------------------------------------------- -// // Copyright (c) Microsoft. All rights reserved. -// This code is licensed under the Microsoft Public License. -// THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY -// IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR -// PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. -// -//----------------------------------------------------------------------------- +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + using System; using System.IO; diff --git a/external/cecil/symbols/pdb/Microsoft.Cci.Pdb/DbiDbgHdr.cs b/external/cecil/symbols/pdb/Microsoft.Cci.Pdb/DbiDbgHdr.cs index 588f3c13de..354925d34f 100644 --- a/external/cecil/symbols/pdb/Microsoft.Cci.Pdb/DbiDbgHdr.cs +++ b/external/cecil/symbols/pdb/Microsoft.Cci.Pdb/DbiDbgHdr.cs @@ -1,13 +1,6 @@ -//----------------------------------------------------------------------------- -// // Copyright (c) Microsoft. All rights reserved. -// This code is licensed under the Microsoft Public License. -// THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY -// IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR -// PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. -// -//----------------------------------------------------------------------------- +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + using System; namespace Microsoft.Cci.Pdb { diff --git a/external/cecil/symbols/pdb/Microsoft.Cci.Pdb/DbiHeader.cs b/external/cecil/symbols/pdb/Microsoft.Cci.Pdb/DbiHeader.cs index 0ca7915883..a245104b6b 100644 --- a/external/cecil/symbols/pdb/Microsoft.Cci.Pdb/DbiHeader.cs +++ b/external/cecil/symbols/pdb/Microsoft.Cci.Pdb/DbiHeader.cs @@ -1,13 +1,6 @@ -//----------------------------------------------------------------------------- -// // Copyright (c) Microsoft. All rights reserved. -// This code is licensed under the Microsoft Public License. -// THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY -// IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR -// PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. -// -//----------------------------------------------------------------------------- +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + using System; namespace Microsoft.Cci.Pdb { diff --git a/external/cecil/symbols/pdb/Microsoft.Cci.Pdb/DbiModuleInfo.cs b/external/cecil/symbols/pdb/Microsoft.Cci.Pdb/DbiModuleInfo.cs index 8ab3717115..1617621637 100644 --- a/external/cecil/symbols/pdb/Microsoft.Cci.Pdb/DbiModuleInfo.cs +++ b/external/cecil/symbols/pdb/Microsoft.Cci.Pdb/DbiModuleInfo.cs @@ -1,13 +1,6 @@ -//----------------------------------------------------------------------------- -// // Copyright (c) Microsoft. All rights reserved. -// This code is licensed under the Microsoft Public License. -// THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY -// IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR -// PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. -// -//----------------------------------------------------------------------------- +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + using System; namespace Microsoft.Cci.Pdb { diff --git a/external/cecil/symbols/pdb/Microsoft.Cci.Pdb/DbiSecCon.cs b/external/cecil/symbols/pdb/Microsoft.Cci.Pdb/DbiSecCon.cs index de9fde951d..7730296d52 100644 --- a/external/cecil/symbols/pdb/Microsoft.Cci.Pdb/DbiSecCon.cs +++ b/external/cecil/symbols/pdb/Microsoft.Cci.Pdb/DbiSecCon.cs @@ -1,13 +1,6 @@ -//----------------------------------------------------------------------------- -// // Copyright (c) Microsoft. All rights reserved. -// This code is licensed under the Microsoft Public License. -// THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY -// IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR -// PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. -// -//----------------------------------------------------------------------------- +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + using System; namespace Microsoft.Cci.Pdb { diff --git a/external/cecil/symbols/pdb/Microsoft.Cci.Pdb/IntHashTable.cs b/external/cecil/symbols/pdb/Microsoft.Cci.Pdb/IntHashTable.cs index db0e41be00..221c07f1fb 100644 --- a/external/cecil/symbols/pdb/Microsoft.Cci.Pdb/IntHashTable.cs +++ b/external/cecil/symbols/pdb/Microsoft.Cci.Pdb/IntHashTable.cs @@ -1,13 +1,6 @@ -//----------------------------------------------------------------------------- -// // Copyright (c) Microsoft. All rights reserved. -// This code is licensed under the Microsoft Public License. -// THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY -// IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR -// PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. -// -//----------------------------------------------------------------------------- +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + using System; using System.Collections; @@ -114,14 +107,14 @@ namespace Microsoft.Cci.Pdb { */ // A typical resize algorithm would pick the smallest prime number in this array - // that is larger than twice the previous capacity. - // Suppose our Hashtable currently has capacity x and enough elements are added - // such that a resize needs to occur. Resizing first computes 2x then finds the - // first prime in the table greater than 2x, i.e. if primes are ordered - // p_1, p_2, …, p_i,…, it finds p_n such that p_n-1 < 2x < p_n. - // Doubling is important for preserving the asymptotic complexity of the - // hashtable operations such as add. Having a prime guarantees that double - // hashing does not lead to infinite loops. IE, your hash function will be + // that is larger than twice the previous capacity. + // Suppose our Hashtable currently has capacity x and enough elements are added + // such that a resize needs to occur. Resizing first computes 2x then finds the + // first prime in the table greater than 2x, i.e. if primes are ordered + // p_1, p_2, …, p_i,…, it finds p_n such that p_n-1 < 2x < p_n. + // Doubling is important for preserving the asymptotic complexity of the + // hashtable operations such as add. Having a prime guarantees that double + // hashing does not lead to infinite loops. IE, your hash function will be // h1(key) + i*h2(key), 0 <= i < size. h2 and the size must be relatively prime. private static readonly int[] primes = { 3, 7, 11, 17, 23, 29, 37, 47, 59, 71, 89, 107, 131, 163, 197, 239, 293, 353, 431, 521, 631, 761, 919, diff --git a/external/cecil/symbols/pdb/Microsoft.Cci.Pdb/Interfaces.cs b/external/cecil/symbols/pdb/Microsoft.Cci.Pdb/Interfaces.cs index 82561fbcc0..acc7f26f99 100644 --- a/external/cecil/symbols/pdb/Microsoft.Cci.Pdb/Interfaces.cs +++ b/external/cecil/symbols/pdb/Microsoft.Cci.Pdb/Interfaces.cs @@ -1,12 +1,12 @@ using System; using System.Collections.Generic; -namespace Microsoft.Cci { +namespace Microsoft.Cci.Pdb { /// /// A range of CLR IL operations that comprise a lexical scope, specified as an IL offset and a length. /// - public interface ILocalScope { + interface ILocalScope { /// /// The offset of the first operation in the scope. /// @@ -22,7 +22,7 @@ namespace Microsoft.Cci { /// A description of the lexical scope in which a namespace type has been nested. This scope is tied to a particular /// method body, so that partial types can be accommodated. /// - public interface INamespaceScope { + interface INamespaceScope { /// /// Zero or more used namespaces. These correspond to using clauses in C#. @@ -35,7 +35,7 @@ namespace Microsoft.Cci { /// /// A namespace that is used (imported) inside a namespace scope. /// - public interface IUsedNamespace { + interface IUsedNamespace { /// /// An alias for a namespace. For example the "x" of "using x = y.z;" in C#. Empty if no alias is present. /// @@ -50,7 +50,7 @@ namespace Microsoft.Cci { /// /// The name of an entity. Typically name instances come from a common pool. Within the pool no two distinct instances will have the same Value or UniqueKey. /// - public interface IName { + interface IName { /// /// An integer that is unique within the pool from which the name instance has been allocated. Useful as a hashtable key. /// diff --git a/external/cecil/symbols/pdb/Microsoft.Cci.Pdb/LICENSE b/external/cecil/symbols/pdb/Microsoft.Cci.Pdb/LICENSE index 7bfc997e59..f54f08dcc2 100644 --- a/external/cecil/symbols/pdb/Microsoft.Cci.Pdb/LICENSE +++ b/external/cecil/symbols/pdb/Microsoft.Cci.Pdb/LICENSE @@ -1,22 +1,21 @@ -Microsoft Public License (Ms-PL) +The MIT License (MIT) -This license governs use of the accompanying software. If you use the software, you -accept this license. If you do not accept the license, do not use the software. +Copyright (c) Microsoft -1. Definitions -The terms "reproduce," "reproduction," "derivative works," and "distribution" have the -same meaning here as under U.S. copyright law. -A "contribution" is the original software, or any additions or changes to the software. -A "contributor" is any person that distributes its contribution under this license. -"Licensed patents" are a contributor's patent claims that read directly on its contribution. +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: -2. Grant of Rights -(A) Copyright Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free copyright license to reproduce its contribution, prepare derivative works of its contribution, and distribute its contribution or any derivative works that you create. -(B) Patent Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free license under its licensed patents to make, have made, use, sell, offer for sale, import, and/or otherwise dispose of its contribution in the software or derivative works of the contribution in the software. +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. -3. Conditions and Limitations -(A) No Trademark License- This license does not grant you rights to use any contributors' name, logo, or trademarks. -(B) If you bring a patent claim against any contributor over patents that you claim are infringed by the software, your patent license from such contributor to the software ends automatically. -(C) If you distribute any portion of the software, you must retain all copyright, patent, trademark, and attribution notices that are present in the software. -(D) If you distribute any portion of the software in source code form, you may do so only under this license by including a complete copy of this license with your distribution. If you distribute any portion of the software in compiled or object code form, you may only do so under a license that complies with this license. -(E) The software is licensed "as-is." You bear the risk of using it. The contributors give no express warranties, guarantees or conditions. You may have additional consumer rights under your local laws which this license cannot change. To the extent permitted under your local laws, the contributors exclude the implied warranties of merchantability, fitness for a particular purpose and non-infringement. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/external/cecil/symbols/pdb/Microsoft.Cci.Pdb/MsfDirectory.cs b/external/cecil/symbols/pdb/Microsoft.Cci.Pdb/MsfDirectory.cs index a6669b5bb5..875c97e0e0 100644 --- a/external/cecil/symbols/pdb/Microsoft.Cci.Pdb/MsfDirectory.cs +++ b/external/cecil/symbols/pdb/Microsoft.Cci.Pdb/MsfDirectory.cs @@ -1,13 +1,6 @@ -//----------------------------------------------------------------------------- -// // Copyright (c) Microsoft. All rights reserved. -// This code is licensed under the Microsoft Public License. -// THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY -// IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR -// PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. -// -//----------------------------------------------------------------------------- +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + using System; namespace Microsoft.Cci.Pdb { diff --git a/external/cecil/symbols/pdb/Microsoft.Cci.Pdb/PdbConstant.cs b/external/cecil/symbols/pdb/Microsoft.Cci.Pdb/PdbConstant.cs index 434841b0cd..833d849854 100644 --- a/external/cecil/symbols/pdb/Microsoft.Cci.Pdb/PdbConstant.cs +++ b/external/cecil/symbols/pdb/Microsoft.Cci.Pdb/PdbConstant.cs @@ -1,22 +1,22 @@ -//----------------------------------------------------------------------------- -// -// Copyright (c) Microsoft. All rights reserved. -// This code is licensed under the Microsoft Public License. -// THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY -// IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR -// PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. -// -//----------------------------------------------------------------------------- +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + using System; using System.Runtime.InteropServices; namespace Microsoft.Cci.Pdb { + /// internal class PdbConstant { internal string name; internal uint token; internal object value; + internal PdbConstant(string name, uint token, object value) { + this.name = name; + this.token = token; + this.value = value; + } + internal PdbConstant(BitAccess bits) { bits.ReadUInt32(out this.token); byte tag1; @@ -78,7 +78,7 @@ namespace Microsoft.Cci.Pdb { break; default: //TODO: error - break; + break; } } else { //TODO: error diff --git a/external/cecil/symbols/pdb/Microsoft.Cci.Pdb/PdbDebugException.cs b/external/cecil/symbols/pdb/Microsoft.Cci.Pdb/PdbDebugException.cs index d7f8f0fdbf..43ada45790 100644 --- a/external/cecil/symbols/pdb/Microsoft.Cci.Pdb/PdbDebugException.cs +++ b/external/cecil/symbols/pdb/Microsoft.Cci.Pdb/PdbDebugException.cs @@ -1,13 +1,6 @@ -//----------------------------------------------------------------------------- -// // Copyright (c) Microsoft. All rights reserved. -// This code is licensed under the Microsoft Public License. -// THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY -// IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR -// PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. -// -//----------------------------------------------------------------------------- +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + using System; using System.IO; diff --git a/external/cecil/symbols/pdb/Microsoft.Cci.Pdb/PdbException.cs b/external/cecil/symbols/pdb/Microsoft.Cci.Pdb/PdbException.cs index 38d1d56368..83c611d8cc 100644 --- a/external/cecil/symbols/pdb/Microsoft.Cci.Pdb/PdbException.cs +++ b/external/cecil/symbols/pdb/Microsoft.Cci.Pdb/PdbException.cs @@ -1,13 +1,6 @@ -//----------------------------------------------------------------------------- -// // Copyright (c) Microsoft. All rights reserved. -// This code is licensed under the Microsoft Public License. -// THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY -// IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR -// PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. -// -//----------------------------------------------------------------------------- +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + using System; using System.IO; diff --git a/external/cecil/symbols/pdb/Microsoft.Cci.Pdb/PdbFile.cs b/external/cecil/symbols/pdb/Microsoft.Cci.Pdb/PdbFile.cs index 9435d6ef6a..35c0d3d671 100644 --- a/external/cecil/symbols/pdb/Microsoft.Cci.Pdb/PdbFile.cs +++ b/external/cecil/symbols/pdb/Microsoft.Cci.Pdb/PdbFile.cs @@ -1,29 +1,40 @@ -//----------------------------------------------------------------------------- -// // Copyright (c) Microsoft. All rights reserved. -// This code is licensed under the Microsoft Public License. -// THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY -// IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR -// PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. -// -//----------------------------------------------------------------------------- -using System; +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +using System; +using System.Collections; using System.Collections.Generic; using System.IO; -using Mono.Cecil.Cil; namespace Microsoft.Cci.Pdb { + internal class PdbFile { + + /// + /// GUID of the Basic source language. + /// + private static readonly Guid BasicLanguageGuid = new Guid(974311608, -15764, 4560, 180, 66, 0, 160, 36, 74, 29, 210); + private PdbFile() // This class can't be instantiated. { } - static void LoadGuidStream(BitAccess bits, out Guid doctype, out Guid language, out Guid vendor) { + static void LoadInjectedSourceInformation(BitAccess bits, out Guid doctype, out Guid language, out Guid vendor, out Guid checksumAlgo, out byte[] checksum) { + int checksumSize; + int injectedSourceSize; + checksum = null; + bits.ReadGuid(out language); bits.ReadGuid(out vendor); bits.ReadGuid(out doctype); + bits.ReadGuid(out checksumAlgo); + bits.ReadInt32(out checksumSize); + bits.ReadInt32(out injectedSourceSize); + + if (checksumSize > 0) { + checksum = new byte[checksumSize]; + bits.ReadBytes(checksum); + } } static Dictionary LoadNameIndex(BitAccess bits, out int age, out Guid guid) { @@ -131,11 +142,11 @@ namespace Microsoft.Cci.Pdb { return ht; } + private static PdbFunction match = new PdbFunction(); + private static int FindFunction(PdbFunction[] funcs, ushort sec, uint off) { - var match = new PdbFunction { - segment = sec, - address = off, - }; + match.segment = sec; + match.address = off; return Array.BinarySearch(funcs, match, PdbFunction.byAddress); } @@ -146,11 +157,13 @@ namespace Microsoft.Cci.Pdb { MsfDirectory dir, Dictionary nameIndex, PdbReader reader, - uint limit) { + uint limit, + Dictionary sourceCache) + { Array.Sort(funcs, PdbFunction.byAddressAndToken); int begin = bits.Position; - IntHashTable checks = ReadSourceFileInfo(bits, limit, names, dir, nameIndex, reader); + IntHashTable checks = ReadSourceFileInfo(bits, limit, names, dir, nameIndex, reader, sourceCache); // Read the lines next. bits.Position = begin; @@ -213,6 +226,11 @@ namespace Microsoft.Cci.Pdb { bits.ReadUInt32(out file.linsiz); // Size of payload. PdbSource src = (PdbSource)checks[(int)file.index]; + if (src.language.Equals(BasicLanguageGuid)) + { + func.AdjustVisualBasicScopes(); + } + PdbLines tmp = new PdbLines(src, file.count); func.lines[block++] = tmp; PdbLine[] lines = tmp.lines; @@ -258,7 +276,9 @@ namespace Microsoft.Cci.Pdb { bool readStrings, MsfDirectory dir, Dictionary nameIndex, - PdbReader reader) { + PdbReader reader, + Dictionary sourceCache) + { PdbFunction[] funcs = null; bits.Position = 0; @@ -276,7 +296,8 @@ namespace Microsoft.Cci.Pdb { if (funcs != null) { bits.Position = info.cbSyms + info.cbOldLines; LoadManagedLines(funcs, names, bits, dir, nameIndex, reader, - (uint)(info.cbSyms + info.cbOldLines + info.cbLines)); + (uint)(info.cbSyms + info.cbOldLines + info.cbLines), + sourceCache); for (int i = 0; i < funcs.Length; i++) { funcList.Add(funcs[i]); @@ -337,32 +358,43 @@ namespace Microsoft.Cci.Pdb { bits.Position = end; } - internal static PdbFunction[] LoadFunctions(Stream read, out Dictionary tokenToSourceMapping, out string sourceServerData, out int age, out Guid guid) { - tokenToSourceMapping = new Dictionary(); - BitAccess bits = new BitAccess(512 * 1024); + internal static PdbInfo LoadFunctions(Stream read) { + PdbInfo pdbInfo = new PdbInfo(); + + pdbInfo.TokenToSourceMapping = new Dictionary(); + BitAccess bits = new BitAccess(64 * 1024); PdbFileHeader head = new PdbFileHeader(read, bits); PdbReader reader = new PdbReader(read, head.pageSize); MsfDirectory dir = new MsfDirectory(reader, head, bits); DbiModuleInfo[] modules = null; DbiDbgHdr header; + Dictionary sourceCache = new Dictionary(); dir.streams[1].Read(reader, bits); - Dictionary nameIndex = LoadNameIndex(bits, out age, out guid); + Dictionary nameIndex = LoadNameIndex(bits, out pdbInfo.Age, out pdbInfo.Guid); int nameStream; if (!nameIndex.TryGetValue("/NAMES", out nameStream)) { - throw new PdbException("No `name' stream"); + throw new PdbException("Could not find the '/NAMES' stream: the PDB file may be a public symbol file instead of a private symbol file"); } dir.streams[nameStream].Read(reader, bits); IntHashTable names = LoadNameStream(bits); int srcsrvStream; if (!nameIndex.TryGetValue("SRCSRV", out srcsrvStream)) - sourceServerData = string.Empty; + pdbInfo.SourceServerData = string.Empty; else { DataStream dataStream = dir.streams[srcsrvStream]; byte[] bytes = new byte[dataStream.contentSize]; dataStream.Read(reader, bits); - sourceServerData = bits.ReadBString(bytes.Length); + pdbInfo.SourceServerData = bits.ReadBString(bytes.Length); + } + + int sourceLinkStream; + if (nameIndex.TryGetValue("SOURCELINK", out sourceLinkStream)) { + DataStream dataStream = dir.streams[sourceLinkStream]; + pdbInfo.SourceLinkData = new byte[dataStream.contentSize]; + dataStream.Read(reader, bits); + bits.ReadBytes(pdbInfo.SourceLinkData); } dir.streams[3].Read(reader, bits); @@ -376,10 +408,10 @@ namespace Microsoft.Cci.Pdb { if (module.stream > 0) { dir.streams[module.stream].Read(reader, bits); if (module.moduleName == "TokenSourceLineInfo") { - LoadTokenToSourceInfo(bits, module, names, dir, nameIndex, reader, tokenToSourceMapping); + LoadTokenToSourceInfo(bits, module, names, dir, nameIndex, reader, pdbInfo.TokenToSourceMapping, sourceCache); continue; } - LoadFuncsFromDbiModule(bits, module, names, funcList, true, dir, nameIndex, reader); + LoadFuncsFromDbiModule(bits, module, names, funcList, true, dir, nameIndex, reader, sourceCache); } } } @@ -400,11 +432,12 @@ namespace Microsoft.Cci.Pdb { // Array.Sort(funcs, PdbFunction.byAddressAndToken); //Array.Sort(funcs, PdbFunction.byToken); - return funcs; + pdbInfo.Functions = funcs; + return pdbInfo; } private static void LoadTokenToSourceInfo(BitAccess bits, DbiModuleInfo module, IntHashTable names, MsfDirectory dir, - Dictionary nameIndex, PdbReader reader, Dictionary tokenToSourceMapping) { + Dictionary nameIndex, PdbReader reader, Dictionary tokenToSourceMapping, Dictionary sourceCache) { bits.Position = 0; int sig; bits.ReadInt32(out sig); @@ -477,15 +510,18 @@ namespace Microsoft.Cci.Pdb { bits.Position = module.cbSyms + module.cbOldLines; int limit = module.cbSyms + module.cbOldLines + module.cbLines; - IntHashTable sourceFiles = ReadSourceFileInfo(bits, (uint)limit, names, dir, nameIndex, reader); + IntHashTable sourceFiles = ReadSourceFileInfo(bits, (uint)limit, names, dir, nameIndex, reader, sourceCache); foreach (var tokenLine in tokenToSourceMapping.Values) { tokenLine.sourceFile = (PdbSource)sourceFiles[(int)tokenLine.file_id]; } } + public static readonly Guid SymDocumentType_Text = new Guid(1518771467, 26129, 4563, 189, 42, 0, 0, 248, 8, 73, 189); + private static IntHashTable ReadSourceFileInfo(BitAccess bits, uint limit, IntHashTable names, MsfDirectory dir, - Dictionary nameIndex, PdbReader reader) { + Dictionary nameIndex, PdbReader reader, Dictionary sourceCache) + { IntHashTable checks = new IntHashTable(); int begin = bits.Position; @@ -508,17 +544,26 @@ namespace Microsoft.Cci.Pdb { bits.ReadUInt8(out chk.type); string name = (string)names[(int)chk.name]; - int guidStream; - Guid doctypeGuid = DocumentType.Text.ToGuid(); - Guid languageGuid = Guid.Empty; - Guid vendorGuid = Guid.Empty; - if (nameIndex.TryGetValue("/SRC/FILES/"+name.ToUpperInvariant(), out guidStream)) { - var guidBits = new BitAccess(0x100); - dir.streams[guidStream].Read(reader, guidBits); - LoadGuidStream(guidBits, out doctypeGuid, out languageGuid, out vendorGuid); - } - PdbSource src = new PdbSource(/*(uint)ni,*/ name, doctypeGuid, languageGuid, vendorGuid); + PdbSource src; + if (!sourceCache.TryGetValue(name, out src)) + { + int guidStream; + Guid doctypeGuid = SymDocumentType_Text; + Guid languageGuid = Guid.Empty; + Guid vendorGuid = Guid.Empty; + Guid checksumAlgoGuid = Guid.Empty; + byte[] checksum = null; + if (nameIndex.TryGetValue("/SRC/FILES/" + name.ToUpperInvariant(), out guidStream)) + { + var guidBits = new BitAccess(0x100); + dir.streams[guidStream].Read(reader, guidBits); + LoadInjectedSourceInformation(guidBits, out doctypeGuid, out languageGuid, out vendorGuid, out checksumAlgoGuid, out checksum); + } + + src = new PdbSource(name, doctypeGuid, languageGuid, vendorGuid, checksumAlgoGuid, checksum); + sourceCache.Add(name, src); + } checks.Add(ni, src); bits.Position += chk.len; bits.Align(4); diff --git a/external/cecil/symbols/pdb/Microsoft.Cci.Pdb/PdbFileHeader.cs b/external/cecil/symbols/pdb/Microsoft.Cci.Pdb/PdbFileHeader.cs index 0a920388ac..8204123f72 100644 --- a/external/cecil/symbols/pdb/Microsoft.Cci.Pdb/PdbFileHeader.cs +++ b/external/cecil/symbols/pdb/Microsoft.Cci.Pdb/PdbFileHeader.cs @@ -1,19 +1,20 @@ -//----------------------------------------------------------------------------- -// // Copyright (c) Microsoft. All rights reserved. -// This code is licensed under the Microsoft Public License. -// THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY -// IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR -// PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. -// -//----------------------------------------------------------------------------- +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + using System; using System.IO; +using System.Linq; using System.Text; namespace Microsoft.Cci.Pdb { internal class PdbFileHeader { + private readonly byte[] windowsPdbMagic = new byte[32] { + 0x4D, 0x69, 0x63, 0x72, 0x6F, 0x73, 0x6F, 0x66, // "Microsof" + 0x74, 0x20, 0x43, 0x2F, 0x43, 0x2B, 0x2B, 0x20, // "t C/C++ " + 0x4D, 0x53, 0x46, 0x20, 0x37, 0x2E, 0x30, 0x30, // "MSF 7.00" + 0x0D, 0x0A, 0x1A, 0x44, 0x53, 0x00, 0x00, 0x00 // "^^^DS^^^" + }; + //internal PdbFileHeader(int pageSize) { // this.magic = new byte[32] { // 0x4D, 0x69, 0x63, 0x72, 0x6F, 0x73, 0x6F, 0x66, // "Microsof" @@ -24,8 +25,6 @@ namespace Microsoft.Cci.Pdb { // this.pageSize = pageSize; //} - const string MAGIC = "Microsoft C/C++ MSF 7.00"; - internal PdbFileHeader(Stream reader, BitAccess bits) { bits.MinCapacity(56); reader.Seek(0, SeekOrigin.Begin); @@ -39,18 +38,20 @@ namespace Microsoft.Cci.Pdb { bits.ReadInt32(out this.directorySize); // 44..47 bits.ReadInt32(out this.zero); // 48..51 - if (Magic != MAGIC) { - throw new InvalidOperationException("Magic is wrong."); + if (!this.magic.SequenceEqual(windowsPdbMagic)) + { + throw new PdbException("The PDB file is not recognized as a Windows PDB file"); } + int directoryPages = ((((directorySize + pageSize - 1) / pageSize) * 4) + pageSize - 1) / pageSize; this.directoryRoot = new int[directoryPages]; bits.FillBuffer(reader, directoryPages * 4); bits.ReadInt32(this.directoryRoot); } - string Magic { - get { return StringFromBytesUTF8(magic, 0, MAGIC.Length); } - } + //internal string Magic { + // get { return StringFromBytesUTF8(magic); } + //} //internal void Write(Stream writer, BitAccess bits) { // bits.MinCapacity(pageSize); @@ -68,18 +69,18 @@ namespace Microsoft.Cci.Pdb { //////////////////////////////////////////////////// Helper Functions. // - static string StringFromBytesUTF8(byte[] bytes) { - return StringFromBytesUTF8(bytes, 0, bytes.Length); - } + //internal static string StringFromBytesUTF8(byte[] bytes) { + // return StringFromBytesUTF8(bytes, 0, bytes.Length); + //} - static string StringFromBytesUTF8(byte[] bytes, int offset, int length) { - for (int i = 0; i < length; i++) { - if (bytes[offset + i] < ' ') { - length = i; - } - } - return Encoding.UTF8.GetString(bytes, offset, length); - } + //internal static string StringFromBytesUTF8(byte[] bytes, int offset, int length) { + // for (int i = 0; i < length; i++) { + // if (bytes[offset + i] < ' ') { + // length = i; + // } + // } + // return Encoding.UTF8.GetString(bytes, offset, length); + //} ////////////////////////////////////////////////////////////// Fields. // diff --git a/external/cecil/symbols/pdb/Microsoft.Cci.Pdb/PdbFunction.cs b/external/cecil/symbols/pdb/Microsoft.Cci.Pdb/PdbFunction.cs index b02b97fee1..affc5ea747 100644 --- a/external/cecil/symbols/pdb/Microsoft.Cci.Pdb/PdbFunction.cs +++ b/external/cecil/symbols/pdb/Microsoft.Cci.Pdb/PdbFunction.cs @@ -1,17 +1,12 @@ -//----------------------------------------------------------------------------- -// // Copyright (c) Microsoft. All rights reserved. -// This code is licensed under the Microsoft Public License. -// THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY -// IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR -// PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. -// -//----------------------------------------------------------------------------- +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + using System; using System.Collections; using System.Collections.Generic; +#pragma warning disable 1591 // TODO: doc comments + namespace Microsoft.Cci.Pdb { internal class PdbFunction { static internal readonly Guid msilMetaData = new Guid(0xc6ea3fc9, 0x59b3, 0x49d6, 0xbc, 0x25, @@ -43,6 +38,13 @@ namespace Microsoft.Cci.Pdb { internal List/*?*/ iteratorScopes; internal PdbSynchronizationInformation/*?*/ synchronizationInformation; + /// + /// Flag saying whether the method has been identified as a product of VB compilation using + /// the legacy Windows PDB symbol format, in which case scope ends need to be shifted by 1 + /// due to different semantics of scope limits in VB and C# compilers. + /// + private bool visualBasicScopesAdjusted = false; + private static string StripNamespace(string module) { int li = module.LastIndexOf('.'); if (li > 0) { @@ -51,6 +53,36 @@ namespace Microsoft.Cci.Pdb { return module; } + /// + /// When the Windows PDB reader identifies a PdbFunction as having 'Basic' as its source language, + /// it calls this method which adjusts all scopes by adding 1 to their lengths to compensate + /// for different behavior of VB vs. the C# compiler w.r.t. emission of scope info. + /// + internal void AdjustVisualBasicScopes() + { + if (!visualBasicScopesAdjusted) + { + visualBasicScopesAdjusted = true; + + // Don't adjust root scope as that one is correct + foreach (PdbScope scope in scopes) + { + AdjustVisualBasicScopes(scope.scopes); + } + } + } + + /// + /// Recursively update the entire scope tree by adding 1 to the length of each scope. + /// + private void AdjustVisualBasicScopes(PdbScope[] scopes) + { + foreach (PdbScope scope in scopes) + { + scope.length++; + AdjustVisualBasicScopes(scope.scopes); + } + } internal static PdbFunction[] LoadManagedFunctions(/*string module,*/ BitAccess bits, uint limit, @@ -260,15 +292,7 @@ namespace Microsoft.Cci.Pdb { if (oem.idOem == msilMetaData) { string name = bits.ReadString(); if (name == "MD2") { - byte version; - bits.ReadUInt8(out version); - if (version == 4) { - byte count; - bits.ReadUInt8(out count); - bits.Align(4); - while (count-- > 0) - this.ReadCustomMetadata(bits); - } + ReadMD2CustomMetadata(bits); } else if (name == "asyncMethodInfo") { this.synchronizationInformation = new PdbSynchronizationInformation(bits); } @@ -338,27 +362,47 @@ namespace Microsoft.Cci.Pdb { } } - private void ReadCustomMetadata(BitAccess bits) { - int savedPosition = bits.Position; + internal void ReadMD2CustomMetadata(BitAccess bits) + { byte version; bits.ReadUInt8(out version); - if (version != 4) { - throw new PdbDebugException("Unknown custom metadata item version: {0}", version); + if (version == 4) { + byte count; + bits.ReadUInt8(out count); + bits.Align(4); + while (count-- > 0) + this.ReadCustomMetadata(bits); } - byte kind; - bits.ReadUInt8(out kind); - bits.Align(4); - uint numberOfBytesInItem; - bits.ReadUInt32(out numberOfBytesInItem); - switch (kind) { - case 0: this.ReadUsingInfo(bits); break; - case 1: this.ReadForwardInfo(bits); break; - case 2: break; // this.ReadForwardedToModuleInfo(bits); break; - case 3: this.ReadIteratorLocals(bits); break; - case 4: this.ReadForwardIterator(bits); break; - // TODO: handle unknown custom metadata, 5 & 6 are new with roslyn, see https://roslyn.codeplex.com/workitem/54 - } - bits.Position = savedPosition+(int)numberOfBytesInItem; + } + + private void ReadCustomMetadata(BitAccess bits) + { + int savedPosition = bits.Position; + byte version; + bits.ReadUInt8(out version); + byte kind; + bits.ReadUInt8(out kind); + bits.Position += 2; // 2-bytes padding + uint numberOfBytesInItem; + bits.ReadUInt32(out numberOfBytesInItem); + if (version == 4) + { + switch (kind) + { + case 0: this.ReadUsingInfo(bits); break; + case 1: this.ReadForwardInfo(bits); break; + case 2: break; // this.ReadForwardedToModuleInfo(bits); break; + case 3: this.ReadIteratorLocals(bits); break; + case 4: this.ReadForwardIterator(bits); break; + case 5: break; // dynamic locals - see http://index/#Microsoft.VisualStudio.LanguageServices/Shared/CustomDebugInfoReader.cs,a3031f7681d76e93 + case 6: break; // EnC data + case 7: break; // EnC data for lambdas and closures + // ignore any other unknown record types that may be added in future, instead of throwing an exception + // see more details here: https://github.com/tmat/roslyn/blob/portable-pdb/docs/specs/PortablePdb-Metadata.md + default: break; // throw new PdbDebugException("Unknown custom metadata item kind: {0}", kind); + } + } + bits.Position = savedPosition + (int)numberOfBytesInItem; } private void ReadForwardIterator(BitAccess bits) { diff --git a/external/cecil/symbols/pdb/Microsoft.Cci.Pdb/PdbInfo.cs b/external/cecil/symbols/pdb/Microsoft.Cci.Pdb/PdbInfo.cs new file mode 100644 index 0000000000..5a4e32b704 --- /dev/null +++ b/external/cecil/symbols/pdb/Microsoft.Cci.Pdb/PdbInfo.cs @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using System; +using System.Collections.Generic; + +namespace Microsoft.Cci.Pdb { + + /// + /// This class represents the information read from a PDB file (both legacy Windows and Portable). + /// + internal class PdbInfo { + /// + /// Enumeration of per-function information contained in the PDB file. + /// + public PdbFunction[] Functions; + + /// + /// Mapping from tokens to source files and line numbers. + /// + public Dictionary TokenToSourceMapping; + + /// + /// Source server data information. + /// + public string SourceServerData; + + /// + /// Age of the PDB file is used to match the PDB against the PE binary. + /// + public int Age; + + /// + /// GUID of the PDB file is used to match the PDB against the PE binary. + /// + public Guid Guid; + + /// + /// Source link data information. + /// + public byte[] SourceLinkData; + } +} diff --git a/external/cecil/symbols/pdb/Microsoft.Cci.Pdb/PdbLine.cs b/external/cecil/symbols/pdb/Microsoft.Cci.Pdb/PdbLine.cs index f6fe3a9d3e..5e73677689 100644 --- a/external/cecil/symbols/pdb/Microsoft.Cci.Pdb/PdbLine.cs +++ b/external/cecil/symbols/pdb/Microsoft.Cci.Pdb/PdbLine.cs @@ -1,13 +1,6 @@ -//----------------------------------------------------------------------------- -// // Copyright (c) Microsoft. All rights reserved. -// This code is licensed under the Microsoft Public License. -// THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY -// IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR -// PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. -// -//----------------------------------------------------------------------------- +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + using System; namespace Microsoft.Cci.Pdb { diff --git a/external/cecil/symbols/pdb/Microsoft.Cci.Pdb/PdbLines.cs b/external/cecil/symbols/pdb/Microsoft.Cci.Pdb/PdbLines.cs index 382638b70f..18d8974c6e 100644 --- a/external/cecil/symbols/pdb/Microsoft.Cci.Pdb/PdbLines.cs +++ b/external/cecil/symbols/pdb/Microsoft.Cci.Pdb/PdbLines.cs @@ -1,13 +1,6 @@ -//----------------------------------------------------------------------------- -// // Copyright (c) Microsoft. All rights reserved. -// This code is licensed under the Microsoft Public License. -// THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY -// IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR -// PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. -// -//----------------------------------------------------------------------------- +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + using System; namespace Microsoft.Cci.Pdb { diff --git a/external/cecil/symbols/pdb/Microsoft.Cci.Pdb/PdbReader.cs b/external/cecil/symbols/pdb/Microsoft.Cci.Pdb/PdbReader.cs index edfd9263c9..28d02c1000 100644 --- a/external/cecil/symbols/pdb/Microsoft.Cci.Pdb/PdbReader.cs +++ b/external/cecil/symbols/pdb/Microsoft.Cci.Pdb/PdbReader.cs @@ -1,13 +1,6 @@ -//----------------------------------------------------------------------------- -// // Copyright (c) Microsoft. All rights reserved. -// This code is licensed under the Microsoft Public License. -// THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY -// IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR -// PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. -// -//----------------------------------------------------------------------------- +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + using System; using System.IO; diff --git a/external/cecil/symbols/pdb/Microsoft.Cci.Pdb/PdbScope.cs b/external/cecil/symbols/pdb/Microsoft.Cci.Pdb/PdbScope.cs index 92ac385e99..9dad77b9a1 100644 --- a/external/cecil/symbols/pdb/Microsoft.Cci.Pdb/PdbScope.cs +++ b/external/cecil/symbols/pdb/Microsoft.Cci.Pdb/PdbScope.cs @@ -1,13 +1,6 @@ -//----------------------------------------------------------------------------- -// // Copyright (c) Microsoft. All rights reserved. -// This code is licensed under the Microsoft Public License. -// THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY -// IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR -// PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. -// -//----------------------------------------------------------------------------- +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + using System; namespace Microsoft.Cci.Pdb { @@ -22,16 +15,21 @@ namespace Microsoft.Cci.Pdb { internal uint offset; internal uint length; - internal PdbScope(uint address, uint length, PdbSlot[] slots, PdbConstant[] constants, string[] usedNamespaces) { + internal PdbScope(uint address, uint offset, uint length, PdbSlot[] slots, PdbConstant[] constants, string[] usedNamespaces) { this.constants = constants; this.slots = slots; this.scopes = new PdbScope[0]; this.usedNamespaces = usedNamespaces; this.address = address; - this.offset = 0; + this.offset = offset; this.length = length; } + internal PdbScope(uint address, uint length, PdbSlot[] slots, PdbConstant[] constants, string[] usedNamespaces) + : this(address, 0, length, slots, constants, usedNamespaces) + { + } + internal PdbScope(uint funcOffset, BlockSym32 block, BitAccess bits, out uint typind) { //this.segment = block.seg; this.address = block.off; diff --git a/external/cecil/symbols/pdb/Microsoft.Cci.Pdb/PdbSlot.cs b/external/cecil/symbols/pdb/Microsoft.Cci.Pdb/PdbSlot.cs index e2b76d5fb8..b9b8ef707c 100644 --- a/external/cecil/symbols/pdb/Microsoft.Cci.Pdb/PdbSlot.cs +++ b/external/cecil/symbols/pdb/Microsoft.Cci.Pdb/PdbSlot.cs @@ -1,13 +1,6 @@ -//----------------------------------------------------------------------------- -// // Copyright (c) Microsoft. All rights reserved. -// This code is licensed under the Microsoft Public License. -// THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY -// IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR -// PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. -// -//----------------------------------------------------------------------------- +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + using System; namespace Microsoft.Cci.Pdb { @@ -19,6 +12,14 @@ namespace Microsoft.Cci.Pdb { //internal uint segment; //internal uint address; + internal PdbSlot(uint slot, uint typeToken, string name, ushort flags) + { + this.slot = slot; + this.typeToken = typeToken; + this.name = name; + this.flags = flags; + } + internal PdbSlot(BitAccess bits) { AttrSlotSym slot; diff --git a/external/cecil/symbols/pdb/Microsoft.Cci.Pdb/PdbSource.cs b/external/cecil/symbols/pdb/Microsoft.Cci.Pdb/PdbSource.cs index ac40f85160..6310b73ff1 100644 --- a/external/cecil/symbols/pdb/Microsoft.Cci.Pdb/PdbSource.cs +++ b/external/cecil/symbols/pdb/Microsoft.Cci.Pdb/PdbSource.cs @@ -1,13 +1,6 @@ -//----------------------------------------------------------------------------- -// // Copyright (c) Microsoft. All rights reserved. -// This code is licensed under the Microsoft Public License. -// THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY -// IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR -// PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. -// -//----------------------------------------------------------------------------- +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + using System; namespace Microsoft.Cci.Pdb { @@ -17,13 +10,17 @@ namespace Microsoft.Cci.Pdb { internal Guid doctype; internal Guid language; internal Guid vendor; + internal Guid checksumAlgorithm; + internal byte[] checksum; - internal PdbSource(/*uint index, */string name, Guid doctype, Guid language, Guid vendor) { + internal PdbSource(/*uint index, */string name, Guid doctype, Guid language, Guid vendor, Guid checksumAlgorithm, byte[] checksum) { //this.index = index; this.name = name; this.doctype = doctype; this.language = language; this.vendor = vendor; + this.checksumAlgorithm = checksumAlgorithm; + this.checksum = checksum; } } } diff --git a/external/cecil/symbols/pdb/Microsoft.Cci.Pdb/PdbTokenLine.cs b/external/cecil/symbols/pdb/Microsoft.Cci.Pdb/PdbTokenLine.cs index 879339b23a..d59c9c8d09 100644 --- a/external/cecil/symbols/pdb/Microsoft.Cci.Pdb/PdbTokenLine.cs +++ b/external/cecil/symbols/pdb/Microsoft.Cci.Pdb/PdbTokenLine.cs @@ -1,13 +1,6 @@ -//----------------------------------------------------------------------------- -// // Copyright (c) Microsoft. All rights reserved. -// This code is licensed under the Microsoft Public License. -// THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY -// IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR -// PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. -// -//----------------------------------------------------------------------------- +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + using System; namespace Microsoft.Cci.Pdb { diff --git a/external/cecil/symbols/pdb/Microsoft.Cci.Pdb/SourceLocationProvider.cs b/external/cecil/symbols/pdb/Microsoft.Cci.Pdb/SourceLocationProvider.cs index 1c4da186a4..74d0e63b21 100644 --- a/external/cecil/symbols/pdb/Microsoft.Cci.Pdb/SourceLocationProvider.cs +++ b/external/cecil/symbols/pdb/Microsoft.Cci.Pdb/SourceLocationProvider.cs @@ -1,16 +1,13 @@ -//----------------------------------------------------------------------------- -// -// Copyright (C) Microsoft Corporation. All Rights Reserved. -// -//----------------------------------------------------------------------------- +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + using System; using System.Collections.Generic; using System.IO; -using Microsoft.Cci; -using Microsoft.Cci.Pdb; -using System.Text; -namespace Microsoft.Cci { +#pragma warning disable 1591 // TODO: doc comments + +namespace Microsoft.Cci.Pdb { internal sealed class PdbIteratorScope : ILocalScope { diff --git a/external/cecil/symbols/pdb/Mono.Cecil.Pdb/ISymUnmanagedDocumentWriter.cs b/external/cecil/symbols/pdb/Mono.Cecil.Pdb/ISymUnmanagedDocumentWriter.cs index e64ec78d1e..2e8589e73f 100644 --- a/external/cecil/symbols/pdb/Mono.Cecil.Pdb/ISymUnmanagedDocumentWriter.cs +++ b/external/cecil/symbols/pdb/Mono.Cecil.Pdb/ISymUnmanagedDocumentWriter.cs @@ -6,6 +6,7 @@ // Licensed under the MIT/X11 license. // +using System; using System.Runtime.InteropServices; namespace Mono.Cecil.Pdb { @@ -14,5 +15,7 @@ namespace Mono.Cecil.Pdb { [InterfaceType (ComInterfaceType.InterfaceIsIUnknown)] [ComImport] interface ISymUnmanagedDocumentWriter { + void SetSource (uint sourceSize, [MarshalAs (UnmanagedType.LPArray, SizeParamIndex = 0)] byte [] source); + void SetCheckSum (Guid algorithmId, uint checkSumSize, [MarshalAs (UnmanagedType.LPArray, SizeParamIndex = 1)] byte [] checkSum); } } diff --git a/external/cecil/symbols/pdb/Mono.Cecil.Pdb/NativePdbReader.cs b/external/cecil/symbols/pdb/Mono.Cecil.Pdb/NativePdbReader.cs index 9280e0f7e6..2d6b1ba8c4 100644 --- a/external/cecil/symbols/pdb/Mono.Cecil.Pdb/NativePdbReader.cs +++ b/external/cecil/symbols/pdb/Mono.Cecil.Pdb/NativePdbReader.cs @@ -90,17 +90,12 @@ namespace Mono.Cecil.Pdb { bool PopulateFunctions () { using (pdb_file) { - Dictionary tokenToSourceMapping; - string sourceServerData; - int age; - Guid guid; + var info = PdbFile.LoadFunctions (pdb_file.value); - var funcs = PdbFile.LoadFunctions (pdb_file.value, out tokenToSourceMapping, out sourceServerData, out age, out guid); - - if (this.guid != guid) + if (this.guid != info.Guid) return false; - foreach (PdbFunction function in funcs) + foreach (PdbFunction function in info.Functions) functions.Add (function.token, function); } @@ -357,9 +352,11 @@ namespace Mono.Cecil.Pdb { return document; document = new Document (name) { - Language = source.language.ToLanguage (), - LanguageVendor = source.vendor.ToVendor (), - Type = source.doctype.ToType (), + LanguageGuid = source.language, + LanguageVendorGuid = source.vendor, + TypeGuid = source.doctype, + HashAlgorithmGuid = source.checksumAlgorithm, + Hash = source.checksum, }; documents.Add (name, document); return document; diff --git a/external/cecil/symbols/pdb/Mono.Cecil.Pdb/NativePdbWriter.cs b/external/cecil/symbols/pdb/Mono.Cecil.Pdb/NativePdbWriter.cs index a0a07476e6..01b6c7a510 100644 --- a/external/cecil/symbols/pdb/Mono.Cecil.Pdb/NativePdbWriter.cs +++ b/external/cecil/symbols/pdb/Mono.Cecil.Pdb/NativePdbWriter.cs @@ -246,6 +246,9 @@ namespace Mono.Cecil.Pdb { document.LanguageVendorGuid, document.TypeGuid); + if (!document.Hash.IsNullOrEmpty ()) + doc_writer.SetCheckSum (document.HashAlgorithmGuid, document.Hash); + documents [document.Url] = doc_writer; return doc_writer; } diff --git a/external/cecil/symbols/pdb/Mono.Cecil.Pdb/SymDocumentWriter.cs b/external/cecil/symbols/pdb/Mono.Cecil.Pdb/SymDocumentWriter.cs index 83cea8e54b..3112c80a3d 100644 --- a/external/cecil/symbols/pdb/Mono.Cecil.Pdb/SymDocumentWriter.cs +++ b/external/cecil/symbols/pdb/Mono.Cecil.Pdb/SymDocumentWriter.cs @@ -13,16 +13,26 @@ namespace Mono.Cecil.Pdb { internal class SymDocumentWriter { - readonly ISymUnmanagedDocumentWriter m_unmanagedDocumentWriter; + readonly ISymUnmanagedDocumentWriter writer; - public SymDocumentWriter (ISymUnmanagedDocumentWriter unmanagedDocumentWriter) + public ISymUnmanagedDocumentWriter Writer { - m_unmanagedDocumentWriter = unmanagedDocumentWriter; + get { return writer; } } - public ISymUnmanagedDocumentWriter GetUnmanaged () + public SymDocumentWriter (ISymUnmanagedDocumentWriter writer) { - return m_unmanagedDocumentWriter; + this.writer = writer; + } + + public void SetSource (byte [] source) + { + writer.SetSource ((uint) source.Length, source); + } + + public void SetCheckSum (Guid hashAlgo, byte [] checkSum) + { + writer.SetCheckSum (hashAlgo, (uint) checkSum.Length, checkSum); } } } diff --git a/external/cecil/symbols/pdb/Mono.Cecil.Pdb/SymWriter.cs b/external/cecil/symbols/pdb/Mono.Cecil.Pdb/SymWriter.cs index 7006c68c7d..f309f2f6c2 100644 --- a/external/cecil/symbols/pdb/Mono.Cecil.Pdb/SymWriter.cs +++ b/external/cecil/symbols/pdb/Mono.Cecil.Pdb/SymWriter.cs @@ -28,7 +28,7 @@ namespace Mono.Cecil.Pdb static Guid s_symUnmangedWriterIID = new Guid("0b97726e-9e6d-4f05-9a26-424022093caa"); static Guid s_CorSymWriter_SxS_ClassID = new Guid ("108296c1-281e-11d3-bd22-0000f80849bd"); - readonly ISymUnmanagedWriter2 m_writer; + readonly ISymUnmanagedWriter2 writer; readonly Collection documents; public SymWriter () @@ -36,7 +36,7 @@ namespace Mono.Cecil.Pdb object objWriter; CoCreateInstance (ref s_CorSymWriter_SxS_ClassID, null, 1, ref s_symUnmangedWriterIID, out objWriter); - m_writer = (ISymUnmanagedWriter2) objWriter; + writer = (ISymUnmanagedWriter2) objWriter; documents = new Collection (); } @@ -45,10 +45,10 @@ namespace Mono.Cecil.Pdb int size; // get size of debug info - m_writer.GetDebugInfo (out idd, 0, out size, null); + writer.GetDebugInfo (out idd, 0, out size, null); byte[] debug_info = new byte[size]; - m_writer.GetDebugInfo (out idd, size, out size, debug_info); + writer.GetDebugInfo (out idd, size, out size, debug_info); return debug_info; } @@ -63,23 +63,23 @@ namespace Mono.Cecil.Pdb int startOffset, int endOffset) { - m_writer.DefineLocalVariable2 (name, (int)attributes, sigToken, 1 /* ILOffset*/, addr1, addr2, addr3, startOffset, endOffset); + writer.DefineLocalVariable2 (name, (int)attributes, sigToken, 1 /* ILOffset*/, addr1, addr2, addr3, startOffset, endOffset); } public void DefineConstant2 (string name, object value, int sigToken) { if (value == null) { - m_writer.DefineConstant2 (name, 0, sigToken); + writer.DefineConstant2 (name, 0, sigToken); return; } - m_writer.DefineConstant2 (name, value, sigToken); + writer.DefineConstant2 (name, value, sigToken); } public void Close () { - m_writer.Close (); - Marshal.ReleaseComObject (m_writer); + writer.Close (); + Marshal.ReleaseComObject (writer); foreach (var document in documents) Marshal.ReleaseComObject (document); @@ -87,69 +87,69 @@ namespace Mono.Cecil.Pdb public void CloseMethod () { - m_writer.CloseMethod (); + writer.CloseMethod (); } public void CloseNamespace () { - m_writer.CloseNamespace (); + writer.CloseNamespace (); } public void CloseScope (int endOffset) { - m_writer.CloseScope (endOffset); + writer.CloseScope (endOffset); } public SymDocumentWriter DefineDocument (string url, Guid language, Guid languageVendor, Guid documentType) { - ISymUnmanagedDocumentWriter unmanagedDocumentWriter; - m_writer.DefineDocument (url, ref language, ref languageVendor, ref documentType, out unmanagedDocumentWriter); + ISymUnmanagedDocumentWriter doc_writer; + writer.DefineDocument (url, ref language, ref languageVendor, ref documentType, out doc_writer); - documents.Add (unmanagedDocumentWriter); - return new SymDocumentWriter (unmanagedDocumentWriter); + documents.Add (doc_writer); + return new SymDocumentWriter (doc_writer); } public void DefineSequencePoints (SymDocumentWriter document, int[] offsets, int[] lines, int[] columns, int[] endLines, int[] endColumns) { - m_writer.DefineSequencePoints (document.GetUnmanaged(), offsets.Length, offsets, lines, columns, endLines, endColumns); + writer.DefineSequencePoints (document.Writer, offsets.Length, offsets, lines, columns, endLines, endColumns); } public void Initialize (object emitter, string filename, bool fFullBuild) { - m_writer.Initialize (emitter, filename, null, fFullBuild); + writer.Initialize (emitter, filename, null, fFullBuild); } public void SetUserEntryPoint (int methodToken) { - m_writer.SetUserEntryPoint (methodToken); + writer.SetUserEntryPoint (methodToken); } public void OpenMethod (int methodToken) { - m_writer.OpenMethod (methodToken); + writer.OpenMethod (methodToken); } public void OpenNamespace (string name) { - m_writer.OpenNamespace (name); + writer.OpenNamespace (name); } public int OpenScope (int startOffset) { int result; - m_writer.OpenScope (startOffset, out result); + writer.OpenScope (startOffset, out result); return result; } public void UsingNamespace (string fullName) { - m_writer.UsingNamespace (fullName); + writer.UsingNamespace (fullName); } public void DefineCustomMetadata (string name, byte [] metadata) { var handle = GCHandle.Alloc (metadata, GCHandleType.Pinned); - m_writer.SetSymAttribute (0, name, (uint) metadata.Length, handle.AddrOfPinnedObject ()); + writer.SetSymAttribute (0, name, (uint) metadata.Length, handle.AddrOfPinnedObject ()); handle.Free (); } } diff --git a/external/cecil/symbols/pdb/Test/Mono.Cecil.Tests/PdbTests.cs b/external/cecil/symbols/pdb/Test/Mono.Cecil.Tests/PdbTests.cs index 2269cb5c92..797f680590 100644 --- a/external/cecil/symbols/pdb/Test/Mono.Cecil.Tests/PdbTests.cs +++ b/external/cecil/symbols/pdb/Test/Mono.Cecil.Tests/PdbTests.cs @@ -99,7 +99,8 @@ namespace Mono.Cecil.Tests { Assert.AreEqual (@"c:\sources\cecil\symbols\Mono.Cecil.Pdb\Test\Resources\assemblies\test.cs", document.Url); Assert.AreEqual (DocumentType.Text, document.Type); - Assert.AreEqual (DocumentHashAlgorithm.None, document.HashAlgorithm); + Assert.AreEqual (DocumentHashAlgorithm.MD5, document.HashAlgorithm); + Assert.AreEqual (new byte [] { 228, 176, 152, 54, 82, 238, 238, 68, 237, 156, 5, 142, 118, 160, 118, 245 }, document.Hash); Assert.AreEqual (DocumentLanguage.CSharp, document.Language); Assert.AreEqual (DocumentLanguageVendor.Microsoft, document.LanguageVendor); }, readOnly: !Platform.HasNativePdbSupport, symbolReaderProvider: typeof(PdbReaderProvider), symbolWriterProvider: typeof(PdbWriterProvider)); @@ -119,7 +120,8 @@ namespace Mono.Cecil.Tests { Assert.AreEqual (@"c:\tmp\VBConsApp\Program.vb", document.Url); Assert.AreEqual (DocumentType.Text, document.Type); - Assert.AreEqual (DocumentHashAlgorithm.None, document.HashAlgorithm); + Assert.AreEqual (DocumentHashAlgorithm.MD5, document.HashAlgorithm); + Assert.AreEqual (new byte [] { 184, 188, 100, 23, 27, 123, 187, 201, 175, 206, 110, 198, 242, 139, 154, 119 }, document.Hash); Assert.AreEqual (DocumentLanguage.Basic, document.Language); Assert.AreEqual (DocumentLanguageVendor.Microsoft, document.LanguageVendor); }, readOnly: !Platform.HasNativePdbSupport, symbolReaderProvider: typeof(PdbReaderProvider), symbolWriterProvider: typeof(PdbWriterProvider)); diff --git a/external/corefx/src/Common/src/CoreLib/Interop/Unix/System.Native/Interop.ReadDir.cs b/external/corefx/src/Common/src/CoreLib/Interop/Unix/System.Native/Interop.ReadDir.cs index 9e32f1ccc2..5888c80fbc 100644 --- a/external/corefx/src/Common/src/CoreLib/Interop/Unix/System.Native/Interop.ReadDir.cs +++ b/external/corefx/src/Common/src/CoreLib/Interop/Unix/System.Native/Interop.ReadDir.cs @@ -30,21 +30,21 @@ internal static partial class Interop internal byte* Name; internal int NameLength; internal NodeType InodeType; - internal const int NameBufferSize = 256; + internal const int NameBufferSize = 256; // sizeof(dirent->d_name) == NAME_MAX + 1 internal ReadOnlySpan GetName(Span buffer) { - Debug.Assert(buffer.Length >= Encoding.UTF8.GetMaxCharCount(NameBufferSize - 1), "should have enough space for the max file name"); + // -1 for null terminator (buffer will not include one), + // and -1 because GetMaxCharCount pessimistically assumes the buffer may start with a partial surrogate + Debug.Assert(buffer.Length >= Encoding.UTF8.GetMaxCharCount(NameBufferSize - 1 - 1)); Debug.Assert(Name != null, "should not have a null name"); ReadOnlySpan nameBytes = (NameLength == -1) // In this case the struct was allocated via struct dirent *readdir(DIR *dirp); - ? new ReadOnlySpan(Name, new ReadOnlySpan(Name, NameBufferSize - 1).IndexOf(0)) + ? new ReadOnlySpan(Name, new ReadOnlySpan(Name, NameBufferSize).IndexOf(0)) : new ReadOnlySpan(Name, NameLength); Debug.Assert(nameBytes.Length > 0, "we shouldn't have gotten a garbage value from the OS"); - if (nameBytes.Length == 0) - return buffer.Slice(0, 0); int charCount = Encoding.UTF8.GetChars(nameBytes, buffer); ReadOnlySpan value = buffer.Slice(0, charCount); diff --git a/external/corefx/src/Common/src/CoreLib/Interop/Unix/System.Native/Interop.Stat.cs b/external/corefx/src/Common/src/CoreLib/Interop/Unix/System.Native/Interop.Stat.cs index 0ca199b70d..cb0f4284f0 100644 --- a/external/corefx/src/Common/src/CoreLib/Interop/Unix/System.Native/Interop.Stat.cs +++ b/external/corefx/src/Common/src/CoreLib/Interop/Unix/System.Native/Interop.Stat.cs @@ -33,6 +33,7 @@ internal static partial class Interop internal long BirthTimeNsec; internal long Dev; internal long Ino; + internal uint UserFlags; } internal static class FileTypes diff --git a/external/corefx/src/Common/src/Interop/Unix/System.Native/Interop.LChflags.cs b/external/corefx/src/Common/src/Interop/Unix/System.Native/Interop.LChflags.cs new file mode 100644 index 0000000000..bf0ecf72b7 --- /dev/null +++ b/external/corefx/src/Common/src/Interop/Unix/System.Native/Interop.LChflags.cs @@ -0,0 +1,26 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; +using System.Runtime.InteropServices; + +internal static partial class Interop +{ + internal static partial class Sys + { + [Flags] + internal enum UserFlags : uint + { + UF_HIDDEN = 0x8000 + } + + [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_LChflags", SetLastError = true)] + internal static extern int LChflags(string path, uint flags); + + internal static readonly bool CanSetHiddenFlag = (LChflagsCanSetHiddenFlag() != 0); + + [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_LChflagsCanSetHiddenFlag")] + private static extern int LChflagsCanSetHiddenFlag(); + } +} \ No newline at end of file diff --git a/external/corefx/src/Common/src/Interop/Unix/System.Native/Interop.Stat.cs b/external/corefx/src/Common/src/Interop/Unix/System.Native/Interop.Stat.cs index 0ca199b70d..cb0f4284f0 100644 --- a/external/corefx/src/Common/src/Interop/Unix/System.Native/Interop.Stat.cs +++ b/external/corefx/src/Common/src/Interop/Unix/System.Native/Interop.Stat.cs @@ -33,6 +33,7 @@ internal static partial class Interop internal long BirthTimeNsec; internal long Dev; internal long Ino; + internal uint UserFlags; } internal static class FileTypes diff --git a/external/corefx/src/Native/Unix/Common/pal_config.h.in b/external/corefx/src/Native/Unix/Common/pal_config.h.in index c76d309940..033e390489 100644 --- a/external/corefx/src/Native/Unix/Common/pal_config.h.in +++ b/external/corefx/src/Native/Unix/Common/pal_config.h.in @@ -16,6 +16,8 @@ #cmakedefine01 HAVE_STAT_TIMESPEC #cmakedefine01 HAVE_STAT_TIM #cmakedefine01 HAVE_STAT_NSEC +#cmakedefine01 HAVE_STAT_FLAGS +#cmakedefine01 HAVE_LCHFLAGS #cmakedefine01 HAVE_GNU_STRERROR_R #cmakedefine01 HAVE_READDIR_R #cmakedefine01 HAVE_DIRENT_NAME_LEN diff --git a/external/corefx/src/Native/Unix/System.Native/pal_io.c b/external/corefx/src/Native/Unix/System.Native/pal_io.c index c3b5aff83b..ddd56b91c9 100644 --- a/external/corefx/src/Native/Unix/System.Native/pal_io.c +++ b/external/corefx/src/Native/Unix/System.Native/pal_io.c @@ -166,6 +166,12 @@ static void ConvertFileStatus(const struct stat_* src, struct FileStatus* dst) dst->BirthTime = 0; dst->BirthTimeNsec = 0; #endif + +#if defined(HAVE_STAT_FLAGS) && defined(UF_HIDDEN) + dst->UserFlags = ((src->st_flags & UF_HIDDEN) == UF_HIDDEN) ? PAL_UF_HIDDEN : 0; +#else + dst->UserFlags = 0; +#endif } // CoreCLR expects the "2" suffixes on these: they should be cleaned up in our @@ -1460,6 +1466,28 @@ int32_t SystemNative_LockFileRegion(intptr_t fd, int64_t offset, int64_t length, return ret; } +int32_t SystemNative_LChflags(const char* path, uint32_t flags) +{ +#if HAVE_LCHFLAGS + int32_t result; + while ((result = lchflags(path, flags)) < 0 && errno == EINTR); + return result; +#else + (void)path, (void)flags; + errno = ENOTSUP; + return -1; +#endif +} + +int32_t SystemNative_LChflagsCanSetHiddenFlag(void) +{ +#if defined(UF_HIDDEN) && defined(HAVE_STAT_FLAGS) && defined(HAVE_LCHFLAGS) + return true; +#else + return false; +#endif +} + int32_t SystemNative_Symlink(const char* target, const char* linkPath) { return symlink(target, linkPath); diff --git a/external/corefx/src/Native/Unix/System.Native/pal_io.h b/external/corefx/src/Native/Unix/System.Native/pal_io.h index aab12e6ed3..f13cdc6606 100644 --- a/external/corefx/src/Native/Unix/System.Native/pal_io.h +++ b/external/corefx/src/Native/Unix/System.Native/pal_io.h @@ -35,6 +35,7 @@ struct FileStatus int64_t BirthTimeNsec; // nanosecond part int64_t Dev; // ID of the device containing the file int64_t Ino; // inode number of the file + uint32_t UserFlags; // user defined flags }; /* Provide consistent access to nanosecond fields, if they exist. */ @@ -153,6 +154,14 @@ enum FILESTATUS_FLAGS_HAS_BIRTHTIME = 1, }; +/** + * Constants for interpreting FileStatus.UserFlags. + */ +enum +{ + PAL_UF_HIDDEN = 0x8000 +}; + /** * Constants from dirent.h for the inode type returned from readdir variants */ @@ -750,6 +759,20 @@ DLLEXPORT int32_t SystemNative_GetPeerID(intptr_t socket, uid_t* euid); */ DLLEXPORT int32_t SystemNative_LockFileRegion(intptr_t fd, int64_t offset, int64_t length, int16_t lockType); +/** +* Changes the file flags of the file whose location is specified in path +* +* Returns 0 for success, -1 for failure. Sets errno for failure. +*/ +DLLEXPORT int32_t SystemNative_LChflags(const char* path, uint32_t flags); + +/** + * Determines if the current platform supports setting UF_HIDDEN (0x8000) flag + * + * Returns true (non-zero) if supported, false (zero) if not. + */ +DLLEXPORT int32_t SystemNative_LChflagsCanSetHiddenFlag(void); + /** * Creates a symbolic link at "linkPath", pointing at "target". * "target" may or may not exist (dangling symbolic links are valid filesystem objects) diff --git a/external/corefx/src/System.IO.FileSystem/src/System.IO.FileSystem.csproj b/external/corefx/src/System.IO.FileSystem/src/System.IO.FileSystem.csproj index df9ff7154e..b7eb4c460c 100644 --- a/external/corefx/src/System.IO.FileSystem/src/System.IO.FileSystem.csproj +++ b/external/corefx/src/System.IO.FileSystem/src/System.IO.FileSystem.csproj @@ -284,6 +284,9 @@ Common\Interop\Unix\Interop.Read.cs + + Common\Interop\Unix\Interop.LChflags.cs + Common\Interop\Unix\Interop.Rename.cs diff --git a/external/corefx/src/System.IO.FileSystem/src/System/IO/Enumeration/FileSystemEntry.Unix.cs b/external/corefx/src/System.IO.FileSystem/src/System/IO/Enumeration/FileSystemEntry.Unix.cs index 1139d2f3f5..728275bf95 100644 --- a/external/corefx/src/System.IO.FileSystem/src/System/IO/Enumeration/FileSystemEntry.Unix.cs +++ b/external/corefx/src/System.IO.FileSystem/src/System/IO/Enumeration/FileSystemEntry.Unix.cs @@ -10,14 +10,13 @@ namespace System.IO.Enumeration /// Lower level view of FileSystemInfo used for processing and filtering find results. /// public unsafe ref partial struct FileSystemEntry - { - private const int FileNameBufferSize = 256; + { internal Interop.Sys.DirectoryEntry _directoryEntry; private FileStatus _status; private Span _pathBuffer; private ReadOnlySpan _fullPath; private ReadOnlySpan _fileName; - private fixed char _fileNameBuffer[FileNameBufferSize]; + private fixed char _fileNameBuffer[Interop.Sys.DirectoryEntry.NameBufferSize]; private FileAttributes _initialAttributes; internal static FileAttributes Initialize( @@ -112,7 +111,7 @@ namespace System.IO.Enumeration { fixed (char* c = _fileNameBuffer) { - Span buffer = new Span(c, FileNameBufferSize); + Span buffer = new Span(c, Interop.Sys.DirectoryEntry.NameBufferSize); _fileName = _directoryEntry.GetName(buffer); } } diff --git a/external/corefx/src/System.IO.FileSystem/src/System/IO/FileStatus.Unix.cs b/external/corefx/src/System.IO.FileSystem/src/System/IO/FileStatus.Unix.cs index 3acb4c5747..670317d4db 100644 --- a/external/corefx/src/System.IO.FileSystem/src/System/IO/FileStatus.Unix.cs +++ b/external/corefx/src/System.IO.FileSystem/src/System/IO/FileStatus.Unix.cs @@ -84,8 +84,8 @@ namespace System.IO if (_isDirectory) attributes |= FileAttributes.Directory; - // If the filename starts with a period, it's hidden. - if (fileName.Length > 0 && fileName[0] == '.') + // If the filename starts with a period or has UF_HIDDEN flag set, it's hidden. + if (fileName.Length > 0 && (fileName[0] == '.' || (_fileStatus.UserFlags & (uint)Interop.Sys.UserFlags.UF_HIDDEN) == (uint)Interop.Sys.UserFlags.UF_HIDDEN)) attributes |= FileAttributes.Hidden; return attributes != default ? attributes : FileAttributes.Normal; @@ -98,10 +98,10 @@ namespace System.IO const FileAttributes allValidFlags = FileAttributes.Archive | FileAttributes.Compressed | FileAttributes.Device | FileAttributes.Directory | FileAttributes.Encrypted | FileAttributes.Hidden | - FileAttributes.Hidden | FileAttributes.IntegrityStream | FileAttributes.Normal | - FileAttributes.NoScrubData | FileAttributes.NotContentIndexed | FileAttributes.Offline | - FileAttributes.ReadOnly | FileAttributes.ReparsePoint | FileAttributes.SparseFile | - FileAttributes.System | FileAttributes.Temporary; + FileAttributes.IntegrityStream | FileAttributes.Normal | FileAttributes.NoScrubData | + FileAttributes.NotContentIndexed | FileAttributes.Offline | FileAttributes.ReadOnly | + FileAttributes.ReparsePoint | FileAttributes.SparseFile | FileAttributes.System | + FileAttributes.Temporary; if ((attributes & ~allValidFlags) != 0) { // Using constant string for argument to match historical throw @@ -113,6 +113,26 @@ namespace System.IO if (!_exists) FileSystemInfo.ThrowNotFound(path); + if (Interop.Sys.CanSetHiddenFlag) + { + if ((attributes & FileAttributes.Hidden) != 0) + { + if ((_fileStatus.UserFlags & (uint)Interop.Sys.UserFlags.UF_HIDDEN) == 0) + { + // If Hidden flag is set and cached file status does not have the flag set then set it + Interop.CheckIo(Interop.Sys.LChflags(path, (_fileStatus.UserFlags | (uint)Interop.Sys.UserFlags.UF_HIDDEN)), path, InitiallyDirectory); + } + } + else + { + if ((_fileStatus.UserFlags & (uint)Interop.Sys.UserFlags.UF_HIDDEN) == (uint)Interop.Sys.UserFlags.UF_HIDDEN) + { + // If Hidden flag is not set and cached file status does have the flag set then remove it + Interop.CheckIo(Interop.Sys.LChflags(path, (_fileStatus.UserFlags & ~(uint)Interop.Sys.UserFlags.UF_HIDDEN)), path, InitiallyDirectory); + } + } + } + // The only thing we can reasonably change is whether the file object is readonly by changing permissions. int newMode = _fileStatus.Mode; diff --git a/external/corefx/src/System.IO.FileSystem/tests/Base/FileGetSetAttributes.cs b/external/corefx/src/System.IO.FileSystem/tests/Base/FileGetSetAttributes.cs index 408666e819..434af1cb5f 100644 --- a/external/corefx/src/System.IO.FileSystem/tests/Base/FileGetSetAttributes.cs +++ b/external/corefx/src/System.IO.FileSystem/tests/Base/FileGetSetAttributes.cs @@ -16,9 +16,16 @@ namespace System.IO.Tests public void SettingAttributes_Unix(FileAttributes attributes) { string path = CreateItem(); - SetAttributes(path, attributes); - Assert.Equal(attributes, GetAttributes(path)); - SetAttributes(path, 0); + AssertSettingAttributes(path, attributes); + } + + [Theory] + [InlineData(FileAttributes.Hidden)] + [PlatformSpecific(TestPlatforms.OSX | TestPlatforms.FreeBSD)] + public void SettingAttributes_OSXAndFreeBSD(FileAttributes attributes) + { + string path = CreateItem(); + AssertSettingAttributes(path, attributes); } [Theory] @@ -33,6 +40,11 @@ namespace System.IO.Tests public void SettingAttributes_Windows(FileAttributes attributes) { string path = CreateItem(); + AssertSettingAttributes(path, attributes); + } + + private void AssertSettingAttributes(string path, FileAttributes attributes) + { SetAttributes(path, attributes); Assert.Equal(attributes, GetAttributes(path)); SetAttributes(path, 0); @@ -48,8 +60,16 @@ namespace System.IO.Tests public void SettingInvalidAttributes_Unix(FileAttributes attributes) { string path = CreateItem(); - SetAttributes(path, attributes); - Assert.Equal(FileAttributes.Normal, GetAttributes(path)); + AssertSettingInvalidAttributes(path, attributes); + } + + [Theory] + [InlineData(FileAttributes.Hidden)] + [PlatformSpecific(TestPlatforms.AnyUnix & ~(TestPlatforms.OSX | TestPlatforms.FreeBSD))] + public void SettingInvalidAttributes_UnixExceptOSXAndFreeBSD(FileAttributes attributes) + { + string path = CreateItem(); + AssertSettingInvalidAttributes(path, attributes); } [Theory] @@ -62,6 +82,11 @@ namespace System.IO.Tests public void SettingInvalidAttributes_Windows(FileAttributes attributes) { string path = CreateItem(); + AssertSettingInvalidAttributes(path, attributes); + } + + private void AssertSettingInvalidAttributes(string path, FileAttributes attributes) + { SetAttributes(path, attributes); Assert.Equal(FileAttributes.Normal, GetAttributes(path)); } diff --git a/external/corefx/src/System.IO.FileSystem/tests/Enumeration/ErrorHandlingTests.netcoreapp.cs b/external/corefx/src/System.IO.FileSystem/tests/Enumeration/ErrorHandlingTests.netcoreapp.cs index e4c85d831e..60bc3d9224 100644 --- a/external/corefx/src/System.IO.FileSystem/tests/Enumeration/ErrorHandlingTests.netcoreapp.cs +++ b/external/corefx/src/System.IO.FileSystem/tests/Enumeration/ErrorHandlingTests.netcoreapp.cs @@ -2,6 +2,9 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +using System; +using System.Collections.Generic; +using System.Linq; using System.IO.Enumeration; using Xunit; @@ -96,5 +99,39 @@ namespace System.IO.Tests Assert.Equal(info.FullName, ie.DirectoryFinished); } } + + [Fact] + public void VariableLengthFileNames_AllCreatableFilesAreEnumerable() + { + DirectoryInfo testDirectory = Directory.CreateDirectory(GetTestFilePath()); + var names = new List(); + + for (int length = 1; length < 10_000; length++) // arbitrarily large limit for the test + { + string name = new string('a', length); + try { File.Create(Path.Join(testDirectory.FullName, name)).Dispose(); } + catch { break; } + names.Add(name); + } + Assert.InRange(names.Count, 1, int.MaxValue); + Assert.Equal(names.OrderBy(n => n), Directory.GetFiles(testDirectory.FullName).Select(n => Path.GetFileName(n)).OrderBy(n => n)); + } + + [Fact] + public void VariableLengthDirectoryNames_AllCreatableDirectoriesAreEnumerable() + { + DirectoryInfo testDirectory = Directory.CreateDirectory(GetTestFilePath()); + var names = new List(); + + for (int length = 1; length < 10_000; length++) // arbitrarily large limit for the test + { + string name = new string('a', length); + try { Directory.CreateDirectory(Path.Join(testDirectory.FullName, name)); } + catch { break; } + names.Add(name); + } + Assert.InRange(names.Count, 1, int.MaxValue); + Assert.Equal(names.OrderBy(n => n), Directory.GetDirectories(testDirectory.FullName).Select(n => Path.GetFileName(n)).OrderBy(n => n)); + } } } diff --git a/external/corefx/src/System.IO.FileSystem/tests/File/Create.cs b/external/corefx/src/System.IO.FileSystem/tests/File/Create.cs index c910e735b3..be16528e76 100644 --- a/external/corefx/src/System.IO.FileSystem/tests/File/Create.cs +++ b/external/corefx/src/System.IO.FileSystem/tests/File/Create.cs @@ -168,6 +168,33 @@ namespace System.IO.Tests #region PlatformSpecific + [Fact] + [PlatformSpecific(TestPlatforms.AnyUnix)] + public void LongDirectoryName() + { + // 255 = NAME_MAX on Linux and macOS + DirectoryInfo path = Directory.CreateDirectory(Path.Combine(GetTestFilePath(), new string('a', 255))); + + Assert.True(Directory.Exists(path.FullName)); + Directory.Delete(path.FullName); + Assert.False(Directory.Exists(path.FullName)); + } + + [Fact] + [PlatformSpecific(TestPlatforms.AnyUnix)] + public void LongFileName() + { + // 255 = NAME_MAX on Linux and macOS + var dir = GetTestFilePath(); + Directory.CreateDirectory(dir); + var path = Path.Combine(dir, new string('b', 255)); + File.Create(path).Dispose(); + + Assert.True(File.Exists(path)); + File.Delete(path); + Assert.False(File.Exists(path)); + } + [Fact] [PlatformSpecific(CaseSensitivePlatforms)] public void CaseSensitive() diff --git a/external/corefx/src/System.IO.FileSystem/tests/FileInfo/GetSetAttributes.cs b/external/corefx/src/System.IO.FileSystem/tests/FileInfo/GetSetAttributes.cs index 89a92f4fb2..1bdfb98db2 100644 --- a/external/corefx/src/System.IO.FileSystem/tests/FileInfo/GetSetAttributes.cs +++ b/external/corefx/src/System.IO.FileSystem/tests/FileInfo/GetSetAttributes.cs @@ -28,5 +28,18 @@ namespace System.IO.Tests test.Refresh(); Assert.Equal(false, test.IsReadOnly); } + + [Theory] + [InlineData(".", true)] + [InlineData("", false)] + [PlatformSpecific(TestPlatforms.OSX)] + public void HiddenAttributeSetCorrectly_OSX(string filePrefix, bool hidden) + { + string testFilePath = Path.Combine(TestDirectory, $"{filePrefix}{GetTestFileName()}"); + FileInfo fileInfo = new FileInfo(testFilePath); + fileInfo.Create().Dispose(); + + Assert.Equal(hidden, (fileInfo.Attributes & FileAttributes.Hidden) == FileAttributes.Hidden); + } } } diff --git a/external/corefx/src/System.IO.FileSystem/tests/FileStream/LockUnlock.cs b/external/corefx/src/System.IO.FileSystem/tests/FileStream/LockUnlock.cs index 2d7207e8d5..68e7a56336 100644 --- a/external/corefx/src/System.IO.FileSystem/tests/FileStream/LockUnlock.cs +++ b/external/corefx/src/System.IO.FileSystem/tests/FileStream/LockUnlock.cs @@ -153,7 +153,7 @@ namespace System.IO.Tests } } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWindowsSubsystemForLinux))] // https://github.com/dotnet/corefx/issues/34397 [InlineData(10, 0, 10, 1, 2)] [InlineData(10, 3, 5, 3, 5)] [InlineData(10, 3, 5, 3, 4)] diff --git a/external/corefx/src/System.Linq.Parallel/src/System/Linq/Parallel/Scheduling/Scheduling.cs b/external/corefx/src/System.Linq.Parallel/src/System/Linq/Parallel/Scheduling/Scheduling.cs index 945994e06e..8cfadde679 100644 --- a/external/corefx/src/System.Linq.Parallel/src/System/Linq/Parallel/Scheduling/Scheduling.cs +++ b/external/corefx/src/System.Linq.Parallel/src/System/Linq/Parallel/Scheduling/Scheduling.cs @@ -31,9 +31,15 @@ namespace System.Linq.Parallel // Whether to preserve order by default, when neither AsOrdered nor AsUnordered is used. internal const bool DefaultPreserveOrder = false; +#if MONO + // By default limit to degree of 16 to avoid too much contention. It's + // still possible to override that to a maximum of MAX_SUPPORTED_DOP. + internal static int DefaultDegreeOfParallelism = Math.Min(Environment.ProcessorCount, 16); +#else // The default degree of parallelism, or -1 if unspecified. Dev unit tests set this value // to change the default DOP. internal static int DefaultDegreeOfParallelism = Math.Min(Environment.ProcessorCount, MAX_SUPPORTED_DOP); +#endif // The size to use for bounded buffers. internal const int DEFAULT_BOUNDED_BUFFER_CAPACITY = 512; diff --git a/external/corefx/src/System.Net.Http/src/System/Net/Http/Headers/UriHeaderParser.cs b/external/corefx/src/System.Net.Http/src/System/Net/Http/Headers/UriHeaderParser.cs index a2d483f9ff..7c0444efc4 100644 --- a/external/corefx/src/System.Net.Http/src/System/Net/Http/Headers/UriHeaderParser.cs +++ b/external/corefx/src/System.Net.Http/src/System/Net/Http/Headers/UriHeaderParser.cs @@ -13,8 +13,17 @@ namespace System.Net.Http.Headers { private UriKind _uriKind; +#if MONO + // FIXME: Workaround for https://github.com/mono/mono/issues/17897. + // This is the same as setting the MONO_URI_DOTNETRELATIVEORABSOLUTE=true + // environment variable. + // See https://github.com/mono/mono/blob/1454b010ae1165a0f2cf261b9420e32d1b52fdaf/mcs/class/referencesource/System/net/System/URI.cs#L991. + internal static readonly UriHeaderParser RelativeOrAbsoluteUriParser = + new UriHeaderParser((UriKind)300); +#else internal static readonly UriHeaderParser RelativeOrAbsoluteUriParser = new UriHeaderParser(UriKind.RelativeOrAbsolute); +#endif private UriHeaderParser(UriKind uriKind) : base(false) diff --git a/external/linker/eng/Version.Details.xml b/external/linker/eng/Version.Details.xml index 515529893c..f10ba74c20 100644 --- a/external/linker/eng/Version.Details.xml +++ b/external/linker/eng/Version.Details.xml @@ -3,9 +3,9 @@ - + https://github.com/dotnet/arcade - ec2dd5b3e7d11b88b2ca0688bb1685836cfad20a + da75c6547c64a91eb8a9cecf8c503331c2cc394a diff --git a/external/linker/eng/Versions.props b/external/linker/eng/Versions.props index 4593f389e7..9a2b324958 100644 --- a/external/linker/eng/Versions.props +++ b/external/linker/eng/Versions.props @@ -5,16 +5,11 @@ prerelease - 3.0.0-preview4-27520-71 + + 5.0.0-alpha1.19413.7 1.5.0 15.4.8 15.4.8 - - - $(RestoreSources); - https://dotnetfeed.blob.core.windows.net/dotnet-coreclr/index.json - - diff --git a/external/linker/eng/azure-pipelines.yml b/external/linker/eng/azure-pipelines.yml index 7ea7b62cb2..0304d82d8e 100644 --- a/external/linker/eng/azure-pipelines.yml +++ b/external/linker/eng/azure-pipelines.yml @@ -1,3 +1,10 @@ +trigger: + batch: true + branches: + include: + - master + - release/* + variables: - name: officialBuild value: ${{ and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }} @@ -29,7 +36,7 @@ jobs: ${{ if eq(variables.officialBuild, 'false') }}: name: Hosted VS2017 ${{ if eq(variables.officialBuild, 'true') }}: - name: NetCoreInternal-Int-Pool + name: NetCoreInternal-Pool queue: BuildPool.Windows.10.Amd64.VS2017 variables: - ${{ if eq(variables.officialBuild, 'false') }}: diff --git a/external/linker/eng/common/build.ps1 b/external/linker/eng/common/build.ps1 index feb58d1419..e001ccb481 100644 --- a/external/linker/eng/common/build.ps1 +++ b/external/linker/eng/common/build.ps1 @@ -85,6 +85,10 @@ function Build { # Re-assign properties to a new variable because PowerShell doesn't let us append properties directly for unclear reasons. # Explicitly set the type as string[] because otherwise PowerShell would make this char[] if $properties is empty. [string[]] $msbuildArgs = $properties + + # Resolve relative project paths into full paths + $projects = ($projects.Split(';').ForEach({Resolve-Path $_}) -join ';') + $msbuildArgs += "/p:Projects=$projects" $properties = $msbuildArgs } diff --git a/external/linker/eng/common/darc-init.ps1 b/external/linker/eng/common/darc-init.ps1 index 8854d979f3..1bf15f435d 100644 --- a/external/linker/eng/common/darc-init.ps1 +++ b/external/linker/eng/common/darc-init.ps1 @@ -1,9 +1,9 @@ param ( $darcVersion = $null, - $versionEndpoint = "https://maestro-prod.westus2.cloudapp.azure.com/api/assets/darc-version?api-version=2019-01-16" + $versionEndpoint = "https://maestro-prod.westus2.cloudapp.azure.com/api/assets/darc-version?api-version=2019-01-16", + $verbosity = "m" ) -$verbosity = "m" . $PSScriptRoot\tools.ps1 function InstallDarcCli ($darcVersion) { @@ -23,7 +23,7 @@ function InstallDarcCli ($darcVersion) { $darcVersion = $(Invoke-WebRequest -Uri $versionEndpoint -UseBasicParsing).Content } - $arcadeServicesSource = 'https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json' + $arcadeServicesSource = 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json' Write-Host "Installing Darc CLI version $darcVersion..." Write-Host "You may need to restart your command window if this is the first dotnet tool you have installed." diff --git a/external/linker/eng/common/darc-init.sh b/external/linker/eng/common/darc-init.sh index abdd0bc05a..6c37281b83 100755 --- a/external/linker/eng/common/darc-init.sh +++ b/external/linker/eng/common/darc-init.sh @@ -3,6 +3,7 @@ source="${BASH_SOURCE[0]}" darcVersion='' versionEndpoint="https://maestro-prod.westus2.cloudapp.azure.com/api/assets/darc-version?api-version=2019-01-16" +verbosity=m while [[ $# > 0 ]]; do opt="$(echo "$1" | awk '{print tolower($0)}')" @@ -15,6 +16,10 @@ while [[ $# > 0 ]]; do versionEndpoint=$2 shift ;; + --verbosity) + verbosity=$2 + shift + ;; *) echo "Invalid argument: $1" usage @@ -34,7 +39,6 @@ while [[ -h "$source" ]]; do [[ $source != /* ]] && source="$scriptroot/$source" done scriptroot="$( cd -P "$( dirname "$source" )" && pwd )" -verbosity=m . "$scriptroot/tools.sh" @@ -54,7 +58,7 @@ function InstallDarcCli { echo $($dotnet_root/dotnet tool uninstall $darc_cli_package_name -g) fi - local arcadeServicesSource="https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json" + local arcadeServicesSource="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json" echo "Installing Darc CLI version $darcVersion..." echo "You may need to restart your command shell if this is the first dotnet tool you have installed." diff --git a/external/linker/eng/common/enable-cross-org-publishing.ps1 b/external/linker/eng/common/enable-cross-org-publishing.ps1 new file mode 100644 index 0000000000..eccbf9f1b1 --- /dev/null +++ b/external/linker/eng/common/enable-cross-org-publishing.ps1 @@ -0,0 +1,6 @@ +param( + [string] $token +) + +Write-Host "##vso[task.setvariable variable=VSS_NUGET_ACCESSTOKEN]$token" +Write-Host "##vso[task.setvariable variable=VSS_NUGET_URI_PREFIXES]https://dnceng.pkgs.visualstudio.com/;https://pkgs.dev.azure.com/dnceng/;https://devdiv.pkgs.visualstudio.com/;https://pkgs.dev.azure.com/devdiv/" diff --git a/external/linker/eng/common/init-tools-native.ps1 b/external/linker/eng/common/init-tools-native.ps1 index 8cf18bcfeb..0fc0503ab9 100644 --- a/external/linker/eng/common/init-tools-native.ps1 +++ b/external/linker/eng/common/init-tools-native.ps1 @@ -133,6 +133,7 @@ try { if (Test-Path $InstallBin) { Write-Host "Native tools are available from" (Convert-Path -Path $InstallBin) Write-Host "##vso[task.prependpath]$(Convert-Path -Path $InstallBin)" + return $InstallBin } else { Write-Error "Native tools install directory does not exist, installation failed" diff --git a/external/linker/eng/common/native/CommonLibrary.psm1 b/external/linker/eng/common/native/CommonLibrary.psm1 index 2a08d5246e..41416862d9 100644 --- a/external/linker/eng/common/native/CommonLibrary.psm1 +++ b/external/linker/eng/common/native/CommonLibrary.psm1 @@ -152,6 +152,8 @@ function Get-File { } else { Write-Verbose "Downloading $Uri" + # Don't display the console progress UI - it's a huge perf hit + $ProgressPreference = 'SilentlyContinue' while($Attempt -Lt $DownloadRetries) { try { diff --git a/external/linker/eng/common/performance/perfhelixpublish.proj b/external/linker/eng/common/performance/perfhelixpublish.proj index 05e5f09891..e5826b5323 100644 --- a/external/linker/eng/common/performance/perfhelixpublish.proj +++ b/external/linker/eng/common/performance/perfhelixpublish.proj @@ -5,8 +5,14 @@ --dotnet-versions %DOTNET_VERSION% --cli-source-info args --cli-branch %PERFLAB_BRANCH% --cli-commit-sha %PERFLAB_HASH% --cli-repository https://github.com/%PERFLAB_REPO% --cli-source-timestamp %PERFLAB_BUILDTIMESTAMP% py -3 %HELIX_CORRELATION_PAYLOAD%\Core_Root\CoreRun.exe + %HELIX_CORRELATION_PAYLOAD%\Baseline_Core_Root\CoreRun.exe $(HelixPreCommands);call %HELIX_CORRELATION_PAYLOAD%\performance\tools\machine-setup.cmd %HELIX_CORRELATION_PAYLOAD%\artifacts\BenchmarkDotNet.Artifacts + %HELIX_CORRELATION_PAYLOAD%\artifacts\BenchmarkDotNet.Artifacts_Baseline + %HELIX_CORRELATION_PAYLOAD%\performance\src\tools\ResultsComparer\ResultsComparer.csproj + %HELIX_CORRELATION_PAYLOAD%\performance\tools\dotnet\$(Architecture)\dotnet.exe + %25%25 + %HELIX_WORKITEM_ROOT%\testResults.xml @@ -24,14 +30,24 @@ --dotnet-versions $DOTNET_VERSION --cli-source-info args --cli-branch $PERFLAB_BRANCH --cli-commit-sha $PERFLAB_HASH --cli-repository https://github.com/$PERFLAB_REPO --cli-source-timestamp $PERFLAB_BUILDTIMESTAMP python3 $(BaseDirectory)/Core_Root/corerun + $(BaseDirectory)/Baseline_Core_Root/corerun $(HelixPreCommands);chmod +x $(PerformanceDirectory)/tools/machine-setup.sh;. $(PerformanceDirectory)/tools/machine-setup.sh $(BaseDirectory)/artifacts/BenchmarkDotNet.Artifacts + $(BaseDirectory)/artifacts/BenchmarkDotNet.Artifacts_Baseline + $(PerformanceDirectory)/src/tools/ResultsComparer/ResultsComparer.csproj + $(PerformanceDirectory)/tools/dotnet/$(Architecture)/dotnet + %25 + $HELIX_WORKITEM_ROOT/testResults.xml --corerun $(CoreRun) + + --corerun $(BaselineCoreRun) + + $(Python) $(WorkItemCommand) --incremental no --architecture $(Architecture) -f $(_Framework) $(PerfLabArguments) @@ -57,20 +73,29 @@ + + false + + $(WorkItemDirectory) - $(WorkItemCommand) --bdn-arguments="--anyCategories $(BDNCategories) $(ExtraBenchmarkDotNetArguments) $(CoreRunArgument) --artifacts $(ArtifactsDirectory) --partition-count $(PartitionCount) --partition-index %(HelixWorkItem.Index)" + $(WorkItemCommand) --bdn-artifacts $(BaselineArtifactsDirectory) --bdn-arguments="--anyCategories $(BDNCategories) $(ExtraBenchmarkDotNetArguments) $(BaselineCoreRunArgument) --partition-count $(PartitionCount) --partition-index %(HelixWorkItem.Index)" + $(WorkItemCommand) --bdn-artifacts $(ArtifactsDirectory) --bdn-arguments="--anyCategories $(BDNCategories) $(ExtraBenchmarkDotNetArguments) $(CoreRunArgument) --partition-count $(PartitionCount) --partition-index %(HelixWorkItem.Index)" + $(DotnetExe) run -f $(_Framework) -p $(ResultsComparer) --base $(BaselineArtifactsDirectory) --diff $(ArtifactsDirectory) --threshold 2$(Percent) --xml $(XMLResults);$(FinalCommand) 4:00 + $(WorkItemDirectory) - $(WorkItemCommand) --bdn-arguments="--anyCategories $(BDNCategories) $(ExtraBenchmarkDotNetArguments) $(CoreRunArgument) --artifacts $(ArtifactsDirectory)" + $(WorkItemCommand) --bdn-artifacts $(BaselineArtifactsDirectory) --bdn-arguments="--anyCategories $(BDNCategories) $(ExtraBenchmarkDotNetArguments) $(BaselineCoreRunArgument)" + $(WorkItemCommand) --bdn-artifacts $(ArtifactsDirectory) --bdn-arguments="--anyCategories $(BDNCategories) $(ExtraBenchmarkDotNetArguments) $(CoreRunArgument)" + $(DotnetExe) run -f $(_Framework) -p $(ResultsComparer) --base $(BaselineArtifactsDirectory) --diff $(ArtifactsDirectory) --threshold 2$(Percent) --xml $(XMLResults) 4:00 diff --git a/external/linker/eng/common/performance/performance-setup.ps1 b/external/linker/eng/common/performance/performance-setup.ps1 index 7e5441f797..ec41965fc8 100644 --- a/external/linker/eng/common/performance/performance-setup.ps1 +++ b/external/linker/eng/common/performance/performance-setup.ps1 @@ -1,8 +1,9 @@ Param( [string] $SourceDirectory=$env:BUILD_SOURCESDIRECTORY, [string] $CoreRootDirectory, + [string] $BaselineCoreRootDirectory, [string] $Architecture="x64", - [string] $Framework="netcoreapp3.0", + [string] $Framework="netcoreapp5.0", [string] $CompilationMode="Tiered", [string] $Repository=$env:BUILD_REPOSITORY_NAME, [string] $Branch=$env:BUILD_SOURCEBRANCH, @@ -12,11 +13,13 @@ Param( [string] $Csproj="src\benchmarks\micro\MicroBenchmarks.csproj", [string] $Kind="micro", [switch] $Internal, + [switch] $Compare, [string] $Configurations="CompilationMode=$CompilationMode" ) -$RunFromPerformanceRepo = ($Repository -eq "dotnet/performance") +$RunFromPerformanceRepo = ($Repository -eq "dotnet/performance") -or ($Repository -eq "dotnet-performance") $UseCoreRun = ($CoreRootDirectory -ne [string]::Empty) +$UseBaselineCoreRun = ($BaselineCoreRootDirectory -ne [string]::Empty) $PayloadDirectory = (Join-Path $SourceDirectory "Payload") $PerformanceDirectory = (Join-Path $PayloadDirectory "performance") @@ -29,11 +32,17 @@ $HelixSourcePrefix = "pr" $Queue = "Windows.10.Amd64.ClientRS4.DevEx.15.8.Open" if ($Framework.StartsWith("netcoreapp")) { - $Queue = "Windows.10.Amd64.ClientRS4.Open" + $Queue = "Windows.10.Amd64.ClientRS5.Open" +} + +if ($Compare) { + $Queue = "Windows.10.Amd64.19H1.Tiger.Perf.Open" + $PerfLabArguments = "" + $ExtraBenchmarkDotNetArguments = "" } if ($Internal) { - $Queue = "Windows.10.Amd64.ClientRS5.Perf" + $Queue = "Windows.10.Amd64.19H1.Tiger.Perf" $PerfLabArguments = "--upload-to-perflab-container" $ExtraBenchmarkDotNetArguments = "" $Creator = "" @@ -56,6 +65,10 @@ if ($UseCoreRun) { $NewCoreRoot = (Join-Path $PayloadDirectory "Core_Root") Move-Item -Path $CoreRootDirectory -Destination $NewCoreRoot } +if ($UseBaselineCoreRun) { + $NewBaselineCoreRoot = (Join-Path $PayloadDirectory "Baseline_Core_Root") + Move-Item -Path $BaselineCoreRootDirectory -Destination $NewBaselineCoreRoot +} $DocsDir = (Join-Path $PerformanceDirectory "docs") robocopy $DocsDir $WorkItemDirectory @@ -80,7 +93,9 @@ Write-PipelineSetVariable -Name 'TargetCsproj' -Value "$Csproj" -IsMultiJobVaria Write-PipelineSetVariable -Name 'Kind' -Value "$Kind" -IsMultiJobVariable $false Write-PipelineSetVariable -Name 'Architecture' -Value "$Architecture" -IsMultiJobVariable $false Write-PipelineSetVariable -Name 'UseCoreRun' -Value "$UseCoreRun" -IsMultiJobVariable $false +Write-PipelineSetVariable -Name 'UseBaselineCoreRun' -Value "$UseBaselineCoreRun" -IsMultiJobVariable $false Write-PipelineSetVariable -Name 'RunFromPerfRepo' -Value "$RunFromPerformanceRepo" -IsMultiJobVariable $false +Write-PipelineSetVariable -Name 'Compare' -Value "$Compare" -IsMultiJobVariable $false # Helix Arguments Write-PipelineSetVariable -Name 'Creator' -Value "$Creator" -IsMultiJobVariable $false diff --git a/external/linker/eng/common/performance/performance-setup.sh b/external/linker/eng/common/performance/performance-setup.sh index 126da5f76d..2f2092166e 100755 --- a/external/linker/eng/common/performance/performance-setup.sh +++ b/external/linker/eng/common/performance/performance-setup.sh @@ -2,20 +2,23 @@ source_directory=$BUILD_SOURCESDIRECTORY core_root_directory= +baseline_core_root_directory= architecture=x64 -framework=netcoreapp3.0 +framework=netcoreapp5.0 compilation_mode=tiered repository=$BUILD_REPOSITORY_NAME branch=$BUILD_SOURCEBRANCH commit_sha=$BUILD_SOURCEVERSION build_number=$BUILD_BUILDNUMBER internal=false +compare=false kind="micro" run_categories="coreclr corefx" csproj="src\benchmarks\micro\MicroBenchmarks.csproj" configurations= run_from_perf_repo=false use_core_run=true +use_baseline_core_run=true while (($# > 0)); do lowerI="$(echo $1 | awk '{print tolower($0)}')" @@ -28,6 +31,10 @@ while (($# > 0)); do core_root_directory=$2 shift 2 ;; + --baselinecorerootdirectory) + baseline_core_root_directory=$2 + shift 2 + ;; --architecture) architecture=$2 shift 2 @@ -72,6 +79,10 @@ while (($# > 0)); do internal=true shift 1 ;; + --compare) + compare=true + shift 1 + ;; --configurations) configurations=$2 shift 2 @@ -102,7 +113,7 @@ while (($# > 0)); do esac done -if [[ "$repository" == "dotnet/performance" ]]; then +if [ "$repository" == "dotnet/performance" ] || [ "$repository" == "dotnet-performance" ]; then run_from_perf_repo=true fi @@ -114,6 +125,10 @@ if [ -z "$core_root_directory" ]; then use_core_run=false fi +if [ -z "$baseline_core_root_directory" ]; then + use_baseline_core_run=false +fi + payload_directory=$source_directory/Payload performance_directory=$payload_directory/performance workitem_directory=$source_directory/workitem @@ -123,6 +138,19 @@ queue=Ubuntu.1804.Amd64.Open creator=$BUILD_DEFINITIONNAME helix_source_prefix="pr" +if [[ "$compare" == true ]]; then + extra_benchmark_dotnet_arguments= + perflab_arguments= + + # No open queues for arm64 + if [[ "$architecture" = "arm64" ]]; then + echo "Compare not available for arm64" + exit 1 + fi + + queue=Ubuntu.1804.Amd64.Tiger.Perf.Open +fi + if [[ "$internal" == true ]]; then perflab_arguments="--upload-to-perflab-container" helix_source_prefix="official" @@ -132,7 +160,7 @@ if [[ "$internal" == true ]]; then if [[ "$architecture" = "arm64" ]]; then queue=Ubuntu.1804.Arm64.Perf else - queue=Ubuntu.1804.Amd64.Perf + queue=Ubuntu.1804.Amd64.Tiger.Perf fi fi @@ -156,21 +184,33 @@ if [[ "$use_core_run" = true ]]; then mv $core_root_directory $new_core_root fi +if [[ "$use_baseline_core_run" = true ]]; then + new_baseline_core_root=$payload_directory/Baseline_Core_Root + mv $baseline_core_root_directory $new_baseline_core_root +fi + +ci=true + +_script_dir=$(pwd)/eng/common +. "$_script_dir/pipeline-logging-functions.sh" + # Make sure all of our variables are available for future steps -echo "##vso[task.setvariable variable=UseCoreRun]$use_core_run" -echo "##vso[task.setvariable variable=Architecture]$architecture" -echo "##vso[task.setvariable variable=PayloadDirectory]$payload_directory" -echo "##vso[task.setvariable variable=PerformanceDirectory]$performance_directory" -echo "##vso[task.setvariable variable=WorkItemDirectory]$workitem_directory" -echo "##vso[task.setvariable variable=Queue]$queue" -echo "##vso[task.setvariable variable=SetupArguments]$setup_arguments" -echo "##vso[task.setvariable variable=Python]python3" -echo "##vso[task.setvariable variable=PerfLabArguments]$perflab_arguments" -echo "##vso[task.setvariable variable=ExtraBenchmarkDotNetArguments]$extra_benchmark_dotnet_arguments" -echo "##vso[task.setvariable variable=BDNCategories]$run_categories" -echo "##vso[task.setvariable variable=TargetCsproj]$csproj" -echo "##vso[task.setvariable variable=RunFromPerfRepo]$run_from_perf_repo" -echo "##vso[task.setvariable variable=Creator]$creator" -echo "##vso[task.setvariable variable=HelixSourcePrefix]$helix_source_prefix" -echo "##vso[task.setvariable variable=Kind]$kind" -echo "##vso[task.setvariable variable=_BuildConfig]$architecture.$kind.$framework" \ No newline at end of file +Write-PipelineSetVariable -name "UseCoreRun" -value "$use_core_run" -is_multi_job_variable false +Write-PipelineSetVariable -name "UseBaselineCoreRun" -value "$use_baseline_core_run" -is_multi_job_variable false +Write-PipelineSetVariable -name "Architecture" -value "$architecture" -is_multi_job_variable false +Write-PipelineSetVariable -name "PayloadDirectory" -value "$payload_directory" -is_multi_job_variable false +Write-PipelineSetVariable -name "PerformanceDirectory" -value "$performance_directory" -is_multi_job_variable false +Write-PipelineSetVariable -name "WorkItemDirectory" -value "$workitem_directory" -is_multi_job_variable false +Write-PipelineSetVariable -name "Queue" -value "$queue" -is_multi_job_variable false +Write-PipelineSetVariable -name "SetupArguments" -value "$setup_arguments" -is_multi_job_variable false +Write-PipelineSetVariable -name "Python" -value "$python3" -is_multi_job_variable false +Write-PipelineSetVariable -name "PerfLabArguments" -value "$perflab_arguments" -is_multi_job_variable false +Write-PipelineSetVariable -name "ExtraBenchmarkDotNetArguments" -value "$extra_benchmark_dotnet_arguments" -is_multi_job_variable false +Write-PipelineSetVariable -name "BDNCategories" -value "$run_categories" -is_multi_job_variable false +Write-PipelineSetVariable -name "TargetCsproj" -value "$csproj" -is_multi_job_variable false +Write-PipelineSetVariable -name "RunFromPerfRepo" -value "$run_from_perf_repo" -is_multi_job_variable false +Write-PipelineSetVariable -name "Creator" -value "$creator" -is_multi_job_variable false +Write-PipelineSetVariable -name "HelixSourcePrefix" -value "$helix_source_prefix" -is_multi_job_variable false +Write-PipelineSetVariable -name "Kind" -value "$kind" -is_multi_job_variable false +Write-PipelineSetVariable -name "_BuildConfig" -value "$architecture.$kind.$framework" -is_multi_job_variable false +Write-PipelineSetVariable -name "Compare" -value "$compare" -is_multi_job_variable false diff --git a/external/linker/eng/common/post-build/darc-gather-drop.ps1 b/external/linker/eng/common/post-build/darc-gather-drop.ps1 index 93a0bd8328..89854d3c1c 100644 --- a/external/linker/eng/common/post-build/darc-gather-drop.ps1 +++ b/external/linker/eng/common/post-build/darc-gather-drop.ps1 @@ -19,7 +19,17 @@ try { ExitWithExitCode $exitCode } + # For now, only use a dry run. + # Ideally we would change darc to enable a quick request that + # would check whether the file exists that you can download it, + # and that it won't conflict with other files. + # https://github.com/dotnet/arcade/issues/3674 + # Right now we can't remove continue-on-error because we ocassionally will have + # dependencies that have no associated builds (e.g. an old dependency). + # We need to add an option to baseline specific dependencies away, or add them manually + # to the BAR. darc gather-drop --non-shipping ` + --dry-run ` --continue-on-error ` --id $BarBuildId ` --output-dir $DropLocation ` diff --git a/external/linker/eng/common/post-build/dotnetsymbol-init.ps1 b/external/linker/eng/common/post-build/dotnetsymbol-init.ps1 deleted file mode 100644 index e7659b98c8..0000000000 --- a/external/linker/eng/common/post-build/dotnetsymbol-init.ps1 +++ /dev/null @@ -1,29 +0,0 @@ -param ( - $dotnetsymbolVersion = $null -) - -$ErrorActionPreference = "Stop" -Set-StrictMode -Version 2.0 - -. $PSScriptRoot\..\tools.ps1 - -$verbosity = "minimal" - -function Installdotnetsymbol ($dotnetsymbolVersion) { - $dotnetsymbolPackageName = "dotnet-symbol" - - $dotnetRoot = InitializeDotNetCli -install:$true - $dotnet = "$dotnetRoot\dotnet.exe" - $toolList = & "$dotnet" tool list --global - - if (($toolList -like "*$dotnetsymbolPackageName*") -and ($toolList -like "*$dotnetsymbolVersion*")) { - Write-Host "dotnet-symbol version $dotnetsymbolVersion is already installed." - } - else { - Write-Host "Installing dotnet-symbol version $dotnetsymbolVersion..." - Write-Host "You may need to restart your command window if this is the first dotnet tool you have installed." - & "$dotnet" tool install $dotnetsymbolPackageName --version $dotnetsymbolVersion --verbosity $verbosity --global - } -} - -Installdotnetsymbol $dotnetsymbolVersion diff --git a/external/linker/eng/common/post-build/sourcelink-cli-init.ps1 b/external/linker/eng/common/post-build/sourcelink-cli-init.ps1 deleted file mode 100644 index 9eaa25b3b5..0000000000 --- a/external/linker/eng/common/post-build/sourcelink-cli-init.ps1 +++ /dev/null @@ -1,29 +0,0 @@ -param ( - $sourcelinkCliVersion = $null -) - -$ErrorActionPreference = "Stop" -Set-StrictMode -Version 2.0 - -. $PSScriptRoot\..\tools.ps1 - -$verbosity = "minimal" - -function InstallSourcelinkCli ($sourcelinkCliVersion) { - $sourcelinkCliPackageName = "sourcelink" - - $dotnetRoot = InitializeDotNetCli -install:$true - $dotnet = "$dotnetRoot\dotnet.exe" - $toolList = & "$dotnet" tool list --global - - if (($toolList -like "*$sourcelinkCliPackageName*") -and ($toolList -like "*$sourcelinkCliVersion*")) { - Write-Host "SourceLink CLI version $sourcelinkCliVersion is already installed." - } - else { - Write-Host "Installing SourceLink CLI version $sourcelinkCliVersion..." - Write-Host "You may need to restart your command window if this is the first dotnet tool you have installed." - & "$dotnet" tool install $sourcelinkCliPackageName --version $sourcelinkCliVersion --verbosity $verbosity --global - } -} - -InstallSourcelinkCli $sourcelinkCliVersion diff --git a/external/linker/eng/common/post-build/sourcelink-validation.ps1 b/external/linker/eng/common/post-build/sourcelink-validation.ps1 index 41e01ae6e6..bbfdacca13 100644 --- a/external/linker/eng/common/post-build/sourcelink-validation.ps1 +++ b/external/linker/eng/common/post-build/sourcelink-validation.ps1 @@ -1,8 +1,8 @@ param( [Parameter(Mandatory=$true)][string] $InputPath, # Full path to directory where Symbols.NuGet packages to be checked are stored [Parameter(Mandatory=$true)][string] $ExtractPath, # Full path to directory where the packages will be extracted during validation - [Parameter(Mandatory=$true)][string] $GHRepoName, # GitHub name of the repo including the Org. E.g., dotnet/arcade - [Parameter(Mandatory=$true)][string] $GHCommit, # GitHub commit SHA used to build the packages + [Parameter(Mandatory=$false)][string] $GHRepoName, # GitHub name of the repo including the Org. E.g., dotnet/arcade + [Parameter(Mandatory=$false)][string] $GHCommit, # GitHub commit SHA used to build the packages [Parameter(Mandatory=$true)][string] $SourcelinkCliVersion # Version of SourceLink CLI to use ) @@ -13,6 +13,12 @@ param( # all files present in the repo at a specific commit point. $global:RepoFiles = @{} +# Maximum number of jobs to run in parallel +$MaxParallelJobs = 6 + +# Wait time between check for system load +$SecondsBetweenLoadChecks = 10 + $ValidatePackage = { param( [string] $PackagePath # Full path to a Symbols.NuGet package @@ -22,8 +28,8 @@ $ValidatePackage = { # Ensure input file exist if (!(Test-Path $PackagePath)) { - Write-PipelineTaskError "Input file does not exist: $PackagePath" - ExitWithExitCode 1 + Write-Host "Input file does not exist: $PackagePath" + return 1 } # Extensions for which we'll look for SourceLink information @@ -38,7 +44,7 @@ $ValidatePackage = { Add-Type -AssemblyName System.IO.Compression.FileSystem - [System.IO.Directory]::CreateDirectory($ExtractPath); + [System.IO.Directory]::CreateDirectory($ExtractPath) | Out-Null try { $zip = [System.IO.Compression.ZipFile]::OpenRead($PackagePath) @@ -138,16 +144,18 @@ $ValidatePackage = { if ($FailedFiles -eq 0) { Write-Host "Passed." + return 0 } else { - Write-PipelineTaskError "$PackagePath has broken SourceLink links." + Write-Host "$PackagePath has broken SourceLink links." + return 1 } } function ValidateSourceLinkLinks { - if (!($GHRepoName -Match "^[^\s\/]+/[^\s\/]+$")) { + if ($GHRepoName -ne "" -and !($GHRepoName -Match "^[^\s\/]+/[^\s\/]+$")) { if (!($GHRepoName -Match "^[^\s-]+-[^\s]+$")) { - Write-PipelineTaskError "GHRepoName should be in the format / or -" + Write-PipelineTaskError "GHRepoName should be in the format / or -. '$GHRepoName'" ExitWithExitCode 1 } else { @@ -155,30 +163,33 @@ function ValidateSourceLinkLinks { } } - if (!($GHCommit -Match "^[0-9a-fA-F]{40}$")) { - Write-PipelineTaskError "GHCommit should be a 40 chars hexadecimal string" + if ($GHCommit -ne "" -and !($GHCommit -Match "^[0-9a-fA-F]{40}$")) { + Write-PipelineTaskError "GHCommit should be a 40 chars hexadecimal string. '$GHCommit'" ExitWithExitCode 1 } - $RepoTreeURL = -Join("http://api.github.com/repos/", $GHRepoName, "/git/trees/", $GHCommit, "?recursive=1") - $CodeExtensions = @(".cs", ".vb", ".fs", ".fsi", ".fsx", ".fsscript") + if ($GHRepoName -ne "" -and $GHCommit -ne "") { + $RepoTreeURL = -Join("http://api.github.com/repos/", $GHRepoName, "/git/trees/", $GHCommit, "?recursive=1") + $CodeExtensions = @(".cs", ".vb", ".fs", ".fsi", ".fsx", ".fsscript") - try { - # Retrieve the list of files in the repo at that particular commit point and store them in the RepoFiles hash - $Data = Invoke-WebRequest $RepoTreeURL -UseBasicParsing | ConvertFrom-Json | Select-Object -ExpandProperty tree + try { + # Retrieve the list of files in the repo at that particular commit point and store them in the RepoFiles hash + $Data = Invoke-WebRequest $RepoTreeURL -UseBasicParsing | ConvertFrom-Json | Select-Object -ExpandProperty tree - foreach ($file in $Data) { - $Extension = [System.IO.Path]::GetExtension($file.path) + foreach ($file in $Data) { + $Extension = [System.IO.Path]::GetExtension($file.path) - if ($CodeExtensions.Contains($Extension)) { - $RepoFiles[$file.path] = 1 + if ($CodeExtensions.Contains($Extension)) { + $RepoFiles[$file.path] = 1 + } } } + catch { + Write-Host "Problems downloading the list of files from the repo. Url used: $RepoTreeURL . Execution will proceed without caching." + } } - catch { - Write-PipelineTaskError "Problems downloading the list of files from the repo. Url used: $RepoTreeURL" - Write-Host $_ - ExitWithExitCode 1 + elseif ($GHRepoName -ne "" -or $GHCommit -ne "") { + Write-Host "For using the http caching mechanism both GHRepoName and GHCommit should be informed." } if (Test-Path $ExtractPath) { @@ -186,14 +197,33 @@ function ValidateSourceLinkLinks { } # Process each NuGet package in parallel - $Jobs = @() Get-ChildItem "$InputPath\*.symbols.nupkg" | ForEach-Object { - $Jobs += Start-Job -ScriptBlock $ValidatePackage -ArgumentList $_.FullName + Start-Job -ScriptBlock $ValidatePackage -ArgumentList $_.FullName | Out-Null + $NumJobs = @(Get-Job -State 'Running').Count + + while ($NumJobs -ge $MaxParallelJobs) { + Write-Host "There are $NumJobs validation jobs running right now. Waiting $SecondsBetweenLoadChecks seconds to check again." + sleep $SecondsBetweenLoadChecks + $NumJobs = @(Get-Job -State 'Running').Count + } + + foreach ($Job in @(Get-Job -State 'Completed')) { + Receive-Job -Id $Job.Id + Remove-Job -Id $Job.Id + } } - foreach ($Job in $Jobs) { - Wait-Job -Id $Job.Id | Receive-Job + $ValidationFailures = 0 + foreach ($Job in @(Get-Job)) { + $jobResult = Wait-Job -Id $Job.Id | Receive-Job + if ($jobResult -ne "0") { + $ValidationFailures++ + } + } + if ($ValidationFailures -gt 0) { + Write-PipelineTaskError " $ValidationFailures package(s) failed validation." + ExitWithExitCode 1 } } diff --git a/external/linker/eng/common/post-build/symbols-validation.ps1 b/external/linker/eng/common/post-build/symbols-validation.ps1 index d5ec51b150..096ac321d1 100644 --- a/external/linker/eng/common/post-build/symbols-validation.ps1 +++ b/external/linker/eng/common/post-build/symbols-validation.ps1 @@ -37,10 +37,10 @@ function FirstMatchingSymbolDescriptionOrDefault { # DWARF file for a .dylib $DylibDwarf = $SymbolPath.Replace($Extension, ".dylib.dwarf") - $dotnetsymbolExe = "$env:USERPROFILE\.dotnet\tools" - $dotnetsymbolExe = Resolve-Path "$dotnetsymbolExe\dotnet-symbol.exe" + $dotnetSymbolExe = "$env:USERPROFILE\.dotnet\tools" + $dotnetSymbolExe = Resolve-Path "$dotnetSymbolExe\dotnet-symbol.exe" - & $dotnetsymbolExe --symbols --modules --windows-pdbs $TargetServerParam $FullPath -o $SymbolsPath | Out-Null + & $dotnetSymbolExe --symbols --modules --windows-pdbs $TargetServerParam $FullPath -o $SymbolsPath | Out-Null if (Test-Path $PdbPath) { return "PDB" @@ -159,25 +159,25 @@ function CheckSymbolsAvailable { } } -function Installdotnetsymbol { - $dotnetsymbolPackageName = "dotnet-symbol" +function InstallDotnetSymbol { + $dotnetSymbolPackageName = "dotnet-symbol" $dotnetRoot = InitializeDotNetCli -install:$true $dotnet = "$dotnetRoot\dotnet.exe" $toolList = & "$dotnet" tool list --global - if (($toolList -like "*$dotnetsymbolPackageName*") -and ($toolList -like "*$dotnetsymbolVersion*")) { - Write-Host "dotnet-symbol version $dotnetsymbolVersion is already installed." + if (($toolList -like "*$dotnetSymbolPackageName*") -and ($toolList -like "*$dotnetSymbolVersion*")) { + Write-Host "dotnet-symbol version $dotnetSymbolVersion is already installed." } else { - Write-Host "Installing dotnet-symbol version $dotnetsymbolVersion..." + Write-Host "Installing dotnet-symbol version $dotnetSymbolVersion..." Write-Host "You may need to restart your command window if this is the first dotnet tool you have installed." - & "$dotnet" tool install $dotnetsymbolPackageName --version $dotnetsymbolVersion --verbosity "minimal" --global + & "$dotnet" tool install $dotnetSymbolPackageName --version $dotnetSymbolVersion --verbosity "minimal" --global } } try { - Installdotnetsymbol + InstallDotnetSymbol CheckSymbolsAvailable } diff --git a/external/linker/eng/common/sdl/execute-all-sdl-tools.ps1 b/external/linker/eng/common/sdl/execute-all-sdl-tools.ps1 index aab7589f2c..eb21321ba2 100644 --- a/external/linker/eng/common/sdl/execute-all-sdl-tools.ps1 +++ b/external/linker/eng/common/sdl/execute-all-sdl-tools.ps1 @@ -1,30 +1,30 @@ Param( - [string] $GuardianPackageName, # Required: the name of guardian CLI package (not needed if GuardianCliLocation is specified) - [string] $NugetPackageDirectory, # Required: directory where NuGet packages are installed (not needed if GuardianCliLocation is specified) - [string] $GuardianCliLocation, # Optional: Direct location of Guardian CLI executable if GuardianPackageName & NugetPackageDirectory are not specified - [string] $Repository=$env:BUILD_REPOSITORY_NAME, # Required: the name of the repository (e.g. dotnet/arcade) - [string] $BranchName=$env:BUILD_SOURCEBRANCH, # Optional: name of branch or version of gdn settings; defaults to master - [string] $SourceDirectory=$env:BUILD_SOURCESDIRECTORY, # Required: the directory where source files are located - [string] $ArtifactsDirectory = (Join-Path $env:BUILD_SOURCESDIRECTORY ("artifacts")), # Required: the directory where build artifacts are located - [string] $AzureDevOpsAccessToken, # Required: access token for dnceng; should be provided via KeyVault - [string[]] $SourceToolsList, # Optional: list of SDL tools to run on source code - [string[]] $ArtifactToolsList, # Optional: list of SDL tools to run on built artifacts - [bool] $TsaPublish=$False, # Optional: true will publish results to TSA; only set to true after onboarding to TSA; TSA is the automated framework used to upload test results as bugs. - [string] $TsaBranchName=$env:BUILD_SOURCEBRANCH, # Optional: required for TSA publish; defaults to $(Build.SourceBranchName); TSA is the automated framework used to upload test results as bugs. - [string] $TsaRepositoryName=$env:BUILD_REPOSITORY_NAME, # Optional: TSA repository name; will be generated automatically if not submitted; TSA is the automated framework used to upload test results as bugs. - [string] $BuildNumber=$env:BUILD_BUILDNUMBER, # Optional: required for TSA publish; defaults to $(Build.BuildNumber) - [bool] $UpdateBaseline=$False, # Optional: if true, will update the baseline in the repository; should only be run after fixing any issues which need to be fixed - [bool] $TsaOnboard=$False, # Optional: if true, will onboard the repository to TSA; should only be run once; TSA is the automated framework used to upload test results as bugs. - [string] $TsaInstanceUrl, # Optional: only needed if TsaOnboard or TsaPublish is true; the instance-url registered with TSA; TSA is the automated framework used to upload test results as bugs. - [string] $TsaCodebaseName, # Optional: only needed if TsaOnboard or TsaPublish is true; the name of the codebase registered with TSA; TSA is the automated framework used to upload test results as bugs. - [string] $TsaProjectName, # Optional: only needed if TsaOnboard or TsaPublish is true; the name of the project registered with TSA; TSA is the automated framework used to upload test results as bugs. - [string] $TsaNotificationEmail, # Optional: only needed if TsaOnboard is true; the email(s) which will receive notifications of TSA bug filings (e.g. alias@microsoft.com); TSA is the automated framework used to upload test results as bugs. - [string] $TsaCodebaseAdmin, # Optional: only needed if TsaOnboard is true; the aliases which are admins of the TSA codebase (e.g. DOMAIN\alias); TSA is the automated framework used to upload test results as bugs. - [string] $TsaBugAreaPath, # Optional: only needed if TsaOnboard is true; the area path where TSA will file bugs in AzDO; TSA is the automated framework used to upload test results as bugs. - [string] $TsaIterationPath, # Optional: only needed if TsaOnboard is true; the iteration path where TSA will file bugs in AzDO; TSA is the automated framework used to upload test results as bugs. - [string] $GuardianLoggerLevel="Standard", # Optional: the logger level for the Guardian CLI; options are Trace, Verbose, Standard, Warning, and Error - [string[]] $CrScanAdditionalRunConfigParams, # Optional: Additional Params to custom build a CredScan run config in the format @("xyz:abc","sdf:1") - [string[]] $PoliCheckAdditionalRunConfigParams # Optional: Additional Params to custom build a Policheck run config in the format @("xyz:abc","sdf:1") + [string] $GuardianPackageName, # Required: the name of guardian CLI package (not needed if GuardianCliLocation is specified) + [string] $NugetPackageDirectory, # Required: directory where NuGet packages are installed (not needed if GuardianCliLocation is specified) + [string] $GuardianCliLocation, # Optional: Direct location of Guardian CLI executable if GuardianPackageName & NugetPackageDirectory are not specified + [string] $Repository=$env:BUILD_REPOSITORY_NAME, # Required: the name of the repository (e.g. dotnet/arcade) + [string] $BranchName=$env:BUILD_SOURCEBRANCH, # Optional: name of branch or version of gdn settings; defaults to master + [string] $SourceDirectory=$env:BUILD_SOURCESDIRECTORY, # Required: the directory where source files are located + [string] $ArtifactsDirectory = (Join-Path $env:BUILD_ARTIFACTSTAGINGDIRECTORY ("artifacts")), # Required: the directory where build artifacts are located + [string] $AzureDevOpsAccessToken, # Required: access token for dnceng; should be provided via KeyVault + [string[]] $SourceToolsList, # Optional: list of SDL tools to run on source code + [string[]] $ArtifactToolsList, # Optional: list of SDL tools to run on built artifacts + [bool] $TsaPublish=$False, # Optional: true will publish results to TSA; only set to true after onboarding to TSA; TSA is the automated framework used to upload test results as bugs. + [string] $TsaBranchName=$env:BUILD_SOURCEBRANCH, # Optional: required for TSA publish; defaults to $(Build.SourceBranchName); TSA is the automated framework used to upload test results as bugs. + [string] $TsaRepositoryName=$env:BUILD_REPOSITORY_NAME, # Optional: TSA repository name; will be generated automatically if not submitted; TSA is the automated framework used to upload test results as bugs. + [string] $BuildNumber=$env:BUILD_BUILDNUMBER, # Optional: required for TSA publish; defaults to $(Build.BuildNumber) + [bool] $UpdateBaseline=$False, # Optional: if true, will update the baseline in the repository; should only be run after fixing any issues which need to be fixed + [bool] $TsaOnboard=$False, # Optional: if true, will onboard the repository to TSA; should only be run once; TSA is the automated framework used to upload test results as bugs. + [string] $TsaInstanceUrl, # Optional: only needed if TsaOnboard or TsaPublish is true; the instance-url registered with TSA; TSA is the automated framework used to upload test results as bugs. + [string] $TsaCodebaseName, # Optional: only needed if TsaOnboard or TsaPublish is true; the name of the codebase registered with TSA; TSA is the automated framework used to upload test results as bugs. + [string] $TsaProjectName, # Optional: only needed if TsaOnboard or TsaPublish is true; the name of the project registered with TSA; TSA is the automated framework used to upload test results as bugs. + [string] $TsaNotificationEmail, # Optional: only needed if TsaOnboard is true; the email(s) which will receive notifications of TSA bug filings (e.g. alias@microsoft.com); TSA is the automated framework used to upload test results as bugs. + [string] $TsaCodebaseAdmin, # Optional: only needed if TsaOnboard is true; the aliases which are admins of the TSA codebase (e.g. DOMAIN\alias); TSA is the automated framework used to upload test results as bugs. + [string] $TsaBugAreaPath, # Optional: only needed if TsaOnboard is true; the area path where TSA will file bugs in AzDO; TSA is the automated framework used to upload test results as bugs. + [string] $TsaIterationPath, # Optional: only needed if TsaOnboard is true; the iteration path where TSA will file bugs in AzDO; TSA is the automated framework used to upload test results as bugs. + [string] $GuardianLoggerLevel="Standard", # Optional: the logger level for the Guardian CLI; options are Trace, Verbose, Standard, Warning, and Error + [string[]] $CrScanAdditionalRunConfigParams, # Optional: Additional Params to custom build a CredScan run config in the format @("xyz:abc","sdf:1") + [string[]] $PoliCheckAdditionalRunConfigParams # Optional: Additional Params to custom build a Policheck run config in the format @("xyz:abc","sdf:1") ) $ErrorActionPreference = "Stop" @@ -45,6 +45,7 @@ if ($GuardianPackageName) { $guardianCliLocation = $GuardianCliLocation } +$workingDirectory = (Split-Path $SourceDirectory -Parent) $ValidPath = Test-Path $guardianCliLocation if ($ValidPath -eq $False) @@ -53,13 +54,13 @@ if ($ValidPath -eq $False) exit 1 } -& $(Join-Path $PSScriptRoot "init-sdl.ps1") -GuardianCliLocation $guardianCliLocation -Repository $RepoName -BranchName $BranchName -WorkingDirectory $ArtifactsDirectory -AzureDevOpsAccessToken $AzureDevOpsAccessToken -GuardianLoggerLevel $GuardianLoggerLevel -$gdnFolder = Join-Path $ArtifactsDirectory ".gdn" +& $(Join-Path $PSScriptRoot "init-sdl.ps1") -GuardianCliLocation $guardianCliLocation -Repository $RepoName -BranchName $BranchName -WorkingDirectory $workingDirectory -AzureDevOpsAccessToken $AzureDevOpsAccessToken -GuardianLoggerLevel $GuardianLoggerLevel +$gdnFolder = Join-Path $workingDirectory ".gdn" if ($TsaOnboard) { if ($TsaCodebaseName -and $TsaNotificationEmail -and $TsaCodebaseAdmin -and $TsaBugAreaPath) { - Write-Host "$guardianCliLocation tsa-onboard --codebase-name `"$TsaCodebaseName`" --notification-alias `"$TsaNotificationEmail`" --codebase-admin `"$TsaCodebaseAdmin`" --instance-url `"$TsaInstanceUrl`" --project-name `"$TsaProjectName`" --area-path `"$TsaBugAreaPath`" --iteration-path `"$TsaIterationPath`" --working-directory $ArtifactsDirectory --logger-level $GuardianLoggerLevel" - & $guardianCliLocation tsa-onboard --codebase-name "$TsaCodebaseName" --notification-alias "$TsaNotificationEmail" --codebase-admin "$TsaCodebaseAdmin" --instance-url "$TsaInstanceUrl" --project-name "$TsaProjectName" --area-path "$TsaBugAreaPath" --iteration-path "$TsaIterationPath" --working-directory $ArtifactsDirectory --logger-level $GuardianLoggerLevel + Write-Host "$guardianCliLocation tsa-onboard --codebase-name `"$TsaCodebaseName`" --notification-alias `"$TsaNotificationEmail`" --codebase-admin `"$TsaCodebaseAdmin`" --instance-url `"$TsaInstanceUrl`" --project-name `"$TsaProjectName`" --area-path `"$TsaBugAreaPath`" --iteration-path `"$TsaIterationPath`" --working-directory $workingDirectory --logger-level $GuardianLoggerLevel" + & $guardianCliLocation tsa-onboard --codebase-name "$TsaCodebaseName" --notification-alias "$TsaNotificationEmail" --codebase-admin "$TsaCodebaseAdmin" --instance-url "$TsaInstanceUrl" --project-name "$TsaProjectName" --area-path "$TsaBugAreaPath" --iteration-path "$TsaIterationPath" --working-directory $workingDirectory --logger-level $GuardianLoggerLevel if ($LASTEXITCODE -ne 0) { Write-Host "Guardian tsa-onboard failed with exit code $LASTEXITCODE." exit $LASTEXITCODE @@ -71,10 +72,10 @@ if ($TsaOnboard) { } if ($ArtifactToolsList -and $ArtifactToolsList.Count -gt 0) { - & $(Join-Path $PSScriptRoot "run-sdl.ps1") -GuardianCliLocation $guardianCliLocation -WorkingDirectory $ArtifactsDirectory -TargetDirectory $ArtifactsDirectory -GdnFolder $gdnFolder -ToolsList $ArtifactToolsList -AzureDevOpsAccessToken $AzureDevOpsAccessToken -UpdateBaseline $UpdateBaseline -GuardianLoggerLevel $GuardianLoggerLevel -CrScanAdditionalRunConfigParams $CrScanAdditionalRunConfigParams -PoliCheckAdditionalRunConfigParams $PoliCheckAdditionalRunConfigParams + & $(Join-Path $PSScriptRoot "run-sdl.ps1") -GuardianCliLocation $guardianCliLocation -WorkingDirectory $workingDirectory -TargetDirectory $ArtifactsDirectory -GdnFolder $gdnFolder -ToolsList $ArtifactToolsList -AzureDevOpsAccessToken $AzureDevOpsAccessToken -UpdateBaseline $UpdateBaseline -GuardianLoggerLevel $GuardianLoggerLevel -CrScanAdditionalRunConfigParams $CrScanAdditionalRunConfigParams -PoliCheckAdditionalRunConfigParams $PoliCheckAdditionalRunConfigParams } if ($SourceToolsList -and $SourceToolsList.Count -gt 0) { - & $(Join-Path $PSScriptRoot "run-sdl.ps1") -GuardianCliLocation $guardianCliLocation -WorkingDirectory $ArtifactsDirectory -TargetDirectory $SourceDirectory -GdnFolder $gdnFolder -ToolsList $SourceToolsList -AzureDevOpsAccessToken $AzureDevOpsAccessToken -UpdateBaseline $UpdateBaseline -GuardianLoggerLevel $GuardianLoggerLevel -CrScanAdditionalRunConfigParams $CrScanAdditionalRunConfigParams -PoliCheckAdditionalRunConfigParams $PoliCheckAdditionalRunConfigParams + & $(Join-Path $PSScriptRoot "run-sdl.ps1") -GuardianCliLocation $guardianCliLocation -WorkingDirectory $workingDirectory -TargetDirectory $SourceDirectory -GdnFolder $gdnFolder -ToolsList $SourceToolsList -AzureDevOpsAccessToken $AzureDevOpsAccessToken -UpdateBaseline $UpdateBaseline -GuardianLoggerLevel $GuardianLoggerLevel -CrScanAdditionalRunConfigParams $CrScanAdditionalRunConfigParams -PoliCheckAdditionalRunConfigParams $PoliCheckAdditionalRunConfigParams } if ($UpdateBaseline) { @@ -86,8 +87,8 @@ if ($TsaPublish) { if (-not $TsaRepositoryName) { $TsaRepositoryName = "$($Repository)-$($BranchName)" } - Write-Host "$guardianCliLocation tsa-publish --all-tools --repository-name `"$TsaRepositoryName`" --branch-name `"$TsaBranchName`" --build-number `"$BuildNumber`" --codebase-name `"$TsaCodebaseName`" --notification-alias `"$TsaNotificationEmail`" --codebase-admin `"$TsaCodebaseAdmin`" --instance-url `"$TsaInstanceUrl`" --project-name `"$TsaProjectName`" --area-path `"$TsaBugAreaPath`" --iteration-path `"$TsaIterationPath`" --working-directory $SourceDirectory --logger-level $GuardianLoggerLevel" - & $guardianCliLocation tsa-publish --all-tools --repository-name "$TsaRepositoryName" --branch-name "$TsaBranchName" --build-number "$BuildNumber" --codebase-name "$TsaCodebaseName" --notification-alias "$TsaNotificationEmail" --codebase-admin "$TsaCodebaseAdmin" --instance-url "$TsaInstanceUrl" --project-name "$TsaProjectName" --area-path "$TsaBugAreaPath" --iteration-path "$TsaIterationPath" --working-directory $ArtifactsDirectory --logger-level $GuardianLoggerLevel + Write-Host "$guardianCliLocation tsa-publish --all-tools --repository-name `"$TsaRepositoryName`" --branch-name `"$TsaBranchName`" --build-number `"$BuildNumber`" --codebase-name `"$TsaCodebaseName`" --notification-alias `"$TsaNotificationEmail`" --codebase-admin `"$TsaCodebaseAdmin`" --instance-url `"$TsaInstanceUrl`" --project-name `"$TsaProjectName`" --area-path `"$TsaBugAreaPath`" --iteration-path `"$TsaIterationPath`" --working-directory $workingDirectory --logger-level $GuardianLoggerLevel" + & $guardianCliLocation tsa-publish --all-tools --repository-name "$TsaRepositoryName" --branch-name "$TsaBranchName" --build-number "$BuildNumber" --onboard $True --codebase-name "$TsaCodebaseName" --notification-alias "$TsaNotificationEmail" --codebase-admin "$TsaCodebaseAdmin" --instance-url "$TsaInstanceUrl" --project-name "$TsaProjectName" --area-path "$TsaBugAreaPath" --iteration-path "$TsaIterationPath" --working-directory $workingDirectory --logger-level $GuardianLoggerLevel if ($LASTEXITCODE -ne 0) { Write-Host "Guardian tsa-publish failed with exit code $LASTEXITCODE." exit $LASTEXITCODE diff --git a/external/linker/eng/common/sdl/extract-artifact-packages.ps1 b/external/linker/eng/common/sdl/extract-artifact-packages.ps1 index 1fdbb14329..6e6825013b 100644 --- a/external/linker/eng/common/sdl/extract-artifact-packages.ps1 +++ b/external/linker/eng/common/sdl/extract-artifact-packages.ps1 @@ -5,6 +5,13 @@ param( $ErrorActionPreference = "Stop" Set-StrictMode -Version 2.0 + +# `tools.ps1` checks $ci to perform some actions. Since the post-build +# scripts don't necessarily execute in the same agent that run the +# build.ps1/sh script this variable isn't automatically set. +$ci = $true +. $PSScriptRoot\..\tools.ps1 + $ExtractPackage = { param( [string] $PackagePath # Full path to a NuGet package diff --git a/external/linker/eng/common/sdl/init-sdl.ps1 b/external/linker/eng/common/sdl/init-sdl.ps1 index 26e01c0673..c737eb0e71 100644 --- a/external/linker/eng/common/sdl/init-sdl.ps1 +++ b/external/linker/eng/common/sdl/init-sdl.ps1 @@ -11,6 +11,9 @@ $ErrorActionPreference = "Stop" Set-StrictMode -Version 2.0 $LASTEXITCODE = 0 +# Don't display the console progress UI - it's a huge perf hit +$ProgressPreference = 'SilentlyContinue' + # Construct basic auth from AzDO access token; construct URI to the repository's gdn folder stored in that repository; construct location of zip file $encodedPat = [Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes(":$AzureDevOpsAccessToken")) $escapedRepository = [Uri]::EscapeDataString("/$Repository/$BranchName/.gdn") diff --git a/external/linker/eng/common/sdl/packages.config b/external/linker/eng/common/sdl/packages.config index 3f97ac2f16..256ffbfb93 100644 --- a/external/linker/eng/common/sdl/packages.config +++ b/external/linker/eng/common/sdl/packages.config @@ -1,4 +1,4 @@ - + - + diff --git a/external/linker/eng/common/sdl/run-sdl.ps1 b/external/linker/eng/common/sdl/run-sdl.ps1 index d7b8564458..9bc25314ae 100644 --- a/external/linker/eng/common/sdl/run-sdl.ps1 +++ b/external/linker/eng/common/sdl/run-sdl.ps1 @@ -25,43 +25,35 @@ if ($ValidPath -eq $False) exit 1 } +$configParam = @("--config") + foreach ($tool in $ToolsList) { $gdnConfigFile = Join-Path $gdnConfigPath "$tool-configure.gdnconfig" - $config = $False Write-Host $tool # We have to manually configure tools that run on source to look at the source directory only if ($tool -eq "credscan") { - Write-Host "$GuardianCliLocation configure --working-directory $WorkingDirectory --tool $tool --output-path $gdnConfigFile --logger-level $GuardianLoggerLevel --noninteractive --force --args `" TargetDirectory : $TargetDirectory `" $(If ($CrScanAdditionalRunConfigParams) {$CrScanAdditionalRunConfigParams})" - & $GuardianCliLocation configure --working-directory $WorkingDirectory --tool $tool --output-path $gdnConfigFile --logger-level $GuardianLoggerLevel --noninteractive --force --args " TargetDirectory : $TargetDirectory " $(If ($CrScanAdditionalRunConfigParams) {$CrScanAdditionalRunConfigParams}) + Write-Host "$GuardianCliLocation configure --working-directory $WorkingDirectory --tool $tool --output-path $gdnConfigFile --logger-level $GuardianLoggerLevel --noninteractive --force --args `" TargetDirectory < $TargetDirectory `" `" OutputType < pre `" $(If ($CrScanAdditionalRunConfigParams) {$CrScanAdditionalRunConfigParams})" + & $GuardianCliLocation configure --working-directory $WorkingDirectory --tool $tool --output-path $gdnConfigFile --logger-level $GuardianLoggerLevel --noninteractive --force --args " TargetDirectory < $TargetDirectory " "OutputType < pre" $(If ($CrScanAdditionalRunConfigParams) {$CrScanAdditionalRunConfigParams}) if ($LASTEXITCODE -ne 0) { Write-Host "Guardian configure for $tool failed with exit code $LASTEXITCODE." exit $LASTEXITCODE } - $config = $True } if ($tool -eq "policheck") { - Write-Host "$GuardianCliLocation configure --working-directory $WorkingDirectory --tool $tool --output-path $gdnConfigFile --logger-level $GuardianLoggerLevel --noninteractive --force --args `" Target : $TargetDirectory `" $(If ($PoliCheckAdditionalRunConfigParams) {$PoliCheckAdditionalRunConfigParams})" - & $GuardianCliLocation configure --working-directory $WorkingDirectory --tool $tool --output-path $gdnConfigFile --logger-level $GuardianLoggerLevel --noninteractive --force --args " Target : $TargetDirectory " $(If ($PoliCheckAdditionalRunConfigParams) {$PoliCheckAdditionalRunConfigParams}) + Write-Host "$GuardianCliLocation configure --working-directory $WorkingDirectory --tool $tool --output-path $gdnConfigFile --logger-level $GuardianLoggerLevel --noninteractive --force --args `" Target < $TargetDirectory `" $(If ($PoliCheckAdditionalRunConfigParams) {$PoliCheckAdditionalRunConfigParams})" + & $GuardianCliLocation configure --working-directory $WorkingDirectory --tool $tool --output-path $gdnConfigFile --logger-level $GuardianLoggerLevel --noninteractive --force --args " Target < $TargetDirectory " $(If ($PoliCheckAdditionalRunConfigParams) {$PoliCheckAdditionalRunConfigParams}) if ($LASTEXITCODE -ne 0) { Write-Host "Guardian configure for $tool failed with exit code $LASTEXITCODE." exit $LASTEXITCODE } - $config = $True } - Write-Host "$GuardianCliLocation run --working-directory $WorkingDirectory --tool $tool --baseline mainbaseline --update-baseline $UpdateBaseline --logger-level $GuardianLoggerLevel --config $gdnConfigFile $config" - if ($config) { - & $GuardianCliLocation run --working-directory $WorkingDirectory --tool $tool --baseline mainbaseline --update-baseline $UpdateBaseline --logger-level $GuardianLoggerLevel --config $gdnConfigFile - if ($LASTEXITCODE -ne 0) { - Write-Host "Guardian run for $tool using $gdnConfigFile failed with exit code $LASTEXITCODE." - exit $LASTEXITCODE - } - } else { - & $GuardianCliLocation run --working-directory $WorkingDirectory --tool $tool --baseline mainbaseline --update-baseline $UpdateBaseline --logger-level $GuardianLoggerLevel - if ($LASTEXITCODE -ne 0) { - Write-Host "Guardian run for $tool failed with exit code $LASTEXITCODE." - exit $LASTEXITCODE - } - } + $configParam+=$gdnConfigFile } +Write-Host "$GuardianCliLocation run --working-directory $WorkingDirectory --baseline mainbaseline --update-baseline $UpdateBaseline --logger-level $GuardianLoggerLevel $configParam" +& $GuardianCliLocation run --working-directory $WorkingDirectory --tool $tool --baseline mainbaseline --update-baseline $UpdateBaseline --logger-level $GuardianLoggerLevel $configParam +if ($LASTEXITCODE -ne 0) { + Write-Host "Guardian run for $ToolsList using $configParam failed with exit code $LASTEXITCODE." + exit $LASTEXITCODE +} diff --git a/external/linker/eng/common/templates/job/execute-sdl.yml b/external/linker/eng/common/templates/job/execute-sdl.yml index 91621cf88f..9a00430d65 100644 --- a/external/linker/eng/common/templates/job/execute-sdl.yml +++ b/external/linker/eng/common/templates/job/execute-sdl.yml @@ -1,7 +1,10 @@ parameters: overrideParameters: '' # Optional: to override values for parameters. additionalParameters: '' # Optional: parameters that need user specific values eg: '-SourceToolsList @("abc","def") -ArtifactToolsList @("ghi","jkl")' - continueOnError: false # optional: determines whether to continue the build if the step errors; + # There is some sort of bug (has been reported) in Azure DevOps where if this parameter is named + # 'continueOnError', the parameter value is not correctly picked up. + # This can also be remedied by the caller (post-build.yml) if it does not use a nested parameter + sdlContinueOnError: false # optional: determines whether to continue the build if the step errors; dependsOn: '' # Optional: dependencies of the job jobs: @@ -21,17 +24,17 @@ jobs: buildType: current downloadType: specific files matchingPattern: "**" - downloadPath: $(Build.SourcesDirectory)\artifacts + downloadPath: $(Build.ArtifactStagingDirectory)\artifacts - powershell: eng/common/sdl/extract-artifact-packages.ps1 - -InputPath $(Build.SourcesDirectory)\artifacts\BlobArtifacts - -ExtractPath $(Build.SourcesDirectory)\artifacts\BlobArtifacts + -InputPath $(Build.ArtifactStagingDirectory)\artifacts\BlobArtifacts + -ExtractPath $(Build.ArtifactStagingDirectory)\artifacts\BlobArtifacts displayName: Extract Blob Artifacts - continueOnError: ${{ parameters.continueOnError }} + continueOnError: ${{ parameters.sdlContinueOnError }} - powershell: eng/common/sdl/extract-artifact-packages.ps1 - -InputPath $(Build.SourcesDirectory)\artifacts\PackageArtifacts - -ExtractPath $(Build.SourcesDirectory)\artifacts\PackageArtifacts + -InputPath $(Build.ArtifactStagingDirectory)\artifacts\PackageArtifacts + -ExtractPath $(Build.ArtifactStagingDirectory)\artifacts\PackageArtifacts displayName: Extract Package Artifacts - continueOnError: ${{ parameters.continueOnError }} + continueOnError: ${{ parameters.sdlContinueOnError }} - task: NuGetToolInstaller@1 displayName: 'Install NuGet.exe' - task: NuGetCommand@2 @@ -45,12 +48,12 @@ jobs: - ${{ if ne(parameters.overrideParameters, '') }}: - powershell: eng/common/sdl/execute-all-sdl-tools.ps1 ${{ parameters.overrideParameters }} displayName: Execute SDL - continueOnError: ${{ parameters.continueOnError }} + continueOnError: ${{ parameters.sdlContinueOnError }} - ${{ if eq(parameters.overrideParameters, '') }}: - powershell: eng/common/sdl/execute-all-sdl-tools.ps1 - -GuardianPackageName Microsoft.Guardian.Cli.0.7.1 + -GuardianPackageName Microsoft.Guardian.Cli.0.7.2 -NugetPackageDirectory $(Build.SourcesDirectory)\.packages -AzureDevOpsAccessToken $(dn-bot-dotnet-build-rw-code-rw) ${{ parameters.additionalParameters }} displayName: Execute SDL - continueOnError: ${{ parameters.continueOnError }} + continueOnError: ${{ parameters.sdlContinueOnError }} diff --git a/external/linker/eng/common/templates/job/job.yml b/external/linker/eng/common/templates/job/job.yml index 8db456bb7f..13dd40e26c 100644 --- a/external/linker/eng/common/templates/job/job.yml +++ b/external/linker/eng/common/templates/job/job.yml @@ -1,67 +1,33 @@ +# Internal resources (telemetry, microbuild) can only be accessed from non-public projects, +# and some (Microbuild) should only be applied to non-PR cases for internal builds. + parameters: # Job schema parameters - https://docs.microsoft.com/en-us/azure/devops/pipelines/yaml-schema?view=vsts&tabs=schema#job cancelTimeoutInMinutes: '' - condition: '' - - continueOnError: false - container: '' - + continueOnError: false dependsOn: '' - displayName: '' - - steps: [] - pool: '' - + steps: [] strategy: '' - timeoutInMinutes: '' - variables: [] - workspace: '' # Job base template specific parameters - # Optional: Enable installing Microbuild plugin - # if 'true', these "variables" must be specified in the variables object or as part of the queue matrix - # _TeamName - the name of your team - # _SignType - 'test' or 'real' + # See schema documentation in /Documentation/AzureDevOps/TemplateSchema.md + artifacts: '' enableMicrobuild: false - - # Optional: Include PublishBuildArtifacts task enablePublishBuildArtifacts: false - - # Optional: Enable publishing to the build asset registry enablePublishBuildAssets: false - - # Optional: Prevent gather/push manifest from executing when using publishing pipelines - enablePublishUsingPipelines: false - - # Optional: Include PublishTestResults task enablePublishTestResults: false - - # Optional: enable sending telemetry - enableTelemetry: false - - # Optional: define the helix repo for telemetry (example: 'dotnet/arcade') - helixRepo: '' - - # Optional: define the helix type for telemetry (example: 'build/product/') - helixType: '' - - # Required: name of the job + enablePublishUsingPipelines: false name: '' - - # Optional: should run as a public build even in the internal project - # if 'true', the build won't run any of the internal only steps, even if it is running in non-public projects. + preSteps: [] runAsPublic: false -# Internal resources (telemetry, microbuild) can only be accessed from non-public projects, -# and some (Microbuild) should only be applied to non-PR cases for internal builds. - jobs: - job: ${{ parameters.name }} @@ -93,7 +59,7 @@ jobs: timeoutInMinutes: ${{ parameters.timeoutInMinutes }} variables: - - ${{ if eq(parameters.enableTelemetry, 'true') }}: + - ${{ if ne(parameters.enableTelemetry, 'false') }}: - name: DOTNET_CLI_TELEMETRY_PROFILE value: '$(Build.Repository.Uri)' - ${{ each variable in parameters.variables }}: @@ -125,21 +91,12 @@ jobs: workspace: ${{ parameters.workspace }} steps: - - ${{ if eq(parameters.enableTelemetry, 'true') }}: - # Telemetry tasks are built from https://github.com/dotnet/arcade-extensions - - task: sendStartTelemetry@0 - displayName: 'Send Helix Start Telemetry' - inputs: - helixRepo: ${{ parameters.helixRepo }} - ${{ if ne(parameters.helixType, '') }}: - helixType: ${{ parameters.helixType }} - buildConfig: $(_BuildConfig) - runAsPublic: ${{ parameters.runAsPublic }} - continueOnError: ${{ parameters.continueOnError }} - condition: always() + - ${{ if ne(parameters.preSteps, '') }}: + - ${{ each preStep in parameters.preSteps }}: + - ${{ preStep }} - - ${{ if eq(parameters.enableMicrobuild, 'true') }}: - - ${{ if and(eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: + - ${{ if and(eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: + - ${{ if eq(parameters.enableMicrobuild, 'true') }}: - task: MicroBuildSigningPlugin@2 displayName: Install MicroBuild plugin inputs: @@ -151,6 +108,16 @@ jobs: continueOnError: ${{ parameters.continueOnError }} condition: and(succeeded(), in(variables['_SignType'], 'real', 'test'), eq(variables['Agent.Os'], 'Windows_NT')) + - task: NuGetAuthenticate@0 + + - ${{ if or(eq(parameters.artifacts.download, 'true'), ne(parameters.artifacts.download, '')) }}: + - task: DownloadPipelineArtifact@2 + inputs: + buildType: current + artifactName: ${{ coalesce(parameters.artifacts.download.name, 'Artifacts_$(Agent.OS)_$(_BuildConfig)') }} + targetPath: ${{ coalesce(parameters.artifacts.download.path, 'artifacts') }} + itemPattern: ${{ coalesce(parameters.artifacts.download.pattern, '**') }} + - ${{ each step in parameters.steps }}: - ${{ step }} @@ -163,20 +130,60 @@ jobs: env: TeamName: $(_TeamName) - - ${{ if eq(parameters.enableTelemetry, 'true') }}: - # Telemetry tasks are built from https://github.com/dotnet/arcade-extensions - - task: sendEndTelemetry@0 - displayName: 'Send Helix End Telemetry' - continueOnError: ${{ parameters.continueOnError }} - condition: always() + - ${{ if ne(parameters.artifacts.publish, '') }}: + - ${{ if or(eq(parameters.artifacts.publish.artifacts, 'true'), ne(parameters.artifacts.publish.artifacts, '')) }}: + - task: CopyFiles@2 + displayName: Gather binaries for publish to artifacts + inputs: + SourceFolder: 'artifacts/bin' + Contents: '**' + TargetFolder: '$(Build.ArtifactStagingDirectory)/artifacts/bin' + - task: CopyFiles@2 + displayName: Gather packages for publish to artifacts + inputs: + SourceFolder: 'artifacts/packages' + Contents: '**' + TargetFolder: '$(Build.ArtifactStagingDirectory)/artifacts/packages' + - task: PublishBuildArtifacts@1 + displayName: Publish pipeline artifacts + inputs: + PathtoPublish: '$(Build.ArtifactStagingDirectory)/artifacts' + PublishLocation: Container + ArtifactName: ${{ coalesce(parameters.artifacts.publish.artifacts.name , 'Artifacts_$(Agent.Os)_$(_BuildConfig)') }} + continueOnError: true + condition: always() + - ${{ if or(eq(parameters.artifacts.publish.logs, 'true'), ne(parameters.artifacts.publish.logs, '')) }}: + - publish: artifacts/log + artifact: ${{ coalesce(parameters.artifacts.publish.logs.name, 'Logs_Build_$(Agent.Os)_$(_BuildConfig)') }} + displayName: Publish logs + continueOnError: true + condition: always() + - ${{ if or(eq(parameters.artifacts.publish.manifests, 'true'), ne(parameters.artifacts.publish.manifests, '')) }}: + - ${{ if and(ne(parameters.enablePublishUsingPipelines, 'true'), eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: + - task: CopyFiles@2 + displayName: Gather Asset Manifests + inputs: + SourceFolder: '$(Build.SourcesDirectory)/artifacts/log/$(_BuildConfig)/AssetManifest' + TargetFolder: '$(Build.ArtifactStagingDirectory)/AssetManifests' + continueOnError: ${{ parameters.continueOnError }} + condition: and(succeeded(), eq(variables['_DotNetPublishToBlobFeed'], 'true')) - - ${{ if eq(parameters.enablePublishBuildArtifacts, 'true') }}: + - task: PublishBuildArtifacts@1 + displayName: Push Asset Manifests + inputs: + PathtoPublish: '$(Build.ArtifactStagingDirectory)/AssetManifests' + PublishLocation: Container + ArtifactName: AssetManifests + continueOnError: ${{ parameters.continueOnError }} + condition: and(succeeded(), eq(variables['_DotNetPublishToBlobFeed'], 'true')) + + - ${{ if ne(parameters.enablePublishBuildArtifacts, 'false') }}: - task: PublishBuildArtifacts@1 displayName: Publish Logs inputs: PathtoPublish: '$(Build.SourcesDirectory)/artifacts/log/$(_BuildConfig)' PublishLocation: Container - ArtifactName: $(Agent.Os)_$(Agent.JobName) + ArtifactName: ${{ coalesce(parameters.enablePublishBuildArtifacts.artifactName, '$(Agent.Os)_$(Agent.JobName)' ) }} continueOnError: true condition: always() diff --git a/external/linker/eng/common/templates/job/performance.yml b/external/linker/eng/common/templates/job/performance.yml index ef809253d1..f877fd7a89 100644 --- a/external/linker/eng/common/templates/job/performance.yml +++ b/external/linker/eng/common/templates/job/performance.yml @@ -5,6 +5,7 @@ parameters: displayName: '' # optional -- display name for the job. Will use jobName if not passed pool: '' # required -- name of the Build pool container: '' # required -- name of the container + osGroup: '' # required -- operating system for the job extraSetupParameters: '' # optional -- extra arguments to pass to the setup script frameworks: ['netcoreapp3.0'] # optional -- list of frameworks to run against continueOnError: 'false' # optional -- determines whether to continue the build if the step errors @@ -44,12 +45,13 @@ jobs: - HelixPreCommand: '' - ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: - - ${{ if eq(variables['Agent.Os'], 'Windows_NT') }}: + - ${{ if eq( parameters.osGroup, 'Windows_NT') }}: - HelixPreCommand: 'set "PERFLAB_UPLOAD_TOKEN=$(PerfCommandUploadToken)"' - IsInternal: -Internal - - ${{ if ne(variables['Agent.Os'], 'Windows_NT') }}: + - ${{ if ne(parameters.osGroup, 'Windows_NT') }}: - HelixPreCommand: 'export PERFLAB_UPLOAD_TOKEN="$(PerfCommandUploadTokenLinux)"' - IsInternal: --internal + - group: DotNet-HelixApi-Access - group: dotnet-benchview diff --git a/external/linker/eng/common/templates/job/publish-build-assets.yml b/external/linker/eng/common/templates/job/publish-build-assets.yml index 9e77ef1b54..b722975f9c 100644 --- a/external/linker/eng/common/templates/job/publish-build-assets.yml +++ b/external/linker/eng/common/templates/job/publish-build-assets.yml @@ -47,6 +47,10 @@ jobs: downloadPath: '$(Build.StagingDirectory)/Download' condition: ${{ parameters.condition }} continueOnError: ${{ parameters.continueOnError }} + + - ${{ if and(eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: + - task: NuGetAuthenticate@0 + - task: PowerShell@2 displayName: Publish Build Assets inputs: @@ -59,6 +63,7 @@ jobs: /p:Configuration=$(_BuildConfig) condition: ${{ parameters.condition }} continueOnError: ${{ parameters.continueOnError }} + - task: powershell@2 displayName: Create ReleaseConfigs Artifact inputs: @@ -67,12 +72,14 @@ jobs: Add-Content -Path "$(Build.StagingDirectory)/ReleaseConfigs.txt" -Value $(BARBuildId) Add-Content -Path "$(Build.StagingDirectory)/ReleaseConfigs.txt" -Value "$(DefaultChannels)" Add-Content -Path "$(Build.StagingDirectory)/ReleaseConfigs.txt" -Value $(IsStableBuild) + - task: PublishBuildArtifacts@1 displayName: Publish ReleaseConfigs Artifact inputs: PathtoPublish: '$(Build.StagingDirectory)/ReleaseConfigs.txt' PublishLocation: Container ArtifactName: ReleaseConfigs + - ${{ if eq(parameters.enablePublishBuildArtifacts, 'true') }}: - task: PublishBuildArtifacts@1 displayName: Publish Logs to VSTS diff --git a/external/linker/eng/common/templates/jobs/jobs.yml b/external/linker/eng/common/templates/jobs/jobs.yml index 6a2f98c036..c08225a9a9 100644 --- a/external/linker/eng/common/templates/jobs/jobs.yml +++ b/external/linker/eng/common/templates/jobs/jobs.yml @@ -1,19 +1,10 @@ parameters: - # Optional: 'true' if failures in job.yml job should not fail the job + # See schema documentation in /Documentation/AzureDevOps/TemplateSchema.md continueOnError: false - # Optional: Enable installing Microbuild plugin - # if 'true', these "variables" must be specified in the variables object or as part of the queue matrix - # _TeamName - the name of your team - # _SignType - 'test' or 'real' - enableMicrobuild: false - # Optional: Include PublishBuildArtifacts task enablePublishBuildArtifacts: false - # Optional: Enable publishing to the build asset registry - enablePublishBuildAssets: false - # Optional: Enable publishing using release pipelines enablePublishUsingPipelines: false @@ -23,19 +14,9 @@ parameters: # Optional: Include toolset dependencies in the generated graph files includeToolset: false - # Optional: Include PublishTestResults task - enablePublishTestResults: false - - # Optional: enable sending telemetry - # if enabled then the 'helixRepo' parameter should also be specified - enableTelemetry: false - # Required: A collection of jobs to run - https://docs.microsoft.com/en-us/azure/devops/pipelines/yaml-schema?view=vsts&tabs=schema#job jobs: [] - # Optional: define the helix repo for telemetry (example: 'dotnet/arcade') - helixRepo: '' - # Optional: Override automatically derived dependsOn value for "publish build assets" job publishBuildAssetsDependsOn: '' @@ -62,29 +43,30 @@ jobs: name: ${{ job.job }} -- ${{ if and(eq(parameters.enablePublishBuildAssets, true), eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: - - template: ../job/publish-build-assets.yml - parameters: - continueOnError: ${{ parameters.continueOnError }} - dependsOn: - - ${{ if ne(parameters.publishBuildAssetsDependsOn, '') }}: - - ${{ each job in parameters.publishBuildAssetsDependsOn }}: - - ${{ job.job }} - - ${{ if eq(parameters.publishBuildAssetsDependsOn, '') }}: - - ${{ each job in parameters.jobs }}: - - ${{ job.job }} - pool: - vmImage: vs2017-win2016 - runAsPublic: ${{ parameters.runAsPublic }} - publishUsingPipelines: ${{ parameters.enablePublishUsingPipelines }} - enablePublishBuildArtifacts: ${{ parameters.enablePublishBuildArtifacts }} - -- ${{ if and(eq(parameters.graphFileGeneration.enabled, true), eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: - - template: ../job/generate-graph-files.yml - parameters: - continueOnError: ${{ parameters.continueOnError }} - includeToolset: ${{ parameters.graphFileGeneration.includeToolset }} - dependsOn: - - Asset_Registry_Publish - pool: - vmImage: vs2017-win2016 +- ${{ if and(eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: + - ${{ if or(eq(parameters.enablePublishBuildAssets, true), eq(parameters.artifacts.publish.manifests, 'true'), ne(parameters.artifacts.publish.manifests, '')) }}: + - template: ../job/publish-build-assets.yml + parameters: + continueOnError: ${{ parameters.continueOnError }} + dependsOn: + - ${{ if ne(parameters.publishBuildAssetsDependsOn, '') }}: + - ${{ each job in parameters.publishBuildAssetsDependsOn }}: + - ${{ job.job }} + - ${{ if eq(parameters.publishBuildAssetsDependsOn, '') }}: + - ${{ each job in parameters.jobs }}: + - ${{ job.job }} + pool: + vmImage: vs2017-win2016 + runAsPublic: ${{ parameters.runAsPublic }} + publishUsingPipelines: ${{ parameters.enablePublishUsingPipelines }} + enablePublishBuildArtifacts: ${{ parameters.enablePublishBuildArtifacts }} + + - ${{ if eq(parameters.graphFileGeneration.enabled, true) }}: + - template: ../job/generate-graph-files.yml + parameters: + continueOnError: ${{ parameters.continueOnError }} + includeToolset: ${{ parameters.graphFileGeneration.includeToolset }} + dependsOn: + - Asset_Registry_Publish + pool: + vmImage: vs2017-win2016 diff --git a/external/linker/eng/common/templates/post-build/channels/internal-servicing.yml b/external/linker/eng/common/templates/post-build/channels/internal-servicing.yml deleted file mode 100644 index dc065ab308..0000000000 --- a/external/linker/eng/common/templates/post-build/channels/internal-servicing.yml +++ /dev/null @@ -1,147 +0,0 @@ -parameters: - enableSymbolValidation: true - -stages: -- stage: IS_Publish - dependsOn: validate - variables: - - template: ../common-variables.yml - displayName: Internal Servicing - jobs: - - template: ../setup-maestro-vars.yml - - - job: - displayName: Symbol Publishing - dependsOn: setupMaestroVars - condition: contains(dependencies.setupMaestroVars.outputs['setReleaseVars.InitialChannels'], format('[{0}]', variables.InternalServicing_30_Channel_Id)) - variables: - - group: DotNet-Symbol-Server-Pats - pool: - vmImage: 'windows-2019' - steps: - - task: DownloadBuildArtifacts@0 - displayName: Download Artifacts - inputs: - downloadType: specific files - matchingPattern: "*Artifacts*" - - - task: PowerShell@2 - displayName: Publish - inputs: - filePath: eng\common\sdk-task.ps1 - arguments: -task PublishToSymbolServers -restore -msbuildEngine dotnet - /p:DotNetSymbolServerTokenMsdl=$(microsoft-symbol-server-pat) - /p:DotNetSymbolServerTokenSymWeb=$(symweb-symbol-server-pat) - /p:PDBArtifactsDirectory='$(Build.ArtifactStagingDirectory)/PDBArtifacts/' - /p:BlobBasePath='$(Build.ArtifactStagingDirectory)/BlobArtifacts/' - /p:Configuration=Release - - - job: publish_assets - displayName: Publish Assets - dependsOn: setupMaestroVars - variables: - - group: DotNet-Blob-Feed - - group: AzureDevOps-Artifact-Feeds-Pats - - name: BARBuildId - value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.BARBuildId'] ] - - name: IsStableBuild - value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.IsStableBuild'] ] - condition: contains(dependencies.setupMaestroVars.outputs['setReleaseVars.InitialChannels'], format('[{0}]', variables.InternalServicing_30_Channel_Id)) - pool: - vmImage: 'windows-2019' - steps: - - task: DownloadBuildArtifacts@0 - displayName: Download Package Artifacts - inputs: - buildType: current - artifactName: PackageArtifacts - - - task: DownloadBuildArtifacts@0 - displayName: Download Blob Artifacts - inputs: - buildType: current - artifactName: BlobArtifacts - - - task: DownloadBuildArtifacts@0 - displayName: Download Asset Manifests - inputs: - buildType: current - artifactName: AssetManifests - - - task: PowerShell@2 - displayName: Add Assets Location - env: - AZURE_DEVOPS_EXT_PAT: $(dn-bot-dnceng-unviersal-packages-rw) - inputs: - filePath: eng\common\sdk-task.ps1 - arguments: -task PublishArtifactsInManifest -restore -msbuildEngine dotnet - /p:ChannelId=$(InternalServicing_30_Channel_Id) - /p:IsStableBuild=$(IsStableBuild) - /p:IsInternalBuild=$(IsInternalBuild) - /p:RepositoryName=$(Build.Repository.Name) - /p:CommitSha=$(Build.SourceVersion) - /p:AzureStorageAccountName=$(ProxyBackedFeedsAccountName) - /p:AzureStorageAccountKey=$(dotnetfeed-storage-access-key-1) - /p:AzureDevOpsFeedsBaseUrl=$(dotnetfeed-internal-private-feed-url) - /p:StaticInternalFeed=$(dotnetfeed-internal-nonstable-feed-url) - /p:NugetPath=$(Agent.BuildDirectory)\Nuget\NuGet.exe - /p:BARBuildId=$(BARBuildId) - /p:MaestroApiEndpoint='$(MaestroApiEndPoint)' - /p:BuildAssetRegistryToken='$(MaestroApiAccessToken)' - /p:ManifestsBasePath='$(Build.ArtifactStagingDirectory)/AssetManifests/' - /p:BlobBasePath='$(Build.ArtifactStagingDirectory)\BlobArtifacts' - /p:PackageBasePath='$(Build.ArtifactStagingDirectory)\PackageArtifacts' - /p:Configuration=Release - - - task: NuGetCommand@2 - displayName: Publish Packages to AzDO Feed - condition: contains(variables['TargetAzDOFeed'], 'pkgs.visualstudio.com') - inputs: - command: push - vstsFeed: $(AzDoFeedName) - packagesToPush: $(Build.ArtifactStagingDirectory)\PackageArtifacts\*.nupkg - publishVstsFeed: $(AzDoFeedName) - - - task: PowerShell@2 - displayName: Publish Blobs to AzDO Feed - inputs: - filePath: $(Build.SourcesDirectory)/eng/common/post-build/publish-blobs-to-azdo.ps1 - arguments: -FeedName $(AzDoFeedName) - -SourceFolderCollection $(Build.ArtifactStagingDirectory)/BlobArtifacts/ - -PersonalAccessToken $(dn-bot-dnceng-unviersal-packages-rw) - enabled: false - - - template: ../trigger-subscription.yml - parameters: - ChannelId: ${{ variables.InternalServicing_30_Channel_Id }} - -- stage: IS_PublishValidation - displayName: Publish Validation - variables: - - template: ../common-variables.yml - jobs: - - template: ../setup-maestro-vars.yml - - - ${{ if eq(parameters.enableSymbolValidation, 'true') }}: - - job: - displayName: Symbol Availability - dependsOn: setupMaestroVars - condition: contains(dependencies.setupMaestroVars.outputs['setReleaseVars.InitialChannels'], format('[{0}]', variables.InternalServicing_30_Channel_Id)) - pool: - vmImage: 'windows-2019' - steps: - - task: DownloadBuildArtifacts@0 - displayName: Download Package Artifacts - inputs: - buildType: current - artifactName: PackageArtifacts - - - task: PowerShell@2 - displayName: Check Symbol Availability - inputs: - filePath: $(Build.SourcesDirectory)/eng/common/post-build/symbols-validation.ps1 - arguments: -InputPath $(Build.ArtifactStagingDirectory)/PackageArtifacts/ -ExtractPath $(Agent.BuildDirectory)/Temp/ -DotnetSymbolVersion $(SymbolToolVersion) - - - template: ../promote-build.yml - parameters: - ChannelId: ${{ variables.InternalServicing_30_Channel_Id }} diff --git a/external/linker/eng/common/templates/post-build/channels/netcore-dev-31.yml b/external/linker/eng/common/templates/post-build/channels/netcore-dev-31.yml new file mode 100644 index 0000000000..af64724f79 --- /dev/null +++ b/external/linker/eng/common/templates/post-build/channels/netcore-dev-31.yml @@ -0,0 +1,132 @@ +parameters: + artifactsPublishingAdditionalParameters: '' + dependsOn: + - Validate + publishInstallersAndChecksums: false + symbolPublishingAdditionalParameters: '' + +stages: +- stage: NetCore_Dev31_Publish + dependsOn: ${{ parameters.dependsOn }} + variables: + - template: ../common-variables.yml + displayName: .NET Core 3.1 Dev Publishing + jobs: + - template: ../setup-maestro-vars.yml + + - job: + displayName: Symbol Publishing + dependsOn: setupMaestroVars + condition: contains(dependencies.setupMaestroVars.outputs['setReleaseVars.InitialChannels'], format('[{0}]', variables.PublicDevRelease_31_Channel_Id)) + variables: + - group: DotNet-Symbol-Server-Pats + pool: + vmImage: 'windows-2019' + steps: + - task: DownloadBuildArtifacts@0 + displayName: Download Blob Artifacts + inputs: + artifactName: 'BlobArtifacts' + continueOnError: true + + - task: DownloadBuildArtifacts@0 + displayName: Download PDB Artifacts + inputs: + artifactName: 'PDBArtifacts' + continueOnError: true + + - task: PowerShell@2 + displayName: Publish + inputs: + filePath: eng\common\sdk-task.ps1 + arguments: -task PublishToSymbolServers -restore -msbuildEngine dotnet + /p:DotNetSymbolServerTokenMsdl=$(microsoft-symbol-server-pat) + /p:DotNetSymbolServerTokenSymWeb=$(symweb-symbol-server-pat) + /p:PDBArtifactsDirectory='$(Build.ArtifactStagingDirectory)/PDBArtifacts/' + /p:BlobBasePath='$(Build.ArtifactStagingDirectory)/BlobArtifacts/' + /p:SymbolPublishingExclusionsFile='$(Build.SourcesDirectory)/eng/SymbolPublishingExclusionsFile.txt' + /p:Configuration=Release + ${{ parameters.symbolPublishingAdditionalParameters }} + + - job: publish_assets + displayName: Publish Assets + dependsOn: setupMaestroVars + variables: + - group: DotNet-Blob-Feed + - group: AzureDevOps-Artifact-Feeds-Pats + - name: BARBuildId + value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.BARBuildId'] ] + - name: IsStableBuild + value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.IsStableBuild'] ] + condition: contains(dependencies.setupMaestroVars.outputs['setReleaseVars.InitialChannels'], format('[{0}]', variables.PublicDevRelease_31_Channel_Id)) + pool: + vmImage: 'windows-2019' + steps: + - task: DownloadBuildArtifacts@0 + displayName: Download Package Artifacts + inputs: + buildType: current + artifactName: PackageArtifacts + + - task: DownloadBuildArtifacts@0 + displayName: Download Blob Artifacts + inputs: + buildType: current + artifactName: BlobArtifacts + + - task: DownloadBuildArtifacts@0 + displayName: Download Asset Manifests + inputs: + buildType: current + artifactName: AssetManifests + + - task: NuGetToolInstaller@1 + displayName: 'Install NuGet.exe' + + # This is necessary whenever we want to publish/restore to an AzDO private feed + - task: NuGetAuthenticate@0 + displayName: 'Authenticate to AzDO Feeds' + + - task: PowerShell@2 + displayName: Enable cross-org publishing + inputs: + filePath: eng\common\enable-cross-org-publishing.ps1 + arguments: -token $(dn-bot-dnceng-artifact-feeds-rw) + + - task: PowerShell@2 + displayName: Publish Assets + inputs: + filePath: eng\common\sdk-task.ps1 + arguments: -task PublishArtifactsInManifest -restore -msbuildEngine dotnet + /p:ArtifactsCategory=$(_DotNetArtifactsCategory) + /p:IsStableBuild=$(IsStableBuild) + /p:IsInternalBuild=$(IsInternalBuild) + /p:RepositoryName=$(Build.Repository.Name) + /p:CommitSha=$(Build.SourceVersion) + /p:NugetPath=$(NuGetExeToolPath) + /p:AzdoTargetFeedPAT='$(dn-bot-dnceng-universal-packages-rw)' + /p:AzureStorageTargetFeedPAT='$(dotnetfeed-storage-access-key-1)' + /p:BARBuildId=$(BARBuildId) + /p:MaestroApiEndpoint='$(MaestroApiEndPoint)' + /p:BuildAssetRegistryToken='$(MaestroApiAccessToken)' + /p:ManifestsBasePath='$(Build.ArtifactStagingDirectory)/AssetManifests/' + /p:BlobBasePath='$(Build.ArtifactStagingDirectory)/BlobArtifacts/' + /p:PackageBasePath='$(Build.ArtifactStagingDirectory)/PackageArtifacts/' + /p:Configuration=Release + /p:PublishInstallersAndChecksums=${{ parameters.publishInstallersAndChecksums }} + /p:InstallersTargetStaticFeed=$(InstallersBlobFeedUrl) + /p:InstallersAzureAccountKey=$(dotnetcli-storage-key) + /p:ChecksumsTargetStaticFeed=$(ChecksumsBlobFeedUrl) + /p:ChecksumsAzureAccountKey=$(dotnetclichecksums-storage-key) + /p:PublishToAzureDevOpsNuGetFeeds=true + /p:AzureDevOpsStaticShippingFeed='https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet3.1/nuget/v3/index.json' + /p:AzureDevOpsStaticShippingFeedKey='$(dn-bot-dnceng-artifact-feeds-rw)' + /p:AzureDevOpsStaticTransportFeed='https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet3.1-transport/nuget/v3/index.json' + /p:AzureDevOpsStaticTransportFeedKey='$(dn-bot-dnceng-artifact-feeds-rw)' + /p:AzureDevOpsStaticSymbolsFeed='https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet3.1-symbols/nuget/v3/index.json' + /p:AzureDevOpsStaticSymbolsFeedKey='$(dn-bot-dnceng-artifact-feeds-rw)' + ${{ parameters.artifactsPublishingAdditionalParameters }} + + - template: ../../steps/promote-build.yml + parameters: + ChannelId: ${{ variables.PublicDevRelease_31_Channel_Id }} diff --git a/external/linker/eng/common/templates/post-build/channels/netcore-dev-5.yml b/external/linker/eng/common/templates/post-build/channels/netcore-dev-5.yml index f2b0cfb269..6c8dff5424 100644 --- a/external/linker/eng/common/templates/post-build/channels/netcore-dev-5.yml +++ b/external/linker/eng/common/templates/post-build/channels/netcore-dev-5.yml @@ -1,12 +1,16 @@ parameters: - enableSymbolValidation: true + artifactsPublishingAdditionalParameters: '' + dependsOn: + - Validate + publishInstallersAndChecksums: false + symbolPublishingAdditionalParameters: '' stages: - stage: NetCore_Dev5_Publish - dependsOn: validate + dependsOn: ${{ parameters.dependsOn }} variables: - template: ../common-variables.yml - displayName: .NET Core 5 Dev Channel + displayName: .NET Core 5 Dev Publishing jobs: - template: ../setup-maestro-vars.yml @@ -20,23 +24,31 @@ stages: vmImage: 'windows-2019' steps: - task: DownloadBuildArtifacts@0 - displayName: Download Artifacts + displayName: Download Blob Artifacts inputs: - downloadType: specific files - matchingPattern: "*Artifacts*" + artifactName: 'BlobArtifacts' + continueOnError: true + + - task: DownloadBuildArtifacts@0 + displayName: Download PDB Artifacts + inputs: + artifactName: 'PDBArtifacts' + continueOnError: true - task: PowerShell@2 displayName: Publish inputs: filePath: eng\common\sdk-task.ps1 arguments: -task PublishToSymbolServers -restore -msbuildEngine dotnet - /p:DotNetSymbolServerTokenMsdl=$(microsoft-symbol-server-pat) - /p:DotNetSymbolServerTokenSymWeb=$(symweb-symbol-server-pat) + /p:DotNetSymbolServerTokenMsdl=$(microsoft-symbol-server-pat) + /p:DotNetSymbolServerTokenSymWeb=$(symweb-symbol-server-pat) /p:PDBArtifactsDirectory='$(Build.ArtifactStagingDirectory)/PDBArtifacts/' /p:BlobBasePath='$(Build.ArtifactStagingDirectory)/BlobArtifacts/' + /p:SymbolPublishingExclusionsFile='$(Build.SourcesDirectory)/eng/SymbolPublishingExclusionsFile.txt' /p:Configuration=Release + ${{ parameters.symbolPublishingAdditionalParameters }} - - job: + - job: publish_assets displayName: Publish Assets dependsOn: setupMaestroVars variables: @@ -68,81 +80,53 @@ stages: buildType: current artifactName: AssetManifests + - task: NuGetToolInstaller@1 + displayName: 'Install NuGet.exe' + + # This is necessary whenever we want to publish/restore to an AzDO private feed + - task: NuGetAuthenticate@0 + displayName: 'Authenticate to AzDO Feeds' + - task: PowerShell@2 - displayName: Add Assets Location - env: - AZURE_DEVOPS_EXT_PAT: $(dn-bot-dnceng-unviersal-packages-rw) + displayName: Enable cross-org publishing + inputs: + filePath: eng\common\enable-cross-org-publishing.ps1 + arguments: -token $(dn-bot-dnceng-artifact-feeds-rw) + + - task: PowerShell@2 + displayName: Publish Assets inputs: filePath: eng\common\sdk-task.ps1 - arguments: -task PublishArtifactsInManifest -restore -msbuildEngine dotnet - /p:ChannelId=$(NetCore_5_Dev_Channel_Id) + arguments: -task PublishArtifactsInManifest -restore -msbuildEngine dotnet /p:ArtifactsCategory=$(_DotNetArtifactsCategory) /p:IsStableBuild=$(IsStableBuild) /p:IsInternalBuild=$(IsInternalBuild) /p:RepositoryName=$(Build.Repository.Name) /p:CommitSha=$(Build.SourceVersion) - /p:NugetPath=$(Agent.BuildDirectory)\Nuget\NuGet.exe - /p:AzdoTargetFeedPAT='$(dn-bot-dnceng-unviersal-packages-rw)' - /p:TargetFeedPAT='$(dn-bot-dnceng-unviersal-packages-rw)' - /p:AzureStorageTargetFeedPAT='$(dotnetfeed-storage-access-key-1)' - /p:BARBuildId=$(BARBuildId) - /p:MaestroApiEndpoint='$(MaestroApiEndPoint)' - /p:BuildAssetRegistryToken='$(MaestroApiAccessToken)' - /p:ManifestsBasePath='$(Build.ArtifactStagingDirectory)/AssetManifests/' - /p:BlobBasePath='$(Build.ArtifactStagingDirectory)/BlobArtifacts/' - /p:PackageBasePath='$(Build.ArtifactStagingDirectory)/PackageArtifacts/' - /p:Configuration=Release - - - task: NuGetCommand@2 - displayName: Publish Packages to AzDO Feed - condition: contains(variables['TargetAzDOFeed'], 'pkgs.visualstudio.com') - inputs: - command: push - vstsFeed: $(AzDoFeedName) - packagesToPush: $(Build.ArtifactStagingDirectory)\PackageArtifacts\*.nupkg - publishVstsFeed: $(AzDoFeedName) + /p:NugetPath=$(NuGetExeToolPath) + /p:AzdoTargetFeedPAT='$(dn-bot-dnceng-universal-packages-rw)' + /p:AzureStorageTargetFeedPAT='$(dotnetfeed-storage-access-key-1)' + /p:BARBuildId=$(BARBuildId) + /p:MaestroApiEndpoint='$(MaestroApiEndPoint)' + /p:BuildAssetRegistryToken='$(MaestroApiAccessToken)' + /p:ManifestsBasePath='$(Build.ArtifactStagingDirectory)/AssetManifests/' + /p:BlobBasePath='$(Build.ArtifactStagingDirectory)/BlobArtifacts/' + /p:PackageBasePath='$(Build.ArtifactStagingDirectory)/PackageArtifacts/' + /p:Configuration=Release + /p:PublishInstallersAndChecksums=${{ parameters.publishInstallersAndChecksums }} + /p:InstallersTargetStaticFeed=$(InstallersBlobFeedUrl) + /p:InstallersAzureAccountKey=$(dotnetcli-storage-key) + /p:ChecksumsTargetStaticFeed=$(ChecksumsBlobFeedUrl) + /p:ChecksumsAzureAccountKey=$(dotnetclichecksums-storage-key) + /p:PublishToAzureDevOpsNuGetFeeds=true + /p:AzureDevOpsStaticShippingFeed='https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5/nuget/v3/index.json' + /p:AzureDevOpsStaticShippingFeedKey='$(dn-bot-dnceng-artifact-feeds-rw)' + /p:AzureDevOpsStaticTransportFeed='https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5-transport/nuget/v3/index.json' + /p:AzureDevOpsStaticTransportFeedKey='$(dn-bot-dnceng-artifact-feeds-rw)' + /p:AzureDevOpsStaticSymbolsFeed='https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5-symbols/nuget/v3/index.json' + /p:AzureDevOpsStaticSymbolsFeedKey='$(dn-bot-dnceng-artifact-feeds-rw)' + ${{ parameters.artifactsPublishingAdditionalParameters }} - - task: PowerShell@2 - displayName: Publish Blobs to AzDO Feed - inputs: - filePath: $(Build.SourcesDirectory)/eng/common/post-build/publish-blobs-to-azdo.ps1 - arguments: -FeedName $(AzDoFeedName) - -SourceFolderCollection $(Build.ArtifactStagingDirectory)/BlobArtifacts/ - -PersonalAccessToken $(dn-bot-dnceng-unviersal-packages-rw) - enabled: false - - -- stage: NetCore_Dev5_PublishValidation - displayName: Publish Validation - variables: - - template: ../common-variables.yml - jobs: - - template: ../setup-maestro-vars.yml - - - ${{ if eq(parameters.enableSymbolValidation, 'true') }}: - - job: - displayName: Symbol Availability - dependsOn: setupMaestroVars - condition: contains(dependencies.setupMaestroVars.outputs['setReleaseVars.InitialChannels'], format('[{0}]', variables.NetCore_5_Dev_Channel_Id)) - pool: - vmImage: 'windows-2019' - steps: - - task: DownloadBuildArtifacts@0 - displayName: Download Package Artifacts - inputs: - buildType: current - artifactName: PackageArtifacts - - - task: PowerShell@2 - displayName: Check Symbol Availability - inputs: - filePath: $(Build.SourcesDirectory)/eng/common/post-build/symbols-validation.ps1 - arguments: -InputPath $(Build.ArtifactStagingDirectory)/PackageArtifacts/ -ExtractPath $(Agent.BuildDirectory)/Temp/ -DotnetSymbolVersion $(SymbolToolVersion) - - - template: ../darc-gather-drop.yml - parameters: - ChannelId: ${{ variables.NetCore_5_Dev_Channel_Id }} - - - template: ../promote-build.yml - parameters: - ChannelId: ${{ variables.NetCore_5_Dev_Channel_Id }} + - template: ../../steps/promote-build.yml + parameters: + ChannelId: ${{ variables.NetCore_5_Dev_Channel_Id }} diff --git a/external/linker/eng/common/templates/post-build/channels/netcore-internal-30.yml b/external/linker/eng/common/templates/post-build/channels/netcore-internal-30.yml new file mode 100644 index 0000000000..201ed570ae --- /dev/null +++ b/external/linker/eng/common/templates/post-build/channels/netcore-internal-30.yml @@ -0,0 +1,142 @@ +parameters: + artifactsPublishingAdditionalParameters: '' + dependsOn: + - Validate + symbolPublishingAdditionalParameters: '' + +stages: +- stage: NetCore_30_Internal_Servicing_Publishing + dependsOn: ${{ parameters.dependsOn }} + variables: + - template: ../common-variables.yml + displayName: .NET Core 3.0 Internal Servicing Publishing + jobs: + - template: ../setup-maestro-vars.yml + + - job: + displayName: Symbol Publishing + dependsOn: setupMaestroVars + condition: contains(dependencies.setupMaestroVars.outputs['setReleaseVars.InitialChannels'], format('[{0}]', variables.InternalServicing_30_Channel_Id)) + variables: + - group: DotNet-Symbol-Server-Pats + pool: + vmImage: 'windows-2019' + steps: + - task: DownloadBuildArtifacts@0 + displayName: Download Blob Artifacts + inputs: + artifactName: 'BlobArtifacts' + continueOnError: true + + - task: DownloadBuildArtifacts@0 + displayName: Download PDB Artifacts + inputs: + artifactName: 'PDBArtifacts' + continueOnError: true + + # This is necessary whenever we want to publish/restore to an AzDO private feed + # Since sdk-task.ps1 tries to restore packages we need to do this authentication here + # otherwise it'll complain about accessing a private feed. + - task: NuGetAuthenticate@0 + displayName: 'Authenticate to AzDO Feeds' + + - task: PowerShell@2 + displayName: Enable cross-org publishing + inputs: + filePath: eng\common\enable-cross-org-publishing.ps1 + arguments: -token $(dn-bot-dnceng-artifact-feeds-rw) + + - task: PowerShell@2 + displayName: Publish + inputs: + filePath: eng\common\sdk-task.ps1 + arguments: -task PublishToSymbolServers -restore -msbuildEngine dotnet + /p:DotNetSymbolServerTokenMsdl=$(microsoft-symbol-server-pat) + /p:DotNetSymbolServerTokenSymWeb=$(symweb-symbol-server-pat) + /p:PDBArtifactsDirectory='$(Build.ArtifactStagingDirectory)/PDBArtifacts/' + /p:BlobBasePath='$(Build.ArtifactStagingDirectory)/BlobArtifacts/' + /p:SymbolPublishingExclusionsFile='$(Build.SourcesDirectory)/eng/SymbolPublishingExclusionsFile.txt' + /p:Configuration=Release + ${{ parameters.symbolPublishingAdditionalParameters }} + + - job: publish_assets + displayName: Publish Assets + dependsOn: setupMaestroVars + variables: + - group: DotNet-Blob-Feed + - group: AzureDevOps-Artifact-Feeds-Pats + - name: BARBuildId + value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.BARBuildId'] ] + - name: IsStableBuild + value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.IsStableBuild'] ] + condition: contains(dependencies.setupMaestroVars.outputs['setReleaseVars.InitialChannels'], format('[{0}]', variables.InternalServicing_30_Channel_Id)) + pool: + vmImage: 'windows-2019' + steps: + - task: DownloadBuildArtifacts@0 + displayName: Download Package Artifacts + inputs: + buildType: current + artifactName: PackageArtifacts + + - task: DownloadBuildArtifacts@0 + displayName: Download Blob Artifacts + inputs: + buildType: current + artifactName: BlobArtifacts + + - task: DownloadBuildArtifacts@0 + displayName: Download Asset Manifests + inputs: + buildType: current + artifactName: AssetManifests + + - task: NuGetToolInstaller@1 + displayName: 'Install NuGet.exe' + + # This is necessary whenever we want to publish/restore to an AzDO private feed + - task: NuGetAuthenticate@0 + displayName: 'Authenticate to AzDO Feeds' + + - task: PowerShell@2 + displayName: Enable cross-org publishing + inputs: + filePath: eng\common\enable-cross-org-publishing.ps1 + arguments: -token $(dn-bot-dnceng-artifact-feeds-rw) + + - task: PowerShell@2 + displayName: Publish Assets + inputs: + filePath: eng\common\sdk-task.ps1 + arguments: -task PublishArtifactsInManifest -restore -msbuildEngine dotnet + /p:IsStableBuild=$(IsStableBuild) + /p:IsInternalBuild=$(IsInternalBuild) + /p:RepositoryName=$(Build.Repository.Name) + /p:CommitSha=$(Build.SourceVersion) + /p:NugetPath=$(NuGetExeToolPath) + /p:AzdoTargetFeedPAT='$(dn-bot-dnceng-universal-packages-rw)' + /p:AzureStorageTargetFeedPAT='$(dotnetfeed-storage-access-key-1)' + /p:BARBuildId=$(BARBuildId) + /p:MaestroApiEndpoint='$(MaestroApiEndPoint)' + /p:BuildAssetRegistryToken='$(MaestroApiAccessToken)' + /p:ManifestsBasePath='$(Build.ArtifactStagingDirectory)/AssetManifests/' + /p:BlobBasePath='$(Build.ArtifactStagingDirectory)/BlobArtifacts/' + /p:PackageBasePath='$(Build.ArtifactStagingDirectory)/PackageArtifacts/' + /p:Configuration=Release + /p:PublishInstallersAndChecksums=true + /p:ChecksumsTargetStaticFeed=$(InternalChecksumsBlobFeedUrl) + /p:ChecksumsAzureAccountKey=$(InternalChecksumsBlobFeedKey) + /p:InstallersTargetStaticFeed=$(InternalInstallersBlobFeedUrl) + /p:InstallersAzureAccountKey=$(InternalInstallersBlobFeedKey) + /p:PublishToAzureDevOpsNuGetFeeds=true + /p:AzureDevOpsStaticShippingFeed='https://pkgs.dev.azure.com/dnceng/_packaging/dotnet3-internal/nuget/v3/index.json' + /p:AzureDevOpsStaticShippingFeedKey='$(dn-bot-dnceng-artifact-feeds-rw)' + /p:AzureDevOpsStaticTransportFeed='https://pkgs.dev.azure.com/dnceng/_packaging/dotnet3-internal-transport/nuget/v3/index.json' + /p:AzureDevOpsStaticTransportFeedKey='$(dn-bot-dnceng-artifact-feeds-rw)' + /p:AzureDevOpsStaticSymbolsFeed='https://pkgs.dev.azure.com/dnceng/_packaging/dotnet3-internal-symbols/nuget/v3/index.json' + /p:AzureDevOpsStaticSymbolsFeedKey='$(dn-bot-dnceng-artifact-feeds-rw)' + ${{ parameters.artifactsPublishingAdditionalParameters }} + + - template: ../../steps/promote-build.yml + parameters: + ChannelId: ${{ variables.InternalServicing_30_Channel_Id }} diff --git a/external/linker/eng/common/templates/post-build/channels/netcore-release-30.yml b/external/linker/eng/common/templates/post-build/channels/netcore-release-30.yml new file mode 100644 index 0000000000..206dd43e3a --- /dev/null +++ b/external/linker/eng/common/templates/post-build/channels/netcore-release-30.yml @@ -0,0 +1,132 @@ +parameters: + artifactsPublishingAdditionalParameters: '' + dependsOn: + - Validate + publishInstallersAndChecksums: false + symbolPublishingAdditionalParameters: '' + +stages: +- stage: NetCore_Release30_Publish + dependsOn: ${{ parameters.dependsOn }} + variables: + - template: ../common-variables.yml + displayName: .NET Core 3.0 Release Publishing + jobs: + - template: ../setup-maestro-vars.yml + + - job: + displayName: Symbol Publishing + dependsOn: setupMaestroVars + condition: contains(dependencies.setupMaestroVars.outputs['setReleaseVars.InitialChannels'], format('[{0}]', variables.PublicRelease_30_Channel_Id)) + variables: + - group: DotNet-Symbol-Server-Pats + pool: + vmImage: 'windows-2019' + steps: + - task: DownloadBuildArtifacts@0 + displayName: Download Blob Artifacts + inputs: + artifactName: 'BlobArtifacts' + continueOnError: true + + - task: DownloadBuildArtifacts@0 + displayName: Download PDB Artifacts + inputs: + artifactName: 'PDBArtifacts' + continueOnError: true + + - task: PowerShell@2 + displayName: Publish + inputs: + filePath: eng\common\sdk-task.ps1 + arguments: -task PublishToSymbolServers -restore -msbuildEngine dotnet + /p:DotNetSymbolServerTokenMsdl=$(microsoft-symbol-server-pat) + /p:DotNetSymbolServerTokenSymWeb=$(symweb-symbol-server-pat) + /p:PDBArtifactsDirectory='$(Build.ArtifactStagingDirectory)/PDBArtifacts/' + /p:BlobBasePath='$(Build.ArtifactStagingDirectory)/BlobArtifacts/' + /p:SymbolPublishingExclusionsFile='$(Build.SourcesDirectory)/eng/SymbolPublishingExclusionsFile.txt' + /p:Configuration=Release + ${{ parameters.symbolPublishingAdditionalParameters }} + + - job: publish_assets + displayName: Publish Assets + dependsOn: setupMaestroVars + variables: + - group: DotNet-Blob-Feed + - group: AzureDevOps-Artifact-Feeds-Pats + - name: BARBuildId + value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.BARBuildId'] ] + - name: IsStableBuild + value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.IsStableBuild'] ] + condition: contains(dependencies.setupMaestroVars.outputs['setReleaseVars.InitialChannels'], format('[{0}]', variables.PublicRelease_30_Channel_Id)) + pool: + vmImage: 'windows-2019' + steps: + - task: DownloadBuildArtifacts@0 + displayName: Download Package Artifacts + inputs: + buildType: current + artifactName: PackageArtifacts + + - task: DownloadBuildArtifacts@0 + displayName: Download Blob Artifacts + inputs: + buildType: current + artifactName: BlobArtifacts + + - task: DownloadBuildArtifacts@0 + displayName: Download Asset Manifests + inputs: + buildType: current + artifactName: AssetManifests + + - task: NuGetToolInstaller@1 + displayName: 'Install NuGet.exe' + + # This is necessary whenever we want to publish/restore to an AzDO private feed + - task: NuGetAuthenticate@0 + displayName: 'Authenticate to AzDO Feeds' + + - task: PowerShell@2 + displayName: Enable cross-org publishing + inputs: + filePath: eng\common\enable-cross-org-publishing.ps1 + arguments: -token $(dn-bot-dnceng-artifact-feeds-rw) + + - task: PowerShell@2 + displayName: Publish Assets + inputs: + filePath: eng\common\sdk-task.ps1 + arguments: -task PublishArtifactsInManifest -restore -msbuildEngine dotnet + /p:ArtifactsCategory=$(_DotNetArtifactsCategory) + /p:IsStableBuild=$(IsStableBuild) + /p:IsInternalBuild=$(IsInternalBuild) + /p:RepositoryName=$(Build.Repository.Name) + /p:CommitSha=$(Build.SourceVersion) + /p:NugetPath=$(NuGetExeToolPath) + /p:AzdoTargetFeedPAT='$(dn-bot-dnceng-universal-packages-rw)' + /p:AzureStorageTargetFeedPAT='$(dotnetfeed-storage-access-key-1)' + /p:BARBuildId=$(BARBuildId) + /p:MaestroApiEndpoint='$(MaestroApiEndPoint)' + /p:BuildAssetRegistryToken='$(MaestroApiAccessToken)' + /p:ManifestsBasePath='$(Build.ArtifactStagingDirectory)/AssetManifests/' + /p:BlobBasePath='$(Build.ArtifactStagingDirectory)/BlobArtifacts/' + /p:PackageBasePath='$(Build.ArtifactStagingDirectory)/PackageArtifacts/' + /p:Configuration=Release + /p:PublishInstallersAndChecksums=${{ parameters.publishInstallersAndChecksums }} + /p:InstallersTargetStaticFeed=$(InstallersBlobFeedUrl) + /p:InstallersAzureAccountKey=$(dotnetcli-storage-key) + /p:ChecksumsTargetStaticFeed=$(ChecksumsBlobFeedUrl) + /p:ChecksumsAzureAccountKey=$(dotnetclichecksums-storage-key) + /p:PublishToAzureDevOpsNuGetFeeds=true + /p:AzureDevOpsStaticShippingFeed='https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet3/nuget/v3/index.json' + /p:AzureDevOpsStaticShippingFeedKey='$(dn-bot-dnceng-artifact-feeds-rw)' + /p:AzureDevOpsStaticTransportFeed='https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet3-transport/nuget/v3/index.json' + /p:AzureDevOpsStaticTransportFeedKey='$(dn-bot-dnceng-artifact-feeds-rw)' + /p:AzureDevOpsStaticSymbolsFeed='https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet3-symbols/nuget/v3/index.json' + /p:AzureDevOpsStaticSymbolsFeedKey='$(dn-bot-dnceng-artifact-feeds-rw)' + ${{ parameters.artifactsPublishingAdditionalParameters }} + + - template: ../../steps/promote-build.yml + parameters: + ChannelId: ${{ variables.PublicRelease_30_Channel_Id }} diff --git a/external/linker/eng/common/templates/post-build/channels/netcore-release-31.yml b/external/linker/eng/common/templates/post-build/channels/netcore-release-31.yml new file mode 100644 index 0000000000..6270c82835 --- /dev/null +++ b/external/linker/eng/common/templates/post-build/channels/netcore-release-31.yml @@ -0,0 +1,132 @@ +parameters: + artifactsPublishingAdditionalParameters: '' + dependsOn: + - Validate + publishInstallersAndChecksums: false + symbolPublishingAdditionalParameters: '' + +stages: +- stage: NetCore_Release31_Publish + dependsOn: ${{ parameters.dependsOn }} + variables: + - template: ../common-variables.yml + displayName: .NET Core 3.1 Release Publishing + jobs: + - template: ../setup-maestro-vars.yml + + - job: + displayName: Symbol Publishing + dependsOn: setupMaestroVars + condition: contains(dependencies.setupMaestroVars.outputs['setReleaseVars.InitialChannels'], format('[{0}]', variables.PublicRelease_31_Channel_Id)) + variables: + - group: DotNet-Symbol-Server-Pats + pool: + vmImage: 'windows-2019' + steps: + - task: DownloadBuildArtifacts@0 + displayName: Download Blob Artifacts + inputs: + artifactName: 'BlobArtifacts' + continueOnError: true + + - task: DownloadBuildArtifacts@0 + displayName: Download PDB Artifacts + inputs: + artifactName: 'PDBArtifacts' + continueOnError: true + + - task: PowerShell@2 + displayName: Publish + inputs: + filePath: eng\common\sdk-task.ps1 + arguments: -task PublishToSymbolServers -restore -msbuildEngine dotnet + /p:DotNetSymbolServerTokenMsdl=$(microsoft-symbol-server-pat) + /p:DotNetSymbolServerTokenSymWeb=$(symweb-symbol-server-pat) + /p:PDBArtifactsDirectory='$(Build.ArtifactStagingDirectory)/PDBArtifacts/' + /p:BlobBasePath='$(Build.ArtifactStagingDirectory)/BlobArtifacts/' + /p:SymbolPublishingExclusionsFile='$(Build.SourcesDirectory)/eng/SymbolPublishingExclusionsFile.txt' + /p:Configuration=Release + ${{ parameters.symbolPublishingAdditionalParameters }} + + - job: publish_assets + displayName: Publish Assets + dependsOn: setupMaestroVars + variables: + - group: DotNet-Blob-Feed + - group: AzureDevOps-Artifact-Feeds-Pats + - name: BARBuildId + value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.BARBuildId'] ] + - name: IsStableBuild + value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.IsStableBuild'] ] + condition: contains(dependencies.setupMaestroVars.outputs['setReleaseVars.InitialChannels'], format('[{0}]', variables.PublicRelease_31_Channel_Id)) + pool: + vmImage: 'windows-2019' + steps: + - task: DownloadBuildArtifacts@0 + displayName: Download Package Artifacts + inputs: + buildType: current + artifactName: PackageArtifacts + + - task: DownloadBuildArtifacts@0 + displayName: Download Blob Artifacts + inputs: + buildType: current + artifactName: BlobArtifacts + + - task: DownloadBuildArtifacts@0 + displayName: Download Asset Manifests + inputs: + buildType: current + artifactName: AssetManifests + + - task: NuGetToolInstaller@1 + displayName: 'Install NuGet.exe' + + # This is necessary whenever we want to publish/restore to an AzDO private feed + - task: NuGetAuthenticate@0 + displayName: 'Authenticate to AzDO Feeds' + + - task: PowerShell@2 + displayName: Enable cross-org publishing + inputs: + filePath: eng\common\enable-cross-org-publishing.ps1 + arguments: -token $(dn-bot-dnceng-artifact-feeds-rw) + + - task: PowerShell@2 + displayName: Publish Assets + inputs: + filePath: eng\common\sdk-task.ps1 + arguments: -task PublishArtifactsInManifest -restore -msbuildEngine dotnet + /p:ArtifactsCategory=$(_DotNetArtifactsCategory) + /p:IsStableBuild=$(IsStableBuild) + /p:IsInternalBuild=$(IsInternalBuild) + /p:RepositoryName=$(Build.Repository.Name) + /p:CommitSha=$(Build.SourceVersion) + /p:NugetPath=$(NuGetExeToolPath) + /p:AzdoTargetFeedPAT='$(dn-bot-dnceng-universal-packages-rw)' + /p:AzureStorageTargetFeedPAT='$(dotnetfeed-storage-access-key-1)' + /p:BARBuildId=$(BARBuildId) + /p:MaestroApiEndpoint='$(MaestroApiEndPoint)' + /p:BuildAssetRegistryToken='$(MaestroApiAccessToken)' + /p:ManifestsBasePath='$(Build.ArtifactStagingDirectory)/AssetManifests/' + /p:BlobBasePath='$(Build.ArtifactStagingDirectory)/BlobArtifacts/' + /p:PackageBasePath='$(Build.ArtifactStagingDirectory)/PackageArtifacts/' + /p:Configuration=Release + /p:PublishInstallersAndChecksums=${{ parameters.publishInstallersAndChecksums }} + /p:InstallersTargetStaticFeed=$(InstallersBlobFeedUrl) + /p:InstallersAzureAccountKey=$(dotnetcli-storage-key) + /p:ChecksumsTargetStaticFeed=$(ChecksumsBlobFeedUrl) + /p:ChecksumsAzureAccountKey=$(dotnetclichecksums-storage-key) + /p:PublishToAzureDevOpsNuGetFeeds=true + /p:AzureDevOpsStaticShippingFeed='https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet3.1/nuget/v3/index.json' + /p:AzureDevOpsStaticShippingFeedKey='$(dn-bot-dnceng-artifact-feeds-rw)' + /p:AzureDevOpsStaticTransportFeed='https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet3.1-transport/nuget/v3/index.json' + /p:AzureDevOpsStaticTransportFeedKey='$(dn-bot-dnceng-artifact-feeds-rw)' + /p:AzureDevOpsStaticSymbolsFeed='https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet3.1-symbols/nuget/v3/index.json' + /p:AzureDevOpsStaticSymbolsFeedKey='$(dn-bot-dnceng-artifact-feeds-rw)' + ${{ parameters.artifactsPublishingAdditionalParameters }} + + - template: ../../steps/promote-build.yml + parameters: + ChannelId: ${{ variables.PublicRelease_31_Channel_Id }} diff --git a/external/linker/eng/common/templates/post-build/channels/netcore-tools-latest.yml b/external/linker/eng/common/templates/post-build/channels/netcore-tools-latest.yml index fd6c09b227..9bf9626ca3 100644 --- a/external/linker/eng/common/templates/post-build/channels/netcore-tools-latest.yml +++ b/external/linker/eng/common/templates/post-build/channels/netcore-tools-latest.yml @@ -1,12 +1,16 @@ parameters: - enableSymbolValidation: true + artifactsPublishingAdditionalParameters: '' + dependsOn: + - Validate + publishInstallersAndChecksums: false + symbolPublishingAdditionalParameters: '' stages: - stage: NetCore_Tools_Latest_Publish - dependsOn: validate + dependsOn: ${{ parameters.dependsOn }} variables: - template: ../common-variables.yml - displayName: .NET Tools - Latest + displayName: .NET Tools - Latest Publishing jobs: - template: ../setup-maestro-vars.yml @@ -20,23 +24,31 @@ stages: vmImage: 'windows-2019' steps: - task: DownloadBuildArtifacts@0 - displayName: Download Artifacts + displayName: Download Blob Artifacts inputs: - downloadType: specific files - matchingPattern: "*Artifacts*" + artifactName: 'BlobArtifacts' + continueOnError: true + + - task: DownloadBuildArtifacts@0 + displayName: Download PDB Artifacts + inputs: + artifactName: 'PDBArtifacts' + continueOnError: true - task: PowerShell@2 displayName: Publish inputs: filePath: eng\common\sdk-task.ps1 arguments: -task PublishToSymbolServers -restore -msbuildEngine dotnet - /p:DotNetSymbolServerTokenMsdl=$(microsoft-symbol-server-pat) - /p:DotNetSymbolServerTokenSymWeb=$(symweb-symbol-server-pat) + /p:DotNetSymbolServerTokenMsdl=$(microsoft-symbol-server-pat) + /p:DotNetSymbolServerTokenSymWeb=$(symweb-symbol-server-pat) /p:PDBArtifactsDirectory='$(Build.ArtifactStagingDirectory)/PDBArtifacts/' /p:BlobBasePath='$(Build.ArtifactStagingDirectory)/BlobArtifacts/' + /p:SymbolPublishingExclusionsFile='$(Build.SourcesDirectory)/eng/SymbolPublishingExclusionsFile.txt' /p:Configuration=Release + ${{ parameters.symbolPublishingAdditionalParameters }} - - job: + - job: publish_assets displayName: Publish Assets dependsOn: setupMaestroVars variables: @@ -68,81 +80,53 @@ stages: buildType: current artifactName: AssetManifests + - task: NuGetToolInstaller@1 + displayName: 'Install NuGet.exe' + + # This is necessary whenever we want to publish/restore to an AzDO private feed + - task: NuGetAuthenticate@0 + displayName: 'Authenticate to AzDO Feeds' + - task: PowerShell@2 - displayName: Add Assets Location - env: - AZURE_DEVOPS_EXT_PAT: $(dn-bot-dnceng-unviersal-packages-rw) + displayName: Enable cross-org publishing + inputs: + filePath: eng\common\enable-cross-org-publishing.ps1 + arguments: -token $(dn-bot-dnceng-artifact-feeds-rw) + + - task: PowerShell@2 + displayName: Publish Assets inputs: filePath: eng\common\sdk-task.ps1 - arguments: -task PublishArtifactsInManifest -restore -msbuildEngine dotnet - /p:ChannelId=$(NetCore_Tools_Latest_Channel_Id) + arguments: -task PublishArtifactsInManifest -restore -msbuildEngine dotnet /p:ArtifactsCategory=$(_DotNetArtifactsCategory) /p:IsStableBuild=$(IsStableBuild) /p:IsInternalBuild=$(IsInternalBuild) /p:RepositoryName=$(Build.Repository.Name) /p:CommitSha=$(Build.SourceVersion) - /p:NugetPath=$(Agent.BuildDirectory)\Nuget\NuGet.exe - /p:AzdoTargetFeedPAT='$(dn-bot-dnceng-unviersal-packages-rw)' - /p:TargetFeedPAT='$(dn-bot-dnceng-unviersal-packages-rw)' - /p:AzureStorageTargetFeedPAT='$(dotnetfeed-storage-access-key-1)' - /p:BARBuildId=$(BARBuildId) - /p:MaestroApiEndpoint='$(MaestroApiEndPoint)' - /p:BuildAssetRegistryToken='$(MaestroApiAccessToken)' - /p:ManifestsBasePath='$(Build.ArtifactStagingDirectory)/AssetManifests/' - /p:BlobBasePath='$(Build.ArtifactStagingDirectory)/BlobArtifacts/' - /p:PackageBasePath='$(Build.ArtifactStagingDirectory)/PackageArtifacts/' - /p:Configuration=Release - - - task: NuGetCommand@2 - displayName: Publish Packages to AzDO Feed - condition: contains(variables['TargetAzDOFeed'], 'pkgs.visualstudio.com') - inputs: - command: push - vstsFeed: $(AzDoFeedName) - packagesToPush: $(Build.ArtifactStagingDirectory)\PackageArtifacts\*.nupkg - publishVstsFeed: $(AzDoFeedName) + /p:NugetPath=$(NuGetExeToolPath) + /p:AzdoTargetFeedPAT='$(dn-bot-dnceng-universal-packages-rw)' + /p:AzureStorageTargetFeedPAT='$(dotnetfeed-storage-access-key-1)' + /p:BARBuildId=$(BARBuildId) + /p:MaestroApiEndpoint='$(MaestroApiEndPoint)' + /p:BuildAssetRegistryToken='$(MaestroApiAccessToken)' + /p:ManifestsBasePath='$(Build.ArtifactStagingDirectory)/AssetManifests/' + /p:BlobBasePath='$(Build.ArtifactStagingDirectory)/BlobArtifacts/' + /p:PackageBasePath='$(Build.ArtifactStagingDirectory)/PackageArtifacts/' + /p:Configuration=Release + /p:PublishInstallersAndChecksums=${{ parameters.publishInstallersAndChecksums }} + /p:InstallersTargetStaticFeed=$(InstallersBlobFeedUrl) + /p:InstallersAzureAccountKey=$(dotnetcli-storage-key) + /p:ChecksumsTargetStaticFeed=$(ChecksumsBlobFeedUrl) + /p:ChecksumsAzureAccountKey=$(dotnetclichecksums-storage-key) + /p:PublishToAzureDevOpsNuGetFeeds=true + /p:AzureDevOpsStaticShippingFeed='https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json' + /p:AzureDevOpsStaticShippingFeedKey='$(dn-bot-dnceng-artifact-feeds-rw)' + /p:AzureDevOpsStaticTransportFeed='https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json' + /p:AzureDevOpsStaticTransportFeedKey='$(dn-bot-dnceng-artifact-feeds-rw)' + /p:AzureDevOpsStaticSymbolsFeed='https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools-symbols/nuget/v3/index.json' + /p:AzureDevOpsStaticSymbolsFeedKey='$(dn-bot-dnceng-artifact-feeds-rw)' + ${{ parameters.artifactsPublishingAdditionalParameters }} - - task: PowerShell@2 - displayName: Publish Blobs to AzDO Feed - inputs: - filePath: $(Build.SourcesDirectory)/eng/common/post-build/publish-blobs-to-azdo.ps1 - arguments: -FeedName $(AzDoFeedName) - -SourceFolderCollection $(Build.ArtifactStagingDirectory)/BlobArtifacts/ - -PersonalAccessToken $(dn-bot-dnceng-unviersal-packages-rw) - enabled: false - - -- stage: NetCore_Tools_Latest_PublishValidation - displayName: Publish Validation - variables: - - template: ../common-variables.yml - jobs: - - template: ../setup-maestro-vars.yml - - - ${{ if eq(parameters.enableSymbolValidation, 'true') }}: - - job: - displayName: Symbol Availability - dependsOn: setupMaestroVars - condition: contains(dependencies.setupMaestroVars.outputs['setReleaseVars.InitialChannels'], format('[{0}]', variables.NetCore_Tools_Latest_Channel_Id)) - pool: - vmImage: 'windows-2019' - steps: - - task: DownloadBuildArtifacts@0 - displayName: Download Package Artifacts - inputs: - buildType: current - artifactName: PackageArtifacts - - - task: PowerShell@2 - displayName: Check Symbol Availability - inputs: - filePath: $(Build.SourcesDirectory)/eng/common/post-build/symbols-validation.ps1 - arguments: -InputPath $(Build.ArtifactStagingDirectory)/PackageArtifacts/ -ExtractPath $(Agent.BuildDirectory)/Temp/ -DotnetSymbolVersion $(SymbolToolVersion) - - - template: ../darc-gather-drop.yml - parameters: - ChannelId: ${{ variables.NetCore_Tools_Latest_Channel_Id }} - - - template: ../promote-build.yml - parameters: - ChannelId: ${{ variables.NetCore_Tools_Latest_Channel_Id }} + - template: ../../steps/promote-build.yml + parameters: + ChannelId: ${{ variables.NetCore_Tools_Latest_Channel_Id }} \ No newline at end of file diff --git a/external/linker/eng/common/templates/post-build/channels/public-dev-release.yml b/external/linker/eng/common/templates/post-build/channels/public-dev-release.yml deleted file mode 100644 index 771dcf4ef8..0000000000 --- a/external/linker/eng/common/templates/post-build/channels/public-dev-release.yml +++ /dev/null @@ -1,148 +0,0 @@ -parameters: - enableSymbolValidation: true - -stages: -- stage: Publish - dependsOn: validate - variables: - - template: ../common-variables.yml - displayName: Developer Channel - jobs: - - template: ../setup-maestro-vars.yml - - - job: - displayName: Symbol Publishing - dependsOn: setupMaestroVars - condition: contains(dependencies.setupMaestroVars.outputs['setReleaseVars.InitialChannels'], format('[{0}]', variables.PublicDevRelease_30_Channel_Id)) - variables: - - group: DotNet-Symbol-Server-Pats - pool: - vmImage: 'windows-2019' - steps: - - task: DownloadBuildArtifacts@0 - displayName: Download Artifacts - inputs: - downloadType: specific files - matchingPattern: "*Artifacts*" - - - task: PowerShell@2 - displayName: Publish - inputs: - filePath: eng\common\sdk-task.ps1 - arguments: -task PublishToSymbolServers -restore -msbuildEngine dotnet - /p:DotNetSymbolServerTokenMsdl=$(microsoft-symbol-server-pat) - /p:DotNetSymbolServerTokenSymWeb=$(symweb-symbol-server-pat) - /p:PDBArtifactsDirectory='$(Build.ArtifactStagingDirectory)/PDBArtifacts/' - /p:BlobBasePath='$(Build.ArtifactStagingDirectory)/BlobArtifacts/' - /p:Configuration=Release - - - job: - displayName: Publish Assets - dependsOn: setupMaestroVars - variables: - - group: DotNet-Blob-Feed - - group: AzureDevOps-Artifact-Feeds-Pats - - name: BARBuildId - value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.BARBuildId'] ] - - name: IsStableBuild - value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.IsStableBuild'] ] - condition: contains(dependencies.setupMaestroVars.outputs['setReleaseVars.InitialChannels'], format('[{0}]', variables.PublicDevRelease_30_Channel_Id)) - pool: - vmImage: 'windows-2019' - steps: - - task: DownloadBuildArtifacts@0 - displayName: Download Package Artifacts - inputs: - buildType: current - artifactName: PackageArtifacts - - - task: DownloadBuildArtifacts@0 - displayName: Download Blob Artifacts - inputs: - buildType: current - artifactName: BlobArtifacts - - - task: DownloadBuildArtifacts@0 - displayName: Download Asset Manifests - inputs: - buildType: current - artifactName: AssetManifests - - - task: PowerShell@2 - displayName: Add Assets Location - env: - AZURE_DEVOPS_EXT_PAT: $(dn-bot-dnceng-unviersal-packages-rw) - inputs: - filePath: eng\common\sdk-task.ps1 - arguments: -task PublishArtifactsInManifest -restore -msbuildEngine dotnet - /p:ChannelId=$(PublicDevRelease_30_Channel_Id) - /p:ArtifactsCategory=$(_DotNetArtifactsCategory) - /p:IsStableBuild=$(IsStableBuild) - /p:IsInternalBuild=$(IsInternalBuild) - /p:RepositoryName=$(Build.Repository.Name) - /p:CommitSha=$(Build.SourceVersion) - /p:NugetPath=$(Agent.BuildDirectory)\Nuget\NuGet.exe - /p:AzdoTargetFeedPAT='$(dn-bot-dnceng-unviersal-packages-rw)' - /p:TargetFeedPAT='$(dn-bot-dnceng-unviersal-packages-rw)' - /p:AzureStorageTargetFeedPAT='$(dotnetfeed-storage-access-key-1)' - /p:BARBuildId=$(BARBuildId) - /p:MaestroApiEndpoint='$(MaestroApiEndPoint)' - /p:BuildAssetRegistryToken='$(MaestroApiAccessToken)' - /p:ManifestsBasePath='$(Build.ArtifactStagingDirectory)/AssetManifests/' - /p:BlobBasePath='$(Build.ArtifactStagingDirectory)/BlobArtifacts/' - /p:PackageBasePath='$(Build.ArtifactStagingDirectory)/PackageArtifacts/' - /p:Configuration=Release - - - task: NuGetCommand@2 - displayName: Publish Packages to AzDO Feed - condition: contains(variables['TargetAzDOFeed'], 'pkgs.visualstudio.com') - inputs: - command: push - vstsFeed: $(AzDoFeedName) - packagesToPush: $(Build.ArtifactStagingDirectory)\PackageArtifacts\*.nupkg - publishVstsFeed: $(AzDoFeedName) - - - task: PowerShell@2 - displayName: Publish Blobs to AzDO Feed - inputs: - filePath: $(Build.SourcesDirectory)/eng/common/post-build/publish-blobs-to-azdo.ps1 - arguments: -FeedName $(AzDoFeedName) - -SourceFolderCollection $(Build.ArtifactStagingDirectory)/BlobArtifacts/ - -PersonalAccessToken $(dn-bot-dnceng-unviersal-packages-rw) - enabled: false - - -- stage: PublishValidation - displayName: Publish Validation - variables: - - template: ../common-variables.yml - jobs: - - template: ../setup-maestro-vars.yml - - - ${{ if eq(parameters.enableSymbolValidation, 'true') }}: - - job: - displayName: Symbol Availability - dependsOn: setupMaestroVars - condition: contains(dependencies.setupMaestroVars.outputs['setReleaseVars.InitialChannels'], format('[{0}]', variables.PublicDevRelease_30_Channel_Id)) - pool: - vmImage: 'windows-2019' - steps: - - task: DownloadBuildArtifacts@0 - displayName: Download Package Artifacts - inputs: - buildType: current - artifactName: PackageArtifacts - - - task: PowerShell@2 - displayName: Check Symbol Availability - inputs: - filePath: $(Build.SourcesDirectory)/eng/common/post-build/symbols-validation.ps1 - arguments: -InputPath $(Build.ArtifactStagingDirectory)/PackageArtifacts/ -ExtractPath $(Agent.BuildDirectory)/Temp/ -DotnetSymbolVersion $(SymbolToolVersion) - - - template: ../darc-gather-drop.yml - parameters: - ChannelId: ${{ variables.PublicDevRelease_30_Channel_Id }} - - - template: ../promote-build.yml - parameters: - ChannelId: ${{ variables.PublicDevRelease_30_Channel_Id }} diff --git a/external/linker/eng/common/templates/post-build/channels/public-release.yml b/external/linker/eng/common/templates/post-build/channels/public-release.yml deleted file mode 100644 index 00108bd3f8..0000000000 --- a/external/linker/eng/common/templates/post-build/channels/public-release.yml +++ /dev/null @@ -1,147 +0,0 @@ -parameters: - enableSymbolValidation: true - -stages: -- stage: PubRel_Publish - dependsOn: validate - variables: - - template: ../common-variables.yml - displayName: Public Release - jobs: - - template: ../setup-maestro-vars.yml - - - job: - displayName: Symbol Publishing - dependsOn: setupMaestroVars - condition: contains(dependencies.setupMaestroVars.outputs['setReleaseVars.InitialChannels'], format('[{0}]', variables.PublicRelease_30_Channel_Id)) - variables: - - group: DotNet-Symbol-Server-Pats - pool: - vmImage: 'windows-2019' - steps: - - task: DownloadBuildArtifacts@0 - displayName: Download Artifacts - inputs: - downloadType: specific files - matchingPattern: "*Artifacts*" - - - task: PowerShell@2 - displayName: Publish - inputs: - filePath: eng\common\sdk-task.ps1 - arguments: -task PublishToSymbolServers -restore -msbuildEngine dotnet - /p:DotNetSymbolServerTokenMsdl=$(microsoft-symbol-server-pat) - /p:DotNetSymbolServerTokenSymWeb=$(symweb-symbol-server-pat) - /p:PDBArtifactsDirectory='$(Build.ArtifactStagingDirectory)/PDBArtifacts/' - /p:BlobBasePath='$(Build.ArtifactStagingDirectory)/BlobArtifacts/' - /p:Configuration=Release - - - job: publish_assets - displayName: Publish Assets - dependsOn: setupMaestroVars - variables: - - group: DotNet-Blob-Feed - - group: AzureDevOps-Artifact-Feeds-Pats - - name: BARBuildId - value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.BARBuildId'] ] - - name: IsStableBuild - value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.IsStableBuild'] ] - condition: contains(dependencies.setupMaestroVars.outputs['setReleaseVars.InitialChannels'], format('[{0}]', variables.PublicRelease_30_Channel_Id)) - pool: - vmImage: 'windows-2019' - steps: - - task: DownloadBuildArtifacts@0 - displayName: Download Package Artifacts - inputs: - buildType: current - artifactName: PackageArtifacts - - - task: DownloadBuildArtifacts@0 - displayName: Download Blob Artifacts - inputs: - buildType: current - artifactName: BlobArtifacts - - - task: DownloadBuildArtifacts@0 - displayName: Download Asset Manifests - inputs: - buildType: current - artifactName: AssetManifests - - - task: PowerShell@2 - displayName: Publish - env: - AZURE_DEVOPS_EXT_PAT: $(dn-bot-dnceng-unviersal-packages-rw) - inputs: - filePath: eng\common\sdk-task.ps1 - arguments: -task PublishArtifactsInManifest -restore -msbuildEngine dotnet - /p:ChannelId=$(PublicRelease_30_Channel_Id) - /p:IsStableBuild=$(IsStableBuild) - /p:IsInternalBuild=$(IsInternalBuild) - /p:RepositoryName=$(Build.Repository.Name) - /p:CommitSha=$(Build.SourceVersion) - /p:AzureStorageAccountName=$(ProxyBackedFeedsAccountName) - /p:AzureStorageAccountKey=$(dotnetfeed-storage-access-key-1) - /p:AzureDevOpsFeedsBaseUrl=$(dotnetfeed-internal-private-feed-url) - /p:StaticInternalFeed=$(dotnetfeed-internal-nonstable-feed-url) - /p:NugetPath=$(Agent.BuildDirectory)\Nuget\NuGet.exe - /p:BARBuildId=$(BARBuildId) - /p:MaestroApiEndpoint='$(MaestroApiEndPoint)' - /p:BuildAssetRegistryToken='$(MaestroApiAccessToken)' - /p:ManifestsBasePath='$(Build.ArtifactStagingDirectory)/AssetManifests/' - /p:BlobBasePath='$(Build.ArtifactStagingDirectory)\BlobArtifacts' - /p:PackageBasePath='$(Build.ArtifactStagingDirectory)\PackageArtifacts' - /p:Configuration=Release - - - task: NuGetCommand@2 - displayName: Publish Packages to AzDO Feed - condition: contains(variables['TargetAzDOFeed'], 'pkgs.visualstudio.com') - inputs: - command: push - vstsFeed: $(AzDoFeedName) - packagesToPush: $(Build.ArtifactStagingDirectory)\PackageArtifacts\*.nupkg - publishVstsFeed: $(AzDoFeedName) - - - task: PowerShell@2 - displayName: Publish Blobs to AzDO Feed - inputs: - filePath: $(Build.SourcesDirectory)/eng/common/post-build/publish-blobs-to-azdo.ps1 - arguments: -FeedName $(AzDoFeedName) - -SourceFolderCollection $(Build.ArtifactStagingDirectory)/BlobArtifacts/ - -PersonalAccessToken $(dn-bot-dnceng-unviersal-packages-rw) - enabled: false - - - template: ../trigger-subscription.yml - parameters: - ChannelId: ${{ variables.PublicRelease_30_Channel_Id }} - -- stage: PubRel_PublishValidation - displayName: Publish Validation - variables: - - template: ../common-variables.yml - jobs: - - template: ../setup-maestro-vars.yml - - - ${{ if eq(parameters.enableSymbolValidation, 'true') }}: - - job: - displayName: Symbol Availability - dependsOn: setupMaestroVars - condition: contains(dependencies.setupMaestroVars.outputs['setReleaseVars.InitialChannels'], format('[{0}]', variables.PublicRelease_30_Channel_Id)) - pool: - vmImage: 'windows-2019' - steps: - - task: DownloadBuildArtifacts@0 - displayName: Download Package Artifacts - inputs: - buildType: current - artifactName: PackageArtifacts - - - task: PowerShell@2 - displayName: Check Symbol Availability - inputs: - filePath: $(Build.SourcesDirectory)/eng/common/post-build/symbols-validation.ps1 - arguments: -InputPath $(Build.ArtifactStagingDirectory)/PackageArtifacts/ -ExtractPath $(Agent.BuildDirectory)/Temp/ -DotnetSymbolVersion $(SymbolToolVersion) - - - template: ../promote-build.yml - parameters: - ChannelId: ${{ variables.PublicRelease_30_Channel_Id }} diff --git a/external/linker/eng/common/templates/post-build/channels/public-validation-release.yml b/external/linker/eng/common/templates/post-build/channels/public-validation-release.yml index f64184da9f..5c8e91cce1 100644 --- a/external/linker/eng/common/templates/post-build/channels/public-validation-release.yml +++ b/external/linker/eng/common/templates/post-build/channels/public-validation-release.yml @@ -1,13 +1,19 @@ +parameters: + artifactsPublishingAdditionalParameters: '' + dependsOn: + - Validate + publishInstallersAndChecksums: false + stages: - stage: PVR_Publish - dependsOn: validate + dependsOn: ${{ parameters.dependsOn }} variables: - template: ../common-variables.yml - displayName: Validation Channel + displayName: .NET Tools - Validation Publishing jobs: - template: ../setup-maestro-vars.yml - - job: + - job: publish_assets displayName: Publish Assets dependsOn: setupMaestroVars variables: @@ -39,61 +45,53 @@ stages: buildType: current artifactName: AssetManifests + - task: NuGetToolInstaller@1 + displayName: 'Install NuGet.exe' + + # This is necessary whenever we want to publish/restore to an AzDO private feed + - task: NuGetAuthenticate@0 + displayName: 'Authenticate to AzDO Feeds' + - task: PowerShell@2 - displayName: Add Assets Location - env: - AZURE_DEVOPS_EXT_PAT: $(dn-bot-dnceng-unviersal-packages-rw) + displayName: Enable cross-org publishing + inputs: + filePath: eng\common\enable-cross-org-publishing.ps1 + arguments: -token $(dn-bot-dnceng-artifact-feeds-rw) + + - task: PowerShell@2 + displayName: Publish Assets inputs: filePath: eng\common\sdk-task.ps1 - arguments: -task PublishArtifactsInManifest -restore -msbuildEngine dotnet - /p:ChannelId=$(PublicValidationRelease_30_Channel_Id) + arguments: -task PublishArtifactsInManifest -restore -msbuildEngine dotnet /p:ArtifactsCategory=$(_DotNetValidationArtifactsCategory) /p:IsStableBuild=$(IsStableBuild) /p:IsInternalBuild=$(IsInternalBuild) /p:RepositoryName=$(Build.Repository.Name) /p:CommitSha=$(Build.SourceVersion) - /p:NugetPath=$(Agent.BuildDirectory)\Nuget\NuGet.exe - /p:AzdoTargetFeedPAT='$(dn-bot-dnceng-unviersal-packages-rw)' - /p:TargetFeedPAT='$(dn-bot-dnceng-unviersal-packages-rw)' - /p:AzureStorageTargetFeedPAT='$(dotnetfeed-storage-access-key-1)' - /p:BARBuildId=$(BARBuildId) - /p:MaestroApiEndpoint='$(MaestroApiEndPoint)' - /p:BuildAssetRegistryToken='$(MaestroApiAccessToken)' - /p:ManifestsBasePath='$(Build.ArtifactStagingDirectory)/AssetManifests/' - /p:BlobBasePath='$(Build.ArtifactStagingDirectory)\BlobArtifacts' - /p:PackageBasePath='$(Build.ArtifactStagingDirectory)\PackageArtifacts' - /p:Configuration=Release + /p:NugetPath=$(NuGetExeToolPath) + /p:AzdoTargetFeedPAT='$(dn-bot-dnceng-universal-packages-rw)' + /p:AzureStorageTargetFeedPAT='$(dotnetfeed-storage-access-key-1)' + /p:BARBuildId=$(BARBuildId) + /p:MaestroApiEndpoint='$(MaestroApiEndPoint)' + /p:BuildAssetRegistryToken='$(MaestroApiAccessToken)' + /p:ManifestsBasePath='$(Build.ArtifactStagingDirectory)/AssetManifests/' + /p:BlobBasePath='$(Build.ArtifactStagingDirectory)/BlobArtifacts/' + /p:PackageBasePath='$(Build.ArtifactStagingDirectory)/PackageArtifacts/' + /p:Configuration=Release + /p:PublishInstallersAndChecksums=${{ parameters.publishInstallersAndChecksums }} + /p:InstallersTargetStaticFeed=$(InstallersBlobFeedUrl) + /p:InstallersAzureAccountKey=$(dotnetcli-storage-key) + /p:ChecksumsTargetStaticFeed=$(ChecksumsBlobFeedUrl) + /p:ChecksumsAzureAccountKey=$(dotnetclichecksums-storage-key) + /p:PublishToAzureDevOpsNuGetFeeds=true + /p:AzureDevOpsStaticShippingFeed='https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json' + /p:AzureDevOpsStaticShippingFeedKey='$(dn-bot-dnceng-artifact-feeds-rw)' + /p:AzureDevOpsStaticTransportFeed='https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json' + /p:AzureDevOpsStaticTransportFeedKey='$(dn-bot-dnceng-artifact-feeds-rw)' + /p:AzureDevOpsStaticSymbolsFeed='https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools-symbols/nuget/v3/index.json' + /p:AzureDevOpsStaticSymbolsFeedKey='$(dn-bot-dnceng-artifact-feeds-rw)' + ${{ parameters.artifactsPublishingAdditionalParameters }} - - task: NuGetCommand@2 - displayName: Publish Packages to AzDO Feed - condition: contains(variables['TargetAzDOFeed'], 'pkgs.visualstudio.com') - inputs: - command: push - vstsFeed: $(AzDoFeedName) - packagesToPush: $(Build.ArtifactStagingDirectory)\PackageArtifacts\*.nupkg - publishVstsFeed: $(AzDoFeedName) - - - task: PowerShell@2 - displayName: Publish Blobs to AzDO Feed - inputs: - filePath: $(Build.SourcesDirectory)/eng/common/post-build/publish-blobs-to-azdo.ps1 - arguments: -FeedName $(AzDoFeedName) - -SourceFolderCollection $(Build.ArtifactStagingDirectory)/BlobArtifacts/ - -PersonalAccessToken $(dn-bot-dnceng-unviersal-packages-rw) - enabled: false - - -- stage: PVR_PublishValidation - displayName: Publish Validation - variables: - - template: ../common-variables.yml - jobs: - - template: ../setup-maestro-vars.yml - - - template: ../darc-gather-drop.yml - parameters: - ChannelId: ${{ variables.PublicValidationRelease_30_Channel_Id }} - - - template: ../promote-build.yml - parameters: - ChannelId: ${{ variables.PublicValidationRelease_30_Channel_Id }} + - template: ../../steps/promote-build.yml + parameters: + ChannelId: ${{ variables.PublicValidationRelease_30_Channel_Id }} diff --git a/external/linker/eng/common/templates/post-build/common-variables.yml b/external/linker/eng/common/templates/post-build/common-variables.yml index 52a74487fd..9ccc08b2c8 100644 --- a/external/linker/eng/common/templates/post-build/common-variables.yml +++ b/external/linker/eng/common/templates/post-build/common-variables.yml @@ -1,9 +1,11 @@ variables: - group: Publish-Build-Assets + - group: DotNet-DotNetCli-Storage + - group: DotNet-MSRC-Storage - # .NET Core 3 Dev - - name: PublicDevRelease_30_Channel_Id - value: 3 + # .NET Core 3.1 Dev + - name: PublicDevRelease_31_Channel_Id + value: 128 # .NET Core 5 Dev - name: NetCore_5_Dev_Channel_Id @@ -25,14 +27,14 @@ variables: - name: PublicRelease_30_Channel_Id value: 19 + # .NET Core 3.1 Release + - name: PublicRelease_31_Channel_Id + value: 129 + # Whether the build is internal or not - name: IsInternalBuild value: ${{ and(ne(variables['System.TeamProject'], 'public'), contains(variables['Build.SourceBranch'], 'internal')) }} - # Storage account name for proxy-backed feeds - - name: ProxyBackedFeedsAccountName - value: dotnetfeed - # Default Maestro++ API Endpoint and API Version - name: MaestroApiEndPoint value: "https://maestro-prod.westus2.cloudapp.azure.com" @@ -45,3 +47,24 @@ variables: value: 3.0.0 - name: SymbolToolVersion value: 1.0.1 + + # Feed Configurations + # These should include the suffix "/index.json" + + # Default locations for Installers and checksums + # Public Locations + - name: ChecksumsBlobFeedUrl + value: https://dotnetclichecksums.blob.core.windows.net/dotnet/index.json + - name: InstallersBlobFeedUrl + value: https://dotnetcli.blob.core.windows.net/dotnet/index.json + + # Private Locations + - name: InternalChecksumsBlobFeedUrl + value: https://dotnetclichecksumsmsrc.blob.core.windows.net/dotnet/index.json + - name: InternalChecksumsBlobFeedKey + value: $(dotnetclichecksumsmsrc-storage-key) + + - name: InternalInstallersBlobFeedUrl + value: https://dotnetclimsrc.blob.core.windows.net/dotnet/index.json + - name: InternalInstallersBlobFeedKey + value: $(dotnetclimsrc-access-key) diff --git a/external/linker/eng/common/templates/post-build/post-build.yml b/external/linker/eng/common/templates/post-build/post-build.yml index aba0b0fcaf..3f06b5d146 100644 --- a/external/linker/eng/common/templates/post-build/post-build.yml +++ b/external/linker/eng/common/templates/post-build/post-build.yml @@ -1,18 +1,29 @@ parameters: - enableSourceLinkValidation: true + enableSourceLinkValidation: false enableSigningValidation: true - enableSymbolValidation: true + enableSymbolValidation: false enableNugetValidation: true + publishInstallersAndChecksums: false SDLValidationParameters: enable: false + continueOnError: false params: '' + # These parameters let the user customize the call to sdk-task.ps1 for publishing + # symbols & general artifacts as well as for signing validation + symbolPublishingAdditionalParameters: '' + artifactsPublishingAdditionalParameters: '' + signingValidationAdditionalParameters: '' + # Which stages should finish execution before post-build stages start - dependsOn: [build] + validateDependsOn: + - build + publishDependsOn: + - Validate stages: -- stage: validate - dependsOn: ${{ parameters.dependsOn }} +- stage: Validate + dependsOn: ${{ parameters.validateDependsOn }} displayName: Validate jobs: - ${{ if eq(parameters.enableNugetValidation, 'true') }}: @@ -37,6 +48,9 @@ stages: - ${{ if eq(parameters.enableSigningValidation, 'true') }}: - job: displayName: Signing Validation + variables: + - template: common-variables.yml + - group: AzureDevOps-Artifact-Feeds-Pats pool: vmImage: 'windows-2019' steps: @@ -46,6 +60,19 @@ stages: buildType: current artifactName: PackageArtifacts + # This is necessary whenever we want to publish/restore to an AzDO private feed + # Since sdk-task.ps1 tries to restore packages we need to do this authentication here + # otherwise it'll complain about accessing a private feed. + - task: NuGetAuthenticate@0 + condition: eq(variables['IsInternalBuild'], 'true') + displayName: 'Authenticate to AzDO Feeds' + + - task: PowerShell@2 + displayName: Enable cross-org publishing + inputs: + filePath: eng\common\enable-cross-org-publishing.ps1 + arguments: -token $(dn-bot-dnceng-artifact-feeds-rw) + - task: PowerShell@2 displayName: Validate inputs: @@ -53,7 +80,8 @@ stages: arguments: -task SigningValidation -restore -msbuildEngine dotnet /p:PackageBasePath='$(Build.ArtifactStagingDirectory)/PackageArtifacts' /p:SignCheckExclusionsFile='$(Build.SourcesDirectory)/eng/SignCheckExclusionsFile.txt' - /p:Configuration=Release + /p:Configuration=Release + ${{ parameters.signingValidationAdditionalParameters }} - ${{ if eq(parameters.enableSourceLinkValidation, 'true') }}: - job: @@ -78,26 +106,57 @@ stages: -GHRepoName $(Build.Repository.Name) -GHCommit $(Build.SourceVersion) -SourcelinkCliVersion $(SourceLinkCLIVersion) + continueOnError: true - ${{ if eq(parameters.SDLValidationParameters.enable, 'true') }}: - template: /eng/common/templates/job/execute-sdl.yml parameters: additionalParameters: ${{ parameters.SDLValidationParameters.params }} + continueOnError: ${{ parameters.SDLValidationParameters.continueOnError }} - template: \eng\common\templates\post-build\channels\netcore-dev-5.yml parameters: - enableSymbolValidation: ${{ parameters.enableSymbolValidation }} + artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }} + dependsOn: ${{ parameters.publishDependsOn }} + publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }} + symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }} -- template: \eng\common\templates\post-build\channels\public-dev-release.yml +- template: \eng\common\templates\post-build\channels\netcore-dev-31.yml parameters: - enableSymbolValidation: ${{ parameters.enableSymbolValidation }} + artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }} + dependsOn: ${{ parameters.publishDependsOn }} + publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }} + symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }} - template: \eng\common\templates\post-build\channels\netcore-tools-latest.yml parameters: - enableSymbolValidation: ${{ parameters.enableSymbolValidation }} + artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }} + dependsOn: ${{ parameters.publishDependsOn }} + publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }} + symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }} - template: \eng\common\templates\post-build\channels\public-validation-release.yml + parameters: + artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }} + dependsOn: ${{ parameters.publishDependsOn }} + publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }} -- template: \eng\common\templates\post-build\channels\public-release.yml +- template: \eng\common\templates\post-build\channels\netcore-release-30.yml + parameters: + artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }} + dependsOn: ${{ parameters.publishDependsOn }} + publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }} + symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }} -- template: \eng\common\templates\post-build\channels\internal-servicing.yml +- template: \eng\common\templates\post-build\channels\netcore-release-31.yml + parameters: + artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }} + dependsOn: ${{ parameters.publishDependsOn }} + publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }} + symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }} + +- template: \eng\common\templates\post-build\channels\netcore-internal-30.yml + parameters: + artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }} + dependsOn: ${{ parameters.publishDependsOn }} + symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }} diff --git a/external/linker/eng/common/templates/steps/promote-build.yml b/external/linker/eng/common/templates/steps/promote-build.yml new file mode 100644 index 0000000000..b90404435d --- /dev/null +++ b/external/linker/eng/common/templates/steps/promote-build.yml @@ -0,0 +1,13 @@ +parameters: + ChannelId: 0 + +steps: +- task: PowerShell@2 + displayName: Add Build to Channel + inputs: + filePath: $(Build.SourcesDirectory)/eng/common/post-build/promote-build.ps1 + arguments: -BuildId $(BARBuildId) + -ChannelId ${{ parameters.ChannelId }} + -MaestroApiAccessToken $(MaestroApiAccessToken) + -MaestroApiEndPoint $(MaestroApiEndPoint) + -MaestroApiVersion $(MaestroApiVersion) diff --git a/external/linker/eng/common/tools.ps1 b/external/linker/eng/common/tools.ps1 index 9c12b1b4fd..5c94bd78d6 100644 --- a/external/linker/eng/common/tools.ps1 +++ b/external/linker/eng/common/tools.ps1 @@ -153,6 +153,7 @@ function InitializeDotNetCli([bool]$install) { # Make Sure that our bootstrapped dotnet cli is available in future steps of the Azure Pipelines build Write-PipelinePrependPath -Path $dotnetRoot + Write-PipelineSetVariable -Name 'DOTNET_MULTILEVEL_LOOKUP' -Value '0' Write-PipelineSetVariable -Name 'DOTNET_SKIP_FIRST_TIME_EXPERIENCE' -Value '1' @@ -163,6 +164,7 @@ function GetDotNetInstallScript([string] $dotnetRoot) { $installScript = Join-Path $dotnetRoot "dotnet-install.ps1" if (!(Test-Path $installScript)) { Create-Directory $dotnetRoot + $ProgressPreference = 'SilentlyContinue' # Don't display the console progress UI - it's a huge perf hit Invoke-WebRequest "https://dot.net/$dotnetInstallScriptVersion/dotnet-install.ps1" -OutFile $installScript } @@ -282,6 +284,7 @@ function InitializeXCopyMSBuild([string]$packageVersion, [bool]$install) { Create-Directory $packageDir Write-Host "Downloading $packageName $packageVersion" + $ProgressPreference = 'SilentlyContinue' # Don't display the console progress UI - it's a huge perf hit Invoke-WebRequest "https://dotnet.myget.org/F/roslyn-tools/api/v2/package/$packageName/$packageVersion/" -OutFile $packagePath Unzip $packagePath $packageDir } @@ -363,7 +366,6 @@ function InitializeBuildTool() { Write-PipelineTelemetryError -Category "InitializeToolset" -Message "/global.json must specify 'tools.dotnet'." ExitWithExitCode 1 } - $buildTool = @{ Path = Join-Path $dotnetRoot "dotnet.exe"; Command = "msbuild"; Tool = "dotnet"; Framework = "netcoreapp2.1" } } elseif ($msbuildEngine -eq "vs") { try { @@ -488,6 +490,18 @@ function Stop-Processes() { function MSBuild() { if ($pipelinesLog) { $buildTool = InitializeBuildTool + + # Work around issues with Azure Artifacts credential provider + # https://github.com/dotnet/arcade/issues/3932 + if ($ci -and $buildTool.Tool -eq "dotnet") { + dotnet nuget locals http-cache -c + + $env:NUGET_PLUGIN_HANDSHAKE_TIMEOUT_IN_SECONDS = 20 + $env:NUGET_PLUGIN_REQUEST_TIMEOUT_IN_SECONDS = 20 + Write-PipelineSetVariable -Name 'NUGET_PLUGIN_HANDSHAKE_TIMEOUT_IN_SECONDS' -Value '20' + Write-PipelineSetVariable -Name 'NUGET_PLUGIN_REQUEST_TIMEOUT_IN_SECONDS' -Value '20' + } + $toolsetBuildProject = InitializeToolset $path = Split-Path -parent $toolsetBuildProject $path = Join-Path $path (Join-Path $buildTool.Framework "Microsoft.DotNet.Arcade.Sdk.dll") diff --git a/external/linker/eng/common/tools.sh b/external/linker/eng/common/tools.sh index 3af9be6157..895ad2442b 100755 --- a/external/linker/eng/common/tools.sh +++ b/external/linker/eng/common/tools.sh @@ -208,12 +208,19 @@ function GetDotNetInstallScript { # Use curl if available, otherwise use wget if command -v curl > /dev/null; then - curl "$install_script_url" -sSL --retry 10 --create-dirs -o "$install_script" - else - wget -q -O "$install_script" "$install_script_url" + curl "$install_script_url" -sSL --retry 10 --create-dirs -o "$install_script" || { + local exit_code=$? + Write-PipelineTelemetryError -category 'InitializeToolset' "Failed to acquire dotnet install script (exit code '$exit_code')." + ExitWithExitCode $exit_code + } + else + wget -q -O "$install_script" "$install_script_url" || { + local exit_code=$? + Write-PipelineTelemetryError -category 'InitializeToolset' "Failed to acquire dotnet install script (exit code '$exit_code')." + ExitWithExitCode $exit_code + } fi fi - # return value _GetDotNetInstallScript="$install_script" } @@ -321,6 +328,18 @@ function MSBuild { if [[ "$pipelines_log" == true ]]; then InitializeBuildTool InitializeToolset + + # Work around issues with Azure Artifacts credential provider + # https://github.com/dotnet/arcade/issues/3932 + if [[ "$ci" == true ]]; then + "$_InitializeBuildTool" nuget locals http-cache -c + + export NUGET_PLUGIN_HANDSHAKE_TIMEOUT_IN_SECONDS=20 + export NUGET_PLUGIN_REQUEST_TIMEOUT_IN_SECONDS=20 + Write-PipelineSetVariable -name "NUGET_PLUGIN_HANDSHAKE_TIMEOUT_IN_SECONDS" -value "20" + Write-PipelineSetVariable -name "NUGET_PLUGIN_REQUEST_TIMEOUT_IN_SECONDS" -value "20" + fi + local toolset_dir="${_InitializeToolset%/*}" local logger_path="$toolset_dir/$_InitializeBuildToolFramework/Microsoft.DotNet.Arcade.Sdk.dll" args=( "${args[@]}" "-logger:$logger_path" ) diff --git a/external/linker/global.json b/external/linker/global.json index 9f17c512e6..525af34e59 100644 --- a/external/linker/global.json +++ b/external/linker/global.json @@ -1,9 +1,9 @@ { "tools": { - "dotnet": "3.0.100-preview6-012264" + "dotnet": "3.0.100" }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.19412.1", + "Microsoft.DotNet.Arcade.Sdk": "5.0.0-beta.19502.11", "Microsoft.NET.Sdk.IL": "3.0.0-preview4-27520-71" } } diff --git a/external/linker/src/ILLink.Tasks/LinkTask.cs b/external/linker/src/ILLink.Tasks/LinkTask.cs index 608ddd0a3a..6c9b15a65a 100644 --- a/external/linker/src/ILLink.Tasks/LinkTask.cs +++ b/external/linker/src/ILLink.Tasks/LinkTask.cs @@ -95,6 +95,8 @@ namespace ILLink.Tasks /// ToolTask implementation + + protected override MessageImportance StandardErrorLoggingImportance => MessageImportance.High; protected override string ToolName => Path.GetFileName (DotNetPath); diff --git a/external/linker/src/linker/Linker.Steps/MarkStep.cs b/external/linker/src/linker/Linker.Steps/MarkStep.cs index 4d45c2737c..1b1354afeb 100644 --- a/external/linker/src/linker/Linker.Steps/MarkStep.cs +++ b/external/linker/src/linker/Linker.Steps/MarkStep.cs @@ -243,7 +243,11 @@ namespace Mono.Linker.Steps { { // We may mark an interface type later on. Which means we need to reprocess any time with one or more interface implementations that have not been marked // and if an interface type is found to be marked and implementation is not marked, then we need to mark that implementation - foreach (var type in _typesWithInterfaces) { + + // copy the data to avoid modified while enumerating error potential, which can happen under certain conditions. + var typesWithInterfaces = _typesWithInterfaces.ToArray (); + + foreach (var type in typesWithInterfaces) { // Exception, types that have not been flagged as instantiated yet. These types may not need their interfaces even if the // interface type is marked if (!Annotations.IsInstantiated (type)) @@ -356,6 +360,11 @@ namespace Mono.Linker.Steps { if (IsUserDependencyMarker (ca.AttributeType) && provider is MemberReference mr) { MarkUserDependency (mr, ca); + if (_context.KeepDependencyAttributes) { + MarkCustomAttribute (ca); + continue; + } + if (Annotations.GetAction (mr.DeclaringType.Module.Assembly) == AssemblyAction.Link) continue; } @@ -679,7 +688,7 @@ namespace Mono.Linker.Steps { if (property != null) MarkMethod (property.SetMethod); - MarkIfType (namedArgument.Argument); + MarkCustomAttributeArgument (namedArgument.Argument); Tracer.Pop (); } @@ -711,7 +720,7 @@ namespace Mono.Linker.Steps { if (field != null) MarkField (field); - MarkIfType (namedArgument.Argument); + MarkCustomAttributeArgument (namedArgument.Argument); } FieldDefinition GetField (TypeDefinition type, string fieldname) @@ -746,55 +755,40 @@ namespace Mono.Linker.Steps { return; foreach (var argument in ca.ConstructorArguments) - MarkIfType (argument); + MarkCustomAttributeArgument (argument); } - void MarkIfType (CustomAttributeArgument argument) + void MarkCustomAttributeArgument (CustomAttributeArgument argument) { var at = argument.Type; + if (at.IsArray) { var et = at.GetElementType (); - if (et.Namespace != "System" || et.Name != "Type") - return; MarkType (et); if (argument.Value == null) return; - foreach (var cac in (CustomAttributeArgument[]) argument.Value) - MarkWithResolvedScope ((TypeReference) cac.Value); - } else if (at.Namespace == "System" && at.Name == "Type") { - MarkType (argument.Type); - MarkWithResolvedScope ((TypeReference) argument.Value); - } - } + foreach (var caa in (CustomAttributeArgument [])argument.Value) + MarkCustomAttributeArgument (caa); - // custom attributes encoding means it's possible to have a scope that will point into a PCL facade - // even if we (just before saving) will resolve all type references (bug #26752) - void MarkWithResolvedScope (TypeReference type) - { - if (type == null) - return; - - // a GenericInstanceType can could contains generic arguments with scope that - // needs to be updated out of the PCL facade (bug #28823) - var git = (type as GenericInstanceType); - if ((git != null) && git.HasGenericArguments) { - foreach (var ga in git.GenericArguments) - MarkWithResolvedScope (ga); - } - // we cannot set the Scope of a TypeSpecification but it's element type can be set - // e.g. System.String[] -> System.String - var ts = (type as TypeSpecification); - if (ts != null) { - MarkWithResolvedScope (ts.ElementType); return; } - var td = type.Resolve (); - if (td != null) - type.Scope = td.Scope; - MarkType (type); + if (at.Namespace == "System") { + switch (at.Name) { + case "Type": + MarkType (argument.Type); + MarkType ((TypeReference)argument.Value); + return; + + case "Object": + var boxed_value = (CustomAttributeArgument)argument.Value; + MarkType (boxed_value.Type); + MarkCustomAttributeArgument (boxed_value); + return; + } + } } protected bool CheckProcessed (IMetadataTokenProvider provider) @@ -1151,19 +1145,24 @@ namespace Mono.Linker.Steps { return; foreach (CustomAttribute attribute in type.CustomAttributes) { - switch (attribute.Constructor.DeclaringType.FullName) { - case "System.Xml.Serialization.XmlSchemaProviderAttribute": + var attrType = attribute.Constructor.DeclaringType; + switch (attrType.Name) { + case "XmlSchemaProviderAttribute" when attrType.Namespace == "System.Xml.Serialization": MarkXmlSchemaProvider (type, attribute); break; - case "System.Diagnostics.DebuggerDisplayAttribute": + case "DebuggerDisplayAttribute" when attrType.Namespace == "System.Diagnostics": MarkTypeWithDebuggerDisplayAttribute (type, attribute); break; - case "System.Diagnostics.DebuggerTypeProxyAttribute": + case "DebuggerTypeProxyAttribute" when attrType.Namespace == "System.Diagnostics": MarkTypeWithDebuggerTypeProxyAttribute (type, attribute); break; - case "System.Diagnostics.Tracing.EventDataAttribute": + case "EventDataAttribute" when attrType.Namespace == "System.Diagnostics.Tracing": MarkMethodsIf (type.Methods, IsPublicInstancePropertyMethod); break; + case "TypeConverterAttribute" when attrType.Namespace == "System.ComponentModel": + // The attribute can be applied anywhere but in reality it's always associated with type + MarkTypeConverterDependency (attribute); + break; } } } @@ -1191,6 +1190,30 @@ namespace Mono.Linker.Steps { MarkNamedMethod (type, method_name); } + void MarkTypeConverterDependency (CustomAttribute attribute) + { + var args = attribute.ConstructorArguments; + if (args.Count < 1) + return; + + TypeDefinition tdef = null; + switch (attribute.ConstructorArguments [0].Value) { + case string s: + tdef = ResolveFullyQualifiedTypeName (s); + break; + case TypeReference type: + tdef = type.Resolve (); + break; + } + + if (tdef == null) + return; + + MarkMethodsIf (tdef.Methods, l => + l.IsDefaultConstructor () || + l.Parameters.Count == 1 && l.Parameters [0].ParameterType.IsTypeOf ("System", "Type")); + } + void MarkTypeWithDebuggerDisplayAttribute (TypeDefinition type, CustomAttribute attribute) { if (_context.KeepMembersForDebugger) { @@ -1370,8 +1393,13 @@ namespace Mono.Linker.Steps { void MarkGenericParameter (GenericParameter parameter) { MarkCustomAttributes (parameter); - foreach (var constraint in parameter.Constraints) + if (!parameter.HasConstraints) + return; + + foreach (var constraint in parameter.Constraints) { + MarkCustomAttributes (constraint); MarkType (constraint.ConstraintType); + } } bool IsVirtualNeededByTypeDueToPreservedScope (MethodDefinition method) @@ -1545,6 +1573,25 @@ namespace Mono.Linker.Steps { return td; } + TypeDefinition ResolveFullyQualifiedTypeName (string name) + { + if (!TypeNameParser.TryParseTypeAssemblyQualifiedName (name, out string typeName, out string assemblyName)) + return null; + + foreach (var assemblyDefinition in _context.GetAssemblies ()) { + if (assemblyName != null && assemblyDefinition.Name.Name != assemblyName) + continue; + + var foundType = assemblyDefinition.MainModule.GetType (typeName); + if (foundType == null) + continue; + + return foundType; + } + + return null; + } + protected TypeReference GetOriginalType (TypeReference type) { while (type is TypeSpecification) { @@ -1826,7 +1873,10 @@ namespace Mono.Linker.Steps { if (ShouldMarkAsInstancePossible (method)) MarkRequirementsForInstantiatedTypes (method.DeclaringType); - if (IsPropertyMethod (method)) + if (method.IsConstructor) { + if (!Annotations.ProcessSatelliteAssemblies && KnownMembers.IsSatelliteAssemblyMarker (method)) + Annotations.ProcessSatelliteAssemblies = true; + } else if (IsPropertyMethod (method)) MarkProperty (GetProperty (method)); else if (IsEventMethod (method)) MarkEvent (GetEvent (method)); @@ -2269,14 +2319,11 @@ namespace Mono.Linker.Steps { int first_arg_instr, second_arg_instr; Instruction first_arg; - string name = default; // // System.Type // if (methodCalledType.Name == "Type" && methodCalledType.Namespace == "System") { - System.Reflection.MemberTypes memberTypes = default; - BindingFlags bindingFlags = default; switch (methodCalled.Name) { // @@ -2285,106 +2332,63 @@ namespace Mono.Linker.Steps { // GetConstructor (BindingFlags, Binder, CallingConventions, Type [], ParameterModifier []) // case "GetConstructor": - memberTypes = System.Reflection.MemberTypes.Constructor; - goto case "Get_?_Instance"; + if (!methodCalledDefinition.IsStatic) + ProcessSystemTypeGetMemberLikeCall (System.Reflection.MemberTypes.Constructor, methodCalledDefinition, i - 1); + + break; // // GetMethod (String) // GetMethod (String, BindingFlags) - // GetMethod (String, Type []) - // GetMethod (String, Type [], ParameterModifier []) - // GetMethod (String, BindingFlags, Binder, Type [], ParameterModifier []) - // GetMethod (String, BindingFlags, Binder, CallingConventions, Type [], ParameterModifier []) + // GetMethod (String, Type[]) + // GetMethod (String, Type[], ParameterModifier[]) + // GetMethod (String, BindingFlags, Binder, Type[], ParameterModifier[]) + // GetMethod (String, BindingFlags, Binder, CallingConventions, Type[], ParameterModifier[]) // // TODO: .NET Core extensions // GetMethod (String, int, Type[]) // GetMethod (String, int, Type[], ParameterModifier[]?) // GetMethod (String, int, BindingFlags, Binder?, Type[], ParameterModifier[]?) // GetMethod (String, int, BindingFlags, Binder?, CallingConventions, Type[], ParameterModifier[]?) + // + case "GetMethod": + if (!methodCalledDefinition.IsStatic) + ProcessSystemTypeGetMemberLikeCall (System.Reflection.MemberTypes.Method, methodCalledDefinition, i - 1); + + break; + // // GetField (String) // GetField (String, BindingFlags) + // + case "GetField": + if (!methodCalledDefinition.IsStatic) + ProcessSystemTypeGetMemberLikeCall (System.Reflection.MemberTypes.Field, methodCalledDefinition, i - 1); + + break; + // // GetEvent (String) // GetEvent (String, BindingFlags) + // + case "GetEvent": + if (!methodCalledDefinition.IsStatic) + ProcessSystemTypeGetMemberLikeCall (System.Reflection.MemberTypes.Event, methodCalledDefinition, i - 1); + + break; + // // GetProperty (String) // GetProperty (String, BindingFlags) // GetProperty (String, Type) - // GetProperty (String, Type []) - // GetProperty (String, Type, Type []) - // GetProperty (String, Type, Type [], ParameterModifier []) - // GetProperty (String, BindingFlags, Binder, Type, Type [], ParameterModifier []) + // GetProperty (String, Type[]) + // GetProperty (String, Type, Type[]) + // GetProperty (String, Type, Type[], ParameterModifier[]) + // GetProperty (String, BindingFlags, Binder, Type, Type[], ParameterModifier[]) // - case "GetMethod": - memberTypes = System.Reflection.MemberTypes.Method; - goto case "Get_?_Instance"; - case "GetField": - memberTypes = System.Reflection.MemberTypes.Field; - goto case "Get_?_Instance"; - case "GetEvent": - memberTypes = System.Reflection.MemberTypes.Event; - goto case "Get_?_Instance"; case "GetProperty": - memberTypes = System.Reflection.MemberTypes.Property; - goto case "Get_?_Instance"; - - case "Get_?_Instance": - if (methodCalledDefinition.IsStatic) - continue; - - first_arg_instr = GetInstructionAtStackDepth (instructions, i - 1, methodCalledDefinition.Parameters.Count); - if (first_arg_instr < 0) { - _context.LogMessage (MessageImportance.Low, $"Reflection call '{methodCalled.FullName}' couldn't be decomposed"); - continue; - } - - first_arg = instructions [first_arg_instr]; - - if (memberTypes == System.Reflection.MemberTypes.Constructor) { - if (first_arg.OpCode == OpCodes.Ldc_I4_S && methodCalled.Parameters.Count > 0 && methodCalled.Parameters [0].ParameterType.Name == "BindingFlags") { - bindingFlags = (BindingFlags)(sbyte)first_arg.Operand; - } - } else { - // - // The next value must be string constant (we don't handle anything else) - // - if (first_arg.OpCode != OpCodes.Ldstr) { - _context.LogMessage (MessageImportance.Low, $"Reflection call '{methodCalled.FullName}' was detected with argument which cannot be analyzed"); - continue; - } - - name = (string)first_arg.Operand; - - var pos_arg = instructions [first_arg_instr + 1]; - if (pos_arg.OpCode == OpCodes.Ldc_I4_S && methodCalled.Parameters.Count > 1 && methodCalled.Parameters [1].ParameterType.Name == "BindingFlags") { - bindingFlags = (BindingFlags)(sbyte)pos_arg.Operand; - } - } - - var declaringType = FindReflectionTypeForLookup (instructions, first_arg_instr - 1); - if (declaringType == null) { - _context.LogMessage (MessageImportance.Low, $"Reflection call '{methodCalled.FullName}' does not use detectable instance type extraction"); - continue; - } - - switch (memberTypes) { - case System.Reflection.MemberTypes.Constructor: - MarkMethodsFromReflectionCall (declaringType, ".ctor", 0, bindingFlags); - break; - case System.Reflection.MemberTypes.Method: - MarkMethodsFromReflectionCall (declaringType, name, 0, bindingFlags); - break; - case System.Reflection.MemberTypes.Field: - MarkFieldsFromReflectionCall (declaringType, name); - break; - case System.Reflection.MemberTypes.Property: - MarkPropertiesFromReflectionCall (declaringType, name); - break; - case System.Reflection.MemberTypes.Event: - MarkEventsFromReflectionCall (declaringType, name); - break; - } + if (!methodCalledDefinition.IsStatic) + ProcessSystemTypeGetMemberLikeCall (System.Reflection.MemberTypes.Property, methodCalledDefinition, i - 1); break; @@ -2402,7 +2406,8 @@ namespace Mono.Linker.Steps { first_arg_instr = GetInstructionAtStackDepth (instructions, i - 1, methodCalledDefinition.Parameters.Count); if (first_arg_instr < 0) { - _context.LogMessage (MessageImportance.Low, $"Reflection call '{methodCalled.FullName}' couldn't be decomposed"); + if (!HasManuallyTrackedDependency (body)) + _context.LogMessage (MessageImportance.Low, $"Reflection call '{methodCalled.FullName}' inside '{body.Method.FullName}' couldn't be decomposed"); continue; } @@ -2411,25 +2416,12 @@ namespace Mono.Linker.Steps { // first_arg = instructions [first_arg_instr]; if (first_arg.OpCode != OpCodes.Ldstr) { - _context.LogMessage (MessageImportance.Low, $"Reflection call '{methodCalled.FullName}' was detected with argument which cannot be analyzed"); + if (!HasManuallyTrackedDependency (body)) + _context.LogMessage (MessageImportance.Low, $"Reflection call '{methodCalled.FullName}' inside '{body.Method.FullName}' was detected with argument which cannot be analyzed"); continue; } - name = (string)first_arg.Operand; - - if (!TypeNameParser.TryParseTypeAssemblyQualifiedName (name, out string typeName, out string assemblyName)) - continue; - - TypeDefinition foundType = null; - foreach (var assemblyDefinition in _context.GetAssemblies ()) { - if (assemblyName != null && assemblyDefinition.Name.Name != assemblyName) - continue; - - foundType = assemblyDefinition.MainModule.GetType (typeName); - if (foundType != null) - break; - } - + TypeDefinition foundType = ResolveFullyQualifiedTypeName ((string) first_arg.Operand); if (foundType == null) continue; @@ -2464,7 +2456,8 @@ namespace Mono.Linker.Steps { case "Call": first_arg_instr = GetInstructionAtStackDepth (instructions, i - 1, 4); if (first_arg_instr < 0) { - _context.LogMessage (MessageImportance.Low, $"Expression call '{methodCalled.FullName}' couldn't be decomposed"); + if (!HasManuallyTrackedDependency (body)) + _context.LogMessage (MessageImportance.Low, $"Expression call '{methodCalled.FullName}' inside '{body.Method.FullName}' couldn't be decomposed"); continue; } @@ -2473,19 +2466,21 @@ namespace Mono.Linker.Steps { first_arg_instr++; declaringType = FindReflectionTypeForLookup (instructions, first_arg_instr); - if (declaringType == null) { - _context.LogMessage (MessageImportance.Low, $"Expression call '{methodCalled.FullName}' was detected with 1st argument which cannot be analyzed"); + if (declaringType == null ) { + if (!HasManuallyTrackedDependency (body)) + _context.LogMessage (MessageImportance.Low, $"Expression call '{methodCalled.FullName}' inside '{body.Method.FullName}' was detected with 1st argument which cannot be analyzed"); continue; } second_arg_instr = GetInstructionAtStackDepth (instructions, i - 1, 3); second_argument = instructions [second_arg_instr]; if (second_argument.OpCode != OpCodes.Ldstr) { - _context.LogMessage (MessageImportance.Low, $"Expression call '{methodCalled.FullName}' was detected with 2nd argument which cannot be analyzed"); + if (!HasManuallyTrackedDependency (body)) + _context.LogMessage (MessageImportance.Low, $"Expression call '{methodCalled.FullName}' inside '{body.Method.FullName}' was detected with 2nd argument which cannot be analyzed"); continue; } - name = (string)second_argument.Operand; + var name = (string)second_argument.Operand; MarkMethodsFromReflectionCall (declaringType, name, null, BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic); @@ -2500,7 +2495,8 @@ namespace Mono.Linker.Steps { second_arg_instr = GetInstructionAtStackDepth (instructions, i - 1, 2); if (second_arg_instr < 0) { - _context.LogMessage (MessageImportance.Low, $"Expression call '{methodCalled.FullName}' couldn't be decomposed"); + if (!HasManuallyTrackedDependency (body)) + _context.LogMessage (MessageImportance.Low, $"Expression call '{methodCalled.FullName}' inside '{body.Method.FullName}' couldn't be decomposed"); continue; } @@ -2510,14 +2506,16 @@ namespace Mono.Linker.Steps { declaringType = FindReflectionTypeForLookup (instructions, second_arg_instr); if (declaringType == null) { - _context.LogMessage (MessageImportance.Low, $"Expression call '{methodCalled.FullName}' was detected with 2nd argument which cannot be analyzed"); + if (!HasManuallyTrackedDependency (body)) + _context.LogMessage (MessageImportance.Low, $"Expression call '{methodCalled.FullName}' inside '{body.Method.FullName}' was detected with 2nd argument which cannot be analyzed"); continue; } var third_arg_inst = GetInstructionAtStackDepth (instructions, i - 1, 1); var third_argument = instructions [third_arg_inst]; if (third_argument.OpCode != OpCodes.Ldstr) { - _context.LogMessage (MessageImportance.Low, $"Expression call '{methodCalled.FullName}' was detected with the 3rd argument which cannot be analyzed"); + if (!HasManuallyTrackedDependency (body)) + _context.LogMessage (MessageImportance.Low, $"Expression call '{methodCalled.FullName}' inside '{body.Method.FullName}' was detected with the 3rd argument which cannot be analyzed"); continue; } @@ -2553,6 +2551,114 @@ namespace Mono.Linker.Steps { continue; } + + // + // System.Reflection.RuntimeReflectionExtensions + // + if (methodCalledType.Name == "RuntimeReflectionExtensions" && methodCalledType.Namespace == "System.Reflection") { + switch (methodCalled.Name) { + // + // GetRuntimeField (this Type type, string name) + // + case "GetRuntimeField": + ProcessSystemTypeGetMemberLikeCall (System.Reflection.MemberTypes.Field, methodCalledDefinition, i - 1, thisExtension: true); + break; + + // + // GetRuntimeMethod (this Type type, string name, Type[] parameters) + // + case "GetRuntimeMethod": + ProcessSystemTypeGetMemberLikeCall (System.Reflection.MemberTypes.Method, methodCalledDefinition, i - 1, thisExtension: true); + break; + + // + // GetRuntimeProperty(this Type type, string name) + // + case "GetRuntimeProperty": + ProcessSystemTypeGetMemberLikeCall (System.Reflection.MemberTypes.Property, methodCalledDefinition, i - 1, thisExtension: true); + break; + + // + // GetRuntimeEvent(this Type type, string name) + // + case "GetRuntimeEvent": + ProcessSystemTypeGetMemberLikeCall (System.Reflection.MemberTypes.Event, methodCalledDefinition, i - 1, thisExtension: true); + break; + } + } + } + + bool HasManuallyTrackedDependency (MethodBody methodBody) + { + return PreserveDependencyLookupStep.HasPreserveDependencyAttribute (methodBody.Method); + } + + // + // Handles instance methods called over typeof (Foo) with string name as the first argument + // + void ProcessSystemTypeGetMemberLikeCall (System.Reflection.MemberTypes memberTypes, MethodDefinition methodCalledDefinition, int startIndex, bool thisExtension = false) + { + int first_instance_arg = methodCalledDefinition.Parameters.Count; + if (thisExtension) + --first_instance_arg; + + var first_arg_instr = GetInstructionAtStackDepth (instructions, startIndex, first_instance_arg); + if (first_arg_instr < 0 && !HasManuallyTrackedDependency (null)) { + if (!HasManuallyTrackedDependency (body)) + _context.LogMessage (MessageImportance.Low, $"Reflection call '{methodCalledDefinition.FullName}' inside '{body.Method.FullName}' couldn't be decomposed"); + return; + } + + var first_arg = instructions [first_arg_instr]; + BindingFlags bindingFlags= default; + string name = default; + + if (memberTypes == System.Reflection.MemberTypes.Constructor) { + if (first_arg.OpCode == OpCodes.Ldc_I4_S && methodCalledDefinition.Parameters.Count > 0 && methodCalledDefinition.Parameters [0].ParameterType.Name == "BindingFlags") { + bindingFlags = (BindingFlags)(sbyte)first_arg.Operand; + } + } else { + // + // The next value must be string constant (we don't handle anything else) + // + if (first_arg.OpCode != OpCodes.Ldstr) { + if (!HasManuallyTrackedDependency (body)) + _context.LogMessage (MessageImportance.Low, $"Reflection call '{methodCalledDefinition.FullName}' inside '{body.Method.FullName}' was detected with argument which cannot be analyzed"); + return; + } + + name = (string)first_arg.Operand; + + var pos_arg = instructions [first_arg_instr + 1]; + if (pos_arg.OpCode == OpCodes.Ldc_I4_S && methodCalledDefinition.Parameters.Count > 1 && methodCalledDefinition.Parameters [1].ParameterType.Name == "BindingFlags") { + bindingFlags = (BindingFlags)(sbyte)pos_arg.Operand; + } + } + + var declaringType = FindReflectionTypeForLookup (instructions, first_arg_instr - 1); + if (declaringType == null) { + if (!HasManuallyTrackedDependency (body)) + _context.LogMessage (MessageImportance.Low, $"Reflection call '{methodCalledDefinition.FullName}' inside '{body.Method.FullName}' does not use detectable instance type extraction"); + return; + } + + switch (memberTypes) { + case System.Reflection.MemberTypes.Constructor: + MarkMethodsFromReflectionCall (declaringType, ".ctor", 0, bindingFlags); + break; + case System.Reflection.MemberTypes.Method: + MarkMethodsFromReflectionCall (declaringType, name, 0, bindingFlags); + break; + case System.Reflection.MemberTypes.Field: + MarkFieldsFromReflectionCall (declaringType, name); + break; + case System.Reflection.MemberTypes.Property: + MarkPropertiesFromReflectionCall (declaringType, name); + break; + case System.Reflection.MemberTypes.Event: + MarkEventsFromReflectionCall (declaringType, name); + break; + } } } diff --git a/external/linker/src/linker/Linker.Steps/OutputStep.cs b/external/linker/src/linker/Linker.Steps/OutputStep.cs index 32c05752ff..27c8ef3ccb 100644 --- a/external/linker/src/linker/Linker.Steps/OutputStep.cs +++ b/external/linker/src/linker/Linker.Steps/OutputStep.cs @@ -103,7 +103,12 @@ namespace Mono.Linker.Steps { } } - assembly.Write (GetAssemblyFileName (assembly, directory), writerParameters); + string outputName = GetAssemblyFileName (assembly, directory); + try { + assembly.Write (outputName, writerParameters); + } catch (Exception e) { + throw new OutputException ($"Failed to write '{outputName}", e); + } } void OutputAssembly (AssemblyDefinition assembly) @@ -121,11 +126,13 @@ namespace Mono.Linker.Steps { case AssemblyAction.AddBypassNGen: Context.Tracer.AddDependency (assembly); WriteAssembly (assembly, directory); + CopySatelliteAssembliesIfNeeded (assembly, directory); break; case AssemblyAction.Copy: Context.Tracer.AddDependency (assembly); CloseSymbols (assembly); CopyAssembly (assembly, directory); + CopySatelliteAssembliesIfNeeded (assembly, directory); break; case AssemblyAction.Delete: CloseSymbols (assembly); @@ -176,6 +183,28 @@ namespace Mono.Linker.Steps { return parameters; } + + void CopySatelliteAssembliesIfNeeded (AssemblyDefinition assembly, string directory) + { + if (!Annotations.ProcessSatelliteAssemblies) + return; + + FileInfo original = GetOriginalAssemblyFileInfo (assembly); + string resourceFile = GetAssemblyResourceFileName (original.FullName); + + foreach (var subDirectory in Directory.EnumerateDirectories (original.DirectoryName)) { + var satelliteAssembly = Path.Combine (subDirectory, resourceFile); + if (!File.Exists (satelliteAssembly)) + continue; + + string cultureName = subDirectory.Substring (subDirectory.LastIndexOf (Path.DirectorySeparatorChar) + 1); + string culturePath = Path.Combine (directory, cultureName); + + Directory.CreateDirectory (culturePath); + File.Copy (satelliteAssembly, Path.Combine (culturePath, resourceFile), true); + } + } + void CopyConfigFileIfNeeded (AssemblyDefinition assembly, string directory) { string config = GetConfigFile (GetOriginalAssemblyFileInfo (assembly).FullName); @@ -190,6 +219,11 @@ namespace Mono.Linker.Steps { File.Copy (config, GetConfigFile (GetAssemblyFileName (assembly, directory)), true); } + static string GetAssemblyResourceFileName (string assembly) + { + return Path.GetFileNameWithoutExtension (assembly) + ".resources.dll"; + } + static string GetConfigFile (string assembly) { return assembly + ".config"; diff --git a/external/linker/src/linker/Linker.Steps/PreserveDependencyLookupStep.cs b/external/linker/src/linker/Linker.Steps/PreserveDependencyLookupStep.cs index d68ec51c73..437c67d730 100644 --- a/external/linker/src/linker/Linker.Steps/PreserveDependencyLookupStep.cs +++ b/external/linker/src/linker/Linker.Steps/PreserveDependencyLookupStep.cs @@ -64,6 +64,19 @@ namespace Mono.Linker.Steps { return tr.Name == "PreserveDependencyAttribute" && tr.Namespace == "System.Runtime.CompilerServices"; } + public static bool HasPreserveDependencyAttribute (MethodDefinition method) + { + if (!method.HasCustomAttributes) + return false; + + foreach (var ca in method.CustomAttributes) { + if (IsPreserveDependencyAttribute (ca.AttributeType)) + return true; + } + + return false; + } + void ProcessPreserveDependencyAttribute (Collection attributes) { foreach (var ca in attributes) { diff --git a/external/linker/src/linker/Linker.Steps/ResolveFromXmlStep.cs b/external/linker/src/linker/Linker.Steps/ResolveFromXmlStep.cs index faac4f749e..83c72205d4 100644 --- a/external/linker/src/linker/Linker.Steps/ResolveFromXmlStep.cs +++ b/external/linker/src/linker/Linker.Steps/ResolveFromXmlStep.cs @@ -104,7 +104,8 @@ namespace Mono.Linker.Steps { { while (iterator.MoveNext ()) { AssemblyDefinition assembly = GetAssembly (context, GetAssemblyName (iterator.Current)); - ProcessAssembly (assembly, iterator); + if (assembly != null) + ProcessAssembly (assembly, iterator); } } diff --git a/external/linker/src/linker/Linker.Steps/SweepStep.cs b/external/linker/src/linker/Linker.Steps/SweepStep.cs index ac38a27506..ed72cc4d22 100644 --- a/external/linker/src/linker/Linker.Steps/SweepStep.cs +++ b/external/linker/src/linker/Linker.Steps/SweepStep.cs @@ -35,11 +35,11 @@ using Mono.Cecil.Cil; namespace Mono.Linker.Steps { - public class SweepStep : BaseStep { - + public class SweepStep : BaseStep + { AssemblyDefinition [] assemblies; - HashSet resolvedTypeReferences; readonly bool sweepSymbols; + readonly HashSet BypassNGenToSave = new HashSet (); public SweepStep (bool sweepSymbols = true) { @@ -49,61 +49,78 @@ namespace Mono.Linker.Steps { protected override void Process () { assemblies = Context.Annotations.GetAssemblies ().ToArray (); + + foreach (var assembly in assemblies) { + RemoveUnusedAssembly (assembly); + } + foreach (var assembly in assemblies) { ProcessAssemblyAction (assembly); - if ((Annotations.GetAction (assembly) == AssemblyAction.Copy) && - !Context.KeepTypeForwarderOnlyAssemblies) { - // Copy assemblies can still contain Type references with - // type forwarders from Delete assemblies - // thus try to resolve all the type references and see - // if some changed the scope. if yes change the action to Save - if (ResolveAllTypeReferences (assembly)) - Annotations.SetAction (assembly, AssemblyAction.Save); - } + } + } - AssemblyAction currentAction = Annotations.GetAction (assembly); + void RemoveUnusedAssembly (AssemblyDefinition assembly) + { + switch (Annotations.GetAction (assembly)) { + case AssemblyAction.AddBypassNGenUsed: + case AssemblyAction.CopyUsed: + case AssemblyAction.Link: + if (!IsUsedAssembly (assembly)) + RemoveAssembly (assembly); - if ((currentAction == AssemblyAction.Link) || (currentAction == AssemblyAction.Save)) { - // if we save (only or by linking) then unmarked exports (e.g. forwarders) must be cleaned - // or they can point to nothing which will break later (e.g. when re-loading for stripping IL) - // reference: https://bugzilla.xamarin.com/show_bug.cgi?id=36577 - if (assembly.MainModule.HasExportedTypes) - SweepCollectionNonAttributable (assembly.MainModule.ExportedTypes); - } + break; } } protected void ProcessAssemblyAction (AssemblyDefinition assembly) { switch (Annotations.GetAction (assembly)) { - case AssemblyAction.Link: - if (!IsMarkedAssembly (assembly)) { - RemoveAssembly (assembly); - return; - } - break; + case AssemblyAction.AddBypassNGenUsed: + Annotations.SetAction (assembly, AssemblyAction.AddBypassNGen); + goto case AssemblyAction.AddBypassNGen; - case AssemblyAction.AddBypassNGenUsed: - if (!IsMarkedAssembly (assembly)) { - RemoveAssembly (assembly); - } else { - Annotations.SetAction (assembly, AssemblyAction.AddBypassNGen); - } - return; + case AssemblyAction.AddBypassNGen: + // FIXME: AddBypassNGen is just wrong, it should not be action as we need to + // turn it to Action.Save here to e.g. correctly update debug symbols + if (!Context.KeepTypeForwarderOnlyAssemblies || BypassNGenToSave.Contains (assembly)) { + goto case AssemblyAction.Save; + } - case AssemblyAction.CopyUsed: - if (!IsMarkedAssembly (assembly)) { - RemoveAssembly (assembly); - } else { - Annotations.SetAction (assembly, AssemblyAction.Copy); - } - return; + break; - default: - return; + case AssemblyAction.CopyUsed: + Annotations.SetAction (assembly, AssemblyAction.Copy); + goto case AssemblyAction.Copy; + + case AssemblyAction.Copy: + // + // Facade assemblies can have unused forwarders pointing to + // removed type (when facades are kept) + // + // main.exe -> facade.dll -> lib.dll + // link | copy | link + // + // when main.exe has unused reference to type in lib.dll + // + if (SweepTypeForwarders (assembly)) + Annotations.SetAction (assembly, AssemblyAction.Save); + + break; + + case AssemblyAction.Link: + SweepAssembly (assembly); + break; + + case AssemblyAction.Save: + // + // Save means we need to rewrite the assembly due to removed assembly + // reference. We do any additional removed assembly reference clean up here + // + UpdateForwardedTypesScope (assembly); + UpdateCustomAttributesTypesScopes (assembly); + SweepTypeForwarders (assembly); + break; } - - SweepAssembly (assembly); } protected virtual void SweepAssembly (AssemblyDefinition assembly) @@ -132,6 +149,21 @@ namespace Mono.Linker.Steps { foreach (var module in assembly.Modules) SweepCustomAttributes (module); + + SweepTypeForwarders (assembly); + + UpdateForwardedTypesScope (assembly); + } + + bool IsUsedAssembly (AssemblyDefinition assembly) + { + if (IsMarkedAssembly (assembly)) + return true; + + if (assembly.MainModule.HasExportedTypes && Context.KeepTypeForwarderOnlyAssemblies) + return true; + + return false; } bool IsMarkedAssembly (AssemblyDefinition assembly) @@ -143,7 +175,15 @@ namespace Mono.Linker.Steps { { Annotations.SetAction (assembly, AssemblyAction.Delete); - SweepReferences (assembly); + foreach (var a in assemblies) { + switch (Annotations.GetAction (a)) { + case AssemblyAction.Skip: + case AssemblyAction.Delete: + continue; + } + + SweepReferences (a, assembly); + } } void SweepResources (AssemblyDefinition assembly) @@ -163,115 +203,242 @@ namespace Mono.Linker.Steps { } } - void SweepReferences (AssemblyDefinition target) + void SweepReferences (AssemblyDefinition assembly, AssemblyDefinition referenceToRemove) { - foreach (var assembly in assemblies) - SweepReferences (assembly, target); - } - - void SweepReferences (AssemblyDefinition assembly, AssemblyDefinition target) - { - if (assembly == target) + if (assembly == referenceToRemove) return; + bool reference_removed = false; + var references = assembly.MainModule.AssemblyReferences; for (int i = 0; i < references.Count; i++) { var reference = references [i]; - AssemblyDefinition r = Context.Resolver.Resolve (reference); - if (r == null) - continue; - if (!AreSameReference (r.Name, target.Name)) + + AssemblyDefinition ad = Context.Resolver.Resolve (reference); + if (ad == null || !AreSameReference (ad.Name, referenceToRemove.Name)) continue; ReferenceRemoved (assembly, reference); - // removal from `references` requires an adjustment to `i` references.RemoveAt (i--); - // Removing the reference does not mean it will be saved back to disk! - // That depends on the AssemblyAction set for the `assembly` + reference_removed = true; + } + + if (reference_removed) { switch (Annotations.GetAction (assembly)) { - case AssemblyAction.Copy: - // We need to save the assembly if a reference was removed, otherwise we can end up - // with an assembly that references an assembly that no longer exists - Annotations.SetAction (assembly, AssemblyAction.Save); - // Copy means even if "unlinked" we still want that assembly to be saved back - // to disk (OutputStep) without the (removed) reference - if (!Context.KeepTypeForwarderOnlyAssemblies) { - ResolveAllTypeReferences (assembly); - } - break; - case AssemblyAction.CopyUsed: - if (IsMarkedAssembly (assembly) && !Context.KeepTypeForwarderOnlyAssemblies) { - Annotations.SetAction (assembly, AssemblyAction.Save); - ResolveAllTypeReferences (assembly); + if (IsUsedAssembly (assembly)) { + goto case AssemblyAction.Copy; } break; - case AssemblyAction.Save: - case AssemblyAction.Link: - case AssemblyAction.AddBypassNGen: + case AssemblyAction.Copy: + // + // Assembly has a reference to another assembly which has been fully removed. This can + // happen when for example the reference assembly is 'copy-used' and it's not needed. + // + // or + // + // Assembly can contain type references with + // type forwarders to deleted assembly (facade) when + // facade assemblies are not kept. For that reason we need to + // rewrite the copy to save to update the scopes not to point + // forwardning assembly (facade). + // + // foo.dll -> facade.dll -> lib.dll + // copy | copy (delete) | link + // + Annotations.SetAction (assembly, AssemblyAction.Save); + break; + case AssemblyAction.AddBypassNGenUsed: - if (!Context.KeepTypeForwarderOnlyAssemblies) { - ResolveAllTypeReferences (assembly); + if (IsUsedAssembly (assembly)) { + Annotations.SetAction (assembly, AssemblyAction.AddBypassNGen); + goto case AssemblyAction.AddBypassNGen; } break; + + case AssemblyAction.AddBypassNGen: + BypassNGenToSave.Add (assembly); + break; } } } - bool ResolveAllTypeReferences (AssemblyDefinition assembly) + bool SweepTypeForwarders (AssemblyDefinition assembly) { - if (resolvedTypeReferences == null) - resolvedTypeReferences = new HashSet (); - if (resolvedTypeReferences.Contains (assembly)) - return false; - resolvedTypeReferences.Add (assembly); + if (assembly.MainModule.HasExportedTypes) { + return SweepCollectionMetadata (assembly.MainModule.ExportedTypes); + } - var hash = new Dictionary (); - bool changes = false; + return false; + } + + void UpdateForwardedTypesScope (AssemblyDefinition assembly) + { + var changed_types = new Dictionary (); foreach (TypeReference tr in assembly.MainModule.GetTypeReferences ()) { - if (hash.ContainsKey (tr)) - continue; if (tr.IsWindowsRuntimeProjection) continue; + var td = tr.Resolve (); - IMetadataScope scope = tr.Scope; // at this stage reference might include things that can't be resolved // and if it is (resolved) it needs to be kept only if marked (#16213) - if ((td != null) && Annotations.IsMarked (td)) { - scope = assembly.MainModule.ImportReference (td).Scope; - if (tr.Scope != scope) - changes = true; - hash.Add (tr, scope); - } - } - if (assembly.MainModule.HasExportedTypes) { - foreach (var et in assembly.MainModule.ExportedTypes) { - var td = et.Resolve (); - IMetadataScope scope = et.Scope; - if ((td != null) && Annotations.IsMarked (td)) { - scope = assembly.MainModule.ImportReference (td).Scope; - et.Scope = scope; - } - } + if (td == null || !Annotations.IsMarked (td)) + continue; + + IMetadataScope scope = assembly.MainModule.ImportReference (td).Scope; + if (tr.Scope != scope) + changed_types.Add (tr, scope); } - // Resolve everything first before updating scopes. + // + // Resolved everything first before updating scopes. // If we set the scope to null, then calling Resolve() on any of its // nested types would crash. - - foreach (var e in hash) { + // + foreach (var e in changed_types) { e.Key.Scope = e.Value; } - return changes; + if (assembly.MainModule.HasExportedTypes) { + foreach (var et in assembly.MainModule.ExportedTypes) { + var td = et.Resolve (); + if (td == null) + continue; + + et.Scope = assembly.MainModule.ImportReference (td).Scope; + } + } + } + + static void UpdateCustomAttributesTypesScopes (AssemblyDefinition assembly) + { + UpdateCustomAttributesTypesScopes ((ICustomAttributeProvider) assembly); + + foreach (var module in assembly.Modules) + UpdateCustomAttributesTypesScopes (module); + + foreach (var type in assembly.MainModule.Types) + UpdateCustomAttributesTypesScopes (type); + } + + static void UpdateCustomAttributesTypesScopes (TypeDefinition typeDefinition) + { + UpdateCustomAttributesTypesScopes ((ICustomAttributeProvider)typeDefinition); + + if (typeDefinition.HasEvents) + UpdateCustomAttributesTypesScopes (typeDefinition.Events); + + if (typeDefinition.HasFields) + UpdateCustomAttributesTypesScopes (typeDefinition.Fields); + + if (typeDefinition.HasMethods) + UpdateCustomAttributesTypesScopes (typeDefinition.Methods); + + if (typeDefinition.HasProperties) + UpdateCustomAttributesTypesScopes (typeDefinition.Properties); + + if (typeDefinition.HasGenericParameters) + UpdateCustomAttributesTypesScopes (typeDefinition.GenericParameters); + + if (typeDefinition.HasNestedTypes) { + foreach (var nestedType in typeDefinition.NestedTypes) { + UpdateCustomAttributesTypesScopes (nestedType); + } + } + } + + static void UpdateCustomAttributesTypesScopes (Collection providers) where T : ICustomAttributeProvider + { + foreach (var provider in providers) + UpdateCustomAttributesTypesScopes (provider); + } + + static void UpdateCustomAttributesTypesScopes (Collection genericParameters) + { + foreach (var gp in genericParameters) { + UpdateCustomAttributesTypesScopes (gp); + + if (gp.HasConstraints) + UpdateCustomAttributesTypesScopes (gp.Constraints); + } + } + + static void UpdateCustomAttributesTypesScopes (ICustomAttributeProvider customAttributeProvider) + { + if (!customAttributeProvider.HasCustomAttributes) + return; + + foreach (var ca in customAttributeProvider.CustomAttributes) + UpdateForwardedTypesScope (ca); + } + + static void UpdateForwardedTypesScope (CustomAttribute attribute) + { + AssemblyDefinition assembly = attribute.Constructor.Module.Assembly; + + if (attribute.HasConstructorArguments) { + foreach (var ca in attribute.ConstructorArguments) + UpdateForwardedTypesScope (ca, assembly); + } + + if (attribute.HasFields) { + foreach (var field in attribute.Fields) + UpdateForwardedTypesScope (field.Argument, assembly); + } + + if (attribute.HasProperties) { + foreach (var property in attribute.Properties) + UpdateForwardedTypesScope (property.Argument, assembly); + } + } + + static void UpdateForwardedTypesScope (CustomAttributeArgument attributeArgument, AssemblyDefinition assembly) + { + UpdateTypeScope (attributeArgument.Type, assembly); + + switch (attributeArgument.Value) { + case TypeReference tr: + UpdateTypeScope (tr, assembly); + break; + case CustomAttributeArgument caa: + UpdateForwardedTypesScope (caa, assembly); + break; + case CustomAttributeArgument[] array: + foreach (var item in array) + UpdateForwardedTypesScope (item, assembly); + break; + } + } + + static void UpdateTypeScope (TypeReference type, AssemblyDefinition assembly) + { + if (type is GenericInstanceType git && git.HasGenericArguments) { + UpdateTypeScope (git.ElementType, assembly); + foreach (var ga in git.GenericArguments) + UpdateTypeScope (ga, assembly); + return; + } + + if (type is ArrayType at) { + UpdateTypeScope (at.ElementType, assembly); + return; + } + + TypeDefinition td = type.Resolve (); + if (td == null) + return; + + IMetadataScope scope = assembly.MainModule.ImportReference (td).Scope; + if (type.Scope != scope) + type.Scope = td.Scope; } protected virtual void SweepType (TypeDefinition type) { if (type.HasFields) - SweepCollection (type.Fields); + SweepCollectionWithCustomAttributes (type.Fields); if (type.HasMethods) SweepMethods (type.Methods); @@ -286,7 +453,7 @@ namespace Mono.Linker.Steps { SweepCustomAttributes (type); if (type.HasGenericParameters) - SweepCustomAttributeCollection (type.GenericParameters); + SweepGenericParameters (type.GenericParameters); if (type.HasProperties) SweepCustomAttributeCollection (type.Properties); @@ -324,6 +491,16 @@ namespace Mono.Linker.Steps { } } + protected void SweepGenericParameters (Collection genericParameters) + { + foreach (var gp in genericParameters) { + SweepCustomAttributes (gp); + + if (gp.HasConstraints) + SweepCustomAttributeCollection (gp.Constraints); + } + } + protected void SweepCustomAttributes (TypeDefinition type) { var removed = SweepCustomAttributes (type as ICustomAttributeProvider); @@ -380,7 +557,9 @@ namespace Mono.Linker.Steps { for (int i = provider.CustomAttributes.Count - 1; i >= 0; i--) { var attribute = provider.CustomAttributes [i]; - if (!Annotations.IsMarked (attribute)) { + if (Annotations.IsMarked (attribute)) { + UpdateForwardedTypesScope (attribute); + } else { CustomAttributeUsageRemoved (provider, attribute); removed.Add (provider.CustomAttributes [i]); provider.CustomAttributes.RemoveAt (i); @@ -398,13 +577,13 @@ namespace Mono.Linker.Steps { protected virtual void SweepMethods (Collection methods) { - SweepCollection (methods); + SweepCollectionWithCustomAttributes (methods); if (sweepSymbols) SweepDebugInfo (methods); foreach (var method in methods) { if (method.HasGenericParameters) - SweepCustomAttributeCollection (method.GenericParameters); + SweepGenericParameters (method.GenericParameters); SweepCustomAttributes (method.MethodReturnType); @@ -461,7 +640,7 @@ namespace Mono.Linker.Steps { } } - protected void SweepCollection (IList list) + protected void SweepCollectionWithCustomAttributes (IList list) where T : ICustomAttributeProvider { for (int i = 0; i < list.Count; i++) if (ShouldRemove (list [i])) { @@ -472,24 +651,19 @@ namespace Mono.Linker.Steps { } } - protected void SweepCollection (IList list) where T : ICustomAttributeProvider + protected bool SweepCollectionMetadata (IList list) where T : IMetadataTokenProvider { - for (int i = 0; i < list.Count; i++) - if (ShouldRemove (list [i])) { - ElementRemoved (list [i]); - list.RemoveAt (i--); - } else { - SweepCustomAttributes (list [i]); - } - } + bool removed = false; - protected void SweepCollectionNonAttributable (IList list) where T : IMetadataTokenProvider - { - for (int i = 0; i < list.Count; i++) + for (int i = 0; i < list.Count; i++) { if (ShouldRemove (list [i])) { ElementRemoved (list [i]); list.RemoveAt (i--); + removed = true; } + } + + return removed; } protected virtual bool ShouldRemove (T element) where T : IMetadataTokenProvider diff --git a/external/linker/src/linker/Linker/Annotations.cs b/external/linker/src/linker/Linker/Annotations.cs index ce91191c05..8530ab04f8 100644 --- a/external/linker/src/linker/Linker/Annotations.cs +++ b/external/linker/src/linker/Linker/Annotations.cs @@ -60,6 +60,8 @@ namespace Mono.Linker { public AnnotationStore (LinkContext context) => this.context = context; + public bool ProcessSatelliteAssemblies { get; set; } + protected Tracer Tracer { get { return context.Tracer; diff --git a/external/linker/src/linker/Linker/AssemblyResolver.cs b/external/linker/src/linker/Linker/AssemblyResolver.cs index 5a4299bae9..f70f95165b 100644 --- a/external/linker/src/linker/Linker/AssemblyResolver.cs +++ b/external/linker/src/linker/Linker/AssemblyResolver.cs @@ -121,8 +121,7 @@ namespace Mono.Linker { } catch (AssemblyResolutionException) { if (!_ignoreUnresolved) throw; - - _context.LogMessage ($"warning: unresolved assembly {name.Name}"); + _context.LogMessage ($"Ignoring unresolved assembly '{name.Name}'."); if (_unresolvedAssemblies == null) _unresolvedAssemblies = new HashSet (); _unresolvedAssemblies.Add (name.Name); diff --git a/external/linker/src/linker/Linker/Driver.cs b/external/linker/src/linker/Linker/Driver.cs index fd3c585959..bfcfbb9078 100644 --- a/external/linker/src/linker/Linker/Driver.cs +++ b/external/linker/src/linker/Linker/Driver.cs @@ -231,6 +231,10 @@ namespace Mono.Linker { context.KeepTypeForwarderOnlyAssemblies = bool.Parse (GetParam ()); continue; + case "--keep-dep-attributes": + context.KeepDependencyAttributes = bool.Parse (GetParam ()); + continue; + case "--ignore-descriptors": ignoreDescriptors = bool.Parse (GetParam ()); continue; @@ -559,13 +563,14 @@ namespace Mono.Linker { Console.WriteLine (" --about About the {0}", _linker); Console.WriteLine (" --verbose Log messages indicating progress and warnings"); Console.WriteLine (" --version Print the version number of the {0}", _linker); + Console.WriteLine (" @ Read response file for more options"); Console.WriteLine (); Console.WriteLine ("Actions"); - Console.WriteLine (" -c Action on the core assemblies. Defaults to 'skip'"); - Console.WriteLine (" copy: Copy the files into the output directory"); - Console.WriteLine (" copyused: Copy the files only when anything from the assembly is used"); - Console.WriteLine (" link: Link the assembly"); + Console.WriteLine (" -c Action on the framework assemblies. Defaults to 'skip'"); + Console.WriteLine (" copy: Copy the assembly into the output (it can be updated when any of its dependencies is removed)"); + Console.WriteLine (" copyused: Same as copy but only for assemblies which are needed"); + Console.WriteLine (" link: Remove any ununsed code or metadata from the assembly"); Console.WriteLine (" skip: Do not process the assembly"); Console.WriteLine (" addbypassngen: Add BypassNGenAttribute to unused methods"); Console.WriteLine (" addbypassngenused: Same as addbypassngen but unused assemblies are removed"); @@ -590,6 +595,7 @@ namespace Mono.Linker { Console.WriteLine (" globalization: Globalization data and globalization behavior"); Console.WriteLine (" --ignore-descriptors Skips reading embedded descriptors (short -z). Defaults to false"); Console.WriteLine (" --keep-facades Keep assemblies with type-forwarders (short -t). Defaults to false"); + Console.WriteLine (" --keep-dep-attributes Keep attributes used for manual dependency tracking. Defaults to false"); Console.WriteLine (" --new-mvid Generate a new guid for each linked assembly (short -g). Defaults to true"); Console.WriteLine (" --skip-unresolved Ignore unresolved types, methods, and assemblies. Defaults to false"); Console.WriteLine (" --strip-resources Remove XML descriptor resources for linked assemblies. Defaults to true"); diff --git a/external/linker/src/linker/Linker/KnownMembers.cs b/external/linker/src/linker/Linker/KnownMembers.cs index 274d4490d1..f1e204bb05 100644 --- a/external/linker/src/linker/Linker/KnownMembers.cs +++ b/external/linker/src/linker/Linker/KnownMembers.cs @@ -17,5 +17,14 @@ namespace Mono.Linker return true; } + + public static bool IsSatelliteAssemblyMarker (MethodDefinition method) + { + if (!method.IsConstructor || method.IsStatic) + return false; + + var declaringType = method.DeclaringType; + return declaringType.Name == "ResourceManager" && declaringType.Namespace == "System.Resources"; + } } } diff --git a/external/linker/src/linker/Linker/LinkContext.cs b/external/linker/src/linker/Linker/LinkContext.cs index a31ea3c187..a5308d497e 100644 --- a/external/linker/src/linker/Linker/LinkContext.cs +++ b/external/linker/src/linker/Linker/LinkContext.cs @@ -113,6 +113,8 @@ namespace Mono.Linker { public bool KeepUsedAttributeTypesOnly { get; set; } + public bool KeepDependencyAttributes { get; set; } + public bool StripResources { get; set; } public System.Collections.IDictionary Actions { @@ -285,6 +287,8 @@ namespace Mono.Linker { public virtual ICollection ResolveReferences (AssemblyDefinition assembly) { List references = new List (); + if (assembly == null) + return references; foreach (AssemblyNameReference reference in assembly.MainModule.AssemblyReferences) { AssemblyDefinition definition = Resolve (reference); if (definition != null) diff --git a/external/linker/src/linker/Linker/OutputException.cs b/external/linker/src/linker/Linker/OutputException.cs new file mode 100644 index 0000000000..a406625fa3 --- /dev/null +++ b/external/linker/src/linker/Linker/OutputException.cs @@ -0,0 +1,17 @@ +using System; + +namespace Mono.Linker +{ + public class OutputException : Exception + { + public OutputException (string message) + : base (message) + { + } + + public OutputException (string message, Exception innerException) + : base (message, innerException) + { + } + } +} \ No newline at end of file diff --git a/external/linker/src/linker/Linker/TypeReferenceExtensions.cs b/external/linker/src/linker/Linker/TypeReferenceExtensions.cs index 13d9db7aa9..ae271a0d4f 100644 --- a/external/linker/src/linker/Linker/TypeReferenceExtensions.cs +++ b/external/linker/src/linker/Linker/TypeReferenceExtensions.cs @@ -231,5 +231,11 @@ namespace Mono.Linker throw new NotImplementedException (); } + + public static bool IsTypeOf (this TypeReference type, string ns, string name) + { + return type.Name == name + && type.Namespace == ns; + } } } diff --git a/external/linker/src/tuner/Mono.Tuner/Dispatcher.cs b/external/linker/src/tuner/Mono.Tuner/Dispatcher.cs index 2d1a32f12c..be16740440 100644 --- a/external/linker/src/tuner/Mono.Tuner/Dispatcher.cs +++ b/external/linker/src/tuner/Mono.Tuner/Dispatcher.cs @@ -44,10 +44,6 @@ namespace Mono.Tuner { get { return context.Annotations; } } - internal Tracer Tracer { - get { return context.Tracer; } - } - public abstract SubStepTargets Targets { get; } public virtual void Initialize (LinkContext context) @@ -96,6 +92,8 @@ namespace Mono.Tuner { List on_properties; List on_events; + Tracer tracer; + public void Add (ISubStep substep) { substeps.Add (substep); @@ -103,11 +101,25 @@ namespace Mono.Tuner { public void Process (LinkContext context) { + tracer = context.Tracer; + InitializeSubSteps (context); BrowseAssemblies (context.GetAssemblies ()); } + void Push (ISubStep subStep) + { + if (tracer != null) + tracer.Push (subStep); + } + + void Pop () + { + if (tracer != null) + tracer.Pop (); + } + static bool HasSubSteps (List substeps) { return substeps != null && substeps.Count > 0; @@ -186,49 +198,55 @@ namespace Mono.Tuner { void DispatchAssembly (AssemblyDefinition assembly) { foreach (var substep in on_assemblies) { - var bs = substep as BaseSubStep; - if (bs != null) - bs.Tracer.Push (substep); + Push (substep); substep.ProcessAssembly (assembly); - if (bs != null) - bs.Tracer.Pop (); + Pop (); } } void DispatchType (TypeDefinition type) { foreach (var substep in on_types) { - var bs = substep as BaseSubStep; - if (bs != null) - bs.Tracer.Push (substep); + Push (substep); substep.ProcessType (type); - if (bs != null) - bs.Tracer.Pop (); + Pop (); } } void DispatchField (FieldDefinition field) { - foreach (var substep in on_fields) + foreach (var substep in on_fields) { + Push (substep); substep.ProcessField (field); + Pop (); + } } void DispatchMethod (MethodDefinition method) { - foreach (var substep in on_methods) + foreach (var substep in on_methods) { + Push (substep); substep.ProcessMethod (method); + Pop (); + } } void DispatchProperty (PropertyDefinition property) { - foreach (var substep in on_properties) + foreach (var substep in on_properties) { + Push (substep); substep.ProcessProperty (property); + Pop (); + } } void DispatchEvent (EventDefinition @event) { - foreach (var substep in on_events) + foreach (var substep in on_events) { + Push (substep); substep.ProcessEvent (@event); + Pop (); + } } void InitializeSubSteps (LinkContext context) diff --git a/external/roslyn-binaries/Microsoft.Net.Compilers/3.4.0/Microsoft.Managed.EditorConfig.targets b/external/roslyn-binaries/Microsoft.Net.Compilers/3.4.0/Microsoft.Managed.EditorConfig.targets deleted file mode 100644 index d659d55470..0000000000 --- a/external/roslyn-binaries/Microsoft.Net.Compilers/3.4.0/Microsoft.Managed.EditorConfig.targets +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - <_AllDirectoriesAbove Include="@(Compile->GetPathsOfAllDirectoriesAbove())" Condition="'$(DiscoverEditorConfigFiles)' != 'false'" /> - - - - - - diff --git a/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/Microsoft.Build.Tasks.CodeAnalysis.dll.REMOVED.git-id b/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/Microsoft.Build.Tasks.CodeAnalysis.dll.REMOVED.git-id new file mode 100644 index 0000000000..5536b0dba4 --- /dev/null +++ b/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/Microsoft.Build.Tasks.CodeAnalysis.dll.REMOVED.git-id @@ -0,0 +1 @@ +14c4ba0a932e7d62d715db026dde8455d777a8ea \ No newline at end of file diff --git a/mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.4.0/Microsoft.CSharp.Core.targets b/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/Microsoft.CSharp.Core.targets similarity index 100% rename from mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.4.0/Microsoft.CSharp.Core.targets rename to external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/Microsoft.CSharp.Core.targets diff --git a/mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.4.0/Microsoft.CodeAnalysis.CSharp.Scripting.dll b/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/Microsoft.CodeAnalysis.CSharp.Scripting.dll similarity index 78% rename from mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.4.0/Microsoft.CodeAnalysis.CSharp.Scripting.dll rename to external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/Microsoft.CodeAnalysis.CSharp.Scripting.dll index b6ddd1a235d611ddd953e34d8dc3ae8095570521..452298dd137319fad42ca323a47aa6dfc6aeb273 100644 GIT binary patch delta 3494 zcmZWrc|4SB8-Cx}WYd=Oh`8X*1P!S@fY~Smg&i6at`JVUpyzhNq_jNsgJkN7qzjtL3j9mh=l2O3Yn%$rR;-f0I(MXR9PhlR5?o~E*N?m@x)=Y z!oiqov#Zt?ZxKc*L%Jj5h=OwJvC|(7PYj<;70TwzFEghL0W9ZkMus7{#{MGtB5{`I2j+ zldep%x-7ZtGS!3zXI3;(teXR*X znhy#r9$Ubvh(}7kl$STzymxtROr1XPwADKJbF>Q&Yc^OA9V%v%Dv};oW%Z5ZMZ?ce z7Zu)8FH@XyOlL(ubMEf^ZBfSN)(fmR=I%NoR%>CPb1G2ENTH-wgH(CMuQD!5Wiui- zR4jN5B`n|kC_C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Microsoft.Net.Compilers/3.5.0/Microsoft.CodeAnalysis.CSharp.dll.REMOVED.git-id new file mode 100644 index 0000000000..e19172eb8d --- /dev/null +++ b/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/Microsoft.CodeAnalysis.CSharp.dll.REMOVED.git-id @@ -0,0 +1 @@ +d981a20baaac679f86733a8e18d3d952e2e95ba3 \ No newline at end of file diff --git a/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/Microsoft.CodeAnalysis.Scripting.dll.REMOVED.git-id b/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/Microsoft.CodeAnalysis.Scripting.dll.REMOVED.git-id new file mode 100644 index 0000000000..0c98b8a3ed --- /dev/null +++ b/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/Microsoft.CodeAnalysis.Scripting.dll.REMOVED.git-id @@ -0,0 +1 @@ +28a3e4df48150babf00b64489910031d0226e8c1 \ No newline at end of file diff --git a/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/Microsoft.CodeAnalysis.VisualBasic.dll.REMOVED.git-id b/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/Microsoft.CodeAnalysis.VisualBasic.dll.REMOVED.git-id new file mode 100644 index 0000000000..3b79397f00 --- /dev/null +++ b/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/Microsoft.CodeAnalysis.VisualBasic.dll.REMOVED.git-id @@ -0,0 +1 @@ +d2f4cf7f9ecbe4b3a9f3ee6cef1ba8e236b037a4 \ No newline at end of file diff --git a/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/Microsoft.CodeAnalysis.dll.REMOVED.git-id b/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/Microsoft.CodeAnalysis.dll.REMOVED.git-id new file mode 100644 index 0000000000..6c42f4ca02 --- /dev/null +++ b/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/Microsoft.CodeAnalysis.dll.REMOVED.git-id @@ -0,0 +1 @@ +6f35dca52fcb84d0fc5489e78b50a8e4be40a68a \ No newline at end of file diff --git a/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/Microsoft.DiaSymReader.Native.amd64.dll.REMOVED.git-id b/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/Microsoft.DiaSymReader.Native.amd64.dll.REMOVED.git-id new file mode 100644 index 0000000000..e411fd0f35 --- /dev/null +++ b/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/Microsoft.DiaSymReader.Native.amd64.dll.REMOVED.git-id @@ -0,0 +1 @@ +e376a20352bb547c881ad93a9529ad3fedd5fae9 \ No newline at end of file diff --git a/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/Microsoft.DiaSymReader.Native.x86.dll.REMOVED.git-id b/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/Microsoft.DiaSymReader.Native.x86.dll.REMOVED.git-id new file mode 100644 index 0000000000..5bfe674ea2 --- /dev/null +++ b/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/Microsoft.DiaSymReader.Native.x86.dll.REMOVED.git-id @@ -0,0 +1 @@ +5ebef7fe292eaf725025142a43f8f667700cf003 \ No newline at end of file diff --git a/mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.4.0/Microsoft.Managed.Core.targets b/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/Microsoft.Managed.Core.targets similarity index 100% rename from mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.4.0/Microsoft.Managed.Core.targets rename to external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/Microsoft.Managed.Core.targets diff --git a/mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.4.0/Microsoft.VisualBasic.Core.targets b/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/Microsoft.VisualBasic.Core.targets similarity index 100% rename from mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.4.0/Microsoft.VisualBasic.Core.targets rename to external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/Microsoft.VisualBasic.Core.targets diff --git a/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/System.Buffers.dll b/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/System.Buffers.dll new file mode 100644 index 0000000000000000000000000000000000000000..b6d9c7782d275b83f4d0883f9bfb2d65fc5c9e9f GIT binary patch literal 27992 zcmeHw2Ut@})9{`<^%}hK`hQLI)eYi1e-?1PBm>1d|}eMp3Q}yQ0_t#oj9x#9pyC ztSI)1y(|Bm6Pn)g-tYgv_qp%;JpaMW*`1x8ZL_npvzr(^WCo%lglO<-Z%3#e-o)cU z!oLQ^kgR05TM2EGJ#AEv4L)rYmB|;gaz(-n5jTgG$`uHN5>^V2CCU@9_yU$sXe28~ zn8sr(D$1F5unzM@XfQ@aI#Y!4ou%DD#w>XZM~EO|O0n+V@Mgg$89oT9kYS3n-UNcE zKlxMx1iZs|1nu&eK#&suy5Aj90tL@wFN8vgKr%w-x|l$mjZoY`co!q20IyA+2P++jvVl*J#{(f~?az;%w=_=Fje_VX(*mJfZG>by$eN)K;xL48Xn%1B z?yp{1V}Y1vW~*v$2`m_54TR*(iV2*RoTe2*x;T|=DqvK5$yvgSK@n;Kk=$*n`E5kC zQJ^q%gj#^Gp-`mFNOwpH^-03sKM|T~)4GUhmN58oRwt#@MkKY) z@2Jgs)4OxfE%k{k_97XmWiLxA)Y*!C4ysPEG$0ZTD3*rAJ7OFQUPMn=o7pnVEsY7} zFe%am!o7$xt`~LAYv$EcP#rrz!He%7}E5(jET z4#U!#s4!926CHKc{g13GL+95L9B>IM02{LRLG4yII`qR z1+$i=8midQ3{_MxiX~`EIXNmJatwJHt+)!{sjHx=Xx)n`D@({5gT@eZfTmVfD^5|C zIgM}skir~e4;T~y?f6VZX;`*O=maQv852ED#ta#uz}OK9 z?m#9*GpeYoV4H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Q=`R8s p=1(`YVOiJOsmv{BiLYrqa`>WJslRYS{FJ7dqq(nN+#!wT{{uAnb?5*9 literal 0 HcmV?d00001 diff --git a/mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.4.0/System.Collections.Immutable.dll.REMOVED.git-id b/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/System.Collections.Immutable.dll.REMOVED.git-id similarity index 100% rename from mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.4.0/System.Collections.Immutable.dll.REMOVED.git-id rename to external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/System.Collections.Immutable.dll.REMOVED.git-id diff --git a/mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.4.0/System.Memory.dll.REMOVED.git-id b/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/System.Memory.dll.REMOVED.git-id similarity index 100% rename from mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.4.0/System.Memory.dll.REMOVED.git-id rename to external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/System.Memory.dll.REMOVED.git-id diff --git a/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/System.Numerics.Vectors.dll.REMOVED.git-id b/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/System.Numerics.Vectors.dll.REMOVED.git-id new file mode 100644 index 0000000000..06dc54564a --- /dev/null +++ b/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/System.Numerics.Vectors.dll.REMOVED.git-id @@ -0,0 +1 @@ +ce46d5be85cdee1a3c0ef5bc22c8e1772d0d0d98 \ No newline at end of file diff --git a/mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.4.0/System.Reflection.Metadata.dll.REMOVED.git-id b/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/System.Reflection.Metadata.dll.REMOVED.git-id similarity index 100% rename from mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.4.0/System.Reflection.Metadata.dll.REMOVED.git-id rename to external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/System.Reflection.Metadata.dll.REMOVED.git-id diff --git a/mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.4.0/System.Runtime.CompilerServices.Unsafe.dll b/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/System.Runtime.CompilerServices.Unsafe.dll similarity index 100% rename from mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.4.0/System.Runtime.CompilerServices.Unsafe.dll rename to external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/System.Runtime.CompilerServices.Unsafe.dll diff --git a/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/System.Text.Encoding.CodePages.dll.REMOVED.git-id b/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/System.Text.Encoding.CodePages.dll.REMOVED.git-id new file mode 100644 index 0000000000..de61fbee4d --- /dev/null +++ b/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/System.Text.Encoding.CodePages.dll.REMOVED.git-id @@ -0,0 +1 @@ +d0f7adf9ece445759892e6848e1aad45189be58e \ No newline at end of file diff --git a/mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.4.0/System.Threading.Tasks.Extensions.dll b/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/System.Threading.Tasks.Extensions.dll similarity index 100% rename from mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.4.0/System.Threading.Tasks.Extensions.dll rename to external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/System.Threading.Tasks.Extensions.dll diff --git a/mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.4.0/VBCSCompiler.exe b/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/VBCSCompiler.exe similarity index 91% rename from mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.4.0/VBCSCompiler.exe rename to external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/VBCSCompiler.exe index f81d471dd2fc6562f9785bd239f83c5647cd7cd0..d0c3890260b8e212094508fdd318629dec6e0916 100644 GIT binary patch delta 3932 zcmcImc|28J+urL;WXg~z^AL)2+WRjS!3GTQo1)`BGs-df)51%e^#Jq4cZfn?9e{ENE6_%7Zmloh?h+p^Ju0ycGa)$ z(_0j@;%}saeifn@*~5#f=Sd@b>mxA5i$?RNAXJ2cFc1cr?m?qbJ?VNheb^I%Rs)C! zHiDJBo2tOdjtavhM4v>1X)pzXHUY>;mqaDOL=Ps5fe;aWbb$y{wEw^1`L=2xQ-FOn z8Axkq<78j_m~2_UR@0~AwOcb7@0z$^=U~fIQl&lYAt~}Y6%DSC4i(<1wtgbF|3XZ{ zT37Fe8Q1vg|lG10Hg9IrMI z61#nmG?A^kr9bMAFNoJO-Cq1*oa&Qht046HRA|t}JERTl#Un`SSf4O4o1&Rn!=Q^c zM|f@8z)JZy+B^IkUE(7JCVOT-3aTU(tG?sw>wuG(Wm5nP-5HgF@cf4);0$D_5RBd= z2!Zs`o`%{>jl!qHAQZ5vCP1I=X{Z;B+7N0BLI5)5ttW#ufXa6y zg988^>vVw$PAO6iWneH6%vB2}EL#_288aga1TeW=H7^u$=PBud9b2SUw|A<}+dJl; z*QtNSZLB3pq#XEjHluC&L!tVma1Fs+u4pvOC17DL_ERnv127mVT?hg@&YR@eJ7pY> zU3%qU2cNG8wgC3EqPX^NMPH^qvtqL@)JHd^_NPfI{-nige>-YDGSWf4dOn&Rxb3U_ z;*nU#^5-6hO>Ofhci(ZMJKZ~!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FR-oSgA@=$K zPdk+`t&ZU9Z>IUFYx7aU%;-!>dR2l4XX)8o)bH%OG`79(Y@NMT_ME(wL2PHpU1_FD z5}7DOhEWSYZ*w{v_46jNxEz7f&cEvMU&0R(ZAdI>2SBiFe!VQ9BYpMGLhHpE-VzgE z@i%P}dE6y`oMwL<=2&eW0W;qITbx315gENO<2lTD1~V!#LjUP*vq~L6BK`kuKm;Qc zI_%;%?YvU{hs72ZdtBP79hZ3Y|NUe+u@Djhp`glX%ll+AkIQTE!p%b@lw9iit$-j8kmsikN!Ztd`>YuBYOKGrnR;Cv%UG|hI zX+zs%O78`~eWTb?)Y0{+Bdqwu{CD9@WoE{25vl?kQ~X|%pBf(TOFhsQFw@6tN%VPL zm`c{|e9GHU7=oK@4G`^^_+2(~iJWpSM(*OoB~Q19p1zG=M;o1<;#{SQr+pR|h+*Y~ zUCA5VuY_OLl}n`NXpZYrY`;BR{=ms{y mtD9OQ8odL$o4eHR2Cv4Zywa=Ce%|XM(#qv$5ub!a(EkA>g?&N* diff --git a/mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.4.0/VBCSCompiler.exe.config b/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/VBCSCompiler.exe.config similarity index 94% rename from mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.4.0/VBCSCompiler.exe.config rename to external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/VBCSCompiler.exe.config index 87112a8741..0715c1248c 100644 --- a/mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.4.0/VBCSCompiler.exe.config +++ b/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/VBCSCompiler.exe.config @@ -11,19 +11,19 @@ - + - + - + diff --git a/mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.4.0/csc.exe b/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/csc.exe similarity index 87% rename from mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.4.0/csc.exe rename to external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/csc.exe index 18255eb37236175c04b0146558287c469c474e74..346a320519c8faf6e940fabe709fe865351791f4 100644 GIT binary patch delta 3822 zcmb_ec|276`#)!9jO~(rlzo?JI5TFU5Romi6H-}56tb6;F=NRZnn|(_(X@~lQp%QF zsU)FW)+ozWlp>U+-*IpE{_gkw_5I^}&g*xApf%lC4tZC+_bx5Un1tE!XOPM)UUmR+yu@FO6XxP)oK#kQ8dDE)Eo8LaLPzVh_^AMV>7>NuGNr5RMT$5x(#+nY#-)v}v-OX(Z!=F+ zQ51iIb7Mb2m@S1H-wIkby?@#FBay^?UiBHlzW^eEdo$ty5BKp+QxHP}Ao$h>@PIx% zl3{z}A#zn}4M7?Sh9Ce3_yANO67YsexIc)0(r_C@01Nm51eoCmkN`cv7Y-)?{%|t< zA6`FrO@`M*cuj(zjd>%FH_W2IQ5#+o97Ta+$#4_|+W>6y0U%()e8W`(NnD<~BOpA5 z)@P#>LRDZl0s%k_6>l`ZRrJkh{2Dn8yLiH8db*Evvml9fY|kgzAIDQ%DtmmQ zO!k(|d){-UxZV#+qswOOJl9U|ld8JJYv6pDdO=mid@l za)WQFHW+C=An;}1oVc1~45m{-!R*J){M9inTK|JKyYPk6?h|4b0~bz5irA+MXVNQe zzY+a>Wj;+6fU3K_Ec@yu<(*5Ce>33N&pyGW-K*_muiXE!6P;eGQc-Lpr+q4CIVPy2y#5Y@t2n zR*(fA2Vr3VB`B_H8|WK;EaI4dq@qhqo+LXyLO!xcjcqVwFcV6>NA$sO~-$P`b(?_qW zI;Dof0D{-yPYc~|l?(IGV!*1?^^3cUlcK-P$>)-cXFgK6dNVV1kqd@2NaB<(^~uf@ zJKpnG)dr)TX58DxdHV)r6d&1k1!tATwhi9Un~+|zU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db+-Tj diff --git a/mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.4.0/csc.exe.config b/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/csc.exe.config similarity index 95% rename from mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.4.0/csc.exe.config rename to external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/csc.exe.config index f416b30f1c..910bda51fc 100644 --- a/mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.4.0/csc.exe.config +++ b/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/csc.exe.config @@ -11,13 +11,13 @@ - + - + diff --git a/mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.4.0/csc.rsp b/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/csc.rsp similarity index 100% rename from mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.4.0/csc.rsp rename to external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/csc.rsp diff --git a/mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.4.0/csi.exe b/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/csi.exe similarity index 62% rename from mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.4.0/csi.exe rename to external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/csi.exe index 143e6ad0da81c3796c9660d82bd598c155e1f4e3..6c9a8cce4069a1f533568dcb23f708b63dfe2969 100644 GIT binary patch delta 3533 zcmZuz2{=^i8$V}^v5qEtml(2T8E3{U$dnKX*_TMyGGoaW4M{X+ZXrvSk(9j>$|#1E zO6DTbdgCcgw#Zl_DobVQKkn`RpZ|03|D5xE-~0aF-|s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tW}*U*vn^4~AMCO*zl+Do6&WFwzAXY>BfT-3bT z^s1eC`pYb1QUkB&0g^Qfu=iwq@=Gpx#2^edk<%(>*j9Q(UHFmd&=zGG?&}&&B^5Po zUDcZU5QrgfddqpQrM~2U#JL*68srM=PjC_Mro{}*lo|=TmKV~)^6s#~5#_lD#b;uU z$CQbM>xnv3LnZopm0u zMr(oI6Pb5ENIre6ldQ{kYSz&@@oLbT)a-V{=s}5?sA-j!>UQ%@RX2@W_o9$#4o<}y fQv>n-OZn$}Kel~^7IYjR1 - + - + - + - + diff --git a/mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.4.0/csi.rsp b/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/csi.rsp similarity index 100% rename from mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.4.0/csi.rsp rename to external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/csi.rsp diff --git a/mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.4.0/vbc.exe b/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/vbc.exe similarity index 87% rename from mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.4.0/vbc.exe rename to external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/vbc.exe index 8abbe37a965bbb66ea424ccb439e84a872c1d0a2..2f326a8c2dbc995227e3d9f45304307b12bb32fa 100644 GIT binary patch delta 3816 zcmb_edpuNY+g@vCj8kmK*ddG@!m!qu8C2vLiX3uC4mD1jwj_r{Wz5Ja6h@KbP?{v6 zQQnkOy)ilFw1pyRh>)U^F}H_pJ3?_iB8Mp07ox zC1RFOUHF`yVvWB35lA04Mg=Rew}b!k0C^Y#p32C$=D8c>Ve22|)e}+OKkfBs@5;gZ zyQ#XG=>>{xyDUplH6MbP4@u9POz_i(A)*hN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dBW!4$K??*2Gs{sEc*TAU-&k`8M znr}D`PhaWFWvEQ57d}qpYZyJSIT2|fdENU(^<UYT*K*l;C>?77aT`=6W2g9hMi2b`R;I9Yy2 zM5>rNH-EZARXhG2$?3RZVIF&noU!<&2_@Z9eDc> z#-nz&$t$UNOVEdR63jPf)z+=!;?)qjWic()Km2=FQKk-6Poi3(6r|>d85SLA(rtQt zpt?Dr;=aG}BZ-VgF`kPxs`GZmr`8NTDJduCieKov`;_j}{?;y2f%-lEb`aVB!iI=_ z`f5P3SDYhkUa_l|=2)*iXnMu**1c8C;>aSBIP&~Q%KQg8 Cp_vr` diff --git a/mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.4.0/vbc.exe.config b/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/vbc.exe.config similarity index 95% rename from mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.4.0/vbc.exe.config rename to external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/vbc.exe.config index a1fd66199e..78ae05085a 100644 --- a/mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.4.0/vbc.exe.config +++ b/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/vbc.exe.config @@ -11,13 +11,13 @@ - + - + diff --git a/mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.4.0/vbc.rsp b/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/vbc.rsp similarity index 100% rename from mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.4.0/vbc.rsp rename to external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/vbc.rsp diff --git a/ikvm-native/Makefile.in b/ikvm-native/Makefile.in index 20c3661629..5fd984e910 100644 --- a/ikvm-native/Makefile.in +++ b/ikvm-native/Makefile.in @@ -292,6 +292,7 @@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTERP_CFLAGS = @INTERP_CFLAGS@ INTL = @INTL@ INVARIANT_AOT_OPTIONS = @INVARIANT_AOT_OPTIONS@ JEMALLOC_AUTOCONF_FLAGS = @JEMALLOC_AUTOCONF_FLAGS@ @@ -568,25 +569,22 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/os.Plo@am__quote@ .c.o: -@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ -@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: -@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ -@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: -@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ -@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ -@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< diff --git a/llvm/Makefile.am b/llvm/Makefile.am index 82c5e8454a..ffaa2b84e7 100644 --- a/llvm/Makefile.am +++ b/llvm/Makefile.am @@ -19,6 +19,12 @@ llvm_extra_libs= endif endif +if INTERNAL_LLVM_ASSERTS +ENABLE_ASSERTS=On +else +ENABLE_ASSERTS=Off +endif + if INTERNAL_LLVM all-local: configure-llvm build-llvm install-llvm llvm_config.mk diff --git a/llvm/Makefile.in b/llvm/Makefile.in index 6322397da0..ddb2245e79 100644 --- a/llvm/Makefile.in +++ b/llvm/Makefile.in @@ -215,6 +215,7 @@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTERP_CFLAGS = @INTERP_CFLAGS@ INTL = @INTL@ INVARIANT_AOT_OPTIONS = @INVARIANT_AOT_OPTIONS@ JEMALLOC_AUTOCONF_FLAGS = @JEMALLOC_AUTOCONF_FLAGS@ @@ -409,6 +410,8 @@ EXTRA_DIST = build.mk build_llvm_config.sh @ENABLE_LLVM_TRUE@@HAVE_STATIC_ZLIB_FALSE@@HAVE_SYS_ZLIB_FALSE@llvm_extra_libs = @ENABLE_LLVM_TRUE@@HAVE_STATIC_ZLIB_FALSE@@HAVE_SYS_ZLIB_TRUE@llvm_extra_libs = -lz @ENABLE_LLVM_TRUE@@HAVE_STATIC_ZLIB_TRUE@llvm_extra_libs = $(STATIC_ZLIB_PATH) +@ENABLE_LLVM_TRUE@@INTERNAL_LLVM_ASSERTS_FALSE@ENABLE_ASSERTS = Off +@ENABLE_LLVM_TRUE@@INTERNAL_LLVM_ASSERTS_TRUE@ENABLE_ASSERTS = On @TARGET_WASM_FALSE@LLVM_TARGET = @TARGET_WASM_TRUE@LLVM_TARGET = wasm32 @@ -669,7 +672,7 @@ $(LLVM_BUILD)/$(if $(NINJA),build.ninja,Makefile): $(abs_top_srcdir)/external/ll -DLLVM_TOOLS_TO_BUILD="opt;llc;llvm-config;llvm-dis" \ -DLLVM_TARGETS_TO_BUILD="X86;ARM;AArch64" \ $(EXTRA_LLVM_ARGS) \ - -DLLVM_ENABLE_ASSERTIONS=$(if $(INTERNAL_LLVM_ASSERTS),On,Off) \ + -DLLVM_ENABLE_ASSERTIONS=$(ENABLE_ASSERTS) \ -DLLVM_ENABLE_LIBXML2=Off \ -DHAVE_FUTIMENS=0 \ $(LLVM_CMAKE_ARGS) \ diff --git a/llvm/build.mk b/llvm/build.mk index 25e45f7217..481854bf9f 100644 --- a/llvm/build.mk +++ b/llvm/build.mk @@ -29,7 +29,7 @@ $(LLVM_BUILD)/$(if $(NINJA),build.ninja,Makefile): $(abs_top_srcdir)/external/ll -DLLVM_TOOLS_TO_BUILD="opt;llc;llvm-config;llvm-dis" \ -DLLVM_TARGETS_TO_BUILD="X86;ARM;AArch64" \ $(EXTRA_LLVM_ARGS) \ - -DLLVM_ENABLE_ASSERTIONS=$(if $(INTERNAL_LLVM_ASSERTS),On,Off) \ + -DLLVM_ENABLE_ASSERTIONS=$(ENABLE_ASSERTS) \ -DLLVM_ENABLE_LIBXML2=Off \ -DHAVE_FUTIMENS=0 \ $(LLVM_CMAKE_ARGS) \ diff --git a/m4/Makefile.in b/m4/Makefile.in index aa2a17f482..1708fbb195 100644 --- a/m4/Makefile.in +++ b/m4/Makefile.in @@ -214,6 +214,7 @@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTERP_CFLAGS = @INTERP_CFLAGS@ INTL = @INTL@ INVARIANT_AOT_OPTIONS = @INVARIANT_AOT_OPTIONS@ JEMALLOC_AUTOCONF_FLAGS = @JEMALLOC_AUTOCONF_FLAGS@ diff --git a/man/Makefile.in b/man/Makefile.in index beb7314761..7bb7e85586 100644 --- a/man/Makefile.in +++ b/man/Makefile.in @@ -246,6 +246,7 @@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTERP_CFLAGS = @INTERP_CFLAGS@ INTL = @INTL@ INVARIANT_AOT_OPTIONS = @INVARIANT_AOT_OPTIONS@ JEMALLOC_AUTOCONF_FLAGS = @JEMALLOC_AUTOCONF_FLAGS@ diff --git a/man/mono.1 b/man/mono.1 index 5d2fb53e79..eea8a3b36d 100644 --- a/man/mono.1 +++ b/man/mono.1 @@ -246,6 +246,14 @@ program that comes with Mono, and calling it like this: .fi .TP +.I mcpu=[native o generic] +cpu=native allows AOT mode to use all instructions current CPU supports, e.g. AVX2, SSE42, etc. +Default value is 'generic'. +.I mattr=[cpu feature] +Allows AOT code generator to use specified CPU features where possible including `System.Runtime.Intrinsics.*'. +E.g. `mattr=+avx2,mattr=-lzcnt' unlocks sse1-4.2, avx1-2 and disables lzcnt. +It's useful for cross-compilation or when it's not possible to use `-mcpu=native' (which enables +all cpu feature current cpu has). .I llvm-outfile=[filename] Gives the path for the temporary LLVM bitcode file created during AOT. .I dedup @@ -555,6 +563,10 @@ generation engine to JIT or AOT compile. .Sp For more information, consult: http://www.mono-project.com/docs/advanced/mono-llvm/ .TP +\fB--ffast-math\fR +This flag allows Mono and LLVM to apply aggressive floating point optimizations. +Can break IEEE754 compliance. +.TP \fB--nollvm\fR When using a Mono that has been compiled with LLVM support, it forces Mono to fallback to its JIT engine and not use the LLVM backend. @@ -1842,6 +1854,11 @@ This option will suspend the program when an unhandled exception occurs. \fBthread-dump-dir=DIR\fR Use DIR for storage thread dumps created by SIGQUIT. .TP +\fBweak-memory-model\fR +Don't enforce the CLR memory model on platforms with weak memory models. This can introduce +random crashes in some rare cases, for multithreaded environments. This can be used for a +performance boost on applications that are single threaded. +.TP \fBverbose-gdb\fR Make gdb output on native crashes more verbose. .ne diff --git a/mcs/build/README.makefiles.md b/mcs/build/README.makefiles.md index 974a6472bb..f351241797 100644 --- a/mcs/build/README.makefiles.md +++ b/mcs/build/README.makefiles.md @@ -693,8 +693,6 @@ compiler so that csc can be used. Always use `/r:foo.dll`, not `/r:foo`. Windows requires the former. -Use `/r:$(corlib)`, not `/r:corlib`. - If you're writing shell script code as part of a make rule, remember that Windows has command-line length limits. So something like diff --git a/mcs/build/README.platforms b/mcs/build/README.platforms index 70b7d5a670..af827aef4b 100644 --- a/mcs/build/README.platforms +++ b/mcs/build/README.platforms @@ -11,14 +11,6 @@ PLATFORM_RUNTIME The system runtime for executing CLR programs. Blank on Win32, probably $(RUNTIME) (the Mono runtime) on everything else. -PLATFORM_CORLIB - The name of the system's corlib. 'mscorlib.dll' - -PLATFORM_MAKE_CORLIB_CMP - Define it to something nonempty if corlib_cmp.dll should be built - on this platform. Only should be done if the platform provides its - own non-Mono runtime that we can compare corlibs with. - PLATFORM_TWEAK_CORLIB_SOURCES A command to futz around with the sources to mscorlib.dll. See linux.make and win32.make for examples. Should be 'cat' unless you know what you're diff --git a/mcs/build/common/Consts.cs b/mcs/build/common/Consts.cs index 1c9003c719..faeddf33e2 100644 --- a/mcs/build/common/Consts.cs +++ b/mcs/build/common/Consts.cs @@ -30,7 +30,7 @@ static partial class Consts { - public const string MonoCorlibVersion = "A144A63D-652C-4CCF-A9EE-8E5A091547F1"; + public const string MonoCorlibVersion = "ABB721D6-116A-4555-B4FD-9248146D2051"; } #if !NETCORE @@ -41,7 +41,7 @@ static partial class Consts // Use these assembly version constants to make code more maintainable. // - public const string MonoVersion = "6.6.0.161"; + public const string MonoVersion = "6.8.0.73"; public const string MonoCompany = "Mono development team"; public const string MonoProduct = "Mono Common Language Infrastructure"; public const string MonoCopyright = "(c) Various Mono authors"; diff --git a/mcs/build/config-default.make b/mcs/build/config-default.make index 0c05bd4c05..11b1b35456 100644 --- a/mcs/build/config-default.make +++ b/mcs/build/config-default.make @@ -21,7 +21,6 @@ TEST_HARNESS = $(topdir)/class/lib/$(PROFILE_DIRECTORY)/$(PARENT_PROFILE)nunit-l PLATFORM_DEBUG_FLAGS = /debug:portable # Workaround for https://bugzilla.xamarin.com/show_bug.cgi?id=59967 MCS_FLAGS = /features:peverify-compat /langversion:latest -MBAS_FLAGS = -debug LIBRARY_FLAGS = ifndef CFLAGS CFLAGS = -g -O2 @@ -41,7 +40,6 @@ TEST_RUNTIME = MONO_PATH="$(TEST_MONO_PATH)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH # keep track of the default value DEFAULT_MCS_FLAGS := $(MCS_FLAGS) -DEFAULT_MBAS_FLAGS := $(MBAS_FLAGS) DEFAULT_PROFILE := net_4_x # You shouldn't need to set these but might on a diff --git a/mcs/build/deps/linux_net_4_x_Mono.Posix_test.dll.sources b/mcs/build/deps/linux_net_4_x_Mono.Posix_test.dll.sources index 602a67d3d8..2396bef645 100644 --- a/mcs/build/deps/linux_net_4_x_Mono.Posix_test.dll.sources +++ b/mcs/build/deps/linux_net_4_x_Mono.Posix_test.dll.sources @@ -1,4 +1,5 @@ Test/Mono.Unix.Android/TestHelper.cs +Test/Mono.Unix.Native/OFDLockTest.cs Test/Mono.Unix.Native/RealTimeSignumTests.cs Test/Mono.Unix.Native/SocketTest.cs Test/Mono.Unix.Native/StdlibTest.cs diff --git a/mcs/build/platforms/linux.make b/mcs/build/platforms/linux.make index 647c782b35..18ab0d24e6 100644 --- a/mcs/build/platforms/linux.make +++ b/mcs/build/platforms/linux.make @@ -5,20 +5,12 @@ PLATFORM_MCS_FLAGS = PLATFORM_RUNTIME = $(RUNTIME) -PLATFORM_CORLIB = mscorlib.dll PLATFORM_TEST_HARNESS_EXCLUDES = -EXTERNAL_MCS = mcs -EXTERNAL_MBAS = mbas EXTERNAL_RUNTIME = mono -#ILDISASM = monodis -ILDISASM = false PLATFORM_PATH_SEPARATOR = : -# Define this if this ever will work on Linux -# PLATFORM_MAKE_CORLIB_CMP = yes - # This is for changing / to \ on windows PLATFORM_CHANGE_SEPARATOR_CMD = cat @@ -27,12 +19,3 @@ hidden_suffix = platform-check: @: -# I tried this but apparently Make's version strings aren't that -# ... consistent between releases. Whatever. -# -# @if ! $(MAKE) --version |grep '^GNU Make version 3' 1>/dev/null 2>&1 ; then \ -# echo "*** You need to build MCS with GNU make. Try \`gmake'" ; \ -# exit 1 ; \ -# fi - -PLATFORM_LINUX=1 diff --git a/mcs/build/platforms/macos.make b/mcs/build/platforms/macos.make index 0b272b8b1d..fecba3bb0b 100644 --- a/mcs/build/platforms/macos.make +++ b/mcs/build/platforms/macos.make @@ -5,20 +5,12 @@ PLATFORM_MCS_FLAGS = PLATFORM_RUNTIME = $(RUNTIME) -PLATFORM_CORLIB = mscorlib.dll PLATFORM_TEST_HARNESS_EXCLUDES = NotOnMac -EXTERNAL_MCS = mcs -EXTERNAL_MBAS = mbas EXTERNAL_RUNTIME = mono -#ILDISASM = monodis -ILDISASM = false PLATFORM_PATH_SEPARATOR = : -# Define this if this ever will work on Linux -# PLATFORM_MAKE_CORLIB_CMP = yes - # This is for changing / to \ on windows PLATFORM_CHANGE_SEPARATOR_CMD = cat @@ -27,12 +19,3 @@ hidden_suffix = platform-check: @: -# I tried this but apparently Make's version strings aren't that -# ... consistent between releases. Whatever. -# -# @if ! $(MAKE) --version |grep '^GNU Make version 3' 1>/dev/null 2>&1 ; then \ -# echo "*** You need to build MCS with GNU make. Try \`gmake'" ; \ -# exit 1 ; \ -# fi - -PLATFORM_MACOS=1 diff --git a/mcs/build/platforms/unix.make b/mcs/build/platforms/unix.make index bcd8405509..643058bc70 100644 --- a/mcs/build/platforms/unix.make +++ b/mcs/build/platforms/unix.make @@ -5,20 +5,12 @@ PLATFORM_MCS_FLAGS = PLATFORM_RUNTIME = $(RUNTIME) -PLATFORM_CORLIB = mscorlib.dll PLATFORM_TEST_HARNESS_EXCLUDES = -EXTERNAL_MCS = mcs -EXTERNAL_MBAS = mbas EXTERNAL_RUNTIME = mono -#ILDISASM = monodis -ILDISASM = false PLATFORM_PATH_SEPARATOR = : -# Define this if this ever will work on Unix -# PLATFORM_MAKE_CORLIB_CMP = yes - # This is for changing / to \ on windows PLATFORM_CHANGE_SEPARATOR_CMD = cat @@ -27,13 +19,3 @@ hidden_suffix = platform-check: @: -# I tried this but apparently Make's version strings aren't that -# ... consistent between releases. Whatever. -# -# @if ! $(MAKE) --version |grep '^GNU Make version 3' 1>/dev/null 2>&1 ; then \ -# echo "*** You need to build MCS with GNU make. Try \`gmake'" ; \ -# exit 1 ; \ -# fi - - -PLATFORM_UNIX=1 diff --git a/mcs/build/platforms/win32.make b/mcs/build/platforms/win32.make index 9d920a3bf9..dd969b5152 100644 --- a/mcs/build/platforms/win32.make +++ b/mcs/build/platforms/win32.make @@ -5,21 +5,10 @@ PLATFORM_MCS_FLAGS = PLATFORM_RUNTIME = -PLATFORM_CORLIB = mscorlib.dll PLATFORM_TEST_HARNESS_EXCLUDES = NotOnWindows -EXTERNAL_MCS = mcs -EXTERNAL_MBAS = vbc.exe EXTERNAL_RUNTIME = mono -# Disabled since it needs the SDK -#ILDISASM = ildasm.exe /test - -#ILDISASM = monodis.bat -## Gross hack -ILDISASM = $(topdir)/../mono/mono/dis/monodis - -PLATFORM_MAKE_CORLIB_CMP = yes PLATFORM_CHANGE_SEPARATOR_CMD=tr '/' '\\\\' PLATFORM_PATH_SEPARATOR = ; @@ -31,4 +20,3 @@ hidden_suffix = .tmp platform-check: @: -PLATFORM_WIN32=1 diff --git a/mcs/build/profiles/net_4_x.make b/mcs/build/profiles/net_4_x.make index 0748f6e347..d4cc75e8f1 100644 --- a/mcs/build/profiles/net_4_x.make +++ b/mcs/build/profiles/net_4_x.make @@ -7,8 +7,6 @@ MCS = $(BOOTSTRAP_MCS) PLATFORMS = macos linux win32 unix -# nuttzing! - profile-check: @: @@ -21,7 +19,7 @@ XBUILD_VERSION = 4.0 ENFORCE_LIBRARY_WARN_AS_ERROR = yes -ifdef PLATFORM_MACOS +ifeq ($(HOST_PLATFORM),macos) MONO_FEATURE_APPLETLS=1 ENABLE_GSS=1 endif diff --git a/mcs/build/rules.make b/mcs/build/rules.make index a77f1d11cc..e57a636ef4 100644 --- a/mcs/build/rules.make +++ b/mcs/build/rules.make @@ -42,11 +42,9 @@ COMPILER_SERVER_ARGS = $(if $(findstring 1,$(ENABLE_COMPILER_SERVER)),$(COMPILER CSC_LOCATION = $(if $(findstring 1,$(ENABLE_COMPILER_SERVER)),$(SERVER_CSC_LOCATION),$(STANDALONE_CSC_LOCATION)) USE_MCS_FLAGS = $(COMPILER_SERVER_ARGS) /codepage:$(CODEPAGE) /nologo /noconfig /deterministic $(LOCAL_MCS_FLAGS) $(PLATFORM_MCS_FLAGS) $(PROFILE_MCS_FLAGS) $(MCS_FLAGS) -USE_MBAS_FLAGS = $(COMPILER_SERVER_ARGS) /codepage:$(CODEPAGE) $(LOCAL_MBAS_FLAGS) $(PLATFORM_MBAS_FLAGS) $(PROFILE_MBAS_FLAGS) $(MBAS_FLAGS) USE_CFLAGS = $(LOCAL_CFLAGS) $(CFLAGS) $(CPPFLAGS) CSCOMPILE = $(Q_MCS) $(MCS) $(USE_MCS_FLAGS) -CSC_RUNTIME_FLAGS = --aot-path=$(abspath $(topdir)/class/lib/$(BUILD_TOOLS_PROFILE)) --gc-params=nursery-size=64m --clr-memory-model -BASCOMPILE = $(MBAS) $(USE_MBAS_FLAGS) +CSC_RUNTIME_FLAGS = --aot-path=$(abspath $(topdir)/class/lib/$(BUILD_TOOLS_PROFILE)) --gc-params=nursery-size=64m CCOMPILE = $(CC) $(USE_CFLAGS) BOOT_COMPILE = $(Q_MCS) $(BOOTSTRAP_MCS) $(USE_MCS_FLAGS) INSTALL = $(SHELL) $(topdir)/../mono/install-sh @@ -54,7 +52,6 @@ INSTALL_DATA = $(INSTALL) -c -m 644 INSTALL_BIN = $(INSTALL) -c -m 755 INSTALL_LIB = $(INSTALL_BIN) MKINSTALLDIRS = $(SHELL) $(topdir)/mkinstalldirs -INTERNAL_MBAS = $(RUNTIME) $(RUNTIME_FLAGS) $(topdir)/mbas/mbas.exe INTERNAL_CSC_LOCATION = $(CSC_LOCATION) # Using CSC_SDK_PATH_DISABLED for sanity check that all references have path specified @@ -100,9 +97,6 @@ include $(topdir)/build/platforms/$(BUILD_PLATFORM).make PROFILE_PLATFORM = $(if $(PLATFORMS),$(if $(filter $(PLATFORMS),$(HOST_PLATFORM)),$(HOST_PLATFORM),$(error Unknown platform "$(HOST_PLATFORM)" for profile "$(PROFILE)"))) PROFILE_DIRECTORY = $(PROFILE)$(if $(PROFILE_PLATFORM),-$(PROFILE_PLATFORM)) -ifdef PLATFORM_CORLIB -corlib = $(PLATFORM_CORLIB) -endif # Useful ifeq ($(PLATFORM_RUNTIME),$(RUNTIME)) diff --git a/mcs/build/start-compiler-server.sh b/mcs/build/start-compiler-server.sh index b7397e9df8..8c74d4c24b 100755 --- a/mcs/build/start-compiler-server.sh +++ b/mcs/build/start-compiler-server.sh @@ -6,7 +6,7 @@ set -u set -e if [ -s "$VBCS_LOCATION" ]; then - CMD="RoslynCommandLineLogFile=$2 $VBCS_RUNTIME --clr-memory-model --gc-params=nursery-size=64m \"$VBCS_LOCATION\" -pipename:$3 &" + CMD="RoslynCommandLineLogFile=$2 $VBCS_RUNTIME --gc-params=nursery-size=64m \"$VBCS_LOCATION\" -pipename:$3 &" echo "Log location set to $2" touch "$2" echo "cd $1; bash -c \"$CMD\"" diff --git a/mcs/class/Mono.Debugger.Soft/Test/dtest-app.cs b/mcs/class/Mono.Debugger.Soft/Test/dtest-app.cs index ae307971ac..be5e6c7f3c 100644 --- a/mcs/class/Mono.Debugger.Soft/Test/dtest-app.cs +++ b/mcs/class/Mono.Debugger.Soft/Test/dtest-app.cs @@ -604,6 +604,7 @@ public class Tests : TestsBase, ITest2 if_property_stepping(); fixed_size_array(); test_new_exception_filter(); + test_async_debug_generics(); return 3; } @@ -903,6 +904,17 @@ public class Tests : TestsBase, ITest2 } } + [MethodImplAttribute (MethodImplOptions.NoInlining)] + public static void test_async_debug_generics () { + ExecuteAsync_Broken().Wait (); + } + + async static Task ExecuteAsync_Broken() + { + await Task.Delay(2); + return default; + } + [MethodImplAttribute (MethodImplOptions.NoInlining)] public static void inspect_enumerator_in_generic_struct() { TestEnumeratorInsideGenericStruct generic_struct = new TestEnumeratorInsideGenericStruct(new KeyValuePair("0", "f1")); diff --git a/mcs/class/Mono.Debugger.Soft/Test/dtest.cs.REMOVED.git-id b/mcs/class/Mono.Debugger.Soft/Test/dtest.cs.REMOVED.git-id index af3a522b72..7e13bd2d0c 100644 --- a/mcs/class/Mono.Debugger.Soft/Test/dtest.cs.REMOVED.git-id +++ b/mcs/class/Mono.Debugger.Soft/Test/dtest.cs.REMOVED.git-id @@ -1 +1 @@ -2bccbb137b170a01de42625d65883e868c508913 \ No newline at end of file +52da50a45dbfc7510ab393f4a443ee0caae46b7b \ No newline at end of file diff --git a/mcs/class/Mono.Management/Mono.Attach/VirtualMachine.cs b/mcs/class/Mono.Management/Mono.Attach/VirtualMachine.cs index 7e57265a62..ab2371364b 100644 --- a/mcs/class/Mono.Management/Mono.Attach/VirtualMachine.cs +++ b/mcs/class/Mono.Management/Mono.Attach/VirtualMachine.cs @@ -139,6 +139,7 @@ namespace Mono.Attach else { writer.Write ((sbyte)PrimitiveType.PRIM_TYPE_STRING); writer.Write (s); + writer.Write ((byte)0); } } diff --git a/mcs/class/Mono.Messaging.RabbitMQ/Mono.Messaging.RabbitMQ/RabbitMQMessagingProvider.cs b/mcs/class/Mono.Messaging.RabbitMQ/Mono.Messaging.RabbitMQ/RabbitMQMessagingProvider.cs index 41644a3505..020520969a 100644 --- a/mcs/class/Mono.Messaging.RabbitMQ/Mono.Messaging.RabbitMQ/RabbitMQMessagingProvider.cs +++ b/mcs/class/Mono.Messaging.RabbitMQ/Mono.Messaging.RabbitMQ/RabbitMQMessagingProvider.cs @@ -43,33 +43,16 @@ namespace Mono.Messaging.RabbitMQ { public class RabbitMQMessagingProvider : IMessagingProvider { private int txCounter = 0; - private readonly uint localIp; + private readonly Guid localId; private readonly MessagingContextPool contextPool; public RabbitMQMessagingProvider () { - localIp = GetLocalIP (); + localId = Guid.NewGuid (); contextPool = new MessagingContextPool (new MessageFactory (this), CreateConnection); } - private static uint GetLocalIP () - { - String strHostName = Dns.GetHostName (); - IPHostEntry ipEntry = Dns.GetHostByName (strHostName); - foreach (IPAddress ip in ipEntry.AddressList) { - if (AddressFamily.InterNetwork == ip.AddressFamily) { - byte[] addr = ip.GetAddressBytes (); - uint localIP = 0; - for (int i = 0; i < 4 && i < addr.Length; i++) { - localIP += (uint) (addr[i] << 8 * (3 - i)); - } - return localIP; - } - } - return 0; - } - public IMessage CreateMessage () { return new MessageBase (); @@ -78,7 +61,7 @@ namespace Mono.Messaging.RabbitMQ { public IMessageQueueTransaction CreateMessageQueueTransaction () { Interlocked.Increment (ref txCounter); - string txId = localIp.ToString () + txCounter.ToString (); + string txId = localId.ToString () + "_" + txCounter.ToString (); return new RabbitMQMessageQueueTransaction (txId, contextPool); } diff --git a/mcs/class/Mono.Posix/Mono.Posix_test.dll.sources b/mcs/class/Mono.Posix/Mono.Posix_test.dll.sources index a2f290f865..5aee212abe 100644 --- a/mcs/class/Mono.Posix/Mono.Posix_test.dll.sources +++ b/mcs/class/Mono.Posix/Mono.Posix_test.dll.sources @@ -9,6 +9,7 @@ Mono.Unix/UnixPathTest.cs Mono.Unix/UnixSignalTest.cs Mono.Unix/UnixUserTest.cs Mono.Unix.Android/TestHelper.cs +Mono.Unix.Native/OFDLockTest.cs Mono.Unix.Native/RealTimeSignumTests.cs Mono.Unix.Native/SocketTest.cs Mono.Unix.Native/StdlibTest.cs diff --git a/mcs/class/Mono.Posix/Mono.Unix.Native/Syscall.cs.REMOVED.git-id b/mcs/class/Mono.Posix/Mono.Unix.Native/Syscall.cs.REMOVED.git-id index 9c04627c13..238bec5482 100644 --- a/mcs/class/Mono.Posix/Mono.Unix.Native/Syscall.cs.REMOVED.git-id +++ b/mcs/class/Mono.Posix/Mono.Unix.Native/Syscall.cs.REMOVED.git-id @@ -1 +1 @@ -6cc67dda4b894bb3ef0dffdc49ae8e816665c012 \ No newline at end of file +c9eb750d22227382cc4989053d328c0e7fc0bc79 \ No newline at end of file diff --git a/mcs/class/Mono.Posix/Test/Mono.Unix.Native/OFDLockTest.cs b/mcs/class/Mono.Posix/Test/Mono.Unix.Native/OFDLockTest.cs new file mode 100644 index 0000000000..44f45fe018 --- /dev/null +++ b/mcs/class/Mono.Posix/Test/Mono.Unix.Native/OFDLockTest.cs @@ -0,0 +1,133 @@ +// +// Tests for FcntlCommand.F_OFD_{GETLK,SETLK,SETLKW} +// +// Authors: +// Steffen Kiess (kiess@ki4.de) +// +// Copyright (C) 2019 Steffen Kiess +// + +using System; +using System.IO; +using System.Net; +using System.Net.Sockets; +using System.Runtime.InteropServices; + +using Mono.Unix; +using Mono.Unix.Native; + +using NUnit.Framework; + +namespace MonoTests.Mono.Unix.Native +{ + [TestFixture, Category ("NotDotNet"), Category ("NotOnWindows"), Category ("NotOnMac")] + public class OFDLockTest { + + string TempFolder; + + [SetUp] + public void SetUp () + { + TempFolder = Path.Combine (Path.GetTempPath (), this.GetType ().FullName); + + if (Directory.Exists (TempFolder)) + Directory.Delete (TempFolder, true); + + Directory.CreateDirectory (TempFolder); + } + + [TearDown] + public void TearDown() + { + if (Directory.Exists (TempFolder)) + Directory.Delete (TempFolder, true); + } + + [Test] + public void TestOFDLock () + { + int fd1 = Syscall.open (TempFolder + "/testfile", OpenFlags.O_RDWR | OpenFlags.O_CREAT | OpenFlags.O_EXCL, FilePermissions.DEFFILEMODE); + if (fd1 < 0) + UnixMarshal.ThrowExceptionForLastError (); + int fd2 = Syscall.open (TempFolder + "/testfile", OpenFlags.O_RDWR); + if (fd2 < 0) + UnixMarshal.ThrowExceptionForLastError (); + int fd3 = Syscall.open (TempFolder + "/testfile", OpenFlags.O_RDWR); + if (fd3 < 0) + UnixMarshal.ThrowExceptionForLastError (); + + // Get read lock for first 100 bytes on fd1 + var flock1 = new Flock { + l_type = LockType.F_RDLCK, + l_whence = SeekFlags.SEEK_SET, + l_start = 0, + l_len = 100, + }; + if (Syscall.fcntl (fd1, FcntlCommand.F_OFD_SETLKW, ref flock1) < 0) { + // Old kernels and non-linux systems should return EINVAL + if (Stdlib.GetLastError () == Errno.EINVAL) + Assert.Ignore ("F_OFD_SETLKW does not seem to be supported."); + UnixMarshal.ThrowExceptionForLastError (); + } + + // Get read lock for first 100 bytes on fd2 + var flock2 = new Flock { + l_type = LockType.F_RDLCK, + l_whence = SeekFlags.SEEK_SET, + l_start = 0, + l_len = 100, + }; + if (Syscall.fcntl (fd2, FcntlCommand.F_OFD_SETLK, ref flock2) < 0) + UnixMarshal.ThrowExceptionForLastError (); + + // Get write lock for remaining bytes on fd1 + var flock3 = new Flock { + l_type = LockType.F_WRLCK, + l_whence = SeekFlags.SEEK_SET, + l_start = 100, + l_len = 0, + }; + if (Syscall.fcntl (fd1, FcntlCommand.F_OFD_SETLK, ref flock3) < 0) + UnixMarshal.ThrowExceptionForLastError (); + + // Close fd3, should not release lock + if (Syscall.close (fd3) < 0) + UnixMarshal.ThrowExceptionForLastError (); + + // Get lock status for byte 150 from fd2 + var flock4 = new Flock { + l_type = LockType.F_RDLCK, + l_whence = SeekFlags.SEEK_SET, + l_start = 150, + l_len = 1, + }; + if (Syscall.fcntl (fd2, FcntlCommand.F_OFD_GETLK, ref flock4) < 0) + UnixMarshal.ThrowExceptionForLastError (); + // There should be a conflicting write lock + Assert.AreEqual (LockType.F_WRLCK, flock4.l_type); + + // Get write byte 0 on fd1, should fail with EAGAIN + var flock5 = new Flock { + l_type = LockType.F_WRLCK, + l_whence = SeekFlags.SEEK_SET, + l_start = 0, + l_len = 1, + }; + var res = Syscall.fcntl (fd1, FcntlCommand.F_OFD_SETLK, ref flock5); + Assert.AreEqual (-1, res); + Assert.AreEqual (Errno.EAGAIN, Stdlib.GetLastError ()); + + if (Syscall.close (fd1) < 0) + UnixMarshal.ThrowExceptionForLastError (); + if (Syscall.close (fd2) < 0) + UnixMarshal.ThrowExceptionForLastError (); + } + } +} + +// vim: noexpandtab +// Local Variables: +// tab-width: 4 +// c-basic-offset: 4 +// indent-tabs-mode: t +// End: diff --git a/mcs/class/Mono.Profiler.Log/Mono.Profiler.Log/LogEnums.cs b/mcs/class/Mono.Profiler.Log/Mono.Profiler.Log/LogEnums.cs index e5535f9fb8..91a58963d3 100644 --- a/mcs/class/Mono.Profiler.Log/Mono.Profiler.Log/LogEnums.cs +++ b/mcs/class/Mono.Profiler.Log/Mono.Profiler.Log/LogEnums.cs @@ -172,6 +172,7 @@ namespace Mono.Profiler.Log { Debugger = 13, Handle = 14, Ephemeron = 15, + Toggleref = 16, } // mono/profiler/log.h : MonoProfilerMonitorEvent diff --git a/mcs/class/Mono.Security/Mono.Security.Interface/CertificateValidationHelper.cs b/mcs/class/Mono.Security/Mono.Security.Interface/CertificateValidationHelper.cs index 9b55f6cc91..a40f5e6433 100644 --- a/mcs/class/Mono.Security/Mono.Security.Interface/CertificateValidationHelper.cs +++ b/mcs/class/Mono.Security/Mono.Security.Interface/CertificateValidationHelper.cs @@ -96,14 +96,6 @@ namespace Mono.Security.Interface ValidationResult ValidateCertificate (string targetHost, bool serverMode, X509CertificateCollection certificates); } - internal interface ICertificateValidator2 : ICertificateValidator - { - /* - * Internal use only. - */ - ValidationResult ValidateCertificate (string targetHost, bool serverMode, X509Certificate leaf, X509Chain chain); - } - public static class CertificateValidationHelper { const string SecurityLibrary = "/System/Library/Frameworks/Security.framework/Security"; diff --git a/mcs/class/Mono.Security/Mono.Security.Interface/IMonoSslStream.cs b/mcs/class/Mono.Security/Mono.Security.Interface/IMonoSslStream.cs index fd8b7da41b..84989904fa 100644 --- a/mcs/class/Mono.Security/Mono.Security.Interface/IMonoSslStream.cs +++ b/mcs/class/Mono.Security/Mono.Security.Interface/IMonoSslStream.cs @@ -42,59 +42,11 @@ namespace Mono.Security.Interface get; } - void AuthenticateAsClient (string targetHost); - - void AuthenticateAsClient (string targetHost, X509CertificateCollection clientCertificates, bool checkCertificateRevocation); - - void AuthenticateAsClient (string targetHost, X509CertificateCollection clientCertificates, SSA.SslProtocols enabledSslProtocols, bool checkCertificateRevocation); - - IAsyncResult BeginAuthenticateAsClient (string targetHost, AsyncCallback asyncCallback, object asyncState); - - IAsyncResult BeginAuthenticateAsClient (string targetHost, X509CertificateCollection clientCertificates, bool checkCertificateRevocation, AsyncCallback asyncCallback, object asyncState); - - IAsyncResult BeginAuthenticateAsClient (string targetHost, X509CertificateCollection clientCertificates, SSA.SslProtocols enabledSslProtocols, bool checkCertificateRevocation, AsyncCallback asyncCallback, object asyncState); - - void EndAuthenticateAsClient (IAsyncResult asyncResult); - - void AuthenticateAsServer (X509Certificate serverCertificate); - - void AuthenticateAsServer (X509Certificate serverCertificate, bool clientCertificateRequired, bool checkCertificateRevocation); - - void AuthenticateAsServer (X509Certificate serverCertificate, bool clientCertificateRequired, SSA.SslProtocols enabledSslProtocols, bool checkCertificateRevocation); - - IAsyncResult BeginAuthenticateAsServer (X509Certificate serverCertificate, AsyncCallback asyncCallback, object asyncState); - - IAsyncResult BeginAuthenticateAsServer (X509Certificate serverCertificate, bool clientCertificateRequired, bool checkCertificateRevocation, AsyncCallback asyncCallback, object asyncState); - - IAsyncResult BeginAuthenticateAsServer (X509Certificate serverCertificate, bool clientCertificateRequired, SSA.SslProtocols enabledSslProtocols, bool checkCertificateRevocation, AsyncCallback asyncCallback, object asyncState); - - void EndAuthenticateAsServer (IAsyncResult asyncResult); - - Task AuthenticateAsClientAsync (string targetHost); - - Task AuthenticateAsClientAsync (string targetHost, X509CertificateCollection clientCertificates, bool checkCertificateRevocation); - Task AuthenticateAsClientAsync (string targetHost, X509CertificateCollection clientCertificates, SSA.SslProtocols enabledSslProtocols, bool checkCertificateRevocation); - Task AuthenticateAsServerAsync (X509Certificate serverCertificate); - - Task AuthenticateAsServerAsync (X509Certificate serverCertificate, bool clientCertificateRequired, bool checkCertificateRevocation); - Task AuthenticateAsServerAsync (X509Certificate serverCertificate, bool clientCertificateRequired, SSA.SslProtocols enabledSslProtocols, bool checkCertificateRevocation); - int Read (byte[] buffer, int offset, int count); - - void Write (byte[] buffer); - - void Write (byte[] buffer, int offset, int count); - - IAsyncResult BeginRead (byte[] buffer, int offset, int count, AsyncCallback asyncCallback, object asyncState); - - int EndRead (IAsyncResult asyncResult); - - IAsyncResult BeginWrite (byte[] buffer, int offset, int count, AsyncCallback asyncCallback, object asyncState); - - void EndWrite (IAsyncResult asyncResult); + Task ReadAsync (byte[] buffer, int offset, int count, CancellationToken cancellationToken); Task WriteAsync (byte[] buffer, int offset, int count, CancellationToken cancellationToken); @@ -215,12 +167,5 @@ namespace Mono.Security.Interface Task RenegotiateAsync (CancellationToken cancellationToken); } - - interface IMonoSslStream2 : IMonoSslStream - { - Task AuthenticateAsClientAsync (IMonoSslClientAuthenticationOptions sslClientAuthenticationOptions, CancellationToken cancellationToken); - - Task AuthenticateAsServerAsync (IMonoSslServerAuthenticationOptions sslServerAuthenticationOptions, CancellationToken cancellationToken); - } } diff --git a/mcs/class/Mono.Security/Mono.Security.Interface/MonoTlsProvider.cs b/mcs/class/Mono.Security/Mono.Security.Interface/MonoTlsProvider.cs index 2f040e0f61..f61ccbacbb 100644 --- a/mcs/class/Mono.Security/Mono.Security.Interface/MonoTlsProvider.cs +++ b/mcs/class/Mono.Security/Mono.Security.Interface/MonoTlsProvider.cs @@ -121,10 +121,6 @@ namespace Mono.Security.Interface Stream innerStream, bool leaveInnerStreamOpen, MonoTlsSettings settings = null); - internal abstract IMonoSslStream CreateSslStreamInternal ( - SslStream sslStream, Stream innerStream, bool leaveInnerStreamOpen, - MonoTlsSettings settings); - #endregion #region Native Certificate Implementation @@ -133,34 +129,6 @@ namespace Mono.Security.Interface get { return false; } } - internal virtual X509Certificate2Impl GetNativeCertificate ( - byte[] data, string password, X509KeyStorageFlags flags) - { - throw new InvalidOperationException (); - } - - internal virtual X509Certificate2Impl GetNativeCertificate ( - X509Certificate certificate) - { - throw new InvalidOperationException (); - } - -#endregion - -#region Certificate Validation - /* - * If @serverMode is true, then we're a server and want to validate a certificate - * that we received from a client. - * - * On OS X and Mobile, the @chain will be initialized with the @certificates, but not actually built. - * - * Returns `true` if certificate validation has been performed and `false` to invoke the - * default system validator. - */ - internal abstract bool ValidateCertificate ( - ICertificateValidator2 validator, string targetHost, bool serverMode, - X509CertificateCollection certificates, bool wantsChain, ref X509Chain chain, - ref MonoSslPolicyErrors errors, ref int status11); #endregion #region Misc diff --git a/mcs/class/Mono.Security/Mono.Security.Interface/MonoTlsProviderFactory.cs b/mcs/class/Mono.Security/Mono.Security.Interface/MonoTlsProviderFactory.cs index 5df54ac6ee..5776e39974 100644 --- a/mcs/class/Mono.Security/Mono.Security.Interface/MonoTlsProviderFactory.cs +++ b/mcs/class/Mono.Security/Mono.Security.Interface/MonoTlsProviderFactory.cs @@ -183,9 +183,10 @@ namespace Mono.Security.Interface * - 1: everything up until May 2018 * - 2: the new ServicePointScheduler changes have landed * - 3: full support for Client Certificates + * - 4: Legacy TLS Removal * */ - internal const int InternalVersion = 3; + internal const int InternalVersion = 4; #endregion } diff --git a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsClientCertificate.cs b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsClientCertificate.cs deleted file mode 100644 index 49e2d85f4c..0000000000 --- a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsClientCertificate.cs +++ /dev/null @@ -1,149 +0,0 @@ -// Transport Security Layer (TLS) -// Copyright (c) 2003-2004 Carlos Guzman Alvarez - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Security.Cryptography.X509Certificates; - -using Mono.Security.Protocol.Tls; - -namespace Mono.Security.Protocol.Tls.Handshake.Client -{ - internal class TlsClientCertificate : HandshakeMessage - { - private bool clientCertSelected; - private X509Certificate clientCert; - - #region Constructors - - public TlsClientCertificate(Context context) - : base(context, HandshakeType.Certificate) - { - } - - #endregion - - #region Properties - - public X509Certificate ClientCertificate { - get { - if (!clientCertSelected) - { - GetClientCertificate (); - clientCertSelected = true; - } - return clientCert; - } - } - - #endregion - - #region Methods - - public override void Update() - { - base.Update(); - this.Reset(); - } - - #endregion - - #region Protected Methods - - private void GetClientCertificate () - { -// TODO: Client certificate selection is unfinished - ClientContext context = (ClientContext)this.Context; - - // note: the server may ask for mutual authentication - // but may not require it (i.e. it can be optional). - if (context.ClientSettings.Certificates != null && - context.ClientSettings.Certificates.Count > 0) - { - clientCert = context.SslStream.RaiseClientCertificateSelection( - this.Context.ClientSettings.Certificates, - new X509Certificate(this.Context.ServerSettings.Certificates[0].RawData), - this.Context.ClientSettings.TargetHost, - null); - // Note: the application code can raise it's - // own exception to stop the connection too. - } - - // Update the selected client certificate - context.ClientSettings.ClientCertificate = clientCert; - } - - private void SendCertificates () - { - TlsStream chain = new TlsStream (); - - X509Certificate currentCert = this.ClientCertificate; - while (currentCert != null) { - byte[] rawCert = currentCert.GetRawCertData (); - chain.WriteInt24 (rawCert.Length); - chain.Write(rawCert); - currentCert = FindParentCertificate (currentCert); - } - this.WriteInt24 ((int)chain.Length); - this.Write (chain.ToArray ()); - } - - protected override void ProcessAsSsl3() - { - if (this.ClientCertificate != null) { - SendCertificates (); - } else { - // an Alert warning for NoCertificate (41) - // should be sent from here - but that would - // break the current message handling - } - } - - protected override void ProcessAsTls1() - { - if (this.ClientCertificate != null) { - SendCertificates (); - } else { - // return message with empty certificate (see 7.4.6 in RFC2246) - this.WriteInt24 (0); - } - } - - private X509Certificate FindParentCertificate (X509Certificate cert) - { - #pragma warning disable 618 - // This certificate is the root certificate - if (cert.GetName () == cert.GetIssuerName ()) - return null; - - foreach (X509Certificate certificate in this.Context.ClientSettings.Certificates) { - if (certificate.GetName () == cert.GetIssuerName ()) - return certificate; - } - return null; - #pragma warning restore 618 - } - - #endregion - } -} diff --git a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsClientCertificateVerify.cs b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsClientCertificateVerify.cs deleted file mode 100644 index bfa689d2ea..0000000000 --- a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsClientCertificateVerify.cs +++ /dev/null @@ -1,220 +0,0 @@ -// Transport Security Layer (TLS) -// Copyright (c) 2003-2004 Carlos Guzman Alvarez - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Security.Cryptography.X509Certificates; - -using System.Security.Cryptography; -using Mono.Security.Cryptography; - -namespace Mono.Security.Protocol.Tls.Handshake.Client -{ - internal class TlsClientCertificateVerify : HandshakeMessage - { - #region Constructors - - public TlsClientCertificateVerify(Context context) - : base(context, HandshakeType.CertificateVerify) - { - } - - #endregion - - #region Methods - - public override void Update() - { - base.Update(); - this.Reset(); - } - - #endregion - - #region Protected Methods - - protected override void ProcessAsSsl3() - { - AsymmetricAlgorithm privKey = null; - ClientContext context = (ClientContext)this.Context; - - privKey = context.SslStream.RaisePrivateKeySelection( - context.ClientSettings.ClientCertificate, - context.ClientSettings.TargetHost); - - if (privKey == null) - { - throw new TlsException(AlertDescription.UserCancelled, "Client certificate Private Key unavailable."); - } - else - { - SslHandshakeHash hash = new SslHandshakeHash(context.MasterSecret); - hash.TransformFinalBlock( - context.HandshakeMessages.ToArray(), - 0, - (int)context.HandshakeMessages.Length); - - // CreateSignature uses ((RSA)privKey).DecryptValue which is not implemented - // in RSACryptoServiceProvider. Other implementations likely implement DecryptValue - // so we will try the CreateSignature method. - byte[] signature = null; - if (!(privKey is RSACryptoServiceProvider)) - { - try - { - signature = hash.CreateSignature((RSA)privKey); - } - catch (NotImplementedException) - { } - } - // If DecryptValue is not implemented, then try to export the private - // key and let the RSAManaged class do the DecryptValue - if (signature == null) - { - // RSAManaged of the selected ClientCertificate - // (at this moment the first one) - RSA rsa = this.getClientCertRSA((RSA)privKey); - - // Write message - signature = hash.CreateSignature(rsa); - } - this.Write((short)signature.Length); - this.Write(signature, 0, signature.Length); - } - } - - protected override void ProcessAsTls1() - { - AsymmetricAlgorithm privKey = null; - ClientContext context = (ClientContext)this.Context; - - privKey = context.SslStream.RaisePrivateKeySelection( - context.ClientSettings.ClientCertificate, - context.ClientSettings.TargetHost); - - if (privKey == null) - { - throw new TlsException(AlertDescription.UserCancelled, "Client certificate Private Key unavailable."); - } - else - { - // Compute handshake messages hash - MD5SHA1 hash = new MD5SHA1(); - hash.ComputeHash( - context.HandshakeMessages.ToArray(), - 0, - (int)context.HandshakeMessages.Length); - - // CreateSignature uses ((RSA)privKey).DecryptValue which is not implemented - // in RSACryptoServiceProvider. Other implementations likely implement DecryptValue - // so we will try the CreateSignature method. - byte[] signature = null; - if (!(privKey is RSACryptoServiceProvider)) - { - try - { - signature = hash.CreateSignature((RSA)privKey); - } - catch (NotImplementedException) - { } - } - // If DecryptValue is not implemented, then try to export the private - // key and let the RSAManaged class do the DecryptValue - if (signature == null) - { - // RSAManaged of the selected ClientCertificate - // (at this moment the first one) - RSA rsa = this.getClientCertRSA((RSA)privKey); - - // Write message - signature = hash.CreateSignature(rsa); - } - this.Write((short)signature.Length); - this.Write(signature, 0, signature.Length); - } - } - - #endregion - - #region Private methods - - private RSA getClientCertRSA(RSA privKey) - { - RSAParameters rsaParams = new RSAParameters(); - RSAParameters privateParams = privKey.ExportParameters(true); - - // for RSA m_publickey contains 2 ASN.1 integers - // the modulus and the public exponent - ASN1 pubkey = new ASN1 (this.Context.ClientSettings.Certificates[0].GetPublicKey()); - ASN1 modulus = pubkey [0]; - if ((modulus == null) || (modulus.Tag != 0x02)) - { - return null; - } - ASN1 exponent = pubkey [1]; - if (exponent.Tag != 0x02) - { - return null; - } - - rsaParams.Modulus = this.getUnsignedBigInteger(modulus.Value); - rsaParams.Exponent = exponent.Value; - - // Set private key parameters - rsaParams.D = privateParams.D; - rsaParams.DP = privateParams.DP; - rsaParams.DQ = privateParams.DQ; - rsaParams.InverseQ = privateParams.InverseQ; - rsaParams.P = privateParams.P; - rsaParams.Q = privateParams.Q; - - // BUG: MS BCL 1.0 can't import a key which - // isn't the same size as the one present in - // the container. - int keySize = (rsaParams.Modulus.Length << 3); - RSAManaged rsa = new RSAManaged(keySize); - rsa.ImportParameters (rsaParams); - - return (RSA)rsa; - } - - private byte[] getUnsignedBigInteger(byte[] integer) - { - if (integer [0] == 0x00) - { - // this first byte is added so we're sure it's an unsigned integer - // however we can't feed it into RSAParameters or DSAParameters - int length = integer.Length - 1; - byte[] uinteger = new byte [length]; - Buffer.BlockCopy (integer, 1, uinteger, 0, length); - return uinteger; - } - else - { - return integer; - } - } - - #endregion - } -} diff --git a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsClientFinished.cs b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsClientFinished.cs deleted file mode 100644 index 9f2e1ae2fb..0000000000 --- a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsClientFinished.cs +++ /dev/null @@ -1,87 +0,0 @@ -// Transport Security Layer (TLS) -// Copyright (c) 2003-2004 Carlos Guzman Alvarez -// Copyright (C) 2006 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Security.Cryptography; - -using Mono.Security.Cryptography; - -namespace Mono.Security.Protocol.Tls.Handshake.Client -{ - internal class TlsClientFinished : HandshakeMessage - { - #region Constructors - - public TlsClientFinished(Context context) - : base(context, HandshakeType.Finished) - { - } - - #endregion - - #region Methods - - public override void Update() - { - base.Update(); - this.Reset(); - } - - #endregion - - #region Protected Methods - - static private byte[] Ssl3Marker = new byte [4] { 0x43, 0x4c, 0x4e, 0x54 }; - - protected override void ProcessAsSsl3() - { - // Compute handshake messages hashes - HashAlgorithm hash = new SslHandshakeHash(this.Context.MasterSecret); - - byte[] data = this.Context.HandshakeMessages.ToArray (); - hash.TransformBlock (data, 0, data.Length, data, 0); - hash.TransformBlock (Ssl3Marker, 0, Ssl3Marker.Length, Ssl3Marker, 0); - // hack to avoid memory allocation - hash.TransformFinalBlock (CipherSuite.EmptyArray, 0, 0); - - this.Write (hash.Hash); - } - - protected override void ProcessAsTls1() - { - // Compute handshake messages hash - HashAlgorithm hash = new MD5SHA1(); - - // note: we could call HashAlgorithm.ComputeHash(Stream) but that would allocate (on Mono) - // a 4096 bytes buffer to process the hash - which is bigger than HandshakeMessages - byte[] data = this.Context.HandshakeMessages.ToArray (); - byte[] digest = hash.ComputeHash (data, 0, data.Length); - - // Write message - Write(this.Context.Write.Cipher.PRF(this.Context.MasterSecret, "client finished", digest, 12)); - } - - #endregion - } -} diff --git a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsClientHello.cs b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsClientHello.cs deleted file mode 100644 index 42ca34523a..0000000000 --- a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsClientHello.cs +++ /dev/null @@ -1,139 +0,0 @@ -// Transport Security Layer (TLS) -// Copyright (c) 2003-2004 Carlos Guzman Alvarez - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Net; -using System.Security.Cryptography; - -namespace Mono.Security.Protocol.Tls.Handshake.Client -{ - internal class TlsClientHello : HandshakeMessage - { - #region Fields - - private byte[] random; - - #endregion - - #region Constructors - - public TlsClientHello(Context context) - : base(context, HandshakeType.ClientHello) - { - } - - #endregion - - #region Methods - - public override void Update() - { - ClientContext context = (ClientContext)this.Context; - - base.Update(); - - context.ClientRandom = random; - context.ClientHelloProtocol = this.Context.Protocol; - - random = null; - } - - #endregion - - #region Protected Methods - - protected override void ProcessAsSsl3() - { - // Client Version - this.Write(this.Context.Protocol); - - // Random bytes - Unix time + Radom bytes [28] - TlsStream clientRandom = new TlsStream(); - clientRandom.Write(this.Context.GetUnixTime()); - clientRandom.Write(this.Context.GetSecureRandomBytes(28)); - this.random = clientRandom.ToArray(); - clientRandom.Reset(); - - this.Write(this.random); - - // Session id - // Check if we have a cache session we could reuse - this.Context.SessionId = ClientSessionCache.FromHost (this.Context.ClientSettings.TargetHost); - if (this.Context.SessionId != null) - { - this.Write((byte)this.Context.SessionId.Length); - if (this.Context.SessionId.Length > 0) - { - this.Write(this.Context.SessionId); - } - } - else - { - this.Write((byte)0); - } - - // Write length of Cipher suites - this.Write((short)(this.Context.SupportedCiphers.Count*2)); - - // Write Supported Cipher suites - for (int i = 0; i < this.Context.SupportedCiphers.Count; i++) - { - this.Write((short)this.Context.SupportedCiphers[i].Code); - } - - // Compression methods length - this.Write((byte)1); - - // Compression methods ( 0 = none ) - this.Write((byte)this.Context.CompressionMethod); - } - - protected override void ProcessAsTls1() - { - ProcessAsSsl3 (); - - // If applicable add the "server_name" extension to the hello message - // http://www.ietf.org/rfc/rfc3546.txt - string host = Context.ClientSettings.TargetHost; - // Our TargetHost might be an address (not a host *name*) - see bug #8553 - // RFC3546 -> Literal IPv4 and IPv6 addresses are not permitted in "HostName". - IPAddress addr; - if (IPAddress.TryParse (host, out addr)) - return; - - TlsStream extensions = new TlsStream (); - byte[] server_name = System.Text.Encoding.UTF8.GetBytes (host); - extensions.Write ((short) 0x0000); // ExtensionType: server_name (0) - extensions.Write ((short) (server_name.Length + 5)); // ServerNameList (length) - extensions.Write ((short) (server_name.Length + 3)); // ServerName (length) - extensions.Write ((byte) 0x00); // NameType: host_name (0) - extensions.Write ((short) server_name.Length); // HostName (length) - extensions.Write (server_name); // HostName (UTF8) - this.Write ((short) extensions.Length); - this.Write (extensions.ToArray ()); - } - - #endregion - } -} \ No newline at end of file diff --git a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsClientKeyExchange.cs b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsClientKeyExchange.cs deleted file mode 100644 index 3534d83317..0000000000 --- a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsClientKeyExchange.cs +++ /dev/null @@ -1,98 +0,0 @@ -// Transport Security Layer (TLS) -// Copyright (c) 2003-2004 Carlos Guzman Alvarez -// Copyright (C) 2006 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Security.Cryptography; - -using Mono.Security.Cryptography; - -namespace Mono.Security.Protocol.Tls.Handshake.Client -{ - internal class TlsClientKeyExchange : HandshakeMessage - { - #region Constructors - - public TlsClientKeyExchange (Context context) : - base(context, HandshakeType.ClientKeyExchange) - { - } - - #endregion - - #region Protected Methods - - protected override void ProcessAsSsl3() - { - // a large chunk of code is common to both SSL3 and TLS1 - // SSL3 doesn't send the length of the buffer - ProcessCommon (false); - } - - protected override void ProcessAsTls1() - { - // a large chunk of code is common to both SSL3 and TLS1 - // TLS1 does send the length of the buffer - ProcessCommon (true); - } - - public void ProcessCommon (bool sendLength) - { - // Compute pre master secret - byte[] preMasterSecret = this.Context.Negotiating.Cipher.CreatePremasterSecret (); - - // Create a new RSA key - RSA rsa = null; - if (this.Context.ServerSettings.ServerKeyExchange) - { - // this is the case for "exportable" ciphers - rsa = new RSAManaged (); - rsa.ImportParameters (this.Context.ServerSettings.RsaParameters); - } - else - { - rsa = this.Context.ServerSettings.CertificateRSA; - } - - // Encrypt premaster_sercret - RSAPKCS1KeyExchangeFormatter formatter = new RSAPKCS1KeyExchangeFormatter (rsa); - - // Write the preMasterSecret encrypted - byte[] buffer = formatter.CreateKeyExchange (preMasterSecret); - if (sendLength) - this.Write ((short) buffer.Length); - this.Write (buffer); - - // Create master secret - this.Context.Negotiating.Cipher.ComputeMasterSecret (preMasterSecret); - - // Create keys - this.Context.Negotiating.Cipher.ComputeKeys (); - - // Clear resources - rsa.Clear (); - } - - #endregion - } -} diff --git a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerCertificate.cs b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerCertificate.cs deleted file mode 100644 index a96b415ef0..0000000000 --- a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerCertificate.cs +++ /dev/null @@ -1,450 +0,0 @@ -// Transport Security Layer (TLS) -// Copyright (c) 2003-2004 Carlos Guzman Alvarez -// Copyright (C) 2004, 2006-2010 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Net; -using System.Collections; -using System.Globalization; -using System.Text.RegularExpressions; -using System.Security.Cryptography; -using X509Cert = System.Security.Cryptography.X509Certificates; - -using Mono.Security.X509; -using Mono.Security.X509.Extensions; - -using Mono.Security.Interface; - -namespace Mono.Security.Protocol.Tls.Handshake.Client -{ - internal class TlsServerCertificate : HandshakeMessage - { - #region Fields - - private X509CertificateCollection certificates; - - #endregion - - #region Constructors - - public TlsServerCertificate(Context context, byte[] buffer) - : base(context, HandshakeType.Certificate, buffer) - { - } - - #endregion - - #region Methods - - public override void Update() - { - base.Update(); - this.Context.ServerSettings.Certificates = this.certificates; - this.Context.ServerSettings.UpdateCertificateRSA(); - } - - #endregion - - #region Protected Methods - - protected override void ProcessAsSsl3() - { - this.ProcessAsTls1(); - } - - protected override void ProcessAsTls1() - { - this.certificates = new X509CertificateCollection(); - - int readed = 0; - int length = this.ReadInt24(); - - while (readed < length) - { - // Read certificate length - int certLength = ReadInt24(); - - // Increment readed - readed += 3; - - if (certLength > 0) - { - // Read certificate data - byte[] buffer = this.ReadBytes(certLength); - - // Create a new X509 Certificate - X509Certificate certificate = new X509Certificate(buffer); - certificates.Add(certificate); - - readed += certLength; - - DebugHelper.WriteLine( - String.Format("Server Certificate {0}", certificates.Count), - buffer); - } - } - - this.validateCertificates(certificates); - } - - #endregion - - #region Private Methods - - // Note: this method only works for RSA certificates - // DH certificates requires some changes - does anyone use one ? - private bool checkCertificateUsage (X509Certificate cert) - { - ClientContext context = (ClientContext)this.Context; - - // certificate extensions are required for this - // we "must" accept older certificates without proofs - if (cert.Version < 3) - return true; - - KeyUsages ku = KeyUsages.none; - switch (context.Negotiating.Cipher.ExchangeAlgorithmType) - { - case ExchangeAlgorithmType.RsaSign: - ku = KeyUsages.digitalSignature; - break; - case ExchangeAlgorithmType.RsaKeyX: - ku = KeyUsages.keyEncipherment; - break; - case ExchangeAlgorithmType.DiffieHellman: - ku = KeyUsages.keyAgreement; - break; - case ExchangeAlgorithmType.Fortezza: - return false; // unsupported certificate type - } - - KeyUsageExtension kux = null; - ExtendedKeyUsageExtension eku = null; - - X509Extension xtn = cert.Extensions ["2.5.29.15"]; - if (xtn != null) - kux = new KeyUsageExtension (xtn); - - xtn = cert.Extensions ["2.5.29.37"]; - if (xtn != null) - eku = new ExtendedKeyUsageExtension (xtn); - - if ((kux != null) && (eku != null)) - { - // RFC3280 states that when both KeyUsageExtension and - // ExtendedKeyUsageExtension are present then BOTH should - // be valid - if (!kux.Support (ku)) - return false; - return (eku.KeyPurpose.Contains ("1.3.6.1.5.5.7.3.1") || - eku.KeyPurpose.Contains ("2.16.840.1.113730.4.1")); - } - else if (kux != null) - { - return kux.Support (ku); - } - else if (eku != null) - { - // Server Authentication (1.3.6.1.5.5.7.3.1) or - // Netscape Server Gated Crypto (2.16.840.1.113730.4) - return (eku.KeyPurpose.Contains ("1.3.6.1.5.5.7.3.1") || - eku.KeyPurpose.Contains ("2.16.840.1.113730.4.1")); - } - - // last chance - try with older (deprecated) Netscape extensions - xtn = cert.Extensions ["2.16.840.1.113730.1.1"]; - if (xtn != null) - { - NetscapeCertTypeExtension ct = new NetscapeCertTypeExtension (xtn); - return ct.Support (NetscapeCertTypeExtension.CertTypes.SslServer); - } - - // if the CN=host (checked later) then we assume this is meant for SSL/TLS - // e.g. the new smtp.gmail.com certificate - return true; - } - - private void validateCertificates(X509CertificateCollection certificates) - { - ClientContext context = (ClientContext)this.Context; - AlertDescription description = AlertDescription.BadCertificate; - -#if INSIDE_SYSTEM - // This helps the linker to remove a lot of validation code that will never be used since - // System.dll will, for OSX and iOS, uses the operating system X.509 certificate validations - RemoteValidation (context, description); -#else - if (context.SslStream.HaveRemoteValidation2Callback) - RemoteValidation (context, description); - else - LocalValidation (context, description); -#endif - } - - void RemoteValidation (ClientContext context, AlertDescription description) - { - ValidationResult res = context.SslStream.RaiseServerCertificateValidation2 (certificates); - if (res.Trusted) - return; - - long error = res.ErrorCode; - switch (error) { - case 0x800B0101: - description = AlertDescription.CertificateExpired; - break; - case 0x800B010A: - description = AlertDescription.UnknownCA; - break; - case 0x800B0109: - description = AlertDescription.UnknownCA; - break; - default: - description = AlertDescription.CertificateUnknown; - break; - } - string err = String.Format ("Invalid certificate received from server. Error code: 0x{0:x}", error); - throw new TlsException (description, err); - } - - void LocalValidation (ClientContext context, AlertDescription description) - { - // the leaf is the web server certificate - X509Certificate leaf = certificates [0]; - X509Cert.X509Certificate cert = new X509Cert.X509Certificate (leaf.RawData); - - ArrayList errors = new ArrayList(); - - // SSL specific check - not all certificates can be - // used to server-side SSL some rules applies after - // all ;-) - if (!checkCertificateUsage (leaf)) - { - // WinError.h CERT_E_PURPOSE 0x800B0106 - errors.Add ((int)-2146762490); - } - - // SSL specific check - does the certificate match - // the host ? - if (!checkServerIdentity (leaf)) - { - // WinError.h CERT_E_CN_NO_MATCH 0x800B010F - errors.Add ((int)-2146762481); - } - - // Note: building and verifying a chain can take much time - // so we do it last (letting simple things fails first) - - // Note: In TLS the certificates MUST be in order (and - // optionally include the root certificate) so we're not - // building the chain using LoadCertificate (it's faster) - - // Note: IIS doesn't seem to send the whole certificate chain - // but only the server certificate :-( it's assuming that you - // already have this chain installed on your computer. duh! - // http://groups.google.ca/groups?q=IIS+server+certificate+chain&hl=en&lr=&ie=UTF-8&oe=UTF-8&selm=85058s%24avd%241%40nnrp1.deja.com&rnum=3 - - // we must remove the leaf certificate from the chain - X509CertificateCollection chain = new X509CertificateCollection (certificates); - chain.Remove (leaf); - X509Chain verify = new X509Chain (chain); - - bool result = false; - - try - { - result = verify.Build (leaf); - } - catch (Exception) - { - result = false; - } - - if (!result) - { - switch (verify.Status) - { - case X509ChainStatusFlags.InvalidBasicConstraints: - // WinError.h TRUST_E_BASIC_CONSTRAINTS 0x80096019 - errors.Add ((int)-2146869223); - break; - - case X509ChainStatusFlags.NotSignatureValid: - // WinError.h TRUST_E_BAD_DIGEST 0x80096010 - errors.Add ((int)-2146869232); - break; - - case X509ChainStatusFlags.NotTimeNested: - // WinError.h CERT_E_VALIDITYPERIODNESTING 0x800B0102 - errors.Add ((int)-2146762494); - break; - - case X509ChainStatusFlags.NotTimeValid: - // WinError.h CERT_E_EXPIRED 0x800B0101 - description = AlertDescription.CertificateExpired; - errors.Add ((int)-2146762495); - break; - - case X509ChainStatusFlags.PartialChain: - // WinError.h CERT_E_CHAINING 0x800B010A - description = AlertDescription.UnknownCA; - errors.Add ((int)-2146762486); - break; - - case X509ChainStatusFlags.UntrustedRoot: - // WinError.h CERT_E_UNTRUSTEDROOT 0x800B0109 - description = AlertDescription.UnknownCA; - errors.Add ((int)-2146762487); - break; - - default: - // unknown error - description = AlertDescription.CertificateUnknown; - errors.Add ((int)verify.Status); - break; - } - } - - int[] certificateErrors = (int[])errors.ToArray(typeof(int)); - - if (!context.SslStream.RaiseServerCertificateValidation( - cert, - certificateErrors)) - { - throw new TlsException( - description, - "Invalid certificate received from server."); - } - } - - // RFC2818 - HTTP Over TLS, Section 3.1 - // http://www.ietf.org/rfc/rfc2818.txt - // - // 1. if present MUST use subjectAltName dNSName as identity - // 1.1. if multiples entries a match of any one is acceptable - // 1.2. wildcard * is acceptable - // 2. URI may be an IP address -> subjectAltName.iPAddress - // 2.1. exact match is required - // 3. Use of the most specific Common Name (CN=) in the Subject - // 3.1 Existing practice but DEPRECATED - private bool checkServerIdentity (X509Certificate cert) - { - ClientContext context = (ClientContext)this.Context; - - string targetHost = context.ClientSettings.TargetHost; - - X509Extension ext = cert.Extensions ["2.5.29.17"]; - // 1. subjectAltName - if (ext != null) - { - SubjectAltNameExtension subjectAltName = new SubjectAltNameExtension (ext); - // 1.1 - multiple dNSName - foreach (string dns in subjectAltName.DNSNames) - { - // 1.2 TODO - wildcard support - if (Match (targetHost, dns)) - return true; - } - // 2. ipAddress - foreach (string ip in subjectAltName.IPAddresses) - { - // 2.1. Exact match required - if (ip == targetHost) - return true; - } - } - // 3. Common Name (CN=) - return checkDomainName (cert.SubjectName); - } - - private bool checkDomainName(string subjectName) - { - ClientContext context = (ClientContext)this.Context; - - string domainName = String.Empty; - Regex search = new Regex(@"CN\s*=\s*([^,]*)"); - - MatchCollection elements = search.Matches(subjectName); - - if (elements.Count == 1) - { - if (elements[0].Success) - { - domainName = elements[0].Groups[1].Value.ToString(); - } - } - - return Match (context.ClientSettings.TargetHost, domainName); - } - - // ensure the pattern is valid wrt to RFC2595 and RFC2818 - // http://www.ietf.org/rfc/rfc2595.txt - // http://www.ietf.org/rfc/rfc2818.txt - static bool Match (string hostname, string pattern) - { - // check if this is a pattern - int index = pattern.IndexOf ('*'); - if (index == -1) { - // not a pattern, do a direct case-insensitive comparison - return (String.Compare (hostname, pattern, true, CultureInfo.InvariantCulture) == 0); - } - - // check pattern validity - // A "*" wildcard character MAY be used as the left-most name component in the certificate. - - // unless this is the last char (valid) - if (index != pattern.Length - 1) { - // then the next char must be a dot .'. - if (pattern [index + 1] != '.') - return false; - } - - // only one (A) wildcard is supported - int i2 = pattern.IndexOf ('*', index + 1); - if (i2 != -1) - return false; - - // match the end of the pattern - string end = pattern.Substring (index + 1); - int length = hostname.Length - end.Length; - // no point to check a pattern that is longer than the hostname - if (length <= 0) - return false; - - if (String.Compare (hostname, length, end, 0, end.Length, true, CultureInfo.InvariantCulture) != 0) - return false; - - // special case, we start with the wildcard - if (index == 0) { - // ensure we hostname non-matched part (start) doesn't contain a dot - int i3 = hostname.IndexOf ('.'); - return ((i3 == -1) || (i3 >= (hostname.Length - end.Length))); - } - - // match the start of the pattern - string start = pattern.Substring (0, index); - return (String.Compare (hostname, 0, start, 0, start.Length, true, CultureInfo.InvariantCulture) == 0); - } - - #endregion - } -} diff --git a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerCertificateRequest.cs b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerCertificateRequest.cs deleted file mode 100644 index cedb565c92..0000000000 --- a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerCertificateRequest.cs +++ /dev/null @@ -1,111 +0,0 @@ -// Transport Security Layer (TLS) -// Copyright (c) 2003-2004 Carlos Guzman Alvarez - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Text; -using Mono.Security; - -namespace Mono.Security.Protocol.Tls.Handshake.Client -{ - internal class TlsServerCertificateRequest : HandshakeMessage - { - #region Fields - - private ClientCertificateType[] certificateTypes; - private string[] distinguisedNames; - - #endregion - - #region Constructors - - public TlsServerCertificateRequest(Context context, byte[] buffer) - : base(context, HandshakeType.CertificateRequest, buffer) - { - } - - #endregion - - #region Methods - - public override void Update() - { - base.Update(); - - this.Context.ServerSettings.CertificateTypes = this.certificateTypes; - this.Context.ServerSettings.DistinguisedNames = this.distinguisedNames; - this.Context.ServerSettings.CertificateRequest = true; - } - - #endregion - - #region Protected Methods - - protected override void ProcessAsSsl3() - { - this.ProcessAsTls1(); - } - - protected override void ProcessAsTls1() - { - // Read requested certificate types - int typesCount = this.ReadByte(); - - this.certificateTypes = new ClientCertificateType[typesCount]; - - for (int i = 0; i < typesCount; i++) - { - this.certificateTypes[i] = (ClientCertificateType)this.ReadByte(); - } - - /* - * Read requested certificate authorities (Distinguised Names) - * - * Name ::= SEQUENCE OF RelativeDistinguishedName - * - * RelativeDistinguishedName ::= SET OF AttributeValueAssertion - * - * AttributeValueAssertion ::= SEQUENCE { - * attributeType OBJECT IDENTIFIER - * attributeValue ANY } - */ - if (this.ReadInt16() != 0) - { - ASN1 rdn = new ASN1(this.ReadBytes(this.ReadInt16())); - - distinguisedNames = new string[rdn.Count]; - - for (int i = 0; i < rdn.Count; i++) - { - // element[0] = attributeType - // element[1] = attributeValue - ASN1 element = new ASN1(rdn[i].Value); - - distinguisedNames[i] = Encoding.UTF8.GetString(element[1].Value); - } - } - } - - #endregion - } -} diff --git a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerFinished.cs b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerFinished.cs deleted file mode 100644 index f741f95a7d..0000000000 --- a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerFinished.cs +++ /dev/null @@ -1,102 +0,0 @@ -// Transport Security Layer (TLS) -// Copyright (c) 2003-2004 Carlos Guzman Alvarez -// Copyright (C) 2006 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Security.Cryptography; - -using Mono.Security.Cryptography; - -namespace Mono.Security.Protocol.Tls.Handshake.Client -{ - internal class TlsServerFinished : HandshakeMessage - { - #region Constructors - - public TlsServerFinished(Context context, byte[] buffer) - : base(context, HandshakeType.Finished, buffer) - { - } - - #endregion - - #region Methods - - public override void Update() - { - base.Update(); - - // Hahdshake is finished - this.Context.HandshakeState = HandshakeState.Finished; - } - - #endregion - - #region Protected Methods - - static private byte[] Ssl3Marker = new byte [4] { 0x53, 0x52, 0x56, 0x52 }; - - protected override void ProcessAsSsl3() - { - // Compute handshake messages hashes - HashAlgorithm hash = new SslHandshakeHash(this.Context.MasterSecret); - - byte[] data = this.Context.HandshakeMessages.ToArray (); - hash.TransformBlock (data, 0, data.Length, data, 0); - hash.TransformBlock (Ssl3Marker, 0, Ssl3Marker.Length, Ssl3Marker, 0); - // hack to avoid memory allocation - hash.TransformFinalBlock (CipherSuite.EmptyArray, 0, 0); - - byte[] serverHash = this.ReadBytes((int)Length); - byte[] clientHash = hash.Hash; - - // Check server prf against client prf - if (!Compare (clientHash, serverHash)) - { -// TODO: Review that selected alert is correct - throw new TlsException(AlertDescription.InsuficientSecurity, "Invalid ServerFinished message received."); - } - } - - protected override void ProcessAsTls1() - { - byte[] serverPRF = this.ReadBytes((int)Length); - HashAlgorithm hash = new MD5SHA1(); - - // note: we could call HashAlgorithm.ComputeHash(Stream) but that would allocate (on Mono) - // a 4096 bytes buffer to process the hash - which is bigger than HandshakeMessages - byte[] data = this.Context.HandshakeMessages.ToArray (); - byte[] digest = hash.ComputeHash (data, 0, data.Length); - - byte[] clientPRF = this.Context.Current.Cipher.PRF(this.Context.MasterSecret, "server finished", digest, 12); - - // Check server prf against client prf - if (!Compare (clientPRF, serverPRF)) - { - throw new TlsException("Invalid ServerFinished message received."); - } - } - - #endregion - } -} diff --git a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerHello.cs b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerHello.cs deleted file mode 100644 index 0cbecb5f26..0000000000 --- a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerHello.cs +++ /dev/null @@ -1,150 +0,0 @@ -// Transport Security Layer (TLS) -// Copyright (c) 2003-2004 Carlos Guzman Alvarez -// Copyright (C) 2006 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; - -namespace Mono.Security.Protocol.Tls.Handshake.Client -{ - internal class TlsServerHello : HandshakeMessage - { - #region Fields - - private SecurityCompressionType compressionMethod; - private byte[] random; - private byte[] sessionId; - private CipherSuite cipherSuite; - - #endregion - - #region Constructors - - public TlsServerHello(Context context, byte[] buffer) - : base(context, HandshakeType.ServerHello, buffer) - { - } - - #endregion - - #region Methods - - public override void Update() - { - base.Update(); - - this.Context.SessionId = this.sessionId; - this.Context.ServerRandom = this.random; - this.Context.Negotiating.Cipher = this.cipherSuite; - this.Context.CompressionMethod = this.compressionMethod; - this.Context.ProtocolNegotiated = true; - - DebugHelper.WriteLine("Selected Cipher Suite {0}", this.cipherSuite.Name); - DebugHelper.WriteLine("Client random", this.Context.ClientRandom); - DebugHelper.WriteLine("Server random", this.Context.ServerRandom); - - // Compute ClientRandom + ServerRandom - int clen = this.Context.ClientRandom.Length; - int slen = this.Context.ServerRandom.Length; - int rlen = clen + slen; - byte[] cs = new byte[rlen]; - Buffer.BlockCopy (this.Context.ClientRandom, 0, cs, 0, clen); - Buffer.BlockCopy (this.Context.ServerRandom, 0, cs, clen, slen); - this.Context.RandomCS = cs; - - // Server Random + Client Random - byte[] sc = new byte[rlen]; - Buffer.BlockCopy (this.Context.ServerRandom, 0, sc, 0, slen); - Buffer.BlockCopy (this.Context.ClientRandom, 0, sc, slen, clen); - this.Context.RandomSC = sc; - } - - #endregion - - #region Protected Methods - - protected override void ProcessAsSsl3() - { - this.ProcessAsTls1(); - } - - protected override void ProcessAsTls1() - { - // Read protocol version - this.processProtocol(this.ReadInt16()); - - // Read random - Unix time + Random bytes - this.random = this.ReadBytes(32); - - // Read Session id - int length = (int) ReadByte (); - if (length > 0) - { - this.sessionId = this.ReadBytes(length); - ClientSessionCache.Add (this.Context.ClientSettings.TargetHost, this.sessionId); - this.Context.AbbreviatedHandshake = Compare (this.sessionId, this.Context.SessionId); - } - else - { - this.Context.AbbreviatedHandshake = false; - } - - // Read cipher suite - short cipherCode = this.ReadInt16(); - if (this.Context.SupportedCiphers.IndexOf(cipherCode) == -1) - { - // The server has sent an invalid ciphersuite - throw new TlsException(AlertDescription.InsuficientSecurity, "Invalid cipher suite received from server"); - } - this.cipherSuite = this.Context.SupportedCiphers[cipherCode]; - - // Read compression methods ( always 0 ) - this.compressionMethod = (SecurityCompressionType)this.ReadByte(); - } - - #endregion - - #region Private Methods - - private void processProtocol(short protocol) - { - SecurityProtocolType serverProtocol = this.Context.DecodeProtocolCode(protocol); - - if ((serverProtocol & this.Context.SecurityProtocolFlags) == serverProtocol || - (this.Context.SecurityProtocolFlags & SecurityProtocolType.Default) == SecurityProtocolType.Default) - { - this.Context.SecurityProtocol = serverProtocol; - this.Context.SupportedCiphers = CipherSuiteFactory.GetSupportedCiphers (false, serverProtocol); - - DebugHelper.WriteLine("Selected protocol {0}", serverProtocol); - } - else - { - throw new TlsException( - AlertDescription.ProtocolVersion, - "Incorrect protocol version received from server"); - } - } - - #endregion - } -} diff --git a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerHelloDone.cs b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerHelloDone.cs deleted file mode 100644 index 7a0e61fb5d..0000000000 --- a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerHelloDone.cs +++ /dev/null @@ -1,52 +0,0 @@ -// Transport Security Layer (TLS) -// Copyright (c) 2003-2004 Carlos Guzman Alvarez - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; - -namespace Mono.Security.Protocol.Tls.Handshake.Client -{ - internal class TlsServerHelloDone : HandshakeMessage - { - #region Constructors - - public TlsServerHelloDone(Context context, byte[] buffer) - : base(context, HandshakeType.ServerHelloDone, buffer) - { - } - - #endregion - - #region Protected Methods - - protected override void ProcessAsSsl3() - { - } - - protected override void ProcessAsTls1() - { - } - - #endregion - } -} diff --git a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerKeyExchange.cs b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerKeyExchange.cs deleted file mode 100644 index d6c8e51302..0000000000 --- a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerKeyExchange.cs +++ /dev/null @@ -1,121 +0,0 @@ -// Transport Security Layer (TLS) -// Copyright (c) 2003-2004 Carlos Guzman Alvarez - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Security.Cryptography; - -using Mono.Security.Cryptography; -using Mono.Security.X509; - -namespace Mono.Security.Protocol.Tls.Handshake.Client -{ - internal class TlsServerKeyExchange : HandshakeMessage - { - #region Fields - - private RSAParameters rsaParams; - private byte[] signedParams; - - #endregion - - #region Constructors - - public TlsServerKeyExchange(Context context, byte[] buffer) - : base(context, HandshakeType.ServerKeyExchange, buffer) - { - this.verifySignature(); - } - - #endregion - - #region Methods - - public override void Update() - { - base.Update(); - - this.Context.ServerSettings.ServerKeyExchange = true; - this.Context.ServerSettings.RsaParameters = this.rsaParams; - this.Context.ServerSettings.SignedParams = this.signedParams; - } - - #endregion - - #region Protected Methods - - protected override void ProcessAsSsl3() - { - this.ProcessAsTls1(); - } - - protected override void ProcessAsTls1() - { - this.rsaParams = new RSAParameters(); - - // Read modulus - this.rsaParams.Modulus = this.ReadBytes(this.ReadInt16()); - - // Read exponent - this.rsaParams.Exponent = this.ReadBytes(this.ReadInt16()); - - // Read signed params - this.signedParams = this.ReadBytes(this.ReadInt16()); - } - - #endregion - - #region Private Methods - - private void verifySignature() - { - MD5SHA1 hash = new MD5SHA1(); - - // Calculate size of server params - int size = rsaParams.Modulus.Length + rsaParams.Exponent.Length + 4; - - // Create server params array - TlsStream stream = new TlsStream(); - - stream.Write(this.Context.RandomCS); - stream.Write(this.ToArray(), 0, size); - - hash.ComputeHash(stream.ToArray()); - - stream.Reset(); - - bool isValidSignature = hash.VerifySignature( - this.Context.ServerSettings.CertificateRSA, - this.signedParams); - - if (!isValidSignature) - { - throw new TlsException( - AlertDescription.DecodeError, - "Data was not signed with the server certificate."); - } - } - - #endregion - } -} diff --git a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsClientCertificate.cs b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsClientCertificate.cs deleted file mode 100644 index 6ef5db4101..0000000000 --- a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsClientCertificate.cs +++ /dev/null @@ -1,276 +0,0 @@ -// Transport Security Layer (TLS) -// Copyright (c) 2003-2004 Carlos Guzman Alvarez -// Copyright (C) 2006 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Collections; -using SSCX = System.Security.Cryptography.X509Certificates; -using Mono.Security.X509; -using Mono.Security.X509.Extensions; - -namespace Mono.Security.Protocol.Tls.Handshake.Server -{ - internal class TlsClientCertificate : HandshakeMessage - { - #region Fields - - private X509CertificateCollection clientCertificates; - - #endregion - - #region Constructors - - public TlsClientCertificate(Context context, byte[] buffer) - : base(context, HandshakeType.Certificate, buffer) - { - } - - #endregion - - #region Methods - - public override void Update() - { - foreach (X509Certificate certificate in clientCertificates) { - this.Context.ClientSettings.Certificates.Add (new SSCX.X509Certificate (certificate.RawData)); - } - } - - public bool HasCertificate { - get { return clientCertificates.Count > 0; } - } - - #endregion - - #region Protected Methods - - protected override void ProcessAsSsl3() - { - this.ProcessAsTls1(); - } - - protected override void ProcessAsTls1() - { - int bytesRead = 0; - int length = this.ReadInt24 (); - this.clientCertificates = new X509CertificateCollection (); - while (length > bytesRead) { - int certLength = this.ReadInt24 (); - bytesRead += certLength + 3; - byte[] cert = this.ReadBytes (certLength); - this.clientCertificates.Add (new X509Certificate (cert)); - } - - if (this.clientCertificates.Count > 0) - { - this.validateCertificates (this.clientCertificates); - } - else if ((this.Context as ServerContext).ClientCertificateRequired) - { - throw new TlsException (AlertDescription.NoCertificate); - } - } - - #endregion - - #region Private Methods - - private bool checkCertificateUsage (X509Certificate cert) - { - ServerContext context = (ServerContext)this.Context; - - // certificate extensions are required for this - // we "must" accept older certificates without proofs - if (cert.Version < 3) - return true; - - KeyUsages ku = KeyUsages.none; - switch (context.Negotiating.Cipher.ExchangeAlgorithmType) - { - case ExchangeAlgorithmType.RsaSign: - case ExchangeAlgorithmType.RsaKeyX: - ku = KeyUsages.digitalSignature; - break; - case ExchangeAlgorithmType.DiffieHellman: - ku = KeyUsages.keyAgreement; - break; - case ExchangeAlgorithmType.Fortezza: - return false; // unsupported certificate type - } - - KeyUsageExtension kux = null; - ExtendedKeyUsageExtension eku = null; - - X509Extension xtn = cert.Extensions["2.5.29.15"]; - if (xtn != null) - kux = new KeyUsageExtension (xtn); - - xtn = cert.Extensions["2.5.29.37"]; - if (xtn != null) - eku = new ExtendedKeyUsageExtension (xtn); - - if ((kux != null) && (eku != null)) - { - // RFC3280 states that when both KeyUsageExtension and - // ExtendedKeyUsageExtension are present then BOTH should - // be valid - return (kux.Support (ku) && - eku.KeyPurpose.Contains ("1.3.6.1.5.5.7.3.2")); - } - else if (kux != null) - { - return kux.Support (ku); - } - else if (eku != null) - { - // Client Authentication (1.3.6.1.5.5.7.3.2) - return eku.KeyPurpose.Contains ("1.3.6.1.5.5.7.3.2"); - } - - // last chance - try with older (deprecated) Netscape extensions - xtn = cert.Extensions["2.16.840.1.113730.1.1"]; - if (xtn != null) - { - NetscapeCertTypeExtension ct = new NetscapeCertTypeExtension (xtn); - return ct.Support (NetscapeCertTypeExtension.CertTypes.SslClient); - } - - // certificate isn't valid for SSL server usage - return false; - } - - private void validateCertificates (X509CertificateCollection certificates) - { - ServerContext context = (ServerContext)this.Context; - AlertDescription description = AlertDescription.BadCertificate; - SSCX.X509Certificate client = null; - int[] certificateErrors = null; - - // note: certificate may be null is no certificate is sent - // (e.g. optional mutual authentication) - if (certificates.Count > 0) { - X509Certificate leaf = certificates[0]; - - ArrayList errors = new ArrayList (); - - // SSL specific check - not all certificates can be - // used to server-side SSL some rules applies after - // all ;-) - if (!checkCertificateUsage (leaf)) - { - // WinError.h CERT_E_PURPOSE 0x800B0106 - errors.Add ((int)-2146762490); - } - - X509Chain verify; - // was a chain supplied ? if so use it, if not - if (certificates.Count > 1) { - // if so use it (and don't build our own) - X509CertificateCollection chain = new X509CertificateCollection (certificates); - chain.Remove (leaf); - verify = new X509Chain (chain); - } else { - // if not, then let's build our own (based on what's available in the stores) - verify = new X509Chain (); - } - - bool result = false; - - try - { - result = verify.Build (leaf); - } - catch (Exception) - { - result = false; - } - - if (!result) - { - switch (verify.Status) - { - case X509ChainStatusFlags.InvalidBasicConstraints: - // WinError.h TRUST_E_BASIC_CONSTRAINTS 0x80096019 - errors.Add ((int)-2146869223); - break; - - case X509ChainStatusFlags.NotSignatureValid: - // WinError.h TRUST_E_BAD_DIGEST 0x80096010 - errors.Add ((int)-2146869232); - break; - - case X509ChainStatusFlags.NotTimeNested: - // WinError.h CERT_E_VALIDITYPERIODNESTING 0x800B0102 - errors.Add ((int)-2146762494); - break; - - case X509ChainStatusFlags.NotTimeValid: - // WinError.h CERT_E_EXPIRED 0x800B0101 - description = AlertDescription.CertificateExpired; - errors.Add ((int)-2146762495); - break; - - case X509ChainStatusFlags.PartialChain: - // WinError.h CERT_E_CHAINING 0x800B010A - description = AlertDescription.UnknownCA; - errors.Add ((int)-2146762486); - break; - - case X509ChainStatusFlags.UntrustedRoot: - // WinError.h CERT_E_UNTRUSTEDROOT 0x800B0109 - description = AlertDescription.UnknownCA; - errors.Add ((int)-2146762487); - break; - - default: - // unknown error - description = AlertDescription.CertificateUnknown; - errors.Add ((int)verify.Status); - break; - } - } - client = new SSCX.X509Certificate (leaf.RawData); - certificateErrors = (int[])errors.ToArray (typeof (int)); - } - else - { - certificateErrors = new int[0]; - } - - SSCX.X509CertificateCollection certCollection = new SSCX.X509CertificateCollection (); - foreach (X509Certificate certificate in certificates) { - certCollection.Add (new SSCX.X509Certificate (certificate.RawData)); - } - if (!context.SslStream.RaiseClientCertificateValidation(client, certificateErrors)) - { - throw new TlsException ( - description, - "Invalid certificate received from client."); - } - - this.Context.ClientSettings.ClientCertificate = client; - } - - #endregion - } -} diff --git a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsClientCertificateVerify.cs b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsClientCertificateVerify.cs deleted file mode 100644 index 20a69edbbd..0000000000 --- a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsClientCertificateVerify.cs +++ /dev/null @@ -1,86 +0,0 @@ -// Transport Security Layer (TLS) -// Copyright (c) 2003-2004 Carlos Guzman Alvarez - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Security.Cryptography.X509Certificates; - -using System.Security.Cryptography; -using Mono.Security.Cryptography; - -namespace Mono.Security.Protocol.Tls.Handshake.Server -{ - internal class TlsClientCertificateVerify : HandshakeMessage - { - #region Constructors - - public TlsClientCertificateVerify(Context context, byte[] buffer) - : base(context, HandshakeType.CertificateVerify, buffer) - { - } - - #endregion - - #region Protected Methods - - protected override void ProcessAsSsl3() - { - ServerContext context = (ServerContext)this.Context; - int length = this.ReadInt16 (); - byte[] signature = this.ReadBytes (length); - - // Verify signature - SslHandshakeHash hash = new SslHandshakeHash(context.MasterSecret); - hash.TransformFinalBlock( - context.HandshakeMessages.ToArray(), - 0, - (int)context.HandshakeMessages.Length); - - if (!hash.VerifySignature(context.ClientSettings.CertificateRSA, signature)) - { - throw new TlsException(AlertDescription.HandshakeFailiure, "Handshake Failure."); - } - } - - protected override void ProcessAsTls1() - { - ServerContext context = (ServerContext)this.Context; - int length = this.ReadInt16 (); - byte[] signature = this.ReadBytes (length); - - // Verify signature - MD5SHA1 hash = new MD5SHA1(); - hash.ComputeHash( - context.HandshakeMessages.ToArray(), - 0, - (int)context.HandshakeMessages.Length); - - if (!hash.VerifySignature(context.ClientSettings.CertificateRSA, signature)) - { - throw new TlsException (AlertDescription.HandshakeFailiure, "Handshake Failure."); - } - } - - #endregion - } -} diff --git a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsClientFinished.cs b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsClientFinished.cs deleted file mode 100644 index 26eaad9a31..0000000000 --- a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsClientFinished.cs +++ /dev/null @@ -1,88 +0,0 @@ -// Transport Security Layer (TLS) -// Copyright (c) 2003-2004 Carlos Guzman Alvarez -// Copyright (C) 2006 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Security.Cryptography; - -using Mono.Security.Cryptography; - -namespace Mono.Security.Protocol.Tls.Handshake.Server -{ - internal class TlsClientFinished : HandshakeMessage - { - #region Constructors - - public TlsClientFinished(Context context, byte[] buffer) - : base(context, HandshakeType.Finished, buffer) - { - } - - #endregion - - #region Protected Methods - - protected override void ProcessAsSsl3() - { - // Compute handshake messages hashes - HashAlgorithm hash = new SslHandshakeHash(this.Context.MasterSecret); - - TlsStream data = new TlsStream(); - data.Write(this.Context.HandshakeMessages.ToArray()); - data.Write((int)0x434C4E54); - - hash.TransformFinalBlock(data.ToArray(), 0, (int)data.Length); - - data.Reset(); - - byte[] clientHash = this.ReadBytes((int)Length); - byte[] serverHash = hash.Hash; - - // Check client prf against server prf - if (!Compare (clientHash, serverHash)) - { - throw new TlsException(AlertDescription.DecryptError, "Decrypt error."); - } - } - - protected override void ProcessAsTls1() - { - byte[] clientPRF = this.ReadBytes((int)this.Length); - HashAlgorithm hash = new MD5SHA1(); - - byte[] data = this.Context.HandshakeMessages.ToArray (); - byte[] digest = hash.ComputeHash (data, 0, data.Length); - - byte[] serverPRF = this.Context.Current.Cipher.PRF( - this.Context.MasterSecret, "client finished", digest, 12); - - // Check client prf against server prf - if (!Compare (clientPRF, serverPRF)) - { - throw new TlsException(AlertDescription.DecryptError, "Decrypt error."); - } - } - - #endregion - } -} diff --git a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsClientHello.cs b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsClientHello.cs deleted file mode 100644 index 1172626f3c..0000000000 --- a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsClientHello.cs +++ /dev/null @@ -1,152 +0,0 @@ -// Transport Security Layer (TLS) -// Copyright (c) 2003-2004 Carlos Guzman Alvarez -// Copyright (C) 2006 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Security.Cryptography; - -namespace Mono.Security.Protocol.Tls.Handshake.Server -{ - internal class TlsClientHello : HandshakeMessage - { - #region Private Fields - - private byte[] random; - private byte[] sessionId; - private short[] cipherSuites; - private byte[] compressionMethods; - - #endregion - - #region Constructors - - public TlsClientHello(Context context, byte[] buffer) - : base(context, HandshakeType.ClientHello, buffer) - { - } - - #endregion - - #region Methods - - public override void Update() - { - base.Update(); - - this.selectCipherSuite(); - this.selectCompressionMethod(); - - this.Context.SessionId = this.sessionId; - this.Context.ClientRandom = this.random; - this.Context.ProtocolNegotiated = true; - } - - #endregion - - #region Protected Methods - - protected override void ProcessAsSsl3() - { - this.ProcessAsTls1(); - } - - protected override void ProcessAsTls1() - { - // Client Version - this.processProtocol(this.ReadInt16()); - - // Random bytes - Unix time + Radom bytes [28] - this.random = this.ReadBytes(32); - - // Session id - // Send the session ID empty - this.sessionId = this.ReadBytes(this.ReadByte()); - - // Read Supported Cipher Suites count - this.cipherSuites = new short[this.ReadInt16()/2]; - - // Read Cipher Suites - for (int i = 0; i < this.cipherSuites.Length; i++) - { - this.cipherSuites[i] = this.ReadInt16(); - } - - // Compression methods length - this.compressionMethods = new byte[this.ReadByte()]; - - for (int i = 0; i < this.compressionMethods.Length; i++) - { - this.compressionMethods[i] = this.ReadByte(); - } - } - - #endregion - - #region Private Methods - - private void processProtocol(short protocol) - { - // a server MUST reply with the hight version supported (`true` for fallback) - // so a TLS 1.2 client (like Google Chrome) will be returned that the server uses TLS 1.0 - // instead of an alert about the protocol - SecurityProtocolType clientProtocol = Context.DecodeProtocolCode (protocol, true); - - if ((clientProtocol & this.Context.SecurityProtocolFlags) == clientProtocol || - (this.Context.SecurityProtocolFlags & SecurityProtocolType.Default) == SecurityProtocolType.Default) - { - this.Context.SecurityProtocol = clientProtocol; - this.Context.SupportedCiphers = CipherSuiteFactory.GetSupportedCiphers (true, clientProtocol); - } - else - { - throw new TlsException(AlertDescription.ProtocolVersion, "Incorrect protocol version received from server"); - } - } - - private void selectCipherSuite() - { - int index = 0; - - for (int i = 0; i < this.cipherSuites.Length; i++) - { - if ((index = this.Context.SupportedCiphers.IndexOf(this.cipherSuites[i])) != -1) - { - this.Context.Negotiating.Cipher = this.Context.SupportedCiphers[index]; - break; - } - } - - if (this.Context.Negotiating.Cipher == null) - { - throw new TlsException(AlertDescription.InsuficientSecurity, "Insuficient Security"); - } - } - - private void selectCompressionMethod() - { - this.Context.CompressionMethod = SecurityCompressionType.None; - } - - #endregion - } -} diff --git a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsClientKeyExchange.cs b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsClientKeyExchange.cs deleted file mode 100644 index ceeb39ad46..0000000000 --- a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsClientKeyExchange.cs +++ /dev/null @@ -1,116 +0,0 @@ -// Transport Security Layer (TLS) -// Copyright (c) 2003-2004 Carlos Guzman Alvarez -// Copyright (C) 2006 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.IO; -using System.Security.Cryptography; -using System.Security.Cryptography.X509Certificates; - -namespace Mono.Security.Protocol.Tls.Handshake.Server -{ - internal class TlsClientKeyExchange : HandshakeMessage - { - #region Constructors - - public TlsClientKeyExchange(Context context, byte[] buffer) : - base(context, - HandshakeType.ClientKeyExchange, - buffer) - { - } - - #endregion - - #region Protected Methods - - protected override void ProcessAsSsl3() - { - AsymmetricAlgorithm privKey = null; - ServerContext context = (ServerContext)this.Context; - - // Select the private key information - privKey = context.SslStream.RaisePrivateKeySelection( - new X509Certificate(context.ServerSettings.Certificates[0].RawData), - null); - - if (privKey == null) - { - throw new TlsException(AlertDescription.UserCancelled, "Server certificate Private Key unavailable."); - } - - // Read client premaster secret - byte[] clientSecret = this.ReadBytes((int)this.Length); - - // Decrypt premaster secret - RSAPKCS1KeyExchangeDeformatter deformatter = new RSAPKCS1KeyExchangeDeformatter(privKey); - - byte[] preMasterSecret = deformatter.DecryptKeyExchange(clientSecret); - - // Create master secret - this.Context.Negotiating.Cipher.ComputeMasterSecret(preMasterSecret); - - // Create keys - this.Context.Negotiating.Cipher.ComputeKeys (); - - // Initialize Cipher Suite - this.Context.Negotiating.Cipher.InitializeCipher (); - } - - protected override void ProcessAsTls1() - { - AsymmetricAlgorithm privKey = null; - ServerContext context = (ServerContext)this.Context; - - // Select the private key information - // Select the private key information - privKey = context.SslStream.RaisePrivateKeySelection( - new X509Certificate(context.ServerSettings.Certificates[0].RawData), - null); - - if (privKey == null) - { - throw new TlsException(AlertDescription.UserCancelled, "Server certificate Private Key unavailable."); - } - - // Read client premaster secret - byte[] clientSecret = this.ReadBytes(this.ReadInt16()); - - // Decrypt premaster secret - RSAPKCS1KeyExchangeDeformatter deformatter = new RSAPKCS1KeyExchangeDeformatter(privKey); - - byte[] preMasterSecret = deformatter.DecryptKeyExchange(clientSecret); - - // Create master secret - this.Context.Negotiating.Cipher.ComputeMasterSecret(preMasterSecret); - - // Create keys - this.Context.Negotiating.Cipher.ComputeKeys(); - - // Initialize Cipher Suite - this.Context.Negotiating.Cipher.InitializeCipher(); - } - - #endregion - } -} diff --git a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsServerCertificate.cs b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsServerCertificate.cs deleted file mode 100644 index 7475d2d1e6..0000000000 --- a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsServerCertificate.cs +++ /dev/null @@ -1,74 +0,0 @@ -// Transport Security Layer (TLS) -// Copyright (c) 2003-2004 Carlos Guzman Alvarez - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Collections; -using System.Text.RegularExpressions; -using System.Security.Cryptography; -using X509Cert = System.Security.Cryptography.X509Certificates; - -using Mono.Security.X509; - -namespace Mono.Security.Protocol.Tls.Handshake.Server -{ - internal class TlsServerCertificate : HandshakeMessage - { - #region Constructors - - public TlsServerCertificate(Context context) - : base(context, HandshakeType.Certificate) - { - } - - #endregion - - #region Protected Methods - - protected override void ProcessAsSsl3() - { - this.ProcessAsTls1(); - } - - protected override void ProcessAsTls1() - { - TlsStream certs = new TlsStream(); - - foreach (X509Certificate certificate in this.Context.ServerSettings.Certificates) - { - // Write certificate length - certs.WriteInt24(certificate.RawData.Length); - - // Write certificate data - certs.Write(certificate.RawData); - } - - this.WriteInt24(Convert.ToInt32(certs.Length)); - this.Write(certs.ToArray()); - - certs.Close(); - } - - #endregion - } -} diff --git a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsServerCertificateRequest.cs b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsServerCertificateRequest.cs deleted file mode 100644 index 40274a6200..0000000000 --- a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsServerCertificateRequest.cs +++ /dev/null @@ -1,107 +0,0 @@ -// Transport Security Layer (TLS) -// Copyright (c) 2003-2004 Carlos Guzman Alvarez - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Text; -using Mono.Security; -using Mono.Security.X509; - -namespace Mono.Security.Protocol.Tls.Handshake.Server -{ - internal class TlsServerCertificateRequest : HandshakeMessage - { - #region Constructors - - public TlsServerCertificateRequest(Context context) - : base(context, HandshakeType.CertificateRequest) - { - } - - #endregion - - #region Protected Methods - - protected override void ProcessAsSsl3() - { - this.ProcessAsTls1(); - } - - protected override void ProcessAsTls1() - { - ServerContext context = (ServerContext)this.Context; - - int count = context.ServerSettings.CertificateTypes.Length; - - this.WriteByte(Convert.ToByte(count)); - - // Write requested certificate types - for (int i = 0; i < count; i++) - { - this.WriteByte((byte)context.ServerSettings.CertificateTypes[i]); - } - - /* - * Write requested certificate authorities (Distinguised Names) - * - * Name ::= SEQUENCE OF RelativeDistinguishedName - * - * RelativeDistinguishedName ::= SET OF AttributeValueAssertion - * - * AttributeValueAssertion ::= SEQUENCE { - * attributeType OBJECT IDENTIFIER - * attributeValue ANY } - */ - - /* - * From RFC 5246: - * If the certificate_authorities list is empty, then the client MAY - * send any certificate of the appropriate ClientCertificateType, - * unless there is some external arrangement to the contrary. - * - * Better let the client choose which certificate instead of sending down - * a potentially large list of DNs. - - if (context.ServerSettings.DistinguisedNames.Length > 0) - { - TlsStream list = new TlsStream (); - // this is the worst formating ever :-| - foreach (string dn in context.ServerSettings.DistinguisedNames) - { - byte[] name = X501.FromString (dn).GetBytes (); - list.Write ((short)name.Length); - list.Write (name); - } - this.Write ((short)list.Length); - this.Write (list.ToArray ()); - } - else - { - */ - this.Write ((short)0); - //} - } - - #endregion - } -} diff --git a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsServerFinished.cs b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsServerFinished.cs deleted file mode 100644 index 91311506cf..0000000000 --- a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsServerFinished.cs +++ /dev/null @@ -1,75 +0,0 @@ -// Transport Security Layer (TLS) -// Copyright (c) 2003-2004 Carlos Guzman Alvarez -// Copyright (C) 2006 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Security.Cryptography; - -using Mono.Security.Cryptography; - -namespace Mono.Security.Protocol.Tls.Handshake.Server -{ - internal class TlsServerFinished : HandshakeMessage - { - #region Constructors - - public TlsServerFinished(Context context) - : base(context, HandshakeType.Finished) - { - } - - #endregion - - #region Protected Methods - - static private byte[] Ssl3Marker = new byte [4] { 0x53, 0x52, 0x56, 0x52 }; - - protected override void ProcessAsSsl3() - { - // Compute handshake messages hashes - HashAlgorithm hash = new SslHandshakeHash(this.Context.MasterSecret); - - byte[] data = this.Context.HandshakeMessages.ToArray (); - hash.TransformBlock (data, 0, data.Length, data, 0); - hash.TransformBlock (Ssl3Marker, 0, Ssl3Marker.Length, Ssl3Marker, 0); - // hack to avoid memory allocation - hash.TransformFinalBlock (CipherSuite.EmptyArray, 0, 0); - - this.Write(hash.Hash); - } - - protected override void ProcessAsTls1() - { - // Compute handshake messages hash - HashAlgorithm hash = new MD5SHA1(); - byte[] data = this.Context.HandshakeMessages.ToArray (); - byte[] digest = hash.ComputeHash (data, 0, data.Length); - - // Write message - this.Write(this.Context.Current.Cipher.PRF( - this.Context.MasterSecret, "server finished", digest, 12)); - } - - #endregion - } -} diff --git a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsServerHello.cs b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsServerHello.cs deleted file mode 100644 index c02c24c57a..0000000000 --- a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsServerHello.cs +++ /dev/null @@ -1,122 +0,0 @@ -// Transport Security Layer (TLS) -// Copyright (c) 2003-2004 Carlos Guzman Alvarez -// Copyright (C) 2006 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; - -namespace Mono.Security.Protocol.Tls.Handshake.Server -{ - internal class TlsServerHello : HandshakeMessage - { - #region Private Fields - - private int unixTime; - private byte[] random; - - #endregion - - #region Constructors - - public TlsServerHello(Context context) - : base(context, HandshakeType.ServerHello) - { - } - - #endregion - - #region Methods - - public override void Update() - { - base.Update(); - - TlsStream random = new TlsStream(); - - // Compute Server Random - random.Write(this.unixTime); - random.Write(this.random); - - this.Context.ServerRandom = random.ToArray(); - - // Compute ClientRandom + ServerRandom - random.Reset(); - random.Write(this.Context.ClientRandom); - random.Write(this.Context.ServerRandom); - - this.Context.RandomCS = random.ToArray(); - - // Server Random + Client Random - random.Reset(); - random.Write(this.Context.ServerRandom); - random.Write(this.Context.ClientRandom); - - this.Context.RandomSC = random.ToArray(); - - random.Reset(); - } - - #endregion - - #region Protected Methods - - protected override void ProcessAsSsl3() - { - this.ProcessAsTls1(); - } - - protected override void ProcessAsTls1() - { - // Write protocol version - this.Write(this.Context.Protocol); - - // Write Unix time - this.unixTime = this.Context.GetUnixTime(); - this.Write(this.unixTime); - - // Write Random bytes - random = this.Context.GetSecureRandomBytes(28); - this.Write(this.random); - - if (this.Context.SessionId == null) - { - this.WriteByte(0); - } - else - { - // Write Session ID length - this.WriteByte((byte)this.Context.SessionId.Length); - - // Write Session ID - this.Write(this.Context.SessionId); - } - - // Write selected cipher suite - this.Write(this.Context.Negotiating.Cipher.Code); - - // Write selected compression method - this.WriteByte((byte)this.Context.CompressionMethod); - } - - #endregion - } -} diff --git a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsServerHelloDone.cs b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsServerHelloDone.cs deleted file mode 100644 index 1ce467c062..0000000000 --- a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsServerHelloDone.cs +++ /dev/null @@ -1,52 +0,0 @@ -// Transport Security Layer (TLS) -// Copyright (c) 2003-2004 Carlos Guzman Alvarez - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; - -namespace Mono.Security.Protocol.Tls.Handshake.Server -{ - internal class TlsServerHelloDone : HandshakeMessage - { - #region Constructors - - public TlsServerHelloDone(Context context) - : base(context, HandshakeType.ServerHelloDone) - { - } - - #endregion - - #region Protected Methods - - protected override void ProcessAsSsl3() - { - } - - protected override void ProcessAsTls1() - { - } - - #endregion - } -} diff --git a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsServerKeyExchange.cs b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsServerKeyExchange.cs deleted file mode 100644 index 8a2d03382a..0000000000 --- a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsServerKeyExchange.cs +++ /dev/null @@ -1,110 +0,0 @@ -// Transport Security Layer (TLS) -// Copyright (c) 2003-2004 Carlos Guzman Alvarez - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Security.Cryptography; - -using SX509 = System.Security.Cryptography.X509Certificates; - -using Mono.Security.Cryptography; -using Mono.Security.X509; - -namespace Mono.Security.Protocol.Tls.Handshake.Server -{ - internal class TlsServerKeyExchange : HandshakeMessage - { - #region Constructors - - public TlsServerKeyExchange(Context context) - : base(context, HandshakeType.ServerKeyExchange) - { - } - - #endregion - - #region Methods - - public override void Update() - { - throw new NotSupportedException(); - } - - #endregion - - #region Protected Methods - - protected override void ProcessAsSsl3() - { - this.ProcessAsTls1(); - } - - protected override void ProcessAsTls1() - { - ServerContext context = (ServerContext)this.Context; - - // Select the private key information - RSA rsa = (RSA)context.SslStream.PrivateKeyCertSelectionDelegate( - new SX509.X509Certificate(context.ServerSettings.Certificates[0].RawData), - null); - - RSAParameters rsaParams = rsa.ExportParameters(false); - - // Write Modulus - this.WriteInt24(rsaParams.Modulus.Length); - this.Write(rsaParams.Modulus, 0, rsaParams.Modulus.Length); - - // Write exponent - this.WriteInt24(rsaParams.Exponent.Length); - this.Write(rsaParams.Exponent, 0, rsaParams.Exponent.Length); - - // Write signed params - byte[] signature = this.createSignature(rsa, this.ToArray()); - this.WriteInt24(signature.Length); - this.Write(signature); - } - - #endregion - - #region Private Methods - - private byte[] createSignature(RSA rsa, byte[] buffer) - { - MD5SHA1 hash = new MD5SHA1(); - - // Create server params array - TlsStream stream = new TlsStream(); - - stream.Write(this.Context.RandomCS); - stream.Write(buffer, 0, buffer.Length); - - hash.ComputeHash(stream.ToArray()); - - stream.Reset(); - - return hash.CreateSignature(rsa); - } - - #endregion - } -} diff --git a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake/ClientCertificateType.cs b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake/ClientCertificateType.cs deleted file mode 100644 index 8bff712791..0000000000 --- a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake/ClientCertificateType.cs +++ /dev/null @@ -1,38 +0,0 @@ -// Transport Security Layer (TLS) -// Copyright (c) 2003-2004 Carlos Guzman Alvarez - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; - -namespace Mono.Security.Protocol.Tls.Handshake -{ - [Serializable] - internal enum ClientCertificateType - { - RSA = 1, - DSS = 2, - RSAFixed = 3, - DSSFixed = 4, - Unknown = 255 - } -} diff --git a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake/HandshakeMessage.cs b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake/HandshakeMessage.cs deleted file mode 100644 index 5407127416..0000000000 --- a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake/HandshakeMessage.cs +++ /dev/null @@ -1,170 +0,0 @@ -// Transport Security Layer (TLS) -// Copyright (c) 2003-2004 Carlos Guzman Alvarez -// Copyright (C) 2006 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; - -namespace Mono.Security.Protocol.Tls.Handshake -{ - internal abstract class HandshakeMessage : TlsStream - { - #region Fields - - private Context context; - private HandshakeType handshakeType; - private ContentType contentType; - private byte[] cache; - - #endregion - - #region Properties - - public Context Context - { - get { return this.context; } - } - - public HandshakeType HandshakeType - { - get { return this.handshakeType; } - } - - public ContentType ContentType - { - get { return this.contentType; } - } - - #endregion - - #region Constructors - - public HandshakeMessage( - Context context, - HandshakeType handshakeType) - : this(context, handshakeType, ContentType.Handshake) - { - } - - public HandshakeMessage( - Context context, - HandshakeType handshakeType, - ContentType contentType) : base() - { - this.context = context; - this.handshakeType = handshakeType; - this.contentType = contentType; - } - - public HandshakeMessage( - Context context, - HandshakeType handshakeType, - byte[] data) : base(data) - { - this.context = context; - this.handshakeType = handshakeType; - } - - #endregion - - #region Abstract Methods - - protected abstract void ProcessAsTls1(); - - protected abstract void ProcessAsSsl3(); - - #endregion - - #region Methods - - public void Process() - { - switch (this.Context.SecurityProtocol) - { - case SecurityProtocolType.Tls: - case SecurityProtocolType.Default: - this.ProcessAsTls1(); - break; - - case SecurityProtocolType.Ssl3: - this.ProcessAsSsl3(); - break; - - case SecurityProtocolType.Ssl2: - default: - throw new NotSupportedException("Unsupported security protocol type"); - } - } - - public virtual void Update() - { - if (this.CanWrite) - { - // result may (should) be available from a previous call to EncodeMessage - if (cache == null) - cache = this.EncodeMessage (); - this.context.HandshakeMessages.Write (cache); - this.Reset(); - cache = null; - } - } - - public virtual byte[] EncodeMessage() - { - cache = null; - - if (CanWrite) - { - byte[] hs = this.ToArray (); - int len = hs.Length; - cache = new byte[4 + len]; - - cache[0] = (byte) HandshakeType; - // Length as an Int24 in Network Order - cache[1] = (byte) (len >> 16); - cache[2] = (byte) (len >> 8); - cache[3] = (byte) len; - Buffer.BlockCopy (hs, 0, cache, 4, len); - } - - return cache; - } - - static public bool Compare (byte[] buffer1, byte[] buffer2) - { - // in our case both null can't exist (or be valid) - if ((buffer1 == null) || (buffer2 == null)) - return false; - - if (buffer1.Length != buffer2.Length) - return false; - - for (int i = 0; i < buffer1.Length; i++) { - if (buffer1[i] != buffer2[i]) - return false; - } - return true; - } - - #endregion - } -} diff --git a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake/HandshakeType.cs b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake/HandshakeType.cs deleted file mode 100644 index a0165a3c61..0000000000 --- a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake/HandshakeType.cs +++ /dev/null @@ -1,44 +0,0 @@ -// Transport Security Layer (TLS) -// Copyright (c) 2003-2004 Carlos Guzman Alvarez - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; - -namespace Mono.Security.Protocol.Tls.Handshake -{ - [Serializable] - internal enum HandshakeType : byte - { - HelloRequest = 0, - ClientHello = 1, - ServerHello = 2, - Certificate = 11, - ServerKeyExchange = 12, - CertificateRequest = 13, - ServerHelloDone = 14, - CertificateVerify = 15, - ClientKeyExchange = 16, - Finished = 20, - None = 255 - } -} diff --git a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/Alert.cs b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/Alert.cs deleted file mode 100644 index 62ac7b9f29..0000000000 --- a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/Alert.cs +++ /dev/null @@ -1,265 +0,0 @@ -// Transport Security Layer (TLS) -// Copyright (c) 2003-2004 Carlos Guzman Alvarez - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; - -namespace Mono.Security.Protocol.Tls -{ - #region Enumerations - - [Serializable] - internal enum AlertLevel : byte - { - Warning = 1, - Fatal = 2 - } - - [Serializable] - internal enum AlertDescription : byte - { - CloseNotify = 0, - UnexpectedMessage = 10, - BadRecordMAC = 20, - DecryptionFailed = 21, - RecordOverflow = 22, - DecompressionFailiure = 30, - HandshakeFailiure = 40, - NoCertificate = 41, // should be used in SSL3 - BadCertificate = 42, - UnsupportedCertificate = 43, - CertificateRevoked = 44, - CertificateExpired = 45, - CertificateUnknown = 46, - IlegalParameter = 47, - UnknownCA = 48, - AccessDenied = 49, - DecodeError = 50, - DecryptError = 51, - ExportRestriction = 60, - ProtocolVersion = 70, - InsuficientSecurity = 71, - InternalError = 80, - UserCancelled = 90, - NoRenegotiation = 100 - } - - #endregion - - internal class Alert - { - #region Fields - - private AlertLevel level; - private AlertDescription description; - - #endregion - - #region Properties - - public AlertLevel Level - { - get { return this.level; } - } - - public AlertDescription Description - { - get { return this.description; } - } - - public string Message - { - get { return Alert.GetAlertMessage(this.description); } - } - - public bool IsWarning - { - get { return this.level == AlertLevel.Warning ? true : false; } - } - - /* - public bool IsFatal - { - get { return this.level == AlertLevel.Fatal ? true : false; } - } - */ - - public bool IsCloseNotify - { - get - { - if (this.IsWarning && - this.description == AlertDescription.CloseNotify) - { - return true; - } - - return false; - } - } - - #endregion - - #region Constructors - - public Alert(AlertDescription description) - { - this.description = description; - this.level = inferAlertLevel(description); - } - - public Alert( - AlertLevel level, - AlertDescription description) - { - this.level = level; - this.description = description; - } - - #endregion - - #region Private Methods - - private static AlertLevel inferAlertLevel(AlertDescription description) - { - switch (description) - { - case AlertDescription.CloseNotify: - case AlertDescription.NoRenegotiation: - case AlertDescription.UserCancelled: - return AlertLevel.Warning; - - case AlertDescription.AccessDenied: - case AlertDescription.BadCertificate: - case AlertDescription.BadRecordMAC: - case AlertDescription.CertificateExpired: - case AlertDescription.CertificateRevoked: - case AlertDescription.CertificateUnknown: - case AlertDescription.DecodeError: - case AlertDescription.DecompressionFailiure: - case AlertDescription.DecryptError: - case AlertDescription.DecryptionFailed: - case AlertDescription.ExportRestriction: - case AlertDescription.HandshakeFailiure: - case AlertDescription.IlegalParameter: - case AlertDescription.InsuficientSecurity: - case AlertDescription.InternalError: - case AlertDescription.ProtocolVersion: - case AlertDescription.RecordOverflow: - case AlertDescription.UnexpectedMessage: - case AlertDescription.UnknownCA: - case AlertDescription.UnsupportedCertificate: - default: - return AlertLevel.Fatal; - } - } - - #endregion - - #region Static Methods - - public static string GetAlertMessage(AlertDescription description) - { - #if (DEBUG) - switch (description) - { - case AlertDescription.AccessDenied: - return "An inappropriate message was received."; - - case AlertDescription.BadCertificate: - return "TLSCiphertext decrypted in an invalid way."; - - case AlertDescription.BadRecordMAC: - return "Record with an incorrect MAC."; - - case AlertDescription.CertificateExpired: - return "Certificate has expired or is not currently valid"; - - case AlertDescription.CertificateRevoked: - return "Certificate was revoked by its signer."; - - case AlertDescription.CertificateUnknown: - return "Certificate Unknown."; - - case AlertDescription.CloseNotify: - return "Connection closed"; - - case AlertDescription.DecodeError: - return "A message could not be decoded because some field was out of the specified range or the length of the message was incorrect."; - - case AlertDescription.DecompressionFailiure: - return "The decompression function received improper input (e.g. data that would expand to excessive length)."; - - case AlertDescription.DecryptError: - return "TLSCiphertext decrypted in an invalid way: either it wasn`t an even multiple of the block length or its padding values, when checked, weren`t correct."; - - case AlertDescription.DecryptionFailed: - return "Handshake cryptographic operation failed, including being unable to correctly verify a signature, decrypt a key exchange, or validate finished message."; - - case AlertDescription.ExportRestriction: - return "Negotiation not in compliance with export restrictions was detected."; - - case AlertDescription.HandshakeFailiure: - return "Unable to negotiate an acceptable set of security parameters given the options available."; - - case AlertDescription.IlegalParameter: - return "A field in the handshake was out of range or inconsistent with other fields."; - - case AlertDescription.InsuficientSecurity: - return "Negotiation has failed specifically because the server requires ciphers more secure than those supported by the client."; - - case AlertDescription.InternalError: - return "Internal error unrelated to the peer or the correctness of the protocol makes it impossible to continue."; - - case AlertDescription.NoRenegotiation: - return "Invalid renegotiation."; - - case AlertDescription.ProtocolVersion: - return "Unsupported protocol version."; - - case AlertDescription.RecordOverflow: - return "Invalid length on TLSCiphertext record or TLSCompressed record."; - - case AlertDescription.UnexpectedMessage: - return "Invalid message received."; - - case AlertDescription.UnknownCA: - return "CA can't be identified as a trusted CA."; - - case AlertDescription.UnsupportedCertificate: - return "Certificate was of an unsupported type."; - - case AlertDescription.UserCancelled: - return "Handshake cancelled by user."; - - default: - return ""; - } - #else - return "The authentication or decryption has failed."; - #endif - } - - #endregion - } -} diff --git a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/CipherAlgorithmType.cs b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/CipherAlgorithmType.cs deleted file mode 100644 index b58cc2c785..0000000000 --- a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/CipherAlgorithmType.cs +++ /dev/null @@ -1,45 +0,0 @@ -// Transport Security Layer (TLS) -// Copyright (c) 2003-2004 Carlos Guzman Alvarez - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; - -namespace Mono.Security.Protocol.Tls -{ -#if INSIDE_SYSTEM - internal -#else - [Serializable] - public -#endif - enum CipherAlgorithmType - { - Des, - None, - Rc2, - Rc4, - Rijndael, - SkipJack, - TripleDes - } -} diff --git a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/CipherSuite.cs b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/CipherSuite.cs deleted file mode 100644 index 91d8034467..0000000000 --- a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/CipherSuite.cs +++ /dev/null @@ -1,594 +0,0 @@ -// Transport Security Layer (TLS) -// Copyright (c) 2003-2004 Carlos Guzman Alvarez -// Copyright (C) 2006 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.IO; -using System.Text; -using System.Security.Cryptography; - -using Mono.Security; -using Mono.Security.Cryptography; -using M = Mono.Security.Cryptography; - -namespace Mono.Security.Protocol.Tls -{ - internal abstract class CipherSuite - { - #region Static Fields - - public static byte[] EmptyArray = new byte[0]; - - #endregion - - #region Fields - - private short code; - private string name; - private CipherAlgorithmType cipherAlgorithmType; - private HashAlgorithmType hashAlgorithmType; - private ExchangeAlgorithmType exchangeAlgorithmType; - private bool isExportable; - private CipherMode cipherMode; - private byte keyMaterialSize; - private int keyBlockSize; - private byte expandedKeyMaterialSize; - private short effectiveKeyBits; - private byte ivSize; - private byte blockSize; - private Context context; - private SymmetricAlgorithm encryptionAlgorithm; - private ICryptoTransform encryptionCipher; - private SymmetricAlgorithm decryptionAlgorithm; - private ICryptoTransform decryptionCipher; - private KeyedHashAlgorithm clientHMAC; - private KeyedHashAlgorithm serverHMAC; - - #endregion - - #region Protected Properties - - protected ICryptoTransform EncryptionCipher - { - get { return this.encryptionCipher; } - } - - protected ICryptoTransform DecryptionCipher - { - get { return this.decryptionCipher; } - } - - protected KeyedHashAlgorithm ClientHMAC - { - get { return this.clientHMAC; } - } - - protected KeyedHashAlgorithm ServerHMAC - { - get { return this.serverHMAC; } - } - - #endregion - - #region Properties - - public CipherAlgorithmType CipherAlgorithmType - { - get { return this.cipherAlgorithmType; } - } - - public string HashAlgorithmName - { - get - { - switch (this.hashAlgorithmType) - { - case HashAlgorithmType.Md5: - return "MD5"; - - case HashAlgorithmType.Sha1: - return "SHA1"; - - default: - return "None"; - } - } - } - - internal HashAlgorithm CreateHashAlgorithm () - { - switch (hashAlgorithmType) { - case HashAlgorithmType.Md5: - return MD5.Create (); - case HashAlgorithmType.Sha1: - return SHA1.Create (); - default: - return null; - } - } - - public HashAlgorithmType HashAlgorithmType - { - get { return this.hashAlgorithmType; } - } - - public int HashSize - { - get - { - switch (this.hashAlgorithmType) - { - case HashAlgorithmType.Md5: - return 16; - - case HashAlgorithmType.Sha1: - return 20; - - default: - return 0; - } - } - } - - public ExchangeAlgorithmType ExchangeAlgorithmType - { - get { return this.exchangeAlgorithmType; } - } - - public CipherMode CipherMode - { - get { return this.cipherMode; } - } - - public short Code - { - get { return this.code; } - } - - public string Name - { - get { return this.name; } - } - - public bool IsExportable - { - get { return this.isExportable; } - } - - public byte KeyMaterialSize - { - get { return this.keyMaterialSize; } - } - - public int KeyBlockSize - { - get { return this.keyBlockSize; } - } - - public byte ExpandedKeyMaterialSize - { - get { return this.expandedKeyMaterialSize; } - } - - public short EffectiveKeyBits - { - get { return this.effectiveKeyBits; } - } - - public byte IvSize - { - get { return this.ivSize; } - } - - /* - public byte BlockSize - { - get { return this.blockSize; } - } - */ - - public Context Context - { - get { return this.context; } - set - { - this.context = value; - } - } - - #endregion - - #region Constructors - - public CipherSuite( - short code, string name, CipherAlgorithmType cipherAlgorithmType, - HashAlgorithmType hashAlgorithmType, ExchangeAlgorithmType exchangeAlgorithmType, - bool exportable, bool blockMode, byte keyMaterialSize, - byte expandedKeyMaterialSize, short effectiveKeyBits, - byte ivSize, byte blockSize) - { - this.code = code; - this.name = name; - this.cipherAlgorithmType = cipherAlgorithmType; - this.hashAlgorithmType = hashAlgorithmType; - this.exchangeAlgorithmType = exchangeAlgorithmType; - this.isExportable = exportable; - if (blockMode) - { - this.cipherMode = CipherMode.CBC; - } - this.keyMaterialSize = keyMaterialSize; - this.expandedKeyMaterialSize= expandedKeyMaterialSize; - this.effectiveKeyBits = effectiveKeyBits; - this.ivSize = ivSize; - this.blockSize = blockSize; - this.keyBlockSize = (this.keyMaterialSize + this.HashSize + this.ivSize) << 1; - } - - #endregion - - #region Methods - - internal void Write (byte[] array, int offset, short value) - { - if (offset > array.Length - 2) - throw new ArgumentException ("offset"); - - array [offset ] = (byte) (value >> 8); - array [offset + 1] = (byte) value; - } - - internal void Write (byte[] array, int offset, ulong value) - { - if (offset > array.Length - 8) - throw new ArgumentException ("offset"); - - array [offset ] = (byte) (value >> 56); - array [offset + 1] = (byte) (value >> 48); - array [offset + 2] = (byte) (value >> 40); - array [offset + 3] = (byte) (value >> 32); - array [offset + 4] = (byte) (value >> 24); - array [offset + 5] = (byte) (value >> 16); - array [offset + 6] = (byte) (value >> 8); - array [offset + 7] = (byte) value; - } - - public void InitializeCipher() - { - this.createEncryptionCipher(); - this.createDecryptionCipher(); - } - - public byte[] EncryptRecord(byte[] fragment, byte[] mac) - { - // Encryption ( fragment + mac [+ padding + padding_length] ) - int length = fragment.Length + mac.Length; - int padlen = 0; - if (this.CipherMode == CipherMode.CBC) { - // Calculate padding_length - length++; // keep an extra byte - padlen = (this.blockSize - length % this.blockSize); - if (padlen == this.blockSize) { - padlen = 0; - } - length += padlen; - } - - byte[] plain = new byte [length]; - Buffer.BlockCopy (fragment, 0, plain, 0, fragment.Length); - Buffer.BlockCopy (mac, 0, plain, fragment.Length, mac.Length); - if (padlen > 0) { - int start = fragment.Length + mac.Length; - for (int i = start; i < (start + padlen + 1); i++) { - plain[i] = (byte)padlen; - } - } - - this.EncryptionCipher.TransformBlock (plain, 0, plain.Length, plain, 0); - return plain; - } - - public void DecryptRecord(byte[] fragment, out byte[] dcrFragment, out byte[] dcrMAC) - { - int fragmentSize = 0; - int paddingLength = 0; - - // Decrypt message fragment ( fragment + mac [+ padding + padding_length] ) - this.DecryptionCipher.TransformBlock(fragment, 0, fragment.Length, fragment, 0); - // optimization: decrypt "in place", worst case: padding will reduce the size of the data - // this will cut in half the memory allocations (dcrFragment and dcrMAC remains) - - // Calculate fragment size - if (this.CipherMode == CipherMode.CBC) - { - // Calculate padding_length - paddingLength = fragment[fragment.Length - 1]; - fragmentSize = (fragment.Length - (paddingLength + 1)) - this.HashSize; - } - else - { - fragmentSize = fragment.Length - this.HashSize; - } - - dcrFragment = new byte[fragmentSize]; - dcrMAC = new byte[HashSize]; - - Buffer.BlockCopy(fragment, 0, dcrFragment, 0, dcrFragment.Length); - Buffer.BlockCopy(fragment, dcrFragment.Length, dcrMAC, 0, dcrMAC.Length); - } - - #endregion - - #region Abstract Methods - - public abstract byte[] ComputeClientRecordMAC(ContentType contentType, byte[] fragment); - - public abstract byte[] ComputeServerRecordMAC(ContentType contentType, byte[] fragment); - - public abstract void ComputeMasterSecret(byte[] preMasterSecret); - - public abstract void ComputeKeys(); - - #endregion - - #region Key Generation Methods - - public byte[] CreatePremasterSecret() - { - ClientContext context = (ClientContext)this.context; - - // Generate random bytes (total size) - byte[] preMasterSecret = this.context.GetSecureRandomBytes (48); - // and replace the first two bytes with the protocol version - // (maximum support version not actual) - preMasterSecret [0] = (byte)(context.ClientHelloProtocol >> 8); - preMasterSecret [1] = (byte)context.ClientHelloProtocol; - - return preMasterSecret; - } - - public byte[] PRF(byte[] secret, string label, byte[] data, int length) - { - /* Secret Length calc exmplain from the RFC2246. Section 5 - * - * S1 and S2 are the two halves of the secret and each is the same - * length. S1 is taken from the first half of the secret, S2 from the - * second half. Their length is created by rounding up the length of the - * overall secret divided by two; thus, if the original secret is an odd - * number of bytes long, the last byte of S1 will be the same as the - * first byte of S2. - */ - - // split secret in 2 - int secretLen = secret.Length >> 1; - // rounding up - if ((secret.Length & 0x1) == 0x1) - secretLen++; - - // Seed - TlsStream seedStream = new TlsStream(); - seedStream.Write(Encoding.ASCII.GetBytes(label)); - seedStream.Write(data); - byte[] seed = seedStream.ToArray(); - seedStream.Reset(); - - // Secret 1 - byte[] secret1 = new byte[secretLen]; - Buffer.BlockCopy(secret, 0, secret1, 0, secretLen); - - // Secret2 - byte[] secret2 = new byte[secretLen]; - Buffer.BlockCopy(secret, (secret.Length - secretLen), secret2, 0, secretLen); - - // Secret 1 processing - byte[] p_md5 = Expand (MD5.Create (), secret1, seed, length); - - // Secret 2 processing - byte[] p_sha = Expand (SHA1.Create (), secret2, seed, length); - - // Perfor XOR of both results - byte[] masterSecret = new byte[length]; - for (int i = 0; i < masterSecret.Length; i++) - { - masterSecret[i] = (byte)(p_md5[i] ^ p_sha[i]); - } - - return masterSecret; - } - - public byte[] Expand (HashAlgorithm hash, byte[] secret, byte[] seed, int length) - { - int hashLength = hash.HashSize / 8; - int iterations = (int)(length / hashLength); - if ((length % hashLength) > 0) - { - iterations++; - } - - M.HMAC hmac = new M.HMAC (hash, secret); - TlsStream resMacs = new TlsStream(); - - byte[][] hmacs = new byte[iterations + 1][]; - hmacs[0] = seed; - for (int i = 1; i <= iterations; i++) - { - TlsStream hcseed = new TlsStream(); - hmac.TransformFinalBlock(hmacs[i-1], 0, hmacs[i-1].Length); - hmacs[i] = hmac.Hash; - hcseed.Write(hmacs[i]); - hcseed.Write(seed); - hmac.TransformFinalBlock(hcseed.ToArray(), 0, (int)hcseed.Length); - resMacs.Write(hmac.Hash); - hcseed.Reset(); - } - - byte[] res = new byte[length]; - - Buffer.BlockCopy(resMacs.ToArray(), 0, res, 0, res.Length); - - resMacs.Reset(); - - return res; - } - - #endregion - - #region Private Methods - - private void createEncryptionCipher() - { - // Create and configure the symmetric algorithm - switch (this.cipherAlgorithmType) - { - case CipherAlgorithmType.Des: - this.encryptionAlgorithm = DES.Create(); - break; - - case CipherAlgorithmType.Rc2: - this.encryptionAlgorithm = RC2.Create(); - break; - - case CipherAlgorithmType.Rc4: - this.encryptionAlgorithm = new ARC4Managed(); - break; - - case CipherAlgorithmType.TripleDes: - this.encryptionAlgorithm = TripleDES.Create(); - break; - - case CipherAlgorithmType.Rijndael: - // only AES is really used - and we can use CommonCrypto for iOS and OSX this way - this.encryptionAlgorithm = Aes.Create(); - break; - } - - // If it's a block cipher - if (this.cipherMode == CipherMode.CBC) - { - // Configure encrypt algorithm - this.encryptionAlgorithm.Mode = this.cipherMode; - this.encryptionAlgorithm.Padding = PaddingMode.None; - this.encryptionAlgorithm.KeySize = this.expandedKeyMaterialSize * 8; - this.encryptionAlgorithm.BlockSize = this.blockSize * 8; - } - - // Set the key and IV for the algorithm - if (this.context is ClientContext) - { - this.encryptionAlgorithm.Key = this.context.ClientWriteKey; - this.encryptionAlgorithm.IV = this.context.ClientWriteIV; - } - else - { - this.encryptionAlgorithm.Key = this.context.ServerWriteKey; - this.encryptionAlgorithm.IV = this.context.ServerWriteIV; - } - - // Create encryption cipher - this.encryptionCipher = this.encryptionAlgorithm.CreateEncryptor(); - - // Create the HMAC algorithm - if (this.context is ClientContext) - { - this.clientHMAC = new M.HMAC( - CreateHashAlgorithm (), - this.context.Negotiating.ClientWriteMAC); - } - else - { - this.serverHMAC = new M.HMAC( - CreateHashAlgorithm (), - this.context.Negotiating.ServerWriteMAC); - } - } - - private void createDecryptionCipher() - { - // Create and configure the symmetric algorithm - switch (this.cipherAlgorithmType) - { - case CipherAlgorithmType.Des: - this.decryptionAlgorithm = DES.Create(); - break; - - case CipherAlgorithmType.Rc2: - this.decryptionAlgorithm = RC2.Create(); - break; - - case CipherAlgorithmType.Rc4: - this.decryptionAlgorithm = new ARC4Managed(); - break; - - case CipherAlgorithmType.TripleDes: - this.decryptionAlgorithm = TripleDES.Create(); - break; - - case CipherAlgorithmType.Rijndael: - // only AES is really used - and we can use CommonCrypto for iOS and OSX this way - this.decryptionAlgorithm = Aes.Create(); - break; - } - - // If it's a block cipher - if (this.cipherMode == CipherMode.CBC) - { - // Configure encrypt algorithm - this.decryptionAlgorithm.Mode = this.cipherMode; - this.decryptionAlgorithm.Padding = PaddingMode.None; - this.decryptionAlgorithm.KeySize = this.expandedKeyMaterialSize * 8; - this.decryptionAlgorithm.BlockSize = this.blockSize * 8; - } - - // Set the key and IV for the algorithm - if (this.context is ClientContext) - { - this.decryptionAlgorithm.Key = this.context.ServerWriteKey; - this.decryptionAlgorithm.IV = this.context.ServerWriteIV; - } - else - { - this.decryptionAlgorithm.Key = this.context.ClientWriteKey; - this.decryptionAlgorithm.IV = this.context.ClientWriteIV; - } - - // Create decryption cipher - this.decryptionCipher = this.decryptionAlgorithm.CreateDecryptor(); - - // Create the HMAC - if (this.context is ClientContext) - { - this.serverHMAC = new M.HMAC( - CreateHashAlgorithm (), - this.context.Negotiating.ServerWriteMAC); - } - else - { - this.clientHMAC = new M.HMAC( - CreateHashAlgorithm (), - this.context.Negotiating.ClientWriteMAC); - } - } - - #endregion - } -} diff --git a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/CipherSuiteCollection.cs b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/CipherSuiteCollection.cs deleted file mode 100644 index 973f4b788b..0000000000 --- a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/CipherSuiteCollection.cs +++ /dev/null @@ -1,130 +0,0 @@ -// Transport Security Layer (TLS) -// Copyright (c) 2003-2004 Carlos Guzman Alvarez -// Copyright 2013-2014 Xamarin Inc. - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Collections.Generic; - -namespace Mono.Security.Protocol.Tls { - - internal sealed class CipherSuiteCollection : List { - - #region Fields - - SecurityProtocolType protocol; - - #endregion - - #region Indexers - - public CipherSuite this [string name] { - get { - int n = IndexOf (name); - return n == -1 ? null : this [n]; - } - } - - public CipherSuite this [short code] { - get { - int n = IndexOf (code); - return n == -1 ? null : this [n]; - } - } - - #endregion - - #region Constructors - - public CipherSuiteCollection (SecurityProtocolType protocol) - { - switch (protocol) { - case SecurityProtocolType.Default: - case SecurityProtocolType.Tls: - case SecurityProtocolType.Ssl3: - this.protocol = protocol; - break; - case SecurityProtocolType.Ssl2: - default: - throw new NotSupportedException ("Unsupported security protocol type."); - } - } - - #endregion - - #region Methods - - public int IndexOf (string name) - { - int index = 0; - foreach (CipherSuite cipherSuite in this) { - if (String.CompareOrdinal (name, cipherSuite.Name) == 0) - return index; - index++; - } - return -1; - } - - public int IndexOf (short code) - { - int index = 0; - foreach (CipherSuite cipherSuite in this) { - if (cipherSuite.Code == code) - return index; - index++; - } - return -1; - } - - public void Add ( - short code, string name, CipherAlgorithmType cipherType, - HashAlgorithmType hashType, ExchangeAlgorithmType exchangeType, - bool exportable, bool blockMode, byte keyMaterialSize, - byte expandedKeyMaterialSize, short effectiveKeyBytes, - byte ivSize, byte blockSize) - { - switch (protocol) { - case SecurityProtocolType.Default: - case SecurityProtocolType.Tls: - Add (new TlsCipherSuite (code, name, cipherType, hashType, exchangeType, exportable, blockMode, - keyMaterialSize, expandedKeyMaterialSize, effectiveKeyBytes, ivSize, blockSize)); - break; - - case SecurityProtocolType.Ssl3: - Add (new SslCipherSuite (code, name, cipherType, hashType, exchangeType, exportable, blockMode, - keyMaterialSize, expandedKeyMaterialSize, effectiveKeyBytes, ivSize, blockSize)); - break; - } - } - - public IList GetNames () - { - var list = new List (Count); - foreach (CipherSuite cipherSuite in this) - list.Add (cipherSuite.Name); - return list; - } - - #endregion - } -} diff --git a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/CipherSuiteFactory.cs b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/CipherSuiteFactory.cs deleted file mode 100644 index cdba0f655d..0000000000 --- a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/CipherSuiteFactory.cs +++ /dev/null @@ -1,199 +0,0 @@ -// Transport Security Layer (TLS) -// Copyright (c) 2003-2004 Carlos Guzman Alvarez -// Copyright 2013-2014 Xamarin Inc. - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Collections.Generic; -using System.Reflection; -using System.Net; - -namespace Mono.Security.Protocol.Tls -{ - internal static class CipherSuiteFactory - { -#if false && !INSIDE_SYSTEM && !BOOTSTRAP_BASIC - static Type spm = typeof (ServicePointManager); - static PropertyInfo client_callback; - static PropertyInfo server_callback; -#endif - - public static CipherSuiteCollection GetSupportedCiphers (bool server, SecurityProtocolType protocol) - { - switch (protocol) { - case SecurityProtocolType.Default: - case SecurityProtocolType.Tls: - return CipherSuiteFactory.GetTls1SupportedCiphers (); - case SecurityProtocolType.Ssl3: - return CipherSuiteFactory.GetSsl3SupportedCiphers (); - case SecurityProtocolType.Ssl2: - default: - throw new NotSupportedException ("Unsupported security protocol type"); - } - } - - #region Private Static Methods - - private static CipherSuiteCollection GetTls1SupportedCiphers() - { - CipherSuiteCollection scs = new CipherSuiteCollection(SecurityProtocolType.Tls); - - // Supported ciphers - scs.Add((0x00 << 0x08) | 0x35, "TLS_RSA_WITH_AES_256_CBC_SHA", CipherAlgorithmType.Rijndael, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaKeyX, false, true, 32, 32, 256, 16, 16); - scs.Add((0x00 << 0x08) | 0x2F, "TLS_RSA_WITH_AES_128_CBC_SHA", CipherAlgorithmType.Rijndael, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaKeyX, false, true, 16, 16, 128, 16, 16); - scs.Add((0x00 << 0x08) | 0x0A, "TLS_RSA_WITH_3DES_EDE_CBC_SHA", CipherAlgorithmType.TripleDes, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaKeyX, false, true, 24, 24, 168, 8, 8); - scs.Add((0x00 << 0x08) | 0x05, "TLS_RSA_WITH_RC4_128_SHA", CipherAlgorithmType.Rc4, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaKeyX, false, false, 16, 16, 128, 0, 0); - scs.Add((0x00 << 0x08) | 0x04, "TLS_RSA_WITH_RC4_128_MD5", CipherAlgorithmType.Rc4, HashAlgorithmType.Md5, ExchangeAlgorithmType.RsaKeyX, false, false, 16, 16, 128, 0, 0); - scs.Add((0x00 << 0x08) | 0x09, "TLS_RSA_WITH_DES_CBC_SHA", CipherAlgorithmType.Des, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaKeyX, false, true, 8, 8, 56, 8, 8); - - // Supported exportable ciphers - // scs.Add((0x00 << 0x08) | 0x03, "TLS_RSA_EXPORT_WITH_RC4_40_MD5", CipherAlgorithmType.Rc4, HashAlgorithmType.Md5, ExchangeAlgorithmType.RsaKeyX, true, false, 5, 16, 40, 0, 0); - // scs.Add((0x00 << 0x08) | 0x06, "TLS_RSA_EXPORT_WITH_RC2_CBC_40_MD5", CipherAlgorithmType.Rc2, HashAlgorithmType.Md5, ExchangeAlgorithmType.RsaKeyX, true, true, 5, 16, 40, 8, 8); - // scs.Add((0x00 << 0x08) | 0x08, "TLS_RSA_EXPORT_WITH_DES40_CBC_SHA", CipherAlgorithmType.Des, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaKeyX, true, true, 5, 8, 40, 8, 8); - // scs.Add((0x00 << 0x08) | 0x60, "TLS_RSA_EXPORT_WITH_RC4_56_MD5", CipherAlgorithmType.Rc4, HashAlgorithmType.Md5, ExchangeAlgorithmType.RsaKeyX, true, false, 7, 16, 56, 0, 0); - // scs.Add((0x00 << 0x08) | 0x61, "TLS_RSA_EXPORT_WITH_RC2_CBC_56_MD5", CipherAlgorithmType.Rc2, HashAlgorithmType.Md5, ExchangeAlgorithmType.RsaKeyX, true, true, 7, 16, 56, 8, 8); - // 56 bits but we use 64 bits because of parity (DES is really 56 bits) - // scs.Add((0x00 << 0x08) | 0x62, "TLS_RSA_EXPORT_WITH_DES_CBC_56_SHA", CipherAlgorithmType.Des, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaKeyX, true, true, 8, 8, 64, 8, 8); - // scs.Add((0x00 << 0x08) | 0x64, "TLS_RSA_EXPORT_WITH_RC4_56_SHA", CipherAlgorithmType.Rc4, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaKeyX, true, false, 7, 16, 56, 0, 0); - - // Default CipherSuite - // scs.Add(0, "TLS_NULL_WITH_NULL_NULL", CipherAlgorithmType.None, HashAlgorithmType.None, ExchangeAlgorithmType.None, true, false, 0, 0, 0, 0, 0); - - // RSA Cipher Suites - // scs.Add((0x00 << 0x08) | 0x01, "TLS_RSA_WITH_NULL_MD5", CipherAlgorithmType.None, HashAlgorithmType.Md5, ExchangeAlgorithmType.None, true, false, 0, 0, 0, 0, 0); - // scs.Add((0x00 << 0x08) | 0x02, "TLS_RSA_WITH_NULL_SHA", CipherAlgorithmType.None, HashAlgorithmType.Sha1, ExchangeAlgorithmType.None, true, false, 0, 0, 0, 0, 0); - // scs.Add((0x00 << 0x08) | 0x03, "TLS_RSA_EXPORT_WITH_RC4_40_MD5", CipherAlgorithmType.Rc4, HashAlgorithmType.Md5, ExchangeAlgorithmType.RsaKeyX, true, false, 5, 16, 40, 0, 0); - // scs.Add((0x00 << 0x08) | 0x05, "TLS_RSA_WITH_RC4_128_SHA", CipherAlgorithmType.Rc4, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaSign, false, false, 16, 16, 128, 0, 0); - // scs.Add((0x00 << 0x08) | 0x04, "TLS_RSA_WITH_RC4_128_MD5", CipherAlgorithmType.Rc4, HashAlgorithmType.Md5, ExchangeAlgorithmType.RsaSign, false, false, 16, 16, 128, 0, 0); - // scs.Add((0x00 << 0x08) | 0x06, "TLS_RSA_EXPORT_WITH_RC2_CBC_40_MD5", CipherAlgorithmType.Rc2, HashAlgorithmType.Md5, ExchangeAlgorithmType.RsaKeyX, true, true, 5, 16, 40, 8, 8); - // scs.Add((0x00 << 0x08) | 0x07, "TLS_RSA_WITH_IDEA_CBC_SHA", "IDEA", HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaSign, false, true, 16, 16, 128, 8, 8); - // scs.Add((0x00 << 0x08) | 0x08, "TLS_RSA_EXPORT_WITH_DES40_CBC_SHA", CipherAlgorithmType.Des, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaKeyX, true, true, 5, 8, 40, 8, 8); - // scs.Add((0x00 << 0x08) | 0x09, "TLS_RSA_WITH_DES_CBC_SHA", CipherAlgorithmType.Des, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaSign, false, true, 8, 8, 56, 8, 8); - // scs.Add((0x00 << 0x08) | 0x0A, "TLS_RSA_WITH_3DES_EDE_CBC_SHA", CipherAlgorithmType.TripleDes, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaSign, false, true, 24, 24, 168, 8, 8); - - // Diffie-Hellman Cipher Suites - // scs.Add((0x00 << 0x08) | 0x0B, "TLS_DH_DSS_EXPORT_WITH_DES40_CBC_SHA", CipherAlgorithmType.Des, HashAlgorithmType.Sha1, ExchangeAlgorithmType.DiffieHellman, true, true, 5, 8, 40, 8, 8); - // scs.Add((0x00 << 0x08) | 0x0C, "TLS_DH_DSS_WITH_DES_CBC_SHA", CipherAlgorithmType.Des, HashAlgorithmType.Sha1, false, ExchangeAlgorithmType.DiffieHellman, true, 8, 8, 56, 8, 8); - // scs.Add((0x00 << 0x08) | 0x0D, "TLS_DH_DSS_WITH_3DES_EDE_CBC_SHA", CipherAlgorithmType.TripleDes, HashAlgorithmType.Sha1, ExchangeAlgorithmType.DiffieHellman, false, true, 24, 24, 168, 8, 8); - // scs.Add((0x00 << 0x08) | 0x0E, "TLS_DH_RSA_EXPORT_WITH_DES40_CBC_SHA", CipherAlgorithmType.Des, HashAlgorithmType.Sha1, ExchangeAlgorithmType.DiffieHellman, true, true, 5, 8, 40, 8, 8); - // scs.Add((0x00 << 0x08) | 0x0F, "TLS_DH_RSA_WITH_DES_CBC_SHA", CipherAlgorithmType.Des, HashAlgorithmType.Sha1, false, ExchangeAlgorithmType.DiffieHellman, true, 8, 8, 56, 8, 8); - // scs.Add((0x00 << 0x08) | 0x10, "TLS_DH_RSA_WITH_3DES_EDE_CBC_SHA", CipherAlgorithmType.TripleDes, HashAlgorithmType.Sha1, ExchangeAlgorithmType.DiffieHellman, false, true, 24, 24, 168, 8, 8); - // scs.Add((0x00 << 0x08) | 0x11, "TLS_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA", CipherAlgorithmType.Des, HashAlgorithmType.Sha1, ExchangeAlgorithmType.DiffieHellman, true, true, 5, 8, 40, 8, 8); - // scs.Add((0x00 << 0x08) | 0x12, "TLS_DHE_DSS_WITH_DES_CBC_SHA", CipherAlgorithmType.Des, HashAlgorithmType.Sha1, ExchangeAlgorithmType.DiffieHellman, false, true, 8, 8, 56, 8, 8); - // scs.Add((0x00 << 0x08) | 0x13, "TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA", CipherAlgorithmType.TripleDes, HashAlgorithmType.Sha1, ExchangeAlgorithmType.DiffieHellman, false, true, 24, 24, 168, 8, 8); - // scs.Add((0x00 << 0x08) | 0x14, "TLS_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA", CipherAlgorithmType.Des, HashAlgorithmType.Sha1, ExchangeAlgorithmType.DiffieHellman, true, true, 5, 8, 40, 8, 8); - // scs.Add((0x00 << 0x08) | 0x15, "TLS_DHE_RSA_WITH_DES_CBC_SHA", HashAlgorithmType.Sha1, CipherAlgorithmType.Des, false, ExchangeAlgorithmType.DiffieHellman, true, 8, 8, 56, 8, 8); - // scs.Add((0x00 << 0x08) | 0x16, "TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA", CipherAlgorithmType.TripleDes, HashAlgorithmType.Sha1, ExchangeAlgorithmType.DiffieHellman, false, true, 24, 24, 168, 8, 8); - - // Anonymous Diffie-Hellman Cipher Suites - // scs.Add((0x00 << 0x08) | 0x17, "TLS_DH_anon_EXPORT_WITH_RC4_40_MD5", CipherAlgorithmType.Rc4, HashAlgorithmType.Md5, ExchangeAlgorithmType.DiffieHellman, true, false, 5, 16, 40, 0, 0); - // scs.Add((0x00 << 0x08) | 0x18, "TLS_DH_anon_WITH_RC4_128_MD5", CipherAlgorithmType.Rc4, HashAlgorithmType.Md5, false, ExchangeAlgorithmType.DiffieHellman, false, 16, 16, 128, 0, 0); - // scs.Add((0x00 << 0x08) | 0x19, "TLS_DH_anon_EXPORT_WITH_DES40_CBC_SHA", CipherAlgorithmType.Des, HashAlgorithmType.Sha1, ExchangeAlgorithmType.DiffieHellman, false, true, 5, 8, 40, 8, 8); - // scs.Add((0x00 << 0x08) | 0x1A, "TLS_DH_anon_WITH_DES_CBC_SHA", "DES4", HashAlgorithmType.Sha1, ExchangeAlgorithmType.DiffieHellman, false, true, 8, 8, 56, 8, 8); - // scs.Add((0x00 << 0x08) | 0x1B, "TLS_DH_anon_WITH_3DES_EDE_CBC_SHA", CipherAlgorithmType.TripleDes, HashAlgorithmType.Sha1, ExchangeAlgorithmType.DiffieHellman, false, true, 24, 24, 168, 8, 8); - - // AES CipherSuites - // - // Ref: RFC3268 - (http://www.ietf.org/rfc/rfc3268.txt) - - // scs.Add((0x00 << 0x08) | 0x2F, "TLS_RSA_WITH_AES_128_CBC_SHA", CipherAlgorithmType.Rijndael, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaSign, false, true, 16, 16, 128, 16, 16); - // scs.Add((0x00 << 0x08) | 0x30, "TLS_DH_DSS_WITH_AES_128_CBC_SHA", CipherAlgorithmType.Rijndael, HashAlgorithmType.Sha1, ExchangeAlgorithmType.DiffieHellman, false, true, 16, 16, 128, 8, 8); - // scs.Add((0x00 << 0x08) | 0x31, "TLS_DH_RSA_WITH_AES_128_CBC_SHA", CipherAlgorithmType.Rijndael, HashAlgorithmType.Sha1, ExchangeAlgorithmType.DiffieHellman, false, true, 16, 16, 128, 8, 8); - // scs.Add((0x00 << 0x08) | 0x32, "TLS_DHE_DSS_WITH_AES_128_CBC_SHA", CipherAlgorithmType.Rijndael, HashAlgorithmType.Sha1, ExchangeAlgorithmType.DiffieHellman, false, true, 16, 16, 128, 8, 8); - // scs.Add((0x00 << 0x08) | 0x33, "TLS_DHE_RSA_WITH_AES_128_CBC_SHA", CipherAlgorithmType.Rijndael, HashAlgorithmType.Sha1, ExchangeAlgorithmType.DiffieHellman, false, true, 16, 16, 128, 8, 8); - // scs.Add((0x00 << 0x08) | 0x34, "TLS_DH_anon_WITH_AES_128_CBC_SHA", CipherAlgorithmType.Rijndael, HashAlgorithmType.Sha1, ExchangeAlgorithmType.DiffieHellman, false, true, 16, 16, 128, 8, 8); - - // scs.Add((0x00 << 0x08) | 0x35, "TLS_RSA_WITH_AES_256_CBC_SHA", CipherAlgorithmType.Rijndael, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaSign, false, true, 32, 32, 256, 16, 16); - // scs.Add((0x00 << 0x08) | 0x36, "TLS_DH_DSS_WITH_AES_256_CBC_SHA", CipherAlgorithmType.Rijndael, HashAlgorithmType.Sha1, ExchangeAlgorithmType.DiffieHellman, false, true, 32, 32, 256, 16, 16); - // scs.Add((0x00 << 0x08) | 0x37, "TLS_DH_RSA_WITH_AES_256_CBC_SHA", CipherAlgorithmType.Rijndael, HashAlgorithmType.Sha1, ExchangeAlgorithmType.DiffieHellman, false, true, 32, 32, 256, 16, 16); - // scs.Add((0x00 << 0x08) | 0x38, "TLS_DHE_DSS_WITH_AES_256_CBC_SHA", CipherAlgorithmType.Rijndael, HashAlgorithmType.Sha1, ExchangeAlgorithmType.DiffieHellman, false, true, 32, 32, 256, 16, 16); - // scs.Add((0x00 << 0x08) | 0x39, "TLS_DHE_RSA_WITH_AES_256_CBC_SHA", CipherAlgorithmType.Rijndael, HashAlgorithmType.Sha1, ExchangeAlgorithmType.DiffieHellman, false, true, 32, 32, 256, 16, 16); - // scs.Add((0x00 << 0x08) | 0x3A, "TLS_DH_anon_WITH_AES_256_CBC_SHA", CipherAlgorithmType.Rijndael, HashAlgorithmType.Sha1, ExchangeAlgorithmType.DiffieHellman, false, true, 32, 32, 256, 16, 16); - - return scs; - } - - private static CipherSuiteCollection GetSsl3SupportedCiphers() - { - CipherSuiteCollection scs = new CipherSuiteCollection(SecurityProtocolType.Ssl3); - - // Supported ciphers - scs.Add((0x00 << 0x08) | 0x35, "SSL_RSA_WITH_AES_256_CBC_SHA", CipherAlgorithmType.Rijndael, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaKeyX, false, true, 32, 32, 256, 16, 16); - scs.Add((0x00 << 0x08) | 0x2F, "SSL_RSA_WITH_AES_128_CBC_SHA", CipherAlgorithmType.Rijndael, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaKeyX, false, true, 16, 16, 128, 16, 16); - scs.Add((0x00 << 0x08) | 0x0A, "SSL_RSA_WITH_3DES_EDE_CBC_SHA", CipherAlgorithmType.TripleDes, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaKeyX, false, true, 24, 24, 168, 8, 8); - scs.Add((0x00 << 0x08) | 0x05, "SSL_RSA_WITH_RC4_128_SHA", CipherAlgorithmType.Rc4, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaKeyX, false, false, 16, 16, 128, 0, 0); - scs.Add((0x00 << 0x08) | 0x04, "SSL_RSA_WITH_RC4_128_MD5", CipherAlgorithmType.Rc4, HashAlgorithmType.Md5, ExchangeAlgorithmType.RsaKeyX, false, false, 16, 16, 128, 0, 0); - scs.Add((0x00 << 0x08) | 0x09, "SSL_RSA_WITH_DES_CBC_SHA", CipherAlgorithmType.Des, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaKeyX, false, true, 8, 8, 56, 8, 8); - - // Supported exportable ciphers - // scs.Add((0x00 << 0x08) | 0x03, "SSL_RSA_EXPORT_WITH_RC4_40_MD5", CipherAlgorithmType.Rc4, HashAlgorithmType.Md5, ExchangeAlgorithmType.RsaKeyX, true, false, 5, 16, 40, 0, 0); - // scs.Add((0x00 << 0x08) | 0x06, "SSL_RSA_EXPORT_WITH_RC2_CBC_40_MD5", CipherAlgorithmType.Rc2, HashAlgorithmType.Md5, ExchangeAlgorithmType.RsaKeyX, true, true, 5, 16, 40, 8, 8); - // scs.Add((0x00 << 0x08) | 0x08, "SSL_RSA_EXPORT_WITH_DES40_CBC_SHA", CipherAlgorithmType.Des, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaKeyX, true, true, 5, 8, 40, 8, 8); - // scs.Add((0x00 << 0x08) | 0x60, "SSL_RSA_EXPORT_WITH_RC4_56_MD5", CipherAlgorithmType.Rc4, HashAlgorithmType.Md5, ExchangeAlgorithmType.RsaKeyX, true, false, 7, 16, 56, 0, 0); - // scs.Add((0x00 << 0x08) | 0x61, "SSL_RSA_EXPORT_WITH_RC2_CBC_56_MD5", CipherAlgorithmType.Rc2, HashAlgorithmType.Md5, ExchangeAlgorithmType.RsaKeyX, true, true, 7, 16, 56, 8, 8); - // 56 bits but we use 64 bits because of parity (DES is really 56 bits) - // scs.Add((0x00 << 0x08) | 0x62, "SSL_RSA_EXPORT_WITH_DES_CBC_56_SHA", CipherAlgorithmType.Des, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaKeyX, true, true, 8, 8, 64, 8, 8); - // scs.Add((0x00 << 0x08) | 0x64, "SSL_RSA_EXPORT_WITH_RC4_56_SHA", CipherAlgorithmType.Rc4, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaKeyX, true, false, 7, 16, 56, 0, 0); - - // Default CipherSuite - // scs.Add(0, "SSL_NULL_WITH_NULL_NULL", CipherAlgorithmType.None, HashAlgorithmType.None, true, false, 0, 0, 0, 0, 0); - - // RSA Cipher Suites - // scs.Add((0x00 << 0x08) | 0x01, "SSL_RSA_WITH_NULL_MD5", CipherAlgorithmType.None, HashAlgorithmType.Md5, ExchangeAlgorithmType.None, true, false, 0, 0, 0, 0, 0); - // scs.Add((0x00 << 0x08) | 0x02, "SSL_RSA_WITH_NULL_SHA", CipherAlgorithmType.None, HashAlgorithmType.Sha1, true, ExchangeAlgorithmType.None, false, 0, 0, 0, 0, 0); - // scs.Add((0x00 << 0x08) | 0x03, "SSL_RSA_EXPORT_WITH_RC4_40_MD5", CipherAlgorithmType.Rc4, HashAlgorithmType.Md5, ExchangeAlgorithmType.RsaKeyX, true, false, 5, 16, 40, 0, 0); - // scs.Add((0x00 << 0x08) | 0x05, "SSL_RSA_WITH_RC4_128_SHA", CipherAlgorithmType.Rc4, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaSign, false, false, 16, 16, 128, 0, 0); - // scs.Add((0x00 << 0x08) | 0x04, "SSL_RSA_WITH_RC4_128_MD5", CipherAlgorithmType.Rc4, HashAlgorithmType.Md5, ExchangeAlgorithmType.RsaSign, false, false, 16, 16, 128, 0, 0); - // scs.Add((0x00 << 0x08) | 0x06, "SSL_RSA_EXPORT_WITH_RC2_CBC_40_MD5", CipherAlgorithmType.Rc2, HashAlgorithmType.Md5, ExchangeAlgorithmType.RsaKeyX, true, true, 5, 16, 40, 8, 8); - // scs.Add((0x00 << 0x08) | 0x07, "SSL_RSA_WITH_IDEA_CBC_SHA", "IDEA", HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaSign, false, true, 16, 16, 128, 8, 8); - // scs.Add((0x00 << 0x08) | 0x08, "SSL_RSA_EXPORT_WITH_DES40_CBC_SHA", CipherAlgorithmType.Des, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaKeyEx, true, true, 5, 8, 40, 8, 8); - // scs.Add((0x00 << 0x08) | 0x09, "SSL_RSA_WITH_DES_CBC_SHA", CipherAlgorithmType.Des, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaSign, false, true, 8, 8, 56, 8, 8); - // scs.Add((0x00 << 0x08) | 0x0A, "SSL_RSA_WITH_3DES_EDE_CBC_SHA", CipherAlgorithmType.TripleDes, HashAlgorithmType.Sha1, ExchangeAlgorithmType.RsaSign, false, true, 24, 24, 168, 8, 8); - - // Diffie-Hellman Cipher Suites - // scs.Add((0x00 << 0x08) | 0x0B, "SSL_DH_DSS_EXPORT_WITH_DES40_CBC_SHA", CipherAlgorithmType.Des, HashAlgorithmType.Sha1, ExchangeAlgorithmType.DiffieHellman, true, true, 5, 8, 40, 8, 8); - // scs.Add((0x00 << 0x08) | 0x0C, "SSL_DH_DSS_WITH_DES_CBC_SHA", CipherAlgorithmType.Des, HashAlgorithmType.Sha1, ExchangeAlgorithmType.DiffieHellman, false, true, 8, 8, 56, 8, 8); - // scs.Add((0x00 << 0x08) | 0x0D, "SSL_DH_DSS_WITH_3DES_EDE_CBC_SHA", CipherAlgorithmType.TripleDes, HashAlgorithmType.Sha1, ExchangeAlgorithmType.DiffieHellman, false, true, 24, 24, 168, 8, 8); - // scs.Add((0x00 << 0x08) | 0x0E, "SSL_DH_RSA_EXPORT_WITH_DES40_CBC_SHA", CipherAlgorithmType.Des, HashAlgorithmType.Sha1, ExchangeAlgorithmType.DiffieHellman, true, true, 5, 8, 40, 8, 8); - // scs.Add((0x00 << 0x08) | 0x0F, "SSL_DH_RSA_WITH_DES_CBC_SHA", CipherAlgorithmType.Des, HashAlgorithmType.Sha1, ExchangeAlgorithmType.DiffieHellman, false, true, 8, 8, 56, 8, 8); - // scs.Add((0x00 << 0x08) | 0x10, "SSL_DH_RSA_WITH_3DES_EDE_CBC_SHA", CipherAlgorithmType.TripleDes, HashAlgorithmType.Sha1, ExchangeAlgorithmType.DiffieHellman, false, true, 24, 24, 168, 8, 8); - // scs.Add((0x00 << 0x08) | 0x11, "SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA", CipherAlgorithmType.Des, HashAlgorithmType.Sha1, ExchangeAlgorithmType.DiffieHellman, true, true, 5, 8, 40, 8, 8); - // scs.Add((0x00 << 0x08) | 0x12, "SSL_DHE_DSS_WITH_DES_CBC_SHA", CipherAlgorithmType.Des, HashAlgorithmType.Sha1, ExchangeAlgorithmType.DiffieHellman, false, true, 8, 8, 56, 8, 8); - // scs.Add((0x00 << 0x08) | 0x13, "SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA", CipherAlgorithmType.TripleDes, HashAlgorithmType.Sha1, ExchangeAlgorithmType.DiffieHellman, false, true, 24, 24, 168, 8, 8); - // scs.Add((0x00 << 0x08) | 0x14, "SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA", CipherAlgorithmType.Des, HashAlgorithmType.Sha1, ExchangeAlgorithmType.DiffieHellman, true, true, 5, 8, 40, 8, 8); - // scs.Add((0x00 << 0x08) | 0x15, "SSL_DHE_RSA_WITH_DES_CBC_SHA", HashAlgorithmType.Sha1, CipherAlgorithmType.Des, ExchangeAlgorithmType.DiffieHellman, false, true, 8, 8, 56, 8, 8); - // scs.Add((0x00 << 0x08) | 0x16, "SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA", CipherAlgorithmType.TripleDes, HashAlgorithmType.Sha1, ExchangeAlgorithmType.DiffieHellman, false, true, 24, 24, 168, 8, 8); - - // Anonymous Diffie-Hellman Cipher Suites - // scs.Add((0x00 << 0x08) | 0x17, "SSL_DH_anon_EXPORT_WITH_RC4_40_MD5", CipherAlgorithmType.Rc4, HashAlgorithmType.Md5, ExchangeAlgorithmType.DiffieHellman, true, false, 5, 16, 40, 0, 0); - // scs.Add((0x00 << 0x08) | 0x18, "SSL_DH_anon_WITH_RC4_128_MD5", CipherAlgorithmType.Rc4, HashAlgorithmType.Md5, false, ExchangeAlgorithmType.DiffieHellman, false, 16, 16, 128, 0, 0); - // scs.Add((0x00 << 0x08) | 0x19, "SSL_DH_anon_EXPORT_WITH_DES40_CBC_SHA", CipherAlgorithmType.Des, HashAlgorithmType.Sha1, ExchangeAlgorithmType.DiffieHellman, false, true, 5, 8, 40, 8, 8); - // scs.Add((0x00 << 0x08) | 0x1A, "SSL_DH_anon_WITH_DES_CBC_SHA", "DES4", HashAlgorithmType.Sha1, ExchangeAlgorithmType.DiffieHellman, false, true, 8, 8, 56, 8, 8); - // scs.Add((0x00 << 0x08) | 0x1B, "SSL_DH_anon_WITH_3DES_EDE_CBC_SHA", CipherAlgorithmType.TripleDes, HashAlgorithmType.Sha1, ExchangeAlgorithmType.DiffieHellman, false, true, 24, 24, 168, 8, 8); - - return scs; - } - - #endregion - } -} diff --git a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/ClientContext.cs b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/ClientContext.cs deleted file mode 100644 index 2472f9a2fa..0000000000 --- a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/ClientContext.cs +++ /dev/null @@ -1,82 +0,0 @@ -// Transport Security Layer (TLS) -// Copyright (c) 2003-2004 Carlos Guzman Alvarez - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; - -using System.Security.Cryptography; -using System.Security.Cryptography.X509Certificates; - -namespace Mono.Security.Protocol.Tls -{ - internal class ClientContext : Context - { - #region Fields - - private SslClientStream sslStream; - private short clientHelloProtocol; - - #endregion - - #region Properties - - public SslClientStream SslStream - { - get { return this.sslStream; } - } - - public short ClientHelloProtocol - { - get { return this.clientHelloProtocol; } - set { this.clientHelloProtocol = value; } - } - - #endregion - - #region Constructors - - public ClientContext( - SslClientStream stream, - SecurityProtocolType securityProtocolType, - string targetHost, - X509CertificateCollection clientCertificates) - : base(securityProtocolType) - { - this.sslStream = stream; - this.ClientSettings.Certificates = clientCertificates; - this.ClientSettings.TargetHost = targetHost; - } - - #endregion - - #region Methods - - public override void Clear() - { - this.clientHelloProtocol = 0; - base.Clear(); - } - - #endregion - } -} diff --git a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/ClientRecordProtocol.cs b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/ClientRecordProtocol.cs deleted file mode 100644 index 0602e70275..0000000000 --- a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/ClientRecordProtocol.cs +++ /dev/null @@ -1,195 +0,0 @@ -// Transport Security Layer (TLS) -// Copyright (c) 2003-2004 Carlos Guzman Alvarez - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Globalization; -using System.IO; - -using Mono.Security.Protocol.Tls.Handshake; -using Mono.Security.Protocol.Tls.Handshake.Client; - -namespace Mono.Security.Protocol.Tls -{ - internal class ClientRecordProtocol : RecordProtocol - { - #region Constructors - - public ClientRecordProtocol( - Stream innerStream, - ClientContext context) : base(innerStream, context) - { - } - - #endregion - - #region Send Messages - - public override HandshakeMessage GetMessage(HandshakeType type) - { - HandshakeMessage msg = this.createClientHandshakeMessage(type); - - return msg; - } - - #endregion - - #region Handshake Processing Methods - - protected override void ProcessHandshakeMessage(TlsStream handMsg) - { - HandshakeType handshakeType = (HandshakeType)handMsg.ReadByte(); - HandshakeMessage message = null; - - DebugHelper.WriteLine(">>>> Processing Handshake record ({0})", handshakeType); - - // Read message length - int length = handMsg.ReadInt24(); - - // Read message data - byte[] data = null; - if (length > 0) - { - data = new byte[length]; - handMsg.Read (data, 0, length); - } - - // Create and process the server message - message = this.createServerHandshakeMessage(handshakeType, data); - if (message != null) - { - message.Process(); - } - - // Update the last handshake message - this.Context.LastHandshakeMsg = handshakeType; - - // Update session - if (message != null) - { - message.Update(); - this.Context.HandshakeMessages.WriteByte ((byte) handshakeType); - this.Context.HandshakeMessages.WriteInt24 (length); - if (length > 0) - { - this.Context.HandshakeMessages.Write (data, 0, data.Length); - } - } - } - - #endregion - - #region Client Handshake Message Factories - - private HandshakeMessage createClientHandshakeMessage(HandshakeType type) - { - switch (type) - { - case HandshakeType.ClientHello: - return new TlsClientHello(this.context); - - case HandshakeType.Certificate: - return new TlsClientCertificate(this.context); - - case HandshakeType.ClientKeyExchange: - return new TlsClientKeyExchange(this.context); - - case HandshakeType.CertificateVerify: - return new TlsClientCertificateVerify(this.context); - - case HandshakeType.Finished: - return new TlsClientFinished(this.context); - - default: - throw new InvalidOperationException("Unknown client handshake message type: " + type.ToString() ); - } - } - - private HandshakeMessage createServerHandshakeMessage( - HandshakeType type, byte[] buffer) - { - ClientContext context = (ClientContext)this.context; - var last = context.LastHandshakeMsg; - - switch (type) - { - case HandshakeType.HelloRequest: - if (context.HandshakeState != HandshakeState.Started) - { - context.HandshakeState = HandshakeState.None; - // re-negotiation will occur at next read/write - // (i.e. not during an existing encode/decode op) - } - else - { - this.SendAlert( - AlertLevel.Warning, - AlertDescription.NoRenegotiation); - } - return null; - - case HandshakeType.ServerHello: - if (last != HandshakeType.HelloRequest) - break; - return new TlsServerHello(this.context, buffer); - - // Optional - case HandshakeType.Certificate: - if (last != HandshakeType.ServerHello) - break; - return new TlsServerCertificate(this.context, buffer); - - // Optional - case HandshakeType.CertificateRequest: - if (last == HandshakeType.ServerKeyExchange || last == HandshakeType.Certificate) - return new TlsServerCertificateRequest(this.context, buffer); - break; - - case HandshakeType.ServerHelloDone: - if (last == HandshakeType.CertificateRequest || last == HandshakeType.Certificate || last == HandshakeType.ServerHello) - return new TlsServerHelloDone(this.context, buffer); - break; - - case HandshakeType.Finished: - // depends if a full (ServerHelloDone) or an abbreviated handshake (ServerHello) is being done - bool check = context.AbbreviatedHandshake ? (last == HandshakeType.ServerHello) : (last == HandshakeType.ServerHelloDone); - // ChangeCipherSpecDone is not an handshake message (it's a content type) but still needs to be happens before finished - if (check && context.ChangeCipherSpecDone) { - context.ChangeCipherSpecDone = false; - return new TlsServerFinished (this.context, buffer); - } - break; - - default: - throw new TlsException( - AlertDescription.UnexpectedMessage, - String.Format(CultureInfo.CurrentUICulture, - "Unknown server handshake message received ({0})", - type.ToString())); - } - throw new TlsException (AlertDescription.HandshakeFailiure, String.Format ("Protocol error, unexpected protocol transition from {0} to {1}", last, type)); - } - - #endregion - } -} diff --git a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/ClientSessionCache.cs b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/ClientSessionCache.cs deleted file mode 100644 index 749a51edea..0000000000 --- a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/ClientSessionCache.cs +++ /dev/null @@ -1,254 +0,0 @@ -// -// ClientSessionCache.cs: Client-side cache for re-using sessions -// -// Author: -// Sebastien Pouliot -// -// Copyright (C) 2006 Novell (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Collections; - -namespace Mono.Security.Protocol.Tls { - - internal class ClientSessionInfo : IDisposable { - - // (by default) we keep this item valid for 3 minutes (if unused) - private const int DefaultValidityInterval = 3 * 60; - private static readonly int ValidityInterval; - - private bool disposed; - private DateTime validuntil; - private string host; - - // see RFC2246 - Section 7 - private byte[] sid; - private byte[] masterSecret; - - static ClientSessionInfo () - { - string user_cache_timeout = Environment.GetEnvironmentVariable ("MONO_TLS_SESSION_CACHE_TIMEOUT"); - if (user_cache_timeout == null) { - ValidityInterval = DefaultValidityInterval; - } else { - try { - ValidityInterval = Int32.Parse (user_cache_timeout); - } - catch { - ValidityInterval = DefaultValidityInterval; - } - } - } - - public ClientSessionInfo (string hostname, byte[] id) - { - host = hostname; - sid = id; - KeepAlive (); - } - - ~ClientSessionInfo () - { - Dispose (false); - } - - - public string HostName { - get { return host; } - } - - public byte[] Id { - get { return sid; } - } - - public bool Valid { - get { return ((masterSecret != null) && (validuntil > DateTime.UtcNow)); } - } - - - public void GetContext (Context context) - { - CheckDisposed (); - if (context.MasterSecret != null) - masterSecret = (byte[]) context.MasterSecret.Clone (); - } - - public void SetContext (Context context) - { - CheckDisposed (); - if (masterSecret != null) - context.MasterSecret = (byte[]) masterSecret.Clone (); - } - - public void KeepAlive () - { - CheckDisposed (); - validuntil = DateTime.UtcNow.AddSeconds (ValidityInterval); - } - - public void Dispose () - { - Dispose (true); - GC.SuppressFinalize (this); - } - - private void Dispose (bool disposing) - { - if (!disposed) { - validuntil = DateTime.MinValue; - host = null; - sid = null; - - if (masterSecret != null) { - Array.Clear (masterSecret, 0, masterSecret.Length); - masterSecret = null; - } - } - disposed = true; - } - - private void CheckDisposed () - { - if (disposed) { - string msg = Locale.GetText ("Cache session information were disposed."); - throw new ObjectDisposedException (msg); - } - } - } - - // note: locking is aggressive but isn't used often (and we gain much more :) - internal class ClientSessionCache { - - static Hashtable cache; - static object locker; - - static ClientSessionCache () - { - cache = new Hashtable (); - locker = new object (); - } - - // note: we may have multiple connections with a host, so - // possibly multiple entries per host (each with a different - // id), so we do not use the host as the hashtable key - static public void Add (string host, byte[] id) - { - lock (locker) { - string uid = BitConverter.ToString (id); - ClientSessionInfo si = (ClientSessionInfo) cache[uid]; - if (si == null) { - cache.Add (uid, new ClientSessionInfo (host, id)); - } else if (si.HostName == host) { - // we already have this and it's still valid - // on the server, so we'll keep it a little longer - si.KeepAlive (); - } else { - // it's very unlikely but the same session id - // could be used by more than one host. In this - // case we replace the older one with the new one - si.Dispose (); - cache.Remove (uid); - cache.Add (uid, new ClientSessionInfo (host, id)); - } - } - } - - // return the first session us - static public byte[] FromHost (string host) - { - lock (locker) { - foreach (ClientSessionInfo si in cache.Values) { - if (si.HostName == host) { - if (si.Valid) { - // ensure it's still valid when we really need it - si.KeepAlive (); - return si.Id; - } - } - } - return null; - } - } - - // only called inside the lock - static private ClientSessionInfo FromContext (Context context, bool checkValidity) - { - if (context == null) - return null; - - byte[] id = context.SessionId; - if ((id == null) || (id.Length == 0)) - return null; - - // do we have a session cached for this host ? - string uid = BitConverter.ToString (id); - - ClientSessionInfo si = (ClientSessionInfo) cache[uid]; - if (si == null) - return null; - - // In the unlikely case of multiple hosts using the same - // session id, we just act like we do not know about it - if (context.ClientSettings.TargetHost != si.HostName) - return null; - - // yes, so what's its status ? - if (checkValidity && !si.Valid) { - si.Dispose (); - cache.Remove (uid); - return null; - } - - // ok, it make sense - return si; - } - - static public bool SetContextInCache (Context context) - { - lock (locker) { - // Don't check the validity because the masterKey of the ClientSessionInfo - // can still be null when this is called the first time - ClientSessionInfo csi = FromContext (context, false); - if (csi == null) - return false; - - csi.GetContext (context); - csi.KeepAlive (); - return true; - } - } - - static public bool SetContextFromCache (Context context) - { - lock (locker) { - ClientSessionInfo csi = FromContext (context, true); - if (csi == null) - return false; - - csi.SetContext (context); - csi.KeepAlive (); - return true; - } - } - } -} diff --git a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/ContentType.cs b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/ContentType.cs deleted file mode 100644 index e07d64e461..0000000000 --- a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/ContentType.cs +++ /dev/null @@ -1,37 +0,0 @@ -// Transport Security Layer (TLS) -// Copyright (c) 2003-2004 Carlos Guzman Alvarez - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; - -namespace Mono.Security.Protocol.Tls -{ - [Serializable] - internal enum ContentType : byte - { - ChangeCipherSpec = 20, - Alert = 21, - Handshake = 22, - ApplicationData = 23, - } -} diff --git a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/Context.cs b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/Context.cs deleted file mode 100644 index 3923daf1a8..0000000000 --- a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/Context.cs +++ /dev/null @@ -1,519 +0,0 @@ -// Transport Security Layer (TLS) -// Copyright (c) 2003-2004 Carlos Guzman Alvarez -// Copyright (C) 2006 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Text; -using System.Collections; -using System.Security.Cryptography; -using System.Security.Cryptography.X509Certificates; - -using Mono.Security.Cryptography; -using Mono.Security.Protocol.Tls.Handshake; - -namespace Mono.Security.Protocol.Tls -{ - internal abstract class Context - { - #region Internal Constants - - internal const short MAX_FRAGMENT_SIZE = 16384; // 2^14 - internal const short TLS1_PROTOCOL_CODE = (0x03 << 8) | 0x01; - internal const short SSL3_PROTOCOL_CODE = (0x03 << 8) | 0x00; - internal const long UNIX_BASE_TICKS = 621355968000000000; - - #endregion - - #region Fields - - // Protocol version - private SecurityProtocolType securityProtocol; - - // Sesison ID - private byte[] sessionId; - - // Compression method - private SecurityCompressionType compressionMethod; - - // Information sent and request by the server in the Handshake protocol - private TlsServerSettings serverSettings; - - // Client configuration - private TlsClientSettings clientSettings; - - // Cipher suite information - private SecurityParameters current; - private SecurityParameters negotiating; - private SecurityParameters read; - private SecurityParameters write; - private CipherSuiteCollection supportedCiphers; - - // Last handshake message received - private HandshakeType lastHandshakeMsg; - - // Handshake negotiation state - private HandshakeState handshakeState; - - // Misc - private bool abbreviatedHandshake; - private bool receivedConnectionEnd; - private bool sentConnectionEnd; - private bool protocolNegotiated; - - // Sequence numbers - private ulong writeSequenceNumber; - private ulong readSequenceNumber; - - // Random data - private byte[] clientRandom; - private byte[] serverRandom; - private byte[] randomCS; - private byte[] randomSC; - - // Key information - private byte[] masterSecret; - private byte[] clientWriteKey; - private byte[] serverWriteKey; - private byte[] clientWriteIV; - private byte[] serverWriteIV; - - // Handshake hashes - private TlsStream handshakeMessages; - - // Secure Random generator - private RandomNumberGenerator random; - - // Record protocol - private RecordProtocol recordProtocol; - - #endregion - - #region Properties - - public bool AbbreviatedHandshake - { - get { return abbreviatedHandshake; } - set { abbreviatedHandshake = value; } - } - - public bool ProtocolNegotiated - { - get { return this.protocolNegotiated; } - set { this.protocolNegotiated = value; } - } - - public bool ChangeCipherSpecDone { get; set; } - - public SecurityProtocolType SecurityProtocol - { - get - { - if ((this.securityProtocol & SecurityProtocolType.Tls) == SecurityProtocolType.Tls || - (this.securityProtocol & SecurityProtocolType.Default) == SecurityProtocolType.Default) - { - return SecurityProtocolType.Tls; - } - else - { - if ((this.securityProtocol & SecurityProtocolType.Ssl3) == SecurityProtocolType.Ssl3) - { - return SecurityProtocolType.Ssl3; - } - } - - throw new NotSupportedException("Unsupported security protocol type"); - } - - set { this.securityProtocol = value; } - } - - public SecurityProtocolType SecurityProtocolFlags - { - get { return this.securityProtocol; } - } - - public short Protocol - { - get - { - switch (this.SecurityProtocol) - { - case SecurityProtocolType.Tls: - case SecurityProtocolType.Default: - return Context.TLS1_PROTOCOL_CODE; - - case SecurityProtocolType.Ssl3: - return Context.SSL3_PROTOCOL_CODE; - - case SecurityProtocolType.Ssl2: - default: - throw new NotSupportedException("Unsupported security protocol type"); - } - } - } - - public byte[] SessionId - { - get { return this.sessionId; } - set { this.sessionId = value; } - } - - public SecurityCompressionType CompressionMethod - { - get { return this.compressionMethod; } - set { this.compressionMethod = value; } - } - - public TlsServerSettings ServerSettings - { - get { return this.serverSettings; } - } - - public TlsClientSettings ClientSettings - { - get { return this.clientSettings; } - } - - public HandshakeType LastHandshakeMsg - { - get { return this.lastHandshakeMsg; } - set { this.lastHandshakeMsg = value; } - } - - public HandshakeState HandshakeState - { - get { return this.handshakeState; } - set { this.handshakeState = value; } - } - - public bool ReceivedConnectionEnd - { - get { return this.receivedConnectionEnd; } - set { this.receivedConnectionEnd = value; } - } - - public bool SentConnectionEnd - { - get { return this.sentConnectionEnd; } - set { this.sentConnectionEnd = value; } - } - - public CipherSuiteCollection SupportedCiphers - { - get { return supportedCiphers; } - set { supportedCiphers = value; } - } - - public TlsStream HandshakeMessages - { - get { return this.handshakeMessages; } - } - - public ulong WriteSequenceNumber - { - get { return this.writeSequenceNumber; } - set { this.writeSequenceNumber = value; } - } - - public ulong ReadSequenceNumber - { - get { return this.readSequenceNumber; } - set { this.readSequenceNumber = value; } - } - - public byte[] ClientRandom - { - get { return this.clientRandom; } - set { this.clientRandom = value; } - } - - public byte[] ServerRandom - { - get { return this.serverRandom; } - set { this.serverRandom = value; } - } - - public byte[] RandomCS - { - get { return this.randomCS; } - set { this.randomCS = value; } - } - - public byte[] RandomSC - { - get { return this.randomSC; } - set { this.randomSC = value; } - } - - public byte[] MasterSecret - { - get { return this.masterSecret; } - set { this.masterSecret = value; } - } - - public byte[] ClientWriteKey - { - get { return this.clientWriteKey; } - set { this.clientWriteKey = value; } - } - - public byte[] ServerWriteKey - { - get { return this.serverWriteKey; } - set { this.serverWriteKey = value; } - } - - public byte[] ClientWriteIV - { - get { return this.clientWriteIV; } - set { this.clientWriteIV = value; } - } - - public byte[] ServerWriteIV - { - get { return this.serverWriteIV; } - set { this.serverWriteIV = value; } - } - - public RecordProtocol RecordProtocol - { - get { return this.recordProtocol; } - set { this.recordProtocol = value; } - } - - #endregion - - #region Constructors - - public Context(SecurityProtocolType securityProtocolType) - { - this.SecurityProtocol = securityProtocolType; - this.compressionMethod = SecurityCompressionType.None; - this.serverSettings = new TlsServerSettings(); - this.clientSettings = new TlsClientSettings(); - this.handshakeMessages = new TlsStream(); - this.sessionId = null; - this.handshakeState = HandshakeState.None; - this.random = RandomNumberGenerator.Create(); - } - - #endregion - - #region Methods - - public int GetUnixTime() - { - DateTime now = DateTime.UtcNow; - - return (int)((now.Ticks - UNIX_BASE_TICKS) / TimeSpan.TicksPerSecond); - } - - public byte[] GetSecureRandomBytes(int count) - { - byte[] secureBytes = new byte[count]; - - this.random.GetNonZeroBytes(secureBytes); - - return secureBytes; - } - - public virtual void Clear() - { - this.compressionMethod = SecurityCompressionType.None; - this.serverSettings = new TlsServerSettings(); - this.clientSettings = new TlsClientSettings(); - this.handshakeMessages = new TlsStream(); - this.sessionId = null; - this.handshakeState = HandshakeState.None; - - this.ClearKeyInfo(); - } - - public virtual void ClearKeyInfo() - { - // Clear Master Secret - if (masterSecret != null) { - Array.Clear (masterSecret, 0, masterSecret.Length); - masterSecret = null; - } - - // Clear client and server random - if (clientRandom != null) { - Array.Clear (clientRandom, 0, clientRandom.Length); - clientRandom = null; - } - if (serverRandom != null) { - Array.Clear (serverRandom, 0, serverRandom.Length); - serverRandom = null; - } - if (randomCS != null) { - Array.Clear (randomCS, 0, randomCS.Length); - randomCS = null; - } - if (randomSC != null) { - Array.Clear (randomSC, 0, randomSC.Length); - randomSC = null; - } - - // Clear client keys - if (clientWriteKey != null) { - Array.Clear (clientWriteKey, 0, clientWriteKey.Length); - clientWriteKey = null; - } - if (clientWriteIV != null) { - Array.Clear (clientWriteIV, 0, clientWriteIV.Length); - clientWriteIV = null; - } - - // Clear server keys - if (serverWriteKey != null) { - Array.Clear (serverWriteKey, 0, serverWriteKey.Length); - serverWriteKey = null; - } - if (serverWriteIV != null) { - Array.Clear (serverWriteIV, 0, serverWriteIV.Length); - serverWriteIV = null; - } - - // Reset handshake messages - this.handshakeMessages.Reset(); - - // Clear MAC keys if protocol is different than Ssl3 - // SSLv3 needs them inside Mono.Security.Protocol.Tls.SslCipherSuite.Compute[Client|Server]RecordMAC - if (this.securityProtocol != SecurityProtocolType.Ssl3) - { -// this.clientWriteMAC = null; -// this.serverWriteMAC = null; - } - } - - public SecurityProtocolType DecodeProtocolCode (short code, bool allowFallback = false) - { - switch (code) - { - case Context.TLS1_PROTOCOL_CODE: - return SecurityProtocolType.Tls; - - case Context.SSL3_PROTOCOL_CODE: - return SecurityProtocolType.Ssl3; - - default: - // if allowed we'll continue using TLS (1.0) even if the other side is capable of using a newer - // version of the TLS protocol - if (allowFallback && (code > (short) Context.TLS1_PROTOCOL_CODE)) - return SecurityProtocolType.Tls; - throw new NotSupportedException("Unsupported security protocol type"); - } - } - - public void ChangeProtocol(short protocol) - { - SecurityProtocolType protocolType = this.DecodeProtocolCode(protocol); - - if ((protocolType & this.SecurityProtocolFlags) == protocolType || - (this.SecurityProtocolFlags & SecurityProtocolType.Default) == SecurityProtocolType.Default) - { - this.SecurityProtocol = protocolType; - this.SupportedCiphers = CipherSuiteFactory.GetSupportedCiphers ((this is ServerContext), protocolType); - } - else - { - throw new TlsException(AlertDescription.ProtocolVersion, "Incorrect protocol version received from server"); - } - } - - - public SecurityParameters Current - { - get - { - if (current == null) - current = new SecurityParameters (); - if (current.Cipher != null) - current.Cipher.Context = this; - return current; - } - } - - public SecurityParameters Negotiating - { - get - { - if (negotiating == null) - negotiating = new SecurityParameters (); - if (negotiating.Cipher != null) - negotiating.Cipher.Context = this; - return negotiating; - } - } - - public SecurityParameters Read - { - get { return read; } - } - - public SecurityParameters Write - { - get { return write; } - } - - public void StartSwitchingSecurityParameters (bool client) - { - if (client) { - // everything we write from now on is encrypted - write = negotiating; - // but we still read with the older cipher until we - // receive the ChangeCipherSpec message - read = current; - } else { - // everything we read from now on is encrypted - read = negotiating; - // but we still write with the older cipher until we - // receive the ChangeCipherSpec message - write = current; - } - current = negotiating; - } - - public void EndSwitchingSecurityParameters (bool client) - { - SecurityParameters temp; - if (client) { - temp = read; - // we now read with the new, negotiated, security parameters - read = current; - } else { - temp = write; - // we now write with the new, negotiated, security parameters - write = current; - } - // so we clear the old one (last reference) - if (temp != null) - temp.Clear (); - negotiating = temp; - // and are now ready for a future renegotiation - } - - #endregion - } -} diff --git a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/DebugHelper.cs b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/DebugHelper.cs deleted file mode 100644 index ff122878c9..0000000000 --- a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/DebugHelper.cs +++ /dev/null @@ -1,95 +0,0 @@ -// Transport Security Layer (TLS) -// Copyright (c) 2003-2004 Carlos Guzman Alvarez - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Diagnostics; - -namespace Mono.Security.Protocol.Tls -{ - internal class DebugHelper - { - private static bool isInitialized; - - [Conditional("DEBUG")] - public static void Initialize() - { - if (!isInitialized) - { -#if !MOBILE - Debug.Listeners.Add(new TextWriterTraceListener(Console.Out)); - // Debug.Listeners.Add(new TextWriterTraceListener(@"c:\ssl.log")); - Debug.AutoFlush = true; - Debug.Indent(); -#endif - - isInitialized = true; - } - } - - [Conditional("DEBUG")] - public static void WriteLine(string format, params object[] args) - { - Initialize(); - Debug.WriteLine(String.Format(format, args)); - } - - [Conditional("DEBUG")] - public static void WriteLine(string message) - { - Initialize(); - Debug.WriteLine(message); - } - - [Conditional("DEBUG")] - public static void WriteLine(string message, byte[] buffer) - { - Initialize(); - DebugHelper.WriteLine(String.Format("{0} ({1} bytes))", message, buffer.Length)); - DebugHelper.WriteBuffer(buffer); - } - - [Conditional("DEBUG")] - public static void WriteBuffer(byte[] buffer) - { - Initialize(); - DebugHelper.WriteBuffer(buffer, 0, buffer.Length); - } - - [Conditional("DEBUG")] - public static void WriteBuffer(byte[] buffer, int index, int length) - { - Initialize(); - for (int i = index; i < length; i += 16) - { - int count = (length - i) >= 16 ? 16 : (length - i); - string buf = ""; - for (int j = 0; j < count; j++) - { - buf += buffer[i + j].ToString("x2") + " "; - } - Debug.WriteLine(buf); - } - } - } -} diff --git a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/ExchangeAlgorithmType.cs b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/ExchangeAlgorithmType.cs deleted file mode 100644 index 3f5156ea93..0000000000 --- a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/ExchangeAlgorithmType.cs +++ /dev/null @@ -1,43 +0,0 @@ -// Transport Security Layer (TLS) -// Copyright (c) 2003-2004 Carlos Guzman Alvarez - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; - -namespace Mono.Security.Protocol.Tls -{ -#if INSIDE_SYSTEM - internal -#else - [Serializable] - public -#endif - enum ExchangeAlgorithmType - { - DiffieHellman, - Fortezza, - None, - RsaKeyX, - RsaSign - } -} diff --git a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/HandshakeState.cs b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/HandshakeState.cs deleted file mode 100644 index cf15386f0f..0000000000 --- a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/HandshakeState.cs +++ /dev/null @@ -1,36 +0,0 @@ -// Transport Security Layer (TLS) -// Copyright (c) 2003-2004 Carlos Guzman Alvarez - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; - -namespace Mono.Security.Protocol.Tls -{ - [Serializable] - internal enum HandshakeState - { - None, - Started, - Finished - } -} diff --git a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/HashAlgorithmType.cs b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/HashAlgorithmType.cs deleted file mode 100644 index 3f6a60cd7c..0000000000 --- a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/HashAlgorithmType.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Transport Security Layer (TLS) -// Copyright (c) 2003-2004 Carlos Guzman Alvarez - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; - -namespace Mono.Security.Protocol.Tls -{ -#if INSIDE_SYSTEM - internal -#else - [Serializable] - public -#endif - enum HashAlgorithmType - { - Md5, - None, - Sha1 - } -} diff --git a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/HttpsClientStream.cs b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/HttpsClientStream.cs deleted file mode 100644 index 6eb85f5389..0000000000 --- a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/HttpsClientStream.cs +++ /dev/null @@ -1,122 +0,0 @@ -// -// HttpsClientStream.cs: Glue between HttpWebRequest and SslClientStream to -// reduce reflection usage. -// -// Author: -// Sebastien Pouliot -// -// Copyright (C) 2004-2007 Novell, Inc. (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.IO; -using System.Net; -using System.Security.Cryptography; -using System.Security.Cryptography.X509Certificates; -using SNS = System.Net.Security; -using SNCX = System.Security.Cryptography.X509Certificates; - -namespace Mono.Security.Protocol.Tls { - - // Note: DO NOT REUSE this class - instead use SslClientStream - - [Obsolete ("This class is obsolete and will be removed shortly.")] - internal class HttpsClientStream : SslClientStream { - - private HttpWebRequest _request; - private int _status; - - public HttpsClientStream (Stream stream, X509CertificateCollection clientCertificates, - HttpWebRequest request, byte [] buffer) - : base (stream, request.Address.Host, false, (Mono.Security.Protocol.Tls.SecurityProtocolType) - ServicePointManager.SecurityProtocol, clientCertificates) - { - // this constructor permit access to the WebRequest to call - // ICertificatePolicy.CheckValidationResult - _request = request; - _status = 0; - if (buffer != null) - InputBuffer.Write (buffer, 0, buffer.Length); - // also saved from reflection - base.CheckCertRevocationStatus = ServicePointManager.CheckCertificateRevocationList; - - ClientCertSelection += delegate (X509CertificateCollection clientCerts, X509Certificate serverCertificate, - string targetHost, X509CertificateCollection serverRequestedCertificates) { - return ((clientCerts == null) || (clientCerts.Count == 0)) ? null : clientCerts [0]; - }; - PrivateKeySelection += delegate (X509Certificate certificate, string targetHost) { - X509Certificate2 cert = (certificate as X509Certificate2); - return (cert == null) ? null : cert.PrivateKey; - }; - } - - public bool TrustFailure { - get { - switch (_status) { - case -2146762486: // CERT_E_CHAINING 0x800B010A - case -2146762487: // CERT_E_UNTRUSTEDROOT 0x800B0109 - return true; - default: - return false; - } - } - } - - internal override bool RaiseServerCertificateValidation (X509Certificate certificate, int[] certificateErrors) - { - bool failed = (certificateErrors.Length > 0); - // only one problem can be reported by this interface - _status = ((failed) ? certificateErrors [0] : 0); - -#pragma warning disable 618 - if (ServicePointManager.CertificatePolicy != null) { - ServicePoint sp = _request.ServicePoint; - bool res = ServicePointManager.CertificatePolicy.CheckValidationResult (sp, certificate, _request, _status); - if (!res) - return false; - failed = true; - } -#pragma warning restore 618 - if (HaveRemoteValidation2Callback) - return failed; // The validation already tried the 2.0 callback - - SNS.RemoteCertificateValidationCallback cb = ServicePointManager.ServerCertificateValidationCallback; - if (cb != null) { - SNS.SslPolicyErrors ssl_errors = 0; - foreach (int i in certificateErrors) { - if (i == (int)-2146762490) // TODO: is this what happens when the purpose is wrong? - ssl_errors |= SNS.SslPolicyErrors.RemoteCertificateNotAvailable; - else if (i == (int) -2146762481) - ssl_errors |= SNS.SslPolicyErrors.RemoteCertificateNameMismatch; - else - ssl_errors |= SNS.SslPolicyErrors.RemoteCertificateChainErrors; - } - SNCX.X509Certificate2 cert2 = new SNCX.X509Certificate2 (certificate.GetRawCertData ()); - SNCX.X509Chain chain = new SNCX.X509Chain (); - if (!chain.Build (cert2)) - ssl_errors |= SNS.SslPolicyErrors.RemoteCertificateChainErrors; - return cb (_request, cert2, chain, ssl_errors); - } - return failed; - } - } -} diff --git a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/MD5SHA1.cs b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/MD5SHA1.cs deleted file mode 100644 index 01680df44e..0000000000 --- a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/MD5SHA1.cs +++ /dev/null @@ -1,146 +0,0 @@ - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -/* Transport Security Layer (TLS) - * Copyright (c) 2003-2004 Carlos Guzman Alvarez - * - * Permission is hereby granted, free of charge, to any person - * obtaining a copy of this software and associated documentation - * files (the "Software"), to deal in the Software without restriction, - * including without limitation the rights to use, copy, modify, merge, - * publish, distribute, sublicense, and/or sell copies of the Software, - * and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES - * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT - * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - -using System; -using System.Security.Cryptography; - -namespace Mono.Security.Protocol.Tls -{ - internal class MD5SHA1 : HashAlgorithm - { - #region Fields - - private HashAlgorithm md5; - private HashAlgorithm sha; - private bool hashing; - - #endregion - - #region Constructors - - public MD5SHA1() : base() - { - this.md5 = MD5.Create(); - this.sha = SHA1.Create(); - - // Set HashSizeValue - this.HashSizeValue = this.md5.HashSize + this.sha.HashSize; - } - - #endregion - - #region Methods - - public override void Initialize() - { - this.md5.Initialize(); - this.sha.Initialize(); - this.hashing = false; - } - - protected override byte[] HashFinal() - { - if (!hashing) - { - this.hashing = true; - } - // Finalize the original hash - this.md5.TransformFinalBlock(new byte[0], 0, 0); - this.sha.TransformFinalBlock(new byte[0], 0, 0); - - byte[] hash = new byte[36]; - - Buffer.BlockCopy(this.md5.Hash, 0, hash, 0, 16); - Buffer.BlockCopy(this.sha.Hash, 0, hash, 16, 20); - - return hash; - } - - protected override void HashCore( - byte[] array, - int ibStart, - int cbSize) - { - if (!hashing) - { - hashing = true; - } - this.md5.TransformBlock(array, ibStart, cbSize, array, ibStart); - this.sha.TransformBlock(array, ibStart, cbSize, array, ibStart); - } - - public byte[] CreateSignature(RSA rsa) - { - if (rsa == null) - { - throw new CryptographicUnexpectedOperationException ("missing key"); - } - - RSASslSignatureFormatter f = new RSASslSignatureFormatter(rsa); - f.SetHashAlgorithm("MD5SHA1"); - - return f.CreateSignature(this.Hash); - } - - public bool VerifySignature(RSA rsa, byte[] rgbSignature) - { - if (rsa == null) - { - throw new CryptographicUnexpectedOperationException ("missing key"); - } - if (rgbSignature == null) - { - throw new ArgumentNullException ("rgbSignature"); - } - - RSASslSignatureDeformatter d = new RSASslSignatureDeformatter(rsa); - d.SetHashAlgorithm("MD5SHA1"); - - return d.VerifySignature(this.Hash, rgbSignature); - } - - #endregion - } -} diff --git a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/RSASslSignatureDeformatter.cs b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/RSASslSignatureDeformatter.cs deleted file mode 100644 index 8131197887..0000000000 --- a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/RSASslSignatureDeformatter.cs +++ /dev/null @@ -1,108 +0,0 @@ -// Transport Security Layer (TLS) -// Copyright (c) 2003-2004 Carlos Guzman Alvarez - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Security.Cryptography; - -namespace Mono.Security.Protocol.Tls -{ - internal class RSASslSignatureDeformatter : AsymmetricSignatureDeformatter - { - #region Fields - - private RSA key; - private HashAlgorithm hash; - - #endregion - - #region Constructors - - public RSASslSignatureDeformatter() - { - } - - public RSASslSignatureDeformatter(AsymmetricAlgorithm key) - { - this.SetKey(key); - } - - #endregion - - #region Methods - - public override bool VerifySignature( - byte[] rgbHash, - byte[] rgbSignature) - { - if (this.key == null) - { - throw new CryptographicUnexpectedOperationException("The key is a null reference"); - } - if (hash == null) - { - throw new CryptographicUnexpectedOperationException("The hash algorithm is a null reference."); - } - if (rgbHash == null) - { - throw new ArgumentNullException("The rgbHash parameter is a null reference."); - } - - return Mono.Security.Cryptography.PKCS1.Verify_v15( - this.key, - this.hash, - rgbHash, - rgbSignature); - } - - public override void SetHashAlgorithm(string strName) - { -#if INSIDE_SYSTEM - hash = new Mono.Security.Cryptography.MD5SHA1 (); -#else - switch (strName) - { - case "MD5SHA1": - this.hash = new MD5SHA1(); - break; - - default: - this.hash = HashAlgorithm.Create(strName); - break; - } -#endif - } - - public override void SetKey(AsymmetricAlgorithm key) - { - if (!(key is RSA)) - { - throw new ArgumentException("Specfied key is not an RSA key"); - } - - this.key = key as RSA; - } - - #endregion - } -} diff --git a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/RSASslSignatureFormatter.cs b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/RSASslSignatureFormatter.cs deleted file mode 100644 index b313f005a9..0000000000 --- a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/RSASslSignatureFormatter.cs +++ /dev/null @@ -1,105 +0,0 @@ -// Transport Security Layer (TLS) -// Copyright (c) 2003-2004 Carlos Guzman Alvarez - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Security.Cryptography; - -namespace Mono.Security.Protocol.Tls -{ - internal class RSASslSignatureFormatter : AsymmetricSignatureFormatter - { - #region Fields - - private RSA key; - private HashAlgorithm hash; - - #endregion - - #region Constructors - - public RSASslSignatureFormatter() - { - } - - public RSASslSignatureFormatter(AsymmetricAlgorithm key) - { - this.SetKey(key); - } - - #endregion - - #region Methods - - public override byte[] CreateSignature(byte[] rgbHash) - { - if (this.key == null) - { - throw new CryptographicUnexpectedOperationException("The key is a null reference"); - } - if (hash == null) - { - throw new CryptographicUnexpectedOperationException("The hash algorithm is a null reference."); - } - if (rgbHash == null) - { - throw new ArgumentNullException("The rgbHash parameter is a null reference."); - } - - return Mono.Security.Cryptography.PKCS1.Sign_v15( - this.key, - this.hash, - rgbHash); - } - - public override void SetHashAlgorithm(string strName) - { -#if INSIDE_SYSTEM - hash = new Mono.Security.Cryptography.MD5SHA1 (); -#else - switch (strName) - { - case "MD5SHA1": - this.hash = new MD5SHA1(); - break; - - default: - this.hash = HashAlgorithm.Create(strName); - break; - } -#endif - } - - public override void SetKey(AsymmetricAlgorithm key) - { - if (!(key is RSA)) - { - throw new ArgumentException("Specfied key is not an RSA key"); - } - - this.key = key as RSA; - } - - #endregion - } -} diff --git a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/RecordProtocol.cs b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/RecordProtocol.cs deleted file mode 100644 index 30270c801c..0000000000 --- a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/RecordProtocol.cs +++ /dev/null @@ -1,965 +0,0 @@ -// Transport Security Layer (TLS) -// Copyright (c) 2003-2004 Carlos Guzman Alvarez -// Copyright (C) 2006-2007 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Collections; -using System.IO; -using System.Threading; - -using Mono.Security.Protocol.Tls.Handshake; - -namespace Mono.Security.Protocol.Tls -{ - internal abstract class RecordProtocol - { - #region Fields - - private static ManualResetEvent record_processing = new ManualResetEvent (true); - - protected Stream innerStream; - protected Context context; - - #endregion - - #region Properties - - public Context Context - { - get { return this.context; } - set { this.context = value; } - } - - #endregion - - #region Constructors - - public RecordProtocol(Stream innerStream, Context context) - { - this.innerStream = innerStream; - this.context = context; - this.context.RecordProtocol = this; - } - - #endregion - - #region Abstract Methods - - public virtual void SendRecord(HandshakeType type) - { - - IAsyncResult ar = this.BeginSendRecord(type, null, null); - - this.EndSendRecord(ar); - - } - - protected abstract void ProcessHandshakeMessage(TlsStream handMsg); - - protected virtual void ProcessChangeCipherSpec () - { - Context ctx = this.Context; - - // Reset sequence numbers - ctx.ReadSequenceNumber = 0; - - if (ctx is ClientContext) { - ctx.EndSwitchingSecurityParameters (true); - } else { - ctx.StartSwitchingSecurityParameters (false); - } - - ctx.ChangeCipherSpecDone = true; - } - - public virtual HandshakeMessage GetMessage(HandshakeType type) - { - throw new NotSupportedException(); - } - - #endregion - - #region Receive Record Async Result - private class ReceiveRecordAsyncResult : IAsyncResult - { - private object locker = new object (); - private AsyncCallback _userCallback; - private object _userState; - private Exception _asyncException; - private ManualResetEvent handle; - private byte[] _resultingBuffer; - private Stream _record; - private bool completed; - - private byte[] _initialBuffer; - - public ReceiveRecordAsyncResult(AsyncCallback userCallback, object userState, byte[] initialBuffer, Stream record) - { - _userCallback = userCallback; - _userState = userState; - _initialBuffer = initialBuffer; - _record = record; - } - - public Stream Record - { - get { return _record; } - } - - public byte[] ResultingBuffer - { - get { return _resultingBuffer; } - } - - public byte[] InitialBuffer - { - get { return _initialBuffer; } - } - - public object AsyncState - { - get { return _userState; } - } - - public Exception AsyncException - { - get { return _asyncException; } - } - - public bool CompletedWithError - { - get { - if (!IsCompleted) - return false; // Perhaps throw InvalidOperationExcetion? - - return null != _asyncException; - } - } - - public WaitHandle AsyncWaitHandle - { - get { - lock (locker) { - if (handle == null) - handle = new ManualResetEvent (completed); - } - return handle; - } - - } - - public bool CompletedSynchronously - { - get { return false; } - } - - public bool IsCompleted - { - get { - lock (locker) { - return completed; - } - } - } - - private void SetComplete(Exception ex, byte[] resultingBuffer) - { - lock (locker) { - if (completed) - return; - - completed = true; - _asyncException = ex; - _resultingBuffer = resultingBuffer; - if (handle != null) - handle.Set (); - - if (_userCallback != null) - _userCallback.BeginInvoke (this, null, null); - } - } - - public void SetComplete(Exception ex) - { - SetComplete(ex, null); - } - - public void SetComplete(byte[] resultingBuffer) - { - SetComplete(null, resultingBuffer); - } - - public void SetComplete() - { - SetComplete(null, null); - } - } - #endregion - - #region Receive Record Async Result - private class SendRecordAsyncResult : IAsyncResult - { - private object locker = new object (); - private AsyncCallback _userCallback; - private object _userState; - private Exception _asyncException; - private ManualResetEvent handle; - private HandshakeMessage _message; - private bool completed; - - public SendRecordAsyncResult(AsyncCallback userCallback, object userState, HandshakeMessage message) - { - _userCallback = userCallback; - _userState = userState; - _message = message; - } - - public HandshakeMessage Message - { - get { return _message; } - } - - public object AsyncState - { - get { return _userState; } - } - - public Exception AsyncException - { - get { return _asyncException; } - } - - public bool CompletedWithError - { - get { - if (!IsCompleted) - return false; // Perhaps throw InvalidOperationExcetion? - - return null != _asyncException; - } - } - - public WaitHandle AsyncWaitHandle - { - get { - lock (locker) { - if (handle == null) - handle = new ManualResetEvent (completed); - } - return handle; - } - - } - - public bool CompletedSynchronously - { - get { return false; } - } - - public bool IsCompleted - { - get { - lock (locker) { - return completed; - } - } - } - - public void SetComplete(Exception ex) - { - lock (locker) { - if (completed) - return; - - completed = true; - if (handle != null) - handle.Set (); - - if (_userCallback != null) - _userCallback.BeginInvoke (this, null, null); - - _asyncException = ex; - } - } - - public void SetComplete() - { - SetComplete(null); - } - } - #endregion - - #region Reveive Record Methods - - public IAsyncResult BeginReceiveRecord(Stream record, AsyncCallback callback, object state) - { - if (this.context.ReceivedConnectionEnd) - { - throw new TlsException( - AlertDescription.InternalError, - "The session is finished and it's no longer valid."); - } - - record_processing.Reset (); - byte[] recordTypeBuffer = new byte[1]; - - ReceiveRecordAsyncResult internalResult = new ReceiveRecordAsyncResult(callback, state, recordTypeBuffer, record); - - record.BeginRead(internalResult.InitialBuffer, 0, internalResult.InitialBuffer.Length, new AsyncCallback(InternalReceiveRecordCallback), internalResult); - - return internalResult; - } - - private void InternalReceiveRecordCallback(IAsyncResult asyncResult) - { - ReceiveRecordAsyncResult internalResult = asyncResult.AsyncState as ReceiveRecordAsyncResult; - Stream record = internalResult.Record; - - try - { - - int bytesRead = internalResult.Record.EndRead(asyncResult); - - //We're at the end of the stream. Time to bail. - if (bytesRead == 0) - { - internalResult.SetComplete((byte[])null); - return; - } - - // Try to read the Record Content Type - int type = internalResult.InitialBuffer[0]; - - ContentType contentType = (ContentType)type; - byte[] buffer = this.ReadRecordBuffer(type, record); - if (buffer == null) - { - // record incomplete (at the moment) - internalResult.SetComplete((byte[])null); - return; - } - - // Decrypt message contents if needed - if (contentType == ContentType.Alert && buffer.Length == 2) - { - } - else if ((this.Context.Read != null) && (this.Context.Read.Cipher != null)) - { - buffer = this.decryptRecordFragment (contentType, buffer); - DebugHelper.WriteLine ("Decrypted record data", buffer); - } - - // Process record - switch (contentType) - { - case ContentType.Alert: - this.ProcessAlert((AlertLevel)buffer [0], (AlertDescription)buffer [1]); - if (record.CanSeek) - { - // don't reprocess that memory block - record.SetLength (0); - } - buffer = null; - break; - - case ContentType.ChangeCipherSpec: - this.ProcessChangeCipherSpec(); - break; - - case ContentType.ApplicationData: - break; - - case ContentType.Handshake: - TlsStream message = new TlsStream (buffer); - while (!message.EOF) - { - this.ProcessHandshakeMessage(message); - } - break; - - case (ContentType)0x80: - this.context.HandshakeMessages.Write (buffer); - break; - - default: - throw new TlsException( - AlertDescription.UnexpectedMessage, - "Unknown record received from server."); - } - - internalResult.SetComplete(buffer); - } - catch (Exception ex) - { - internalResult.SetComplete(ex); - } - - } - - public byte[] EndReceiveRecord(IAsyncResult asyncResult) - { - ReceiveRecordAsyncResult internalResult = asyncResult as ReceiveRecordAsyncResult; - - if (null == internalResult) - throw new ArgumentException("Either the provided async result is null or was not created by this RecordProtocol."); - - if (!internalResult.IsCompleted) - internalResult.AsyncWaitHandle.WaitOne(); - - if (internalResult.CompletedWithError) - throw internalResult.AsyncException; - - byte[] result = internalResult.ResultingBuffer; - record_processing.Set (); - return result; - } - - public byte[] ReceiveRecord(Stream record) - { - if (this.context.ReceivedConnectionEnd) - { - throw new TlsException( - AlertDescription.InternalError, - "The session is finished and it's no longer valid."); - } - - record_processing.Reset (); - byte[] recordTypeBuffer = new byte[1]; - - int bytesRead = record.Read(recordTypeBuffer, 0, recordTypeBuffer.Length); - - //We're at the end of the stream. Time to bail. - if (bytesRead == 0) - { - return null; - } - - // Try to read the Record Content Type - int type = recordTypeBuffer[0]; - - ContentType contentType = (ContentType)type; - byte[] buffer = this.ReadRecordBuffer(type, record); - if (buffer == null) - { - // record incomplete (at the moment) - return null; - } - - // Decrypt message contents if needed - if (contentType == ContentType.Alert && buffer.Length == 2) - { - } - else if ((this.Context.Read != null) && (this.Context.Read.Cipher != null)) - { - buffer = this.decryptRecordFragment (contentType, buffer); - DebugHelper.WriteLine ("Decrypted record data", buffer); - } - - // Process record - switch (contentType) - { - case ContentType.Alert: - this.ProcessAlert((AlertLevel)buffer [0], (AlertDescription)buffer [1]); - if (record.CanSeek) - { - // don't reprocess that memory block - record.SetLength (0); - } - buffer = null; - break; - - case ContentType.ChangeCipherSpec: - this.ProcessChangeCipherSpec(); - break; - - case ContentType.ApplicationData: - break; - - case ContentType.Handshake: - TlsStream message = new TlsStream (buffer); - while (!message.EOF) - { - this.ProcessHandshakeMessage(message); - } - break; - - case (ContentType)0x80: - this.context.HandshakeMessages.Write (buffer); - break; - - default: - throw new TlsException( - AlertDescription.UnexpectedMessage, - "Unknown record received from server."); - } - - record_processing.Set (); - return buffer; - } - - private byte[] ReadRecordBuffer (int contentType, Stream record) - { - if (!Enum.IsDefined(typeof(ContentType), (ContentType)contentType)) - { - throw new TlsException(AlertDescription.DecodeError); - } - - byte[] header = new byte[4]; - if (record.Read (header, 0, 4) != 4) - throw new TlsException ("buffer underrun"); - - short protocol = (short)((header [0] << 8) | header [1]); - short length = (short)((header [2] << 8) | header [3]); - - // process further only if the whole record is available - // note: the first 5 bytes aren't part of the length - if (record.CanSeek && (length + 5 > record.Length)) - { - return null; - } - - // Read Record data - int totalReceived = 0; - byte[] buffer = new byte[length]; - while (totalReceived != length) - { - int justReceived = record.Read(buffer, totalReceived, buffer.Length - totalReceived); - - //Make sure we get some data so we don't end up in an infinite loop here before shutdown. - if (0 == justReceived) - { - throw new TlsException(AlertDescription.CloseNotify, "Received 0 bytes from stream. It must be closed."); - } - - totalReceived += justReceived; - } - - // Check that the message has a valid protocol version - if (protocol != this.context.Protocol && this.context.ProtocolNegotiated) - { - throw new TlsException( - AlertDescription.ProtocolVersion, "Invalid protocol version on message received"); - } - - DebugHelper.WriteLine("Record data", buffer); - - return buffer; - } - - private void ProcessAlert(AlertLevel alertLevel, AlertDescription alertDesc) - { - switch (alertLevel) - { - case AlertLevel.Fatal: - throw new TlsException(alertLevel, alertDesc); - - case AlertLevel.Warning: - default: - switch (alertDesc) - { - case AlertDescription.CloseNotify: - this.context.ReceivedConnectionEnd = true; - break; - } - break; - } - } - - #endregion - - #region Send Alert Methods - - internal void SendAlert(ref Exception ex) - { - var tlsEx = ex as TlsException; - var alert = tlsEx != null ? tlsEx.Alert : new Alert(AlertDescription.InternalError); - - try { - SendAlert(alert); - } catch (Exception alertEx) { - ex = new IOException (string.Format ("Error while sending TLS Alert ({0}:{1}): {2}", alert.Level, alert.Description, ex), alertEx); - } - } - - public void SendAlert(AlertDescription description) - { - this.SendAlert(new Alert(description)); - } - - public void SendAlert(AlertLevel level, AlertDescription description) - { - this.SendAlert(new Alert(level, description)); - } - - public void SendAlert(Alert alert) - { - AlertLevel level; - AlertDescription description; - bool close; - - if (alert == null) { - DebugHelper.WriteLine(">>>> Write Alert NULL"); - level = AlertLevel.Fatal; - description = AlertDescription.InternalError; - close = true; - } else { - DebugHelper.WriteLine(">>>> Write Alert ({0}|{1})", alert.Description, alert.Message); - level = alert.Level; - description = alert.Description; - close = alert.IsCloseNotify; - } - - // Write record - this.SendRecord (ContentType.Alert, new byte[2] { (byte) level, (byte) description }); - - if (close) { - this.context.SentConnectionEnd = true; - } - } - - #endregion - - #region Send Record Methods - - public void SendChangeCipherSpec() - { - DebugHelper.WriteLine(">>>> Write Change Cipher Spec"); - - // Send Change Cipher Spec message with the current cipher - // or as plain text if this is the initial negotiation - this.SendRecord(ContentType.ChangeCipherSpec, new byte[] {1}); - - Context ctx = this.context; - - // Reset sequence numbers - ctx.WriteSequenceNumber = 0; - - // all further data sent will be encrypted with the negotiated - // security parameters (now the current parameters) - if (ctx is ClientContext) { - ctx.StartSwitchingSecurityParameters (true); - } else { - ctx.EndSwitchingSecurityParameters (false); - } - } - - public void SendChangeCipherSpec(Stream recordStream) - { - DebugHelper.WriteLine(">>>> Write Change Cipher Spec"); - - byte[] record = this.EncodeRecord (ContentType.ChangeCipherSpec, new byte[] { 1 }); - - // Send Change Cipher Spec message with the current cipher - // or as plain text if this is the initial negotiation - recordStream.Write(record, 0, record.Length); - - Context ctx = this.context; - - // Reset sequence numbers - ctx.WriteSequenceNumber = 0; - - // all further data sent will be encrypted with the negotiated - // security parameters (now the current parameters) - if (ctx is ClientContext) { - ctx.StartSwitchingSecurityParameters (true); - } else { - ctx.EndSwitchingSecurityParameters (false); - } - } - - public IAsyncResult BeginSendChangeCipherSpec(AsyncCallback callback, object state) - { - DebugHelper.WriteLine (">>>> Write Change Cipher Spec"); - - // Send Change Cipher Spec message with the current cipher - // or as plain text if this is the initial negotiation - return this.BeginSendRecord (ContentType.ChangeCipherSpec, new byte[] { 1 }, callback, state); - } - - public void EndSendChangeCipherSpec (IAsyncResult asyncResult) - { - this.EndSendRecord (asyncResult); - - Context ctx = this.context; - - // Reset sequence numbers - ctx.WriteSequenceNumber = 0; - - // all further data sent will be encrypted with the negotiated - // security parameters (now the current parameters) - if (ctx is ClientContext) { - ctx.StartSwitchingSecurityParameters (true); - } else { - ctx.EndSwitchingSecurityParameters (false); - } - } - - public IAsyncResult BeginSendRecord(HandshakeType handshakeType, AsyncCallback callback, object state) - { - HandshakeMessage msg = this.GetMessage(handshakeType); - - msg.Process(); - - DebugHelper.WriteLine(">>>> Write handshake record ({0}|{1})", context.Protocol, msg.ContentType); - - SendRecordAsyncResult internalResult = new SendRecordAsyncResult(callback, state, msg); - - this.BeginSendRecord(msg.ContentType, msg.EncodeMessage(), new AsyncCallback(InternalSendRecordCallback), internalResult); - - return internalResult; - } - - private void InternalSendRecordCallback(IAsyncResult ar) - { - SendRecordAsyncResult internalResult = ar.AsyncState as SendRecordAsyncResult; - - try - { - this.EndSendRecord(ar); - - // Update session - internalResult.Message.Update(); - - // Reset message contents - internalResult.Message.Reset(); - - internalResult.SetComplete(); - } - catch (Exception ex) - { - internalResult.SetComplete(ex); - } - } - - public IAsyncResult BeginSendRecord(ContentType contentType, byte[] recordData, AsyncCallback callback, object state) - { - if (this.context.SentConnectionEnd) - { - throw new TlsException( - AlertDescription.InternalError, - "The session is finished and it's no longer valid."); - } - - byte[] record = this.EncodeRecord(contentType, recordData); - - return this.innerStream.BeginWrite(record, 0, record.Length, callback, state); - } - - public void EndSendRecord(IAsyncResult asyncResult) - { - if (asyncResult is SendRecordAsyncResult) - { - SendRecordAsyncResult internalResult = asyncResult as SendRecordAsyncResult; - if (!internalResult.IsCompleted) - internalResult.AsyncWaitHandle.WaitOne(); - if (internalResult.CompletedWithError) - throw internalResult.AsyncException; - } - else - { - this.innerStream.EndWrite(asyncResult); - } - } - - public void SendRecord(ContentType contentType, byte[] recordData) - { - IAsyncResult ar = this.BeginSendRecord(contentType, recordData, null, null); - - this.EndSendRecord(ar); - } - - public byte[] EncodeRecord(ContentType contentType, byte[] recordData) - { - return this.EncodeRecord( - contentType, - recordData, - 0, - recordData.Length); - } - - public byte[] EncodeRecord( - ContentType contentType, - byte[] recordData, - int offset, - int count) - { - if (this.context.SentConnectionEnd) - { - throw new TlsException( - AlertDescription.InternalError, - "The session is finished and it's no longer valid."); - } - - TlsStream record = new TlsStream(); - - int position = offset; - - while (position < ( offset + count )) - { - short fragmentLength = 0; - byte[] fragment; - - if ((count + offset - position) > Context.MAX_FRAGMENT_SIZE) - { - fragmentLength = Context.MAX_FRAGMENT_SIZE; - } - else - { - fragmentLength = (short)(count + offset - position); - } - - // Fill the fragment data - fragment = new byte[fragmentLength]; - Buffer.BlockCopy(recordData, position, fragment, 0, fragmentLength); - - if ((this.Context.Write != null) && (this.Context.Write.Cipher != null)) - { - // Encrypt fragment - fragment = this.encryptRecordFragment (contentType, fragment); - } - - // Write tls message - record.Write((byte)contentType); - record.Write(this.context.Protocol); - record.Write((short)fragment.Length); - record.Write(fragment); - - DebugHelper.WriteLine("Record data", fragment); - - // Update buffer position - position += fragmentLength; - } - - return record.ToArray(); - } - - public byte[] EncodeHandshakeRecord(HandshakeType handshakeType) - { - HandshakeMessage msg = this.GetMessage(handshakeType); - - msg.Process(); - - var bytes = this.EncodeRecord (msg.ContentType, msg.EncodeMessage ()); - - msg.Update(); - - msg.Reset(); - - return bytes; - } - - #endregion - - #region Cryptography Methods - - private byte[] encryptRecordFragment( - ContentType contentType, - byte[] fragment) - { - byte[] mac = null; - - // Calculate message MAC - if (this.Context is ClientContext) - { - mac = this.context.Write.Cipher.ComputeClientRecordMAC(contentType, fragment); - } - else - { - mac = this.context.Write.Cipher.ComputeServerRecordMAC (contentType, fragment); - } - - DebugHelper.WriteLine(">>>> Record MAC", mac); - - // Encrypt the message - byte[] ecr = this.context.Write.Cipher.EncryptRecord (fragment, mac); - - // Update sequence number - this.context.WriteSequenceNumber++; - - return ecr; - } - - private byte[] decryptRecordFragment( - ContentType contentType, - byte[] fragment) - { - byte[] dcrFragment = null; - byte[] dcrMAC = null; - - try - { - this.context.Read.Cipher.DecryptRecord (fragment, out dcrFragment, out dcrMAC); - } - catch - { - if (this.context is ServerContext) - { - this.Context.RecordProtocol.SendAlert(AlertDescription.DecryptionFailed); - } - throw; - } - - // Generate record MAC - byte[] mac = null; - - if (this.Context is ClientContext) - { - mac = this.context.Read.Cipher.ComputeServerRecordMAC(contentType, dcrFragment); - } - else - { - mac = this.context.Read.Cipher.ComputeClientRecordMAC (contentType, dcrFragment); - } - - DebugHelper.WriteLine(">>>> Record MAC", mac); - - // Check record MAC - if (!Compare (mac, dcrMAC)) - { - throw new TlsException(AlertDescription.BadRecordMAC, "Bad record MAC"); - } - - // Update sequence number - this.context.ReadSequenceNumber++; - - return dcrFragment; - } - - private bool Compare (byte[] array1, byte[] array2) - { - if (array1 == null) - return (array2 == null); - if (array2 == null) - return false; - if (array1.Length != array2.Length) - return false; - for (int i = 0; i < array1.Length; i++) { - if (array1[i] != array2[i]) - return false; - } - return true; - } - - #endregion - } -} diff --git a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/SecurityCompressionType.cs b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/SecurityCompressionType.cs deleted file mode 100644 index 07f5c49a38..0000000000 --- a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/SecurityCompressionType.cs +++ /dev/null @@ -1,42 +0,0 @@ -// Transport Security Layer (TLS) -// Copyright (c) 2003-2004 Carlos Guzman Alvarez - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; - -namespace Mono.Security.Protocol.Tls -{ - // Information about compression methods allowed by TLS - // can be found in: - // draft-ietf-tls-compression-05.txt (http://www.ietf.org/internet-drafts/draft-ietf-tls-compression-05.txt) -#if INSIDE_SYSTEM - internal -#else - public -#endif - enum SecurityCompressionType - { - None = 0, - Zlib = 1 - } -} diff --git a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/SecurityProtocolType.cs b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/SecurityProtocolType.cs deleted file mode 100644 index bf42576392..0000000000 --- a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/SecurityProtocolType.cs +++ /dev/null @@ -1,46 +0,0 @@ -// Transport Security Layer (TLS) -// Copyright (c) 2003-2004 Carlos Guzman Alvarez -// Copyright (C) 2014 Xamarin Inc. (http://www.xamarin.com) - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; - -namespace Mono.Security.Protocol.Tls -{ - [Flags] -#if INSIDE_SYSTEM - internal -#else - [Serializable] - public -#endif - enum SecurityProtocolType - { - Default = -1073741824, - Ssl2 = 12, - Ssl3 = 48, - Tls = 192, - Tls11 = 768, - Tls12 = 3072, - } -} \ No newline at end of file diff --git a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/ServerContext.cs b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/ServerContext.cs deleted file mode 100644 index a1bbd02ae7..0000000000 --- a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/ServerContext.cs +++ /dev/null @@ -1,118 +0,0 @@ -// Transport Security Layer (TLS) -// Copyright (c) 2003-2004 Carlos Guzman Alvarez - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Collections; -using System.Security.Cryptography; -using System.Security.Cryptography.X509Certificates; - -using Mono.Security.Protocol.Tls.Handshake; -using Mono.Security.Interface; -using MonoX509 = Mono.Security.X509; - -namespace Mono.Security.Protocol.Tls -{ - internal class ServerContext : Context - { - #region Fields - - private SslServerStream sslStream; - private bool request_client_certificate; - private bool clientCertificateRequired; - - #endregion - - #region Properties - - public SslServerStream SslStream - { - get { return this.sslStream; } - } - - public bool ClientCertificateRequired - { - get { return this.clientCertificateRequired; } - } - - public bool RequestClientCertificate { - get { return request_client_certificate; } - } - - #endregion - - #region Constructors - - public ServerContext( - SslServerStream stream, - SecurityProtocolType securityProtocolType, - X509Certificate serverCertificate, - bool clientCertificateRequired, - bool requestClientCertificate) - : base(securityProtocolType) - { - this.sslStream = stream; - this.clientCertificateRequired = clientCertificateRequired; - this.request_client_certificate = requestClientCertificate; - - // Convert the System.Security cert to a Mono Cert - MonoX509.X509Certificate cert = new MonoX509.X509Certificate(serverCertificate.GetRawCertData()); - - // Add server certificate to the certificate collection - this.ServerSettings.Certificates = new MonoX509.X509CertificateCollection(); - this.ServerSettings.Certificates.Add(cert); - - this.ServerSettings.UpdateCertificateRSA(); - - if (CertificateValidationHelper.SupportsX509Chain) { - // Build the chain for the certificate and if the chain is correct, add all certificates - // (except the root certificate [FIRST ONE] ... the client is supposed to know that one, - // otherwise the whole concept of a trusted chain doesn't work out ... - MonoX509.X509Chain chain = new MonoX509.X509Chain (MonoX509.X509StoreManager.IntermediateCACertificates); - - if (chain.Build (cert)) { - for (int j = chain.Chain.Count - 1; j > 0; j--) - ServerSettings.Certificates.Add (chain.Chain [j]); - } - } - - // Add requested certificate types - ServerSettings.CertificateTypes = new ClientCertificateType [ServerSettings.Certificates.Count]; - for (int j = 0; j < this.ServerSettings.CertificateTypes.Length; j++) - ServerSettings.CertificateTypes [j] = ClientCertificateType.RSA; - - if (CertificateValidationHelper.SupportsX509Chain) { - // Add certificate authorities - MonoX509.X509CertificateCollection trusted = MonoX509.X509StoreManager.TrustedRootCertificates; - string[] list = new string [trusted.Count]; - int i = 0; - foreach (MonoX509.X509Certificate root in trusted) { - list [i++] = root.IssuerName; - } - this.ServerSettings.DistinguisedNames = list; - } - } - - #endregion - } -} diff --git a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/ServerRecordProtocol.cs b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/ServerRecordProtocol.cs deleted file mode 100644 index f8207297cb..0000000000 --- a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/ServerRecordProtocol.cs +++ /dev/null @@ -1,173 +0,0 @@ -// Transport Security Layer (TLS) -// Copyright (c) 2003-2004 Carlos Guzman Alvarez - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Globalization; -using System.IO; - -using Mono.Security.Protocol.Tls.Handshake; -using Mono.Security.Protocol.Tls.Handshake.Server; - -namespace Mono.Security.Protocol.Tls -{ - internal class ServerRecordProtocol : RecordProtocol - { - TlsClientCertificate cert; - - #region Constructors - - public ServerRecordProtocol( - Stream innerStream, - ServerContext context) : base(innerStream, context) - { - } - - #endregion - - #region Send Messages - - public override HandshakeMessage GetMessage(HandshakeType type) - { - // Create and process the record message - HandshakeMessage msg = this.createServerHandshakeMessage(type); - - return msg; - } - - #endregion - - #region Handshake Processing Methods - - protected override void ProcessHandshakeMessage(TlsStream handMsg) - { - HandshakeType handshakeType = (HandshakeType)handMsg.ReadByte(); - HandshakeMessage message = null; - - // Read message length - int length = handMsg.ReadInt24(); - - // Read message data - byte[] data = new byte[length]; - handMsg.Read(data, 0, length); - - // Create and process the server message - message = this.createClientHandshakeMessage(handshakeType, data); - message.Process(); - - // Update the last handshake message - this.Context.LastHandshakeMsg = handshakeType; - - // Update session - if (message != null) - { - message.Update(); - this.Context.HandshakeMessages.WriteByte ((byte) handshakeType); - this.Context.HandshakeMessages.WriteInt24 (length); - this.Context.HandshakeMessages.Write (data, 0, data.Length); - } - } - - #endregion - - #region Server Handshake Message Factories - - private HandshakeMessage createClientHandshakeMessage( - HandshakeType type, byte[] buffer) - { - var last = context.LastHandshakeMsg; - switch (type) - { - case HandshakeType.ClientHello: - return new TlsClientHello(this.context, buffer); - - case HandshakeType.Certificate: - if (last != HandshakeType.ClientHello) - break; - cert = new TlsClientCertificate(this.context, buffer); - return cert; - - case HandshakeType.ClientKeyExchange: - if (last == HandshakeType.ClientHello || last == HandshakeType.Certificate) - return new TlsClientKeyExchange(this.context, buffer); - break; - - case HandshakeType.CertificateVerify: - if (last == HandshakeType.ClientKeyExchange && cert != null) - return new TlsClientCertificateVerify(this.context, buffer); - break; - - case HandshakeType.Finished: - // Certificates are optional, but if provided, they should send a CertificateVerify - bool hasCert = cert != null && cert.HasCertificate; - bool check = hasCert ? (last == HandshakeType.CertificateVerify) : (last == HandshakeType.ClientKeyExchange); - // ChangeCipherSpecDone is not an handshake message (it's a content type) but still needs to be happens before finished - if (check && context.ChangeCipherSpecDone) { - context.ChangeCipherSpecDone = false; - return new TlsClientFinished(this.context, buffer); - } - break; - - default: - throw new TlsException(AlertDescription.UnexpectedMessage, String.Format(CultureInfo.CurrentUICulture, - "Unknown server handshake message received ({0})", - type.ToString())); - } - throw new TlsException (AlertDescription.HandshakeFailiure, String.Format ("Protocol error, unexpected protocol transition from {0} to {1}", last, type)); - } - - private HandshakeMessage createServerHandshakeMessage( - HandshakeType type) - { - switch (type) - { - case HandshakeType.HelloRequest: - this.SendRecord(HandshakeType.ClientHello); - return null; - - case HandshakeType.ServerHello: - return new TlsServerHello(this.context); - - case HandshakeType.Certificate: - return new TlsServerCertificate(this.context); - - case HandshakeType.ServerKeyExchange: - return new TlsServerKeyExchange(this.context); - - case HandshakeType.CertificateRequest: - return new TlsServerCertificateRequest(this.context); - - case HandshakeType.ServerHelloDone: - return new TlsServerHelloDone(this.context); - - case HandshakeType.Finished: - return new TlsServerFinished(this.context); - - default: - throw new InvalidOperationException("Unknown server handshake message type: " + type.ToString() ); - } - } - - #endregion - } -} diff --git a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/SslCipherSuite.cs b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/SslCipherSuite.cs deleted file mode 100644 index da95ed15e5..0000000000 --- a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/SslCipherSuite.cs +++ /dev/null @@ -1,251 +0,0 @@ -// Transport Security Layer (TLS) -// Copyright (c) 2003-2004 Carlos Guzman Alvarez -// Copyright (C) 2006 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.IO; -using System.Security.Cryptography; -using System.Text; - -namespace Mono.Security.Protocol.Tls -{ - internal class SslCipherSuite : CipherSuite - { - #region Fields - - private byte[] pad1; - private byte[] pad2; - - private const int MacHeaderLength = 11; - private byte[] header; - - #endregion - - #region Constructors - - public SslCipherSuite( - short code, string name, CipherAlgorithmType cipherAlgorithmType, - HashAlgorithmType hashAlgorithmType, ExchangeAlgorithmType exchangeAlgorithmType, - bool exportable, bool blockMode, byte keyMaterialSize, - byte expandedKeyMaterialSize, short effectiveKeyBytes, - byte ivSize, byte blockSize) : - base(code, name, cipherAlgorithmType, hashAlgorithmType, - exchangeAlgorithmType, exportable, blockMode, keyMaterialSize, - expandedKeyMaterialSize, effectiveKeyBytes, ivSize, blockSize) - - { - int padLength = (hashAlgorithmType == HashAlgorithmType.Md5) ? 48 : 40; - - // Fill pad arrays - this.pad1 = new byte[padLength]; - this.pad2 = new byte[padLength]; - - /* Pad the key for inner and outer digest */ - for (int i = 0; i < padLength; ++i) - { - this.pad1[i] = 0x36; - this.pad2[i] = 0x5C; - } - } - - #endregion - - #region MAC Generation Methods - - public override byte[] ComputeServerRecordMAC(ContentType contentType, byte[] fragment) - { - HashAlgorithm hash = CreateHashAlgorithm (); - - byte[] smac = this.Context.Read.ServerWriteMAC; - hash.TransformBlock (smac, 0, smac.Length, smac, 0); - hash.TransformBlock (pad1, 0, pad1.Length, pad1, 0); - - if (header == null) - header = new byte [MacHeaderLength]; - - ulong seqnum = (Context is ClientContext) ? Context.ReadSequenceNumber : Context.WriteSequenceNumber; - Write (header, 0, seqnum); - header [8] = (byte) contentType; - Write (header, 9, (short)fragment.Length); - hash.TransformBlock (header, 0, header.Length, header, 0); - hash.TransformBlock (fragment, 0, fragment.Length, fragment, 0); - // hack, else the method will allocate a new buffer of the same length (negative half the optimization) - hash.TransformFinalBlock (CipherSuite.EmptyArray, 0, 0); - - byte[] blockHash = hash.Hash; - - hash.Initialize (); - - hash.TransformBlock (smac, 0, smac.Length, smac, 0); - hash.TransformBlock (pad2, 0, pad2.Length, pad2, 0); - hash.TransformBlock (blockHash, 0, blockHash.Length, blockHash, 0); - // hack again - hash.TransformFinalBlock (CipherSuite.EmptyArray, 0, 0); - - return hash.Hash; - } - - public override byte[] ComputeClientRecordMAC(ContentType contentType, byte[] fragment) - { - HashAlgorithm hash = CreateHashAlgorithm (); - - byte[] cmac = this.Context.Current.ClientWriteMAC; - hash.TransformBlock (cmac, 0, cmac.Length, cmac, 0); - hash.TransformBlock (pad1, 0, pad1.Length, pad1, 0); - - if (header == null) - header = new byte [MacHeaderLength]; - - ulong seqnum = (Context is ClientContext) ? Context.WriteSequenceNumber : Context.ReadSequenceNumber; - Write (header, 0, seqnum); - header [8] = (byte) contentType; - Write (header, 9, (short)fragment.Length); - hash.TransformBlock (header, 0, header.Length, header, 0); - hash.TransformBlock (fragment, 0, fragment.Length, fragment, 0); - // hack, else the method will allocate a new buffer of the same length (negative half the optimization) - hash.TransformFinalBlock (CipherSuite.EmptyArray, 0, 0); - - byte[] blockHash = hash.Hash; - - hash.Initialize (); - - hash.TransformBlock (cmac, 0, cmac.Length, cmac, 0); - hash.TransformBlock (pad2, 0, pad2.Length, pad2, 0); - hash.TransformBlock (blockHash, 0, blockHash.Length, blockHash, 0); - // hack again - hash.TransformFinalBlock (CipherSuite.EmptyArray, 0, 0); - - return hash.Hash; - } - - #endregion - - #region Key Generation Methods - - public override void ComputeMasterSecret(byte[] preMasterSecret) - { - TlsStream masterSecret = new TlsStream(); - - masterSecret.Write(this.prf(preMasterSecret, "A", this.Context.RandomCS)); - masterSecret.Write(this.prf(preMasterSecret, "BB", this.Context.RandomCS)); - masterSecret.Write(this.prf(preMasterSecret, "CCC", this.Context.RandomCS)); - - this.Context.MasterSecret = masterSecret.ToArray(); - - DebugHelper.WriteLine(">>>> MasterSecret", this.Context.MasterSecret); - } - - public override void ComputeKeys() - { - // Compute KeyBlock - TlsStream tmp = new TlsStream(); - - char labelChar = 'A'; - int count = 1; - - while (tmp.Length < this.KeyBlockSize) - { - string label = String.Empty; - - for (int i = 0; i < count; i++) - { - label += labelChar.ToString(); - } - - byte[] block = this.prf(this.Context.MasterSecret, label.ToString(), this.Context.RandomSC); - - int size = (tmp.Length + block.Length) > this.KeyBlockSize ? (this.KeyBlockSize - (int)tmp.Length) : block.Length; - - tmp.Write(block, 0, size); - - labelChar++; - count++; - } - - // Create keyblock - TlsStream keyBlock = new TlsStream(tmp.ToArray()); - - this.Context.Negotiating.ClientWriteMAC = keyBlock.ReadBytes(this.HashSize); - this.Context.Negotiating.ServerWriteMAC = keyBlock.ReadBytes(this.HashSize); - this.Context.ClientWriteKey = keyBlock.ReadBytes(this.KeyMaterialSize); - this.Context.ServerWriteKey = keyBlock.ReadBytes(this.KeyMaterialSize); - - if (this.IvSize != 0) - { - this.Context.ClientWriteIV = keyBlock.ReadBytes(this.IvSize); - this.Context.ServerWriteIV = keyBlock.ReadBytes(this.IvSize); - } - else - { - this.Context.ClientWriteIV = CipherSuite.EmptyArray; - this.Context.ServerWriteIV = CipherSuite.EmptyArray; - } - - DebugHelper.WriteLine(">>>> KeyBlock", keyBlock.ToArray()); - DebugHelper.WriteLine(">>>> ClientWriteKey", this.Context.ClientWriteKey); - DebugHelper.WriteLine(">>>> ClientWriteIV", this.Context.ClientWriteIV); - DebugHelper.WriteLine(">>>> ClientWriteMAC", this.Context.Negotiating.ClientWriteMAC); - DebugHelper.WriteLine(">>>> ServerWriteKey", this.Context.ServerWriteKey); - DebugHelper.WriteLine(">>>> ServerWriteIV", this.Context.ServerWriteIV); - DebugHelper.WriteLine(">>>> ServerWriteMAC", this.Context.Negotiating.ServerWriteMAC); - - ClientSessionCache.SetContextInCache (this.Context); - // Clear no more needed data - keyBlock.Reset(); - tmp.Reset(); - } - - #endregion - - #region Private Methods - - private byte[] prf(byte[] secret, string label, byte[] random) - { - HashAlgorithm md5 = MD5.Create(); - HashAlgorithm sha = SHA1.Create(); - - // Compute SHA hash - TlsStream block = new TlsStream(); - block.Write(Encoding.ASCII.GetBytes(label)); - block.Write(secret); - block.Write(random); - - byte[] shaHash = sha.ComputeHash(block.ToArray(), 0, (int)block.Length); - - block.Reset(); - - // Compute MD5 hash - block.Write(secret); - block.Write(shaHash); - - byte[] result = md5.ComputeHash(block.ToArray(), 0, (int)block.Length); - - // Free resources - block.Reset(); - - return result; - } - - #endregion - } -} diff --git a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/SslClientStream.cs b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/SslClientStream.cs deleted file mode 100644 index 39680547b0..0000000000 --- a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/SslClientStream.cs +++ /dev/null @@ -1,659 +0,0 @@ -// Transport Security Layer (TLS) -// Copyright (c) 2003-2004 Carlos Guzman Alvarez - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Collections; -using System.IO; -using System.Net; -using System.Net.Sockets; -using System.Security.Cryptography; -using System.Security.Cryptography.X509Certificates; -using System.Threading; - -using Mono.Security.Protocol.Tls.Handshake; -using Mono.Security.Interface; - -namespace Mono.Security.Protocol.Tls -{ - #region Delegates - -#if INSIDE_SYSTEM - internal -#else - public -#endif - delegate bool CertificateValidationCallback( - X509Certificate certificate, - int[] certificateErrors); - -#if INSIDE_SYSTEM - internal -#else - public -#endif - delegate ValidationResult CertificateValidationCallback2 (Mono.Security.X509.X509CertificateCollection collection); - -#if INSIDE_SYSTEM - internal -#else - public -#endif - delegate X509Certificate CertificateSelectionCallback( - X509CertificateCollection clientCertificates, - X509Certificate serverCertificate, - string targetHost, - X509CertificateCollection serverRequestedCertificates); - -#if INSIDE_SYSTEM - internal -#else - public -#endif - delegate AsymmetricAlgorithm PrivateKeySelectionCallback( - X509Certificate certificate, - string targetHost); - - #endregion - -#if INSIDE_SYSTEM - internal -#else - public -#endif - class SslClientStream : SslStreamBase - { - #region Internal Events - - internal event CertificateValidationCallback ServerCertValidation; - internal event CertificateSelectionCallback ClientCertSelection; - internal event PrivateKeySelectionCallback PrivateKeySelection; - - #endregion - - #region Properties - - // required by HttpsClientStream for proxy support - internal Stream InputBuffer - { - get { return base.inputBuffer; } - } - - public X509CertificateCollection ClientCertificates - { - get { return this.context.ClientSettings.Certificates; } - } - - public X509Certificate SelectedClientCertificate - { - get { return this.context.ClientSettings.ClientCertificate; } - } - - #endregion - - #region Callback Properties - - public CertificateValidationCallback ServerCertValidationDelegate - { - get { return this.ServerCertValidation; } - set { this.ServerCertValidation = value; } - } - - public CertificateSelectionCallback ClientCertSelectionDelegate - { - get { return this.ClientCertSelection; } - set { this.ClientCertSelection = value; } - } - - public PrivateKeySelectionCallback PrivateKeyCertSelectionDelegate - { - get { return this.PrivateKeySelection; } - set { this.PrivateKeySelection = value; } - } - - #endregion - - public event CertificateValidationCallback2 ServerCertValidation2; - - #region Constructors - - public SslClientStream( - Stream stream, - string targetHost, - bool ownsStream) - : this( - stream, targetHost, ownsStream, - SecurityProtocolType.Default, null) - { - } - - public SslClientStream( - Stream stream, - string targetHost, - X509Certificate clientCertificate) - : this( - stream, targetHost, false, SecurityProtocolType.Default, - new X509CertificateCollection(new X509Certificate[]{clientCertificate})) - { - } - - public SslClientStream( - Stream stream, - string targetHost, - X509CertificateCollection clientCertificates) : - this( - stream, targetHost, false, SecurityProtocolType.Default, - clientCertificates) - { - } - - public SslClientStream( - Stream stream, - string targetHost, - bool ownsStream, - SecurityProtocolType securityProtocolType) - : this( - stream, targetHost, ownsStream, securityProtocolType, - new X509CertificateCollection()) - { - } - - public SslClientStream( - Stream stream, - string targetHost, - bool ownsStream, - SecurityProtocolType securityProtocolType, - X509CertificateCollection clientCertificates): - base(stream, ownsStream) - { - if (targetHost == null || targetHost.Length == 0) - { - throw new ArgumentNullException("targetHost is null or an empty string."); - } - - this.context = new ClientContext( - this, - securityProtocolType, - targetHost, - clientCertificates); - - this.protocol = new ClientRecordProtocol(innerStream, (ClientContext)this.context); - } - - #endregion - - #region Finalizer - - ~SslClientStream() - { - base.Dispose(false); - } - - #endregion - - #region IDisposable Methods - - protected override void Dispose(bool disposing) - { - base.Dispose(disposing); - - if (disposing) - { - this.ServerCertValidation = null; - this.ClientCertSelection = null; - this.PrivateKeySelection = null; - this.ServerCertValidation2 = null; - } - } - - #endregion - - #region Handshake Methods - - /* - Client Server - - ClientHello --------> - ServerHello - Certificate* - ServerKeyExchange* - CertificateRequest* - <-------- ServerHelloDone - Certificate* - ClientKeyExchange - CertificateVerify* - [ChangeCipherSpec] - Finished --------> - [ChangeCipherSpec] - <-------- Finished - Application Data <-------> Application Data - - Fig. 1 - Message flow for a full handshake - */ - - private void SafeEndReceiveRecord (IAsyncResult ar, bool ignoreEmpty = false) - { - byte[] record = this.protocol.EndReceiveRecord (ar); - if (!ignoreEmpty && ((record == null) || (record.Length == 0))) { - throw new TlsException ( - AlertDescription.HandshakeFailiure, - "The server stopped the handshake."); - } - } - - private enum NegotiateState - { - SentClientHello, - ReceiveClientHelloResponse, - SentCipherSpec, - ReceiveCipherSpecResponse, - SentKeyExchange, - ReceiveFinishResponse, - SentFinished, - }; - - private class NegotiateAsyncResult : IAsyncResult - { - private object locker = new object (); - private AsyncCallback _userCallback; - private object _userState; - private Exception _asyncException; - private ManualResetEvent handle; - private NegotiateState _state; - private bool completed; - - public NegotiateAsyncResult(AsyncCallback userCallback, object userState, NegotiateState state) - { - _userCallback = userCallback; - _userState = userState; - _state = state; - } - - public NegotiateState State - { - get { return _state; } - set { _state = value; } - } - - public object AsyncState - { - get { return _userState; } - } - - public Exception AsyncException - { - get { return _asyncException; } - } - - public bool CompletedWithError - { - get { - if (!IsCompleted) - return false; // Perhaps throw InvalidOperationExcetion? - - return null != _asyncException; - } - } - - public WaitHandle AsyncWaitHandle - { - get { - lock (locker) { - if (handle == null) - handle = new ManualResetEvent (completed); - } - return handle; - } - - } - - public bool CompletedSynchronously - { - get { return false; } - } - - public bool IsCompleted - { - get { - lock (locker) { - return completed; - } - } - } - - public void SetComplete(Exception ex) - { - lock (locker) { - if (completed) - return; - - completed = true; - if (handle != null) - handle.Set (); - - if (_userCallback != null) - _userCallback.BeginInvoke (this, null, null); - - _asyncException = ex; - } - } - - public void SetComplete() - { - SetComplete(null); - } - } - - internal override IAsyncResult BeginNegotiateHandshake(AsyncCallback callback, object state) - { - if (this.context.HandshakeState != HandshakeState.None) { - this.context.Clear (); - } - - // Obtain supported cipher suites - this.context.SupportedCiphers = CipherSuiteFactory.GetSupportedCiphers (false, context.SecurityProtocol); - - // Set handshake state - this.context.HandshakeState = HandshakeState.Started; - - NegotiateAsyncResult result = new NegotiateAsyncResult (callback, state, NegotiateState.SentClientHello); - - // Begin sending the client hello - this.protocol.BeginSendRecord (HandshakeType.ClientHello, NegotiateAsyncWorker, result); - - return result; - } - - internal override void EndNegotiateHandshake (IAsyncResult result) - { - NegotiateAsyncResult negotiate = result as NegotiateAsyncResult; - - if (negotiate == null) - throw new ArgumentNullException (); - if (!negotiate.IsCompleted) - negotiate.AsyncWaitHandle.WaitOne(); - if (negotiate.CompletedWithError) - throw negotiate.AsyncException; - } - - private void NegotiateAsyncWorker (IAsyncResult result) - { - NegotiateAsyncResult negotiate = result.AsyncState as NegotiateAsyncResult; - - try - { - switch (negotiate.State) - { - case NegotiateState.SentClientHello: - this.protocol.EndSendRecord (result); - - // we are now ready to ready the receive the hello response. - negotiate.State = NegotiateState.ReceiveClientHelloResponse; - - // Start reading the client hello response - this.protocol.BeginReceiveRecord (this.innerStream, NegotiateAsyncWorker, negotiate); - break; - - case NegotiateState.ReceiveClientHelloResponse: - this.SafeEndReceiveRecord (result, true); - - if (this.context.LastHandshakeMsg != HandshakeType.ServerHelloDone && - (!this.context.AbbreviatedHandshake || this.context.LastHandshakeMsg != HandshakeType.ServerHello)) { - // Read next record (skip empty, e.g. warnings alerts) - this.protocol.BeginReceiveRecord (this.innerStream, NegotiateAsyncWorker, negotiate); - break; - } - - // special case for abbreviated handshake where no ServerHelloDone is sent from the server - if (this.context.AbbreviatedHandshake) { - ClientSessionCache.SetContextFromCache (this.context); - this.context.Negotiating.Cipher.ComputeKeys (); - this.context.Negotiating.Cipher.InitializeCipher (); - - negotiate.State = NegotiateState.SentCipherSpec; - - // Send Change Cipher Spec message with the current cipher - // or as plain text if this is the initial negotiation - this.protocol.BeginSendChangeCipherSpec(NegotiateAsyncWorker, negotiate); - } else { - // Send client certificate if requested - // even if the server ask for it it _may_ still be optional - bool clientCertificate = this.context.ServerSettings.CertificateRequest; - - using (var memstream = new MemoryStream()) - { - // NOTE: sadly SSL3 and TLS1 differs in how they handle this and - // the current design doesn't allow a very cute way to handle - // SSL3 alert warning for NoCertificate (41). - if (this.context.SecurityProtocol == SecurityProtocolType.Ssl3) - { - clientCertificate = ((this.context.ClientSettings.Certificates != null) && - (this.context.ClientSettings.Certificates.Count > 0)); - // this works well with OpenSSL (but only for SSL3) - } - - byte[] record = null; - - if (clientCertificate) - { - record = this.protocol.EncodeHandshakeRecord(HandshakeType.Certificate); - memstream.Write(record, 0, record.Length); - } - - // Send Client Key Exchange - record = this.protocol.EncodeHandshakeRecord(HandshakeType.ClientKeyExchange); - memstream.Write(record, 0, record.Length); - - // Now initialize session cipher with the generated keys - this.context.Negotiating.Cipher.InitializeCipher(); - - // Send certificate verify if requested (optional) - if (clientCertificate && (this.context.ClientSettings.ClientCertificate != null)) - { - record = this.protocol.EncodeHandshakeRecord(HandshakeType.CertificateVerify); - memstream.Write(record, 0, record.Length); - } - - // send the chnage cipher spec. - this.protocol.SendChangeCipherSpec(memstream); - - // Send Finished message - record = this.protocol.EncodeHandshakeRecord(HandshakeType.Finished); - memstream.Write(record, 0, record.Length); - - negotiate.State = NegotiateState.SentKeyExchange; - - // send all the records. - this.innerStream.BeginWrite (memstream.GetBuffer (), 0, (int)memstream.Length, NegotiateAsyncWorker, negotiate); - } - } - break; - - case NegotiateState.SentKeyExchange: - this.innerStream.EndWrite (result); - - negotiate.State = NegotiateState.ReceiveFinishResponse; - - this.protocol.BeginReceiveRecord (this.innerStream, NegotiateAsyncWorker, negotiate); - - break; - - case NegotiateState.ReceiveFinishResponse: - this.SafeEndReceiveRecord (result); - - // Read record until server finished is received - if (this.context.HandshakeState != HandshakeState.Finished) { - // If all goes well this will process messages: - // Change Cipher Spec - // Server finished - this.protocol.BeginReceiveRecord (this.innerStream, NegotiateAsyncWorker, negotiate); - } - else { - // Reset Handshake messages information - this.context.HandshakeMessages.Reset (); - - // Clear Key Info - this.context.ClearKeyInfo(); - - negotiate.SetComplete (); - } - break; - - - case NegotiateState.SentCipherSpec: - this.protocol.EndSendChangeCipherSpec (result); - - negotiate.State = NegotiateState.ReceiveCipherSpecResponse; - - // Start reading the cipher spec response - this.protocol.BeginReceiveRecord (this.innerStream, NegotiateAsyncWorker, negotiate); - break; - - case NegotiateState.ReceiveCipherSpecResponse: - this.SafeEndReceiveRecord (result, true); - - if (this.context.HandshakeState != HandshakeState.Finished) - { - this.protocol.BeginReceiveRecord (this.innerStream, NegotiateAsyncWorker, negotiate); - } - else - { - negotiate.State = NegotiateState.SentFinished; - this.protocol.BeginSendRecord(HandshakeType.Finished, NegotiateAsyncWorker, negotiate); - } - break; - - case NegotiateState.SentFinished: - this.protocol.EndSendRecord (result); - - // Reset Handshake messages information - this.context.HandshakeMessages.Reset (); - - // Clear Key Info - this.context.ClearKeyInfo(); - - negotiate.SetComplete (); - - break; - } - } - catch (TlsException ex) - { - try { - Exception e = ex; - this.protocol.SendAlert(ref e); - } catch { - } - negotiate.SetComplete(new IOException("The authentication or decryption has failed.", ex)); - } - catch (Exception ex) - { - try { - this.protocol.SendAlert(AlertDescription.InternalError); - } catch { - } - negotiate.SetComplete(new IOException("The authentication or decryption has failed.", ex)); - } - } - - #endregion - - #region Event Methods - - internal override X509Certificate OnLocalCertificateSelection(X509CertificateCollection clientCertificates, X509Certificate serverCertificate, string targetHost, X509CertificateCollection serverRequestedCertificates) - { - if (this.ClientCertSelection != null) - { - return this.ClientCertSelection( - clientCertificates, - serverCertificate, - targetHost, - serverRequestedCertificates); - } - - return null; - } - - internal override bool HaveRemoteValidation2Callback { - get { return ServerCertValidation2 != null; } - } - - internal override ValidationResult OnRemoteCertificateValidation2 (Mono.Security.X509.X509CertificateCollection collection) - { - CertificateValidationCallback2 cb = ServerCertValidation2; - if (cb != null) - return cb (collection); - return null; - } - - internal override bool OnRemoteCertificateValidation(X509Certificate certificate, int[] errors) - { - if (this.ServerCertValidation != null) - { - return this.ServerCertValidation(certificate, errors); - } - - return (errors != null && errors.Length == 0); - } - - internal virtual bool RaiseServerCertificateValidation( - X509Certificate certificate, - int[] certificateErrors) - { - return base.RaiseRemoteCertificateValidation(certificate, certificateErrors); - } - - internal virtual ValidationResult RaiseServerCertificateValidation2 (Mono.Security.X509.X509CertificateCollection collection) - { - return base.RaiseRemoteCertificateValidation2 (collection); - } - - internal X509Certificate RaiseClientCertificateSelection( - X509CertificateCollection clientCertificates, - X509Certificate serverCertificate, - string targetHost, - X509CertificateCollection serverRequestedCertificates) - { - return base.RaiseLocalCertificateSelection(clientCertificates, serverCertificate, targetHost, serverRequestedCertificates); - } - - internal override AsymmetricAlgorithm OnLocalPrivateKeySelection(X509Certificate certificate, string targetHost) - { - if (this.PrivateKeySelection != null) - { - return this.PrivateKeySelection(certificate, targetHost); - } - - return null; - } - - internal AsymmetricAlgorithm RaisePrivateKeySelection( - X509Certificate certificate, - string targetHost) - { - return base.RaiseLocalPrivateKeySelection(certificate, targetHost); - } - - #endregion - } -} diff --git a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/SslHandshakeHash.cs b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/SslHandshakeHash.cs deleted file mode 100644 index 2a670b40d5..0000000000 --- a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/SslHandshakeHash.cs +++ /dev/null @@ -1,185 +0,0 @@ -// Transport Security Layer (TLS) -// Copyright (c) 2003-2004 Carlos Guzman Alvarez - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Security.Cryptography; - -namespace Mono.Security.Protocol.Tls -{ - internal class SslHandshakeHash : System.Security.Cryptography.HashAlgorithm - { - #region Fields - - private HashAlgorithm md5; - private HashAlgorithm sha; - private bool hashing; - private byte[] secret; - private byte[] innerPadMD5; - private byte[] outerPadMD5; - private byte[] innerPadSHA; - private byte[] outerPadSHA; - - #endregion - - #region Constructors - - public SslHandshakeHash(byte[] secret) - { - // Create md5 and sha1 hashes - this.md5 = MD5.Create (); - this.sha = SHA1.Create (); - - // Set HashSizeValue - this.HashSizeValue = md5.HashSize + sha.HashSize; - - // Update secret - this.secret = secret; - - this.Initialize(); - } - - #endregion - - #region Methods - - public override void Initialize() - { - this.md5.Initialize(); - this.sha.Initialize(); - this.initializePad(); - this.hashing = false; - } - - protected override byte[] HashFinal() - { - if (!this.hashing) - { - this.hashing = true; - } - - // Finalize the md5 hash - this.md5.TransformBlock(this.secret, 0, this.secret.Length, this.secret, 0); - this.md5.TransformFinalBlock(this.innerPadMD5, 0, this.innerPadMD5.Length); - - byte[] firstResultMD5 = this.md5.Hash; - - this.md5.Initialize(); - this.md5.TransformBlock(this.secret, 0, this.secret.Length, this.secret, 0); - this.md5.TransformBlock(this.outerPadMD5, 0, this.outerPadMD5.Length, this.outerPadMD5, 0); - this.md5.TransformFinalBlock(firstResultMD5, 0, firstResultMD5.Length); - - // Finalize the sha1 hash - this.sha.TransformBlock(this.secret, 0, this.secret.Length, this.secret, 0); - this.sha.TransformFinalBlock(this.innerPadSHA, 0, this.innerPadSHA.Length); - - byte[] firstResultSHA = this.sha.Hash; - - this.sha.Initialize(); - this.sha.TransformBlock(this.secret, 0, this.secret.Length, this.secret, 0); - this.sha.TransformBlock(this.outerPadSHA, 0, this.outerPadSHA.Length, this.outerPadSHA, 0); - this.sha.TransformFinalBlock(firstResultSHA, 0, firstResultSHA.Length); - - this.Initialize(); - - byte[] result = new byte[36]; - - Buffer.BlockCopy(this.md5.Hash, 0, result, 0, 16); - Buffer.BlockCopy(this.sha.Hash, 0, result, 16, 20); - - return result; - } - - protected override void HashCore(byte[] array, int ibStart, int cbSize) - { - if (!this.hashing) - { - this.hashing = true; - } - - this.md5.TransformBlock(array, ibStart, cbSize, array, ibStart); - this.sha.TransformBlock(array, ibStart, cbSize, array, ibStart); - } - - public byte[] CreateSignature(RSA rsa) - { - if (rsa == null) - { - throw new CryptographicUnexpectedOperationException ("missing key"); - } - - RSASslSignatureFormatter f = new RSASslSignatureFormatter(rsa); - f.SetHashAlgorithm("MD5SHA1"); - - return f.CreateSignature(this.Hash); - } - - public bool VerifySignature(RSA rsa, byte[] rgbSignature) - { - if (rsa == null) - { - throw new CryptographicUnexpectedOperationException ("missing key"); - } - if (rgbSignature == null) - { - throw new ArgumentNullException ("rgbSignature"); - } - - RSASslSignatureDeformatter d = new RSASslSignatureDeformatter(rsa); - d.SetHashAlgorithm("MD5SHA1"); - - return d.VerifySignature(this.Hash, rgbSignature); - } - - #endregion - - #region Private Methods - - private void initializePad() - { - // Fill md5 arrays - this.innerPadMD5 = new byte[48]; - this.outerPadMD5 = new byte[48]; - - /* Pad the key for inner and outer digest */ - for (int i = 0; i < 48; ++i) - { - this.innerPadMD5[i] = 0x36; - this.outerPadMD5[i] = 0x5C; - } - - // Fill sha arrays - this.innerPadSHA = new byte[40]; - this.outerPadSHA = new byte[40]; - - /* Pad the key for inner and outer digest */ - for (int i = 0; i < 40; ++i) - { - this.innerPadSHA[i] = 0x36; - this.outerPadSHA[i] = 0x5C; - } - } - - #endregion - } -} diff --git a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/SslServerStream.cs b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/SslServerStream.cs deleted file mode 100644 index f93ab4425e..0000000000 --- a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/SslServerStream.cs +++ /dev/null @@ -1,332 +0,0 @@ -// Transport Security Layer (TLS) -// Copyright (c) 2003-2004 Carlos Guzman Alvarez - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Collections; -using System.IO; -using System.Net; -using System.Net.Sockets; -using System.Security.Cryptography; -using System.Security.Cryptography.X509Certificates; - -using Mono.Security.Protocol.Tls.Handshake; -using Mono.Security.Interface; - -namespace Mono.Security.Protocol.Tls -{ -#if INSIDE_SYSTEM - internal -#else - public -#endif - class SslServerStream : SslStreamBase - { - #region Internal Events - - internal event CertificateValidationCallback ClientCertValidation; - internal event PrivateKeySelectionCallback PrivateKeySelection; - - #endregion - - #region Properties - - public X509Certificate ClientCertificate - { - get - { - if (this.context.HandshakeState == HandshakeState.Finished) - { - return this.context.ClientSettings.ClientCertificate; - } - - return null; - } - } - - #endregion - - #region Callback Properties - - public CertificateValidationCallback ClientCertValidationDelegate - { - get { return this.ClientCertValidation; } - set { this.ClientCertValidation = value; } - } - - public PrivateKeySelectionCallback PrivateKeyCertSelectionDelegate - { - get { return this.PrivateKeySelection; } - set { this.PrivateKeySelection = value; } - } - - #endregion - - public event CertificateValidationCallback2 ClientCertValidation2; - #region Constructors - - public SslServerStream( - Stream stream, - X509Certificate serverCertificate) : this( - stream, - serverCertificate, - false, - false, - SecurityProtocolType.Default) - { - } - - public SslServerStream( - Stream stream, - X509Certificate serverCertificate, - bool clientCertificateRequired, - bool ownsStream): this( - stream, - serverCertificate, - clientCertificateRequired, - ownsStream, - SecurityProtocolType.Default) - { - } - - public SslServerStream( - Stream stream, - X509Certificate serverCertificate, - bool clientCertificateRequired, - bool requestClientCertificate, - bool ownsStream) - : this (stream, serverCertificate, clientCertificateRequired, requestClientCertificate, ownsStream, SecurityProtocolType.Default) - { - } - - public SslServerStream( - Stream stream, - X509Certificate serverCertificate, - bool clientCertificateRequired, - bool ownsStream, - SecurityProtocolType securityProtocolType) - : this (stream, serverCertificate, clientCertificateRequired, false, ownsStream, securityProtocolType) - { - } - - public SslServerStream( - Stream stream, - X509Certificate serverCertificate, - bool clientCertificateRequired, - bool requestClientCertificate, - bool ownsStream, - SecurityProtocolType securityProtocolType) - : base(stream, ownsStream) - { - this.context = new ServerContext( - this, - securityProtocolType, - serverCertificate, - clientCertificateRequired, - requestClientCertificate); - - this.protocol = new ServerRecordProtocol(innerStream, (ServerContext)this.context); - } - - #endregion - - #region Finalizer - - ~SslServerStream() - { - this.Dispose(false); - } - - #endregion - - #region IDisposable Methods - - protected override void Dispose(bool disposing) - { - base.Dispose(disposing); - - if (disposing) - { - this.ClientCertValidation = null; - this.PrivateKeySelection = null; - } - } - - #endregion - - #region Handsake Methods - - /* - Client Server - - ClientHello --------> - ServerHello - Certificate* - ServerKeyExchange* - CertificateRequest* - <-------- ServerHelloDone - Certificate* - ClientKeyExchange - CertificateVerify* - [ChangeCipherSpec] - Finished --------> - [ChangeCipherSpec] - <-------- Finished - Application Data <-------> Application Data - - Fig. 1 - Message flow for a full handshake - */ - - internal override IAsyncResult BeginNegotiateHandshake(AsyncCallback callback, object state) - { - // Reset the context if needed - if (this.context.HandshakeState != HandshakeState.None) - { - this.context.Clear(); - } - - // Obtain supported cipher suites - this.context.SupportedCiphers = CipherSuiteFactory.GetSupportedCiphers (true, context.SecurityProtocol); - - // Set handshake state - this.context.HandshakeState = HandshakeState.Started; - - // Receive Client Hello message - return this.protocol.BeginReceiveRecord(this.innerStream, callback, state); - - } - - internal override void EndNegotiateHandshake(IAsyncResult asyncResult) - { - // Receive Client Hello message and ignore it - this.protocol.EndReceiveRecord(asyncResult); - - // If received message is not an ClientHello send a - // Fatal Alert - if (this.context.LastHandshakeMsg != HandshakeType.ClientHello) - { - this.protocol.SendAlert(AlertDescription.UnexpectedMessage); - } - - // Send ServerHello message - this.protocol.SendRecord(HandshakeType.ServerHello); - - // Send ServerCertificate message - this.protocol.SendRecord(HandshakeType.Certificate); - - // If the client certificate is required send the CertificateRequest message - if (((ServerContext)this.context).ClientCertificateRequired || - ((ServerContext)this.context).RequestClientCertificate) - { - this.protocol.SendRecord(HandshakeType.CertificateRequest); - } - - // Send ServerHelloDone message - this.protocol.SendRecord(HandshakeType.ServerHelloDone); - - // Receive client response, until the Client Finished message - // is received. IE can be interrupted at this stage and never - // complete the handshake - while (this.context.LastHandshakeMsg != HandshakeType.Finished) - { - byte[] record = this.protocol.ReceiveRecord(this.innerStream); - if ((record == null) || (record.Length == 0)) - { - throw new TlsException( - AlertDescription.HandshakeFailiure, - "The client stopped the handshake."); - } - } - - // Send ChangeCipherSpec and ServerFinished messages - this.protocol.SendChangeCipherSpec(); - this.protocol.SendRecord (HandshakeType.Finished); - - // The handshake is finished - this.context.HandshakeState = HandshakeState.Finished; - - // Reset Handshake messages information - this.context.HandshakeMessages.Reset (); - - // Clear Key Info - this.context.ClearKeyInfo(); - } - - #endregion - - #region Event Methods - - internal override X509Certificate OnLocalCertificateSelection(X509CertificateCollection clientCertificates, X509Certificate serverCertificate, string targetHost, X509CertificateCollection serverRequestedCertificates) - { - throw new NotSupportedException(); - } - - internal override bool OnRemoteCertificateValidation(X509Certificate certificate, int[] errors) - { - if (this.ClientCertValidation != null) - { - return this.ClientCertValidation(certificate, errors); - } - - return (errors != null && errors.Length == 0); - } - - internal override bool HaveRemoteValidation2Callback { - get { return ClientCertValidation2 != null; } - } - - internal override ValidationResult OnRemoteCertificateValidation2 (Mono.Security.X509.X509CertificateCollection collection) - { - CertificateValidationCallback2 cb = ClientCertValidation2; - if (cb != null) - return cb (collection); - return null; - } - - internal bool RaiseClientCertificateValidation( - X509Certificate certificate, - int[] certificateErrors) - { - return base.RaiseRemoteCertificateValidation(certificate, certificateErrors); - } - - internal override AsymmetricAlgorithm OnLocalPrivateKeySelection(X509Certificate certificate, string targetHost) - { - if (this.PrivateKeySelection != null) - { - return this.PrivateKeySelection(certificate, targetHost); - } - - return null; - } - - internal AsymmetricAlgorithm RaisePrivateKeySelection( - X509Certificate certificate, - string targetHost) - { - return base.RaiseLocalPrivateKeySelection(certificate, targetHost); - } - - #endregion - } -} diff --git a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/SslStreamBase.cs b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/SslStreamBase.cs deleted file mode 100644 index ffd1adc205..0000000000 --- a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/SslStreamBase.cs +++ /dev/null @@ -1,1224 +0,0 @@ -// Transport Security Layer (TLS) -// Copyright (c) 2003-2004 Carlos Guzman Alvarez -// Copyright (C) 2006-2007 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Collections; -using System.IO; -using System.Net; -using System.Net.Sockets; -using System.Security.Cryptography; -using System.Security.Cryptography.X509Certificates; -using System.Threading; - -using Mono.Security.Interface; - -namespace Mono.Security.Protocol.Tls -{ -#if INSIDE_SYSTEM - internal -#else - public -#endif - abstract class SslStreamBase: Stream, IDisposable - { - private delegate void AsyncHandshakeDelegate(InternalAsyncResult asyncResult, bool fromWrite); - - #region Fields - - static ManualResetEvent record_processing = new ManualResetEvent (true); - - internal Stream innerStream; - internal MemoryStream inputBuffer; - internal Context context; - internal RecordProtocol protocol; - internal bool ownsStream; - private volatile bool disposed; - private bool checkCertRevocationStatus; - private object negotiate; - private object read; - private object write; - private ManualResetEvent negotiationComplete; - - #endregion - - - #region Constructors - - protected SslStreamBase( - Stream stream, - bool ownsStream) - { - if (stream == null) - { - throw new ArgumentNullException("stream is null."); - } - if (!stream.CanRead || !stream.CanWrite) - { - throw new ArgumentNullException("stream is not both readable and writable."); - } - - this.inputBuffer = new MemoryStream(); - this.innerStream = stream; - this.ownsStream = ownsStream; - this.negotiate = new object(); - this.read = new object(); - this.write = new object(); - this.negotiationComplete = new ManualResetEvent(false); - } - - #endregion - - #region Handshakes - private void AsyncHandshakeCallback(IAsyncResult asyncResult) - { - InternalAsyncResult internalResult = asyncResult.AsyncState as InternalAsyncResult; - - try - { - try - { - this.EndNegotiateHandshake(asyncResult); - } - catch (Exception ex) - { - this.protocol.SendAlert(ref ex); - throw new IOException("The authentication or decryption has failed.", ex); - } - - if (internalResult.ProceedAfterHandshake) - { - //kick off the read or write process (whichever called us) after the handshake is complete - if (internalResult.FromWrite) - { - InternalBeginWrite(internalResult); - } - else - { - InternalBeginRead(internalResult); - } - negotiationComplete.Set(); - } - else - { - negotiationComplete.Set(); - internalResult.SetComplete(); - } - - } - catch (Exception ex) - { - negotiationComplete.Set(); - internalResult.SetComplete(ex); - } - } - - internal bool MightNeedHandshake - { - get - { - if (this.context.HandshakeState == HandshakeState.Finished) - { - return false; - } - else - { - lock (this.negotiate) - { - return (this.context.HandshakeState != HandshakeState.Finished); - } - } - } - } - - internal void NegotiateHandshake() - { - if (this.MightNeedHandshake) - { - InternalAsyncResult ar = new InternalAsyncResult(null, null, null, 0, 0, false, false); - - //if something already started negotiation, wait for it. - //otherwise end it ourselves. - if (!BeginNegotiateHandshake(ar)) - { - this.negotiationComplete.WaitOne(); - } - else - { - this.EndNegotiateHandshake(ar); - } - } - } - - #endregion - - #region Abstracts/Virtuals - - internal abstract IAsyncResult BeginNegotiateHandshake (AsyncCallback callback, object state); - internal abstract void EndNegotiateHandshake (IAsyncResult result); - - internal abstract X509Certificate OnLocalCertificateSelection(X509CertificateCollection clientCertificates, - X509Certificate serverCertificate, - string targetHost, - X509CertificateCollection serverRequestedCertificates); - - internal abstract bool OnRemoteCertificateValidation(X509Certificate certificate, int[] errors); - internal abstract ValidationResult OnRemoteCertificateValidation2 (Mono.Security.X509.X509CertificateCollection collection); - internal abstract bool HaveRemoteValidation2Callback { get; } - - internal abstract AsymmetricAlgorithm OnLocalPrivateKeySelection(X509Certificate certificate, string targetHost); - - #endregion - - #region Event Methods - - internal X509Certificate RaiseLocalCertificateSelection(X509CertificateCollection certificates, - X509Certificate remoteCertificate, - string targetHost, - X509CertificateCollection requestedCertificates) - { - return OnLocalCertificateSelection(certificates, remoteCertificate, targetHost, requestedCertificates); - } - - internal bool RaiseRemoteCertificateValidation(X509Certificate certificate, int[] errors) - { - return OnRemoteCertificateValidation(certificate, errors); - } - - internal ValidationResult RaiseRemoteCertificateValidation2 (Mono.Security.X509.X509CertificateCollection collection) - { - return OnRemoteCertificateValidation2 (collection); - } - - internal AsymmetricAlgorithm RaiseLocalPrivateKeySelection( - X509Certificate certificate, - string targetHost) - { - return OnLocalPrivateKeySelection(certificate, targetHost); - } - #endregion - - #region Security Properties - - public bool CheckCertRevocationStatus - { - get { return this.checkCertRevocationStatus; } - set { this.checkCertRevocationStatus = value; } - } - - public CipherAlgorithmType CipherAlgorithm - { - get - { - if (this.context.HandshakeState == HandshakeState.Finished) - { - return this.context.Current.Cipher.CipherAlgorithmType; - } - - return CipherAlgorithmType.None; - } - } - - public int CipherStrength - { - get - { - if (this.context.HandshakeState == HandshakeState.Finished) - { - return this.context.Current.Cipher.EffectiveKeyBits; - } - - return 0; - } - } - - public HashAlgorithmType HashAlgorithm - { - get - { - if (this.context.HandshakeState == HandshakeState.Finished) - { - return this.context.Current.Cipher.HashAlgorithmType; - } - - return HashAlgorithmType.None; - } - } - - public int HashStrength - { - get - { - if (this.context.HandshakeState == HandshakeState.Finished) - { - return this.context.Current.Cipher.HashSize * 8; - } - - return 0; - } - } - - public int KeyExchangeStrength - { - get - { - if (this.context.HandshakeState == HandshakeState.Finished) - { - return this.context.ServerSettings.Certificates[0].RSA.KeySize; - } - - return 0; - } - } - - public ExchangeAlgorithmType KeyExchangeAlgorithm - { - get - { - if (this.context.HandshakeState == HandshakeState.Finished) - { - return this.context.Current.Cipher.ExchangeAlgorithmType; - } - - return ExchangeAlgorithmType.None; - } - } - - public SecurityProtocolType SecurityProtocol - { - get - { - if (this.context.HandshakeState == HandshakeState.Finished) - { - return this.context.SecurityProtocol; - } - - return 0; - } - } - - public X509Certificate ServerCertificate - { - get - { - if (this.context.HandshakeState == HandshakeState.Finished) - { - if (this.context.ServerSettings.Certificates != null && - this.context.ServerSettings.Certificates.Count > 0) - { - return new X509Certificate(this.context.ServerSettings.Certificates[0].RawData); - } - } - - return null; - } - } - - // this is used by Mono's certmgr tool to download certificates - internal Mono.Security.X509.X509CertificateCollection ServerCertificates - { - get { return context.ServerSettings.Certificates; } - } - - #endregion - - #region Internal Async Result/State Class - - private class InternalAsyncResult : IAsyncResult - { - private object locker = new object (); - private AsyncCallback _userCallback; - private object _userState; - private Exception _asyncException; - private ManualResetEvent handle; - private bool completed; - private int _bytesRead; - private bool _fromWrite; - private bool _proceedAfterHandshake; - - private byte[] _buffer; - private int _offset; - private int _count; - - public InternalAsyncResult(AsyncCallback userCallback, object userState, byte[] buffer, int offset, int count, bool fromWrite, bool proceedAfterHandshake) - { - _userCallback = userCallback; - _userState = userState; - _buffer = buffer; - _offset = offset; - _count = count; - _fromWrite = fromWrite; - _proceedAfterHandshake = proceedAfterHandshake; - } - - public bool ProceedAfterHandshake - { - get { return _proceedAfterHandshake; } - } - - public bool FromWrite - { - get { return _fromWrite; } - } - - public byte[] Buffer - { - get { return _buffer; } - } - - public int Offset - { - get { return _offset; } - } - - public int Count - { - get { return _count; } - } - - public int BytesRead - { - get { return _bytesRead; } - } - - public object AsyncState - { - get { return _userState; } - } - - public Exception AsyncException - { - get { return _asyncException; } - } - - public bool CompletedWithError - { - get { - if (IsCompleted == false) - return false; - return null != _asyncException; - } - } - - public WaitHandle AsyncWaitHandle - { - get { - lock (locker) { - if (handle == null) - handle = new ManualResetEvent (completed); - } - return handle; - } - } - - public bool CompletedSynchronously - { - get { return false; } - } - - public bool IsCompleted - { - get { - lock (locker) - return completed; - } - } - - private void SetComplete(Exception ex, int bytesRead) - { - lock (locker) { - if (completed) - return; - - completed = true; - _asyncException = ex; - _bytesRead = bytesRead; - if (handle != null) - handle.Set (); - } - if (_userCallback != null) - _userCallback.BeginInvoke (this, null, null); - } - - public void SetComplete(Exception ex) - { - SetComplete(ex, 0); - } - - public void SetComplete(int bytesRead) - { - SetComplete(null, bytesRead); - } - - public void SetComplete() - { - SetComplete(null, 0); - } - } - #endregion - - #region Stream Overrides and Async Stream Operations - - private bool BeginNegotiateHandshake(InternalAsyncResult asyncResult) - { - try - { - lock (this.negotiate) - { - if (this.context.HandshakeState == HandshakeState.None) - { - this.BeginNegotiateHandshake(new AsyncCallback(AsyncHandshakeCallback), asyncResult); - - return true; - } - else - { - return false; - } - } - } - catch (Exception ex) - { - this.negotiationComplete.Set(); - this.protocol.SendAlert(ref ex); - - throw new IOException("The authentication or decryption has failed.", ex); - } - } - - private void EndNegotiateHandshake(InternalAsyncResult asyncResult) - { - if (asyncResult.IsCompleted == false) - asyncResult.AsyncWaitHandle.WaitOne(); - - if (asyncResult.CompletedWithError) - { - throw asyncResult.AsyncException; - } - } - - public override IAsyncResult BeginRead( - byte[] buffer, - int offset, - int count, - AsyncCallback callback, - object state) - { - this.checkDisposed(); - - if (buffer == null) - { - throw new ArgumentNullException("buffer is a null reference."); - } - if (offset < 0) - { - throw new ArgumentOutOfRangeException("offset is less than 0."); - } - if (offset > buffer.Length) - { - throw new ArgumentOutOfRangeException("offset is greater than the length of buffer."); - } - if (count < 0) - { - throw new ArgumentOutOfRangeException("count is less than 0."); - } - if (count > (buffer.Length - offset)) - { - throw new ArgumentOutOfRangeException("count is less than the length of buffer minus the value of the offset parameter."); - } - - InternalAsyncResult asyncResult = new InternalAsyncResult(callback, state, buffer, offset, count, false, true); - - if (this.MightNeedHandshake) - { - if (! BeginNegotiateHandshake(asyncResult)) - { - //we made it down here so the handshake was not started. - //another thread must have started it in the mean time. - //wait for it to complete and then perform our original operation - this.negotiationComplete.WaitOne(); - - InternalBeginRead(asyncResult); - } - } - else - { - InternalBeginRead(asyncResult); - } - - return asyncResult; - } - - // bigger than max record length for SSL/TLS - private byte[] recbuf = new byte[16384]; - - private void InternalBeginRead(InternalAsyncResult asyncResult) - { - try - { - int preReadSize = 0; - - lock (this.read) - { - // If actual buffer is fully read, reset it - bool shouldReset = this.inputBuffer.Position == this.inputBuffer.Length && this.inputBuffer.Length > 0; - - // If the buffer isn't fully read, but does have data, we need to immediately - // read the info from the buffer and let the user know that they have more data. - bool shouldReadImmediately = (this.inputBuffer.Length > 0) && (asyncResult.Count > 0); - - if (shouldReset) - { - this.resetBuffer(); - } - else if (shouldReadImmediately) - { - preReadSize = this.inputBuffer.Read(asyncResult.Buffer, asyncResult.Offset, asyncResult.Count); - } - } - - // This is explicitly done outside the synclock to avoid - // any potential deadlocks in the delegate call. - if (0 < preReadSize) - { - asyncResult.SetComplete(preReadSize); - } - else if (recordStream.Position < recordStream.Length) { - InternalReadCallback_inner (asyncResult, recbuf, new object[] { recbuf, asyncResult }, false, 0); - } - else if (!this.context.ReceivedConnectionEnd) - { - // this will read data from the network until we have (at least) one - // record to send back to the caller - this.innerStream.BeginRead(recbuf, 0, recbuf.Length, - new AsyncCallback(InternalReadCallback), new object[] { recbuf, asyncResult }); - } - else - { - // We're done with the connection so we need to let the caller know with 0 bytes read - asyncResult.SetComplete(0); - } - } - catch (Exception ex) - { - this.protocol.SendAlert(ref ex); - throw new IOException("The authentication or decryption has failed.", ex); - } - } - - - private MemoryStream recordStream = new MemoryStream(); - - // read encrypted data until we have enough to decrypt (at least) one - // record and return are the records (may be more than one) we have - private void InternalReadCallback(IAsyncResult result) - { - object[] state = (object[])result.AsyncState; - byte[] recbuf = (byte[])state[0]; - InternalAsyncResult internalResult = (InternalAsyncResult)state[1]; - - try - { - this.checkDisposed(); - - int n = innerStream.EndRead(result); - if (n > 0) - { - // Add the just received data to the waiting data - recordStream.Write(recbuf, 0, n); - } - else - { - // 0 length data means this read operation is done (lost connection in the case of a network stream). - internalResult.SetComplete(0); - return; - } - - InternalReadCallback_inner(internalResult, recbuf, state, true, n); - } - catch (Exception ex) - { - internalResult.SetComplete(ex); - } - - } - - // read encrypted data until we have enough to decrypt (at least) one - // record and return are the records (may be more than one) we have - private void InternalReadCallback_inner(InternalAsyncResult internalResult, byte[] recbuf, object[] state, bool didRead, int n) - { - if (this.disposed) - return; - - try - { - bool dataToReturn = false; - long pos = recordStream.Position; - - recordStream.Position = 0; - byte[] record = null; - - // don't try to decode record unless we have at least 5 bytes - // i.e. type (1), protocol (2) and length (2) - if (recordStream.Length >= 5) - { - record = this.protocol.ReceiveRecord(recordStream); - } - - // a record of 0 length is valid (and there may be more record after it) - while (record != null) - { - // we probably received more stuff after the record, and we must keep it! - long remainder = recordStream.Length - recordStream.Position; - byte[] outofrecord = null; - if (remainder > 0) - { - outofrecord = new byte[remainder]; - recordStream.Read(outofrecord, 0, outofrecord.Length); - } - - lock (this.read) - { - long position = this.inputBuffer.Position; - - if (record.Length > 0) - { - // Write new data to the inputBuffer - this.inputBuffer.Seek(0, SeekOrigin.End); - this.inputBuffer.Write(record, 0, record.Length); - - // Restore buffer position - this.inputBuffer.Seek(position, SeekOrigin.Begin); - dataToReturn = true; - } - } - - recordStream.SetLength(0); - record = null; - - if (remainder > 0) - { - recordStream.Write(outofrecord, 0, outofrecord.Length); - // type (1), protocol (2) and length (2) - if (recordStream.Length >= 5) - { - // try to see if another record is available - recordStream.Position = 0; - record = this.protocol.ReceiveRecord(recordStream); - if (record == null) - pos = recordStream.Length; - } - else - pos = remainder; - } - else - pos = 0; - } - - if (!dataToReturn && (!didRead || (n > 0))) - { - if (context.ReceivedConnectionEnd) { - internalResult.SetComplete (0); - } else { - // there is no record to return to caller and (possibly) more data waiting - // so continue reading from network (and appending to stream) - recordStream.Position = recordStream.Length; - this.innerStream.BeginRead(recbuf, 0, recbuf.Length, - new AsyncCallback(InternalReadCallback), state); - } - } - else - { - // we have record(s) to return -or- no more available to read from network - // reset position for further reading - recordStream.Position = pos; - - int bytesRead = 0; - lock (this.read) - { - bytesRead = this.inputBuffer.Read(internalResult.Buffer, internalResult.Offset, internalResult.Count); - } - - internalResult.SetComplete(bytesRead); - } - } - catch (Exception ex) - { - internalResult.SetComplete(ex); - } - } - - private void InternalBeginWrite(InternalAsyncResult asyncResult) - { - try - { - // Send the buffer as a TLS record - - lock (this.write) - { - byte[] record = this.protocol.EncodeRecord( - ContentType.ApplicationData, asyncResult.Buffer, asyncResult.Offset, asyncResult.Count); - - this.innerStream.BeginWrite( - record, 0, record.Length, new AsyncCallback(InternalWriteCallback), asyncResult); - } - } - catch (Exception ex) - { - this.protocol.SendAlert (ref ex); - this.Close(); - - throw new IOException("The authentication or decryption has failed.", ex); - } - } - - private void InternalWriteCallback(IAsyncResult ar) - { - InternalAsyncResult internalResult = (InternalAsyncResult)ar.AsyncState; - - try - { - this.checkDisposed(); - this.innerStream.EndWrite(ar); - internalResult.SetComplete(); - } - catch (Exception ex) - { - internalResult.SetComplete(ex); - } - } - - public override IAsyncResult BeginWrite( - byte[] buffer, - int offset, - int count, - AsyncCallback callback, - object state) - { - this.checkDisposed(); - - if (buffer == null) - { - throw new ArgumentNullException("buffer is a null reference."); - } - if (offset < 0) - { - throw new ArgumentOutOfRangeException("offset is less than 0."); - } - if (offset > buffer.Length) - { - throw new ArgumentOutOfRangeException("offset is greater than the length of buffer."); - } - if (count < 0) - { - throw new ArgumentOutOfRangeException("count is less than 0."); - } - if (count > (buffer.Length - offset)) - { - throw new ArgumentOutOfRangeException("count is less than the length of buffer minus the value of the offset parameter."); - } - - - InternalAsyncResult asyncResult = new InternalAsyncResult(callback, state, buffer, offset, count, true, true); - - if (this.MightNeedHandshake) - { - if (! BeginNegotiateHandshake(asyncResult)) - { - //we made it down here so the handshake was not started. - //another thread must have started it in the mean time. - //wait for it to complete and then perform our original operation - this.negotiationComplete.WaitOne(); - - InternalBeginWrite(asyncResult); - } - } - else - { - InternalBeginWrite(asyncResult); - } - - return asyncResult; - } - - public override int EndRead(IAsyncResult asyncResult) - { - this.checkDisposed(); - - InternalAsyncResult internalResult = asyncResult as InternalAsyncResult; - if (internalResult == null) - { - throw new ArgumentNullException("asyncResult is null or was not obtained by calling BeginRead."); - } - - // Always wait until the read is complete - if (!asyncResult.IsCompleted) - { - if (!asyncResult.AsyncWaitHandle.WaitOne ()) - throw new TlsException (AlertDescription.InternalError, "Couldn't complete EndRead"); - } - - if (internalResult.CompletedWithError) - { - throw internalResult.AsyncException; - } - - return internalResult.BytesRead; - } - - public override void EndWrite(IAsyncResult asyncResult) - { - this.checkDisposed(); - - InternalAsyncResult internalResult = asyncResult as InternalAsyncResult; - if (internalResult == null) - { - throw new ArgumentNullException("asyncResult is null or was not obtained by calling BeginWrite."); - } - - - if (!asyncResult.IsCompleted) - { - if (!internalResult.AsyncWaitHandle.WaitOne ()) - throw new TlsException (AlertDescription.InternalError, "Couldn't complete EndWrite"); - } - - if (internalResult.CompletedWithError) - { - throw internalResult.AsyncException; - } - } - - public override void Close() - { - base.Close (); - } - - public override void Flush() - { - this.checkDisposed(); - - this.innerStream.Flush(); - } - - public int Read(byte[] buffer) - { - return this.Read(buffer, 0, buffer.Length); - } - - public override int Read(byte[] buffer, int offset, int count) - { - this.checkDisposed (); - - if (buffer == null) - { - throw new ArgumentNullException ("buffer"); - } - if (offset < 0) - { - throw new ArgumentOutOfRangeException("offset is less than 0."); - } - if (offset > buffer.Length) - { - throw new ArgumentOutOfRangeException("offset is greater than the length of buffer."); - } - if (count < 0) - { - throw new ArgumentOutOfRangeException("count is less than 0."); - } - if (count > (buffer.Length - offset)) - { - throw new ArgumentOutOfRangeException("count is less than the length of buffer minus the value of the offset parameter."); - } - - if (this.context.HandshakeState != HandshakeState.Finished) - { - this.NegotiateHandshake (); // Handshake negotiation - } - - lock (this.read) { - try { - record_processing.Reset (); - // do we already have some decrypted data ? - if (this.inputBuffer.Position > 0) { - // or maybe we used all the buffer before ? - if (this.inputBuffer.Position == this.inputBuffer.Length) { - this.inputBuffer.SetLength (0); - } else { - int n = this.inputBuffer.Read (buffer, offset, count); - if (n > 0) { - record_processing.Set (); - return n; - } - } - } - - bool needMoreData = false; - while (true) { - // we first try to process the read with the data we already have - if ((recordStream.Position == 0) || needMoreData) { - needMoreData = false; - // if we loop, then it either means we need more data - byte[] recbuf = new byte[16384]; - int n = 0; - if (count == 1) { - int value = innerStream.ReadByte (); - if (value >= 0) { - recbuf[0] = (byte) value; - n = 1; - } - } else { - n = innerStream.Read (recbuf, 0, recbuf.Length); - } - if (n > 0) { - // Add the new received data to the waiting data - if ((recordStream.Length > 0) && (recordStream.Position != recordStream.Length)) - recordStream.Seek (0, SeekOrigin.End); - recordStream.Write (recbuf, 0, n); - } else { - // or that the read operation is done (lost connection in the case of a network stream). - record_processing.Set (); - return 0; - } - } - - bool dataToReturn = false; - - recordStream.Position = 0; - byte[] record = null; - - // don't try to decode record unless we have at least 5 bytes - // i.e. type (1), protocol (2) and length (2) - if (recordStream.Length >= 5) { - record = this.protocol.ReceiveRecord (recordStream); - needMoreData = (record == null); - } - - // a record of 0 length is valid (and there may be more record after it) - while (record != null) { - // we probably received more stuff after the record, and we must keep it! - long remainder = recordStream.Length - recordStream.Position; - byte[] outofrecord = null; - if (remainder > 0) { - outofrecord = new byte[remainder]; - recordStream.Read (outofrecord, 0, outofrecord.Length); - } - - long position = this.inputBuffer.Position; - - if (record.Length > 0) { - // Write new data to the inputBuffer - this.inputBuffer.Seek (0, SeekOrigin.End); - this.inputBuffer.Write (record, 0, record.Length); - - // Restore buffer position - this.inputBuffer.Seek (position, SeekOrigin.Begin); - dataToReturn = true; - } - - recordStream.SetLength (0); - record = null; - - if (remainder > 0) { - recordStream.Write (outofrecord, 0, outofrecord.Length); - recordStream.Position = 0; - } - - if (dataToReturn) { - // we have record(s) to return -or- no more available to read from network - // reset position for further reading - int i = inputBuffer.Read (buffer, offset, count); - record_processing.Set (); - return i; - } - } - } - } - catch (TlsException ex) - { - throw new IOException("The authentication or decryption has failed.", ex); - } - catch (Exception ex) - { - throw new IOException("IO exception during read.", ex); - } - } - } - - public override long Seek(long offset, SeekOrigin origin) - { - throw new NotSupportedException(); - } - - public override void SetLength(long value) - { - throw new NotSupportedException(); - } - - public void Write(byte[] buffer) - { - this.Write(buffer, 0, buffer.Length); - } - - public override void Write(byte[] buffer, int offset, int count) - { - this.checkDisposed (); - - if (buffer == null) - { - throw new ArgumentNullException ("buffer"); - } - if (offset < 0) - { - throw new ArgumentOutOfRangeException("offset is less than 0."); - } - if (offset > buffer.Length) - { - throw new ArgumentOutOfRangeException("offset is greater than the length of buffer."); - } - if (count < 0) - { - throw new ArgumentOutOfRangeException("count is less than 0."); - } - if (count > (buffer.Length - offset)) - { - throw new ArgumentOutOfRangeException("count is less than the length of buffer minus the value of the offset parameter."); - } - - if (this.context.HandshakeState != HandshakeState.Finished) - { - this.NegotiateHandshake (); - } - - lock (this.write) - { - try - { - // Send the buffer as a TLS record - byte[] record = this.protocol.EncodeRecord (ContentType.ApplicationData, buffer, offset, count); - this.innerStream.Write (record, 0, record.Length); - } - catch (Exception ex) - { - this.protocol.SendAlert(ref ex); - this.Close(); - throw new IOException("The authentication or decryption has failed.", ex); - } - } - } - - public override bool CanRead - { - get { return this.innerStream.CanRead; } - } - - public override bool CanSeek - { - get { return false; } - } - - public override bool CanWrite - { - get { return this.innerStream.CanWrite; } - } - - public override long Length - { - get { throw new NotSupportedException(); } - } - - public override long Position - { - get - { - throw new NotSupportedException(); - } - set - { - throw new NotSupportedException(); - } - } - #endregion - - #region IDisposable Members and Finalizer - - ~SslStreamBase() - { - this.Dispose(false); - } - - protected override void Dispose (bool disposing) - { - if (!this.disposed) - { - if (disposing) - { - if (this.innerStream != null) - { - if (this.context.HandshakeState == HandshakeState.Finished && - !this.context.SentConnectionEnd) - { - // Write close notify - try { - this.protocol.SendAlert(AlertDescription.CloseNotify); - } catch { - } - } - - if (this.ownsStream) - { - // Close inner stream - this.innerStream.Close(); - } - } - this.ownsStream = false; - this.innerStream = null; - } - - this.disposed = true; - base.Dispose (disposing); - } - } - - #endregion - - #region Misc Methods - - private void resetBuffer() - { - this.inputBuffer.SetLength(0); - this.inputBuffer.Position = 0; - } - - internal void checkDisposed() - { - if (this.disposed) - { - throw new ObjectDisposedException("The Stream is closed."); - } - } - - #endregion - - } -} diff --git a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/TlsCipherSuite.cs b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/TlsCipherSuite.cs deleted file mode 100644 index 2b261bf36a..0000000000 --- a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/TlsCipherSuite.cs +++ /dev/null @@ -1,152 +0,0 @@ -// Transport Security Layer (TLS) -// Copyright (c) 2003-2004 Carlos Guzman Alvarez -// Copyright (C) 2006 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.IO; -using System.Security.Cryptography; - -namespace Mono.Security.Protocol.Tls -{ - internal class TlsCipherSuite : CipherSuite - { - private const int MacHeaderLength = 13; - private byte[] header; - private object headerLock = new object (); - - #region Constructors - - public TlsCipherSuite( - short code, string name, CipherAlgorithmType cipherAlgorithmType, - HashAlgorithmType hashAlgorithmType, ExchangeAlgorithmType exchangeAlgorithmType, - bool exportable, bool blockMode, byte keyMaterialSize, - byte expandedKeyMaterialSize, short effectiveKeyBytes, - byte ivSize, byte blockSize) - :base(code, name, cipherAlgorithmType, hashAlgorithmType, - exchangeAlgorithmType, exportable, blockMode, keyMaterialSize, - expandedKeyMaterialSize, effectiveKeyBytes, ivSize, blockSize) - { - } - - #endregion - - #region MAC Generation Methods - - public override byte[] ComputeServerRecordMAC(ContentType contentType, byte[] fragment) - { - lock (headerLock) { - if (header == null) - header = new byte [MacHeaderLength]; - - ulong seqnum = (Context is ClientContext) ? Context.ReadSequenceNumber : Context.WriteSequenceNumber; - Write (header, 0, seqnum); - header [8] = (byte)contentType; - Write (header, 9, this.Context.Protocol); - Write (header, 11, (short)fragment.Length); - - HashAlgorithm mac = this.ServerHMAC; - mac.TransformBlock (header, 0, header.Length, header, 0); - mac.TransformBlock (fragment, 0, fragment.Length, fragment, 0); - // hack, else the method will allocate a new buffer of the same length (negative half the optimization) - mac.TransformFinalBlock (CipherSuite.EmptyArray, 0, 0); - return mac.Hash; - } - } - - public override byte[] ComputeClientRecordMAC(ContentType contentType, byte[] fragment) - { - lock (headerLock) { - if (header == null) - header = new byte [MacHeaderLength]; - - ulong seqnum = (Context is ClientContext) ? Context.WriteSequenceNumber : Context.ReadSequenceNumber; - Write (header, 0, seqnum); - header [8] = (byte)contentType; - Write (header, 9, this.Context.Protocol); - Write (header, 11, (short)fragment.Length); - - HashAlgorithm mac = this.ClientHMAC; - mac.TransformBlock (header, 0, header.Length, header, 0); - mac.TransformBlock (fragment, 0, fragment.Length, fragment, 0); - // hack, else the method will allocate a new buffer of the same length (negative half the optimization) - mac.TransformFinalBlock (CipherSuite.EmptyArray, 0, 0); - return mac.Hash; - } - } - - #endregion - - #region Key Generation Methods - - public override void ComputeMasterSecret(byte[] preMasterSecret) - { - // Create master secret - this.Context.MasterSecret = new byte[preMasterSecret.Length]; - this.Context.MasterSecret = this.PRF( - preMasterSecret, "master secret", this.Context.RandomCS, 48); - - DebugHelper.WriteLine(">>>> MasterSecret", this.Context.MasterSecret); - } - - public override void ComputeKeys() - { - // Create keyblock - TlsStream keyBlock = new TlsStream( - this.PRF( - this.Context.MasterSecret, - "key expansion", - this.Context.RandomSC, - this.KeyBlockSize)); - - this.Context.Negotiating.ClientWriteMAC = keyBlock.ReadBytes(this.HashSize); - this.Context.Negotiating.ServerWriteMAC = keyBlock.ReadBytes(this.HashSize); - this.Context.ClientWriteKey = keyBlock.ReadBytes(this.KeyMaterialSize); - this.Context.ServerWriteKey = keyBlock.ReadBytes(this.KeyMaterialSize); - - if (this.IvSize != 0) - { - this.Context.ClientWriteIV = keyBlock.ReadBytes(this.IvSize); - this.Context.ServerWriteIV = keyBlock.ReadBytes(this.IvSize); - } - else - { - this.Context.ClientWriteIV = CipherSuite.EmptyArray; - this.Context.ServerWriteIV = CipherSuite.EmptyArray; - } - - DebugHelper.WriteLine(">>>> KeyBlock", keyBlock.ToArray()); - DebugHelper.WriteLine(">>>> ClientWriteKey", this.Context.ClientWriteKey); - DebugHelper.WriteLine(">>>> ClientWriteIV", this.Context.ClientWriteIV); - DebugHelper.WriteLine(">>>> ClientWriteMAC", this.Context.Negotiating.ClientWriteMAC); - DebugHelper.WriteLine(">>>> ServerWriteKey", this.Context.ServerWriteKey); - DebugHelper.WriteLine(">>>> ServerWriteIV", this.Context.ServerWriteIV); - DebugHelper.WriteLine(">>>> ServerWriteMAC", this.Context.Negotiating.ServerWriteMAC); - - ClientSessionCache.SetContextInCache (this.Context); - // Clear no more needed data - keyBlock.Reset(); - } - - #endregion - } -} diff --git a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/TlsClientSettings.cs b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/TlsClientSettings.cs deleted file mode 100644 index bcbc882cf3..0000000000 --- a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/TlsClientSettings.cs +++ /dev/null @@ -1,124 +0,0 @@ -// Transport Security Layer (TLS) -// Copyright (c) 2003-2004 Carlos Guzman Alvarez - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Text; -using System.Security.Cryptography.X509Certificates; -using Mono.Security.Cryptography; -using X509 = Mono.Security.X509; - -namespace Mono.Security.Protocol.Tls -{ - internal sealed class TlsClientSettings - { - #region Fields - - private string targetHost; - private X509CertificateCollection certificates; - //private SecurityCompressionType compressionMethod; - private X509Certificate clientCertificate; - private RSAManaged certificateRSA; - - #endregion - - #region Properties - - public string TargetHost - { - get { return this.targetHost; } - set { this.targetHost = value; } - } - - public X509CertificateCollection Certificates - { - get { return this.certificates; } - set { this.certificates = value; } - } - - public X509Certificate ClientCertificate - { - get { return this.clientCertificate; } - set - { - this.clientCertificate = value; - this.UpdateCertificateRSA(); - } - } - - public RSAManaged CertificateRSA - { - get { return this.certificateRSA; } - } - - /* - public SecurityCompressionType CompressionMethod - { - get { return this.compressionMethod; } - set - { - if (value != SecurityCompressionType.None) - { - throw new NotSupportedException("Specified compression method is not supported"); - } - this.compressionMethod = value; - } - } - */ - - #endregion - - #region Constructors - - public TlsClientSettings() - { - // this.compressionMethod = SecurityCompressionType.None; - this.certificates = new X509CertificateCollection(); - this.targetHost = String.Empty; - } - - #endregion - - #region Methods - - public void UpdateCertificateRSA() - { - if (this.clientCertificate == null) - { - this.certificateRSA = null; - } - else - { - X509.X509Certificate cert = new X509.X509Certificate(this.clientCertificate.GetRawCertData()); - - this.certificateRSA = new RSAManaged( - cert.RSA.KeySize); - - this.certificateRSA.ImportParameters( - cert.RSA.ExportParameters(false)); - } - } - - #endregion - } -} diff --git a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/TlsException.cs b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/TlsException.cs deleted file mode 100644 index ef2c5ce090..0000000000 --- a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/TlsException.cs +++ /dev/null @@ -1,93 +0,0 @@ -// Transport Security Layer (TLS) -// Copyright (c) 2003-2004 Carlos Guzman Alvarez - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Text; -using System.Runtime.Serialization; - -namespace Mono.Security.Protocol.Tls -{ - [Serializable] - internal sealed class TlsException : Exception - { - #region Fields - - private Alert alert; - - #endregion - - #region Properties - - public Alert Alert - { - get { return this.alert; } - } - - #endregion - - #region Constructors - - internal TlsException(string message) : base(message) - { - } - - internal TlsException(SerializationInfo info, StreamingContext context) : base(info, context) - { - } - - internal TlsException(string message, Exception ex) : base(message, ex) - { - } - - internal TlsException( - AlertLevel level, - AlertDescription description) - : this (level, description, Alert.GetAlertMessage(description)) - { - } - - internal TlsException( - AlertLevel level, - AlertDescription description, - string message) : base (message) - { - this.alert = new Alert(level, description); - } - - internal TlsException( - AlertDescription description) - : this (description, Alert.GetAlertMessage(description)) - { - } - - internal TlsException( - AlertDescription description, - string message) : base (message) - { - this.alert = new Alert(description); - } - - #endregion - } -} diff --git a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/TlsServerSettings.cs b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/TlsServerSettings.cs deleted file mode 100644 index fec31752e7..0000000000 --- a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/TlsServerSettings.cs +++ /dev/null @@ -1,129 +0,0 @@ -// Transport Security Layer (TLS) -// Copyright (c) 2003-2004 Carlos Guzman Alvarez - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Security.Cryptography; - -using Mono.Security.Cryptography; -using Mono.Security.X509; -using Mono.Security.Protocol.Tls.Handshake; - -namespace Mono.Security.Protocol.Tls -{ - internal class TlsServerSettings - { - #region Fields - - private X509CertificateCollection certificates; - private RSA certificateRSA; - private RSAParameters rsaParameters; - private byte[] signedParams; - private string[] distinguisedNames; - private bool serverKeyExchange; - private bool certificateRequest; - private ClientCertificateType[] certificateTypes; - - #endregion - - #region Properties - - public bool ServerKeyExchange - { - get { return this.serverKeyExchange; } - set { this.serverKeyExchange = value; } - } - - public X509CertificateCollection Certificates - { - get { return this.certificates; } - set { this.certificates = value; } - } - - public RSA CertificateRSA - { - get { return this.certificateRSA; } - } - - public RSAParameters RsaParameters - { - get { return this.rsaParameters; } - set { this.rsaParameters = value; } - } - - public byte[] SignedParams - { - get { return this.signedParams; } - set { this.signedParams = value; } - } - - public bool CertificateRequest - { - get { return this.certificateRequest; } - set { this.certificateRequest = value; } - } - - public ClientCertificateType[] CertificateTypes - { - get { return this.certificateTypes; } - set { this.certificateTypes = value; } - } - - public string[] DistinguisedNames - { - get { return this.distinguisedNames; } - set { this.distinguisedNames = value; } - } - - #endregion - - #region Constructors - - public TlsServerSettings() - { - } - - #endregion - - #region Methods - - public void UpdateCertificateRSA() - { - if (this.certificates == null || - this.certificates.Count == 0) - { - this.certificateRSA = null; - } - else - { - this.certificateRSA = new RSAManaged( - this.certificates[0].RSA.KeySize); - - this.certificateRSA.ImportParameters( - this.certificates[0].RSA.ExportParameters(false)); - } - } - - #endregion - } -} diff --git a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/TlsStream.cs b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/TlsStream.cs deleted file mode 100644 index 4130ad10ec..0000000000 --- a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/TlsStream.cs +++ /dev/null @@ -1,274 +0,0 @@ -// Transport Security Layer (TLS) -// Copyright (c) 2003-2004 Carlos Guzman Alvarez -// Copyright (C) 2006 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.IO; - -namespace Mono.Security.Protocol.Tls -{ - internal class TlsStream : Stream - { - #region Fields - - private bool canRead; - private bool canWrite; - private MemoryStream buffer; - private byte[] temp; - private const int temp_size = 4; - - #endregion - - #region Properties - - public bool EOF - { - get - { - if (this.Position < this.Length) - { - return false; - } - else - { - return true; - } - } - } - - #endregion - - #region Stream Properties - - public override bool CanWrite - { - get { return this.canWrite; } - } - - public override bool CanRead - { - get { return this.canRead; } - } - - public override bool CanSeek - { - get { return this.buffer.CanSeek; } - } - - public override long Position - { - get { return this.buffer.Position; } - set { this.buffer.Position = value; } - } - - public override long Length - { - get { return this.buffer.Length; } - } - - #endregion - - #region Constructors - - public TlsStream() : base() - { - this.buffer = new MemoryStream(0); - this.canRead = false; - this.canWrite = true; - } - - public TlsStream(byte[] data) : base() - { - if (data != null) - this.buffer = new MemoryStream(data); - else - this.buffer = new MemoryStream (); - this.canRead = true; - this.canWrite = false; - } - - #endregion - - #region Specific Read Methods - - // hack for reducing memory allocations - // returned value is valid only for the length asked *and* - // cannot be directly returned outside the class - // note: Mono's Stream.ReadByte does a 1 byte array allocation - private byte[] ReadSmallValue (int length) - { - if (length > temp_size) - throw new ArgumentException ("8 bytes maximum"); - if (temp == null) - temp = new byte[temp_size]; - - if (this.Read (temp, 0, length) != length) - throw new TlsException (String.Format ("buffer underrun")); - return temp; - } - - public new byte ReadByte() - { - byte[] result = ReadSmallValue (1); - return result [0]; - } - - public short ReadInt16() - { - byte[] result = ReadSmallValue (2); - return (short) (result[0] << 8 | result[1]); - } - - public int ReadInt24() - { - byte[] result = ReadSmallValue (3); - return ((result[0] << 16) | (result[1] << 8) | result[2]); - } - - public int ReadInt32() - { - byte[] result = ReadSmallValue (4); - return ((result[0] << 24) | (result[1] << 16) | (result[2] << 8) | result[3]); - } - - public byte[] ReadBytes(int count) - { - byte[] bytes = new byte[count]; - if (this.Read(bytes, 0, count) != count) - throw new TlsException ("buffer underrun"); - - return bytes; - } - - #endregion - - #region Specific Write Methods - - // note: Mono's Stream.WriteByte does a 1 byte array allocation - public void Write(byte value) - { - if (temp == null) - temp = new byte[temp_size]; - temp[0] = value; - this.Write (temp, 0, 1); - } - - public void Write(short value) - { - if (temp == null) - temp = new byte[temp_size]; - temp[0] = ((byte)(value >> 8)); - temp[1] = ((byte)value); - this.Write (temp, 0, 2); - } - - public void WriteInt24(int value) - { - if (temp == null) - temp = new byte[temp_size]; - temp[0] = ((byte)(value >> 16)); - temp[1] = ((byte)(value >> 8)); - temp[2] = ((byte)value); - this.Write (temp, 0, 3); - } - - public void Write(int value) - { - if (temp == null) - temp = new byte[temp_size]; - temp[0] = ((byte)(value >> 24)); - temp[1] = ((byte)(value >> 16)); - temp[2] = ((byte)(value >> 8)); - temp[3] = ((byte)value); - this.Write (temp, 0, 4); - } - - public void Write(ulong value) - { - Write ((int)(value >> 32)); - Write ((int)value); - } - - public void Write(byte[] buffer) - { - this.Write(buffer, 0, buffer.Length); - } - - #endregion - - #region Methods - - public void Reset() - { - this.buffer.SetLength(0); - this.buffer.Position = 0; - } - - public byte[] ToArray() - { - return this.buffer.ToArray(); - } - - #endregion - - #region Stream Methods - - public override void Flush() - { - this.buffer.Flush(); - } - - public override void SetLength(long length) - { - this.buffer.SetLength(length); - } - - public override long Seek(long offset, System.IO.SeekOrigin loc) - { - return this.buffer.Seek(offset, loc); - } - - public override int Read(byte[] buffer, int offset, int count) - { - if (this.canRead) - { - return this.buffer.Read(buffer, offset, count); - } - throw new InvalidOperationException("Read operations are not allowed by this stream"); - } - - public override void Write(byte[] buffer, int offset, int count) - { - if (this.canWrite) - { - this.buffer.Write(buffer, offset, count); - } - else - { - throw new InvalidOperationException("Write operations are not allowed by this stream"); - } - } - - #endregion - } -} diff --git a/mcs/class/Mono.Security/Mono.Security.dll.sources b/mcs/class/Mono.Security/Mono.Security.dll.sources index c6b8882cad..d431140fdb 100644 --- a/mcs/class/Mono.Security/Mono.Security.dll.sources +++ b/mcs/class/Mono.Security/Mono.Security.dll.sources @@ -74,65 +74,7 @@ ./Mono.Security.Protocol.Ntlm/Type1Message.cs ./Mono.Security.Protocol.Ntlm/Type2Message.cs ./Mono.Security.Protocol.Ntlm/Type3Message.cs -./Mono.Security.Protocol.Tls/Alert.cs -./Mono.Security.Protocol.Tls/CipherAlgorithmType.cs -./Mono.Security.Protocol.Tls/CipherSuite.cs -./Mono.Security.Protocol.Tls/CipherSuiteCollection.cs -./Mono.Security.Protocol.Tls/CipherSuiteFactory.cs -./Mono.Security.Protocol.Tls/ClientContext.cs -./Mono.Security.Protocol.Tls/ClientRecordProtocol.cs -./Mono.Security.Protocol.Tls/ClientSessionCache.cs -./Mono.Security.Protocol.Tls/ContentType.cs -./Mono.Security.Protocol.Tls/Context.cs -./Mono.Security.Protocol.Tls/DebugHelper.cs -./Mono.Security.Protocol.Tls/ExchangeAlgorithmType.cs -./Mono.Security.Protocol.Tls/HandshakeState.cs -./Mono.Security.Protocol.Tls/HashAlgorithmType.cs -./Mono.Security.Protocol.Tls/MD5SHA1.cs -./Mono.Security.Protocol.Tls/HttpsClientStream.cs -./Mono.Security.Protocol.Tls/RecordProtocol.cs -./Mono.Security.Protocol.Tls/RSASslSignatureDeformatter.cs -./Mono.Security.Protocol.Tls/RSASslSignatureFormatter.cs -./Mono.Security.Protocol.Tls/SecurityCompressionType.cs -./Mono.Security.Protocol.Tls/SecurityParameters.cs -./Mono.Security.Protocol.Tls/SecurityProtocolType.cs -./Mono.Security.Protocol.Tls/ServerContext.cs -./Mono.Security.Protocol.Tls/ServerRecordProtocol.cs -./Mono.Security.Protocol.Tls/SslClientStream.cs -./Mono.Security.Protocol.Tls/SslCipherSuite.cs -./Mono.Security.Protocol.Tls/SslHandshakeHash.cs -./Mono.Security.Protocol.Tls/SslServerStream.cs -./Mono.Security.Protocol.Tls/SslStreamBase.cs -./Mono.Security.Protocol.Tls/TlsCipherSuite.cs -./Mono.Security.Protocol.Tls/TlsClientSettings.cs -./Mono.Security.Protocol.Tls/TlsException.cs -./Mono.Security.Protocol.Tls/TlsServerSettings.cs -./Mono.Security.Protocol.Tls/TlsStream.cs -./Mono.Security.Protocol.Tls.Handshake/ClientCertificateType.cs -./Mono.Security.Protocol.Tls.Handshake/HandshakeMessage.cs -./Mono.Security.Protocol.Tls.Handshake/HandshakeType.cs -./Mono.Security.Protocol.Tls.Handshake.Client/TlsClientCertificate.cs -./Mono.Security.Protocol.Tls.Handshake.Client/TlsClientCertificateVerify.cs -./Mono.Security.Protocol.Tls.Handshake.Client/TlsClientFinished.cs -./Mono.Security.Protocol.Tls.Handshake.Client/TlsClientHello.cs -./Mono.Security.Protocol.Tls.Handshake.Client/TlsClientKeyExchange.cs -./Mono.Security.Protocol.Tls.Handshake.Client/TlsServerCertificate.cs -./Mono.Security.Protocol.Tls.Handshake.Client/TlsServerCertificateRequest.cs -./Mono.Security.Protocol.Tls.Handshake.Client/TlsServerFinished.cs -./Mono.Security.Protocol.Tls.Handshake.Client/TlsServerHello.cs -./Mono.Security.Protocol.Tls.Handshake.Client/TlsServerHelloDone.cs -./Mono.Security.Protocol.Tls.Handshake.Client/TlsServerKeyExchange.cs -./Mono.Security.Protocol.Tls.Handshake.Server/TlsClientCertificate.cs -./Mono.Security.Protocol.Tls.Handshake.Server/TlsClientCertificateVerify.cs -./Mono.Security.Protocol.Tls.Handshake.Server/TlsClientFinished.cs -./Mono.Security.Protocol.Tls.Handshake.Server/TlsClientHello.cs -./Mono.Security.Protocol.Tls.Handshake.Server/TlsClientKeyExchange.cs -./Mono.Security.Protocol.Tls.Handshake.Server/TlsServerCertificate.cs -./Mono.Security.Protocol.Tls.Handshake.Server/TlsServerCertificateRequest.cs -./Mono.Security.Protocol.Tls.Handshake.Server/TlsServerFinished.cs -./Mono.Security.Protocol.Tls.Handshake.Server/TlsServerHello.cs -./Mono.Security.Protocol.Tls.Handshake.Server/TlsServerHelloDone.cs -./Mono.Security.Protocol.Tls.Handshake.Server/TlsServerKeyExchange.cs + ./Mono.Xml/MiniParser.cs ./Mono.Xml/SecurityParser.cs diff --git a/mcs/class/System.Core/common_System.Core.dll.sources b/mcs/class/System.Core/common_System.Core.dll.sources index 0a8d10c7ab..d4249126ab 100644 --- a/mcs/class/System.Core/common_System.Core.dll.sources +++ b/mcs/class/System.Core/common_System.Core.dll.sources @@ -2,6 +2,8 @@ ../../build/common/SR.cs ../../build/common/MonoTODOAttribute.cs +../corlib/System.Runtime.CompilerServices/PreserveDependencyAttribute.cs + Assembly/AssemblyInfo.cs System/Util.cs System.IO.MemoryMappedFiles/MemoryMappedFile.cs diff --git a/mcs/class/System.Drawing/win32_net_4_x_System.Drawing.dll.exclude.sources b/mcs/class/System.Drawing/win32_net_4_x_System.Drawing.dll.exclude.sources new file mode 100644 index 0000000000..9a9569334e --- /dev/null +++ b/mcs/class/System.Drawing/win32_net_4_x_System.Drawing.dll.exclude.sources @@ -0,0 +1,2 @@ +System.Drawing/BufferedGraphics.cs +System.Drawing/BufferedGraphicsContext.cs diff --git a/mcs/class/System.Drawing/win32_net_4_x_System.Drawing.dll.sources b/mcs/class/System.Drawing/win32_net_4_x_System.Drawing.dll.sources new file mode 100644 index 0000000000..925185e88a --- /dev/null +++ b/mcs/class/System.Drawing/win32_net_4_x_System.Drawing.dll.sources @@ -0,0 +1,4 @@ +#include System.Drawing.dll.sources + +../../../external/corefx/src/System.Drawing.Common/src/System/Drawing/BufferedGraphics.Windows.cs +../../../external/corefx/src/System.Drawing.Common/src/System/Drawing/BufferedGraphicsContext.Windows.cs diff --git a/mcs/class/System.Net.Http/System.Net.Http/ByteArrayContent.cs b/mcs/class/System.Net.Http/System.Net.Http/ByteArrayContent.cs index ab551ee273..46a92e38cd 100644 --- a/mcs/class/System.Net.Http/System.Net.Http/ByteArrayContent.cs +++ b/mcs/class/System.Net.Http/System.Net.Http/ByteArrayContent.cs @@ -63,7 +63,7 @@ namespace System.Net.Http return Task.FromResult (new MemoryStream (content, offset, count)); } - protected internal override Task SerializeToStreamAsync (Stream stream, TransportContext context) + protected override Task SerializeToStreamAsync (Stream stream, TransportContext context) { return stream.WriteAsync (content, offset, count); } diff --git a/mcs/class/System.Net.Http/System.Net.Http/HttpClient.cs b/mcs/class/System.Net.Http/System.Net.Http/HttpClient.cs index 3e91b2d224..0c697b05a8 100644 --- a/mcs/class/System.Net.Http/System.Net.Http/HttpClient.cs +++ b/mcs/class/System.Net.Http/System.Net.Http/HttpClient.cs @@ -44,7 +44,12 @@ namespace System.Net.Http long buffer_size; TimeSpan timeout; -#if !XAMARIN_MODERN && !WASM +#if XAMARIN_MODERN + public HttpClient () + : this (CreateDefaultHandler (), true) + { + } +#elif !WASM public HttpClient () : this (new HttpClientHandler (), true) { diff --git a/mcs/class/System.Net.Http/System.Net.Http/HttpClient.macios.cs b/mcs/class/System.Net.Http/System.Net.Http/HttpClient.macios.cs index a60a7941b2..120d4de401 100644 --- a/mcs/class/System.Net.Http/System.Net.Http/HttpClient.macios.cs +++ b/mcs/class/System.Net.Http/System.Net.Http/HttpClient.macios.cs @@ -3,12 +3,6 @@ using System.Reflection; namespace System.Net.Http { public partial class HttpClient { - - public HttpClient () - : this (CreateDefaultHandler ()) - { - } - static HttpMessageHandler CreateDefaultHandler () { return ObjCRuntime.RuntimeOptions.GetHttpMessageHandler (); diff --git a/mcs/class/System.Net.Http/System.Net.Http/HttpClientHandler.platformnotsupported.cs b/mcs/class/System.Net.Http/System.Net.Http/HttpClientHandler.platformnotsupported.cs deleted file mode 100644 index e883807a5c..0000000000 --- a/mcs/class/System.Net.Http/System.Net.Http/HttpClientHandler.platformnotsupported.cs +++ /dev/null @@ -1,179 +0,0 @@ -// -// System.Net.Http/HttpClientHandler.cs -// -// Author: -// Rolf Bjarne Kvinge -// -// Copyright (C) 2016 Xamarin Inc (http://www.xamarin.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System.Collections.Generic; -using System.Net.Security; -using System.Security.Authentication; -using System.Security.Cryptography.X509Certificates; -using System.Threading.Tasks; -using System.Threading; - -namespace System.Net.Http -{ - public class HttpClientHandler : HttpMessageHandler - { - const string EXCEPTION_MESSAGE = "System.Net.Http.HttpClientHandler is not supported on the current platform."; - - public HttpClientHandler () - { - throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); - } - - public bool AllowAutoRedirect { - get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); } - set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); } - } - - public DecompressionMethods AutomaticDecompression { - get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); } - set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); } - } - - public ClientCertificateOption ClientCertificateOptions { - get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); } - set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); } - } - - public CookieContainer CookieContainer { - get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); } - set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); } - } - - public ICredentials Credentials { - get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); } - set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); } - } - - public int MaxAutomaticRedirections { - get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); } - set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); } - } - - public long MaxRequestContentBufferSize { - get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); } - set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); } - } - - public bool PreAuthenticate { - get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); } - set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); } - } - - public IWebProxy Proxy { - get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); } - set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); } - } - - public virtual bool SupportsAutomaticDecompression { - get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); } - } - - public virtual bool SupportsProxy { - get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); } - } - - public virtual bool SupportsRedirectConfiguration { - get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); } - } - - public bool UseCookies { - get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); } - set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); } - } - - public bool UseDefaultCredentials { - get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); } - set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); } - } - - public bool UseProxy { - get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); } - set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); } - } - - protected override void Dispose (bool disposing) - { - throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); - } - - HttpResponseMessage CreateResponseMessage (HttpWebResponse wr, HttpRequestMessage requestMessage, CancellationToken cancellationToken) - { - throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); - } - - protected internal async override Task SendAsync (HttpRequestMessage request, CancellationToken cancellationToken) - { - throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); - } - - public bool CheckCertificateRevocationList { - get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); } - set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); } - } - - public X509CertificateCollection ClientCertificates { - get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); } - } - - public ICredentials DefaultProxyCredentials { - get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); } - set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); } - } - - public int MaxConnectionsPerServer { - get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); } - set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); } - } - - public int MaxResponseHeadersLength { - get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); } - set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); } - } - - public IDictionary Properties { - get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); } - set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); } - } - - public Func ServerCertificateCustomValidationCallback { - get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); } - set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); } - } - - public SslProtocols SslProtocols { - get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); } - set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); } - } - - // Only used in MonoWebRequestHandler and ignored by the other handlers. - internal void SetWebRequestTimeout (TimeSpan timeout) => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); - - // NS2.1: - public static System.Func DangerousAcceptAnyServerCertificateValidator => throw new PlatformNotSupportedException (); - } -} diff --git a/mcs/class/System.Net.Http/System.Net.Http/HttpClientHandler.xi.cs b/mcs/class/System.Net.Http/System.Net.Http/HttpClientHandler.xi.cs new file mode 100644 index 0000000000..223762534a --- /dev/null +++ b/mcs/class/System.Net.Http/System.Net.Http/HttpClientHandler.xi.cs @@ -0,0 +1,148 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System.Collections.Generic; +using System.Net.Security; +using System.Security.Authentication; +using System.Security.Cryptography.X509Certificates; +using System.Threading; +using System.Threading.Tasks; + +namespace System.Net.Http +{ + public class HttpClientHandler : HttpMessageHandler + { + HttpMessageHandler platformHandler; + + public HttpClientHandler () + { + // Ensure GetHttpMessageHandler does not recursively call new HttpClientHandler () + platformHandler = ObjCRuntime.RuntimeOptions.GetHttpMessageHandler (); + } + + protected override void Dispose (bool disposing) + { + if (disposing) { + if (platformHandler != null) { + platformHandler.Dispose (); + platformHandler = null; + } + } + base.Dispose (disposing); + } + + public virtual bool SupportsAutomaticDecompression => false; + + public virtual bool SupportsProxy => false; + + public virtual bool SupportsRedirectConfiguration => false; + + public bool UseCookies { + get => throw new PlatformNotSupportedException (); + set => throw new PlatformNotSupportedException (); + } + + public CookieContainer CookieContainer { + get => throw new PlatformNotSupportedException (); + set => throw new PlatformNotSupportedException (); + } + + public ClientCertificateOption ClientCertificateOptions { + get => throw new PlatformNotSupportedException (); + set => throw new PlatformNotSupportedException (); + } + + public X509CertificateCollection ClientCertificates { + get => throw new PlatformNotSupportedException (); + set => throw new PlatformNotSupportedException (); + } + + public Func ServerCertificateCustomValidationCallback { + get => throw new PlatformNotSupportedException (); + set => throw new PlatformNotSupportedException (); + } + + public bool CheckCertificateRevocationList { + get => throw new PlatformNotSupportedException (); + set => throw new PlatformNotSupportedException (); + } + + public SslProtocols SslProtocols { + get => throw new PlatformNotSupportedException (); + set => throw new PlatformNotSupportedException (); + } + + public DecompressionMethods AutomaticDecompression { + get => throw new PlatformNotSupportedException (); + set => throw new PlatformNotSupportedException (); + } + + public bool UseProxy { + get => throw new PlatformNotSupportedException (); + set => throw new PlatformNotSupportedException (); + } + + public IWebProxy Proxy { + get => throw new PlatformNotSupportedException (); + set => throw new PlatformNotSupportedException (); + } + + public ICredentials DefaultProxyCredentials { + get => throw new PlatformNotSupportedException (); + set => throw new PlatformNotSupportedException (); + } + + public bool PreAuthenticate { + get => throw new PlatformNotSupportedException (); + set => throw new PlatformNotSupportedException (); + } + + public bool UseDefaultCredentials { + get => throw new PlatformNotSupportedException (); + set => throw new PlatformNotSupportedException (); + } + + public ICredentials Credentials { + get => throw new PlatformNotSupportedException (); + set => throw new PlatformNotSupportedException (); + } + + public bool AllowAutoRedirect { + get => throw new PlatformNotSupportedException (); + set => throw new PlatformNotSupportedException (); + } + + public int MaxAutomaticRedirections { + get => throw new PlatformNotSupportedException (); + set => throw new PlatformNotSupportedException (); + } + + public int MaxConnectionsPerServer { + get => throw new PlatformNotSupportedException (); + set => throw new PlatformNotSupportedException (); + } + + public int MaxResponseHeadersLength { + get => throw new PlatformNotSupportedException (); + set => throw new PlatformNotSupportedException (); + } + + public long MaxRequestContentBufferSize { + get => throw new PlatformNotSupportedException (); + set => throw new PlatformNotSupportedException (); + } + + public IDictionary Properties => throw new PlatformNotSupportedException (); + + public static Func DangerousAcceptAnyServerCertificateValidator { get; } = delegate { return true; }; + + protected internal override Task SendAsync (HttpRequestMessage request, CancellationToken cancellationToken) + { + if (platformHandler == null) + throw new ObjectDisposedException (GetType().ToString()); + + return platformHandler.SendAsync (request, cancellationToken); + } + } +} \ No newline at end of file diff --git a/mcs/class/System.Net.Http/System.Net.Http/HttpContent.cs b/mcs/class/System.Net.Http/System.Net.Http/HttpContent.cs index df97dc50bb..9f40665000 100644 --- a/mcs/class/System.Net.Http/System.Net.Http/HttpContent.cs +++ b/mcs/class/System.Net.Http/System.Net.Http/HttpContent.cs @@ -212,7 +212,12 @@ namespace System.Net.Http return value.Length; } - protected internal abstract Task SerializeToStreamAsync (Stream stream, TransportContext context); + internal Task SerializeToStreamAsync_internal (Stream stream, TransportContext context) + { + return SerializeToStreamAsync (stream, context); + } + + protected abstract Task SerializeToStreamAsync (Stream stream, TransportContext context); protected internal abstract bool TryComputeLength (out long length); } } diff --git a/mcs/class/System.Net.Http/System.Net.Http/MultipartContent.cs b/mcs/class/System.Net.Http/System.Net.Http/MultipartContent.cs index a607167548..f97f2b523b 100644 --- a/mcs/class/System.Net.Http/System.Net.Http/MultipartContent.cs +++ b/mcs/class/System.Net.Http/System.Net.Http/MultipartContent.cs @@ -122,7 +122,7 @@ namespace System.Net.Http base.Dispose (disposing); } - protected internal override async Task SerializeToStreamAsync (Stream stream, TransportContext context) + protected override async Task SerializeToStreamAsync (Stream stream, TransportContext context) { // RFC 2046 // @@ -156,7 +156,7 @@ namespace System.Net.Http sb.Clear (); await stream.WriteAsync (buffer, 0, buffer.Length).ConfigureAwait (false); - await c.SerializeToStreamAsync (stream, context).ConfigureAwait (false); + await c.SerializeToStreamAsync_internal (stream, context).ConfigureAwait (false); if (i != nested_content.Count - 1) { sb.Append ('\r').Append ('\n'); diff --git a/mcs/class/System.Net.Http/System.Net.Http/StreamContent.cs b/mcs/class/System.Net.Http/System.Net.Http/StreamContent.cs index b8c27858a2..151a8c3750 100644 --- a/mcs/class/System.Net.Http/System.Net.Http/StreamContent.cs +++ b/mcs/class/System.Net.Http/System.Net.Http/StreamContent.cs @@ -87,7 +87,7 @@ namespace System.Net.Http base.Dispose (disposing); } - protected internal override Task SerializeToStreamAsync (Stream stream, TransportContext context) + protected override Task SerializeToStreamAsync (Stream stream, TransportContext context) { if (contentCopied) { if (!content.CanSeek) { diff --git a/mcs/class/System.Net.Http/Test/System.Net.Http.Headers/HttpHeaderValueCollection.cs b/mcs/class/System.Net.Http/Test/System.Net.Http.Headers/HttpHeaderValueCollection.cs index 2afccf21c1..915b076065 100644 --- a/mcs/class/System.Net.Http/Test/System.Net.Http.Headers/HttpHeaderValueCollection.cs +++ b/mcs/class/System.Net.Http/Test/System.Net.Http.Headers/HttpHeaderValueCollection.cs @@ -120,10 +120,14 @@ namespace MonoTests.System.Net.Http.Headers headers.TryAddWithoutValidation("User-Agent", "agent2/2.0"); Assert.AreEqual (1, headers.UserAgent.Count, "#1"); +#if !MONOTOUCH_WATCH if (HttpClientTestHelpers.UsingSocketsHandler) +#endif Assert.AreEqual ("agent2/2.0 user,agent/1.0", headers.UserAgent.ToString (), "#2"); +#if !MONOTOUCH_WATCH else Assert.AreEqual ("agent2/2.0user,agent/1.0", headers.UserAgent.ToString (), "#2"); +#endif Assert.AreEqual ("User-Agent: agent2/2.0 user,agent/1.0\r\n", headers.ToString (), "#3"); diff --git a/mcs/class/System.Net.Http/Test/System.Net.Http.Headers/HttpHeadersTest.cs b/mcs/class/System.Net.Http/Test/System.Net.Http.Headers/HttpHeadersTest.cs index bfabf4ee6a..93ef2c81bd 100644 --- a/mcs/class/System.Net.Http/Test/System.Net.Http.Headers/HttpHeadersTest.cs +++ b/mcs/class/System.Net.Http/Test/System.Net.Http.Headers/HttpHeadersTest.cs @@ -61,8 +61,10 @@ namespace MonoTests.System.Net.Http.Headers if (HttpClientTestHelpers.UsingSocketsHandler) Assert.Fail ("#1"); } catch (FormatException) { +#if !MONOTOUCH_WATCH if (!HttpClientTestHelpers.UsingSocketsHandler) throw; +#endif } } diff --git a/mcs/class/System.Net.Http/Test/System.Net.Http/HttpClientTest.cs b/mcs/class/System.Net.Http/Test/System.Net.Http/HttpClientTest.cs index 402be6aa87..72c7d4550e 100644 --- a/mcs/class/System.Net.Http/Test/System.Net.Http/HttpClientTest.cs +++ b/mcs/class/System.Net.Http/Test/System.Net.Http/HttpClientTest.cs @@ -189,7 +189,9 @@ namespace MonoTests.System.Net.Http [Test] #if FEATURE_NO_BSD_SOCKETS +#if !MONOTOUCH_WATCH [ExpectedException (typeof (PlatformNotSupportedException))] +#endif #endif public void Ctor_HttpClientHandler () { @@ -1109,7 +1111,9 @@ namespace MonoTests.System.Net.Http [Test] #if FEATURE_NO_BSD_SOCKETS +#if !MONOTOUCH_WATCH [ExpectedException (typeof (PlatformNotSupportedException))] +#endif #endif public void Send_Invalid () { diff --git a/mcs/class/System.Net.Http/Test/System.Net.Http/HttpRequestMessageTest.cs b/mcs/class/System.Net.Http/Test/System.Net.Http/HttpRequestMessageTest.cs index 735fe2919d..3daf5b02bd 100644 --- a/mcs/class/System.Net.Http/Test/System.Net.Http/HttpRequestMessageTest.cs +++ b/mcs/class/System.Net.Http/Test/System.Net.Http/HttpRequestMessageTest.cs @@ -61,13 +61,17 @@ namespace MonoTests.System.Net.Http Assert.AreEqual (HttpMethod.Get, m.Method, "#3"); Assert.IsNotNull (m.Properties, "#4"); Assert.IsNull (m.RequestUri, "#5"); +#if !MONOTOUCH_WATCH if (HttpClientTestHelpers.UsingSocketsHandler) { +#endif Assert.AreEqual (new Version (2, 0), m.Version, "#6"); Assert.AreEqual ("Method: GET, RequestUri: '', Version: 2.0, Content: , Headers:\r\n{\r\n}", m.ToString (), "#7"); +#if !MONOTOUCH_WATCH } else { Assert.AreEqual (new Version (1, 1), m.Version, "#6"); Assert.AreEqual ("Method: GET, RequestUri: '', Version: 1.1, Content: , Headers:\r\n{\r\n}", m.ToString (), "#7"); } +#endif } [Test] @@ -670,10 +674,14 @@ namespace MonoTests.System.Net.Http // .NET encloses the "Age: vv" with two whitespaces. var normalized = Regex.Replace (message.ToString (), @"\s", ""); +#if !MONOTOUCH_WATCH if (HttpClientTestHelpers.UsingSocketsHandler) +#endif Assert.AreEqual ("Method:GET,RequestUri:'',Version:2.0,Content:,Headers:{Age:vv}", normalized, "#3"); +#if !MONOTOUCH_WATCH else Assert.AreEqual ("Method:GET,RequestUri:'',Version:1.1,Content:,Headers:{Age:vv}", normalized, "#3"); +#endif } [Test] diff --git a/mcs/class/System.Net.Http/Test/System.Net.Http/HttpResponseMessageTest.cs b/mcs/class/System.Net.Http/Test/System.Net.Http/HttpResponseMessageTest.cs index 0ed45c14c6..9e51515241 100644 --- a/mcs/class/System.Net.Http/Test/System.Net.Http/HttpResponseMessageTest.cs +++ b/mcs/class/System.Net.Http/Test/System.Net.Http/HttpResponseMessageTest.cs @@ -275,10 +275,14 @@ namespace MonoTests.System.Net.Http Assert.AreEqual ("v1", values[0]); break; case 1: +#if !MONOTOUCH_WATCH if (HttpClientTestHelpers.UsingSocketsHandler) +#endif Assert.AreEqual ("Cache-Control", entry.Key); +#if !MONOTOUCH_WATCH else Assert.AreEqual ("cache-control", entry.Key); +#endif values = entry.Value.ToList (); Assert.AreEqual (1, values.Count); Assert.AreEqual ("audio", values[0]); diff --git a/mcs/class/System.Net.Http/corefx/ReadOnlyMemoryContent.cs b/mcs/class/System.Net.Http/corefx/ReadOnlyMemoryContent.cs index f4272bfb55..d20989108b 100644 --- a/mcs/class/System.Net.Http/corefx/ReadOnlyMemoryContent.cs +++ b/mcs/class/System.Net.Http/corefx/ReadOnlyMemoryContent.cs @@ -7,7 +7,7 @@ namespace System.Net.Http public sealed partial class ReadOnlyMemoryContent : System.Net.Http.HttpContent { public ReadOnlyMemoryContent(System.ReadOnlyMemory content) => throw new PlatformNotSupportedException(); - protected internal override System.Threading.Tasks.Task SerializeToStreamAsync(System.IO.Stream stream, System.Net.TransportContext context) => throw new PlatformNotSupportedException(); + protected override System.Threading.Tasks.Task SerializeToStreamAsync(System.IO.Stream stream, System.Net.TransportContext context) => throw new PlatformNotSupportedException(); protected internal override bool TryComputeLength(out long length) => throw new PlatformNotSupportedException(); } } \ No newline at end of file diff --git a/mcs/class/System.Net.Http/monotouch_System.Net.Http.dll.exclude.sources b/mcs/class/System.Net.Http/monotouch_System.Net.Http.dll.exclude.sources new file mode 100644 index 0000000000..c1788b13bf --- /dev/null +++ b/mcs/class/System.Net.Http/monotouch_System.Net.Http.dll.exclude.sources @@ -0,0 +1 @@ +HttpClient.DefaultHandler.cs diff --git a/mcs/class/System.Net.Http/monotouch_System.Net.Http.dll.sources b/mcs/class/System.Net.Http/monotouch_System.Net.Http.dll.sources index f4de7b4ea3..6e2a208bb3 100644 --- a/mcs/class/System.Net.Http/monotouch_System.Net.Http.dll.sources +++ b/mcs/class/System.Net.Http/monotouch_System.Net.Http.dll.sources @@ -1,2 +1,2 @@ -#include legacy.sources +#include socketshandler.sources System.Net.Http/HttpClient.macios.cs diff --git a/mcs/class/System.Net.Http/monotouch_tv_System.Net.Http.dll.exclude.sources b/mcs/class/System.Net.Http/monotouch_tv_System.Net.Http.dll.exclude.sources new file mode 100644 index 0000000000..b5624e526e --- /dev/null +++ b/mcs/class/System.Net.Http/monotouch_tv_System.Net.Http.dll.exclude.sources @@ -0,0 +1 @@ +#include monotouch_System.Net.Http.dll.exclude.sources diff --git a/mcs/class/System.Net.Http/monotouch_tv_System.Net.Http.dll.sources b/mcs/class/System.Net.Http/monotouch_tv_System.Net.Http.dll.sources index f4de7b4ea3..6a31559fca 100644 --- a/mcs/class/System.Net.Http/monotouch_tv_System.Net.Http.dll.sources +++ b/mcs/class/System.Net.Http/monotouch_tv_System.Net.Http.dll.sources @@ -1,2 +1 @@ -#include legacy.sources -System.Net.Http/HttpClient.macios.cs +#include monotouch_System.Net.Http.dll.sources diff --git a/mcs/class/System.Net.Http/monotouch_watch_System.Net.Http.dll.exclude.sources b/mcs/class/System.Net.Http/monotouch_watch_System.Net.Http.dll.exclude.sources deleted file mode 100644 index 5fb1f1caa7..0000000000 --- a/mcs/class/System.Net.Http/monotouch_watch_System.Net.Http.dll.exclude.sources +++ /dev/null @@ -1,7 +0,0 @@ -HttpClientHandler.cs -HttpClientHandler.Legacy.cs -IMonoHttpClientHandler.cs -MonoWebRequestHandler.cs - -../../../external/corefx/src/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/CancellationHelper.cs -../../../external/corefx/src/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/ConnectHelper.cs diff --git a/mcs/class/System.Net.Http/monotouch_watch_System.Net.Http.dll.sources b/mcs/class/System.Net.Http/monotouch_watch_System.Net.Http.dll.sources index 8f6e9ebbc1..6685621bd0 100644 --- a/mcs/class/System.Net.Http/monotouch_watch_System.Net.Http.dll.sources +++ b/mcs/class/System.Net.Http/monotouch_watch_System.Net.Http.dll.sources @@ -1,3 +1,34 @@ -#include legacy.sources -System.Net.Http/HttpClientHandler.platformnotsupported.cs +Assembly/AssemblyInfo.cs + +corefx/NetEventSource.Http.cs + +System.Net.Http/HttpClientHandler.xi.cs System.Net.Http/HttpClient.macios.cs +HttpRequestMessage.Mono.cs + +../../../external/corefx/src/System.Net.Http/src/System/Net/Http/Headers/*.cs + +../../../external/corefx/src/System.Net.Http/src/System/Net/Http/ByteArrayContent.cs +../../../external/corefx/src/System.Net.Http/src/System/Net/Http/ByteArrayHelpers.cs +../../../external/corefx/src/System.Net.Http/src/System/Net/Http/ClientCertificateOption.cs +../../../external/corefx/src/System.Net.Http/src/System/Net/Http/DelegatingHandler.cs +../../../external/corefx/src/System.Net.Http/src/System/Net/Http/FormUrlEncodedContent.cs +../../../external/corefx/src/System.Net.Http/src/System/Net/Http/HttpClient.cs +../../../external/corefx/src/System.Net.Http/src/System/Net/Http/HttpCompletionOption.cs +../../../external/corefx/src/System.Net.Http/src/System/Net/Http/HttpContent.cs +../../../external/corefx/src/System.Net.Http/src/System/Net/Http/HttpMessageHandler.cs +../../../external/corefx/src/System.Net.Http/src/System/Net/Http/HttpMessageInvoker.cs +../../../external/corefx/src/System.Net.Http/src/System/Net/Http/HttpMethod.cs +../../../external/corefx/src/System.Net.Http/src/System/Net/Http/HttpParseResult.cs +../../../external/corefx/src/System.Net.Http/src/System/Net/Http/HttpRequestException.cs +../../../external/corefx/src/System.Net.Http/src/System/Net/Http/HttpRequestMessage.cs +../../../external/corefx/src/System.Net.Http/src/System/Net/Http/HttpResponseMessage.cs +../../../external/corefx/src/System.Net.Http/src/System/Net/Http/HttpRuleParser.cs +../../../external/corefx/src/System.Net.Http/src/System/Net/Http/HttpUtilities.cs +../../../external/corefx/src/System.Net.Http/src/System/Net/Http/MessageProcessingHandler.cs +../../../external/corefx/src/System.Net.Http/src/System/Net/Http/MultipartContent.cs +../../../external/corefx/src/System.Net.Http/src/System/Net/Http/MultipartFormDataContent.cs +../../../external/corefx/src/System.Net.Http/src/System/Net/Http/ReadOnlyMemoryContent.cs +../../../external/corefx/src/System.Net.Http/src/System/Net/Http/StreamContent.cs +../../../external/corefx/src/System.Net.Http/src/System/Net/Http/StreamToStreamCopy.cs +../../../external/corefx/src/System.Net.Http/src/System/Net/Http/StringContent.cs diff --git a/mcs/class/System.Net.Http/socketshandler.sources b/mcs/class/System.Net.Http/socketshandler.sources index e8622eafe6..6b7824fe91 100644 --- a/mcs/class/System.Net.Http/socketshandler.sources +++ b/mcs/class/System.Net.Http/socketshandler.sources @@ -8,8 +8,6 @@ HttpRequestMessage.Mono.cs IMonoHttpClientHandler.cs MonoWebRequestHandler.cs -../corlib/System.Diagnostics/Debug.cs - corefx/SocketsHttpHandler.Mono.cs corefx/NetEventSource.Http.cs diff --git a/mcs/class/System.Net.Http/xammac_System.Net.Http.dll.exclude.sources b/mcs/class/System.Net.Http/xammac_System.Net.Http.dll.exclude.sources new file mode 100644 index 0000000000..b5624e526e --- /dev/null +++ b/mcs/class/System.Net.Http/xammac_System.Net.Http.dll.exclude.sources @@ -0,0 +1 @@ +#include monotouch_System.Net.Http.dll.exclude.sources diff --git a/mcs/class/System.Net.Http/xammac_System.Net.Http.dll.sources b/mcs/class/System.Net.Http/xammac_System.Net.Http.dll.sources index f4de7b4ea3..6e2a208bb3 100644 --- a/mcs/class/System.Net.Http/xammac_System.Net.Http.dll.sources +++ b/mcs/class/System.Net.Http/xammac_System.Net.Http.dll.sources @@ -1,2 +1,2 @@ -#include legacy.sources +#include socketshandler.sources System.Net.Http/HttpClient.macios.cs diff --git a/mcs/class/System.Net.Http/xammac_net_4_5_System.Net.Http.dll.exclude.sources b/mcs/class/System.Net.Http/xammac_net_4_5_System.Net.Http.dll.exclude.sources new file mode 100644 index 0000000000..b5624e526e --- /dev/null +++ b/mcs/class/System.Net.Http/xammac_net_4_5_System.Net.Http.dll.exclude.sources @@ -0,0 +1 @@ +#include monotouch_System.Net.Http.dll.exclude.sources diff --git a/mcs/class/System.Net.Http/xammac_net_4_5_System.Net.Http.dll.sources b/mcs/class/System.Net.Http/xammac_net_4_5_System.Net.Http.dll.sources index f4de7b4ea3..6e2a208bb3 100644 --- a/mcs/class/System.Net.Http/xammac_net_4_5_System.Net.Http.dll.sources +++ b/mcs/class/System.Net.Http/xammac_net_4_5_System.Net.Http.dll.sources @@ -1,2 +1,2 @@ -#include legacy.sources +#include socketshandler.sources System.Net.Http/HttpClient.macios.cs diff --git a/mcs/class/System.Runtime.Remoting/Test/ActivationTests.cs b/mcs/class/System.Runtime.Remoting/Test/ActivationTests.cs index 5ea68f21d5..f05d556b74 100644 --- a/mcs/class/System.Runtime.Remoting/Test/ActivationTests.cs +++ b/mcs/class/System.Runtime.Remoting/Test/ActivationTests.cs @@ -30,7 +30,10 @@ namespace MonoTests.Remoting { try { - tcp = new TcpChannel (0); + Hashtable tcpOptions = new Hashtable (); + tcpOptions ["port"] = 0; + tcpOptions ["bindTo"] = "127.0.0.1"; + tcp = new TcpChannel (tcpOptions, null, null); Hashtable options = new Hashtable (); options ["timeout"] = 10000; // 10s @@ -42,8 +45,8 @@ namespace MonoTests.Remoting AppDomain domain = BaseCallTest.CreateDomain ("testdomain_activation"); server = (ActivationServer) domain.CreateInstanceAndUnwrap(GetType().Assembly.FullName,"MonoTests.Remoting.ActivationServer"); - var tcpUrlPrefix = $"tcp://localhost:{server.TcpPort}"; - var httpUrlPrefix = $"http://localhost:{server.HttpPort}"; + var tcpUrlPrefix = $"tcp://127.0.0.1:{server.TcpPort}"; + var httpUrlPrefix = $"http://127.0.0.1:{server.HttpPort}"; RemotingConfiguration.RegisterActivatedClientType (typeof(CaObject1), tcpUrlPrefix); RemotingConfiguration.RegisterActivatedClientType (typeof(CaObject2), httpUrlPrefix); RemotingConfiguration.RegisterWellKnownClientType (typeof(WkObjectSinglecall1), tcpUrlPrefix + "/wkoSingleCall1"); @@ -169,8 +172,14 @@ namespace MonoTests.Remoting { TcpPort = NetworkHelpers.FindFreePort (); HttpPort = NetworkHelpers.FindFreePort (); - tcp = new TcpChannel (TcpPort); - http = new HttpChannel (HttpPort); + IDictionary tcpProps = new Hashtable (); + IDictionary httpProps = new Hashtable (); + tcpProps ["port"] = TcpPort; + tcpProps ["bindTo"] = "127.0.0.1"; + httpProps ["port"] = HttpPort; + httpProps ["bindTo"] = "127.0.0.1"; + tcp = new TcpChannel (tcpProps, null, null); + http = new HttpChannel (httpProps, null, null); ChannelServices.RegisterChannel (tcp); ChannelServices.RegisterChannel (http); diff --git a/mcs/class/System.Runtime.Remoting/Test/GenericTest.cs b/mcs/class/System.Runtime.Remoting/Test/GenericTest.cs index a8a9a7bfea..79edd73662 100644 --- a/mcs/class/System.Runtime.Remoting/Test/GenericTest.cs +++ b/mcs/class/System.Runtime.Remoting/Test/GenericTest.cs @@ -172,6 +172,7 @@ namespace MonoTests.Remoting IDictionary props = new Hashtable (); props ["name"] = Guid.NewGuid ().ToString("N"); props ["port"] = port; + props ["bindTo"] = "127.0.0.1"; TcpChannel chan = new TcpChannel (props, null, null); ChannelServices.RegisterChannel (chan); diff --git a/mcs/class/System.Runtime.Remoting/Test/HttpBugTests.cs b/mcs/class/System.Runtime.Remoting/Test/HttpBugTests.cs index 553c58a580..b80d79fd12 100644 --- a/mcs/class/System.Runtime.Remoting/Test/HttpBugTests.cs +++ b/mcs/class/System.Runtime.Remoting/Test/HttpBugTests.cs @@ -20,11 +20,15 @@ namespace MonoTests.Remoting.Http [Ignore ("This test somehow keeps http channel registered and then blocks any further http tests working. This also happens under .NET, so this test itself is wrong with nunit 2.4.8.")] public void Test () { - new HttpChannel (8086); + var port = NetworkHelpers.FindFreePort (); + Hashtable props = new Hashtable (); + props["port"] = port; + props["bindTo"] = "127.0.0.1"; + new HttpChannel (props, null, null); RemotingServices.Marshal (new Service (), "test"); Service remObj = (Service) RemotingServices.Connect ( - typeof (Service), "http://localhost:8086/test"); + typeof (Service), $"http://127.0.0.1:{port}/test"); ArrayList list; remObj.Test (out list); @@ -70,13 +74,16 @@ namespace MonoTests.Remoting.Http public void Main () { var port = NetworkHelpers.FindFreePort (); - channel = new HttpChannel (port); + Hashtable props = new Hashtable (); + props["port"] = port; + props["bindTo"] = "127.0.0.1"; + channel = new HttpChannel (props, null, null); ChannelServices.RegisterChannel (channel); RemotingConfiguration.RegisterWellKnownServiceType (typeof (Bug321420),"Server.soap", WellKnownObjectMode.Singleton); Bug321420 s = (Bug321420) Activator.GetObject (typeof - (Bug321420), $"http://localhost:{port}/Server.soap"); + (Bug321420), $"http://127.0.0.1:{port}/Server.soap"); // this works: s.Method ("a", "b"); s.Method ("a", "a"); @@ -101,7 +108,7 @@ namespace MonoTests.Remoting.Http public void Main () { Foo foo = (Foo) Activator.GetObject (typeof (Foo), - $"http://localhost:{server.HttpPort}/Test"); + $"http://127.0.0.1:{server.HttpPort}/Test"); Bar bar = foo.Login (); if (bar != null) @@ -146,7 +153,10 @@ namespace MonoTests.Remoting.Http public void Start () { HttpPort = NetworkHelpers.FindFreePort (); - c = new HttpChannel (HttpPort); + Hashtable props = new Hashtable (); + props["port"] = HttpPort; + props["bindTo"] = "127.0.0.1"; + c = new HttpChannel (props, null, null); ChannelServices.RegisterChannel (c); Type t = typeof(Foo); @@ -174,11 +184,14 @@ namespace MonoTests.Remoting.Http [Test] public void Main () { - channel = new HttpChannel (0); + Hashtable props = new Hashtable (); + props["port"] = 0; + props["bindTo"] = "127.0.0.1"; + channel = new HttpChannel (props, null, null); ChannelServices.RegisterChannel (channel); MarshalByRefObject obj = (MarshalByRefObject) RemotingServices.Connect ( typeof (IFactorial), - $"http://localhost:{server.HttpPort}/MyEndPoint"); + $"http://127.0.0.1:{server.HttpPort}/MyEndPoint"); IFactorial cal = (IFactorial) obj; Assert.AreEqual (cal.CalculateFactorial (4), 24); } @@ -216,7 +229,10 @@ namespace MonoTests.Remoting.Http public void Start () { HttpPort = NetworkHelpers.FindFreePort (); - c = new HttpChannel (HttpPort); + Hashtable props = new Hashtable (); + props["port"] = HttpPort; + props["bindTo"] = "127.0.0.1"; + c = new HttpChannel (props, null, null); ChannelServices.RegisterChannel (c); Type t = typeof(Calculator); diff --git a/mcs/class/System.Runtime.Remoting/Test/RemotingServicesTest.cs b/mcs/class/System.Runtime.Remoting/Test/RemotingServicesTest.cs index b7bad06cf9..d5e1e44a50 100644 --- a/mcs/class/System.Runtime.Remoting/Test/RemotingServicesTest.cs +++ b/mcs/class/System.Runtime.Remoting/Test/RemotingServicesTest.cs @@ -294,6 +294,7 @@ namespace MonoTests.Remoting IDictionary props = new Hashtable (); props ["name"] = objMarshal.Uri; props ["port"] = port; + props ["bindTo"] = "127.0.0.1"; TcpChannel chn = new TcpChannel (props, null, null); ChannelServices.RegisterChannel (chn); @@ -317,6 +318,7 @@ namespace MonoTests.Remoting IDictionary props = new Hashtable (); props ["name"] = objMarshal.Uri; props ["port"] = port; + props ["bindTo"] = "127.0.0.1"; TcpChannel chn = new TcpChannel (props, null, null); ChannelServices.RegisterChannel (chn); @@ -346,7 +348,10 @@ namespace MonoTests.Remoting public void ExecuteMessage () { var port = NetworkHelpers.FindFreePort (); - TcpChannel chn = new TcpChannel (port); + IDictionary props = new Hashtable (); + props ["port"] = port; + props ["bindTo"] = "127.0.0.1"; + TcpChannel chn = new TcpChannel (props, null, null); ChannelServices.RegisterChannel (chn); try { MarshalObject objMarshal = NewMarshalObject (); @@ -379,7 +384,10 @@ namespace MonoTests.Remoting public void IsOneWay () { var port = NetworkHelpers.FindFreePort (); - TcpChannel chn = new TcpChannel (port); + IDictionary props = new Hashtable (); + props ["port"] = port; + props ["bindTo"] = "127.0.0.1"; + TcpChannel chn = new TcpChannel (props, null, null); ChannelServices.RegisterChannel (chn); try { RemotingConfiguration.RegisterWellKnownServiceType (typeof (MarshalObject), "MarshalObject.rem", WellKnownObjectMode.Singleton); @@ -403,7 +411,10 @@ namespace MonoTests.Remoting public void GetObjRefForProxy () { var port = NetworkHelpers.FindFreePort (); - TcpChannel chn = new TcpChannel (port); + IDictionary props = new Hashtable (); + props ["port"] = port; + props ["bindTo"] = "127.0.0.1"; + TcpChannel chn = new TcpChannel (props, null, null); ChannelServices.RegisterChannel (chn); try { // Register le factory as a SAO @@ -427,7 +438,10 @@ namespace MonoTests.Remoting public void GetRealProxy () { var port = NetworkHelpers.FindFreePort (); - TcpChannel chn = new TcpChannel (port); + IDictionary props = new Hashtable (); + props ["port"] = port; + props ["bindTo"] = "127.0.0.1"; + TcpChannel chn = new TcpChannel (props, null, null); ChannelServices.RegisterChannel (chn); try { RemotingConfiguration.RegisterWellKnownServiceType (typeof (MarshalObject), "MonoTests.System.Runtime.Remoting.RemotingServicesTest.MarshalObject.soap", WellKnownObjectMode.Singleton); @@ -449,7 +463,10 @@ namespace MonoTests.Remoting public void SetObjectUriForMarshal () { var port = NetworkHelpers.FindFreePort (); - TcpChannel chn = new TcpChannel (port); + IDictionary props = new Hashtable (); + props ["port"] = port; + props ["bindTo"] = "127.0.0.1"; + TcpChannel chn = new TcpChannel (props, null, null); ChannelServices.RegisterChannel (chn); try { MarshalObject objRem = NewMarshalObject (); @@ -469,7 +486,10 @@ namespace MonoTests.Remoting public void GetServeurTypeForUri () { var port = NetworkHelpers.FindFreePort (); - TcpChannel chn = new TcpChannel (port); + IDictionary props = new Hashtable (); + props ["port"] = port; + props ["bindTo"] = "127.0.0.1"; + TcpChannel chn = new TcpChannel (props, null, null); Type type = typeof (MarshalObject); ChannelServices.RegisterChannel (chn); try { @@ -491,7 +511,10 @@ namespace MonoTests.Remoting public void IsObjectOutOf () { var port = NetworkHelpers.FindFreePort (); - TcpChannel chn = new TcpChannel (port); + IDictionary props = new Hashtable (); + props ["port"] = port; + props ["bindTo"] = "127.0.0.1"; + TcpChannel chn = new TcpChannel (props, null, null); ChannelServices.RegisterChannel (chn); try { RemotingConfiguration.RegisterWellKnownServiceType (typeof (MarshalObject), "MarshalObject2.rem", WellKnownObjectMode.Singleton); @@ -514,7 +537,10 @@ namespace MonoTests.Remoting { var port = NetworkHelpers.FindFreePort (); RemotingConfiguration.ApplicationName = "app"; - TcpChannel chn = new TcpChannel (port); + IDictionary props = new Hashtable (); + props ["port"] = port; + props ["bindTo"] = "127.0.0.1"; + TcpChannel chn = new TcpChannel (props, null, null); ChannelServices.RegisterChannel (chn); try { RemotingConfiguration.RegisterWellKnownServiceType (typeof (MarshalObject), "obj3.rem", WellKnownObjectMode.Singleton); @@ -541,7 +567,10 @@ namespace MonoTests.Remoting public void GetObjectWithChannelDataTest () { var port = NetworkHelpers.FindFreePort (); - TcpChannel chn = new TcpChannel (port); + IDictionary props = new Hashtable (); + props ["port"] = port; + props ["bindTo"] = "127.0.0.1"; + TcpChannel chn = new TcpChannel (props, null, null); ChannelServices.RegisterChannel (chn); try { RemotingConfiguration.RegisterWellKnownServiceType (typeof (MarshalObject), "getobjectwithchanneldata.rem", WellKnownObjectMode.Singleton); diff --git a/mcs/class/System.Runtime.Remoting/Test/TcpCalls.cs b/mcs/class/System.Runtime.Remoting/Test/TcpCalls.cs index 1e28d511f8..293ca6338f 100644 --- a/mcs/class/System.Runtime.Remoting/Test/TcpCalls.cs +++ b/mcs/class/System.Runtime.Remoting/Test/TcpCalls.cs @@ -7,6 +7,7 @@ // using System; +using System.Collections; using System.Runtime.Remoting; using System.Runtime.Remoting.Channels; using System.Runtime.Remoting.Channels.Tcp; @@ -55,12 +56,18 @@ namespace MonoTests.Remoting { public override IChannelSender CreateClientChannel () { - return new TcpChannel (0); + Hashtable props = new Hashtable (); + props["port"] = 0; + props["bindTo"] = "127.0.0.1"; + return new TcpChannel (props, null, null); } public override IChannelReceiver CreateServerChannel () { - return new TcpChannel (0); + Hashtable props = new Hashtable (); + props["port"] = 0; + props["bindTo"] = "127.0.0.1"; + return new TcpChannel (props, null, null); } } } diff --git a/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization.dll.sources b/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization.dll.sources index 9ba03a46a2..fc2e9b0c9e 100644 --- a/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization.dll.sources +++ b/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization.dll.sources @@ -20,3 +20,5 @@ ReferenceSources/DataContractSerializerExtensions.cs ReferenceSources/NotImplemented.cs ../../../external/corefx/src/System.Runtime.Serialization.Primitives/src/System/Runtime/Serialization/ISerializationSurrogateProvider.cs + +../corlib/System.Runtime.CompilerServices/PreserveDependencyAttribute.cs \ No newline at end of file diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/InternalWindowManager.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/InternalWindowManager.cs index 62a5c9286a..d5e6d9bc8e 100644 --- a/mcs/class/System.Windows.Forms/System.Windows.Forms/InternalWindowManager.cs +++ b/mcs/class/System.Windows.Forms/System.Windows.Forms/InternalWindowManager.cs @@ -433,6 +433,8 @@ namespace System.Windows.Forms { get { if (!Form.ShowIcon) return false; + if (!Form.ControlBox) + return false; if (!HasBorders) return false; if (IsMinimized) diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/ThemeWin32Classic.cs.REMOVED.git-id b/mcs/class/System.Windows.Forms/System.Windows.Forms/ThemeWin32Classic.cs.REMOVED.git-id index 497463f828..7112767095 100644 --- a/mcs/class/System.Windows.Forms/System.Windows.Forms/ThemeWin32Classic.cs.REMOVED.git-id +++ b/mcs/class/System.Windows.Forms/System.Windows.Forms/ThemeWin32Classic.cs.REMOVED.git-id @@ -1 +1 @@ -f2415f506a659f57d72508738c65626711d53d22 \ No newline at end of file +bd6eda781217ed9b0c7a9982db462506e4a69c0d \ No newline at end of file diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/TreeNodeCollection.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/TreeNodeCollection.cs index bd5557091e..020eaac5d0 100644 --- a/mcs/class/System.Windows.Forms/System.Windows.Forms/TreeNodeCollection.cs +++ b/mcs/class/System.Windows.Forms/System.Windows.Forms/TreeNodeCollection.cs @@ -90,8 +90,12 @@ namespace System.Windows.Forms { set { if (index < 0 || index >= Count) throw new ArgumentOutOfRangeException ("index"); - SetupNode (value); + + var removedNode = nodes [index]; nodes [index] = value; + + OnUIACollectionChanged (CollectionChangeAction.Remove, removedNode); + SetupNode (value); } } @@ -107,7 +111,7 @@ namespace System.Windows.Forms { bool UsingSorting { get { - TreeView tv = owner == null ? null : owner.TreeView; + TreeView tv = TreeView; return tv != null && (tv.Sorted || tv.TreeViewNodeSorter != null); } } @@ -125,11 +129,7 @@ namespace System.Windows.Forms { throw new ArgumentNullException("node"); int index; - TreeView tree_view = null; - - if (owner != null) - tree_view = owner.TreeView; - + TreeView tree_view = TreeView; if (tree_view != null && UsingSorting) { index = AddSorted (node); } else { @@ -142,9 +142,6 @@ namespace System.Windows.Forms { SetupNode (node); - // UIA Framework Event: Collection Changed - if (tree_view != null) - tree_view.OnUIACollectionChanged (owner, new CollectionChangeEventArgs (CollectionChangeAction.Add, node)); return index; } @@ -206,14 +203,11 @@ namespace System.Windows.Forms { Array.Clear (nodes, 0, count); count = 0; - TreeView tree_view = null; - if (owner != null) { - tree_view = owner.TreeView; - if (tree_view != null) { - tree_view.UpdateBelow (owner); - tree_view.RecalculateVisibleOrder (owner); - tree_view.UpdateScrollBars (false); - } + TreeView tree_view = TreeView; + if (tree_view != null) { + tree_view.UpdateBelow (owner); + tree_view.RecalculateVisibleOrder (owner); + tree_view.UpdateScrollBars (false); } } @@ -273,7 +267,7 @@ namespace System.Windows.Forms { // If we can use sorting, it means we have an owner *and* a TreeView if (UsingSorting) - Sort (owner.TreeView.TreeViewNodeSorter); + Sort (TreeView.TreeViewNodeSorter); SetupNode (node); } @@ -345,10 +339,7 @@ namespace System.Windows.Forms { bool re_set_selected = false; bool visible = removed.IsVisible; - TreeView tree_view = null; - if (owner != null) - tree_view = owner.TreeView; - + TreeView tree_view = TreeView; if (tree_view != null) { tree_view.RecalculateVisibleOrder (prev); @@ -388,9 +379,7 @@ namespace System.Windows.Forms { tree_view.UpdateBelow (parent); } - // UIA Framework Event: Collection Changed - if (tree_view != null) - tree_view.OnUIACollectionChanged (owner, new CollectionChangeEventArgs (CollectionChangeAction.Remove, removed)); + OnUIACollectionChanged (CollectionChangeAction.Remove, removed); } public virtual void RemoveByKey (string key) @@ -418,10 +407,7 @@ namespace System.Windows.Forms { node.parent = owner; - TreeView tree_view = null; - if (owner != null) - tree_view = owner.TreeView; - + TreeView tree_view = TreeView; if (tree_view != null) { // We may need to invalidate this entire node collection if sorted. TreeNode prev = UsingSorting ? owner : GetPrevNode (node); @@ -433,6 +419,8 @@ namespace System.Windows.Forms { tree_view.UpdateBelow (owner); } + + OnUIACollectionChanged (CollectionChangeAction.Add, node); } int IList.Add (object node) @@ -465,7 +453,7 @@ namespace System.Windows.Forms { if (count >= nodes.Length) Grow (); - TreeView tree_view = owner.TreeView; + TreeView tree_view = TreeView; if (tree_view.TreeViewNodeSorter != null) { // Custom sorting nodes [count++] = node; Sort (tree_view.TreeViewNodeSorter); @@ -507,7 +495,7 @@ namespace System.Windows.Forms { } // Sorted may have been set to false even if TreeViewNodeSorter is being used. - TreeView tv = owner == null ? null : owner.TreeView; + TreeView tv = TreeView; if (tv != null) tv.sorted = true; } @@ -556,6 +544,17 @@ namespace System.Windows.Forms { } } + // UIA Framework Event: Collection Changed + private void OnUIACollectionChanged (CollectionChangeAction action, TreeNode node) + { + TreeView?.OnUIACollectionChanged (owner, new CollectionChangeEventArgs (action, node)); + } + + private TreeView TreeView + { + get { return owner?.TreeView; } + } + internal class TreeNodeEnumerator : IEnumerator { private TreeNodeCollection collection; diff --git a/mcs/class/System.Xaml/System.Xaml/XamlXmlReader.cs b/mcs/class/System.Xaml/System.Xaml/XamlXmlReader.cs index bf855511f6..f025676ecb 100644 --- a/mcs/class/System.Xaml/System.Xaml/XamlXmlReader.cs +++ b/mcs/class/System.Xaml/System.Xaml/XamlXmlReader.cs @@ -317,18 +317,23 @@ namespace System.Xaml // FIXME: is this rule correct? var v = pair.Value; if (!String.IsNullOrEmpty (v) && v [0] == '{') { - var pai = ParsedMarkupExtensionInfo.Parse (v, xaml_namespace_resolver, sctx); - yield return Node (XamlNodeType.StartObject, pai.Type); - foreach (var xepair in pai.Arguments) { - yield return Node (XamlNodeType.StartMember, xepair.Key); - if (xepair.Value is List) - foreach (var s in (List) xepair.Value) - yield return Node (XamlNodeType.Value, s); - else - yield return Node (XamlNodeType.Value, xepair.Value); - yield return Node (XamlNodeType.EndMember, xepair.Key); + if (v.Length > 1 && v [1] == '}') { + //Escaped value + yield return Node (XamlNodeType.Value, v.Substring (2)); + } else { + var pai = ParsedMarkupExtensionInfo.Parse (v, xaml_namespace_resolver, sctx); + yield return Node (XamlNodeType.StartObject, pai.Type); + foreach (var xepair in pai.Arguments) { + yield return Node (XamlNodeType.StartMember, xepair.Key); + if (xepair.Value is List) + foreach (var s in (List) xepair.Value) + yield return Node (XamlNodeType.Value, s); + else + yield return Node (XamlNodeType.Value, xepair.Value); + yield return Node (XamlNodeType.EndMember, xepair.Key); + } + yield return Node (XamlNodeType.EndObject, pai.Type); } - yield return Node (XamlNodeType.EndObject, pai.Type); } else yield return Node (XamlNodeType.Value, pair.Value); diff --git a/mcs/class/System.Xaml/Test/System.Xaml/XamlXmlReaderTest.cs b/mcs/class/System.Xaml/Test/System.Xaml/XamlXmlReaderTest.cs index b2d90b00e0..5e58267cc9 100755 --- a/mcs/class/System.Xaml/Test/System.Xaml/XamlXmlReaderTest.cs +++ b/mcs/class/System.Xaml/Test/System.Xaml/XamlXmlReaderTest.cs @@ -720,6 +720,13 @@ namespace MonoTests.System.Xaml Read_ContentPropertyContainer (r); } + [Test] + public void EscapedValue () + { + var exception = (Exception)XamlServices.Load(new StringReader("")); + Assert.AreEqual ("{123}", exception.HelpLink); + } + #region non-common tests [Test] public void Bug680385 () diff --git a/mcs/class/System/Mono.AppleTls/AppleCertificateHelper.cs b/mcs/class/System/Mono.AppleTls/AppleCertificateHelper.cs index 18212bb54d..8608ff4e25 100644 --- a/mcs/class/System/Mono.AppleTls/AppleCertificateHelper.cs +++ b/mcs/class/System/Mono.AppleTls/AppleCertificateHelper.cs @@ -14,9 +14,11 @@ extern alias MonoSecurity; using System; using System.Collections; using System.Reflection; +using System.Net.Security; using System.Runtime.InteropServices; using System.Security.Cryptography.X509Certificates; +using MNS = Mono.Net.Security; #if MONO_SECURITY_ALIAS using MonoSecurity::Mono.Security.Interface; #else @@ -116,12 +118,12 @@ namespace Mono.AppleTls } public static bool InvokeSystemCertificateValidator ( - ICertificateValidator2 validator, string targetHost, bool serverMode, + MNS.ChainValidationHelper validator, string targetHost, bool serverMode, X509CertificateCollection certificates, - ref MonoSslPolicyErrors errors, ref int status11) + ref SslPolicyErrors errors, ref int status11) { if (certificates == null) { - errors |= MonoSslPolicyErrors.RemoteCertificateNotAvailable; + errors |= SslPolicyErrors.RemoteCertificateNotAvailable; return false; } @@ -150,7 +152,7 @@ namespace Mono.AppleTls if (result == SecTrustResult.Unspecified || result == SecTrustResult.Proceed) return true; - errors |= MonoSslPolicyErrors.RemoteCertificateChainErrors; + errors |= SslPolicyErrors.RemoteCertificateChainErrors; return false; } } diff --git a/mcs/class/System/Mono.AppleTls/AppleTlsProvider.cs b/mcs/class/System/Mono.AppleTls/AppleTlsProvider.cs index 3ec4ded73b..0e7bc342a2 100644 --- a/mcs/class/System/Mono.AppleTls/AppleTlsProvider.cs +++ b/mcs/class/System/Mono.AppleTls/AppleTlsProvider.cs @@ -28,7 +28,7 @@ using Mono.Security.Interface; namespace Mono.AppleTls { - class AppleTlsProvider : MonoTlsProvider + class AppleTlsProvider : MNS.MobileTlsProvider { public override string Name { get { return "apple-tls"; } @@ -38,14 +38,7 @@ namespace Mono.AppleTls get { return MNS.MonoTlsProviderFactory.AppleTlsId; } } - public override IMonoSslStream CreateSslStream ( - Stream innerStream, bool leaveInnerStreamOpen, - MonoTlsSettings settings = null) - { - return SslStream.CreateMonoSslStream (innerStream, leaveInnerStreamOpen, this, settings); - } - - internal override IMonoSslStream CreateSslStreamInternal ( + internal override MNS.MobileAuthenticatedStream CreateSslStream ( SslStream sslStream, Stream innerStream, bool leaveInnerStreamOpen, MonoTlsSettings settings) { @@ -73,9 +66,9 @@ namespace Mono.AppleTls } internal override bool ValidateCertificate ( - ICertificateValidator2 validator, string targetHost, bool serverMode, + MNS.ChainValidationHelper validator, string targetHost, bool serverMode, X509CertificateCollection certificates, bool wantsChain, ref X509Chain chain, - ref MonoSslPolicyErrors errors, ref int status11) + ref SslPolicyErrors errors, ref int status11) { if (wantsChain) chain = MNS.SystemCertificateValidator.CreateX509Chain (certificates); diff --git a/mcs/class/System/Mono.AppleTls/AppleTlsStream.cs b/mcs/class/System/Mono.AppleTls/AppleTlsStream.cs index 03c47f26dd..be5206d436 100644 --- a/mcs/class/System/Mono.AppleTls/AppleTlsStream.cs +++ b/mcs/class/System/Mono.AppleTls/AppleTlsStream.cs @@ -31,7 +31,7 @@ namespace Mono.AppleTls class AppleTlsStream : MNS.MobileAuthenticatedStream { public AppleTlsStream (Stream innerStream, bool leaveInnerStreamOpen, SslStream owner, - MonoTlsSettings settings, MonoTlsProvider provider) + MonoTlsSettings settings, MNS.MobileTlsProvider provider) : base (innerStream, leaveInnerStreamOpen, owner, settings, provider) { } diff --git a/mcs/class/System/Mono.Btls/MonoBtlsProvider.cs b/mcs/class/System/Mono.Btls/MonoBtlsProvider.cs index 6654fa731c..97c50aacab 100644 --- a/mcs/class/System/Mono.Btls/MonoBtlsProvider.cs +++ b/mcs/class/System/Mono.Btls/MonoBtlsProvider.cs @@ -50,7 +50,7 @@ using MNS = Mono.Net.Security; namespace Mono.Btls { - class MonoBtlsProvider : MonoTlsProvider + class MonoBtlsProvider : MNS.MobileTlsProvider { public override Guid ID { get { return MNS.MonoTlsProviderFactory.BtlsId; } @@ -85,14 +85,7 @@ namespace Mono.Btls get { return SslProtocols.Tls12 | SslProtocols.Tls11 | SslProtocols.Tls; } } - public override IMonoSslStream CreateSslStream ( - Stream innerStream, bool leaveInnerStreamOpen, - MonoTlsSettings settings = null) - { - return SslStream.CreateMonoSslStream (innerStream, leaveInnerStreamOpen, this, settings); - } - - internal override IMonoSslStream CreateSslStreamInternal ( + internal override MNS.MobileAuthenticatedStream CreateSslStream ( SslStream sslStream, Stream innerStream, bool leaveInnerStreamOpen, MonoTlsSettings settings) { @@ -104,14 +97,14 @@ namespace Mono.Btls get { return true; } } - internal override X509Certificate2Impl GetNativeCertificate ( + internal X509Certificate2Impl GetNativeCertificate ( byte[] data, string password, X509KeyStorageFlags flags) { using (var handle = new SafePasswordHandle (password)) return GetNativeCertificate (data, handle, flags); } - internal override X509Certificate2Impl GetNativeCertificate ( + internal X509Certificate2Impl GetNativeCertificate ( X509Certificate certificate) { var impl = certificate.Impl as X509CertificateImplBtls; @@ -152,9 +145,9 @@ namespace Mono.Btls } internal override bool ValidateCertificate ( - ICertificateValidator2 validator, string targetHost, bool serverMode, + MNS.ChainValidationHelper validator, string targetHost, bool serverMode, X509CertificateCollection certificates, bool wantsChain, ref X509Chain chain, - ref MonoSslPolicyErrors errors, ref int status11) + ref SslPolicyErrors errors, ref int status11) { if (chain != null) { var chainImpl = (X509ChainImplBtls)chain.Impl; @@ -215,15 +208,15 @@ namespace Mono.Btls } void CheckValidationResult ( - ICertificateValidator validator, string targetHost, bool serverMode, + MNS.ChainValidationHelper validator, string targetHost, bool serverMode, X509CertificateCollection certificates, bool wantsChain, X509Chain chain, MonoBtlsX509StoreCtx storeCtx, - bool success, ref MonoSslPolicyErrors errors, ref int status11) + bool success, ref SslPolicyErrors errors, ref int status11) { status11 = unchecked((int)0); if (success) return; - errors = MonoSslPolicyErrors.RemoteCertificateChainErrors; + errors = SslPolicyErrors.RemoteCertificateChainErrors; if (!wantsChain || storeCtx == null || chain == null) { status11 = unchecked((int)0x800B010B); return; @@ -231,12 +224,12 @@ namespace Mono.Btls var error = storeCtx.GetError (); switch (error) { case Mono.Btls.MonoBtlsX509Error.OK: - errors = MonoSslPolicyErrors.None; + errors = SslPolicyErrors.None; break; case Mono.Btls.MonoBtlsX509Error.CRL_NOT_YET_VALID: break; case MonoBtlsX509Error.HOSTNAME_MISMATCH: - errors = MonoSslPolicyErrors.RemoteCertificateNameMismatch; + errors = SslPolicyErrors.RemoteCertificateNameMismatch; chain.Impl.AddStatus (X509ChainStatusFlags.UntrustedRoot); status11 = unchecked ((int)0x800B010B); break; diff --git a/mcs/class/System/Mono.Btls/MonoBtlsStream.cs b/mcs/class/System/Mono.Btls/MonoBtlsStream.cs index 63a4eaf9b8..6e44e194ff 100644 --- a/mcs/class/System/Mono.Btls/MonoBtlsStream.cs +++ b/mcs/class/System/Mono.Btls/MonoBtlsStream.cs @@ -47,7 +47,7 @@ namespace Mono.Btls class MonoBtlsStream : MNS.MobileAuthenticatedStream { public MonoBtlsStream (Stream innerStream, bool leaveInnerStreamOpen, SslStream owner, - MonoTlsSettings settings, MonoTlsProvider provider) + MonoTlsSettings settings, MNS.MobileTlsProvider provider) : base (innerStream, leaveInnerStreamOpen, owner, settings, provider) { } diff --git a/mcs/class/System/Mono.Btls/X509PalImpl.Btls.cs b/mcs/class/System/Mono.Btls/X509PalImpl.Btls.cs index 5b8a360f17..e051b7672b 100644 --- a/mcs/class/System/Mono.Btls/X509PalImpl.Btls.cs +++ b/mcs/class/System/Mono.Btls/X509PalImpl.Btls.cs @@ -56,7 +56,7 @@ namespace Mono.Btls public override X509CertificateImpl Import (byte[] data) { - return Provider.GetNativeCertificate (data, null, X509KeyStorageFlags.DefaultKeySet); + return Provider.GetNativeCertificate (data, (string)null, X509KeyStorageFlags.DefaultKeySet); } public override X509Certificate2Impl Import ( diff --git a/mcs/class/System/Mono.Net.Security/ChainValidationHelper.cs b/mcs/class/System/Mono.Net.Security/ChainValidationHelper.cs index 8d0146b7ce..8aac9bd099 100644 --- a/mcs/class/System/Mono.Net.Security/ChainValidationHelper.cs +++ b/mcs/class/System/Mono.Net.Security/ChainValidationHelper.cs @@ -64,11 +64,11 @@ namespace Mono.Net.Security { internal delegate bool ServerCertValidationCallbackWrapper (ServerCertValidationCallback callback, X509Certificate certificate, X509Chain chain, MonoSslPolicyErrors sslPolicyErrors); - internal class ChainValidationHelper : ICertificateValidator2 + internal class ChainValidationHelper : ICertificateValidator { readonly WeakReference owner; readonly MonoTlsSettings settings; - readonly MonoTlsProvider provider; + readonly MobileTlsProvider provider; readonly ServerCertValidationCallback certValidationCallback; readonly LocalCertSelectionCallback certSelectionCallback; readonly MonoTlsStream tlsStream; @@ -76,18 +76,18 @@ namespace Mono.Net.Security #pragma warning disable 618 - internal static ICertificateValidator GetInternalValidator (SslStream owner, MonoTlsProvider provider, MonoTlsSettings settings) + internal static ChainValidationHelper GetInternalValidator (SslStream owner, MobileTlsProvider provider, MonoTlsSettings settings) { if (settings == null) return new ChainValidationHelper (owner, provider, null, false, null); if (settings.CertificateValidator != null) - return settings.CertificateValidator; + return (ChainValidationHelper)settings.CertificateValidator; return new ChainValidationHelper (owner, provider, settings, false, null); } internal static ICertificateValidator GetDefaultValidator (MonoTlsSettings settings) { - var provider = MonoTlsProviderFactory.GetProvider (); + var provider = MonoTlsProviderFactory.GetProviderInternal (); if (settings == null) return new ChainValidationHelper (null, provider, null, false, null); if (settings.CertificateValidator != null) @@ -95,21 +95,21 @@ namespace Mono.Net.Security return new ChainValidationHelper (null, provider, settings, false, null); } - internal static ChainValidationHelper Create (MonoTlsProvider provider, ref MonoTlsSettings settings, MonoTlsStream stream) + internal static ChainValidationHelper Create (MobileTlsProvider provider, ref MonoTlsSettings settings, MonoTlsStream stream) { var helper = new ChainValidationHelper (null, provider, settings, true, stream); settings = helper.settings; return helper; } - ChainValidationHelper (SslStream owner, MonoTlsProvider provider, MonoTlsSettings settings, bool cloneSettings, MonoTlsStream stream) + ChainValidationHelper (SslStream owner, MobileTlsProvider provider, MonoTlsSettings settings, bool cloneSettings, MonoTlsStream stream) { if (settings == null) settings = MonoTlsSettings.CopyDefaultSettings (); if (cloneSettings) settings = settings.CloneWithValidator (this); if (provider == null) - provider = MonoTlsProviderFactory.GetProvider (); + provider = MonoTlsProviderFactory.GetProviderInternal (); this.provider = provider; this.settings = settings; @@ -152,7 +152,7 @@ namespace Mono.Net.Security return new ServerCertValidationCallback ((s, c, ch, e) => { string targetHost = null; if (s is SslStream sslStream) - targetHost = ((MobileAuthenticatedStream)sslStream.Impl).TargetHost; + targetHost = sslStream.InternalTargetHost; else if (s is HttpWebRequest request) { targetHost = request.Host; if (!string.IsNullOrEmpty (targetHost)) { @@ -309,9 +309,7 @@ namespace Mono.Net.Security wantsChain = true; } - var xerrors = (MonoSslPolicyErrors)errors; - result = provider.ValidateCertificate (this, host, server, certs, wantsChain, ref chain, ref xerrors, ref status11); - errors = (SslPolicyErrors)xerrors; + result = provider.ValidateCertificate (this, host, server, certs, wantsChain, ref chain, ref errors, ref status11); if (status11 == 0 && errors != 0) { // TRUST_E_FAIL diff --git a/mcs/class/System/Mono.Net.Security/LegacySslStream.cs b/mcs/class/System/Mono.Net.Security/LegacySslStream.cs deleted file mode 100644 index 1512306bcd..0000000000 --- a/mcs/class/System/Mono.Net.Security/LegacySslStream.cs +++ /dev/null @@ -1,645 +0,0 @@ -// -// System.Net.Security.SslStream.cs -// -// Authors: -// Tim Coleman (tim@timcoleman.com) -// Atsushi Enomoto (atsushi@ximian.com) -// Marek Safar (marek.safar@gmail.com) -// -// Copyright (C) Tim Coleman, 2004 -// (c) 2004,2007 Novell, Inc. (http://www.novell.com) -// Copyright 2011 Xamarin Inc. -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -#if SECURITY_DEP - -#if MONO_SECURITY_ALIAS -extern alias MonoSecurity; -#endif - -#if MONO_SECURITY_ALIAS -using MonoCipherAlgorithmType = MonoSecurity::Mono.Security.Protocol.Tls.CipherAlgorithmType; -using MonoHashAlgorithmType = MonoSecurity::Mono.Security.Protocol.Tls.HashAlgorithmType; -using MonoExchangeAlgorithmType = MonoSecurity::Mono.Security.Protocol.Tls.ExchangeAlgorithmType; -using MonoSecurityProtocolType = MonoSecurity::Mono.Security.Protocol.Tls.SecurityProtocolType; -using MonoSecurity::Mono.Security.Protocol.Tls; -using MonoSecurity::Mono.Security.Interface; -#else -using MonoCipherAlgorithmType = Mono.Security.Protocol.Tls.CipherAlgorithmType; -using MonoHashAlgorithmType = Mono.Security.Protocol.Tls.HashAlgorithmType; -using MonoExchangeAlgorithmType = Mono.Security.Protocol.Tls.ExchangeAlgorithmType; -using MonoSecurityProtocolType = Mono.Security.Protocol.Tls.SecurityProtocolType; -using Mono.Security.Protocol.Tls; -using Mono.Security.Interface; -#endif - -using CipherAlgorithmType = System.Security.Authentication.CipherAlgorithmType; -using HashAlgorithmType = System.Security.Authentication.HashAlgorithmType; -using ExchangeAlgorithmType = System.Security.Authentication.ExchangeAlgorithmType; - -using System; -using System.IO; -using System.Net; -using System.Net.Security; -using System.Threading; -using System.Threading.Tasks; -using System.Security.Authentication; -using System.Security.Cryptography.X509Certificates; -using System.Security.Principal; -using System.Security.Cryptography; - -namespace Mono.Net.Security.Private -{ - /* - * Strictly private - do not use outside the Mono.Net.Security directory. - */ - [MonoTODO ("Non-X509Certificate2 certificate is not supported")] - internal class LegacySslStream : AuthenticatedStream, IMonoSslStream - { - #region Fields - - SslStreamBase ssl_stream; - ICertificateValidator certificateValidator; - - #endregion // Fields - - #region Constructors - - public LegacySslStream (Stream innerStream, bool leaveInnerStreamOpen, SslStream owner, MonoTlsProvider provider, MonoTlsSettings settings) - : base (innerStream, leaveInnerStreamOpen) - { - SslStream = owner; - Provider = provider; - certificateValidator = ChainValidationHelper.GetInternalValidator (owner, provider, settings); - } - #endregion // Constructors - - #region Properties - - public override bool CanRead { - get { return InnerStream.CanRead; } - } - - public override bool CanSeek { - get { return InnerStream.CanSeek; } - } - - public override bool CanTimeout { - get { return InnerStream.CanTimeout; } - } - - public override bool CanWrite { - get { return InnerStream.CanWrite; } - } - - public override long Length { - get { return InnerStream.Length; } - } - - public override long Position { - get { return InnerStream.Position; } - set { - throw new NotSupportedException ("This stream does not support seek operations"); - } - } - - // AuthenticatedStream overrides - - public override bool IsAuthenticated { - get { return ssl_stream != null; } - } - - public override bool IsEncrypted { - get { return IsAuthenticated; } - } - - public override bool IsMutuallyAuthenticated { - get { return IsAuthenticated && (IsServer ? RemoteCertificate != null : LocalCertificate != null); } - } - - public override bool IsServer { - get { return ssl_stream is SslServerStream; } - } - - public override bool IsSigned { - get { return IsAuthenticated; } - } - - public override int ReadTimeout { - get { return InnerStream.ReadTimeout; } - set { InnerStream.ReadTimeout = value; } - } - - public override int WriteTimeout { - get { return InnerStream.WriteTimeout; } - set { InnerStream.WriteTimeout = value; } - } - - // SslStream - - public virtual bool CheckCertRevocationStatus { - get { - if (!IsAuthenticated) - return false; - - return ssl_stream.CheckCertRevocationStatus; - } - } - - public virtual CipherAlgorithmType CipherAlgorithm { - get { - CheckConnectionAuthenticated (); - - switch (ssl_stream.CipherAlgorithm) { - case MonoCipherAlgorithmType.Des: - return CipherAlgorithmType.Des; - case MonoCipherAlgorithmType.None: - return CipherAlgorithmType.None; - case MonoCipherAlgorithmType.Rc2: - return CipherAlgorithmType.Rc2; - case MonoCipherAlgorithmType.Rc4: - return CipherAlgorithmType.Rc4; - case MonoCipherAlgorithmType.SkipJack: - break; - case MonoCipherAlgorithmType.TripleDes: - return CipherAlgorithmType.TripleDes; - case MonoCipherAlgorithmType.Rijndael: - switch (ssl_stream.CipherStrength) { - case 128: - return CipherAlgorithmType.Aes128; - case 192: - return CipherAlgorithmType.Aes192; - case 256: - return CipherAlgorithmType.Aes256; - } - break; - } - - throw new InvalidOperationException ("Not supported cipher algorithm is in use. It is likely a bug in SslStream."); - } - } - - public virtual int CipherStrength { - get { - CheckConnectionAuthenticated (); - - return ssl_stream.CipherStrength; - } - } - - public virtual HashAlgorithmType HashAlgorithm { - get { - CheckConnectionAuthenticated (); - - switch (ssl_stream.HashAlgorithm) { - case MonoHashAlgorithmType.Md5: - return HashAlgorithmType.Md5; - case MonoHashAlgorithmType.None: - return HashAlgorithmType.None; - case MonoHashAlgorithmType.Sha1: - return HashAlgorithmType.Sha1; - } - - throw new InvalidOperationException ("Not supported hash algorithm is in use. It is likely a bug in SslStream."); - } - } - - public virtual int HashStrength { - get { - CheckConnectionAuthenticated (); - - return ssl_stream.HashStrength; - } - } - - public virtual ExchangeAlgorithmType KeyExchangeAlgorithm { - get { - CheckConnectionAuthenticated (); - - switch (ssl_stream.KeyExchangeAlgorithm) { - case MonoExchangeAlgorithmType.DiffieHellman: - return ExchangeAlgorithmType.DiffieHellman; - case MonoExchangeAlgorithmType.Fortezza: - break; - case MonoExchangeAlgorithmType.None: - return ExchangeAlgorithmType.None; - case MonoExchangeAlgorithmType.RsaKeyX: - return ExchangeAlgorithmType.RsaKeyX; - case MonoExchangeAlgorithmType.RsaSign: - return ExchangeAlgorithmType.RsaSign; - } - - throw new InvalidOperationException ("Not supported exchange algorithm is in use. It is likely a bug in SslStream."); - } - } - - public virtual int KeyExchangeStrength { - get { - CheckConnectionAuthenticated (); - - return ssl_stream.KeyExchangeStrength; - } - } - - X509Certificate IMonoSslStream.InternalLocalCertificate { - get { - return IsServer ? ssl_stream.ServerCertificate : ((SslClientStream) ssl_stream).SelectedClientCertificate; - } - } - - public virtual X509Certificate LocalCertificate { - get { - CheckConnectionAuthenticated (); - - return IsServer ? ssl_stream.ServerCertificate : ((SslClientStream) ssl_stream).SelectedClientCertificate; - } - } - - public virtual X509Certificate RemoteCertificate { - get { - CheckConnectionAuthenticated (); - return !IsServer ? ssl_stream.ServerCertificate : ((SslServerStream) ssl_stream).ClientCertificate; - } - } - - public virtual SslProtocols SslProtocol { - get { - CheckConnectionAuthenticated (); - - switch (ssl_stream.SecurityProtocol) { - case MonoSecurityProtocolType.Default: - return SslProtocols.Default; - case MonoSecurityProtocolType.Ssl2: - return SslProtocols.Ssl2; - case MonoSecurityProtocolType.Ssl3: - return SslProtocols.Ssl3; - case MonoSecurityProtocolType.Tls: - return SslProtocols.Tls; - } - - throw new InvalidOperationException ("Not supported SSL/TLS protocol is in use. It is likely a bug in SslStream."); - } - } - - #endregion // Properties - - #region Methods - -/* - AsymmetricAlgorithm GetPrivateKey (X509Certificate cert, string targetHost) - { - // FIXME: what can I do for non-X509Certificate2 ? - X509Certificate2 cert2 = cert as X509Certificate2; - return cert2 != null ? cert2.PrivateKey : null; - } -*/ - X509Certificate OnCertificateSelection (X509CertificateCollection clientCerts, X509Certificate serverCert, string targetHost, X509CertificateCollection serverRequestedCerts) - { -#pragma warning disable 618 - string [] acceptableIssuers = new string [serverRequestedCerts != null ? serverRequestedCerts.Count : 0]; - for (int i = 0; i < acceptableIssuers.Length; i++) - acceptableIssuers [i] = serverRequestedCerts [i].GetIssuerName (); - X509Certificate clientCertificate; - certificateValidator.SelectClientCertificate (targetHost, clientCerts, serverCert, acceptableIssuers, out clientCertificate); - return clientCertificate; -#pragma warning restore 618 - } - - public virtual IAsyncResult BeginAuthenticateAsClient (string targetHost, AsyncCallback asyncCallback, object asyncState) - { - return BeginAuthenticateAsClient (targetHost, new X509CertificateCollection (), SslProtocols.Tls, false, asyncCallback, asyncState); - } - - public virtual IAsyncResult BeginAuthenticateAsClient (string targetHost, X509CertificateCollection clientCertificates, bool checkCertificateRevocation, AsyncCallback asyncCallback, object asyncState) - { - return BeginAuthenticateAsClient (targetHost, clientCertificates, SecurityProtocol.SystemDefaultSecurityProtocols, checkCertificateRevocation, asyncCallback, asyncState); - } - - public virtual IAsyncResult BeginAuthenticateAsClient (string targetHost, X509CertificateCollection clientCertificates, SslProtocols enabledSslProtocols, bool checkCertificateRevocation, AsyncCallback asyncCallback, object asyncState) - { - if (IsAuthenticated) - throw new InvalidOperationException ("This SslStream is already authenticated"); - - SslClientStream s = new SslClientStream (InnerStream, targetHost, !LeaveInnerStreamOpen, GetMonoSslProtocol (enabledSslProtocols), clientCertificates); - s.CheckCertRevocationStatus = checkCertificateRevocation; - - // Due to the Mono.Security internal, it cannot reuse - // the delegated argument, as Mono.Security creates - // another instance of X509Certificate which lacks - // private key but is filled the private key via this - // delegate. - s.PrivateKeyCertSelectionDelegate = delegate (X509Certificate cert, string host) { - string hash = cert.GetCertHashString (); - // ... so, we cannot use the delegate argument. - foreach (X509Certificate cc in clientCertificates) { - if (cc.GetCertHashString () != hash) - continue; - X509Certificate2 cert2 = cc as X509Certificate2; - cert2 = cert2 ?? new X509Certificate2 (cc); - return cert2.PrivateKey; - } - return null; - }; - - // Even if validation_callback is null this allows us to verify requests where the user - // does not provide a verification callback but attempts to authenticate with the website - // as a client (see https://bugzilla.xamarin.com/show_bug.cgi?id=18962 for an example) - s.ServerCertValidation2 += (mcerts) => { - X509CertificateCollection certs = null; - if (mcerts != null) { - certs = new X509CertificateCollection (); - for (int i = 0; i < mcerts.Count; i++) - certs.Add (new X509Certificate2 (mcerts [i].RawData)); - } - return ((ChainValidationHelper)certificateValidator).ValidateCertificate (targetHost, false, certs); - }; - s.ClientCertSelectionDelegate = OnCertificateSelection; - - ssl_stream = s; - - return BeginWrite (new byte [0], 0, 0, asyncCallback, asyncState); - } - - public override IAsyncResult BeginRead (byte[] buffer, int offset, int count, AsyncCallback asyncCallback, object asyncState) - { - CheckConnectionAuthenticated (); - - return ssl_stream.BeginRead (buffer, offset, count, asyncCallback, asyncState); - } - - public virtual IAsyncResult BeginAuthenticateAsServer (X509Certificate serverCertificate, AsyncCallback asyncCallback, object asyncState) - { - return BeginAuthenticateAsServer (serverCertificate, false, SslProtocols.Tls, false, asyncCallback, asyncState); - } - - public virtual IAsyncResult BeginAuthenticateAsServer (X509Certificate serverCertificate, bool clientCertificateRequired, bool checkCertificateRevocation, AsyncCallback asyncCallback, object asyncState) - { - return BeginAuthenticateAsServer (serverCertificate, clientCertificateRequired, SecurityProtocol.SystemDefaultSecurityProtocols, checkCertificateRevocation, asyncCallback, asyncState); - } - - public virtual IAsyncResult BeginAuthenticateAsServer (X509Certificate serverCertificate, bool clientCertificateRequired, SslProtocols enabledSslProtocols, bool checkCertificateRevocation, AsyncCallback asyncCallback, object asyncState) - { - if (IsAuthenticated) - throw new InvalidOperationException ("This SslStream is already authenticated"); - - SslServerStream s = new SslServerStream (InnerStream, serverCertificate, false, clientCertificateRequired, !LeaveInnerStreamOpen, GetMonoSslProtocol (enabledSslProtocols)); - s.CheckCertRevocationStatus = checkCertificateRevocation; - // Due to the Mono.Security internal, it cannot reuse - // the delegated argument, as Mono.Security creates - // another instance of X509Certificate which lacks - // private key but is filled the private key via this - // delegate. - s.PrivateKeyCertSelectionDelegate = delegate (X509Certificate cert, string targetHost) { - // ... so, we cannot use the delegate argument. - X509Certificate2 cert2 = serverCertificate as X509Certificate2 ?? new X509Certificate2 (serverCertificate); - return cert2 != null ? cert2.PrivateKey : null; - }; - - s.ClientCertValidationDelegate = delegate (X509Certificate cert, int[] certErrors) { - var errors = certErrors.Length > 0 ? MonoSslPolicyErrors.RemoteCertificateChainErrors : MonoSslPolicyErrors.None; - return ((ChainValidationHelper)certificateValidator).ValidateClientCertificate (cert, errors); - }; - - ssl_stream = s; - - return BeginWrite (new byte[0], 0, 0, asyncCallback, asyncState); - } - - MonoSecurityProtocolType GetMonoSslProtocol (SslProtocols ms) - { - switch (ms) { - case SslProtocols.Ssl2: - return MonoSecurityProtocolType.Ssl2; - case SslProtocols.Ssl3: - return MonoSecurityProtocolType.Ssl3; - case SslProtocols.Tls: - return MonoSecurityProtocolType.Tls; - default: - return MonoSecurityProtocolType.Default; - } - } - - public override IAsyncResult BeginWrite (byte[] buffer, int offset, int count, AsyncCallback asyncCallback, object asyncState) - { - CheckConnectionAuthenticated (); - - return ssl_stream.BeginWrite (buffer, offset, count, asyncCallback, asyncState); - } - - public virtual void AuthenticateAsClient (string targetHost) - { - AuthenticateAsClient (targetHost, new X509CertificateCollection (), SslProtocols.Tls, false); - } - - public virtual void AuthenticateAsClient (string targetHost, X509CertificateCollection clientCertificates, bool checkCertificateRevocation) - { - AuthenticateAsClient (targetHost, clientCertificates, SecurityProtocol.SystemDefaultSecurityProtocols, checkCertificateRevocation); - } - - public virtual void AuthenticateAsClient (string targetHost, X509CertificateCollection clientCertificates, SslProtocols enabledSslProtocols, bool checkCertificateRevocation) - { - EndAuthenticateAsClient (BeginAuthenticateAsClient ( - targetHost, clientCertificates, enabledSslProtocols, checkCertificateRevocation, null, null)); - } - - public virtual void AuthenticateAsServer (X509Certificate serverCertificate) - { - AuthenticateAsServer (serverCertificate, false, SslProtocols.Tls, false); - } - - public virtual void AuthenticateAsServer (X509Certificate serverCertificate, bool clientCertificateRequired, bool checkCertificateRevocation) - { - AuthenticateAsServer (serverCertificate, clientCertificateRequired, SecurityProtocol.SystemDefaultSecurityProtocols, checkCertificateRevocation); - } - - public virtual void AuthenticateAsServer (X509Certificate serverCertificate, bool clientCertificateRequired, SslProtocols enabledSslProtocols, bool checkCertificateRevocation) - { - EndAuthenticateAsServer (BeginAuthenticateAsServer ( - serverCertificate, clientCertificateRequired, enabledSslProtocols, checkCertificateRevocation, null, null)); - } - - protected override void Dispose (bool disposing) - { - if (disposing) { - if (ssl_stream != null) - ssl_stream.Dispose (); - ssl_stream = null; - } - base.Dispose (disposing); - } - - public virtual void EndAuthenticateAsClient (IAsyncResult asyncResult) - { - CheckConnectionAuthenticated (); - - if (CanRead) - ssl_stream.EndRead (asyncResult); - else - ssl_stream.EndWrite (asyncResult); - } - - public virtual void EndAuthenticateAsServer (IAsyncResult asyncResult) - { - CheckConnectionAuthenticated (); - - if (CanRead) - ssl_stream.EndRead (asyncResult); - else - ssl_stream.EndWrite (asyncResult); - } - - public override int EndRead (IAsyncResult asyncResult) - { - CheckConnectionAuthenticated (); - - return ssl_stream.EndRead (asyncResult); - } - - public override void EndWrite (IAsyncResult asyncResult) - { - CheckConnectionAuthenticated (); - - ssl_stream.EndWrite (asyncResult); - } - - public override void Flush () - { - CheckConnectionAuthenticated (); - - InnerStream.Flush (); - } - - public override int Read (byte[] buffer, int offset, int count) - { - return EndRead (BeginRead (buffer, offset, count, null, null)); - } - - public override long Seek (long offset, SeekOrigin origin) - { - throw new NotSupportedException ("This stream does not support seek operations"); - } - - public override void SetLength (long value) - { - InnerStream.SetLength (value); - } - - public override void Write (byte[] buffer, int offset, int count) - { - EndWrite (BeginWrite (buffer, offset, count, null, null)); - } - - public void Write (byte[] buffer) - { - Write (buffer, 0, buffer.Length); - } - - void CheckConnectionAuthenticated () - { - if (!IsAuthenticated) - throw new InvalidOperationException ("This operation is invalid until it is successfully authenticated"); - } - - public virtual Task AuthenticateAsClientAsync (string targetHost) - { - return Task.Factory.FromAsync (BeginAuthenticateAsClient, EndAuthenticateAsClient, targetHost, null); - } - - public virtual Task AuthenticateAsClientAsync (string targetHost, X509CertificateCollection clientCertificates, bool checkCertificateRevocation) - { - return AuthenticateAsClientAsync (targetHost, clientCertificates, SecurityProtocol.SystemDefaultSecurityProtocols, checkCertificateRevocation); - } - - public virtual Task AuthenticateAsClientAsync (string targetHost, X509CertificateCollection clientCertificates, SslProtocols enabledSslProtocols, bool checkCertificateRevocation) - { - var t = Tuple.Create (targetHost, clientCertificates, enabledSslProtocols, checkCertificateRevocation, this); - - return Task.Factory.FromAsync ((callback, state) => { - var d = (Tuple) state; - return d.Item5.BeginAuthenticateAsClient (d.Item1, d.Item2, d.Item3, d.Item4, callback, null); - }, EndAuthenticateAsClient, t); - } - - public virtual Task AuthenticateAsServerAsync (X509Certificate serverCertificate) - { - return Task.Factory.FromAsync (BeginAuthenticateAsServer, EndAuthenticateAsServer, serverCertificate, null); - } - - public virtual Task AuthenticateAsServerAsync (X509Certificate serverCertificate, bool clientCertificateRequired, bool checkCertificateRevocation) - { - return AuthenticateAsServerAsync (serverCertificate, clientCertificateRequired, SecurityProtocol.SystemDefaultSecurityProtocols, checkCertificateRevocation); - } - - public virtual Task AuthenticateAsServerAsync (X509Certificate serverCertificate, bool clientCertificateRequired, SslProtocols enabledSslProtocols, bool checkCertificateRevocation) - { - var t = Tuple.Create (serverCertificate, clientCertificateRequired, enabledSslProtocols, checkCertificateRevocation, this); - - return Task.Factory.FromAsync ((callback, state) => { - var d = (Tuple) state; - return d.Item5.BeginAuthenticateAsServer (d.Item1, d.Item2, d.Item3, d.Item4, callback, null); - }, EndAuthenticateAsServer, t); - } - - #endregion // Methods - - #region IMonoSslStream - - Task IMonoSslStream.ShutdownAsync () - { - return Task.CompletedTask; - } - - AuthenticatedStream IMonoSslStream.AuthenticatedStream { - get { return this; } - } - - TransportContext IMonoSslStream.TransportContext { - get { throw new NotSupportedException (); } - } - - public SslStream SslStream { - get; - } - - public MonoTlsProvider Provider { - get; - } - - public MonoTlsConnectionInfo GetConnectionInfo () - { - return null; - } - - public bool CanRenegotiate => false; - - public Task RenegotiateAsync (CancellationToken cancellationToken) - { - throw new NotSupportedException (); - } - - #endregion - } -} - -#endif diff --git a/mcs/class/System/Mono.Net.Security/LegacyTlsProvider.cs b/mcs/class/System/Mono.Net.Security/LegacyTlsProvider.cs deleted file mode 100644 index d5d66c2f5e..0000000000 --- a/mcs/class/System/Mono.Net.Security/LegacyTlsProvider.cs +++ /dev/null @@ -1,108 +0,0 @@ -// -// LegacyTlsProvider.cs -// -// Author: -// Martin Baulig -// -// Copyright (c) 2015 Xamarin, Inc. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -#if SECURITY_DEP -#if MONO_SECURITY_ALIAS -extern alias MonoSecurity; -#endif - -#if MONO_SECURITY_ALIAS -using MSI = MonoSecurity::Mono.Security.Interface; -#else -using MSI = Mono.Security.Interface; -#endif - -using System; -using System.IO; -using System.Net; -using System.Net.Security; -using System.Security.Cryptography.X509Certificates; -using System.Security.Authentication; - -namespace Mono.Net.Security -{ - /* - * Strictly private - do not use outside the Mono.Net.Security directory. - */ - class LegacyTlsProvider : MSI.MonoTlsProvider - { - public override Guid ID { - get { return MonoTlsProviderFactory.LegacyId; } - } - - public override string Name { - get { return "legacy"; } - } - - public override bool SupportsSslStream { - get { return true; } - } - - public override bool SupportsConnectionInfo { - get { return false; } - } - - public override bool SupportsMonoExtensions { - get { return false; } - } - - internal override bool SupportsCleanShutdown { - get { return false; } - } - - public override SslProtocols SupportedProtocols { - get { return SslProtocols.Tls; } - } - - public override MSI.IMonoSslStream CreateSslStream ( - Stream innerStream, bool leaveInnerStreamOpen, - MSI.MonoTlsSettings settings = null) - { - return SslStream.CreateMonoSslStream (innerStream, leaveInnerStreamOpen, this, settings); - } - - internal override MSI.IMonoSslStream CreateSslStreamInternal ( - SslStream sslStream, Stream innerStream, bool leaveInnerStreamOpen, - MSI.MonoTlsSettings settings) - { - return new Private.LegacySslStream (innerStream, leaveInnerStreamOpen, sslStream, this, settings); - } - - internal override bool ValidateCertificate ( - MSI.ICertificateValidator2 validator, string targetHost, bool serverMode, - X509CertificateCollection certificates, bool wantsChain, ref X509Chain chain, - ref MSI.MonoSslPolicyErrors errors, ref int status11) - { - if (wantsChain) - chain = SystemCertificateValidator.CreateX509Chain (certificates); - var xerrors = (SslPolicyErrors)errors; - var result = SystemCertificateValidator.Evaluate (validator.Settings, targetHost, certificates, chain, ref xerrors, ref status11); - errors = (MSI.MonoSslPolicyErrors)xerrors; - return result; - } - } -} -#endif - diff --git a/mcs/class/System/Mono.Net.Security/MobileAuthenticatedStream.cs b/mcs/class/System/Mono.Net.Security/MobileAuthenticatedStream.cs index f603a3c23e..7e743dc3cc 100644 --- a/mcs/class/System/Mono.Net.Security/MobileAuthenticatedStream.cs +++ b/mcs/class/System/Mono.Net.Security/MobileAuthenticatedStream.cs @@ -35,7 +35,7 @@ using SslProtocols = System.Security.Authentication.SslProtocols; namespace Mono.Net.Security { - abstract class MobileAuthenticatedStream : AuthenticatedStream, MSI.IMonoSslStream2 + abstract class MobileAuthenticatedStream : AuthenticatedStream, MSI.IMonoSslStream { /* * This is intentionally called `xobileTlsContext'. It is a "dangerous" object @@ -70,7 +70,7 @@ namespace Mono.Net.Security } public MobileAuthenticatedStream (Stream innerStream, bool leaveInnerStreamOpen, SslStream owner, - MSI.MonoTlsSettings settings, MSI.MonoTlsProvider provider) + MSI.MonoTlsSettings settings, MobileTlsProvider provider) : base (innerStream, leaveInnerStreamOpen) { SslStream = owner; @@ -90,10 +90,12 @@ namespace Mono.Net.Security get; } - public MSI.MonoTlsProvider Provider { + public MobileTlsProvider Provider { get; } + MSI.MonoTlsProvider MSI.IMonoSslStream.Provider => Provider; + internal bool HasContext { get { return xobileTlsContext != null; } } @@ -159,16 +161,6 @@ namespace Mono.Net.Security Shutdown } - public void AuthenticateAsClient (string targetHost) - { - AuthenticateAsClient (targetHost, new X509CertificateCollection (), SecurityProtocol.SystemDefaultSecurityProtocols, false); - } - - public void AuthenticateAsClient (string targetHost, X509CertificateCollection clientCertificates, bool checkCertificateRevocation) - { - AuthenticateAsClient (targetHost, clientCertificates, SecurityProtocol.SystemDefaultSecurityProtocols, false); - } - public void AuthenticateAsClient (string targetHost, X509CertificateCollection clientCertificates, SslProtocols enabledSslProtocols, bool checkCertificateRevocation) { var options = new MonoSslClientAuthenticationOptions { @@ -187,45 +179,6 @@ namespace Mono.Net.Security } } - public IAsyncResult BeginAuthenticateAsClient (string targetHost, AsyncCallback asyncCallback, object asyncState) - { - return BeginAuthenticateAsClient (targetHost, new X509CertificateCollection (), SecurityProtocol.SystemDefaultSecurityProtocols, false, asyncCallback, asyncState); - } - - public IAsyncResult BeginAuthenticateAsClient (string targetHost, X509CertificateCollection clientCertificates, bool checkCertificateRevocation, AsyncCallback asyncCallback, object asyncState) - { - return BeginAuthenticateAsClient (targetHost, clientCertificates, SecurityProtocol.SystemDefaultSecurityProtocols, checkCertificateRevocation, asyncCallback, asyncState); - } - - public IAsyncResult BeginAuthenticateAsClient (string targetHost, X509CertificateCollection clientCertificates, SslProtocols enabledSslProtocols, bool checkCertificateRevocation, AsyncCallback asyncCallback, object asyncState) - { - var options = new MonoSslClientAuthenticationOptions { - TargetHost = targetHost, - ClientCertificates = clientCertificates, - EnabledSslProtocols = enabledSslProtocols, - CertificateRevocationCheckMode = checkCertificateRevocation ? X509RevocationMode.Online : X509RevocationMode.NoCheck, - EncryptionPolicy = EncryptionPolicy.RequireEncryption - }; - - var task = ProcessAuthentication (false, options, CancellationToken.None); - return TaskToApm.Begin (task, asyncCallback, asyncState); - } - - public void EndAuthenticateAsClient (IAsyncResult asyncResult) - { - TaskToApm.End (asyncResult); - } - - public void AuthenticateAsServer (X509Certificate serverCertificate) - { - AuthenticateAsServer (serverCertificate, false, SecurityProtocol.SystemDefaultSecurityProtocols, false); - } - - public void AuthenticateAsServer (X509Certificate serverCertificate, bool clientCertificateRequired, bool checkCertificateRevocation) - { - AuthenticateAsServer (serverCertificate, clientCertificateRequired, SecurityProtocol.SystemDefaultSecurityProtocols, checkCertificateRevocation); - } - public void AuthenticateAsServer (X509Certificate serverCertificate, bool clientCertificateRequired, SslProtocols enabledSslProtocols, bool checkCertificateRevocation) { var options = new MonoSslServerAuthenticationOptions { @@ -244,45 +197,6 @@ namespace Mono.Net.Security } } - public IAsyncResult BeginAuthenticateAsServer (X509Certificate serverCertificate, AsyncCallback asyncCallback, object asyncState) - { - return BeginAuthenticateAsServer (serverCertificate, false, SecurityProtocol.SystemDefaultSecurityProtocols, false, asyncCallback, asyncState); - } - - public IAsyncResult BeginAuthenticateAsServer (X509Certificate serverCertificate, bool clientCertificateRequired, bool checkCertificateRevocation, AsyncCallback asyncCallback, object asyncState) - { - return BeginAuthenticateAsServer (serverCertificate, clientCertificateRequired, SecurityProtocol.SystemDefaultSecurityProtocols, checkCertificateRevocation, asyncCallback, asyncState); - } - - public IAsyncResult BeginAuthenticateAsServer (X509Certificate serverCertificate, bool clientCertificateRequired, SslProtocols enabledSslProtocols, bool checkCertificateRevocation, AsyncCallback asyncCallback, object asyncState) - { - var options = new MonoSslServerAuthenticationOptions { - ServerCertificate = serverCertificate, - ClientCertificateRequired = clientCertificateRequired, - EnabledSslProtocols = enabledSslProtocols, - CertificateRevocationCheckMode = checkCertificateRevocation ? X509RevocationMode.Online : X509RevocationMode.NoCheck, - EncryptionPolicy = EncryptionPolicy.RequireEncryption - }; - - var task = ProcessAuthentication (false, options, CancellationToken.None); - return TaskToApm.Begin (task, asyncCallback, asyncState); - } - - public void EndAuthenticateAsServer (IAsyncResult asyncResult) - { - TaskToApm.End (asyncResult); - } - - public Task AuthenticateAsClientAsync (string targetHost) - { - return AuthenticateAsClientAsync (targetHost, null, SecurityProtocol.SystemDefaultSecurityProtocols, false); - } - - public Task AuthenticateAsClientAsync (string targetHost, X509CertificateCollection clientCertificates, bool checkCertificateRevocation) - { - return AuthenticateAsClientAsync (targetHost, clientCertificates, SecurityProtocol.SystemDefaultSecurityProtocols, checkCertificateRevocation); - } - public Task AuthenticateAsClientAsync (string targetHost, X509CertificateCollection clientCertificates, SslProtocols enabledSslProtocols, bool checkCertificateRevocation) { var options = new MonoSslClientAuthenticationOptions { @@ -301,16 +215,6 @@ namespace Mono.Net.Security return ProcessAuthentication (false, (MonoSslClientAuthenticationOptions)sslClientAuthenticationOptions, cancellationToken); } - public Task AuthenticateAsServerAsync (X509Certificate serverCertificate) - { - return AuthenticateAsServerAsync (serverCertificate, false, SecurityProtocol.SystemDefaultSecurityProtocols, false); - } - - public Task AuthenticateAsServerAsync (X509Certificate serverCertificate, bool clientCertificateRequired, bool checkCertificateRevocation) - { - return AuthenticateAsServerAsync (serverCertificate, clientCertificateRequired, SecurityProtocol.SystemDefaultSecurityProtocols, checkCertificateRevocation); - } - public Task AuthenticateAsServerAsync (X509Certificate serverCertificate, bool clientCertificateRequired, SslProtocols enabledSslProtocols, bool checkCertificateRevocation) { var options = new MonoSslServerAuthenticationOptions { @@ -408,30 +312,6 @@ namespace Mono.Net.Security protected abstract MobileTlsContext CreateContext (MonoSslAuthenticationOptions options); - public override IAsyncResult BeginRead (byte[] buffer, int offset, int count, AsyncCallback asyncCallback, object asyncState) - { - var asyncRequest = new AsyncReadRequest (this, false, buffer, offset, count); - var task = StartOperation (OperationType.Read, asyncRequest, CancellationToken.None); - return TaskToApm.Begin (task, asyncCallback, asyncState); - } - - public override int EndRead (IAsyncResult asyncResult) - { - return TaskToApm.End (asyncResult); - } - - public override IAsyncResult BeginWrite (byte[] buffer, int offset, int count, AsyncCallback asyncCallback, object asyncState) - { - var asyncRequest = new AsyncWriteRequest (this, false, buffer, offset, count); - var task = StartOperation (OperationType.Write, asyncRequest, CancellationToken.None); - return TaskToApm.Begin (task, asyncCallback, asyncState); - } - - public override void EndWrite (IAsyncResult asyncResult) - { - TaskToApm.End (asyncResult); - } - public override int Read (byte[] buffer, int offset, int count) { var asyncRequest = new AsyncReadRequest (this, true, buffer, offset, count); @@ -439,11 +319,6 @@ namespace Mono.Net.Security return task.Result; } - public void Write (byte[] buffer) - { - Write (buffer, 0, buffer.Length); - } - public override void Write (byte[] buffer, int offset, int count) { var asyncRequest = new AsyncWriteRequest (this, true, buffer, offset, count); diff --git a/mcs/class/System/Mono.Net.Security/MobileTlsContext.cs b/mcs/class/System/Mono.Net.Security/MobileTlsContext.cs index deeda5405a..7994f98c72 100644 --- a/mcs/class/System/Mono.Net.Security/MobileTlsContext.cs +++ b/mcs/class/System/Mono.Net.Security/MobileTlsContext.cs @@ -32,7 +32,7 @@ namespace Mono.Net.Security { abstract class MobileTlsContext : IDisposable { - ICertificateValidator2 certificateValidator; + ChainValidationHelper certificateValidator; protected MobileTlsContext (MobileAuthenticatedStream parent, MonoSslAuthenticationOptions options) { @@ -55,7 +55,7 @@ namespace Mono.Net.Security } } - certificateValidator = (ICertificateValidator2)ChainValidationHelper.GetInternalValidator ( + certificateValidator = ChainValidationHelper.GetInternalValidator ( parent.SslStream, parent.Provider, parent.Settings); } diff --git a/mcs/class/System/Mono.Net.Security/MobileTlsProvider.cs b/mcs/class/System/Mono.Net.Security/MobileTlsProvider.cs new file mode 100644 index 0000000000..8969a96bfc --- /dev/null +++ b/mcs/class/System/Mono.Net.Security/MobileTlsProvider.cs @@ -0,0 +1,48 @@ +#if SECURITY_DEP +#if MONO_SECURITY_ALIAS +extern alias MonoSecurity; +#endif + +#if MONO_SECURITY_ALIAS +using MonoSecurity::Mono.Security.Interface; +#else +using Mono.Security.Interface; +#endif + +using System; +using System.IO; +using System.Net.Security; +using System.Security.Cryptography.X509Certificates; + +namespace Mono.Net.Security +{ + abstract class MobileTlsProvider : MonoTlsProvider + { + public sealed override IMonoSslStream CreateSslStream ( + Stream innerStream, bool leaveInnerStreamOpen, + MonoTlsSettings settings = null) + { + return SslStream.CreateMonoSslStream (innerStream, leaveInnerStreamOpen, this, settings); + } + + internal abstract MobileAuthenticatedStream CreateSslStream ( + SslStream sslStream, Stream innerStream, bool leaveInnerStreamOpen, + MonoTlsSettings settings); + + /* + * If @serverMode is true, then we're a server and want to validate a certificate + * that we received from a client. + * + * On OS X and Mobile, the @chain will be initialized with the @certificates, but not actually built. + * + * Returns `true` if certificate validation has been performed and `false` to invoke the + * default system validator. + */ + internal abstract bool ValidateCertificate ( + ChainValidationHelper validator, string targetHost, bool serverMode, + X509CertificateCollection certificates, bool wantsChain, ref X509Chain chain, + ref SslPolicyErrors errors, ref int status11); + } +} + +#endif diff --git a/mcs/class/System/Mono.Net.Security/MonoTlsProviderFactory.cs b/mcs/class/System/Mono.Net.Security/MonoTlsProviderFactory.cs index c38752e060..21c3737c4e 100644 --- a/mcs/class/System/Mono.Net.Security/MonoTlsProviderFactory.cs +++ b/mcs/class/System/Mono.Net.Security/MonoTlsProviderFactory.cs @@ -70,7 +70,7 @@ namespace Mono.Net.Security * */ - internal static MSI.MonoTlsProvider GetProviderInternal () + internal static MobileTlsProvider GetProviderInternal () { lock (locker) { InitializeInternal (); @@ -88,7 +88,7 @@ namespace Mono.Net.Security InitializeProviderRegistration (); - MSI.MonoTlsProvider provider; + MobileTlsProvider provider; try { provider = CreateDefaultProviderImpl (); } catch (Exception ex) { @@ -123,18 +123,18 @@ namespace Mono.Net.Security static object locker = new object (); static bool initialized; - static MSI.MonoTlsProvider defaultProvider; + static MobileTlsProvider defaultProvider; /* * @providerRegistration maps provider names to a tuple containing its ID and full type name. * On non-reflection enabled systems (such as XI and XM), we can use the Guid to uniquely * identify the provider. * - * @providerCache maps the provider's Guid to the MSI.MonoTlsProvider instance. + * @providerCache maps the provider's Guid to the MobileTlsProvider instance. * */ static Dictionary> providerRegistration; - static Dictionary providerCache; + static Dictionary providerCache; #if !ONLY_APPLETLS && !MONOTOUCH && !XAMMAC static Type LookupProviderType (string name, bool throwOnError) @@ -155,7 +155,7 @@ namespace Mono.Net.Security } #endif - static MSI.MonoTlsProvider LookupProvider (string name, bool throwOnError) + static MobileTlsProvider LookupProvider (string name, bool throwOnError) { lock (locker) { InitializeProviderRegistration (); @@ -167,7 +167,7 @@ namespace Mono.Net.Security } // Check cache before doing the reflection lookup. - MSI.MonoTlsProvider provider; + MobileTlsProvider provider; if (providerCache.TryGetValue (entry.Item1, out provider)) return provider; @@ -177,7 +177,7 @@ namespace Mono.Net.Security throw new NotSupportedException (string.Format ("Could not find TLS Provider: `{0}'.", entry.Item2)); try { - provider = (MSI.MonoTlsProvider)Activator.CreateInstance (type, true); + provider = (MobileTlsProvider)Activator.CreateInstance (type, true); } catch (Exception ex) { throw new NotSupportedException (string.Format ("Unable to instantiate TLS Provider `{0}'.", type), ex); } @@ -214,7 +214,6 @@ namespace Mono.Net.Security internal static readonly Guid AppleTlsId = new Guid ("981af8af-a3a3-419a-9f01-a518e3a17c1c"); internal static readonly Guid BtlsId = new Guid ("432d18c9-9348-4b90-bfbf-9f2a10e1f15b"); - internal static readonly Guid LegacyId = new Guid ("809e77d5-56cc-4da8-b9f0-45e65ba9cceb"); static void InitializeProviderRegistration () { @@ -225,7 +224,7 @@ namespace Mono.Net.Security InitializeDebug (); providerRegistration = new Dictionary> (); - providerCache = new Dictionary (); + providerCache = new Dictionary (); PopulateProviders (); } @@ -238,34 +237,31 @@ namespace Mono.Net.Security var appleTlsEntry = new Tuple (AppleTlsId, typeof (Mono.AppleTls.AppleTlsProvider).FullName); providerRegistration.Add ("default", appleTlsEntry); + providerRegistration.Add ("legacy", appleTlsEntry); providerRegistration.Add ("apple", appleTlsEntry); } #elif MONODROID // TODO: Should be redundant static void PopulateProviders () { - var legacyEntry = new Tuple (LegacyId, typeof (Mono.Net.Security.LegacyTlsProvider).FullName); - - providerRegistration.Add ("legacy", legacyEntry); - - #if MONO_FEATURE_BTLS +#if MONO_FEATURE_BTLS var btlsEntry = new Tuple (BtlsId, typeof (Mono.Btls.MonoBtlsProvider).FullName); - if (btlsEntry != null) - providerRegistration.Add ("default", btlsEntry); - else - #endif - providerRegistration.Add ("default", legacyEntry); + providerRegistration.Add ("default", btlsEntry); + providerRegistration.Add ("legacy", btlsEntry); + providerRegistration.Add ("btls", btlsEntry); +#endif } #else static void PopulateProviders () { -#if MONO_FEATURE_APPLETLS - var appleTlsEntry = new Tuple (AppleTlsId, typeof (Mono.AppleTls.AppleTlsProvider).FullName); -#endif - var legacyEntry = new Tuple (LegacyId, typeof (Mono.Net.Security.LegacyTlsProvider).FullName); - providerRegistration.Add ("legacy", legacyEntry); - + Tuple appleTlsEntry = null; Tuple btlsEntry = null; + +#if MONO_FEATURE_APPLETLS + appleTlsEntry = new Tuple (AppleTlsId, typeof (Mono.AppleTls.AppleTlsProvider).FullName); + providerRegistration.Add ("apple", appleTlsEntry); +#endif + #if MONO_FEATURE_BTLS if (IsBtlsSupported ()) { btlsEntry = new Tuple (BtlsId, typeof (Mono.Btls.MonoBtlsProvider).FullName); @@ -273,21 +269,11 @@ namespace Mono.Net.Security } #endif -#if MONO_FEATURE_APPLETLS - if (Platform.IsMacOS) - providerRegistration.Add ("default", appleTlsEntry); - else -#endif -#if MONO_FEATURE_BTLS - if (btlsEntry != null) - providerRegistration.Add ("default", btlsEntry); - else -#endif - providerRegistration.Add ("default", legacyEntry); - -#if MONO_FEATURE_APPLETLS - providerRegistration.Add ("apple", appleTlsEntry); -#endif + var defaultEntry = appleTlsEntry ?? btlsEntry; + if (defaultEntry != null) { + providerRegistration.Add ("default", defaultEntry); + providerRegistration.Add ("legacy", defaultEntry); + } } #endif @@ -297,24 +283,22 @@ namespace Mono.Net.Security internal extern static bool IsBtlsSupported (); #endif - static MSI.MonoTlsProvider CreateDefaultProviderImpl () + static MobileTlsProvider CreateDefaultProviderImpl () { #if MONODROID - MSI.MonoTlsProvider provider = null; var type = Environment.GetEnvironmentVariable ("XA_TLS_PROVIDER"); switch (type) { +#if MONO_FEATURE_BTLS case null: case "default": case "legacy": - return new LegacyTlsProvider (); -#if MONO_FEATURE_BTLS case "btls": if (!IsBtlsSupported ()) throw new NotSupportedException ("BTLS in not supported!"); return new MonoBtlsProvider (); #endif default: - throw new NotSupportedException (string.Format ("Invalid TLS Provider: `{0}'.", provider)); + throw new NotSupportedException ($"Invalid TLS Provider: `{type}'."); } #elif ONLY_APPLETLS || MONOTOUCH || XAMMAC @@ -326,6 +310,7 @@ namespace Mono.Net.Security switch (type) { case "default": + case "legacy": #if MONO_FEATURE_APPLETLS if (Platform.IsMacOS) goto case "apple"; @@ -334,7 +319,7 @@ namespace Mono.Net.Security if (IsBtlsSupported ()) goto case "btls"; #endif - goto case "legacy"; + throw new NotSupportedException ("TLS Support not available."); #if MONO_FEATURE_APPLETLS case "apple": return new AppleTlsProvider (); @@ -343,8 +328,6 @@ namespace Mono.Net.Security case "btls": return new MonoBtlsProvider (); #endif - case "legacy": - return new Mono.Net.Security.LegacyTlsProvider (); } return LookupProvider (type, true); @@ -359,13 +342,9 @@ namespace Mono.Net.Security * Mono.Security.dll provides a public wrapper around these. */ - internal static MSI.MonoTlsProvider GetProvider () + internal static MobileTlsProvider GetProvider () { - var provider = GetProviderInternal (); - if (provider == null) - throw new NotSupportedException ("No TLS Provider available."); - - return provider; + return GetProviderInternal (); } internal static bool IsProviderSupported (string name) @@ -376,7 +355,7 @@ namespace Mono.Net.Security } } - internal static MSI.MonoTlsProvider GetProvider (string name) + internal static MobileTlsProvider GetProvider (string name) { return LookupProvider (name, false); } diff --git a/mcs/class/System/Mono.Net.Security/MonoTlsStream.cs b/mcs/class/System/Mono.Net.Security/MonoTlsStream.cs index 66e857644d..935df6acaf 100644 --- a/mcs/class/System/Mono.Net.Security/MonoTlsStream.cs +++ b/mcs/class/System/Mono.Net.Security/MonoTlsStream.cs @@ -53,7 +53,7 @@ namespace Mono.Net.Security class MonoTlsStream : IDisposable { #if SECURITY_DEP - readonly MonoTlsProvider provider; + readonly MobileTlsProvider provider; readonly NetworkStream networkStream; readonly HttpWebRequest request; @@ -63,9 +63,9 @@ namespace Mono.Net.Security get { return request; } } - IMonoSslStream sslStream; + SslStream sslStream; - internal IMonoSslStream SslStream { + internal SslStream SslStream { get { return sslStream; } } #else @@ -104,7 +104,7 @@ namespace Mono.Net.Security #if SECURITY_DEP var socket = networkStream.InternalSocket; WebConnection.Debug ($"MONO TLS STREAM CREATE STREAM: {socket.ID}"); - sslStream = provider.CreateSslStream (networkStream, false, settings); + sslStream = new SslStream (networkStream, false, provider, settings); try { var host = request.Host; @@ -121,7 +121,7 @@ namespace Mono.Net.Security status = WebExceptionStatus.Success; - request.ServicePoint.UpdateClientCertificate (sslStream.InternalLocalCertificate); + request.ServicePoint.UpdateClientCertificate (sslStream.LocalCertificate); } catch (Exception ex) { WebConnection.Debug ($"MONO TLS STREAM ERROR: {socket.ID} {socket.CleanedUp} {ex.Message}"); if (socket.CleanedUp) @@ -132,8 +132,7 @@ namespace Mono.Net.Security status = WebExceptionStatus.SecureChannelFailure; request.ServicePoint.UpdateClientCertificate (null); - sslStream.Dispose (); - sslStream = null; + CloseSslStream (); throw; } @@ -142,12 +141,11 @@ namespace Mono.Net.Security await sslStream.WriteAsync (tunnel.Data, 0, tunnel.Data.Length, cancellationToken).ConfigureAwait (false); } catch { status = WebExceptionStatus.SendFailure; - sslStream.Dispose (); - sslStream = null; + CloseSslStream (); throw; } - return sslStream.AuthenticatedStream; + return sslStream; #else throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); #endif @@ -155,6 +153,10 @@ namespace Mono.Net.Security public void Dispose () { + CloseSslStream (); + } + + void CloseSslStream () { if (sslStream != null) { sslStream.Dispose (); sslStream = null; diff --git a/mcs/class/System/Mono.Net.Security/NoReflectionHelper.cs b/mcs/class/System/Mono.Net.Security/NoReflectionHelper.cs index 7a440a4620..e5ef498196 100644 --- a/mcs/class/System/Mono.Net.Security/NoReflectionHelper.cs +++ b/mcs/class/System/Mono.Net.Security/NoReflectionHelper.cs @@ -96,7 +96,7 @@ namespace Mono.Net.Security internal static HttpWebRequest CreateHttpsRequest (Uri requestUri, object provider, object settings) { #if SECURITY_DEP - return new HttpWebRequest (requestUri, (MSI.MonoTlsProvider)provider, (MSI.MonoTlsSettings)settings); + return new HttpWebRequest (requestUri, (MobileTlsProvider)provider, (MSI.MonoTlsSettings)settings); #else throw new NotSupportedException (); #endif diff --git a/mcs/class/System/Mono/SystemCertificateProvider.cs b/mcs/class/System/Mono/SystemCertificateProvider.cs index e63b22d629..fe40196e28 100644 --- a/mcs/class/System/Mono/SystemCertificateProvider.cs +++ b/mcs/class/System/Mono/SystemCertificateProvider.cs @@ -89,7 +89,7 @@ namespace Mono return; #if MONO_FEATURE_BTLS || MONO_FEATURE_APPLETLS - provider = MonoTlsProviderFactory.GetProvider (); + provider = MonoTlsProviderFactory.GetProvider (); #endif x509pal = GetX509Pal (); } diff --git a/mcs/class/System/System.IO/FileSystemWatcher.cs b/mcs/class/System/System.IO/FileSystemWatcher.cs index 6d4f8b5234..cbf71e7a9a 100644 --- a/mcs/class/System/System.IO/FileSystemWatcher.cs +++ b/mcs/class/System/System.IO/FileSystemWatcher.cs @@ -42,7 +42,7 @@ using System.Threading.Tasks; namespace System.IO { [DefaultEvent("Changed")] [IODescription ("")] - public class FileSystemWatcher : Component, ISupportInitialize { + public partial class FileSystemWatcher : Component, ISupportInitialize { #region Fields diff --git a/mcs/class/System/System.IO/FileSystemWatcher.platformnotsupported.cs b/mcs/class/System/System.IO/FileSystemWatcher.platformnotsupported.cs new file mode 100644 index 0000000000..0386d4134c --- /dev/null +++ b/mcs/class/System/System.IO/FileSystemWatcher.platformnotsupported.cs @@ -0,0 +1,163 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel; +using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; +using System.IO.Enumeration; +using System.Threading; +using System.Threading.Tasks; + +namespace System.IO +{ + public partial class FileSystemWatcher : Component, ISupportInitialize + { + internal const string EXCEPTION_MESSAGE = "System.IO.FileSystemWatcher is not supported on the current platform."; + + public FileSystemWatcher () + { + throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); + } + + public FileSystemWatcher (string path) + { + throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); + } + + public FileSystemWatcher (string path, string filter) + { + throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); + } + + public NotifyFilters NotifyFilter + { + get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); } + set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); } + } + + public Collection Filters => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); + + public bool EnableRaisingEvents + { + get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); } + set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); } + } + + public string Filter + { + get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); } + set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); } + } + + public bool IncludeSubdirectories + { + get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); } + set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); } + } + + public int InternalBufferSize + { + get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); } + set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); } + } + + public string Path + { + get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); } + set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); } + } + + public event FileSystemEventHandler Changed + { + add { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); } + remove { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); } + } + + public event FileSystemEventHandler Created + { + add { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); } + remove { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); } + } + + public event FileSystemEventHandler Deleted + { + add { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); } + remove { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); } + } + + public event ErrorEventHandler Error + { + add { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); } + remove { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); } + } + + public event RenamedEventHandler Renamed + { + add { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); } + remove { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); } + } + + public WaitForChangedResult WaitForChanged (WatcherChangeTypes changeType) => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); + + public WaitForChangedResult WaitForChanged (WatcherChangeTypes changeType, int timeout) + { + throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); + } + + public override ISite Site + { + get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); } + set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); } + } + + public ISynchronizeInvoke SynchronizingObject + { + get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); } + set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); } + } + + public void BeginInit () + { + throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); + } + + public void EndInit () + { + throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); + } + + [SuppressMessage ("Microsoft.Security", "CA2109:ReviewVisibleEventHandlers", MessageId = "0#", Justification = "Changing from protected to private would be a breaking change")] + protected void OnChanged (FileSystemEventArgs e) + { + throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); + } + + [SuppressMessage ("Microsoft.Security", "CA2109:ReviewVisibleEventHandlers", MessageId = "0#", Justification = "Changing from protected to private would be a breaking change")] + protected void OnCreated (FileSystemEventArgs e) + { + throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); + } + + [SuppressMessage ("Microsoft.Security", "CA2109:ReviewVisibleEventHandlers", MessageId = "0#", Justification = "Changing from protected to private would be a breaking change")] + protected void OnDeleted(FileSystemEventArgs e) + { + throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); + } + + [SuppressMessage ("Microsoft.Security", "CA2109:ReviewVisibleEventHandlers", MessageId = "0#", Justification = "Changing from protected to private would be a breaking change")] + protected void OnError (ErrorEventArgs e) + { + throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); + } + + [SuppressMessage ("Microsoft.Security", "CA2109:ReviewVisibleEventHandlers", MessageId = "0#", Justification = "Changing from protected to private would be a breaking change")] + protected void OnRenamed (RenamedEventArgs e) + { + throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); + } + } +} \ No newline at end of file diff --git a/mcs/class/System/System.Net.Mail/SmtpClient.cs b/mcs/class/System/System.Net.Mail/SmtpClient.cs index 19197681a7..50937672a8 100644 --- a/mcs/class/System/System.Net.Mail/SmtpClient.cs +++ b/mcs/class/System/System.Net.Mail/SmtpClient.cs @@ -1167,10 +1167,10 @@ try { var tlsProvider = MonoTlsProviderFactory.GetProviderInternal (); var settings = MSI.MonoTlsSettings.CopyDefaultSettings (); settings.UseServicePointManagerCallback = true; - var sslStream = tlsProvider.CreateSslStream (stream, false, settings); + var sslStream = new SslStream (stream, false, tlsProvider, settings); CheckCancellation (); sslStream.AuthenticateAsClient (Host, this.ClientCertificates, SslProtocols.Default, false); - stream = sslStream.AuthenticatedStream; + stream = sslStream; #else throw new SystemException ("You are using an incomplete System.dll build"); diff --git a/mcs/class/System/System.Net.NetworkInformation/Win32IPGlobalProperties.cs b/mcs/class/System/System.Net.NetworkInformation/Win32IPGlobalProperties.cs index 49d9a2617d..22f9c0e7ed 100644 --- a/mcs/class/System/System.Net.NetworkInformation/Win32IPGlobalProperties.cs +++ b/mcs/class/System/System.Net.NetworkInformation/Win32IPGlobalProperties.cs @@ -38,8 +38,6 @@ namespace System.Net.NetworkInformation { public const int AF_INET = 2; public const int AF_INET6 = 23; - // FIXME: it might be getting wrong table. I'm getting - // different results from .NET 2.0. unsafe void FillTcpTable (out List tab4, out List tab6) { tab4 = new List (); @@ -305,16 +303,16 @@ namespace System.Net.NetworkInformation { { public TcpState State; public uint LocalAddr; - public int LocalPort; + public uint LocalPort; public uint RemoteAddr; - public int RemotePort; + public uint RemotePort; public IPEndPoint LocalEndPoint { - get { return new IPEndPoint (LocalAddr, LocalPort); } + get { return new IPEndPoint (LocalAddr, ntohs((ushort)LocalPort)); } } public IPEndPoint RemoteEndPoint { - get { return new IPEndPoint (RemoteAddr, RemotePort); } + get { return new IPEndPoint (RemoteAddr, ntohs((ushort)RemotePort)); } } public TcpConnectionInformation TcpInfo { @@ -328,17 +326,17 @@ namespace System.Net.NetworkInformation { public TcpState State; public Win32_IN6_ADDR LocalAddr; public uint LocalScopeId; - public int LocalPort; + public uint LocalPort; public Win32_IN6_ADDR RemoteAddr; public uint RemoteScopeId; - public int RemotePort; + public uint RemotePort; public IPEndPoint LocalEndPoint { - get { return new IPEndPoint (new IPAddress (LocalAddr.Bytes, LocalScopeId), LocalPort); } + get { return new IPEndPoint (new IPAddress (LocalAddr.Bytes, LocalScopeId), ntohs((ushort)LocalPort)); } } public IPEndPoint RemoteEndPoint { - get { return new IPEndPoint (new IPAddress (RemoteAddr.Bytes, RemoteScopeId), RemotePort); } + get { return new IPEndPoint (new IPAddress (RemoteAddr.Bytes, RemoteScopeId), ntohs((ushort)RemotePort)); } } public TcpConnectionInformation TcpInfo { @@ -362,10 +360,10 @@ namespace System.Net.NetworkInformation { { public Win32_IN6_ADDR LocalAddr; public uint LocalScopeId; - public int LocalPort; + public uint LocalPort; public IPEndPoint LocalEndPoint { - get { return new IPEndPoint (new IPAddress (LocalAddr.Bytes, LocalScopeId), LocalPort); } + get { return new IPEndPoint (new IPAddress (LocalAddr.Bytes, LocalScopeId), ntohs((ushort)LocalPort)); } } } } diff --git a/mcs/class/System/System.Net.Security/SslStream.cs b/mcs/class/System/System.Net.Security/SslStream.cs index 79b755b168..eb3110bc02 100644 --- a/mcs/class/System/System.Net.Security/SslStream.cs +++ b/mcs/class/System/System.Net.Security/SslStream.cs @@ -79,22 +79,20 @@ namespace System.Net.Security public class SslStream : AuthenticatedStream { #if SECURITY_DEP - MonoTlsProvider provider; + MNS.MobileTlsProvider provider; MonoTlsSettings settings; RemoteCertificateValidationCallback validationCallback; LocalCertificateSelectionCallback selectionCallback; + MNS.MobileAuthenticatedStream impl; bool explicitSettings; - IMonoSslStream impl; - internal IMonoSslStream Impl { + internal MNS.MobileAuthenticatedStream Impl { get { CheckDisposed (); return impl; } } - IMonoSslStream2 Impl2 => (IMonoSslStream2)Impl; - internal MonoTlsProvider Provider { get { CheckDisposed (); @@ -102,9 +100,16 @@ namespace System.Net.Security } } - static MonoTlsProvider GetProvider () + internal string InternalTargetHost { + get { + CheckDisposed (); + return impl.TargetHost; + } + } + + static MNS.MobileTlsProvider GetProvider () { - return MonoTlsProviderFactory.GetProvider (); + return (MNS.MobileTlsProvider)MonoTlsProviderFactory.GetProvider (); } public SslStream (Stream innerStream) @@ -117,7 +122,7 @@ namespace System.Net.Security { provider = GetProvider (); settings = MonoTlsSettings.CopyDefaultSettings (); - impl = provider.CreateSslStreamInternal (this, innerStream, leaveInnerStreamOpen, settings); + impl = provider.CreateSslStream (this, innerStream, leaveInnerStreamOpen, settings); } public SslStream (Stream innerStream, bool leaveInnerStreamOpen, RemoteCertificateValidationCallback userCertificateValidationCallback) @@ -132,7 +137,7 @@ namespace System.Net.Security settings = MonoTlsSettings.CopyDefaultSettings (); SetAndVerifyValidationCallback (userCertificateValidationCallback); SetAndVerifySelectionCallback (userCertificateSelectionCallback); - impl = provider.CreateSslStream (innerStream, leaveInnerStreamOpen, settings); + impl = provider.CreateSslStream (this, innerStream, leaveInnerStreamOpen, settings); } [MonoLimitation ("encryptionPolicy is ignored")] @@ -144,13 +149,13 @@ namespace System.Net.Security internal SslStream (Stream innerStream, bool leaveInnerStreamOpen, MonoTlsProvider provider, MonoTlsSettings settings) : base (innerStream, leaveInnerStreamOpen) { - this.provider = provider; + this.provider = (MNS.MobileTlsProvider)provider; this.settings = settings.Clone (); explicitSettings = true; - impl = provider.CreateSslStreamInternal (this, innerStream, leaveInnerStreamOpen, settings); + impl = this.provider.CreateSslStream (this, innerStream, leaveInnerStreamOpen, settings); } - internal static IMonoSslStream CreateMonoSslStream (Stream innerStream, bool leaveInnerStreamOpen, MonoTlsProvider provider, MonoTlsSettings settings) + internal static IMonoSslStream CreateMonoSslStream (Stream innerStream, bool leaveInnerStreamOpen, MNS.MobileTlsProvider provider, MonoTlsSettings settings) { var sslStream = new SslStream (innerStream, leaveInnerStreamOpen, provider, settings); return sslStream.Impl; @@ -198,12 +203,12 @@ namespace System.Net.Security public virtual void AuthenticateAsClient (string targetHost) { - Impl.AuthenticateAsClient (targetHost); + AuthenticateAsClient (targetHost, new X509CertificateCollection (), SecurityProtocol.SystemDefaultSecurityProtocols, false); } public virtual void AuthenticateAsClient (string targetHost, X509CertificateCollection clientCertificates, bool checkCertificateRevocation) { - Impl.AuthenticateAsClient (targetHost, clientCertificates, SecurityProtocol.SystemDefaultSecurityProtocols, checkCertificateRevocation); + AuthenticateAsClient (targetHost, clientCertificates, SecurityProtocol.SystemDefaultSecurityProtocols, checkCertificateRevocation); } public virtual void AuthenticateAsClient (string targetHost, X509CertificateCollection clientCertificates, SslProtocols enabledSslProtocols, bool checkCertificateRevocation) @@ -213,27 +218,28 @@ namespace System.Net.Security public virtual IAsyncResult BeginAuthenticateAsClient (string targetHost, AsyncCallback asyncCallback, object asyncState) { - return Impl.BeginAuthenticateAsClient (targetHost, asyncCallback, asyncState); + return BeginAuthenticateAsClient (targetHost, new X509CertificateCollection (), SecurityProtocol.SystemDefaultSecurityProtocols, false, asyncCallback, asyncState); } public virtual IAsyncResult BeginAuthenticateAsClient (string targetHost, X509CertificateCollection clientCertificates, bool checkCertificateRevocation, AsyncCallback asyncCallback, object asyncState) { - return Impl.BeginAuthenticateAsClient (targetHost, clientCertificates, SecurityProtocol.SystemDefaultSecurityProtocols, checkCertificateRevocation, asyncCallback, asyncState); + return BeginAuthenticateAsClient (targetHost, clientCertificates, SecurityProtocol.SystemDefaultSecurityProtocols, checkCertificateRevocation, asyncCallback, asyncState); } public virtual IAsyncResult BeginAuthenticateAsClient (string targetHost, X509CertificateCollection clientCertificates, SslProtocols enabledSslProtocols, bool checkCertificateRevocation, AsyncCallback asyncCallback, object asyncState) { - return Impl.BeginAuthenticateAsClient (targetHost, clientCertificates, enabledSslProtocols, checkCertificateRevocation, asyncCallback, asyncState); + var task = Impl.AuthenticateAsClientAsync (targetHost, clientCertificates, enabledSslProtocols, checkCertificateRevocation); + return TaskToApm.Begin (task, asyncCallback, asyncState); } public virtual void EndAuthenticateAsClient (IAsyncResult asyncResult) { - Impl.EndAuthenticateAsClient (asyncResult); + TaskToApm.End (asyncResult); } public virtual void AuthenticateAsServer (X509Certificate serverCertificate) { - Impl.AuthenticateAsServer (serverCertificate); + Impl.AuthenticateAsServer (serverCertificate, false, SecurityProtocol.SystemDefaultSecurityProtocols, false); } public virtual void AuthenticateAsServer (X509Certificate serverCertificate, bool clientCertificateRequired, bool checkCertificateRevocation) @@ -248,29 +254,30 @@ namespace System.Net.Security public virtual IAsyncResult BeginAuthenticateAsServer (X509Certificate serverCertificate, AsyncCallback asyncCallback, object asyncState) { - return Impl.BeginAuthenticateAsServer (serverCertificate, asyncCallback, asyncState); + return BeginAuthenticateAsServer (serverCertificate, false, SecurityProtocol.SystemDefaultSecurityProtocols, false, asyncCallback, asyncState); } public virtual IAsyncResult BeginAuthenticateAsServer (X509Certificate serverCertificate, bool clientCertificateRequired, bool checkCertificateRevocation, AsyncCallback asyncCallback, object asyncState) { - return Impl.BeginAuthenticateAsServer (serverCertificate, clientCertificateRequired, SecurityProtocol.SystemDefaultSecurityProtocols, checkCertificateRevocation, asyncCallback, asyncState); + return BeginAuthenticateAsServer (serverCertificate, clientCertificateRequired, SecurityProtocol.SystemDefaultSecurityProtocols, checkCertificateRevocation, asyncCallback, asyncState); } public virtual IAsyncResult BeginAuthenticateAsServer (X509Certificate serverCertificate, bool clientCertificateRequired, SslProtocols enabledSslProtocols, bool checkCertificateRevocation, AsyncCallback asyncCallback, object asyncState) { - return Impl.BeginAuthenticateAsServer (serverCertificate, clientCertificateRequired, enabledSslProtocols, checkCertificateRevocation, asyncCallback, asyncState); + var task = Impl.AuthenticateAsServerAsync (serverCertificate, clientCertificateRequired, enabledSslProtocols, checkCertificateRevocation); + return TaskToApm.Begin (task, asyncCallback, asyncState); } public virtual void EndAuthenticateAsServer (IAsyncResult asyncResult) { - Impl.EndAuthenticateAsServer (asyncResult); + TaskToApm.End (asyncResult); } public TransportContext TransportContext => null; public virtual Task AuthenticateAsClientAsync (string targetHost) { - return Impl.AuthenticateAsClientAsync (targetHost); + return Impl.AuthenticateAsClientAsync (targetHost, new X509CertificateCollection (), SecurityProtocol.SystemDefaultSecurityProtocols, false); } public virtual Task AuthenticateAsClientAsync (string targetHost, X509CertificateCollection clientCertificates, bool checkCertificateRevocation) @@ -287,12 +294,12 @@ namespace System.Net.Security { SetAndVerifyValidationCallback (sslClientAuthenticationOptions.RemoteCertificateValidationCallback); SetAndVerifySelectionCallback (sslClientAuthenticationOptions.LocalCertificateSelectionCallback); - return Impl2.AuthenticateAsClientAsync (new MNS.MonoSslClientAuthenticationOptions (sslClientAuthenticationOptions), cancellationToken); + return Impl.AuthenticateAsClientAsync (new MNS.MonoSslClientAuthenticationOptions (sslClientAuthenticationOptions), cancellationToken); } public virtual Task AuthenticateAsServerAsync (X509Certificate serverCertificate) { - return Impl.AuthenticateAsServerAsync (serverCertificate); + return Impl.AuthenticateAsServerAsync (serverCertificate, false, SecurityProtocol.SystemDefaultSecurityProtocols, false); } public virtual Task AuthenticateAsServerAsync (X509Certificate serverCertificate, bool clientCertificateRequired, bool checkCertificateRevocation) @@ -307,7 +314,7 @@ namespace System.Net.Security public Task AuthenticateAsServerAsync (SslServerAuthenticationOptions sslServerAuthenticationOptions, CancellationToken cancellationToken) { - return Impl2.AuthenticateAsServerAsync (CreateAuthenticationOptions (sslServerAuthenticationOptions), cancellationToken); + return Impl.AuthenticateAsServerAsync (CreateAuthenticationOptions (sslServerAuthenticationOptions), cancellationToken); } public virtual Task ShutdownAsync () @@ -471,27 +478,16 @@ namespace System.Net.Security Impl.Write (buffer, offset, count); } - // [HostProtection (ExternalThreading=true)] - public override IAsyncResult BeginRead (byte[] buffer, int offset, int count, AsyncCallback asyncCallback, object asyncState) + public override Task ReadAsync (byte[] buffer, int offset, int count, CancellationToken cancellationToken) { - return Impl.BeginRead (buffer, offset, count, asyncCallback, asyncState); + return Impl.ReadAsync (buffer, offset, count, cancellationToken); } - public override int EndRead (IAsyncResult asyncResult) + public override Task WriteAsync (byte[] buffer, int offset, int count, CancellationToken cancellationToken) { - return Impl.EndRead (asyncResult); + return Impl.WriteAsync (buffer, offset, count, cancellationToken); } - // [HostProtection (ExternalThreading=true)] - public override IAsyncResult BeginWrite (byte[] buffer, int offset, int count, AsyncCallback asyncCallback, object asyncState) - { - return Impl.BeginWrite (buffer, offset, count, asyncCallback, asyncState); - } - - public override void EndWrite (IAsyncResult asyncResult) - { - Impl.EndWrite (asyncResult); - } #else // !SECURITY_DEP const string EXCEPTION_MESSAGE = "System.Net.Security.SslStream is not supported on the current platform."; diff --git a/mcs/class/System/System.Net.Sockets/Socket.cs b/mcs/class/System/System.Net.Sockets/Socket.cs index 22b88e57e8..985075412f 100644 --- a/mcs/class/System/System.Net.Sockets/Socket.cs +++ b/mcs/class/System/System.Net.Sockets/Socket.cs @@ -608,15 +608,15 @@ namespace System.Net.Sockets throw new InvalidOperationException ("No operation in progress"); try { - e.AcceptSocket = e.current_socket.EndAccept (ares); + e.AcceptSocket = e.CurrentSocket.EndAccept (ares); } catch (SocketException ex) { e.SocketError = ex.SocketErrorCode; } catch (ObjectDisposedException) { e.SocketError = SocketError.OperationAborted; } finally { if (e.AcceptSocket == null) - e.AcceptSocket = new Socket (e.current_socket.AddressFamily, e.current_socket.SocketType, e.current_socket.ProtocolType, null); - e.Complete (); + e.AcceptSocket = new Socket (e.CurrentSocket.AddressFamily, e.CurrentSocket.SocketType, e.CurrentSocket.ProtocolType, null); + e.Complete_internal (); } }); @@ -740,7 +740,7 @@ namespace System.Net.Sockets sockares.CheckIfThrowDelayedException (); - buffer = sockares.Buffer; + buffer = sockares.Buffer.ToArray (); bytesTransferred = sockares.Total; return sockares.AcceptedSocket; @@ -959,7 +959,7 @@ namespace System.Net.Sockets * * Note that we're not calling `e.Complete ()` (or resetting `e.in_progress`) here. */ - e.current_socket.EndConnect (ares); + e.CurrentSocket.EndConnect (ares); } return pending; @@ -979,7 +979,7 @@ namespace System.Net.Sockets throw new ArgumentNullException("e"); if (e.in_progress != 0 && e.LastOperation == SocketAsyncOperation.Connect) - e.current_socket?.Close (); + e.CurrentSocket?.Close (); } static AsyncCallback ConnectAsyncCallback = new AsyncCallback (ares => { @@ -989,13 +989,13 @@ namespace System.Net.Sockets throw new InvalidOperationException ("No operation in progress"); try { - e.current_socket.EndConnect (ares); + e.CurrentSocket.EndConnect (ares); } catch (SocketException se) { e.SocketError = se.SocketErrorCode; } catch (ObjectDisposedException) { e.SocketError = SocketError.OperationAborted; } finally { - e.Complete (); + e.Complete_internal (); } }); @@ -1254,7 +1254,7 @@ namespace System.Net.Sockets Array.Resize (ref addresses, last_valid); return true; } else { - e.ConnectByNameError = null; + e.SetConnectByNameError (null); return false; } } @@ -1307,13 +1307,13 @@ namespace System.Net.Sockets throw new InvalidOperationException ("No operation in progress"); try { - e.current_socket.EndDisconnect (ares); + e.CurrentSocket.EndDisconnect (ares); } catch (SocketException ex) { e.SocketError = ex.SocketErrorCode; } catch (ObjectDisposedException) { e.SocketError = SocketError.OperationAborted; } finally { - e.Complete (); + e.Complete_internal (); } }); @@ -1399,6 +1399,29 @@ namespace System.Net.Sockets return ret; } + int Receive (Memory buffer, int offset, int size, SocketFlags socketFlags, out SocketError errorCode) + { + ThrowIfDisposedAndClosed (); + + int nativeError; + int ret; + unsafe { + using (var handle = buffer.Slice (offset, size).Pin ()) { + ret = Receive_internal (m_Handle, (byte*)handle.Pointer, size, socketFlags, out nativeError, is_blocking); + } + } + + errorCode = (SocketError) nativeError; + if (errorCode != SocketError.Success && errorCode != SocketError.WouldBlock && errorCode != SocketError.InProgress) { + is_connected = false; + is_bound = false; + } else { + is_connected = true; + } + + return ret; + } + [CLSCompliant (false)] public int Receive (IList> buffers, SocketFlags socketFlags, out SocketError errorCode) { @@ -1477,10 +1500,10 @@ namespace System.Net.Sockets // LAME SPEC: the ArgumentException is never thrown, instead an NRE is // thrown when e.Buffer and e.BufferList are null (works fine when one is // set to a valid object) - if (e.Buffer == null && e.BufferList == null) + if (e.MemoryBuffer.Equals (default) && e.BufferList == null) throw new NullReferenceException ("Either e.Buffer or e.BufferList must be valid buffers."); - if (e.Buffer == null) { + if (e.BufferList != null) { InitSocketAsyncEventArgs (e, ReceiveAsyncCallback, e, SocketOperation.ReceiveGeneric); e.socket_async_result.Buffers = e.BufferList; @@ -1489,7 +1512,7 @@ namespace System.Net.Sockets } else { InitSocketAsyncEventArgs (e, ReceiveAsyncCallback, e, SocketOperation.Receive); - e.socket_async_result.Buffer = e.Buffer; + e.socket_async_result.Buffer = e.MemoryBuffer; e.socket_async_result.Offset = e.Offset; e.socket_async_result.Size = e.Count; @@ -1506,13 +1529,13 @@ namespace System.Net.Sockets throw new InvalidOperationException ("No operation in progress"); try { - e.BytesTransferred = e.current_socket.EndReceive (ares); + e.SetBytesTransferred (e.CurrentSocket.EndReceive (ares)); } catch (SocketException se){ e.SocketError = se.SocketErrorCode; } catch (ObjectDisposedException) { e.SocketError = SocketError.OperationAborted; } finally { - e.Complete (); + e.Complete_internal (); } }); @@ -1545,8 +1568,8 @@ namespace System.Net.Sockets try { unsafe { - fixed (byte* pbuffer = sockares.Buffer) { - total = Receive_internal (sockares.socket.m_Handle, &pbuffer[sockares.Offset], sockares.Size, sockares.SockFlags, out sockares.error, sockares.socket.is_blocking); + using (var pbuffer = sockares.Buffer.Slice (sockares.Offset, sockares.Size).Pin ()) { + total = Receive_internal (sockares.socket.m_Handle, (byte*)pbuffer.Pointer, sockares.Size, sockares.SockFlags, out sockares.error, sockares.socket.is_blocking); } } } catch (Exception e) { @@ -1700,6 +1723,44 @@ namespace System.Net.Sockets return cnt; } + int ReceiveFrom (Memory buffer, int offset, int size, SocketFlags socketFlags, ref EndPoint remoteEP, out SocketError errorCode) + { + SocketAddress sockaddr = remoteEP.Serialize(); + + int nativeError; + int cnt; + unsafe { + using (var handle = buffer.Slice (offset, size).Pin ()) { + cnt = ReceiveFrom_internal (m_Handle, (byte*)handle.Pointer, size, socketFlags, ref sockaddr, out nativeError, is_blocking); + } + } + + errorCode = (SocketError) nativeError; + if (errorCode != SocketError.Success) { + if (errorCode != SocketError.WouldBlock && errorCode != SocketError.InProgress) { + is_connected = false; + } else if (errorCode == SocketError.WouldBlock && is_blocking) { // This might happen when ReceiveTimeout is set + errorCode = SocketError.TimedOut; + } + + return 0; + } + + is_connected = true; + is_bound = true; + + /* If sockaddr is null then we're a connection oriented protocol and should ignore the + * remoteEP parameter (see MSDN documentation for Socket.ReceiveFrom(...) ) */ + if (sockaddr != null) { + /* Stupidly, EndPoint.Create() is an instance method */ + remoteEP = remoteEP.Create (sockaddr); + } + + seed_endpoint = remoteEP; + + return cnt; + } + public bool ReceiveFromAsync (SocketAsyncEventArgs e) { ThrowIfDisposedAndClosed (); @@ -1730,13 +1791,13 @@ namespace System.Net.Sockets throw new InvalidOperationException ("No operation in progress"); try { - e.BytesTransferred = e.current_socket.EndReceiveFrom (ares, ref e.remote_ep); + e.SetBytesTransferred (e.CurrentSocket.EndReceiveFrom_internal ((SocketAsyncResult)ares, e)); } catch (SocketException ex) { e.SocketError = ex.SocketErrorCode; } catch (ObjectDisposedException) { e.SocketError = SocketError.OperationAborted; } finally { - e.Complete (); + e.Complete_internal (); } }); @@ -1801,7 +1862,20 @@ namespace System.Net.Sockets return sockares.Total; } + int EndReceiveFrom_internal (SocketAsyncResult sockares, SocketAsyncEventArgs ares) + { + ThrowIfDisposedAndClosed (); + if (Interlocked.CompareExchange (ref sockares.EndCalled, 1, 0) == 1) + throw new InvalidOperationException ("EndReceiveFrom can only be called once per asynchronous operation"); + + if (!sockares.IsCompleted) + sockares.AsyncWaitHandle.WaitOne (); + + sockares.CheckIfThrowDelayedException (); + ares.RemoteEndPoint = sockares.EndPoint; + return sockares.Total; + } static unsafe int ReceiveFrom_internal (SafeSocketHandle safeHandle, byte* buffer, int count, SocketFlags flags, ref SocketAddress sockaddr, out int error, bool blocking) { @@ -1967,10 +2041,10 @@ namespace System.Net.Sockets ThrowIfDisposedAndClosed (); - if (e.Buffer == null && e.BufferList == null) + if (e.MemoryBuffer.Equals (default) && e.BufferList == null) throw new NullReferenceException ("Either e.Buffer or e.BufferList must be valid buffers."); - if (e.Buffer == null) { + if (e.BufferList != null) { InitSocketAsyncEventArgs (e, SendAsyncCallback, e, SocketOperation.SendGeneric); e.socket_async_result.Buffers = e.BufferList; @@ -1979,7 +2053,7 @@ namespace System.Net.Sockets } else { InitSocketAsyncEventArgs (e, SendAsyncCallback, e, SocketOperation.Send); - e.socket_async_result.Buffer = e.Buffer; + e.socket_async_result.Buffer = e.MemoryBuffer; e.socket_async_result.Offset = e.Offset; e.socket_async_result.Size = e.Count; @@ -1996,13 +2070,13 @@ namespace System.Net.Sockets throw new InvalidOperationException ("No operation in progress"); try { - e.BytesTransferred = e.current_socket.EndSend (ares); + e.SetBytesTransferred (e.CurrentSocket.EndSend (ares)); } catch (SocketException se){ e.SocketError = se.SocketErrorCode; } catch (ObjectDisposedException) { e.SocketError = SocketError.OperationAborted; } finally { - e.Complete (); + e.Complete_internal (); } }); @@ -2037,8 +2111,8 @@ namespace System.Net.Sockets try { unsafe { - fixed (byte *pbuffer = sockares.Buffer) { - total = Socket.Send_internal (sockares.socket.m_Handle, &pbuffer[sockares.Offset], sockares.Size, sockares.SockFlags, out sockares.error, false); + using (var pbuffer = sockares.Buffer.Slice (sockares.Offset, sockares.Size).Pin ()) { + total = Socket.Send_internal (sockares.socket.m_Handle, (byte*)pbuffer.Pointer, sockares.Size, sockares.SockFlags, out sockares.error, false); } } } catch (Exception e) { @@ -2189,6 +2263,35 @@ namespace System.Net.Sockets return ret; } + int SendTo (Memory buffer, int offset, int size, SocketFlags socketFlags, EndPoint remoteEP) + { + ThrowIfDisposedAndClosed (); + + if (remoteEP == null) + throw new ArgumentNullException("remoteEP"); + + int error; + int ret; + unsafe { + using (var pbuffer = buffer.Slice (offset, size).Pin ()) { + ret = SendTo_internal (m_Handle, (byte*)pbuffer.Pointer, size, socketFlags, remoteEP.Serialize (), out error, is_blocking); + } + } + + SocketError err = (SocketError) error; + if (err != 0) { + if (err != SocketError.WouldBlock && err != SocketError.InProgress) + is_connected = false; + throw new SocketException (error); + } + + is_connected = true; + is_bound = true; + seed_endpoint = remoteEP; + + return ret; + } + public bool SendToAsync (SocketAsyncEventArgs e) { // NO check is made whether e != null in MS.NET (NRE is thrown in such case) @@ -2220,13 +2323,13 @@ namespace System.Net.Sockets throw new InvalidOperationException ("No operation in progress"); try { - e.BytesTransferred = e.current_socket.EndSendTo (ares); + e.SetBytesTransferred (e.CurrentSocket.EndSendTo (ares)); } catch (SocketException ex) { e.SocketError = ex.SocketErrorCode; } catch (ObjectDisposedException) { e.SocketError = SocketError.OperationAborted; } finally { - e.Complete (); + e.Complete_internal (); } }); @@ -2857,10 +2960,10 @@ namespace System.Net.Sockets if (e.AcceptSocket != null) { e.socket_async_result.AcceptSocket = e.AcceptSocket; } - e.current_socket = this; + e.SetCurrentSocket (this); e.SetLastOperation (SocketOperationToSocketAsyncOperation (operation)); e.SocketError = SocketError.Success; - e.BytesTransferred = 0; + e.SetBytesTransferred (0); } SocketAsyncOperation SocketOperationToSocketAsyncOperation (SocketOperation op) diff --git a/mcs/class/System/System.Net.Sockets/SocketAsyncEventArgs.cs b/mcs/class/System/System.Net.Sockets/SocketAsyncEventArgs.cs index 6d22d76de5..69510e35eb 100644 --- a/mcs/class/System/System.Net.Sockets/SocketAsyncEventArgs.cs +++ b/mcs/class/System/System.Net.Sockets/SocketAsyncEventArgs.cs @@ -36,19 +36,19 @@ using System.Threading; namespace System.Net.Sockets { - public class SocketAsyncEventArgs : EventArgs, IDisposable + public partial class SocketAsyncEventArgs : EventArgs, IDisposable { bool disposed; internal volatile int in_progress; - internal EndPoint remote_ep; - internal Socket current_socket; + EndPoint remote_ep; + Socket current_socket; internal SocketAsyncResult socket_async_result = new SocketAsyncResult (); public Exception ConnectByNameError { get; - internal set; + private set; } public Socket AcceptSocket { @@ -56,31 +56,9 @@ namespace System.Net.Sockets set; } - public byte[] Buffer { - get; - private set; - } - - public Memory MemoryBuffer => Buffer; - - internal IList> m_BufferList; - public IList> BufferList { - get { return m_BufferList; } - set { - if (Buffer != null && value != null) - throw new ArgumentException ("Buffer and BufferList properties cannot both be non-null."); - m_BufferList = value; - } - } - public int BytesTransferred { get; - internal set; - } - - public int Count { - get; - internal set; + private set; } public bool DisconnectReuseSocket { @@ -93,11 +71,6 @@ namespace System.Net.Sockets private set; } - public int Offset { - get; - private set; - } - public EndPoint RemoteEndPoint { get { return remote_ep; } set { remote_ep = value; } @@ -150,24 +123,17 @@ namespace System.Net.Sockets } } - internal bool PolicyRestricted { - get; - private set; - } - public event EventHandler Completed; - internal SocketAsyncEventArgs (bool policy) - : this () - { - PolicyRestricted = policy; - } - public SocketAsyncEventArgs () { SendPacketsSendSize = -1; } + internal SocketAsyncEventArgs (bool flowExecutionContext) + { + } + ~SocketAsyncEventArgs () { Dispose (false); @@ -187,6 +153,25 @@ namespace System.Net.Sockets GC.SuppressFinalize (this); } + internal void SetConnectByNameError (Exception error) + { + ConnectByNameError = error; + } + + internal void SetBytesTransferred (int value) + { + BytesTransferred = value; + } + + internal Socket CurrentSocket { + get { return current_socket; } + } + + internal void SetCurrentSocket (Socket socket) + { + current_socket = socket; + } + internal void SetLastOperation (SocketAsyncOperation op) { if (disposed) @@ -197,7 +182,7 @@ namespace System.Net.Sockets LastOperation = op; } - internal void Complete () + internal void Complete_internal () { in_progress = 0; OnCompleted (this); @@ -213,43 +198,6 @@ namespace System.Net.Sockets handler (e.current_socket, e); } - internal void CopyBufferFrom (SocketAsyncEventArgs source) - { - Buffer = source.Buffer; - Offset = source.Offset; - Count = source.Count; - } - - public void SetBuffer (int offset, int count) - { - SetBuffer (Buffer, offset, count); - } - - public void SetBuffer (byte[] buffer, int offset, int count) - { - if (buffer != null) { - if (BufferList != null) - throw new ArgumentException ("Buffer and BufferList properties cannot both be non-null."); - - int buflen = buffer.Length; - if (offset < 0 || (offset != 0 && offset >= buflen)) - throw new ArgumentOutOfRangeException ("offset"); - - if (count < 0 || count > buflen - offset) - throw new ArgumentOutOfRangeException ("count"); - - Count = count; - Offset = offset; - } - - Buffer = buffer; - } - - public void SetBuffer(Memory buffer) - { - SetBuffer(buffer.ToArray(), 0, buffer.Length); - } - internal void StartOperationCommon (Socket socket) { current_socket = socket; @@ -269,7 +217,7 @@ namespace System.Net.Sockets if (current_socket != null) current_socket.is_connected = false; - Complete (); + Complete_internal (); } internal void FinishOperationAsyncFailure (Exception exception, int bytesTransferred, SocketFlags flags) @@ -279,7 +227,7 @@ namespace System.Net.Sockets if (current_socket != null) current_socket.is_connected = false; - Complete (); + Complete_internal (); } internal void FinishWrapperConnectSuccess (Socket connectSocket, int bytesTransferred, SocketFlags flags) @@ -287,7 +235,7 @@ namespace System.Net.Sockets SetResults(SocketError.Success, bytesTransferred, flags); current_socket = connectSocket; - Complete (); + Complete_internal (); } internal void SetResults (SocketError socketError, int bytesTransferred, SocketFlags flags) diff --git a/mcs/class/System/System.Net.Sockets/SocketAsyncResult.cs b/mcs/class/System/System.Net.Sockets/SocketAsyncResult.cs index 4004e47585..99c940d4af 100644 --- a/mcs/class/System/System.Net.Sockets/SocketAsyncResult.cs +++ b/mcs/class/System/System.Net.Sockets/SocketAsyncResult.cs @@ -43,7 +43,7 @@ namespace System.Net.Sockets Exception DelayedException; public EndPoint EndPoint; // Connect,ReceiveFrom,SendTo - public byte [] Buffer; // Receive,ReceiveFrom,Send,SendTo + public Memory Buffer; // Receive,ReceiveFrom,Send,SendTo public int Offset; // Receive,ReceiveFrom,Send,SendTo public int Size; // Receive,ReceiveFrom,Send,SendTo public SocketFlags SockFlags; // Receive,ReceiveFrom,Send,SendTo diff --git a/mcs/class/System/System.Net/HttpWebRequest.cs b/mcs/class/System/System.Net/HttpWebRequest.cs index 9a305810d0..75982d033d 100644 --- a/mcs/class/System/System.Net/HttpWebRequest.cs +++ b/mcs/class/System/System.Net/HttpWebRequest.cs @@ -114,7 +114,7 @@ namespace System.Net static RequestCachePolicy defaultCachePolicy; int readWriteTimeout = 300000; // ms #if SECURITY_DEP - MonoTlsProvider tlsProvider; + MobileTlsProvider tlsProvider; MonoTlsSettings tlsSettings; #endif ServerCertValidationCallback certValidationCallback; @@ -166,7 +166,7 @@ namespace System.Net } #if SECURITY_DEP - internal HttpWebRequest (Uri uri, MonoTlsProvider tlsProvider, MonoTlsSettings settings = null) + internal HttpWebRequest (Uri uri, MobileTlsProvider tlsProvider, MonoTlsSettings settings = null) : this (uri) { this.tlsProvider = tlsProvider; @@ -265,7 +265,7 @@ namespace System.Net } #if SECURITY_DEP - internal MonoTlsProvider TlsProvider { + internal MobileTlsProvider TlsProvider { get { return tlsProvider; } } diff --git a/mcs/class/System/System.Net/ServicePoint.cs b/mcs/class/System/System.Net/ServicePoint.cs index 4e59aa3537..2a501abcf8 100644 --- a/mcs/class/System/System.Net/ServicePoint.cs +++ b/mcs/class/System/System.Net/ServicePoint.cs @@ -392,11 +392,6 @@ namespace System.Net return true; } } - - internal Socket GetConnection(PooledStream PooledStream, object owner, bool async, out IPAddress address, ref Socket abortSocket, ref Socket abortSocket6) - { - throw new NotImplementedException (); - } } } diff --git a/mcs/class/System/System.Net/ServicePoint.platformnotsupported.cs b/mcs/class/System/System.Net/ServicePoint.platformnotsupported.cs index d744a55644..3380a29c65 100644 --- a/mcs/class/System/System.Net/ServicePoint.platformnotsupported.cs +++ b/mcs/class/System/System.Net/ServicePoint.platformnotsupported.cs @@ -117,11 +117,5 @@ namespace System.Net public X509Certificate ClientCertificate { get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); } } - - // For reference source - internal Socket GetConnection(PooledStream PooledStream, object owner, bool async, out IPAddress address, ref Socket abortSocket, ref Socket abortSocket6) - { - throw new NotImplementedException (); - } } } diff --git a/mcs/class/System/System.Net/WebConnection.cs b/mcs/class/System/System.Net/WebConnection.cs index 5fd7e013a9..a6e6daf20a 100644 --- a/mcs/class/System/System.Net/WebConnection.cs +++ b/mcs/class/System/System.Net/WebConnection.cs @@ -166,7 +166,21 @@ namespace System.Net } else { try { operation.ThrowIfDisposed (cancellationToken); - await socket.ConnectAsync (remote).ConfigureAwait (false); + + /* + * Socket.Tasks.cs from CoreFX introduces a new internal + * BeginConnect(EndPoint) overload, which will replace + * the one we're using from SocketTaskExtensions.cs. + * + * Our implementation of Socket.BeginConnect() does not + * invoke the callback when the request failed synchronously. + * + * Explicitly use our implementation from SocketTaskExtensions.cs here. + */ + await Task.Factory.FromAsync ( + (targetEndPoint, callback, state) => ((Socket)state).BeginConnect (targetEndPoint, callback, state), + asyncResult => ((Socket)asyncResult.AsyncState).EndConnect (asyncResult), + remote, socket).ConfigureAwait (false); } catch (ObjectDisposedException) { throw; } catch (Exception exc) { diff --git a/mcs/class/System/System_xtest.dll.sources b/mcs/class/System/System_xtest.dll.sources index d8e567ddf4..5e3b7e6c52 100644 --- a/mcs/class/System/System_xtest.dll.sources +++ b/mcs/class/System/System_xtest.dll.sources @@ -1,6 +1,7 @@ ../test-helpers/Configuration.Http.cs ../test-helpers/Configuration.Certificates.cs ../test-helpers/TestConfiguration.cs +../test-helpers/NetworkStreamHelper.cs ../../../external/corefx/src/Common/tests/System/Threading/Tasks/TaskTimeoutExtensions.cs @@ -96,6 +97,8 @@ System/RemoteExecutorTests.cs ../../../external/corefx/src/Common/tests/System/Net/Sockets/SocketTestServerAPM.cs ../../../external/corefx/src/Common/tests/System/Net/Sockets/SocketTestServerAsync.cs ../../../external/corefx/src/Common/tests/System/Net/Sockets/TestSettings.cs +../../../external/corefx/src/System.Net.Sockets/tests/FunctionalTests/NetworkStreamTest.cs +../../../external/corefx/src/System.Net.Sockets/tests/FunctionalTests/NetworkStreamTest.netcoreapp.cs #../../../external/corefx/src/System.Net.Sockets/tests/FunctionalTests/*.cs:NetworkStreamTest.netcoreapp.cs,SocketTestHelper.netcoreapp.cs,SendReceive.netcoreapp.cs,SocketAsyncEventArgsTest.cs,LoggingTest.cs,SendReceive.cs # System.Net.Primitives diff --git a/mcs/class/System/Test/System.Collections.Concurrent/BlockingCollectionTests.cs b/mcs/class/System/Test/System.Collections.Concurrent/BlockingCollectionTests.cs index 5c43555619..aa4b71c712 100644 --- a/mcs/class/System/Test/System.Collections.Concurrent/BlockingCollectionTests.cs +++ b/mcs/class/System/Test/System.Collections.Concurrent/BlockingCollectionTests.cs @@ -250,6 +250,7 @@ namespace MonoTests.System.Collections.Concurrent } [Test, ExpectedException (typeof(OperationCanceledException))] + [Category ("MultiThreaded")] public void BoundedAddLimit () { const int elNumber = 5; diff --git a/mcs/class/System/Test/System.Collections.Concurrent/ConcurrentBagTests.cs b/mcs/class/System/Test/System.Collections.Concurrent/ConcurrentBagTests.cs index af23b5137b..223c5207db 100644 --- a/mcs/class/System/Test/System.Collections.Concurrent/ConcurrentBagTests.cs +++ b/mcs/class/System/Test/System.Collections.Concurrent/ConcurrentBagTests.cs @@ -241,12 +241,14 @@ namespace MonoTests.System.Collections.Concurrent } [Test] + [Category("MultiThreaded")] public void AddStressTest () { CollectionStressTestHelper.AddStressTest (bag); } [Test] + [Category("MultiThreaded")] public void RemoveStressTest () { CollectionStressTestHelper.RemoveStressTest (bag, CheckOrderingType.DontCare); diff --git a/mcs/class/System/Test/System.IO/FileSystemWatcherTest.cs b/mcs/class/System/Test/System.IO/FileSystemWatcherTest.cs index fdd7cf3b4d..5e1a2b7303 100644 --- a/mcs/class/System/Test/System.IO/FileSystemWatcherTest.cs +++ b/mcs/class/System/Test/System.IO/FileSystemWatcherTest.cs @@ -129,18 +129,25 @@ namespace MonoTests.System.IO Assert.IsNotNull (watcherHandleField); var proxyType = typeof (FileSystemWatcher).Assembly.GetType ("System.IO.CoreFXFileSystemWatcherProxy"); Assert.IsNotNull (proxyType); + // the "internal_map" maps watcher handles to backend CoreFX FSW instances + var proxyTypeInternalMapField = proxyType.GetField ("internal_map", BindingFlags.Static | BindingFlags.NonPublic); + Assert.IsNotNull (proxyTypeInternalMapField); var fsw1 = new FileSystemWatcher (tmp.Path, "*"); var fsw2 = new FileSystemWatcher (tmp.Path, "*"); + // at this point watcher and watcher_handle should be set + global::System.Collections.Generic.IDictionary internal_map = null; object handle1 = null; object handle2 = null; // using "using" to ensure that Dispose gets called even if we throw an exception using (var fsw11 = fsw1) using (var fsw22 = fsw2) { - // at this point watcher and watcher_handle should be set + // Once at least one FSW is initialized, watcher should be set. But if the + // wrong backend is getting used, ignore this test because the other checks + // (internal_map in particular) won't be valid. var watcher = watcherField.GetValue (fsw1); Assert.IsNotNull (watcher); if (!proxyType.IsAssignableFrom (watcher.GetType ())) @@ -152,6 +159,17 @@ namespace MonoTests.System.IO Assert.IsNotNull (handle1); Assert.IsNotNull (handle2); + // Can't check for internal_map earlier - it is lazily created when the first + // FSW instance is created + internal_map = proxyTypeInternalMapField.GetValue (null) + as global::System.Collections.Generic.IDictionary; + Assert.IsNotNull (internal_map); + + // Both of handles should be in the internal map while the file system watchers + // are not disposed. + Assert.IsTrue (internal_map.ContainsKey (handle1)); + Assert.IsTrue (internal_map.ContainsKey (handle2)); + } // Dispose was called, now watcher_handle should be null @@ -159,14 +177,6 @@ namespace MonoTests.System.IO Assert.IsNull (watcherHandleField.GetValue (fsw1)); Assert.IsNull (watcherHandleField.GetValue (fsw2)); - // and moreover, the CoreFXFileSystemWatcherProxy shouldn't have entries for either handle1 or handle2 - - var proxyTypeInternalMapField = proxyType.GetField ("internal_map", BindingFlags.Static | BindingFlags.NonPublic); - Assert.IsNotNull (proxyTypeInternalMapField); - var internal_map = proxyTypeInternalMapField.GetValue (null) - as global::System.Collections.Generic.IDictionary; - Assert.IsNotNull (internal_map); - // This pair are the critical checks: after we call Dispose on fsw1 and fsw2, the // backend's internal map shouldn't have anything keyed on handle1 and handle2. // Therefore System.IO.CoreFX.FileSystemWatcher instances will be disposed of, too. diff --git a/mcs/class/System/Test/System.Net.NetworkInformation/PingTest.cs b/mcs/class/System/Test/System.Net.NetworkInformation/PingTest.cs index 2cbdb6838c..6b759a06b8 100644 --- a/mcs/class/System/Test/System.Net.NetworkInformation/PingTest.cs +++ b/mcs/class/System/Test/System.Net.NetworkInformation/PingTest.cs @@ -7,6 +7,7 @@ using System.Threading; namespace MonoTests.System.Net.NetworkInformation { [TestFixture] + [Category("NotWasm")] public partial class PingTest { partial void AndroidShouldPingWork (ref bool shouldWork); @@ -89,6 +90,7 @@ namespace MonoTests.System.Net.NetworkInformation } [Test] + [Category("MultiThreaded")] #if MONOTOUCH [Ignore("Ping implementation is broken on MT (requires sudo access)")] #endif @@ -106,6 +108,7 @@ namespace MonoTests.System.Net.NetworkInformation } [Test] + [Category("MultiThreaded")] #if MONOTOUCH [Ignore("Ping implementation is broken on MT (requires sudo access)")] #endif diff --git a/mcs/class/System/Test/System.Net.Sockets/IPv6MulticastOptionTest.cs b/mcs/class/System/Test/System.Net.Sockets/IPv6MulticastOptionTest.cs index 37a3915369..903c23440d 100644 --- a/mcs/class/System/Test/System.Net.Sockets/IPv6MulticastOptionTest.cs +++ b/mcs/class/System/Test/System.Net.Sockets/IPv6MulticastOptionTest.cs @@ -15,6 +15,7 @@ using NUnit.Framework; namespace MonoTests.System.Net.Sockets { [TestFixture] + [Category("NotWasm")] public class IPv6MulticastOptionTest { [Test] // .ctor (IPAddress) diff --git a/mcs/class/System/Test/System.Net.Sockets/MulticastOptionTest.cs b/mcs/class/System/Test/System.Net.Sockets/MulticastOptionTest.cs index 3734c5b2d1..42bff4f3ea 100644 --- a/mcs/class/System/Test/System.Net.Sockets/MulticastOptionTest.cs +++ b/mcs/class/System/Test/System.Net.Sockets/MulticastOptionTest.cs @@ -15,6 +15,7 @@ using NUnit.Framework; namespace MonoTests.System.Net.Sockets { [TestFixture] + [Category("NotWasm")] public class MulticastOptionTest { [Test] // .ctor (IPAddress) diff --git a/mcs/class/System/Test/System.Net.Sockets/SocketTest.cs.REMOVED.git-id b/mcs/class/System/Test/System.Net.Sockets/SocketTest.cs.REMOVED.git-id index b45e9b54b9..a8cf0a5916 100644 --- a/mcs/class/System/Test/System.Net.Sockets/SocketTest.cs.REMOVED.git-id +++ b/mcs/class/System/Test/System.Net.Sockets/SocketTest.cs.REMOVED.git-id @@ -1 +1 @@ -26abf15ade2510913f1d42482631191500fa985f \ No newline at end of file +cc8d3b2e69cd214888cb3ce95f89b1a8c8d81587 \ No newline at end of file diff --git a/mcs/class/System/Test/System.Net/FileWebRequestTest.cs b/mcs/class/System/Test/System.Net/FileWebRequestTest.cs index 869666699b..ab2d603353 100644 --- a/mcs/class/System/Test/System.Net/FileWebRequestTest.cs +++ b/mcs/class/System/Test/System.Net/FileWebRequestTest.cs @@ -26,6 +26,7 @@ using MonoTests.Helpers; namespace MonoTests.System.Net { [TestFixture] + [Category("NotWasm")] public class FileWebRequestTest { private TempDirectory _tempDirectory; diff --git a/mcs/class/System/Test/System.Net/FileWebResponseTest.cs b/mcs/class/System/Test/System.Net/FileWebResponseTest.cs index 97f1f33a6f..6172e8b553 100644 --- a/mcs/class/System/Test/System.Net/FileWebResponseTest.cs +++ b/mcs/class/System/Test/System.Net/FileWebResponseTest.cs @@ -19,6 +19,7 @@ using MonoTests.Helpers; namespace MonoTests.System.Net { [TestFixture] + [Category("NotWasm")] public class FileWebResponseTest { private TempDirectory _tempDirectory; diff --git a/mcs/class/System/Test/System.Net/HttpListener2Test.cs b/mcs/class/System/Test/System.Net/HttpListener2Test.cs index c3d3822f95..4a09e4881b 100644 --- a/mcs/class/System/Test/System.Net/HttpListener2Test.cs +++ b/mcs/class/System/Test/System.Net/HttpListener2Test.cs @@ -364,6 +364,7 @@ namespace MonoTests.System.Net { ManualResetEvent test_evt; bool test14_error; [Test] + [Category("MultiThreaded")] #if FEATURE_NO_BSD_SOCKETS [ExpectedException (typeof (PlatformNotSupportedException))] #endif @@ -502,6 +503,7 @@ namespace MonoTests.System.Net { } [Test] + [Category("MultiThreaded")] #if FEATURE_NO_BSD_SOCKETS [ExpectedException (typeof (PlatformNotSupportedException))] #endif @@ -550,6 +552,7 @@ namespace MonoTests.System.Net { } [Test] + [Category("MultiThreaded")] #if FEATURE_NO_BSD_SOCKETS [ExpectedException (typeof (PlatformNotSupportedException))] #endif @@ -603,6 +606,7 @@ namespace MonoTests.System.Net { } [Test] + [Category("MultiThreaded")] #if FEATURE_NO_BSD_SOCKETS [ExpectedException (typeof (PlatformNotSupportedException))] #endif @@ -762,6 +766,7 @@ namespace MonoTests.System.Net { // Test case for bug 341443, an pretty old bug, filed on November of 2007. // [Test] + [Category("MultiThreaded")] #if FEATURE_NO_BSD_SOCKETS [ExpectedException (typeof (PlatformNotSupportedException))] #endif diff --git a/mcs/class/System/Test/System.Net/HttpWebRequestTest.cs.REMOVED.git-id b/mcs/class/System/Test/System.Net/HttpWebRequestTest.cs.REMOVED.git-id index 905e0042fb..eb8e12403f 100644 --- a/mcs/class/System/Test/System.Net/HttpWebRequestTest.cs.REMOVED.git-id +++ b/mcs/class/System/Test/System.Net/HttpWebRequestTest.cs.REMOVED.git-id @@ -1 +1 @@ -0252b387e04bece7b463e77edb0534daf063deb1 \ No newline at end of file +8140e6616df57c3904842d3847add82df55ae4a6 \ No newline at end of file diff --git a/mcs/class/System/Test/System.Net/WebRequestTest.cs b/mcs/class/System/Test/System.Net/WebRequestTest.cs index 57115d810b..4493b8ebdf 100644 --- a/mcs/class/System/Test/System.Net/WebRequestTest.cs +++ b/mcs/class/System/Test/System.Net/WebRequestTest.cs @@ -326,7 +326,8 @@ namespace MonoTests.System.Net { [Test] //BNC#323452 // Throws exception with Status == Timeout. The same code behaves as the test expects when run from a regular app. // Might be an issue with the test suite. To investigate. - [Category("AndroidNotWorking")] + [Category("AndroidNotWorking")] + [Category("MultiThreaded")] public void TestFailedConnection () { try { @@ -353,6 +354,7 @@ namespace MonoTests.System.Net { [Test] //BNC#323452 [Category ("AndroidNotWorking")] // Fails when ran as part of the entire BCL test suite. Works when only this fixture is ran + [Category ("MultiThreaded")] public void TestFailedResolution () { try { diff --git a/mcs/class/System/Test/System.Text.RegularExpressions/RegexBugs_Long.cs.REMOVED.git-id b/mcs/class/System/Test/System.Text.RegularExpressions/RegexBugs_Long.cs.REMOVED.git-id index 607b5e84cb..9bb943e0b5 100644 --- a/mcs/class/System/Test/System.Text.RegularExpressions/RegexBugs_Long.cs.REMOVED.git-id +++ b/mcs/class/System/Test/System.Text.RegularExpressions/RegexBugs_Long.cs.REMOVED.git-id @@ -1 +1 @@ -19f90a2ddd3e19d1ddfdd6cf4302daaa6a2da61f \ No newline at end of file +c732b1a7bc6786c5dcd0149235ea1de120147611 \ No newline at end of file diff --git a/mcs/class/System/Test/System.Timers/TimerTest.cs b/mcs/class/System/Test/System.Timers/TimerTest.cs index 94f3552b6f..00a238f2e9 100644 --- a/mcs/class/System/Test/System.Timers/TimerTest.cs +++ b/mcs/class/System/Test/System.Timers/TimerTest.cs @@ -329,6 +329,7 @@ namespace MonoTests.System.Timers } [Test] + [Category ("NotWasm")] // Object.onAbort public void TestRaceCondition () { Assert.IsTrue (new RaceTest (true).Success, "#1"); diff --git a/mcs/class/System/common.sources b/mcs/class/System/common.sources index 9a52f4aa89..5508c2d2b4 100644 --- a/mcs/class/System/common.sources +++ b/mcs/class/System/common.sources @@ -585,7 +585,6 @@ ReferenceSources/Win32Exception.cs ../referencesource/System/net/System/Net/_NetRes.cs ../referencesource/System/net/System/Net/_LazyAsyncResult.cs ../referencesource/System/net/System/Net/_LoggingObject.cs -../referencesource/System/net/System/Net/_PooledStream.cs ../referencesource/System/net/System/Net/_ProxyChain.cs ../referencesource/System/net/System/Net/_ScatterGatherBuffers.cs ../referencesource/System/net/System/Net/_Semaphore.cs @@ -600,7 +599,6 @@ ReferenceSources/Win32Exception.cs ../referencesource/System/net/System/Net/cookiecollection.cs ../referencesource/System/net/System/Net/cookiecontainer.cs ../referencesource/System/net/System/Net/cookieexception.cs -../referencesource/System/net/System/Net/connectionpool.cs ../referencesource/System/net/System/Net/DnsEndPoint.cs ../referencesource/System/net/System/Net/EndPoint.cs ../referencesource/System/net/System/Net/FtpStatusCode.cs @@ -661,18 +659,20 @@ ReferenceSources/Win32Exception.cs ../referencesource/System/net/System/Net/SecureProtocols/AuthenticatedStream.cs ../referencesource/System/net/System/Net/SecureProtocols/NegotiateEnumTypes.cs -../../../external/corefx/src/System.Net.Sockets/src/System/Net/Sockets/MultipleConnectAsync.cs ../referencesource/System/net/System/Net/Sockets/AddressFamily.cs ../referencesource/System/net/System/Net/Sockets/IOControlCode.cs ../referencesource/System/net/System/Net/Sockets/IPPacketInformation.cs ../referencesource/System/net/System/Net/Sockets/IPProtectionLevel.cs ../referencesource/System/net/System/Net/Sockets/LingerOption.cs +../../../external/corefx/src/System.Net.Sockets/src/System/Net/Sockets/MultipleConnectAsync.cs ../referencesource/System/net/System/Net/Sockets/MulticastOption.cs -../referencesource/System/net/System/Net/Sockets/NetworkStream.cs +# ../referencesource/System/net/System/Net/Sockets/NetworkStream.cs +../../../external/corefx/src/System.Net.Sockets/src/System/Net/Sockets/NetworkStream.cs ../referencesource/System/net/System/Net/Sockets/ProtocolFamily.cs ../referencesource/System/net/System/Net/Sockets/ProtocolType.cs ../referencesource/System/net/System/Net/Sockets/SelectMode.cs ../referencesource/System/net/System/Net/Sockets/Socket.cs +../../../external/corefx/src/System.Net.Sockets/src/System/Net/Sockets/Socket.Tasks.cs ../referencesource/System/net/System/Net/Sockets/SocketErrors.cs ../referencesource/System/net/System/Net/Sockets/SocketFlags.cs ../referencesource/System/net/System/Net/Sockets/SocketInformation.cs @@ -808,6 +808,7 @@ ReferenceSources/Win32Exception.cs ../../../external/corefx/src/Common/src/System/Net/ExceptionCheck.cs ../../../external/corefx/src/Common/src/System/Net/HttpStatusDescription.cs ../../../external/corefx/src/Common/src/System/Net/NegotiationInfoClass.cs +../../../external/corefx/src/Common/src/System/Net/RangeValidationHelpers.cs ../../../external/corefx/src/Common/src/System/Net/SecurityProtocol.cs ../../../external/corefx/src/Common/src/System/Net/SecurityStatusPal.cs ../../../external/corefx/src/Common/src/System/Net/UriScheme.cs @@ -914,3 +915,4 @@ ReferenceSources/Win32Exception.cs ../../../external/corefx/src/System.Text.RegularExpressions/src/System/Collections/Generic/ValueListBuilder.Pop.cs ../../../external/corefx/src/System.Text.RegularExpressions/src/System/Collections/HashtableExtensions.cs + diff --git a/mcs/class/System/common_networking.sources b/mcs/class/System/common_networking.sources index f89d6b794b..863fe62450 100644 --- a/mcs/class/System/common_networking.sources +++ b/mcs/class/System/common_networking.sources @@ -4,10 +4,9 @@ System.Net/NtlmClient.cs Mono.Net.Security/AsyncProtocolRequest.cs Mono.Net.Security/CallbackHelpers.cs Mono.Net.Security/ChainValidationHelper.cs -Mono.Net.Security/LegacySslStream.cs -Mono.Net.Security/LegacyTlsProvider.cs Mono.Net.Security/MobileAuthenticatedStream.cs Mono.Net.Security/MobileTlsContext.cs +Mono.Net.Security/MobileTlsProvider.cs Mono.Net.Security/MonoSslAuthenticationOptions.cs Mono.Net.Security/MonoSslClientAuthenticationOptions.cs Mono.Net.Security/MonoSslServerAuthenticationOptions.cs diff --git a/mcs/class/System/corefx/NetworkStream.cs b/mcs/class/System/corefx/NetworkStream.cs new file mode 100644 index 0000000000..d18f8e5168 --- /dev/null +++ b/mcs/class/System/corefx/NetworkStream.cs @@ -0,0 +1,18 @@ +using System.Threading; +using System.Threading.Tasks; + +namespace System.Net.Sockets +{ + partial class NetworkStream + { + internal Socket InternalSocket { + get { + Socket chkSocket = _streamSocket; + if (_cleanedUp || chkSocket == null) + throw new ObjectDisposedException (GetType ().FullName); + + return chkSocket; + } + } + } +} diff --git a/mcs/class/System/corefx/SocketAsyncEventArgs.cs b/mcs/class/System/corefx/SocketAsyncEventArgs.cs new file mode 100644 index 0000000000..ddc8793bbf --- /dev/null +++ b/mcs/class/System/corefx/SocketAsyncEventArgs.cs @@ -0,0 +1,169 @@ +using System; +using System.Diagnostics; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using System.Reflection; +using System.Security; +using System.Threading; + +namespace System.Net.Sockets +{ + partial class SocketAsyncEventArgs + { + // Single buffer. + private Memory _buffer; + private int _offset; + private int _count; + private bool _bufferIsExplicitArray; + + // BufferList property variables. + private IList> _bufferList; + private List> _bufferListInternal; + + public byte[] Buffer + { + get + { + if (_bufferIsExplicitArray) + { + bool success = MemoryMarshal.TryGetArray(_buffer, out ArraySegment arraySegment); + Debug.Assert(success); + return arraySegment.Array; + } + + return null; + } + } + + public Memory MemoryBuffer => _buffer; + + public int Offset => _offset; + + public int Count => _count; + + // NOTE: this property is mutually exclusive with Buffer. + // Setting this property with an existing non-null Buffer will throw. + public IList> BufferList + { + get { return _bufferList; } + set + { + if (value != null) + { + if (!_buffer.Equals(default)) + { + // Can't have both set + throw new ArgumentException(SR.Format(SR.net_ambiguousbuffers, nameof(Buffer))); + } + + // Copy the user-provided list into our internal buffer list, + // so that we are not affected by subsequent changes to the list. + // We reuse the existing list so that we can avoid reallocation when possible. + int bufferCount = value.Count; + if (_bufferListInternal == null) + { + _bufferListInternal = new List>(bufferCount); + } + else + { + _bufferListInternal.Clear(); + } + + for (int i = 0; i < bufferCount; i++) + { + ArraySegment buffer = value[i]; + RangeValidationHelpers.ValidateSegment(buffer); + _bufferListInternal.Add(buffer); + } + } + else + { + _bufferListInternal?.Clear(); + } + + _bufferList = value; + } + } + + public void SetBuffer(int offset, int count) + { + if (!_buffer.Equals(default)) + { + if ((uint)offset > _buffer.Length) + { + throw new ArgumentOutOfRangeException(nameof(offset)); + } + if ((uint)count > (_buffer.Length - offset)) + { + throw new ArgumentOutOfRangeException(nameof(count)); + } + if (!_bufferIsExplicitArray) + { + throw new InvalidOperationException(SR.InvalidOperation_BufferNotExplicitArray); + } + + _offset = offset; + _count = count; + } + } + + internal void CopyBufferFrom(SocketAsyncEventArgs source) + { + _buffer = source._buffer; + _offset = source._offset; + _count = source._count; + _bufferIsExplicitArray = source._bufferIsExplicitArray; + } + + public void SetBuffer(byte[] buffer, int offset, int count) + { + if (buffer == null) + { + // Clear out existing buffer. + _buffer = default; + _offset = 0; + _count = 0; + _bufferIsExplicitArray = false; + } + else + { + // Can't have both Buffer and BufferList. + if (_bufferList != null) + { + throw new ArgumentException(SR.Format(SR.net_ambiguousbuffers, nameof(BufferList))); + } + + // Offset and count can't be negative and the + // combination must be in bounds of the array. + if ((uint)offset > buffer.Length) + { + throw new ArgumentOutOfRangeException(nameof(offset)); + } + if ((uint)count > (buffer.Length - offset)) + { + throw new ArgumentOutOfRangeException(nameof(count)); + } + + _buffer = buffer; + _offset = offset; + _count = count; + _bufferIsExplicitArray = true; + } + } + + public void SetBuffer(Memory buffer) + { + if (buffer.Length != 0 && _bufferList != null) + { + throw new ArgumentException(SR.Format(SR.net_ambiguousbuffers, nameof(BufferList))); + } + + _buffer = buffer; + _offset = 0; + _count = buffer.Length; + _bufferIsExplicitArray = false; + } + + internal bool HasMultipleBuffers => _bufferList != null; + } +} diff --git a/mcs/class/System/fsw.pns.sources b/mcs/class/System/fsw.pns.sources new file mode 100644 index 0000000000..6130454aad --- /dev/null +++ b/mcs/class/System/fsw.pns.sources @@ -0,0 +1 @@ +System.IO/FileSystemWatcher.platformnotsupported.cs \ No newline at end of file diff --git a/mcs/class/System/monotouch_watch_System_xtest.dll.exclude.sources b/mcs/class/System/monotouch_watch_System_xtest.dll.exclude.sources index 4742b73fbb..afa014c625 100644 --- a/mcs/class/System/monotouch_watch_System_xtest.dll.exclude.sources +++ b/mcs/class/System/monotouch_watch_System_xtest.dll.exclude.sources @@ -6,3 +6,6 @@ ../../../external/corefx/src/Common/tests/System/Net/WebSockets/WebSocketCreateTest.cs ../../../external/corefx/src/System.Net.WebSockets/tests/WebSocketTests.netcoreapp.cs + +../../../external/corefx/src/System.Net.Sockets/tests/FunctionalTests/NetworkStreamTest.cs +../../../external/corefx/src/System.Net.Sockets/tests/FunctionalTests/NetworkStreamTest.netcoreapp.cs diff --git a/mcs/class/System/orbis_System.dll.exclude.sources b/mcs/class/System/orbis_System.dll.exclude.sources index 88149d6983..66fbcf6d57 100644 --- a/mcs/class/System/orbis_System.dll.exclude.sources +++ b/mcs/class/System/orbis_System.dll.exclude.sources @@ -1,2 +1,3 @@ System.Net/MacProxy.cs +Mono/AppleTypes.cs System.Security.Cryptography.X509Certificates/OSX509Certificates.cs diff --git a/mcs/class/System/wasm_System.dll.exclude.sources b/mcs/class/System/wasm_System.dll.exclude.sources new file mode 100644 index 0000000000..a6a19c8bc9 --- /dev/null +++ b/mcs/class/System/wasm_System.dll.exclude.sources @@ -0,0 +1,3 @@ +System.IO/FileSystemWatcher.cs +../../../external/corefx/src/System.IO.FileSystem.Watcher/src/System/IO/FileSystemWatcher.UnknownUnix.cs +../../../external/corefx/src/System.IO.FileSystem.Watcher/src/System/IO/FileSystemWatcher.cs diff --git a/mcs/class/System/wasm_System.dll.sources b/mcs/class/System/wasm_System.dll.sources index 70a77a6dbf..a6748349a0 100644 --- a/mcs/class/System/wasm_System.dll.sources +++ b/mcs/class/System/wasm_System.dll.sources @@ -1 +1,2 @@ #include mobile_System.dll.sources +#include fsw.pns.sources \ No newline at end of file diff --git a/mcs/class/System/wasm_System_xtest.dll.exclude.sources b/mcs/class/System/wasm_System_xtest.dll.exclude.sources index 63393652ba..7b3b9391fd 100644 --- a/mcs/class/System/wasm_System_xtest.dll.exclude.sources +++ b/mcs/class/System/wasm_System_xtest.dll.exclude.sources @@ -8,3 +8,6 @@ ../../../external/corefx/src/System.CodeDom/tests/Microsoft/CSharp/*.cs ../../../external/corefx/src/System.CodeDom/tests/Microsoft/VisualBasic/*.cs ../../../external/corefx/src/System.CodeDom/tests/*.cs + +../../../external/corefx/src/System.IO.FileSystem.Watcher/tests/*.cs +System/RemoteExecutorTests.cs diff --git a/mcs/class/corlib/Makefile b/mcs/class/corlib/Makefile index 02fa5ff974..b25a933f10 100644 --- a/mcs/class/corlib/Makefile +++ b/mcs/class/corlib/Makefile @@ -37,11 +37,13 @@ RESX_RESOURCE_STRING = \ ../../../external/corefx/src/System.Collections.NonGeneric/src/Resources/Strings.resx \ ../../../external/corefx/src/System.ComponentModel.TypeConverter/src/Resources/Strings.resx \ ../../../external/corefx/src/System.Buffers/src/Resources/Strings.resx \ + ../../../external/corefx/src/System.IO.FileSystem/src/Resources/Strings.resx \ ../../../external/corefx/src/System.IO.FileSystem.Watcher/src/Resources/Strings.resx \ ../../../external/corefx/src/System.IO.Ports/src/Resources/Strings.resx \ ../../../external/corefx/src/System.Memory/src/Resources/Strings.resx \ ../../../external/corefx/src/System.Net.HttpListener/src/Resources/Strings.resx \ ../../../external/corefx/src/System.Net.Requests/src/Resources/Strings.resx \ + ../../../external/corefx/src/System.Net.Sockets/src/Resources/Strings.resx \ ../../../external/corefx/src/System.Net.Http/src/Resources/Strings.resx \ ../../../external/corefx/src/System.Numerics.Vectors/src/Resources/Strings.resx \ ../../../external/corefx/src/System.Reflection.TypeExtensions/src/Resources/Strings.resx \ diff --git a/mcs/class/corlib/Mono/Runtime.cs b/mcs/class/corlib/Mono/Runtime.cs index 8f4cf1afd3..f59a7e9389 100644 --- a/mcs/class/corlib/Mono/Runtime.cs +++ b/mcs/class/corlib/Mono/Runtime.cs @@ -81,6 +81,8 @@ namespace Mono { return true; } + static object exception_capture = new object (); + [MethodImplAttribute (MethodImplOptions.InternalCall)] static extern string ExceptionToState_internal (Exception exc, out ulong portable_hash, out ulong unportable_hash); @@ -143,8 +145,11 @@ namespace Mono { { ulong portable_hash; ulong unportable_hash; - string payload_str = ExceptionToState_internal (exc, out portable_hash, out unportable_hash); - SendMicrosoftTelemetry (payload_str, portable_hash, unportable_hash); + lock (exception_capture) + { + string payload_str = ExceptionToState_internal (exc, out portable_hash, out unportable_hash); + SendMicrosoftTelemetry (payload_str, portable_hash, unportable_hash); + } } // All must be set except for configDir_str diff --git a/mcs/class/corlib/ReferenceSources/Buffer.cs b/mcs/class/corlib/ReferenceSources/Buffer.cs index 50ee42a05c..f89199219b 100644 --- a/mcs/class/corlib/ReferenceSources/Buffer.cs +++ b/mcs/class/corlib/ReferenceSources/Buffer.cs @@ -93,7 +93,7 @@ namespace System dst += int.MaxValue; } - memcpy1 (dst, src, (int) sourceBytesToCopy); + Memcpy (dst, src, (int) sourceBytesToCopy); } [CLSCompliantAttribute (false)] diff --git a/mcs/class/corlib/ReferenceSources/Type.cs b/mcs/class/corlib/ReferenceSources/Type.cs index 03c95c0af1..28fbf135b2 100644 --- a/mcs/class/corlib/ReferenceSources/Type.cs +++ b/mcs/class/corlib/ReferenceSources/Type.cs @@ -34,10 +34,40 @@ using StackCrawlMark = System.Threading.StackCrawlMark; namespace System { [Serializable] +#if !MOBILE + [ComVisible (true)] + [ComDefaultInterfaceAttribute (typeof (_Type))] + [ClassInterface(ClassInterfaceType.None)] + partial class Type : MemberInfo, _Type +#else partial class Type : MemberInfo +#endif { internal RuntimeTypeHandle _impl; +#if !MOBILE + void _Type.GetIDsOfNames ([In] ref Guid riid, IntPtr rgszNames, uint cNames, uint lcid, IntPtr rgDispId) + { + throw new NotImplementedException (); + } + + void _Type.GetTypeInfo (uint iTInfo, uint lcid, IntPtr ppTInfo) + { + throw new NotImplementedException (); + } + + void _Type.GetTypeInfoCount (out uint pcTInfo) + { + throw new NotImplementedException (); + } + + void _Type.Invoke (uint dispIdMember, [In] ref Guid riid, uint lcid, short wFlags, IntPtr pDispParams, + IntPtr pVarResult, IntPtr pExcepInfo, IntPtr puArgErr) + { + throw new NotImplementedException (); + } +#endif + internal virtual Type InternalResolve () { return UnderlyingSystemType; diff --git a/mcs/class/corlib/System.IO/MonoIOError.cs b/mcs/class/corlib/System.IO/MonoIOError.cs index 28cec30c58..897ab869da 100644 --- a/mcs/class/corlib/System.IO/MonoIOError.cs +++ b/mcs/class/corlib/System.IO/MonoIOError.cs @@ -75,8 +75,8 @@ namespace System.IO ERROR_SHARING_BUFFER_EXCEEDED = 36, ERROR_HANDLE_EOF = 38, */ ERROR_HANDLE_DISK_FULL = 39, - ERROR_NOT_SUPPORTED = 50, - /* ERROR_REM_NOT_LIST = 51, + ERROR_NOT_SUPPORTED = 50, + /* ERROR_REM_NOT_LIST = 51, ERROR_DUP_NAME = 52, ERROR_BAD_NETPATH = 53, ERROR_NETWORK_BUSY = 54, diff --git a/mcs/class/corlib/System.IO/Path.cs b/mcs/class/corlib/System.IO/Path.cs index 12bf6e6d57..997d44bf72 100644 --- a/mcs/class/corlib/System.IO/Path.cs +++ b/mcs/class/corlib/System.IO/Path.cs @@ -734,7 +734,7 @@ namespace System.IO { if (Environment.IsRunningOnWindows) dirs[i] = dirs[i].TrimEnd (); - if (dirs[i] == "." || (i != 0 && dirs[i].Length == 0)) + if ((!(isUnc && i == 2) && dirs[i] == ".") || (i != 0 && dirs[i].Length == 0)) continue; else if (dirs[i] == "..") { // don't overwrite path segments below the limit diff --git a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/SecurityParameters.cs b/mcs/class/corlib/System.Reflection/MethodInfo.cs similarity index 52% rename from mcs/class/Mono.Security/Mono.Security.Protocol.Tls/SecurityParameters.cs rename to mcs/class/corlib/System.Reflection/MethodInfo.cs index 3c744ea240..733a4da28e 100644 --- a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/SecurityParameters.cs +++ b/mcs/class/corlib/System.Reflection/MethodInfo.cs @@ -1,5 +1,3 @@ -// Transport Security Layer (TLS) -// Copyright (C) 2006 Novell, Inc (http://www.novell.com) // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the @@ -8,10 +6,10 @@ // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: -// +// // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. -// +// // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND @@ -21,40 +19,48 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -using System; +using System.Runtime.InteropServices; -namespace Mono.Security.Protocol.Tls { +namespace System.Reflection { - // note: other things should be moved here - internal class SecurityParameters { - - private CipherSuite cipher; - private byte[] clientWriteMAC; - private byte[] serverWriteMAC; - - public SecurityParameters () + [Serializable] +#if !MOBILE + [ComVisible(true)] + [ComDefaultInterface(typeof(_MethodInfo))] + [ClassInterface(ClassInterfaceType.None)] + partial class MethodInfo : _MethodInfo +#else + partial class MethodInfo +#endif + { +#if !MOBILE + void _MethodInfo.GetIDsOfNames ([In] ref Guid riid, IntPtr rgszNames, uint cNames, uint lcid, IntPtr rgDispId) { + throw new NotImplementedException (); } - public CipherSuite Cipher { - get { return cipher; } - set { cipher = value; } - } - - public byte[] ClientWriteMAC { - get { return clientWriteMAC; } - set { clientWriteMAC = value; } - } - - public byte[] ServerWriteMAC { - get { return serverWriteMAC; } - set { serverWriteMAC = value; } - } - - public void Clear () + void _MethodInfo.GetTypeInfo (uint iTInfo, uint lcid, IntPtr ppTInfo) { - // FIXME: clear cipher - cipher = null; + throw new NotImplementedException (); } + + void _MethodInfo.GetTypeInfoCount (out uint pcTInfo) + { + throw new NotImplementedException (); + } + + void _MethodInfo.Invoke (uint dispIdMember, [In] ref Guid riid, uint lcid, short wFlags, IntPtr pDispParams, + IntPtr pVarResult, IntPtr pExcepInfo, IntPtr puArgErr) + { + throw new NotImplementedException (); + } + + Type _MethodInfo.GetType () + { + return GetType (); + } +#endif + + internal virtual int GenericParameterCount => GetGenericArguments ().Length; } } diff --git a/mcs/class/corlib/System.Runtime.InteropServices/Marshal.cs b/mcs/class/corlib/System.Runtime.InteropServices/Marshal.cs index b2ed727327..b564f4150d 100644 --- a/mcs/class/corlib/System.Runtime.InteropServices/Marshal.cs +++ b/mcs/class/corlib/System.Runtime.InteropServices/Marshal.cs @@ -1936,9 +1936,8 @@ namespace System.Runtime.InteropServices return GetFunctionPointerForDelegateInternal ((Delegate)(object)d); } - internal static void SetLastWin32Error (int error) - { - } + [MethodImplAttribute(MethodImplOptions.InternalCall)] + internal static extern void SetLastWin32Error (int error); #if NETCORE internal static IntPtr AllocBSTR (int length) diff --git a/mcs/class/corlib/System.Runtime.InteropServices/_MethodInfo.cs b/mcs/class/corlib/System.Runtime.InteropServices/_MethodInfo.cs index e8180ad7bf..c2afed673d 100644 --- a/mcs/class/corlib/System.Runtime.InteropServices/_MethodInfo.cs +++ b/mcs/class/corlib/System.Runtime.InteropServices/_MethodInfo.cs @@ -20,81 +20,48 @@ namespace System.Runtime.InteropServices [ComVisible (true)] public interface _MethodInfo { - bool Equals (object other); - - MethodInfo GetBaseDefinition(); - - object[] GetCustomAttributes (bool inherit); - - object[] GetCustomAttributes (Type attributeType, bool inherit); - - int GetHashCode (); - - MethodImplAttributes GetMethodImplementationFlags (); - - ParameterInfo[] GetParameters (); - - void GetIDsOfNames ([In] ref Guid riid, IntPtr rgszNames, uint cNames, uint lcid, IntPtr rgDispId); - - void GetTypeInfo (uint iTInfo, uint lcid, IntPtr ppTInfo); - - void GetTypeInfoCount (out uint pcTInfo); - - void Invoke (uint dispIdMember, [In] ref Guid riid, uint lcid, short wFlags, IntPtr pDispParams, + void GetTypeInfoCount(out uint pcTInfo); + void GetTypeInfo(uint iTInfo, uint lcid, IntPtr ppTInfo); + void GetIDsOfNames([In] ref Guid riid, IntPtr rgszNames, uint cNames, uint lcid, IntPtr rgDispId); + void Invoke(uint dispIdMember, [In] ref Guid riid, uint lcid, short wFlags, IntPtr pDispParams, IntPtr pVarResult, IntPtr pExcepInfo, IntPtr puArgErr); - Type GetType (); + String ToString(); + bool Equals(Object other); + int GetHashCode(); + Type GetType(); - object Invoke (object obj, object[] parameters); - - object Invoke (object obj, BindingFlags invokeAttr, Binder binder, object[] parameters, CultureInfo culture); - + MemberTypes MemberType { get; } + String Name { get; } + Type DeclaringType { get; } + Type ReflectedType { get; } + Object[] GetCustomAttributes(Type attributeType, bool inherit); + Object[] GetCustomAttributes(bool inherit); bool IsDefined(Type attributeType, bool inherit); - - string ToString (); - MethodAttributes Attributes {get;} + ParameterInfo[] GetParameters(); + MethodImplAttributes GetMethodImplementationFlags(); + RuntimeMethodHandle MethodHandle { get; } + MethodAttributes Attributes { get; } + CallingConventions CallingConvention { get; } + Object Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture); + bool IsPublic { get; } + bool IsPrivate { get; } + bool IsFamily { get; } + bool IsAssembly { get; } + bool IsFamilyAndAssembly { get; } + bool IsFamilyOrAssembly { get; } + bool IsStatic { get; } + bool IsFinal { get; } + bool IsVirtual { get; } + bool IsHideBySig { get; } + bool IsAbstract { get; } + bool IsSpecialName { get; } + bool IsConstructor { get; } + Object Invoke(Object obj, Object[] parameters); - CallingConventions CallingConvention {get;} - - Type DeclaringType {get;} - - bool IsAbstract {get;} - - bool IsAssembly {get;} - - bool IsConstructor {get;} - - bool IsFamily {get;} - - bool IsFamilyAndAssembly {get;} - - bool IsFamilyOrAssembly {get;} - - bool IsFinal {get;} - - bool IsHideBySig {get;} - - bool IsPrivate {get;} - - bool IsPublic {get;} - - bool IsSpecialName {get;} - - bool IsStatic {get;} - - bool IsVirtual {get;} - - MemberTypes MemberType {get;} - - RuntimeMethodHandle MethodHandle {get;} - - string Name {get;} - - Type ReflectedType {get;} - - Type ReturnType {get;} - - ICustomAttributeProvider ReturnTypeCustomAttributes {get;} + Type ReturnType { get; } + ICustomAttributeProvider ReturnTypeCustomAttributes { get; } + MethodInfo GetBaseDefinition(); } } diff --git a/mcs/class/corlib/System.Runtime.InteropServices/_Type.cs b/mcs/class/corlib/System.Runtime.InteropServices/_Type.cs index 1565230a30..c41e60c0c8 100644 --- a/mcs/class/corlib/System.Runtime.InteropServices/_Type.cs +++ b/mcs/class/corlib/System.Runtime.InteropServices/_Type.cs @@ -20,229 +20,125 @@ namespace System.Runtime.InteropServices [ComVisible (true)] public interface _Type { - bool Equals (object other); - - bool Equals (Type o); - - Type[] FindInterfaces (TypeFilter filter, object filterCriteria); - - MemberInfo[] FindMembers (MemberTypes memberType, BindingFlags bindingAttr, MemberFilter filter, object filterCriteria); - - int GetArrayRank (); - - ConstructorInfo GetConstructor (Type[] types); - - ConstructorInfo GetConstructor (BindingFlags bindingAttr, Binder binder, Type[] types, ParameterModifier[] modifiers); - - ConstructorInfo GetConstructor (BindingFlags bindingAttr, Binder binder, CallingConventions callConvention, Type[] types, ParameterModifier[] modifiers); - - ConstructorInfo[] GetConstructors (); - - ConstructorInfo[] GetConstructors (BindingFlags bindingAttr); - - object[] GetCustomAttributes (bool inherit); - - object[] GetCustomAttributes (Type attributeType, bool inherit); - - MemberInfo[] GetDefaultMembers (); - - Type GetElementType (); - - EventInfo GetEvent (string name); - - EventInfo GetEvent (string name, BindingFlags bindingAttr); - - EventInfo[] GetEvents (); - - EventInfo[] GetEvents (BindingFlags bindingAttr); - - FieldInfo GetField (string name); - - FieldInfo GetField (string name, BindingFlags bindingAttr); - - FieldInfo[] GetFields (); - - FieldInfo[] GetFields (BindingFlags bindingAttr); - - int GetHashCode (); - - void GetIDsOfNames ([In] ref Guid riid, IntPtr rgszNames, uint cNames, uint lcid, IntPtr rgDispId); - - void GetTypeInfo (uint iTInfo, uint lcid, IntPtr ppTInfo); - - void GetTypeInfoCount (out uint pcTInfo); - - void Invoke (uint dispIdMember, [In] ref Guid riid, uint lcid, short wFlags, IntPtr pDispParams, - IntPtr pVarResult, IntPtr pExcepInfo, IntPtr puArgErr); - - Type GetInterface (string name); - - Type GetInterface (string name, bool ignoreCase); - - InterfaceMapping GetInterfaceMap (Type interfaceType); - - Type[] GetInterfaces (); - - MemberInfo[] GetMember (string name); - - MemberInfo[] GetMember (string name, MemberTypes type, BindingFlags bindingAttr); - - MemberInfo[] GetMember (string name, BindingFlags bindingAttr); - - MemberInfo[] GetMembers (); - - MemberInfo[] GetMembers (BindingFlags bindingAttr); - - MethodInfo GetMethod (string name); - - MethodInfo GetMethod (string name, BindingFlags bindingAttr); - - MethodInfo GetMethod (string name, Type[] types); - - MethodInfo GetMethod (string name, Type[] types, ParameterModifier[] modifiers); - - MethodInfo GetMethod (string name, BindingFlags bindingAttr, Binder binder, Type[] types, ParameterModifier[] modifiers); - - MethodInfo GetMethod (string name, BindingFlags bindingAttr, Binder binder, CallingConventions callConvention, Type[] types, ParameterModifier[] modifiers); - - MethodInfo[] GetMethods (); - - MethodInfo[] GetMethods (BindingFlags bindingAttr); - - Type GetNestedType (string name); - - Type GetNestedType (string name, BindingFlags bindingAttr); - - Type[] GetNestedTypes (); - - Type[] GetNestedTypes (BindingFlags bindingAttr); - - PropertyInfo[] GetProperties (); - - PropertyInfo[] GetProperties (BindingFlags bindingAttr); - - PropertyInfo GetProperty (string name); - - PropertyInfo GetProperty (string name, BindingFlags bindingAttr); - - PropertyInfo GetProperty (string name, Type returnType); - - PropertyInfo GetProperty (string name, Type[] types); - - PropertyInfo GetProperty (string name, Type returnType, Type[] types); - - PropertyInfo GetProperty (string name, Type returnType, Type[] types, ParameterModifier[] modifiers); - - PropertyInfo GetProperty (string name, BindingFlags bindingAttr, Binder binder, Type returnType, Type[] types, ParameterModifier[] modifiers); - - Type GetType (); - - object InvokeMember (string name, BindingFlags invokeAttr, Binder binder, object target, object[] args); - - object InvokeMember (string name, BindingFlags invokeAttr, Binder binder, object target, object[] args, CultureInfo culture); - - object InvokeMember (string name, BindingFlags invokeAttr, Binder binder, object target, object[] args, ParameterModifier[] modifiers, CultureInfo culture, string[] namedParameters); - - bool IsAssignableFrom (Type c); - - bool IsDefined (Type attributeType, bool inherit); - - bool IsInstanceOfType (object o); - - bool IsSubclassOf (Type c); - - string ToString (); - - Assembly Assembly {get;} - - string AssemblyQualifiedName {get;} - - TypeAttributes Attributes {get;} - - Type BaseType {get;} - - Type DeclaringType {get;} - - string FullName {get;} - - Guid GUID {get;} - - bool HasElementType {get;} - - bool IsAbstract {get;} - - bool IsAnsiClass {get;} - - bool IsArray {get;} - - bool IsAutoClass {get;} - - bool IsAutoLayout {get;} - - bool IsByRef {get;} - - bool IsClass {get;} - - bool IsCOMObject {get;} - - bool IsContextful {get;} - - bool IsEnum {get;} - - bool IsExplicitLayout {get;} - - bool IsImport {get;} - - bool IsInterface {get;} - - bool IsLayoutSequential {get;} - - bool IsMarshalByRef {get;} - - bool IsNestedAssembly {get;} - - bool IsNestedFamANDAssem {get;} - - bool IsNestedFamily {get;} - - bool IsNestedFamORAssem {get;} - - bool IsNestedPrivate {get;} - - bool IsNestedPublic {get;} - - bool IsNotPublic {get;} - - bool IsPointer {get;} - - bool IsPrimitive {get;} - - bool IsPublic {get;} - - bool IsSealed {get;} - - bool IsSerializable {get;} - - bool IsSpecialName {get;} - - bool IsUnicodeClass {get;} - - bool IsValueType {get;} - - MemberTypes MemberType {get;} - - Module Module {get;} - - string Name {get;} - - string Namespace {get;} - - Type ReflectedType {get;} - - RuntimeTypeHandle TypeHandle {get;} - - ConstructorInfo TypeInitializer {get;} - - Type UnderlyingSystemType {get;} + void GetTypeInfoCount(out uint pcTInfo); + void GetTypeInfo(uint iTInfo, uint lcid, IntPtr ppTInfo); + void GetIDsOfNames([In] ref Guid riid, IntPtr rgszNames, uint cNames, uint lcid, IntPtr rgDispId); + void Invoke(uint dispIdMember, [In] ref Guid riid, uint lcid, short wFlags, IntPtr pDispParams, IntPtr pVarResult, + IntPtr pExcepInfo, IntPtr puArgErr); + + String ToString(); + bool Equals(Object other); + int GetHashCode(); + Type GetType(); + + MemberTypes MemberType { get; } + String Name { get; } + Type DeclaringType { get; } + Type ReflectedType { get; } + Object[] GetCustomAttributes(Type attributeType, bool inherit); + Object[] GetCustomAttributes(bool inherit); + bool IsDefined(Type attributeType, bool inherit); + + Guid GUID { get; } + Module Module { get; } + Assembly Assembly { get; } + RuntimeTypeHandle TypeHandle { get; } + String FullName { get; } + String Namespace { get; } + String AssemblyQualifiedName { get; } + int GetArrayRank(); + Type BaseType { get; } + + ConstructorInfo[] GetConstructors(BindingFlags bindingAttr); + Type GetInterface(String name, bool ignoreCase); + Type[] GetInterfaces(); + Type[] FindInterfaces(TypeFilter filter,Object filterCriteria); + EventInfo GetEvent(String name,BindingFlags bindingAttr); + EventInfo[] GetEvents(); + EventInfo[] GetEvents(BindingFlags bindingAttr); + Type[] GetNestedTypes(BindingFlags bindingAttr); + Type GetNestedType(String name, BindingFlags bindingAttr); + MemberInfo[] GetMember(String name, MemberTypes type, BindingFlags bindingAttr); + MemberInfo[] GetDefaultMembers(); + MemberInfo[] FindMembers(MemberTypes memberType,BindingFlags bindingAttr,MemberFilter filter,Object filterCriteria); + Type GetElementType(); + bool IsSubclassOf(Type c); + bool IsInstanceOfType(Object o); + bool IsAssignableFrom(Type c); + InterfaceMapping GetInterfaceMap(Type interfaceType); + MethodInfo GetMethod(String name, BindingFlags bindingAttr, Binder binder, Type[] types, ParameterModifier[] modifiers); + MethodInfo GetMethod(String name, BindingFlags bindingAttr); + MethodInfo[] GetMethods(BindingFlags bindingAttr); + FieldInfo GetField(String name, BindingFlags bindingAttr); + FieldInfo[] GetFields(BindingFlags bindingAttr); + PropertyInfo GetProperty(String name, BindingFlags bindingAttr); + PropertyInfo GetProperty(String name,BindingFlags bindingAttr,Binder binder, Type returnType, Type[] types, ParameterModifier[] modifiers); + PropertyInfo[] GetProperties(BindingFlags bindingAttr); + MemberInfo[] GetMember(String name, BindingFlags bindingAttr); + MemberInfo[] GetMembers(BindingFlags bindingAttr); + Object InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args, ParameterModifier[] modifiers, + CultureInfo culture, String[] namedParameters); + Type UnderlyingSystemType { get; } + + Object InvokeMember(String name,BindingFlags invokeAttr,Binder binder, Object target, Object[] args, CultureInfo culture); + Object InvokeMember(String name,BindingFlags invokeAttr,Binder binder, Object target, Object[] args); + ConstructorInfo GetConstructor(BindingFlags bindingAttr, Binder binder, CallingConventions callConvention, Type[] types, ParameterModifier[] modifiers); + ConstructorInfo GetConstructor(BindingFlags bindingAttr, Binder binder, Type[] types, ParameterModifier[] modifiers); + ConstructorInfo GetConstructor(Type[] types); + ConstructorInfo[] GetConstructors(); + ConstructorInfo TypeInitializer{ get; } + + MethodInfo GetMethod(String name, BindingFlags bindingAttr, Binder binder, CallingConventions callConvention, Type[] types, ParameterModifier[] modifiers); + MethodInfo GetMethod(String name, Type[] types, ParameterModifier[] modifiers); + MethodInfo GetMethod(String name, Type[] types); + MethodInfo GetMethod(String name); + MethodInfo[] GetMethods(); + FieldInfo GetField(String name); + FieldInfo[] GetFields(); + Type GetInterface(String name); + EventInfo GetEvent(String name); + PropertyInfo GetProperty(String name, Type returnType, Type[] types,ParameterModifier[] modifiers); + PropertyInfo GetProperty(String name, Type returnType, Type[] types); + PropertyInfo GetProperty(String name, Type[] types); + PropertyInfo GetProperty(String name, Type returnType); + PropertyInfo GetProperty(String name); + PropertyInfo[] GetProperties(); + Type[] GetNestedTypes(); + Type GetNestedType(String name); + MemberInfo[] GetMember(String name); + MemberInfo[] GetMembers(); + TypeAttributes Attributes { get; } + bool IsNotPublic { get; } + bool IsPublic { get; } + bool IsNestedPublic { get; } + bool IsNestedPrivate { get; } + bool IsNestedFamily { get; } + bool IsNestedAssembly { get; } + bool IsNestedFamANDAssem { get; } + bool IsNestedFamORAssem { get; } + bool IsAutoLayout { get; } + bool IsLayoutSequential { get; } + bool IsExplicitLayout { get; } + bool IsClass { get; } + bool IsInterface { get; } + bool IsValueType { get; } + bool IsAbstract { get; } + bool IsSealed { get; } + bool IsEnum { get; } + bool IsSpecialName { get; } + bool IsImport { get; } + bool IsSerializable { get; } + bool IsAnsiClass { get; } + bool IsUnicodeClass { get; } + bool IsAutoClass { get; } + bool IsArray { get; } + bool IsByRef { get; } + bool IsPointer { get; } + bool IsPrimitive { get; } + bool IsCOMObject { get; } + bool HasElementType { get; } + bool IsContextful { get; } + bool IsMarshalByRef { get; } + bool Equals(Type o); } } diff --git a/mcs/class/corlib/System.Security.Permissions/SiteIdentityPermission.cs b/mcs/class/corlib/System.Security.Permissions/SiteIdentityPermission.cs index b4cbc3693a..f38cf2c851 100644 --- a/mcs/class/corlib/System.Security.Permissions/SiteIdentityPermission.cs +++ b/mcs/class/corlib/System.Security.Permissions/SiteIdentityPermission.cs @@ -197,7 +197,7 @@ namespace System.Security.Permissions { if (x == 42) { // special case for wildcards (*) // must be alone or first and followed by a dot - if ((s.Length > 1) && ((s [i + 1] != '.') || (i > 0))) + if ((s.Length > 1) && ((i > 0) || (s [i + 1] != '.'))) return false; } if (!valid [x - 33]) { diff --git a/mcs/class/corlib/System.Security.Policy/ApplicationTrustEnumerator.cs b/mcs/class/corlib/System.Security.Policy/ApplicationTrustEnumerator.cs index d305344226..9de6f2399d 100644 --- a/mcs/class/corlib/System.Security.Policy/ApplicationTrustEnumerator.cs +++ b/mcs/class/corlib/System.Security.Policy/ApplicationTrustEnumerator.cs @@ -35,34 +35,25 @@ namespace System.Security.Policy { [ComVisible (true)] public sealed class ApplicationTrustEnumerator : IEnumerator { - private IEnumerator e; + ApplicationTrustCollection trusts; + int current; - internal ApplicationTrustEnumerator (ApplicationTrustCollection collection) - { - e = collection.GetEnumerator (); + internal ApplicationTrustEnumerator (ApplicationTrustCollection atc) { + trusts = atc; + current = -1; } - // properties + public ApplicationTrust Current => trusts [current]; - public ApplicationTrust Current { - get { return (ApplicationTrust) e.Current; } - } + object IEnumerator.Current => (object) trusts [current]; - object IEnumerator.Current { - get { return e.Current; } - } + public void Reset () => current = -1; - // methods - - public bool MoveNext () - { - return e.MoveNext (); - } - - public void Reset () - { - e.Reset (); + public bool MoveNext () { + if (current == ((int) trusts.Count - 1)) + return false; + current++; + return true; } } } - diff --git a/mcs/class/corlib/System.Threading/Interlocked.cs b/mcs/class/corlib/System.Threading/Interlocked.cs index 55eb29ac47..d63054d575 100644 --- a/mcs/class/corlib/System.Threading/Interlocked.cs +++ b/mcs/class/corlib/System.Threading/Interlocked.cs @@ -48,9 +48,29 @@ namespace System.Threading [MethodImplAttribute(MethodImplOptions.InternalCall)] internal extern static int CompareExchange(ref int location1, int value, int comparand, ref bool succeeded); - [ReliabilityContractAttribute (Consistency.WillNotCorruptState, Cer.Success)] + [ReliabilityContract (Consistency.WillNotCorruptState, Cer.Success)] [MethodImplAttribute(MethodImplOptions.InternalCall)] - public extern static object CompareExchange(ref object location1, object value, object comparand); + extern static void CompareExchange (ref object location1, ref object value, ref object comparand, ref object result); + + [ReliabilityContract (Consistency.WillNotCorruptState, Cer.Success)] + public static object CompareExchange (ref object location1, object value, object comparand) + { + // This avoids coop handles, esp. on the output which would be particularly inefficient. + // Passing everything by ref is equivalent to coop handles -- ref to locals at least. + // + // location1's treatment is unclear. But note that passing it by handle would be incorrect, + // as it would use a local alias, which the coop marshaling does, to avoid the unclarity here, + // that of a ref being to a managed frame vs. a native frame. Perhaps that could be revisited. + // + // So there a hole here, that of calling this function with location1 being in a native frame. + // Usually it will be to a field, static or not, and not even to managed stack. + // + // This is usually intrinsified. Ideally it is always intrinisified. + // + object result = null; + CompareExchange (ref location1, ref value, ref comparand, ref result); + return result; + } [MethodImplAttribute(MethodImplOptions.InternalCall)] public extern static float CompareExchange(ref float location1, float value, float comparand); @@ -74,9 +94,19 @@ namespace System.Threading [MethodImplAttribute(MethodImplOptions.InternalCall)] public extern static int Exchange(ref int location1, int value); - [ReliabilityContractAttribute (Consistency.WillNotCorruptState, Cer.Success)] + [ReliabilityContract (Consistency.WillNotCorruptState, Cer.Success)] [MethodImplAttribute(MethodImplOptions.InternalCall)] - public extern static object Exchange(ref object location1, object value); + extern static void Exchange (ref object location1, ref object value, ref object result); + + [ReliabilityContract (Consistency.WillNotCorruptState, Cer.Success)] + public static object Exchange (ref object location1, object value) + { + // See CompareExchange(object) for comments. + // + object result = null; + Exchange (ref location1, ref value, ref result); + return result; + } [MethodImplAttribute(MethodImplOptions.InternalCall)] public extern static float Exchange(ref float location1, float value); @@ -92,9 +122,29 @@ namespace System.Threading public extern static double CompareExchange(ref double location1, double value, double comparand); [ComVisible (false)] - [MethodImplAttribute(MethodImplOptions.InternalCall)] [ReliabilityContract (Consistency.WillNotCorruptState, Cer.Success)] - public extern static T CompareExchange (ref T location1, T value, T comparand) where T:class; + [Intrinsic] + public static T CompareExchange (ref T location1, T value, T comparand) where T : class + { + unsafe { + if (Unsafe.AsPointer (ref location1) == null) + throw new NullReferenceException (); + } + // Besides avoiding coop handles for efficiency, + // and correctness, this also appears needed to + // avoid an assertion failure in the runtime, related to + // coop handles over generics. + // + // See CompareExchange(object) for more comments. + // + // This is not entirely convincing due to lack of volatile. + // + T result = null; + // T : class so call the object overload. + CompareExchange (ref Unsafe.As (ref location1), ref Unsafe.As(ref value), ref Unsafe.As(ref comparand), ref Unsafe.As(ref result)); + return result; + } + [MethodImplAttribute(MethodImplOptions.InternalCall)] public extern static long Exchange(ref long location1, long value); @@ -107,9 +157,23 @@ namespace System.Threading public extern static double Exchange(ref double location1, double value); [ComVisible (false)] - [MethodImplAttribute(MethodImplOptions.InternalCall)] [ReliabilityContract (Consistency.WillNotCorruptState, Cer.Success)] - public extern static T Exchange (ref T location1, T value) where T:class; + [Intrinsic] + public static T Exchange (ref T location1, T value) where T : class + { + unsafe { + if (Unsafe.AsPointer (ref location1) == null) + throw new NullReferenceException (); + } + // See CompareExchange(T) for comments. + // + // This is not entirely convincing due to lack of volatile. + // + T result = null; + // T : class so call the object overload. + Exchange (ref Unsafe.As(ref location1), ref Unsafe.As(ref value), ref Unsafe.As(ref result)); + return result; + } [MethodImplAttribute(MethodImplOptions.InternalCall)] public extern static long Read(ref long location); diff --git a/mcs/class/corlib/System.Threading/Thread.cs b/mcs/class/corlib/System.Threading/Thread.cs index 9e03e23962..cbc56275f9 100644 --- a/mcs/class/corlib/System.Threading/Thread.cs +++ b/mcs/class/corlib/System.Threading/Thread.cs @@ -54,8 +54,10 @@ namespace System.Threading { IntPtr handle; IntPtr native_handle; // used only on Win32 /* accessed only from unmanaged code */ - private IntPtr name; - private int name_len; + private IntPtr name_chars; + private IntPtr name_generation; + private int name_free; + private int name_length; private ThreadState state; private object abort_exc; private int abort_state_handle; @@ -403,7 +405,13 @@ namespace System.Threading { private extern static string GetName_internal (InternalThread thread); [MethodImplAttribute(MethodImplOptions.InternalCall)] - private extern static void SetName_internal (InternalThread thread, String name); + private static unsafe extern void SetName_icall (InternalThread thread, char *name, int nameLength); + + private static unsafe void SetName_internal (InternalThread thread, String name) + { + fixed (char* fixed_name = name) + SetName_icall (thread, fixed_name, name?.Length ?? 0); + } /* * The thread name must be shared by appdomains, so it is stored in diff --git a/mcs/class/corlib/System/AppDomain.cs b/mcs/class/corlib/System/AppDomain.cs index 0b72b70f0d..a4dd2bbd1f 100644 --- a/mcs/class/corlib/System/AppDomain.cs +++ b/mcs/class/corlib/System/AppDomain.cs @@ -758,7 +758,7 @@ namespace System { throw new FileNotFoundException (null, assemblyRef.Name); string cb = assemblyRef.CodeBase; - if (cb.ToLower (CultureInfo.InvariantCulture).StartsWith ("file://")) + if (cb.StartsWith ("file://", StringComparison.OrdinalIgnoreCase)) cb = new Mono.Security.Uri (cb).LocalPath; try { diff --git a/mcs/class/corlib/System/AppDomainSetup.cs b/mcs/class/corlib/System/AppDomainSetup.cs index fd43c4ae4d..7aea11883d 100644 --- a/mcs/class/corlib/System/AppDomainSetup.cs +++ b/mcs/class/corlib/System/AppDomainSetup.cs @@ -31,6 +31,7 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // +using System.Globalization; using System.Collections.Generic; using System.IO; using System.Runtime.CompilerServices; @@ -142,9 +143,8 @@ namespace System if (appBase == null) return null; - int len = appBase.Length; - if (len >= 8 && appBase.ToLower ().StartsWith ("file://")) { - appBase = appBase.Substring (7); + if (appBase.StartsWith ("file://", StringComparison.OrdinalIgnoreCase)) { + appBase = new Mono.Security.Uri (appBase).LocalPath; if (Path.DirectorySeparatorChar != '/') appBase = appBase.Replace ('/', Path.DirectorySeparatorChar); } diff --git a/mcs/class/corlib/System/CStreamWriter.cs b/mcs/class/corlib/System/CStreamWriter.cs index 215b0abee8..181171af9a 100644 --- a/mcs/class/corlib/System/CStreamWriter.cs +++ b/mcs/class/corlib/System/CStreamWriter.cs @@ -166,6 +166,12 @@ namespace System.IO { } } } + + public override void WriteLine (string val) + { + Write (val); + Write (NewLine); + } } } #endif diff --git a/mcs/class/corlib/System/TimeZoneInfo.cs b/mcs/class/corlib/System/TimeZoneInfo.cs index 6dd7c955a5..e41d897c01 100644 --- a/mcs/class/corlib/System/TimeZoneInfo.cs +++ b/mcs/class/corlib/System/TimeZoneInfo.cs @@ -1254,8 +1254,11 @@ namespace System private static DateTime TransitionPoint (TransitionTime transition, int year) { - if (transition.IsFixedDateRule) - return new DateTime (year, transition.Month, transition.Day) + transition.TimeOfDay.TimeOfDay; + if (transition.IsFixedDateRule) { + var daysInMonth = DateTime.DaysInMonth (year, transition.Month); + var transitionDay = transition.Day <= daysInMonth ? transition.Day : daysInMonth; + return new DateTime (year, transition.Month, transitionDay) + transition.TimeOfDay.TimeOfDay; + } DayOfWeek first = (new DateTime (year, transition.Month, 1)).DayOfWeek; int day = 1 + (transition.Week - 1) * 7 + (transition.DayOfWeek - first + 7) % 7; diff --git a/mcs/class/corlib/Test/Mono/MonoNativePlatformType.cs b/mcs/class/corlib/Test/Mono/MonoNativePlatformType.cs index aabf87b7dc..0ad30ec0b2 100644 --- a/mcs/class/corlib/Test/Mono/MonoNativePlatformType.cs +++ b/mcs/class/corlib/Test/Mono/MonoNativePlatformType.cs @@ -39,6 +39,7 @@ namespace Mono MONO_NATIVE_PLATFORM_TYPE_ANDROID = 5, MONO_NATIVE_PLATFORM_TYPE_FREEBSD = 6, MONO_NATIVE_PLATFORM_TYPE_HAIKU = 7, + MONO_NATIVE_PLATFORM_TYPE_NETBSD = 8, MONO_NATIVE_PLATFORM_TYPE_IPHONE = 0x100, MONO_NATIVE_PLATFORM_TYPE_TV = 0x200, diff --git a/mcs/class/corlib/Test/System.Security.Permissions/SiteIdentityPermissionTest.cs b/mcs/class/corlib/Test/System.Security.Permissions/SiteIdentityPermissionTest.cs index 6ea768095f..fa9fb9e9bf 100644 --- a/mcs/class/corlib/Test/System.Security.Permissions/SiteIdentityPermissionTest.cs +++ b/mcs/class/corlib/Test/System.Security.Permissions/SiteIdentityPermissionTest.cs @@ -54,6 +54,7 @@ namespace MonoTests.System.Security.Permissions { "*www.mono-project.com", "*-project.com", "www.*.com", + "www.mono-project.com*" }; [Category ("NotWorking")] diff --git a/mcs/class/corlib/Test/System/AppDomainSetupTest.cs b/mcs/class/corlib/Test/System/AppDomainSetupTest.cs index 387d0318a3..6d62357094 100644 --- a/mcs/class/corlib/Test/System/AppDomainSetupTest.cs +++ b/mcs/class/corlib/Test/System/AppDomainSetupTest.cs @@ -198,6 +198,25 @@ namespace MonoTests.System } } + [Test] + public void ApplicationBase9 () + { + AppDomainSetup setup = new AppDomainSetup (); + string url = "file://"; + if (RunningOnWindows) + { + url += "/" + Environment.CurrentDirectory; + setup.ApplicationBase = url; + Assert.AreEqual (Environment.CurrentDirectory, setup.ApplicationBase); + } + else + { + url += "/home"; + setup.ApplicationBase = url; + Assert.AreEqual ("/home", setup.ApplicationBase); + } + } + #if MONO_FEATURE_MULTIPLE_APPDOMAINS [Test] #if MOBILE diff --git a/mcs/class/corlib/Test/System/AttributeTest.cs b/mcs/class/corlib/Test/System/AttributeTest.cs index 11b32e6c7b..7b1a0530dc 100644 --- a/mcs/class/corlib/Test/System/AttributeTest.cs +++ b/mcs/class/corlib/Test/System/AttributeTest.cs @@ -1252,6 +1252,27 @@ namespace MonoTests.System Assert.AreEqual (1, attrs.Length); } + [Test] + public void GetCustomAttributesOnOpenGenericMethodOverride () + { + // Regression test for https://github.com/mono/mono/issues/17278 + /* The issue is in how we pass along the generic + * instantiation. So there are two parts here: we + * start with a method on a GTD which has to decompose + * into the GTD and it's instantiation with its own + * generic parameters, and then we go up to its parent + * and grandparent inflating and decomposing the + * resulting instantiation. The instantiations keep + * passing the last parameter as the number of + * parameters shrinks so that the gparam index from the + * original type is now out of bounds for the parent + * and grandparent. If we mess up, we'll get a + * BadImageFormatException from the runtime. */ + var m = typeof (Three<,,>).GetMethod ("Foo"); + var attrs = Attribute.GetCustomAttributes(m, typeof(MyCAttr), true); + Assert.AreEqual (1, attrs.Length); + } + class EvtBase { public virtual event EventHandler Event {add {} remove {}} @@ -1268,6 +1289,20 @@ namespace MonoTests.System public override event EventHandler Event {add {} remove {}} } + abstract class One { + [MyCAttr] + public abstract A Foo (); + } + + abstract class Two : One { + } + + class Three : Two { + public override R Foo () { + throw new Exception ("Doesn't matter"); + } + } + [Test] //Regression test for #662867 public void GetCustomAttributesOnEventOverride () { diff --git a/mcs/class/corlib/Test/System/TimeZoneInfoTest.cs b/mcs/class/corlib/Test/System/TimeZoneInfoTest.cs index e166487ef6..c762bd158e 100644 --- a/mcs/class/corlib/Test/System/TimeZoneInfoTest.cs +++ b/mcs/class/corlib/Test/System/TimeZoneInfoTest.cs @@ -56,12 +56,12 @@ namespace MonoTests.System return "GTB Standard Time"; case "Europe/Chisinau": return "E. Europe Standard Time"; - case "US/Eastern": + case "America/New_York": return "Eastern Standard Time"; case "America/Chicago": case "US/Central": return "Central Standard Time"; - case "US/Pacific": + case "America/Los_Angeles": return "Pacific Standard Time"; case "Australia/Sydney": case "Australia/Melbourne": @@ -84,7 +84,7 @@ namespace MonoTests.System case "Europe/Oslo": case "Europe/San_Marino": return "W. Europe Standard Time"; - case "Canada/Eastern": + case "America/Toronto": return "Eastern Standard Time"; case "Asia/Tehran": return "Iran Standard Time"; @@ -482,26 +482,38 @@ namespace MonoTests.System Assert.IsTrue (tzi.IsDaylightSavingTime (dateOffset)); } + // https://github.com/mono/mono/issues/16742 + [Test] + public void Bug_16472 () + { + var parsedTime = DateTime.Parse ("1948-02-19T23:00:00Z", CultureInfo.InvariantCulture); + var newTime = TimeZoneInfo.ConvertTime (parsedTime, TimeZoneInfo.FindSystemTimeZoneById (MapTimeZoneId ("Europe/Rome"))); + Assert.AreEqual (1948, newTime.Year); + } + // https://github.com/mono/mono/issues/9664 [Test] public void Bug_9664 () { - TimeZoneInfo tzi = TimeZoneInfo.FindSystemTimeZoneById (MapTimeZoneId ("US/Central")); + TimeZoneInfo tzi; + try { + tzi = TimeZoneInfo.FindSystemTimeZoneById (MapTimeZoneId ("US/Central")); + } catch (TimeZoneNotFoundException e) { + Assert.Ignore ("Timezone US/Central not found."); + return; + } var date = new DateTime (2019, 3, 9, 21, 0, 0); Assert.IsFalse (tzi.IsDaylightSavingTime (date)); Assert.AreEqual (new TimeSpan (-6, 0, 0), tzi.GetUtcOffset (date)); - tzi = TimeZoneInfo.FindSystemTimeZoneById (MapTimeZoneId ("US/Central")); date = new DateTime (2019, 3, 10, 2, 0, 0); Assert.IsFalse (tzi.IsDaylightSavingTime (date)); Assert.AreEqual (new TimeSpan (-6, 0, 0), tzi.GetUtcOffset (date)); - tzi = TimeZoneInfo.FindSystemTimeZoneById (MapTimeZoneId ("US/Central")); date = new DateTime (2019, 3, 10, 2, 30, 0); Assert.IsFalse (tzi.IsDaylightSavingTime (date)); Assert.AreEqual (new TimeSpan (-6, 0, 0), tzi.GetUtcOffset (date)); - tzi = TimeZoneInfo.FindSystemTimeZoneById (MapTimeZoneId ("US/Central")); date = new DateTime (2019, 3, 10, 3, 0, 0); Assert.IsTrue (tzi.IsDaylightSavingTime (date)); Assert.AreEqual (new TimeSpan (-5, 0, 0), tzi.GetUtcOffset (date)); @@ -533,207 +545,207 @@ namespace MonoTests.System new DateTime (2020, 3, 8, 0, 0, 0), new DateTime (2020, 3, 8, 0, 30, 0), new DateTime (2020, 3, 8, 1, 0, 0), new TimeSpan (-5, 0, 0), new TimeSpan (-4, 0, 0)); - // US, Kansas City, MO (US Central Time): Jumps ahead at 2:00 AM on 3/8/2020 to 3:00 AM + // US, Kansas City, MO (US Central Time): Jumps ahead at 2:00 AM on 3/8/2020 to 3:00 AM CheckJumpingIntoDST ("America/Chicago", new DateTime (2020, 3, 8, 2, 0, 0), new DateTime (2020, 3, 8, 2, 30, 0), new DateTime (2020, 3, 8, 3, 0, 0), new TimeSpan (-6, 0, 0), new TimeSpan (-5, 0, 0)); - // Anchorage, AK (Alaska Time): Jumps ahead at 2:00 AM on 3/8/2020 to 3:00 AM + // Anchorage, AK (Alaska Time): Jumps ahead at 2:00 AM on 3/8/2020 to 3:00 AM CheckJumpingIntoDST ("America/Anchorage", new DateTime (2020, 3, 8, 2, 0, 0), new DateTime (2020, 3, 8, 2, 30, 0), new DateTime (2020, 3, 8, 3, 0, 0), new TimeSpan (-9, 0, 0), new TimeSpan (-8, 0, 0)); - // Azores ST (Ponta Delgada, Portugal): Jumps ahead at 12:00 AM on 3/29/2020 to 1:00 AM + // Azores ST (Ponta Delgada, Portugal): Jumps ahead at 12:00 AM on 3/29/2020 to 1:00 AM CheckJumpingIntoDST ("Atlantic/Azores", new DateTime (2020, 3, 29, 0, 0, 0), new DateTime (2020, 3, 29, 0, 30, 0), new DateTime (2020, 3, 29, 1, 0, 0), new TimeSpan (-1, 0, 0), new TimeSpan (0, 0, 0)); - - // Iran, Tehran (Iran ST): Jumps ahead at 12:00 AM on 3/21/2020 to 1:00 AM + + // Iran, Tehran (Iran ST): Jumps ahead at 12:00 AM on 3/21/2020 to 1:00 AM CheckJumpingIntoDST ("Asia/Tehran", new DateTime (2020, 3, 21, 0, 0, 0), new DateTime (2020, 3, 21, 0, 30, 0), new DateTime (2020, 3, 21, 1, 0, 0), new TimeSpan (3, 30, 0), new TimeSpan (4, 30, 0)); - - // Israel, Jerusalem (Israel ST): Jumps ahead at 2:00 AM on 3/27/2020 to 3:00 AM + + // Israel, Jerusalem (Israel ST): Jumps ahead at 2:00 AM on 3/27/2020 to 3:00 AM CheckJumpingIntoDST ("Asia/Jerusalem", new DateTime (2020, 3, 27, 2, 0, 0), new DateTime (2020, 3, 27, 2, 30, 0), new DateTime (2020, 3, 27, 3, 0, 0), new TimeSpan (2, 0, 0), new TimeSpan (3, 0, 0)); - // Jordan, Amman (Eastern European ST): Jumps ahead at 12:00 AM on 3/27/2020 to 1:00 AM + // Jordan, Amman (Eastern European ST): Jumps ahead at 12:00 AM on 3/27/2020 to 1:00 AM CheckJumpingIntoDST ("Asia/Amman", new DateTime (2020, 3, 27, 0, 0, 0), new DateTime (2020, 3, 27, 0, 30, 0), new DateTime (2020, 3, 27, 1, 0, 0), new TimeSpan (2, 0, 0), new TimeSpan (3, 0, 0)); - // Albania, Tirana (Central European ST): Jumps ahead at 2:00 AM on 3/29/2020 to 3:00 AM + // Albania, Tirana (Central European ST): Jumps ahead at 2:00 AM on 3/29/2020 to 3:00 AM CheckJumpingIntoDST ("Europe/Tirane", new DateTime (2020, 3, 29, 2, 0, 0), new DateTime (2020, 3, 29, 2, 30, 0), new DateTime (2020, 3, 29, 3, 0, 0), new TimeSpan (1, 0, 0), new TimeSpan (2, 0, 0)); - // Austria, Vienna (Central European ST): Jumps ahead at 2:00 AM on 3/29/2020 to 3:00 AM + // Austria, Vienna (Central European ST): Jumps ahead at 2:00 AM on 3/29/2020 to 3:00 AM CheckJumpingIntoDST ("Europe/Vienna", new DateTime (2020, 3, 29, 2, 0, 0), new DateTime (2020, 3, 29, 2, 30, 0), new DateTime (2020, 3, 29, 3, 0, 0), new TimeSpan (1, 0, 0), new TimeSpan (2, 0, 0)); - // Belgium, Brussels (Central European ST): Jumps ahead at 2:00 AM on 3/29/2020 to 3:00 AM + // Belgium, Brussels (Central European ST): Jumps ahead at 2:00 AM on 3/29/2020 to 3:00 AM CheckJumpingIntoDST ("Europe/Brussels", new DateTime (2020, 3, 29, 2, 0, 0), new DateTime (2020, 3, 29, 2, 30, 0), new DateTime (2020, 3, 29, 3, 0, 0), new TimeSpan (1, 0, 0), new TimeSpan (2, 0, 0)); - // Bulgaria, Sofia (Eastern European ST): Jumps ahead at 3:00 AM on 3/29/2020 to 4:00 AM + // Bulgaria, Sofia (Eastern European ST): Jumps ahead at 3:00 AM on 3/29/2020 to 4:00 AM CheckJumpingIntoDST ("Europe/Sofia", new DateTime (2020, 3, 29, 3, 0, 0), new DateTime (2020, 3, 29, 3, 30, 0), new DateTime (2020, 3, 29, 4, 0, 0), new TimeSpan (2, 0, 0), new TimeSpan (3, 0, 0)); - // Czechia, Prague (Central European ST): Jumps ahead at 2:00 AM on 3/29/2020 to 3:00 AM + // Czechia, Prague (Central European ST): Jumps ahead at 2:00 AM on 3/29/2020 to 3:00 AM CheckJumpingIntoDST ("Europe/Prague", new DateTime (2020, 3, 29, 2, 0, 0), new DateTime (2020, 3, 29, 2, 30, 0), new DateTime (2020, 3, 29, 3, 0, 0), new TimeSpan (1, 0, 0), new TimeSpan (2, 0, 0)); - // Denmark, Copenhagen (Central European ST): Jumps ahead at 2:00 AM on 3/29/2020 to 3:00 AM + // Denmark, Copenhagen (Central European ST): Jumps ahead at 2:00 AM on 3/29/2020 to 3:00 AM CheckJumpingIntoDST ("Europe/Copenhagen", new DateTime (2020, 3, 29, 2, 0, 0), new DateTime (2020, 3, 29, 2, 30, 0), new DateTime (2020, 3, 29, 3, 0, 0), new TimeSpan (1, 0, 0), new TimeSpan (2, 0, 0)); - // Estonia, Tallinn (Eastern European ST): Jumps ahead at 3:00 AM on 3/29/2020 to 4:00 AM + // Estonia, Tallinn (Eastern European ST): Jumps ahead at 3:00 AM on 3/29/2020 to 4:00 AM CheckJumpingIntoDST ("Europe/Tallinn", new DateTime (2020, 3, 29, 3, 0, 0), new DateTime (2020, 3, 29, 3, 30, 0), new DateTime (2020, 3, 29, 4, 0, 0), new TimeSpan (2, 0, 0), new TimeSpan (3, 0, 0)); - // France, Paris (Central European ST): Jumps ahead at 2:00 AM on 3/29/2020 to 3:00 AM + // France, Paris (Central European ST): Jumps ahead at 2:00 AM on 3/29/2020 to 3:00 AM CheckJumpingIntoDST ("Europe/Paris", new DateTime (2020, 3, 29, 2, 0, 0), new DateTime (2020, 3, 29, 2, 30, 0), new DateTime (2020, 3, 29, 3, 0, 0), new TimeSpan (1, 0, 0), new TimeSpan (2, 0, 0)); - // Germany, Berlin (Central European ST): Jumps ahead at 2:00 AM on 3/29/2020 to 3:00 AM + // Germany, Berlin (Central European ST): Jumps ahead at 2:00 AM on 3/29/2020 to 3:00 AM CheckJumpingIntoDST ("Europe/Berlin", new DateTime (2020, 3, 29, 2, 0, 0), new DateTime (2020, 3, 29, 2, 30, 0), new DateTime (2020, 3, 29, 3, 0, 0), new TimeSpan (1, 0, 0), new TimeSpan (2, 0, 0)); - // Greece, Athens (Eastern European ST): Jumps ahead at 3:00 AM on 3/29/2020 to 4:00 AM + // Greece, Athens (Eastern European ST): Jumps ahead at 3:00 AM on 3/29/2020 to 4:00 AM CheckJumpingIntoDST ("Europe/Athens", new DateTime (2020, 3, 29, 3, 0, 0), new DateTime (2020, 3, 29, 3, 30, 0), new DateTime (2020, 3, 29, 4, 0, 0), new TimeSpan (2, 0, 0), new TimeSpan (3, 0, 0)); - // Guernsey (UK) Jumps ahead at 1:00 AM on 3/29/2020 to 2:00 AM + // Guernsey (UK) Jumps ahead at 1:00 AM on 3/29/2020 to 2:00 AM CheckJumpingIntoDST ("Europe/Guernsey", new DateTime (2020, 3, 29, 1, 0, 0), new DateTime (2020, 3, 29, 1, 30, 0), new DateTime (2020, 3, 29, 2, 0, 0), new TimeSpan (0, 0, 0), new TimeSpan (1, 0, 0)); - // Holy See, Vatican City (Central European ST): Jumps ahead at 2:00 AM on 3/29/2020 to 3:00 AM + // Holy See, Vatican City (Central European ST): Jumps ahead at 2:00 AM on 3/29/2020 to 3:00 AM CheckJumpingIntoDST ("Europe/Vatican", new DateTime (2020, 3, 29, 2, 0, 0), new DateTime (2020, 3, 29, 2, 30, 0), new DateTime (2020, 3, 29, 3, 0, 0), new TimeSpan (1, 0, 0), new TimeSpan (2, 0, 0)); - // Hungary, Budapest (Central European ST): Jumps ahead at 2:00 AM on 3/29/2020 to 3:00 AM + // Hungary, Budapest (Central European ST): Jumps ahead at 2:00 AM on 3/29/2020 to 3:00 AM CheckJumpingIntoDST ("Europe/Budapest", new DateTime (2020, 3, 29, 2, 0, 0), new DateTime (2020, 3, 29, 2, 30, 0), new DateTime (2020, 3, 29, 3, 0, 0), new TimeSpan (1, 0, 0), new TimeSpan (2, 0, 0)); - // // Ireland, Dublin (Greenwich Mean Time -> Irish Standard Time): Jumps ahead at 1:00 AM on 3/29/2020 to 2:00 AM + // // Ireland, Dublin (Greenwich Mean Time -> Irish Standard Time): Jumps ahead at 1:00 AM on 3/29/2020 to 2:00 AM // CheckJumpingIntoDST ("Europe/Dublin", // new DateTime (2020, 3, 29, 1, 0, 0), new DateTime (2020, 3, 29, 1, 30, 0), new DateTime (2020, 3, 29, 2, 0, 0), // new TimeSpan (0, 0, 0), new TimeSpan (1, 0, 0)); - // UK, Douglas, Isle of Man (GMT+1:00): Jumps ahead at 1:00 AM on 3/29/2020 to 2:00 AM + // UK, Douglas, Isle of Man (GMT+1:00): Jumps ahead at 1:00 AM on 3/29/2020 to 2:00 AM CheckJumpingIntoDST ("Europe/Isle_of_Man", new DateTime (2020, 3, 29, 1, 0, 0), new DateTime (2020, 3, 29, 1, 30, 0), new DateTime (2020, 3, 29, 2, 0, 0), new TimeSpan (0, 0, 0), new TimeSpan (1, 0, 0)); - // Italy, Rome (Central European ST): Jumps ahead at 2:00 AM on 3/29/2020 to 3:00 AM + // Italy, Rome (Central European ST): Jumps ahead at 2:00 AM on 3/29/2020 to 3:00 AM CheckJumpingIntoDST ("Europe/Rome", new DateTime (2020, 3, 29, 2, 0, 0), new DateTime (2020, 3, 29, 2, 30, 0), new DateTime (2020, 3, 29, 3, 0, 0), new TimeSpan (1, 0, 0), new TimeSpan (2, 0, 0)); - // Jersey (UK): Jumps ahead at 1:00 AM on 3/29/2020 to 2:00 AM + // Jersey (UK): Jumps ahead at 1:00 AM on 3/29/2020 to 2:00 AM CheckJumpingIntoDST ("Europe/Jersey", new DateTime (2020, 3, 29, 1, 0, 0), new DateTime (2020, 3, 29, 1, 30, 0), new DateTime (2020, 3, 29, 2, 0, 0), new TimeSpan (0, 0, 0), new TimeSpan (1, 0, 0)); - // Latvia, Riga (Eastern European ST): Jumps ahead at 3:00 AM on 3/29/2020 to 4:00 AM + // Latvia, Riga (Eastern European ST): Jumps ahead at 3:00 AM on 3/29/2020 to 4:00 AM CheckJumpingIntoDST ("Europe/Riga", new DateTime (2020, 3, 29, 3, 0, 0), new DateTime (2020, 3, 29, 3, 30, 0), new DateTime (2020, 3, 29, 4, 0, 0), new TimeSpan (2, 0, 0), new TimeSpan (3, 0, 0)); - // Lithuania, Vilnius (Eastern European ST): Jumps ahead at 3:00 AM on 3/29/2020 to 4:00 AM + // Lithuania, Vilnius (Eastern European ST): Jumps ahead at 3:00 AM on 3/29/2020 to 4:00 AM CheckJumpingIntoDST ("Europe/Vilnius", new DateTime (2020, 3, 29, 3, 0, 0), new DateTime (2020, 3, 29, 3, 30, 0), new DateTime (2020, 3, 29, 4, 0, 0), new TimeSpan (2, 0, 0), new TimeSpan (3, 0, 0)); - // Luxembourg, Luxembourg (Central European ST): Jumps ahead at 2:00 AM on 3/29/2020 to 3:00 AM + // Luxembourg, Luxembourg (Central European ST): Jumps ahead at 2:00 AM on 3/29/2020 to 3:00 AM CheckJumpingIntoDST ("Europe/Luxembourg", new DateTime (2020, 3, 29, 2, 0, 0), new DateTime (2020, 3, 29, 2, 30, 0), new DateTime (2020, 3, 29, 3, 0, 0), new TimeSpan (1, 0, 0), new TimeSpan (2, 0, 0)); - // Malta, Valletta (Central European ST): Jumps ahead at 2:00 AM on 3/29/2020 to 3:00 AM + // Malta, Valletta (Central European ST): Jumps ahead at 2:00 AM on 3/29/2020 to 3:00 AM CheckJumpingIntoDST ("Europe/Malta", new DateTime (2020, 3, 29, 2, 0, 0), new DateTime (2020, 3, 29, 2, 30, 0), new DateTime (2020, 3, 29, 3, 0, 0), new TimeSpan (1, 0, 0), new TimeSpan (2, 0, 0)); - // Moldova, ChiÅŸinău (Eastern European ST): Jumps ahead at 2:00 AM on 3/29/2020 to 3:00 AM + // Moldova, ChiÅŸinău (Eastern European ST): Jumps ahead at 2:00 AM on 3/29/2020 to 3:00 AM CheckJumpingIntoDST ("Europe/Chisinau", new DateTime (2020, 3, 29, 2, 0, 0), new DateTime (2020, 3, 29, 2, 30, 0), new DateTime (2020, 3, 29, 3, 0, 0), new TimeSpan (2, 0, 0), new TimeSpan (3, 0, 0)); - // Monaco, Monaco (Central European ST): Jumps ahead at 2:00 AM on 3/29/2020 to 3:00 AM + // Monaco, Monaco (Central European ST): Jumps ahead at 2:00 AM on 3/29/2020 to 3:00 AM CheckJumpingIntoDST ("Europe/Monaco", new DateTime (2020, 3, 29, 2, 0, 0), new DateTime (2020, 3, 29, 2, 30, 0), new DateTime (2020, 3, 29, 3, 0, 0), new TimeSpan (1, 0, 0), new TimeSpan (2, 0, 0)); - // Netherlands, Amsterdam (Central European ST): Jumps ahead at 2:00 AM on 3/29/2020 to 3:00 AM + // Netherlands, Amsterdam (Central European ST): Jumps ahead at 2:00 AM on 3/29/2020 to 3:00 AM CheckJumpingIntoDST ("Europe/Amsterdam", new DateTime (2020, 3, 29, 2, 0, 0), new DateTime (2020, 3, 29, 2, 30, 0), new DateTime (2020, 3, 29, 3, 0, 0), new TimeSpan (1, 0, 0), new TimeSpan (2, 0, 0)); - // Norway, Oslo (Central European ST): Jumps ahead at 2:00 AM on 3/29/2020 to 3:00 AM + // Norway, Oslo (Central European ST): Jumps ahead at 2:00 AM on 3/29/2020 to 3:00 AM CheckJumpingIntoDST ("Europe/Oslo", new DateTime (2020, 3, 29, 2, 0, 0), new DateTime (2020, 3, 29, 2, 30, 0), new DateTime (2020, 3, 29, 3, 0, 0), new TimeSpan (1, 0, 0), new TimeSpan (2, 0, 0)); - // Poland, Warsaw (Central European ST): Jumps ahead at 2:00 AM on 3/29/2020 to 3:00 AM + // Poland, Warsaw (Central European ST): Jumps ahead at 2:00 AM on 3/29/2020 to 3:00 AM CheckJumpingIntoDST ("Europe/Warsaw", new DateTime (2020, 3, 29, 2, 0, 0), new DateTime (2020, 3, 29, 2, 30, 0), new DateTime (2020, 3, 29, 3, 0, 0), new TimeSpan (1, 0, 0), new TimeSpan (2, 0, 0)); - // Portugal, Lisbon (Western European ST): Jumps ahead at 1:00 AM on 3/29/2020 to 2:00 AM + // Portugal, Lisbon (Western European ST): Jumps ahead at 1:00 AM on 3/29/2020 to 2:00 AM CheckJumpingIntoDST ("Europe/Lisbon", new DateTime (2020, 3, 29, 1, 0, 0), new DateTime (2020, 3, 29, 1, 30, 0), new DateTime (2020, 3, 29, 2, 0, 0), new TimeSpan (0, 0, 0), new TimeSpan (1, 0, 0)); - // San Marino, San Marino (Central European ST): Jumps ahead at 2:00 AM on 3/29/2020 to 3:00 AM + // San Marino, San Marino (Central European ST): Jumps ahead at 2:00 AM on 3/29/2020 to 3:00 AM CheckJumpingIntoDST ("Europe/San_Marino", new DateTime (2020, 3, 29, 2, 0, 0), new DateTime (2020, 3, 29, 2, 30, 0), new DateTime (2020, 3, 29, 3, 0, 0), new TimeSpan (1, 0, 0), new TimeSpan (2, 0, 0)); - // Slovakia, Bratislava (Central European ST): Jumps ahead at 2:00 AM on 3/29/2020 to 3:00 AM + // Slovakia, Bratislava (Central European ST): Jumps ahead at 2:00 AM on 3/29/2020 to 3:00 AM CheckJumpingIntoDST ("Europe/Bratislava", new DateTime (2020, 3, 29, 2, 0, 0), new DateTime (2020, 3, 29, 2, 30, 0), new DateTime (2020, 3, 29, 3, 0, 0), new TimeSpan (1, 0, 0), new TimeSpan (2, 0, 0)); - // Spain, Madrid (Central European ST): Jumps ahead at 2:00 AM on 3/29/2020 to 3:00 AM + // Spain, Madrid (Central European ST): Jumps ahead at 2:00 AM on 3/29/2020 to 3:00 AM CheckJumpingIntoDST ("Europe/Madrid", new DateTime (2020, 3, 29, 2, 0, 0), new DateTime (2020, 3, 29, 2, 30, 0), new DateTime (2020, 3, 29, 3, 0, 0), new TimeSpan (1, 0, 0), new TimeSpan (2, 0, 0)); - // Ukraine, Kiev (Eastern European ST): Jumps ahead at 3:00 AM on 3/29/2020 to 4:00 AM + // Ukraine, Kiev (Eastern European ST): Jumps ahead at 3:00 AM on 3/29/2020 to 4:00 AM CheckJumpingIntoDST ("Europe/Kiev", new DateTime (2020, 3, 29, 3, 0, 0), new DateTime (2020, 3, 29, 3, 30, 0), new DateTime (2020, 3, 29, 4, 0, 0), new TimeSpan (2, 0, 0), new TimeSpan (3, 0, 0)); - // United Kingdom, London (British ST): Jumps ahead at 1:00 AM on 3/29/2020 to 2:00 AM + // United Kingdom, London (British ST): Jumps ahead at 1:00 AM on 3/29/2020 to 2:00 AM CheckJumpingIntoDST ("Europe/London", new DateTime (2020, 3, 29, 1, 0, 0), new DateTime (2020, 3, 29, 1, 30, 0), new DateTime (2020, 3, 29, 2, 0, 0), new TimeSpan (0, 0, 0), new TimeSpan (1, 0, 0)); } - void CheckJumpingIntoDST (string tzId, DateTime dstDeltaStart, DateTime inDstDelta, DateTime dstDeltaEnd, TimeSpan baseOffset, TimeSpan dstOffset) + void CheckJumpingIntoDST (string tzId, DateTime dstDeltaStart, DateTime inDstDelta, DateTime dstDeltaEnd, TimeSpan baseOffset, TimeSpan dstOffset) { var tzi = TimeZoneInfo.FindSystemTimeZoneById (MapTimeZoneId (tzId)); Assert.IsFalse (tzi.IsDaylightSavingTime (dstDeltaStart), $"{tzId}: #1"); Assert.AreEqual (baseOffset, tzi.GetUtcOffset (dstDeltaStart), $"{tzId}: #2"); - Assert.IsFalse (tzi.IsDaylightSavingTime (inDstDelta), $"{tzId}: #3"); + Assert.IsFalse (tzi.IsDaylightSavingTime (inDstDelta), $"{tzId}: #3"); Assert.AreEqual (baseOffset, tzi.GetUtcOffset (inDstDelta), $"{tzId}: #4"); - Assert.IsTrue (tzi.IsDaylightSavingTime (dstDeltaEnd), $"{tzId}: #5"); + Assert.IsTrue (tzi.IsDaylightSavingTime (dstDeltaEnd), $"{tzId}: #5"); Assert.AreEqual (dstOffset, tzi.GetUtcOffset (dstDeltaEnd), $"{tzId}: #6"); } } @@ -998,8 +1010,8 @@ namespace MonoTests.System [Test (Description="Fix the bug https://bugzilla.xamarin.com/show_bug.cgi?id=1849")] public void ConvertTime_AjustmentConvertTimeWithSourceTimeZone () { - TimeZoneInfo easternTimeZone = TimeZoneInfo.FindSystemTimeZoneById (MapTimeZoneId ("US/Eastern")); - TimeZoneInfo pacificTimeZone = TimeZoneInfo.FindSystemTimeZoneById (MapTimeZoneId ("US/Pacific")); + TimeZoneInfo easternTimeZone = TimeZoneInfo.FindSystemTimeZoneById (MapTimeZoneId ("America/New_York")); + TimeZoneInfo pacificTimeZone = TimeZoneInfo.FindSystemTimeZoneById (MapTimeZoneId ("America/Los_Angeles")); DateTime lastMidnight = new DateTime (new DateTime (2012, 06, 13).Ticks, DateTimeKind.Unspecified); DateTime lastMidnightAsEST = TimeZoneInfo.ConvertTime (lastMidnight, pacificTimeZone, easternTimeZone); @@ -1276,7 +1288,6 @@ namespace MonoTests.System "Europe/Dublin", // Europe/Dublin has a DST offset of 34 minutes and 39 seconds in 1916. "Europe/Amsterdam", "America/St_Johns", - "Canada/Newfoundland", "Europe/Moscow", "Europe/Riga", }; diff --git a/mcs/class/corlib/Test/System/TimeZoneTest.cs b/mcs/class/corlib/Test/System/TimeZoneTest.cs index 9cb66e6a53..066be7ebdd 100644 --- a/mcs/class/corlib/Test/System/TimeZoneTest.cs +++ b/mcs/class/corlib/Test/System/TimeZoneTest.cs @@ -364,7 +364,7 @@ public class TimeZoneTest { [Category ("NotWasm")] public void FindSystemTimeZoneById () { - TimeZoneInfo tzi = TimeZoneInfo.FindSystemTimeZoneById (TimeZoneInfoTest.MapTimeZoneId ("Canada/Eastern")); + TimeZoneInfo tzi = TimeZoneInfo.FindSystemTimeZoneById (TimeZoneInfoTest.MapTimeZoneId ("America/Toronto")); Assert.IsTrue ("EDT" == tzi.DaylightName || "Eastern Daylight Time" == tzi.DaylightName, "DaylightName"); Assert.IsTrue ("EST" == tzi.StandardName || "Eastern Standard Time" == tzi.StandardName, "StandardName"); Assert.IsTrue (tzi.SupportsDaylightSavingTime, "SupportsDaylightSavingTime"); diff --git a/mcs/class/corlib/corefx/MethodInfo.cs b/mcs/class/corlib/corefx/MethodInfo.cs deleted file mode 100644 index cbef004385..0000000000 --- a/mcs/class/corlib/corefx/MethodInfo.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace System.Reflection { - [Serializable] - partial class MethodInfo { - internal virtual int GenericParameterCount => GetGenericArguments ().Length; - } -} diff --git a/mcs/class/corlib/corefx/SR.cs.REMOVED.git-id b/mcs/class/corlib/corefx/SR.cs.REMOVED.git-id index 6d36f63f8b..9fbe287fda 100644 --- a/mcs/class/corlib/corefx/SR.cs.REMOVED.git-id +++ b/mcs/class/corlib/corefx/SR.cs.REMOVED.git-id @@ -1 +1 @@ -0d8ca7ea2340d4d83a6e2e36ccfef2a1088c23f7 \ No newline at end of file +35736eff07e2c640611194361c95bdb612d891be \ No newline at end of file diff --git a/mcs/class/corlib/corlib.dll.sources.REMOVED.git-id b/mcs/class/corlib/corlib.dll.sources.REMOVED.git-id index d3a7d4e728..4546cd1ac0 100644 --- a/mcs/class/corlib/corlib.dll.sources.REMOVED.git-id +++ b/mcs/class/corlib/corlib.dll.sources.REMOVED.git-id @@ -1 +1 @@ -d3b87d5ca787d43652ead46e2ed22cd62e293e8f \ No newline at end of file +d8d8021a5ca1bc353a5abb4cc17334448231e895 \ No newline at end of file diff --git a/mcs/class/corlib/unix_build_corlib.dll.sources b/mcs/class/corlib/unix_build_corlib.dll.sources index e33ba79c14..a3ebc60f09 100644 --- a/mcs/class/corlib/unix_build_corlib.dll.sources +++ b/mcs/class/corlib/unix_build_corlib.dll.sources @@ -15,6 +15,7 @@ ../../../external/corefx/src/Common/src/Interop/Unix/System.Native/Interop.GetEUid.cs ../../../external/corefx/src/Common/src/Interop/Unix/System.Native/Interop.GetEGid.cs ../../../external/corefx/src/Common/src/Interop/Unix/System.Native/Interop.CopyFile.cs +../../../external/corefx/src/Common/src/Interop/Unix/System.Native/Interop.LChflags.cs ../../../external/corefx/src/Common/src/Interop/Unix/System.Native/Interop.Unlink.cs ../../../external/corefx/src/Common/src/Interop/Unix/System.Native/Interop.Link.cs ../../../external/corefx/src/Common/src/Interop/Unix/System.Native/Interop.Rename.cs diff --git a/mcs/class/lib/monolite-linux/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/netstandard.dll.REMOVED.git-id b/mcs/class/lib/monolite-linux/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/netstandard.dll.REMOVED.git-id deleted file mode 100644 index e0103a2a1e..0000000000 --- a/mcs/class/lib/monolite-linux/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/netstandard.dll.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -56458cedc0a306d35e8a68743d493b8814d3169d \ No newline at end of file diff --git a/mcs/class/lib/monolite-linux/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Mono.Cecil.dll.REMOVED.git-id b/mcs/class/lib/monolite-linux/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Mono.Cecil.dll.REMOVED.git-id deleted file mode 100644 index 306cb0fa83..0000000000 --- a/mcs/class/lib/monolite-linux/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Mono.Cecil.dll.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -a59e995fac121cfdd11ce0d927c7d3b506365f17 \ No newline at end of file diff --git a/mcs/class/lib/monolite-linux/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Mono.Security.dll.REMOVED.git-id b/mcs/class/lib/monolite-linux/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Mono.Security.dll.REMOVED.git-id deleted file mode 100644 index 74df7a692f..0000000000 --- a/mcs/class/lib/monolite-linux/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Mono.Security.dll.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -7db2447256a75befb73a1f986c2a83808086ccb4 \ No newline at end of file diff --git a/mcs/class/lib/monolite-linux/A144A63D-652C-4CCF-A9EE-8E5A091547F1/System.Configuration.dll.REMOVED.git-id b/mcs/class/lib/monolite-linux/A144A63D-652C-4CCF-A9EE-8E5A091547F1/System.Configuration.dll.REMOVED.git-id deleted file mode 100644 index ef66e48d80..0000000000 --- a/mcs/class/lib/monolite-linux/A144A63D-652C-4CCF-A9EE-8E5A091547F1/System.Configuration.dll.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -c9e4f0a11e45ac3c153c2a636d3ba3768a2766d2 \ No newline at end of file diff --git a/mcs/class/lib/monolite-linux/A144A63D-652C-4CCF-A9EE-8E5A091547F1/System.Core.dll.REMOVED.git-id b/mcs/class/lib/monolite-linux/A144A63D-652C-4CCF-A9EE-8E5A091547F1/System.Core.dll.REMOVED.git-id deleted file mode 100644 index 46be39d414..0000000000 --- a/mcs/class/lib/monolite-linux/A144A63D-652C-4CCF-A9EE-8E5A091547F1/System.Core.dll.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -b2d1d12c815dd2731ceb7238b8de888ec1dc4427 \ No newline at end of file diff --git a/mcs/class/lib/monolite-linux/A144A63D-652C-4CCF-A9EE-8E5A091547F1/System.IO.Compression.dll.REMOVED.git-id b/mcs/class/lib/monolite-linux/A144A63D-652C-4CCF-A9EE-8E5A091547F1/System.IO.Compression.dll.REMOVED.git-id deleted file mode 100644 index a841d59ba6..0000000000 --- a/mcs/class/lib/monolite-linux/A144A63D-652C-4CCF-A9EE-8E5A091547F1/System.IO.Compression.dll.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -d97bbdb4e0657d02c39782f54edf8dc4467b1b92 \ No newline at end of file diff --git a/mcs/class/lib/monolite-linux/A144A63D-652C-4CCF-A9EE-8E5A091547F1/System.Numerics.dll.REMOVED.git-id b/mcs/class/lib/monolite-linux/A144A63D-652C-4CCF-A9EE-8E5A091547F1/System.Numerics.dll.REMOVED.git-id deleted file mode 100644 index 990a91d170..0000000000 --- a/mcs/class/lib/monolite-linux/A144A63D-652C-4CCF-A9EE-8E5A091547F1/System.Numerics.dll.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -b3a0572d70584537d9b177e4afe63f7bb6ca3d5c \ No newline at end of file diff --git a/mcs/class/lib/monolite-linux/A144A63D-652C-4CCF-A9EE-8E5A091547F1/System.Xml.dll.REMOVED.git-id b/mcs/class/lib/monolite-linux/A144A63D-652C-4CCF-A9EE-8E5A091547F1/System.Xml.dll.REMOVED.git-id deleted file mode 100644 index 9aa6db03d5..0000000000 --- a/mcs/class/lib/monolite-linux/A144A63D-652C-4CCF-A9EE-8E5A091547F1/System.Xml.dll.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -e9ae2f2451e01d5135e74708e64d84c6c9107114 \ No newline at end of file diff --git a/mcs/class/lib/monolite-linux/A144A63D-652C-4CCF-A9EE-8E5A091547F1/System.dll.REMOVED.git-id b/mcs/class/lib/monolite-linux/A144A63D-652C-4CCF-A9EE-8E5A091547F1/System.dll.REMOVED.git-id deleted file mode 100644 index 4d39f88a2b..0000000000 --- a/mcs/class/lib/monolite-linux/A144A63D-652C-4CCF-A9EE-8E5A091547F1/System.dll.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -fdd96f02a656ffe6e476fde83e4774bf4827619b \ No newline at end of file diff --git a/mcs/class/lib/monolite-linux/A144A63D-652C-4CCF-A9EE-8E5A091547F1/mcs.exe.REMOVED.git-id b/mcs/class/lib/monolite-linux/A144A63D-652C-4CCF-A9EE-8E5A091547F1/mcs.exe.REMOVED.git-id deleted file mode 100644 index c1a75bb8a2..0000000000 --- a/mcs/class/lib/monolite-linux/A144A63D-652C-4CCF-A9EE-8E5A091547F1/mcs.exe.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -9cd9d03def90a4614eda02f0c3ca4848fea4554c \ No newline at end of file diff --git a/mcs/class/lib/monolite-linux/A144A63D-652C-4CCF-A9EE-8E5A091547F1/mscorlib.dll.REMOVED.git-id b/mcs/class/lib/monolite-linux/A144A63D-652C-4CCF-A9EE-8E5A091547F1/mscorlib.dll.REMOVED.git-id deleted file mode 100644 index 1212af84f8..0000000000 --- a/mcs/class/lib/monolite-linux/A144A63D-652C-4CCF-A9EE-8E5A091547F1/mscorlib.dll.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -cf9041d8696b6f8d91bb0e5ce9e739575de742cf \ No newline at end of file diff --git a/mcs/class/lib/monolite-linux/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Collections.Concurrent.dll b/mcs/class/lib/monolite-linux/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Collections.Concurrent.dll similarity index 100% rename from mcs/class/lib/monolite-linux/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Collections.Concurrent.dll rename to mcs/class/lib/monolite-linux/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Collections.Concurrent.dll diff --git a/mcs/class/lib/monolite-linux/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Collections.dll b/mcs/class/lib/monolite-linux/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Collections.dll similarity index 100% rename from mcs/class/lib/monolite-linux/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Collections.dll rename to mcs/class/lib/monolite-linux/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Collections.dll diff --git a/mcs/class/lib/monolite-linux/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Diagnostics.Debug.dll b/mcs/class/lib/monolite-linux/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Diagnostics.Debug.dll similarity index 100% rename from mcs/class/lib/monolite-linux/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Diagnostics.Debug.dll rename to mcs/class/lib/monolite-linux/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Diagnostics.Debug.dll diff --git a/mcs/class/lib/monolite-linux/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Diagnostics.FileVersionInfo.dll b/mcs/class/lib/monolite-linux/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Diagnostics.FileVersionInfo.dll similarity index 100% rename from mcs/class/lib/monolite-linux/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Diagnostics.FileVersionInfo.dll rename to mcs/class/lib/monolite-linux/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Diagnostics.FileVersionInfo.dll diff --git a/mcs/class/lib/monolite-linux/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Diagnostics.Tools.dll b/mcs/class/lib/monolite-linux/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Diagnostics.Tools.dll similarity index 100% rename from mcs/class/lib/monolite-linux/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Diagnostics.Tools.dll rename to mcs/class/lib/monolite-linux/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Diagnostics.Tools.dll diff --git a/mcs/class/lib/monolite-linux/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Dynamic.Runtime.dll b/mcs/class/lib/monolite-linux/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Dynamic.Runtime.dll similarity index 100% rename from mcs/class/lib/monolite-linux/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Dynamic.Runtime.dll rename to mcs/class/lib/monolite-linux/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Dynamic.Runtime.dll diff --git a/mcs/class/lib/monolite-linux/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Globalization.dll b/mcs/class/lib/monolite-linux/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Globalization.dll similarity index 100% rename from mcs/class/lib/monolite-linux/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Globalization.dll rename to mcs/class/lib/monolite-linux/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Globalization.dll diff --git a/mcs/class/lib/monolite-linux/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.IO.FileSystem.Primitives.dll b/mcs/class/lib/monolite-linux/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.IO.FileSystem.Primitives.dll similarity index 100% rename from mcs/class/lib/monolite-linux/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.IO.FileSystem.Primitives.dll rename to mcs/class/lib/monolite-linux/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.IO.FileSystem.Primitives.dll diff --git a/mcs/class/lib/monolite-linux/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.IO.FileSystem.dll b/mcs/class/lib/monolite-linux/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.IO.FileSystem.dll similarity index 100% rename from mcs/class/lib/monolite-linux/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.IO.FileSystem.dll rename to mcs/class/lib/monolite-linux/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.IO.FileSystem.dll diff --git a/mcs/class/lib/monolite-linux/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.IO.dll b/mcs/class/lib/monolite-linux/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.IO.dll similarity index 100% rename from mcs/class/lib/monolite-linux/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.IO.dll rename to mcs/class/lib/monolite-linux/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.IO.dll diff --git a/mcs/class/lib/monolite-linux/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Linq.Expressions.dll b/mcs/class/lib/monolite-linux/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Linq.Expressions.dll similarity index 100% rename from mcs/class/lib/monolite-linux/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Linq.Expressions.dll rename to mcs/class/lib/monolite-linux/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Linq.Expressions.dll diff --git a/mcs/class/lib/monolite-linux/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Linq.dll b/mcs/class/lib/monolite-linux/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Linq.dll similarity index 100% rename from mcs/class/lib/monolite-linux/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Linq.dll rename to mcs/class/lib/monolite-linux/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Linq.dll diff --git a/mcs/class/lib/monolite-linux/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Reflection.Extensions.dll b/mcs/class/lib/monolite-linux/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Reflection.Extensions.dll similarity index 100% rename from mcs/class/lib/monolite-linux/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Reflection.Extensions.dll rename to mcs/class/lib/monolite-linux/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Reflection.Extensions.dll diff --git a/mcs/class/lib/monolite-linux/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Reflection.Primitives.dll b/mcs/class/lib/monolite-linux/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Reflection.Primitives.dll similarity index 100% rename from mcs/class/lib/monolite-linux/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Reflection.Primitives.dll rename to mcs/class/lib/monolite-linux/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Reflection.Primitives.dll diff --git a/mcs/class/lib/monolite-linux/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Reflection.dll b/mcs/class/lib/monolite-linux/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Reflection.dll similarity index 100% rename from mcs/class/lib/monolite-linux/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Reflection.dll rename to mcs/class/lib/monolite-linux/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Reflection.dll diff --git a/mcs/class/lib/monolite-linux/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Resources.ResourceManager.dll b/mcs/class/lib/monolite-linux/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Resources.ResourceManager.dll similarity index 100% rename from mcs/class/lib/monolite-linux/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Resources.ResourceManager.dll rename to mcs/class/lib/monolite-linux/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Resources.ResourceManager.dll diff --git a/mcs/class/lib/monolite-linux/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Runtime.Extensions.dll b/mcs/class/lib/monolite-linux/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Runtime.Extensions.dll similarity index 100% rename from mcs/class/lib/monolite-linux/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Runtime.Extensions.dll rename to mcs/class/lib/monolite-linux/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Runtime.Extensions.dll diff --git a/mcs/class/lib/monolite-linux/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Runtime.InteropServices.dll b/mcs/class/lib/monolite-linux/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Runtime.InteropServices.dll similarity index 100% rename from mcs/class/lib/monolite-linux/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Runtime.InteropServices.dll rename to mcs/class/lib/monolite-linux/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Runtime.InteropServices.dll diff --git a/mcs/class/lib/monolite-linux/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Runtime.Numerics.dll b/mcs/class/lib/monolite-linux/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Runtime.Numerics.dll similarity index 100% rename from mcs/class/lib/monolite-linux/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Runtime.Numerics.dll rename to mcs/class/lib/monolite-linux/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Runtime.Numerics.dll diff --git a/mcs/class/lib/monolite-linux/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Runtime.dll b/mcs/class/lib/monolite-linux/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Runtime.dll similarity index 100% rename from mcs/class/lib/monolite-linux/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Runtime.dll rename to mcs/class/lib/monolite-linux/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Runtime.dll diff --git a/mcs/class/lib/monolite-linux/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Security.Cryptography.Algorithms.dll b/mcs/class/lib/monolite-linux/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Security.Cryptography.Algorithms.dll similarity index 100% rename from mcs/class/lib/monolite-linux/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Security.Cryptography.Algorithms.dll rename to mcs/class/lib/monolite-linux/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Security.Cryptography.Algorithms.dll diff --git a/mcs/class/lib/monolite-linux/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Security.Cryptography.Primitives.dll b/mcs/class/lib/monolite-linux/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Security.Cryptography.Primitives.dll similarity index 100% rename from mcs/class/lib/monolite-linux/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Security.Cryptography.Primitives.dll rename to mcs/class/lib/monolite-linux/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Security.Cryptography.Primitives.dll diff --git a/mcs/class/lib/monolite-linux/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Text.Encoding.CodePages.dll b/mcs/class/lib/monolite-linux/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Text.Encoding.CodePages.dll similarity index 100% rename from mcs/class/lib/monolite-linux/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Text.Encoding.CodePages.dll rename to mcs/class/lib/monolite-linux/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Text.Encoding.CodePages.dll diff --git a/mcs/class/lib/monolite-linux/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Text.Encoding.Extensions.dll b/mcs/class/lib/monolite-linux/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Text.Encoding.Extensions.dll similarity index 100% rename from mcs/class/lib/monolite-linux/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Text.Encoding.Extensions.dll rename to mcs/class/lib/monolite-linux/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Text.Encoding.Extensions.dll diff --git a/mcs/class/lib/monolite-linux/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Text.Encoding.dll b/mcs/class/lib/monolite-linux/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Text.Encoding.dll similarity index 100% rename from mcs/class/lib/monolite-linux/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Text.Encoding.dll rename to mcs/class/lib/monolite-linux/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Text.Encoding.dll diff --git a/mcs/class/lib/monolite-linux/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Threading.Tasks.Parallel.dll b/mcs/class/lib/monolite-linux/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Threading.Tasks.Parallel.dll similarity index 100% rename from mcs/class/lib/monolite-linux/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Threading.Tasks.Parallel.dll rename to mcs/class/lib/monolite-linux/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Threading.Tasks.Parallel.dll diff --git a/mcs/class/lib/monolite-linux/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Threading.Tasks.dll b/mcs/class/lib/monolite-linux/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Threading.Tasks.dll similarity index 100% rename from mcs/class/lib/monolite-linux/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Threading.Tasks.dll rename to mcs/class/lib/monolite-linux/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Threading.Tasks.dll diff --git a/mcs/class/lib/monolite-linux/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Threading.dll b/mcs/class/lib/monolite-linux/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Threading.dll similarity index 100% rename from mcs/class/lib/monolite-linux/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Threading.dll rename to mcs/class/lib/monolite-linux/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Threading.dll diff --git a/mcs/class/lib/monolite-linux/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.ValueTuple.dll b/mcs/class/lib/monolite-linux/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.ValueTuple.dll similarity index 100% rename from mcs/class/lib/monolite-linux/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.ValueTuple.dll rename to mcs/class/lib/monolite-linux/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.ValueTuple.dll diff --git a/mcs/class/lib/monolite-linux/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Xml.ReaderWriter.dll b/mcs/class/lib/monolite-linux/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Xml.ReaderWriter.dll similarity index 100% rename from mcs/class/lib/monolite-linux/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Xml.ReaderWriter.dll rename to mcs/class/lib/monolite-linux/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Xml.ReaderWriter.dll diff --git a/mcs/class/lib/monolite-linux/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Xml.XDocument.dll b/mcs/class/lib/monolite-linux/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Xml.XDocument.dll similarity index 100% rename from mcs/class/lib/monolite-linux/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Xml.XDocument.dll rename to mcs/class/lib/monolite-linux/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Xml.XDocument.dll diff --git a/mcs/class/lib/monolite-linux/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/netstandard.dll.REMOVED.git-id b/mcs/class/lib/monolite-linux/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/netstandard.dll.REMOVED.git-id new file mode 100644 index 0000000000..c1b6653057 --- /dev/null +++ b/mcs/class/lib/monolite-linux/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/netstandard.dll.REMOVED.git-id @@ -0,0 +1 @@ +1ff46092b9a120eb841c522b31e0e90e291874fe \ No newline at end of file diff --git a/mcs/class/lib/monolite-linux/ABB721D6-116A-4555-B4FD-9248146D2051/Mono.Cecil.dll.REMOVED.git-id b/mcs/class/lib/monolite-linux/ABB721D6-116A-4555-B4FD-9248146D2051/Mono.Cecil.dll.REMOVED.git-id new file mode 100644 index 0000000000..1e92b9e74a --- /dev/null +++ b/mcs/class/lib/monolite-linux/ABB721D6-116A-4555-B4FD-9248146D2051/Mono.Cecil.dll.REMOVED.git-id @@ -0,0 +1 @@ +c835199ef4f799c5ea6f316c148249ab88cede2a \ No newline at end of file diff --git a/mcs/class/lib/monolite-linux/ABB721D6-116A-4555-B4FD-9248146D2051/Mono.Security.dll.REMOVED.git-id b/mcs/class/lib/monolite-linux/ABB721D6-116A-4555-B4FD-9248146D2051/Mono.Security.dll.REMOVED.git-id new file mode 100644 index 0000000000..62534ee432 --- /dev/null +++ b/mcs/class/lib/monolite-linux/ABB721D6-116A-4555-B4FD-9248146D2051/Mono.Security.dll.REMOVED.git-id @@ -0,0 +1 @@ +10c199f6273088a52230ffe5240dab06dc79ef6a \ No newline at end of file diff --git a/mcs/class/lib/monolite-linux/ABB721D6-116A-4555-B4FD-9248146D2051/System.Configuration.dll.REMOVED.git-id b/mcs/class/lib/monolite-linux/ABB721D6-116A-4555-B4FD-9248146D2051/System.Configuration.dll.REMOVED.git-id new file mode 100644 index 0000000000..89473e8e0a --- /dev/null +++ b/mcs/class/lib/monolite-linux/ABB721D6-116A-4555-B4FD-9248146D2051/System.Configuration.dll.REMOVED.git-id @@ -0,0 +1 @@ +d7c75a5161e4dc77ff72514f81e5bcfee1f66f18 \ No newline at end of file diff --git a/mcs/class/lib/monolite-linux/ABB721D6-116A-4555-B4FD-9248146D2051/System.Core.dll.REMOVED.git-id b/mcs/class/lib/monolite-linux/ABB721D6-116A-4555-B4FD-9248146D2051/System.Core.dll.REMOVED.git-id new file mode 100644 index 0000000000..d783e90e06 --- /dev/null +++ b/mcs/class/lib/monolite-linux/ABB721D6-116A-4555-B4FD-9248146D2051/System.Core.dll.REMOVED.git-id @@ -0,0 +1 @@ +97a131da135cdb88e3070994bfcb405182f0cc23 \ No newline at end of file diff --git a/mcs/class/lib/monolite-linux/ABB721D6-116A-4555-B4FD-9248146D2051/System.IO.Compression.dll.REMOVED.git-id b/mcs/class/lib/monolite-linux/ABB721D6-116A-4555-B4FD-9248146D2051/System.IO.Compression.dll.REMOVED.git-id new file mode 100644 index 0000000000..9eb794c682 --- /dev/null +++ b/mcs/class/lib/monolite-linux/ABB721D6-116A-4555-B4FD-9248146D2051/System.IO.Compression.dll.REMOVED.git-id @@ -0,0 +1 @@ +5090147e0bd6549ca5cbf10241cacd11d023d17c \ No newline at end of file diff --git a/mcs/class/lib/monolite-linux/ABB721D6-116A-4555-B4FD-9248146D2051/System.Numerics.dll.REMOVED.git-id b/mcs/class/lib/monolite-linux/ABB721D6-116A-4555-B4FD-9248146D2051/System.Numerics.dll.REMOVED.git-id new file mode 100644 index 0000000000..7ad0ca9687 --- /dev/null +++ b/mcs/class/lib/monolite-linux/ABB721D6-116A-4555-B4FD-9248146D2051/System.Numerics.dll.REMOVED.git-id @@ -0,0 +1 @@ +3529d3fc8f191980ad92d1191106ad14ea1e6f0b \ No newline at end of file diff --git a/mcs/class/lib/monolite-linux/A144A63D-652C-4CCF-A9EE-8E5A091547F1/System.Security.dll.REMOVED.git-id b/mcs/class/lib/monolite-linux/ABB721D6-116A-4555-B4FD-9248146D2051/System.Security.dll.REMOVED.git-id similarity index 100% rename from mcs/class/lib/monolite-linux/A144A63D-652C-4CCF-A9EE-8E5A091547F1/System.Security.dll.REMOVED.git-id rename to mcs/class/lib/monolite-linux/ABB721D6-116A-4555-B4FD-9248146D2051/System.Security.dll.REMOVED.git-id diff --git a/mcs/class/lib/monolite-linux/A144A63D-652C-4CCF-A9EE-8E5A091547F1/System.Xml.Linq.dll.REMOVED.git-id b/mcs/class/lib/monolite-linux/ABB721D6-116A-4555-B4FD-9248146D2051/System.Xml.Linq.dll.REMOVED.git-id similarity index 100% rename from mcs/class/lib/monolite-linux/A144A63D-652C-4CCF-A9EE-8E5A091547F1/System.Xml.Linq.dll.REMOVED.git-id rename to mcs/class/lib/monolite-linux/ABB721D6-116A-4555-B4FD-9248146D2051/System.Xml.Linq.dll.REMOVED.git-id diff --git a/mcs/class/lib/monolite-linux/ABB721D6-116A-4555-B4FD-9248146D2051/System.Xml.dll.REMOVED.git-id b/mcs/class/lib/monolite-linux/ABB721D6-116A-4555-B4FD-9248146D2051/System.Xml.dll.REMOVED.git-id new file mode 100644 index 0000000000..4ade6a3678 --- /dev/null +++ b/mcs/class/lib/monolite-linux/ABB721D6-116A-4555-B4FD-9248146D2051/System.Xml.dll.REMOVED.git-id @@ -0,0 +1 @@ +5bf7ee680fde34b85692b0dfd2698af889ab8767 \ No newline at end of file diff --git a/mcs/class/lib/monolite-linux/ABB721D6-116A-4555-B4FD-9248146D2051/System.dll.REMOVED.git-id b/mcs/class/lib/monolite-linux/ABB721D6-116A-4555-B4FD-9248146D2051/System.dll.REMOVED.git-id new file mode 100644 index 0000000000..bbe262d302 --- /dev/null +++ b/mcs/class/lib/monolite-linux/ABB721D6-116A-4555-B4FD-9248146D2051/System.dll.REMOVED.git-id @@ -0,0 +1 @@ +444cfb43e9d19732c08dfc47c74331d659aabd72 \ No newline at end of file diff --git a/mcs/class/lib/monolite-linux/ABB721D6-116A-4555-B4FD-9248146D2051/mcs.exe.REMOVED.git-id b/mcs/class/lib/monolite-linux/ABB721D6-116A-4555-B4FD-9248146D2051/mcs.exe.REMOVED.git-id new file mode 100644 index 0000000000..0bd014855b --- /dev/null +++ b/mcs/class/lib/monolite-linux/ABB721D6-116A-4555-B4FD-9248146D2051/mcs.exe.REMOVED.git-id @@ -0,0 +1 @@ +4f01f6898ed1815cc48192ace724a80bcce666f8 \ No newline at end of file diff --git a/mcs/class/lib/monolite-linux/ABB721D6-116A-4555-B4FD-9248146D2051/mscorlib.dll.REMOVED.git-id b/mcs/class/lib/monolite-linux/ABB721D6-116A-4555-B4FD-9248146D2051/mscorlib.dll.REMOVED.git-id new file mode 100644 index 0000000000..96aaab6f39 --- /dev/null +++ b/mcs/class/lib/monolite-linux/ABB721D6-116A-4555-B4FD-9248146D2051/mscorlib.dll.REMOVED.git-id @@ -0,0 +1 @@ +ea565b946160f2dab6d14029d989862bb8ad1293 \ No newline at end of file diff --git a/mcs/class/lib/monolite-macos/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/netstandard.dll.REMOVED.git-id b/mcs/class/lib/monolite-macos/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/netstandard.dll.REMOVED.git-id deleted file mode 100644 index e0103a2a1e..0000000000 --- a/mcs/class/lib/monolite-macos/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/netstandard.dll.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -56458cedc0a306d35e8a68743d493b8814d3169d \ No newline at end of file diff --git a/mcs/class/lib/monolite-macos/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Mono.Cecil.dll.REMOVED.git-id b/mcs/class/lib/monolite-macos/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Mono.Cecil.dll.REMOVED.git-id deleted file mode 100644 index 306cb0fa83..0000000000 --- a/mcs/class/lib/monolite-macos/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Mono.Cecil.dll.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -a59e995fac121cfdd11ce0d927c7d3b506365f17 \ No newline at end of file diff --git a/mcs/class/lib/monolite-macos/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Mono.Security.dll.REMOVED.git-id b/mcs/class/lib/monolite-macos/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Mono.Security.dll.REMOVED.git-id deleted file mode 100644 index 74df7a692f..0000000000 --- a/mcs/class/lib/monolite-macos/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Mono.Security.dll.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -7db2447256a75befb73a1f986c2a83808086ccb4 \ No newline at end of file diff --git a/mcs/class/lib/monolite-macos/A144A63D-652C-4CCF-A9EE-8E5A091547F1/System.Configuration.dll.REMOVED.git-id b/mcs/class/lib/monolite-macos/A144A63D-652C-4CCF-A9EE-8E5A091547F1/System.Configuration.dll.REMOVED.git-id deleted file mode 100644 index ef66e48d80..0000000000 --- a/mcs/class/lib/monolite-macos/A144A63D-652C-4CCF-A9EE-8E5A091547F1/System.Configuration.dll.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -c9e4f0a11e45ac3c153c2a636d3ba3768a2766d2 \ No newline at end of file diff --git a/mcs/class/lib/monolite-macos/A144A63D-652C-4CCF-A9EE-8E5A091547F1/System.Core.dll.REMOVED.git-id b/mcs/class/lib/monolite-macos/A144A63D-652C-4CCF-A9EE-8E5A091547F1/System.Core.dll.REMOVED.git-id deleted file mode 100644 index 46be39d414..0000000000 --- a/mcs/class/lib/monolite-macos/A144A63D-652C-4CCF-A9EE-8E5A091547F1/System.Core.dll.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -b2d1d12c815dd2731ceb7238b8de888ec1dc4427 \ No newline at end of file diff --git a/mcs/class/lib/monolite-macos/A144A63D-652C-4CCF-A9EE-8E5A091547F1/System.IO.Compression.dll.REMOVED.git-id b/mcs/class/lib/monolite-macos/A144A63D-652C-4CCF-A9EE-8E5A091547F1/System.IO.Compression.dll.REMOVED.git-id deleted file mode 100644 index a841d59ba6..0000000000 --- a/mcs/class/lib/monolite-macos/A144A63D-652C-4CCF-A9EE-8E5A091547F1/System.IO.Compression.dll.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -d97bbdb4e0657d02c39782f54edf8dc4467b1b92 \ No newline at end of file diff --git a/mcs/class/lib/monolite-macos/A144A63D-652C-4CCF-A9EE-8E5A091547F1/System.Numerics.dll.REMOVED.git-id b/mcs/class/lib/monolite-macos/A144A63D-652C-4CCF-A9EE-8E5A091547F1/System.Numerics.dll.REMOVED.git-id deleted file mode 100644 index 990a91d170..0000000000 --- a/mcs/class/lib/monolite-macos/A144A63D-652C-4CCF-A9EE-8E5A091547F1/System.Numerics.dll.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -b3a0572d70584537d9b177e4afe63f7bb6ca3d5c \ No newline at end of file diff --git a/mcs/class/lib/monolite-macos/A144A63D-652C-4CCF-A9EE-8E5A091547F1/System.Xml.dll.REMOVED.git-id b/mcs/class/lib/monolite-macos/A144A63D-652C-4CCF-A9EE-8E5A091547F1/System.Xml.dll.REMOVED.git-id deleted file mode 100644 index 9aa6db03d5..0000000000 --- a/mcs/class/lib/monolite-macos/A144A63D-652C-4CCF-A9EE-8E5A091547F1/System.Xml.dll.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -e9ae2f2451e01d5135e74708e64d84c6c9107114 \ No newline at end of file diff --git a/mcs/class/lib/monolite-macos/A144A63D-652C-4CCF-A9EE-8E5A091547F1/System.dll.REMOVED.git-id b/mcs/class/lib/monolite-macos/A144A63D-652C-4CCF-A9EE-8E5A091547F1/System.dll.REMOVED.git-id deleted file mode 100644 index 4d39f88a2b..0000000000 --- a/mcs/class/lib/monolite-macos/A144A63D-652C-4CCF-A9EE-8E5A091547F1/System.dll.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -fdd96f02a656ffe6e476fde83e4774bf4827619b \ No newline at end of file diff --git a/mcs/class/lib/monolite-macos/A144A63D-652C-4CCF-A9EE-8E5A091547F1/mcs.exe.REMOVED.git-id b/mcs/class/lib/monolite-macos/A144A63D-652C-4CCF-A9EE-8E5A091547F1/mcs.exe.REMOVED.git-id deleted file mode 100644 index 57907a6470..0000000000 --- a/mcs/class/lib/monolite-macos/A144A63D-652C-4CCF-A9EE-8E5A091547F1/mcs.exe.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -81565efe2b0412f45e6703253e792f68b4fcf8f7 \ No newline at end of file diff --git a/mcs/class/lib/monolite-macos/A144A63D-652C-4CCF-A9EE-8E5A091547F1/mscorlib.dll.REMOVED.git-id b/mcs/class/lib/monolite-macos/A144A63D-652C-4CCF-A9EE-8E5A091547F1/mscorlib.dll.REMOVED.git-id deleted file mode 100644 index 1212af84f8..0000000000 --- a/mcs/class/lib/monolite-macos/A144A63D-652C-4CCF-A9EE-8E5A091547F1/mscorlib.dll.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -cf9041d8696b6f8d91bb0e5ce9e739575de742cf \ No newline at end of file diff --git a/mcs/class/lib/monolite-macos/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Collections.Concurrent.dll b/mcs/class/lib/monolite-macos/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Collections.Concurrent.dll similarity index 100% rename from mcs/class/lib/monolite-macos/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Collections.Concurrent.dll rename to mcs/class/lib/monolite-macos/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Collections.Concurrent.dll diff --git a/mcs/class/lib/monolite-macos/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Collections.dll b/mcs/class/lib/monolite-macos/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Collections.dll similarity index 100% rename from mcs/class/lib/monolite-macos/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Collections.dll rename to mcs/class/lib/monolite-macos/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Collections.dll diff --git a/mcs/class/lib/monolite-macos/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Diagnostics.Debug.dll b/mcs/class/lib/monolite-macos/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Diagnostics.Debug.dll similarity index 100% rename from mcs/class/lib/monolite-macos/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Diagnostics.Debug.dll rename to mcs/class/lib/monolite-macos/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Diagnostics.Debug.dll diff --git a/mcs/class/lib/monolite-macos/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Diagnostics.FileVersionInfo.dll b/mcs/class/lib/monolite-macos/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Diagnostics.FileVersionInfo.dll similarity index 100% rename from mcs/class/lib/monolite-macos/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Diagnostics.FileVersionInfo.dll rename to mcs/class/lib/monolite-macos/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Diagnostics.FileVersionInfo.dll diff --git a/mcs/class/lib/monolite-macos/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Diagnostics.Tools.dll b/mcs/class/lib/monolite-macos/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Diagnostics.Tools.dll similarity index 100% rename from mcs/class/lib/monolite-macos/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Diagnostics.Tools.dll rename to mcs/class/lib/monolite-macos/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Diagnostics.Tools.dll diff --git a/mcs/class/lib/monolite-macos/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Dynamic.Runtime.dll b/mcs/class/lib/monolite-macos/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Dynamic.Runtime.dll similarity index 100% rename from mcs/class/lib/monolite-macos/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Dynamic.Runtime.dll rename to mcs/class/lib/monolite-macos/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Dynamic.Runtime.dll diff --git a/mcs/class/lib/monolite-macos/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Globalization.dll b/mcs/class/lib/monolite-macos/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Globalization.dll similarity index 100% rename from mcs/class/lib/monolite-macos/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Globalization.dll rename to mcs/class/lib/monolite-macos/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Globalization.dll diff --git a/mcs/class/lib/monolite-macos/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.IO.FileSystem.Primitives.dll b/mcs/class/lib/monolite-macos/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.IO.FileSystem.Primitives.dll similarity index 100% rename from mcs/class/lib/monolite-macos/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.IO.FileSystem.Primitives.dll rename to mcs/class/lib/monolite-macos/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.IO.FileSystem.Primitives.dll diff --git a/mcs/class/lib/monolite-macos/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.IO.FileSystem.dll b/mcs/class/lib/monolite-macos/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.IO.FileSystem.dll similarity index 100% rename from mcs/class/lib/monolite-macos/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.IO.FileSystem.dll rename to mcs/class/lib/monolite-macos/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.IO.FileSystem.dll diff --git a/mcs/class/lib/monolite-macos/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.IO.dll b/mcs/class/lib/monolite-macos/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.IO.dll similarity index 100% rename from mcs/class/lib/monolite-macos/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.IO.dll rename to mcs/class/lib/monolite-macos/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.IO.dll diff --git a/mcs/class/lib/monolite-macos/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Linq.Expressions.dll b/mcs/class/lib/monolite-macos/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Linq.Expressions.dll similarity index 100% rename from mcs/class/lib/monolite-macos/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Linq.Expressions.dll rename to mcs/class/lib/monolite-macos/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Linq.Expressions.dll diff --git a/mcs/class/lib/monolite-macos/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Linq.dll b/mcs/class/lib/monolite-macos/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Linq.dll similarity index 100% rename from mcs/class/lib/monolite-macos/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Linq.dll rename to mcs/class/lib/monolite-macos/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Linq.dll diff --git a/mcs/class/lib/monolite-macos/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Reflection.Extensions.dll b/mcs/class/lib/monolite-macos/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Reflection.Extensions.dll similarity index 100% rename from mcs/class/lib/monolite-macos/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Reflection.Extensions.dll rename to mcs/class/lib/monolite-macos/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Reflection.Extensions.dll diff --git a/mcs/class/lib/monolite-macos/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Reflection.Primitives.dll b/mcs/class/lib/monolite-macos/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Reflection.Primitives.dll similarity index 100% rename from mcs/class/lib/monolite-macos/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Reflection.Primitives.dll rename to mcs/class/lib/monolite-macos/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Reflection.Primitives.dll diff --git a/mcs/class/lib/monolite-macos/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Reflection.dll b/mcs/class/lib/monolite-macos/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Reflection.dll similarity index 100% rename from mcs/class/lib/monolite-macos/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Reflection.dll rename to mcs/class/lib/monolite-macos/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Reflection.dll diff --git a/mcs/class/lib/monolite-macos/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Resources.ResourceManager.dll b/mcs/class/lib/monolite-macos/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Resources.ResourceManager.dll similarity index 100% rename from mcs/class/lib/monolite-macos/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Resources.ResourceManager.dll rename to mcs/class/lib/monolite-macos/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Resources.ResourceManager.dll diff --git a/mcs/class/lib/monolite-macos/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Runtime.Extensions.dll b/mcs/class/lib/monolite-macos/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Runtime.Extensions.dll similarity index 100% rename from mcs/class/lib/monolite-macos/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Runtime.Extensions.dll rename to mcs/class/lib/monolite-macos/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Runtime.Extensions.dll diff --git a/mcs/class/lib/monolite-macos/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Runtime.InteropServices.dll b/mcs/class/lib/monolite-macos/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Runtime.InteropServices.dll similarity index 100% rename from mcs/class/lib/monolite-macos/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Runtime.InteropServices.dll rename to mcs/class/lib/monolite-macos/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Runtime.InteropServices.dll diff --git a/mcs/class/lib/monolite-macos/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Runtime.Numerics.dll b/mcs/class/lib/monolite-macos/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Runtime.Numerics.dll similarity index 100% rename from mcs/class/lib/monolite-macos/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Runtime.Numerics.dll rename to mcs/class/lib/monolite-macos/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Runtime.Numerics.dll diff --git a/mcs/class/lib/monolite-macos/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Runtime.dll b/mcs/class/lib/monolite-macos/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Runtime.dll similarity index 100% rename from mcs/class/lib/monolite-macos/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Runtime.dll rename to mcs/class/lib/monolite-macos/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Runtime.dll diff --git a/mcs/class/lib/monolite-macos/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Security.Cryptography.Algorithms.dll b/mcs/class/lib/monolite-macos/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Security.Cryptography.Algorithms.dll similarity index 100% rename from mcs/class/lib/monolite-macos/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Security.Cryptography.Algorithms.dll rename to mcs/class/lib/monolite-macos/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Security.Cryptography.Algorithms.dll diff --git a/mcs/class/lib/monolite-macos/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Security.Cryptography.Primitives.dll b/mcs/class/lib/monolite-macos/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Security.Cryptography.Primitives.dll similarity index 100% rename from mcs/class/lib/monolite-macos/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Security.Cryptography.Primitives.dll rename to mcs/class/lib/monolite-macos/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Security.Cryptography.Primitives.dll diff --git a/mcs/class/lib/monolite-macos/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Text.Encoding.CodePages.dll b/mcs/class/lib/monolite-macos/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Text.Encoding.CodePages.dll similarity index 100% rename from mcs/class/lib/monolite-macos/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Text.Encoding.CodePages.dll rename to mcs/class/lib/monolite-macos/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Text.Encoding.CodePages.dll diff --git a/mcs/class/lib/monolite-macos/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Text.Encoding.Extensions.dll b/mcs/class/lib/monolite-macos/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Text.Encoding.Extensions.dll similarity index 100% rename from mcs/class/lib/monolite-macos/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Text.Encoding.Extensions.dll rename to mcs/class/lib/monolite-macos/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Text.Encoding.Extensions.dll diff --git a/mcs/class/lib/monolite-macos/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Text.Encoding.dll b/mcs/class/lib/monolite-macos/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Text.Encoding.dll similarity index 100% rename from mcs/class/lib/monolite-macos/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Text.Encoding.dll rename to mcs/class/lib/monolite-macos/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Text.Encoding.dll diff --git a/mcs/class/lib/monolite-macos/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Threading.Tasks.Parallel.dll b/mcs/class/lib/monolite-macos/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Threading.Tasks.Parallel.dll similarity index 100% rename from mcs/class/lib/monolite-macos/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Threading.Tasks.Parallel.dll rename to mcs/class/lib/monolite-macos/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Threading.Tasks.Parallel.dll diff --git a/mcs/class/lib/monolite-macos/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Threading.Tasks.dll b/mcs/class/lib/monolite-macos/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Threading.Tasks.dll similarity index 100% rename from mcs/class/lib/monolite-macos/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Threading.Tasks.dll rename to mcs/class/lib/monolite-macos/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Threading.Tasks.dll diff --git a/mcs/class/lib/monolite-macos/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Threading.dll b/mcs/class/lib/monolite-macos/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Threading.dll similarity index 100% rename from mcs/class/lib/monolite-macos/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Threading.dll rename to mcs/class/lib/monolite-macos/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Threading.dll diff --git a/mcs/class/lib/monolite-macos/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.ValueTuple.dll b/mcs/class/lib/monolite-macos/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.ValueTuple.dll similarity index 100% rename from mcs/class/lib/monolite-macos/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.ValueTuple.dll rename to mcs/class/lib/monolite-macos/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.ValueTuple.dll diff --git a/mcs/class/lib/monolite-macos/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Xml.ReaderWriter.dll b/mcs/class/lib/monolite-macos/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Xml.ReaderWriter.dll similarity index 100% rename from mcs/class/lib/monolite-macos/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Xml.ReaderWriter.dll rename to mcs/class/lib/monolite-macos/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Xml.ReaderWriter.dll diff --git a/mcs/class/lib/monolite-macos/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Xml.XDocument.dll b/mcs/class/lib/monolite-macos/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Xml.XDocument.dll similarity index 100% rename from mcs/class/lib/monolite-macos/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Xml.XDocument.dll rename to mcs/class/lib/monolite-macos/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Xml.XDocument.dll diff --git a/mcs/class/lib/monolite-macos/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/netstandard.dll.REMOVED.git-id b/mcs/class/lib/monolite-macos/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/netstandard.dll.REMOVED.git-id new file mode 100644 index 0000000000..c1b6653057 --- /dev/null +++ b/mcs/class/lib/monolite-macos/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/netstandard.dll.REMOVED.git-id @@ -0,0 +1 @@ +1ff46092b9a120eb841c522b31e0e90e291874fe \ No newline at end of file diff --git a/mcs/class/lib/monolite-macos/ABB721D6-116A-4555-B4FD-9248146D2051/Mono.Cecil.dll.REMOVED.git-id b/mcs/class/lib/monolite-macos/ABB721D6-116A-4555-B4FD-9248146D2051/Mono.Cecil.dll.REMOVED.git-id new file mode 100644 index 0000000000..1e92b9e74a --- /dev/null +++ b/mcs/class/lib/monolite-macos/ABB721D6-116A-4555-B4FD-9248146D2051/Mono.Cecil.dll.REMOVED.git-id @@ -0,0 +1 @@ +c835199ef4f799c5ea6f316c148249ab88cede2a \ No newline at end of file diff --git a/mcs/class/lib/monolite-macos/ABB721D6-116A-4555-B4FD-9248146D2051/Mono.Security.dll.REMOVED.git-id b/mcs/class/lib/monolite-macos/ABB721D6-116A-4555-B4FD-9248146D2051/Mono.Security.dll.REMOVED.git-id new file mode 100644 index 0000000000..62534ee432 --- /dev/null +++ b/mcs/class/lib/monolite-macos/ABB721D6-116A-4555-B4FD-9248146D2051/Mono.Security.dll.REMOVED.git-id @@ -0,0 +1 @@ +10c199f6273088a52230ffe5240dab06dc79ef6a \ No newline at end of file diff --git a/mcs/class/lib/monolite-macos/ABB721D6-116A-4555-B4FD-9248146D2051/System.Configuration.dll.REMOVED.git-id b/mcs/class/lib/monolite-macos/ABB721D6-116A-4555-B4FD-9248146D2051/System.Configuration.dll.REMOVED.git-id new file mode 100644 index 0000000000..89473e8e0a --- /dev/null +++ b/mcs/class/lib/monolite-macos/ABB721D6-116A-4555-B4FD-9248146D2051/System.Configuration.dll.REMOVED.git-id @@ -0,0 +1 @@ +d7c75a5161e4dc77ff72514f81e5bcfee1f66f18 \ No newline at end of file diff --git a/mcs/class/lib/monolite-macos/ABB721D6-116A-4555-B4FD-9248146D2051/System.Core.dll.REMOVED.git-id b/mcs/class/lib/monolite-macos/ABB721D6-116A-4555-B4FD-9248146D2051/System.Core.dll.REMOVED.git-id new file mode 100644 index 0000000000..d783e90e06 --- /dev/null +++ b/mcs/class/lib/monolite-macos/ABB721D6-116A-4555-B4FD-9248146D2051/System.Core.dll.REMOVED.git-id @@ -0,0 +1 @@ +97a131da135cdb88e3070994bfcb405182f0cc23 \ No newline at end of file diff --git a/mcs/class/lib/monolite-macos/ABB721D6-116A-4555-B4FD-9248146D2051/System.IO.Compression.dll.REMOVED.git-id b/mcs/class/lib/monolite-macos/ABB721D6-116A-4555-B4FD-9248146D2051/System.IO.Compression.dll.REMOVED.git-id new file mode 100644 index 0000000000..9eb794c682 --- /dev/null +++ b/mcs/class/lib/monolite-macos/ABB721D6-116A-4555-B4FD-9248146D2051/System.IO.Compression.dll.REMOVED.git-id @@ -0,0 +1 @@ +5090147e0bd6549ca5cbf10241cacd11d023d17c \ No newline at end of file diff --git a/mcs/class/lib/monolite-macos/ABB721D6-116A-4555-B4FD-9248146D2051/System.Numerics.dll.REMOVED.git-id b/mcs/class/lib/monolite-macos/ABB721D6-116A-4555-B4FD-9248146D2051/System.Numerics.dll.REMOVED.git-id new file mode 100644 index 0000000000..7ad0ca9687 --- /dev/null +++ b/mcs/class/lib/monolite-macos/ABB721D6-116A-4555-B4FD-9248146D2051/System.Numerics.dll.REMOVED.git-id @@ -0,0 +1 @@ +3529d3fc8f191980ad92d1191106ad14ea1e6f0b \ No newline at end of file diff --git a/mcs/class/lib/monolite-macos/A144A63D-652C-4CCF-A9EE-8E5A091547F1/System.Security.dll.REMOVED.git-id b/mcs/class/lib/monolite-macos/ABB721D6-116A-4555-B4FD-9248146D2051/System.Security.dll.REMOVED.git-id similarity index 100% rename from mcs/class/lib/monolite-macos/A144A63D-652C-4CCF-A9EE-8E5A091547F1/System.Security.dll.REMOVED.git-id rename to mcs/class/lib/monolite-macos/ABB721D6-116A-4555-B4FD-9248146D2051/System.Security.dll.REMOVED.git-id diff --git a/mcs/class/lib/monolite-macos/A144A63D-652C-4CCF-A9EE-8E5A091547F1/System.Xml.Linq.dll.REMOVED.git-id b/mcs/class/lib/monolite-macos/ABB721D6-116A-4555-B4FD-9248146D2051/System.Xml.Linq.dll.REMOVED.git-id similarity index 100% rename from mcs/class/lib/monolite-macos/A144A63D-652C-4CCF-A9EE-8E5A091547F1/System.Xml.Linq.dll.REMOVED.git-id rename to mcs/class/lib/monolite-macos/ABB721D6-116A-4555-B4FD-9248146D2051/System.Xml.Linq.dll.REMOVED.git-id diff --git a/mcs/class/lib/monolite-macos/ABB721D6-116A-4555-B4FD-9248146D2051/System.Xml.dll.REMOVED.git-id b/mcs/class/lib/monolite-macos/ABB721D6-116A-4555-B4FD-9248146D2051/System.Xml.dll.REMOVED.git-id new file mode 100644 index 0000000000..4ade6a3678 --- /dev/null +++ b/mcs/class/lib/monolite-macos/ABB721D6-116A-4555-B4FD-9248146D2051/System.Xml.dll.REMOVED.git-id @@ -0,0 +1 @@ +5bf7ee680fde34b85692b0dfd2698af889ab8767 \ No newline at end of file diff --git a/mcs/class/lib/monolite-macos/ABB721D6-116A-4555-B4FD-9248146D2051/System.dll.REMOVED.git-id b/mcs/class/lib/monolite-macos/ABB721D6-116A-4555-B4FD-9248146D2051/System.dll.REMOVED.git-id new file mode 100644 index 0000000000..bbe262d302 --- /dev/null +++ b/mcs/class/lib/monolite-macos/ABB721D6-116A-4555-B4FD-9248146D2051/System.dll.REMOVED.git-id @@ -0,0 +1 @@ +444cfb43e9d19732c08dfc47c74331d659aabd72 \ No newline at end of file diff --git a/mcs/class/lib/monolite-macos/ABB721D6-116A-4555-B4FD-9248146D2051/mcs.exe.REMOVED.git-id b/mcs/class/lib/monolite-macos/ABB721D6-116A-4555-B4FD-9248146D2051/mcs.exe.REMOVED.git-id new file mode 100644 index 0000000000..0bd014855b --- /dev/null +++ b/mcs/class/lib/monolite-macos/ABB721D6-116A-4555-B4FD-9248146D2051/mcs.exe.REMOVED.git-id @@ -0,0 +1 @@ +4f01f6898ed1815cc48192ace724a80bcce666f8 \ No newline at end of file diff --git a/mcs/class/lib/monolite-macos/ABB721D6-116A-4555-B4FD-9248146D2051/mscorlib.dll.REMOVED.git-id b/mcs/class/lib/monolite-macos/ABB721D6-116A-4555-B4FD-9248146D2051/mscorlib.dll.REMOVED.git-id new file mode 100644 index 0000000000..96aaab6f39 --- /dev/null +++ b/mcs/class/lib/monolite-macos/ABB721D6-116A-4555-B4FD-9248146D2051/mscorlib.dll.REMOVED.git-id @@ -0,0 +1 @@ +ea565b946160f2dab6d14029d989862bb8ad1293 \ No newline at end of file diff --git a/mcs/class/lib/monolite-unix/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/netstandard.dll.REMOVED.git-id b/mcs/class/lib/monolite-unix/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/netstandard.dll.REMOVED.git-id deleted file mode 100644 index e0103a2a1e..0000000000 --- a/mcs/class/lib/monolite-unix/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/netstandard.dll.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -56458cedc0a306d35e8a68743d493b8814d3169d \ No newline at end of file diff --git a/mcs/class/lib/monolite-unix/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Mono.Cecil.dll.REMOVED.git-id b/mcs/class/lib/monolite-unix/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Mono.Cecil.dll.REMOVED.git-id deleted file mode 100644 index 306cb0fa83..0000000000 --- a/mcs/class/lib/monolite-unix/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Mono.Cecil.dll.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -a59e995fac121cfdd11ce0d927c7d3b506365f17 \ No newline at end of file diff --git a/mcs/class/lib/monolite-unix/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Mono.Security.dll.REMOVED.git-id b/mcs/class/lib/monolite-unix/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Mono.Security.dll.REMOVED.git-id deleted file mode 100644 index 74df7a692f..0000000000 --- a/mcs/class/lib/monolite-unix/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Mono.Security.dll.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -7db2447256a75befb73a1f986c2a83808086ccb4 \ No newline at end of file diff --git a/mcs/class/lib/monolite-unix/A144A63D-652C-4CCF-A9EE-8E5A091547F1/System.Configuration.dll.REMOVED.git-id b/mcs/class/lib/monolite-unix/A144A63D-652C-4CCF-A9EE-8E5A091547F1/System.Configuration.dll.REMOVED.git-id deleted file mode 100644 index ef66e48d80..0000000000 --- a/mcs/class/lib/monolite-unix/A144A63D-652C-4CCF-A9EE-8E5A091547F1/System.Configuration.dll.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -c9e4f0a11e45ac3c153c2a636d3ba3768a2766d2 \ No newline at end of file diff --git a/mcs/class/lib/monolite-unix/A144A63D-652C-4CCF-A9EE-8E5A091547F1/System.Core.dll.REMOVED.git-id b/mcs/class/lib/monolite-unix/A144A63D-652C-4CCF-A9EE-8E5A091547F1/System.Core.dll.REMOVED.git-id deleted file mode 100644 index 46be39d414..0000000000 --- a/mcs/class/lib/monolite-unix/A144A63D-652C-4CCF-A9EE-8E5A091547F1/System.Core.dll.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -b2d1d12c815dd2731ceb7238b8de888ec1dc4427 \ No newline at end of file diff --git a/mcs/class/lib/monolite-unix/A144A63D-652C-4CCF-A9EE-8E5A091547F1/System.IO.Compression.dll.REMOVED.git-id b/mcs/class/lib/monolite-unix/A144A63D-652C-4CCF-A9EE-8E5A091547F1/System.IO.Compression.dll.REMOVED.git-id deleted file mode 100644 index a841d59ba6..0000000000 --- a/mcs/class/lib/monolite-unix/A144A63D-652C-4CCF-A9EE-8E5A091547F1/System.IO.Compression.dll.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -d97bbdb4e0657d02c39782f54edf8dc4467b1b92 \ No newline at end of file diff --git a/mcs/class/lib/monolite-unix/A144A63D-652C-4CCF-A9EE-8E5A091547F1/System.Numerics.dll.REMOVED.git-id b/mcs/class/lib/monolite-unix/A144A63D-652C-4CCF-A9EE-8E5A091547F1/System.Numerics.dll.REMOVED.git-id deleted file mode 100644 index 990a91d170..0000000000 --- a/mcs/class/lib/monolite-unix/A144A63D-652C-4CCF-A9EE-8E5A091547F1/System.Numerics.dll.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -b3a0572d70584537d9b177e4afe63f7bb6ca3d5c \ No newline at end of file diff --git a/mcs/class/lib/monolite-unix/A144A63D-652C-4CCF-A9EE-8E5A091547F1/System.Xml.dll.REMOVED.git-id b/mcs/class/lib/monolite-unix/A144A63D-652C-4CCF-A9EE-8E5A091547F1/System.Xml.dll.REMOVED.git-id deleted file mode 100644 index 9aa6db03d5..0000000000 --- a/mcs/class/lib/monolite-unix/A144A63D-652C-4CCF-A9EE-8E5A091547F1/System.Xml.dll.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -e9ae2f2451e01d5135e74708e64d84c6c9107114 \ No newline at end of file diff --git a/mcs/class/lib/monolite-unix/A144A63D-652C-4CCF-A9EE-8E5A091547F1/System.dll.REMOVED.git-id b/mcs/class/lib/monolite-unix/A144A63D-652C-4CCF-A9EE-8E5A091547F1/System.dll.REMOVED.git-id deleted file mode 100644 index 4d39f88a2b..0000000000 --- a/mcs/class/lib/monolite-unix/A144A63D-652C-4CCF-A9EE-8E5A091547F1/System.dll.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -fdd96f02a656ffe6e476fde83e4774bf4827619b \ No newline at end of file diff --git a/mcs/class/lib/monolite-unix/A144A63D-652C-4CCF-A9EE-8E5A091547F1/mcs.exe.REMOVED.git-id b/mcs/class/lib/monolite-unix/A144A63D-652C-4CCF-A9EE-8E5A091547F1/mcs.exe.REMOVED.git-id deleted file mode 100644 index 57907a6470..0000000000 --- a/mcs/class/lib/monolite-unix/A144A63D-652C-4CCF-A9EE-8E5A091547F1/mcs.exe.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -81565efe2b0412f45e6703253e792f68b4fcf8f7 \ No newline at end of file diff --git a/mcs/class/lib/monolite-unix/A144A63D-652C-4CCF-A9EE-8E5A091547F1/mscorlib.dll.REMOVED.git-id b/mcs/class/lib/monolite-unix/A144A63D-652C-4CCF-A9EE-8E5A091547F1/mscorlib.dll.REMOVED.git-id deleted file mode 100644 index 1212af84f8..0000000000 --- a/mcs/class/lib/monolite-unix/A144A63D-652C-4CCF-A9EE-8E5A091547F1/mscorlib.dll.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -cf9041d8696b6f8d91bb0e5ce9e739575de742cf \ No newline at end of file diff --git a/mcs/class/lib/monolite-unix/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Collections.Concurrent.dll b/mcs/class/lib/monolite-unix/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Collections.Concurrent.dll similarity index 100% rename from mcs/class/lib/monolite-unix/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Collections.Concurrent.dll rename to mcs/class/lib/monolite-unix/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Collections.Concurrent.dll diff --git a/mcs/class/lib/monolite-unix/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Collections.dll b/mcs/class/lib/monolite-unix/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Collections.dll similarity index 100% rename from mcs/class/lib/monolite-unix/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Collections.dll rename to mcs/class/lib/monolite-unix/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Collections.dll diff --git a/mcs/class/lib/monolite-unix/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Diagnostics.Debug.dll b/mcs/class/lib/monolite-unix/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Diagnostics.Debug.dll similarity index 100% rename from mcs/class/lib/monolite-unix/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Diagnostics.Debug.dll rename to mcs/class/lib/monolite-unix/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Diagnostics.Debug.dll diff --git a/mcs/class/lib/monolite-unix/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Diagnostics.FileVersionInfo.dll b/mcs/class/lib/monolite-unix/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Diagnostics.FileVersionInfo.dll similarity index 100% rename from mcs/class/lib/monolite-unix/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Diagnostics.FileVersionInfo.dll rename to mcs/class/lib/monolite-unix/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Diagnostics.FileVersionInfo.dll diff --git a/mcs/class/lib/monolite-unix/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Diagnostics.Tools.dll b/mcs/class/lib/monolite-unix/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Diagnostics.Tools.dll similarity index 100% rename from mcs/class/lib/monolite-unix/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Diagnostics.Tools.dll rename to mcs/class/lib/monolite-unix/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Diagnostics.Tools.dll diff --git a/mcs/class/lib/monolite-unix/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Dynamic.Runtime.dll b/mcs/class/lib/monolite-unix/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Dynamic.Runtime.dll similarity index 100% rename from mcs/class/lib/monolite-unix/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Dynamic.Runtime.dll rename to mcs/class/lib/monolite-unix/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Dynamic.Runtime.dll diff --git a/mcs/class/lib/monolite-unix/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Globalization.dll b/mcs/class/lib/monolite-unix/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Globalization.dll similarity index 100% rename from mcs/class/lib/monolite-unix/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Globalization.dll rename to mcs/class/lib/monolite-unix/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Globalization.dll diff --git a/mcs/class/lib/monolite-unix/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.IO.FileSystem.Primitives.dll b/mcs/class/lib/monolite-unix/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.IO.FileSystem.Primitives.dll similarity index 100% rename from mcs/class/lib/monolite-unix/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.IO.FileSystem.Primitives.dll rename to mcs/class/lib/monolite-unix/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.IO.FileSystem.Primitives.dll diff --git a/mcs/class/lib/monolite-unix/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.IO.FileSystem.dll b/mcs/class/lib/monolite-unix/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.IO.FileSystem.dll similarity index 100% rename from mcs/class/lib/monolite-unix/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.IO.FileSystem.dll rename to mcs/class/lib/monolite-unix/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.IO.FileSystem.dll diff --git a/mcs/class/lib/monolite-unix/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.IO.dll b/mcs/class/lib/monolite-unix/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.IO.dll similarity index 100% rename from mcs/class/lib/monolite-unix/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.IO.dll rename to mcs/class/lib/monolite-unix/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.IO.dll diff --git a/mcs/class/lib/monolite-unix/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Linq.Expressions.dll b/mcs/class/lib/monolite-unix/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Linq.Expressions.dll similarity index 100% rename from mcs/class/lib/monolite-unix/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Linq.Expressions.dll rename to mcs/class/lib/monolite-unix/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Linq.Expressions.dll diff --git a/mcs/class/lib/monolite-unix/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Linq.dll b/mcs/class/lib/monolite-unix/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Linq.dll similarity index 100% rename from mcs/class/lib/monolite-unix/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Linq.dll rename to mcs/class/lib/monolite-unix/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Linq.dll diff --git a/mcs/class/lib/monolite-unix/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Reflection.Extensions.dll b/mcs/class/lib/monolite-unix/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Reflection.Extensions.dll similarity index 100% rename from mcs/class/lib/monolite-unix/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Reflection.Extensions.dll rename to mcs/class/lib/monolite-unix/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Reflection.Extensions.dll diff --git a/mcs/class/lib/monolite-unix/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Reflection.Primitives.dll b/mcs/class/lib/monolite-unix/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Reflection.Primitives.dll similarity index 100% rename from mcs/class/lib/monolite-unix/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Reflection.Primitives.dll rename to mcs/class/lib/monolite-unix/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Reflection.Primitives.dll diff --git a/mcs/class/lib/monolite-unix/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Reflection.dll b/mcs/class/lib/monolite-unix/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Reflection.dll similarity index 100% rename from mcs/class/lib/monolite-unix/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Reflection.dll rename to mcs/class/lib/monolite-unix/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Reflection.dll diff --git a/mcs/class/lib/monolite-unix/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Resources.ResourceManager.dll b/mcs/class/lib/monolite-unix/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Resources.ResourceManager.dll similarity index 100% rename from mcs/class/lib/monolite-unix/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Resources.ResourceManager.dll rename to mcs/class/lib/monolite-unix/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Resources.ResourceManager.dll diff --git a/mcs/class/lib/monolite-unix/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Runtime.Extensions.dll b/mcs/class/lib/monolite-unix/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Runtime.Extensions.dll similarity index 100% rename from mcs/class/lib/monolite-unix/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Runtime.Extensions.dll rename to mcs/class/lib/monolite-unix/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Runtime.Extensions.dll diff --git a/mcs/class/lib/monolite-unix/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Runtime.InteropServices.dll b/mcs/class/lib/monolite-unix/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Runtime.InteropServices.dll similarity index 100% rename from mcs/class/lib/monolite-unix/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Runtime.InteropServices.dll rename to mcs/class/lib/monolite-unix/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Runtime.InteropServices.dll diff --git a/mcs/class/lib/monolite-unix/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Runtime.Numerics.dll b/mcs/class/lib/monolite-unix/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Runtime.Numerics.dll similarity index 100% rename from mcs/class/lib/monolite-unix/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Runtime.Numerics.dll rename to mcs/class/lib/monolite-unix/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Runtime.Numerics.dll diff --git a/mcs/class/lib/monolite-unix/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Runtime.dll b/mcs/class/lib/monolite-unix/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Runtime.dll similarity index 100% rename from mcs/class/lib/monolite-unix/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Runtime.dll rename to mcs/class/lib/monolite-unix/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Runtime.dll diff --git a/mcs/class/lib/monolite-unix/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Security.Cryptography.Algorithms.dll b/mcs/class/lib/monolite-unix/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Security.Cryptography.Algorithms.dll similarity index 100% rename from mcs/class/lib/monolite-unix/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Security.Cryptography.Algorithms.dll rename to mcs/class/lib/monolite-unix/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Security.Cryptography.Algorithms.dll diff --git a/mcs/class/lib/monolite-unix/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Security.Cryptography.Primitives.dll b/mcs/class/lib/monolite-unix/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Security.Cryptography.Primitives.dll similarity index 100% rename from mcs/class/lib/monolite-unix/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Security.Cryptography.Primitives.dll rename to mcs/class/lib/monolite-unix/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Security.Cryptography.Primitives.dll diff --git a/mcs/class/lib/monolite-unix/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Text.Encoding.CodePages.dll b/mcs/class/lib/monolite-unix/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Text.Encoding.CodePages.dll similarity index 100% rename from mcs/class/lib/monolite-unix/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Text.Encoding.CodePages.dll rename to mcs/class/lib/monolite-unix/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Text.Encoding.CodePages.dll diff --git a/mcs/class/lib/monolite-unix/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Text.Encoding.Extensions.dll b/mcs/class/lib/monolite-unix/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Text.Encoding.Extensions.dll similarity index 100% rename from mcs/class/lib/monolite-unix/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Text.Encoding.Extensions.dll rename to mcs/class/lib/monolite-unix/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Text.Encoding.Extensions.dll diff --git a/mcs/class/lib/monolite-unix/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Text.Encoding.dll b/mcs/class/lib/monolite-unix/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Text.Encoding.dll similarity index 100% rename from mcs/class/lib/monolite-unix/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Text.Encoding.dll rename to mcs/class/lib/monolite-unix/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Text.Encoding.dll diff --git a/mcs/class/lib/monolite-unix/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Threading.Tasks.Parallel.dll b/mcs/class/lib/monolite-unix/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Threading.Tasks.Parallel.dll similarity index 100% rename from mcs/class/lib/monolite-unix/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Threading.Tasks.Parallel.dll rename to mcs/class/lib/monolite-unix/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Threading.Tasks.Parallel.dll diff --git a/mcs/class/lib/monolite-unix/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Threading.Tasks.dll b/mcs/class/lib/monolite-unix/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Threading.Tasks.dll similarity index 100% rename from mcs/class/lib/monolite-unix/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Threading.Tasks.dll rename to mcs/class/lib/monolite-unix/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Threading.Tasks.dll diff --git a/mcs/class/lib/monolite-unix/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Threading.dll b/mcs/class/lib/monolite-unix/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Threading.dll similarity index 100% rename from mcs/class/lib/monolite-unix/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Threading.dll rename to mcs/class/lib/monolite-unix/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Threading.dll diff --git a/mcs/class/lib/monolite-unix/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.ValueTuple.dll b/mcs/class/lib/monolite-unix/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.ValueTuple.dll similarity index 100% rename from mcs/class/lib/monolite-unix/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.ValueTuple.dll rename to mcs/class/lib/monolite-unix/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.ValueTuple.dll diff --git a/mcs/class/lib/monolite-unix/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Xml.ReaderWriter.dll b/mcs/class/lib/monolite-unix/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Xml.ReaderWriter.dll similarity index 100% rename from mcs/class/lib/monolite-unix/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Xml.ReaderWriter.dll rename to mcs/class/lib/monolite-unix/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Xml.ReaderWriter.dll diff --git a/mcs/class/lib/monolite-unix/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Xml.XDocument.dll b/mcs/class/lib/monolite-unix/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Xml.XDocument.dll similarity index 100% rename from mcs/class/lib/monolite-unix/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Xml.XDocument.dll rename to mcs/class/lib/monolite-unix/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Xml.XDocument.dll diff --git a/mcs/class/lib/monolite-unix/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/netstandard.dll.REMOVED.git-id b/mcs/class/lib/monolite-unix/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/netstandard.dll.REMOVED.git-id new file mode 100644 index 0000000000..c1b6653057 --- /dev/null +++ b/mcs/class/lib/monolite-unix/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/netstandard.dll.REMOVED.git-id @@ -0,0 +1 @@ +1ff46092b9a120eb841c522b31e0e90e291874fe \ No newline at end of file diff --git a/mcs/class/lib/monolite-unix/ABB721D6-116A-4555-B4FD-9248146D2051/Mono.Cecil.dll.REMOVED.git-id b/mcs/class/lib/monolite-unix/ABB721D6-116A-4555-B4FD-9248146D2051/Mono.Cecil.dll.REMOVED.git-id new file mode 100644 index 0000000000..1e92b9e74a --- /dev/null +++ b/mcs/class/lib/monolite-unix/ABB721D6-116A-4555-B4FD-9248146D2051/Mono.Cecil.dll.REMOVED.git-id @@ -0,0 +1 @@ +c835199ef4f799c5ea6f316c148249ab88cede2a \ No newline at end of file diff --git a/mcs/class/lib/monolite-unix/ABB721D6-116A-4555-B4FD-9248146D2051/Mono.Security.dll.REMOVED.git-id b/mcs/class/lib/monolite-unix/ABB721D6-116A-4555-B4FD-9248146D2051/Mono.Security.dll.REMOVED.git-id new file mode 100644 index 0000000000..62534ee432 --- /dev/null +++ b/mcs/class/lib/monolite-unix/ABB721D6-116A-4555-B4FD-9248146D2051/Mono.Security.dll.REMOVED.git-id @@ -0,0 +1 @@ +10c199f6273088a52230ffe5240dab06dc79ef6a \ No newline at end of file diff --git a/mcs/class/lib/monolite-unix/ABB721D6-116A-4555-B4FD-9248146D2051/System.Configuration.dll.REMOVED.git-id b/mcs/class/lib/monolite-unix/ABB721D6-116A-4555-B4FD-9248146D2051/System.Configuration.dll.REMOVED.git-id new file mode 100644 index 0000000000..89473e8e0a --- /dev/null +++ b/mcs/class/lib/monolite-unix/ABB721D6-116A-4555-B4FD-9248146D2051/System.Configuration.dll.REMOVED.git-id @@ -0,0 +1 @@ +d7c75a5161e4dc77ff72514f81e5bcfee1f66f18 \ No newline at end of file diff --git a/mcs/class/lib/monolite-unix/ABB721D6-116A-4555-B4FD-9248146D2051/System.Core.dll.REMOVED.git-id b/mcs/class/lib/monolite-unix/ABB721D6-116A-4555-B4FD-9248146D2051/System.Core.dll.REMOVED.git-id new file mode 100644 index 0000000000..d783e90e06 --- /dev/null +++ b/mcs/class/lib/monolite-unix/ABB721D6-116A-4555-B4FD-9248146D2051/System.Core.dll.REMOVED.git-id @@ -0,0 +1 @@ +97a131da135cdb88e3070994bfcb405182f0cc23 \ No newline at end of file diff --git a/mcs/class/lib/monolite-unix/ABB721D6-116A-4555-B4FD-9248146D2051/System.IO.Compression.dll.REMOVED.git-id b/mcs/class/lib/monolite-unix/ABB721D6-116A-4555-B4FD-9248146D2051/System.IO.Compression.dll.REMOVED.git-id new file mode 100644 index 0000000000..9eb794c682 --- /dev/null +++ b/mcs/class/lib/monolite-unix/ABB721D6-116A-4555-B4FD-9248146D2051/System.IO.Compression.dll.REMOVED.git-id @@ -0,0 +1 @@ +5090147e0bd6549ca5cbf10241cacd11d023d17c \ No newline at end of file diff --git a/mcs/class/lib/monolite-unix/ABB721D6-116A-4555-B4FD-9248146D2051/System.Numerics.dll.REMOVED.git-id b/mcs/class/lib/monolite-unix/ABB721D6-116A-4555-B4FD-9248146D2051/System.Numerics.dll.REMOVED.git-id new file mode 100644 index 0000000000..7ad0ca9687 --- /dev/null +++ b/mcs/class/lib/monolite-unix/ABB721D6-116A-4555-B4FD-9248146D2051/System.Numerics.dll.REMOVED.git-id @@ -0,0 +1 @@ +3529d3fc8f191980ad92d1191106ad14ea1e6f0b \ No newline at end of file diff --git a/mcs/class/lib/monolite-unix/A144A63D-652C-4CCF-A9EE-8E5A091547F1/System.Security.dll.REMOVED.git-id b/mcs/class/lib/monolite-unix/ABB721D6-116A-4555-B4FD-9248146D2051/System.Security.dll.REMOVED.git-id similarity index 100% rename from mcs/class/lib/monolite-unix/A144A63D-652C-4CCF-A9EE-8E5A091547F1/System.Security.dll.REMOVED.git-id rename to mcs/class/lib/monolite-unix/ABB721D6-116A-4555-B4FD-9248146D2051/System.Security.dll.REMOVED.git-id diff --git a/mcs/class/lib/monolite-unix/A144A63D-652C-4CCF-A9EE-8E5A091547F1/System.Xml.Linq.dll.REMOVED.git-id b/mcs/class/lib/monolite-unix/ABB721D6-116A-4555-B4FD-9248146D2051/System.Xml.Linq.dll.REMOVED.git-id similarity index 100% rename from mcs/class/lib/monolite-unix/A144A63D-652C-4CCF-A9EE-8E5A091547F1/System.Xml.Linq.dll.REMOVED.git-id rename to mcs/class/lib/monolite-unix/ABB721D6-116A-4555-B4FD-9248146D2051/System.Xml.Linq.dll.REMOVED.git-id diff --git a/mcs/class/lib/monolite-unix/ABB721D6-116A-4555-B4FD-9248146D2051/System.Xml.dll.REMOVED.git-id b/mcs/class/lib/monolite-unix/ABB721D6-116A-4555-B4FD-9248146D2051/System.Xml.dll.REMOVED.git-id new file mode 100644 index 0000000000..4ade6a3678 --- /dev/null +++ b/mcs/class/lib/monolite-unix/ABB721D6-116A-4555-B4FD-9248146D2051/System.Xml.dll.REMOVED.git-id @@ -0,0 +1 @@ +5bf7ee680fde34b85692b0dfd2698af889ab8767 \ No newline at end of file diff --git a/mcs/class/lib/monolite-unix/ABB721D6-116A-4555-B4FD-9248146D2051/System.dll.REMOVED.git-id b/mcs/class/lib/monolite-unix/ABB721D6-116A-4555-B4FD-9248146D2051/System.dll.REMOVED.git-id new file mode 100644 index 0000000000..bbe262d302 --- /dev/null +++ b/mcs/class/lib/monolite-unix/ABB721D6-116A-4555-B4FD-9248146D2051/System.dll.REMOVED.git-id @@ -0,0 +1 @@ +444cfb43e9d19732c08dfc47c74331d659aabd72 \ No newline at end of file diff --git a/mcs/class/lib/monolite-unix/ABB721D6-116A-4555-B4FD-9248146D2051/mcs.exe.REMOVED.git-id b/mcs/class/lib/monolite-unix/ABB721D6-116A-4555-B4FD-9248146D2051/mcs.exe.REMOVED.git-id new file mode 100644 index 0000000000..0bd014855b --- /dev/null +++ b/mcs/class/lib/monolite-unix/ABB721D6-116A-4555-B4FD-9248146D2051/mcs.exe.REMOVED.git-id @@ -0,0 +1 @@ +4f01f6898ed1815cc48192ace724a80bcce666f8 \ No newline at end of file diff --git a/mcs/class/lib/monolite-unix/ABB721D6-116A-4555-B4FD-9248146D2051/mscorlib.dll.REMOVED.git-id b/mcs/class/lib/monolite-unix/ABB721D6-116A-4555-B4FD-9248146D2051/mscorlib.dll.REMOVED.git-id new file mode 100644 index 0000000000..96aaab6f39 --- /dev/null +++ b/mcs/class/lib/monolite-unix/ABB721D6-116A-4555-B4FD-9248146D2051/mscorlib.dll.REMOVED.git-id @@ -0,0 +1 @@ +ea565b946160f2dab6d14029d989862bb8ad1293 \ No newline at end of file diff --git a/mcs/class/lib/monolite-win32/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/netstandard.dll.REMOVED.git-id b/mcs/class/lib/monolite-win32/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/netstandard.dll.REMOVED.git-id deleted file mode 100644 index e0103a2a1e..0000000000 --- a/mcs/class/lib/monolite-win32/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/netstandard.dll.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -56458cedc0a306d35e8a68743d493b8814d3169d \ No newline at end of file diff --git a/mcs/class/lib/monolite-win32/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Mono.Cecil.dll.REMOVED.git-id b/mcs/class/lib/monolite-win32/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Mono.Cecil.dll.REMOVED.git-id deleted file mode 100644 index 306cb0fa83..0000000000 --- a/mcs/class/lib/monolite-win32/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Mono.Cecil.dll.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -a59e995fac121cfdd11ce0d927c7d3b506365f17 \ No newline at end of file diff --git a/mcs/class/lib/monolite-win32/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Mono.Security.dll.REMOVED.git-id b/mcs/class/lib/monolite-win32/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Mono.Security.dll.REMOVED.git-id deleted file mode 100644 index 74df7a692f..0000000000 --- a/mcs/class/lib/monolite-win32/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Mono.Security.dll.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -7db2447256a75befb73a1f986c2a83808086ccb4 \ No newline at end of file diff --git a/mcs/class/lib/monolite-win32/A144A63D-652C-4CCF-A9EE-8E5A091547F1/System.Configuration.dll.REMOVED.git-id b/mcs/class/lib/monolite-win32/A144A63D-652C-4CCF-A9EE-8E5A091547F1/System.Configuration.dll.REMOVED.git-id deleted file mode 100644 index ef66e48d80..0000000000 --- a/mcs/class/lib/monolite-win32/A144A63D-652C-4CCF-A9EE-8E5A091547F1/System.Configuration.dll.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -c9e4f0a11e45ac3c153c2a636d3ba3768a2766d2 \ No newline at end of file diff --git a/mcs/class/lib/monolite-win32/A144A63D-652C-4CCF-A9EE-8E5A091547F1/System.Core.dll.REMOVED.git-id b/mcs/class/lib/monolite-win32/A144A63D-652C-4CCF-A9EE-8E5A091547F1/System.Core.dll.REMOVED.git-id deleted file mode 100644 index dc7c54bb68..0000000000 --- a/mcs/class/lib/monolite-win32/A144A63D-652C-4CCF-A9EE-8E5A091547F1/System.Core.dll.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -7be770041cc663cde7e2b4a1bc18977580b045b0 \ No newline at end of file diff --git a/mcs/class/lib/monolite-win32/A144A63D-652C-4CCF-A9EE-8E5A091547F1/System.IO.Compression.dll.REMOVED.git-id b/mcs/class/lib/monolite-win32/A144A63D-652C-4CCF-A9EE-8E5A091547F1/System.IO.Compression.dll.REMOVED.git-id deleted file mode 100644 index a841d59ba6..0000000000 --- a/mcs/class/lib/monolite-win32/A144A63D-652C-4CCF-A9EE-8E5A091547F1/System.IO.Compression.dll.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -d97bbdb4e0657d02c39782f54edf8dc4467b1b92 \ No newline at end of file diff --git a/mcs/class/lib/monolite-win32/A144A63D-652C-4CCF-A9EE-8E5A091547F1/System.Numerics.dll.REMOVED.git-id b/mcs/class/lib/monolite-win32/A144A63D-652C-4CCF-A9EE-8E5A091547F1/System.Numerics.dll.REMOVED.git-id deleted file mode 100644 index 990a91d170..0000000000 --- a/mcs/class/lib/monolite-win32/A144A63D-652C-4CCF-A9EE-8E5A091547F1/System.Numerics.dll.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -b3a0572d70584537d9b177e4afe63f7bb6ca3d5c \ No newline at end of file diff --git a/mcs/class/lib/monolite-win32/A144A63D-652C-4CCF-A9EE-8E5A091547F1/System.Xml.dll.REMOVED.git-id b/mcs/class/lib/monolite-win32/A144A63D-652C-4CCF-A9EE-8E5A091547F1/System.Xml.dll.REMOVED.git-id deleted file mode 100644 index 9aa6db03d5..0000000000 --- a/mcs/class/lib/monolite-win32/A144A63D-652C-4CCF-A9EE-8E5A091547F1/System.Xml.dll.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -e9ae2f2451e01d5135e74708e64d84c6c9107114 \ No newline at end of file diff --git a/mcs/class/lib/monolite-win32/A144A63D-652C-4CCF-A9EE-8E5A091547F1/System.dll.REMOVED.git-id b/mcs/class/lib/monolite-win32/A144A63D-652C-4CCF-A9EE-8E5A091547F1/System.dll.REMOVED.git-id deleted file mode 100644 index 4d39f88a2b..0000000000 --- a/mcs/class/lib/monolite-win32/A144A63D-652C-4CCF-A9EE-8E5A091547F1/System.dll.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -fdd96f02a656ffe6e476fde83e4774bf4827619b \ No newline at end of file diff --git a/mcs/class/lib/monolite-win32/A144A63D-652C-4CCF-A9EE-8E5A091547F1/mcs.exe.REMOVED.git-id b/mcs/class/lib/monolite-win32/A144A63D-652C-4CCF-A9EE-8E5A091547F1/mcs.exe.REMOVED.git-id deleted file mode 100644 index 57907a6470..0000000000 --- a/mcs/class/lib/monolite-win32/A144A63D-652C-4CCF-A9EE-8E5A091547F1/mcs.exe.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -81565efe2b0412f45e6703253e792f68b4fcf8f7 \ No newline at end of file diff --git a/mcs/class/lib/monolite-win32/A144A63D-652C-4CCF-A9EE-8E5A091547F1/mscorlib.dll.REMOVED.git-id b/mcs/class/lib/monolite-win32/A144A63D-652C-4CCF-A9EE-8E5A091547F1/mscorlib.dll.REMOVED.git-id deleted file mode 100644 index 399c9d43e7..0000000000 --- a/mcs/class/lib/monolite-win32/A144A63D-652C-4CCF-A9EE-8E5A091547F1/mscorlib.dll.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -5dbdcb800f29d2482c0d7ca1644fb3d37a4150ec \ No newline at end of file diff --git a/mcs/class/lib/monolite-win32/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Collections.Concurrent.dll b/mcs/class/lib/monolite-win32/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Collections.Concurrent.dll similarity index 100% rename from mcs/class/lib/monolite-win32/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Collections.Concurrent.dll rename to mcs/class/lib/monolite-win32/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Collections.Concurrent.dll diff --git a/mcs/class/lib/monolite-win32/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Collections.dll b/mcs/class/lib/monolite-win32/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Collections.dll similarity index 100% rename from mcs/class/lib/monolite-win32/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Collections.dll rename to mcs/class/lib/monolite-win32/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Collections.dll diff --git a/mcs/class/lib/monolite-win32/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Diagnostics.Debug.dll b/mcs/class/lib/monolite-win32/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Diagnostics.Debug.dll similarity index 100% rename from mcs/class/lib/monolite-win32/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Diagnostics.Debug.dll rename to mcs/class/lib/monolite-win32/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Diagnostics.Debug.dll diff --git a/mcs/class/lib/monolite-win32/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Diagnostics.FileVersionInfo.dll b/mcs/class/lib/monolite-win32/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Diagnostics.FileVersionInfo.dll similarity index 100% rename from mcs/class/lib/monolite-win32/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Diagnostics.FileVersionInfo.dll rename to mcs/class/lib/monolite-win32/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Diagnostics.FileVersionInfo.dll diff --git a/mcs/class/lib/monolite-win32/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Diagnostics.Tools.dll b/mcs/class/lib/monolite-win32/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Diagnostics.Tools.dll similarity index 100% rename from mcs/class/lib/monolite-win32/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Diagnostics.Tools.dll rename to mcs/class/lib/monolite-win32/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Diagnostics.Tools.dll diff --git a/mcs/class/lib/monolite-win32/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Dynamic.Runtime.dll b/mcs/class/lib/monolite-win32/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Dynamic.Runtime.dll similarity index 100% rename from mcs/class/lib/monolite-win32/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Dynamic.Runtime.dll rename to mcs/class/lib/monolite-win32/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Dynamic.Runtime.dll diff --git a/mcs/class/lib/monolite-win32/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Globalization.dll b/mcs/class/lib/monolite-win32/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Globalization.dll similarity index 100% rename from mcs/class/lib/monolite-win32/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Globalization.dll rename to mcs/class/lib/monolite-win32/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Globalization.dll diff --git a/mcs/class/lib/monolite-win32/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.IO.FileSystem.Primitives.dll b/mcs/class/lib/monolite-win32/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.IO.FileSystem.Primitives.dll similarity index 100% rename from mcs/class/lib/monolite-win32/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.IO.FileSystem.Primitives.dll rename to mcs/class/lib/monolite-win32/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.IO.FileSystem.Primitives.dll diff --git a/mcs/class/lib/monolite-win32/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.IO.FileSystem.dll b/mcs/class/lib/monolite-win32/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.IO.FileSystem.dll similarity index 100% rename from mcs/class/lib/monolite-win32/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.IO.FileSystem.dll rename to mcs/class/lib/monolite-win32/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.IO.FileSystem.dll diff --git a/mcs/class/lib/monolite-win32/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.IO.dll b/mcs/class/lib/monolite-win32/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.IO.dll similarity index 100% rename from mcs/class/lib/monolite-win32/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.IO.dll rename to mcs/class/lib/monolite-win32/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.IO.dll diff --git a/mcs/class/lib/monolite-win32/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Linq.Expressions.dll b/mcs/class/lib/monolite-win32/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Linq.Expressions.dll similarity index 100% rename from mcs/class/lib/monolite-win32/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Linq.Expressions.dll rename to mcs/class/lib/monolite-win32/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Linq.Expressions.dll diff --git a/mcs/class/lib/monolite-win32/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Linq.dll b/mcs/class/lib/monolite-win32/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Linq.dll similarity index 100% rename from mcs/class/lib/monolite-win32/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Linq.dll rename to mcs/class/lib/monolite-win32/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Linq.dll diff --git a/mcs/class/lib/monolite-win32/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Reflection.Extensions.dll b/mcs/class/lib/monolite-win32/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Reflection.Extensions.dll similarity index 100% rename from mcs/class/lib/monolite-win32/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Reflection.Extensions.dll rename to mcs/class/lib/monolite-win32/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Reflection.Extensions.dll diff --git a/mcs/class/lib/monolite-win32/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Reflection.Primitives.dll b/mcs/class/lib/monolite-win32/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Reflection.Primitives.dll similarity index 100% rename from mcs/class/lib/monolite-win32/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Reflection.Primitives.dll rename to mcs/class/lib/monolite-win32/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Reflection.Primitives.dll diff --git a/mcs/class/lib/monolite-win32/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Reflection.dll b/mcs/class/lib/monolite-win32/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Reflection.dll similarity index 100% rename from mcs/class/lib/monolite-win32/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Reflection.dll rename to mcs/class/lib/monolite-win32/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Reflection.dll diff --git a/mcs/class/lib/monolite-win32/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Resources.ResourceManager.dll b/mcs/class/lib/monolite-win32/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Resources.ResourceManager.dll similarity index 100% rename from mcs/class/lib/monolite-win32/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Resources.ResourceManager.dll rename to mcs/class/lib/monolite-win32/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Resources.ResourceManager.dll diff --git a/mcs/class/lib/monolite-win32/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Runtime.Extensions.dll b/mcs/class/lib/monolite-win32/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Runtime.Extensions.dll similarity index 100% rename from mcs/class/lib/monolite-win32/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Runtime.Extensions.dll rename to mcs/class/lib/monolite-win32/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Runtime.Extensions.dll diff --git a/mcs/class/lib/monolite-win32/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Runtime.InteropServices.dll b/mcs/class/lib/monolite-win32/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Runtime.InteropServices.dll similarity index 100% rename from mcs/class/lib/monolite-win32/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Runtime.InteropServices.dll rename to mcs/class/lib/monolite-win32/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Runtime.InteropServices.dll diff --git a/mcs/class/lib/monolite-win32/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Runtime.Numerics.dll b/mcs/class/lib/monolite-win32/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Runtime.Numerics.dll similarity index 100% rename from mcs/class/lib/monolite-win32/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Runtime.Numerics.dll rename to mcs/class/lib/monolite-win32/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Runtime.Numerics.dll diff --git a/mcs/class/lib/monolite-win32/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Runtime.dll b/mcs/class/lib/monolite-win32/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Runtime.dll similarity index 100% rename from mcs/class/lib/monolite-win32/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Runtime.dll rename to mcs/class/lib/monolite-win32/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Runtime.dll diff --git a/mcs/class/lib/monolite-win32/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Security.Cryptography.Algorithms.dll b/mcs/class/lib/monolite-win32/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Security.Cryptography.Algorithms.dll similarity index 100% rename from mcs/class/lib/monolite-win32/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Security.Cryptography.Algorithms.dll rename to mcs/class/lib/monolite-win32/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Security.Cryptography.Algorithms.dll diff --git a/mcs/class/lib/monolite-win32/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Security.Cryptography.Primitives.dll b/mcs/class/lib/monolite-win32/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Security.Cryptography.Primitives.dll similarity index 100% rename from mcs/class/lib/monolite-win32/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Security.Cryptography.Primitives.dll rename to mcs/class/lib/monolite-win32/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Security.Cryptography.Primitives.dll diff --git a/mcs/class/lib/monolite-win32/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Text.Encoding.CodePages.dll b/mcs/class/lib/monolite-win32/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Text.Encoding.CodePages.dll similarity index 100% rename from mcs/class/lib/monolite-win32/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Text.Encoding.CodePages.dll rename to mcs/class/lib/monolite-win32/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Text.Encoding.CodePages.dll diff --git a/mcs/class/lib/monolite-win32/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Text.Encoding.Extensions.dll b/mcs/class/lib/monolite-win32/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Text.Encoding.Extensions.dll similarity index 100% rename from mcs/class/lib/monolite-win32/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Text.Encoding.Extensions.dll rename to mcs/class/lib/monolite-win32/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Text.Encoding.Extensions.dll diff --git a/mcs/class/lib/monolite-win32/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Text.Encoding.dll b/mcs/class/lib/monolite-win32/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Text.Encoding.dll similarity index 100% rename from mcs/class/lib/monolite-win32/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Text.Encoding.dll rename to mcs/class/lib/monolite-win32/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Text.Encoding.dll diff --git a/mcs/class/lib/monolite-win32/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Threading.Tasks.Parallel.dll b/mcs/class/lib/monolite-win32/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Threading.Tasks.Parallel.dll similarity index 100% rename from mcs/class/lib/monolite-win32/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Threading.Tasks.Parallel.dll rename to mcs/class/lib/monolite-win32/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Threading.Tasks.Parallel.dll diff --git a/mcs/class/lib/monolite-win32/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Threading.Tasks.dll b/mcs/class/lib/monolite-win32/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Threading.Tasks.dll similarity index 100% rename from mcs/class/lib/monolite-win32/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Threading.Tasks.dll rename to mcs/class/lib/monolite-win32/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Threading.Tasks.dll diff --git a/mcs/class/lib/monolite-win32/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Threading.dll b/mcs/class/lib/monolite-win32/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Threading.dll similarity index 100% rename from mcs/class/lib/monolite-win32/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Threading.dll rename to mcs/class/lib/monolite-win32/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Threading.dll diff --git a/mcs/class/lib/monolite-win32/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.ValueTuple.dll b/mcs/class/lib/monolite-win32/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.ValueTuple.dll similarity index 100% rename from mcs/class/lib/monolite-win32/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.ValueTuple.dll rename to mcs/class/lib/monolite-win32/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.ValueTuple.dll diff --git a/mcs/class/lib/monolite-win32/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Xml.ReaderWriter.dll b/mcs/class/lib/monolite-win32/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Xml.ReaderWriter.dll similarity index 100% rename from mcs/class/lib/monolite-win32/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Xml.ReaderWriter.dll rename to mcs/class/lib/monolite-win32/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Xml.ReaderWriter.dll diff --git a/mcs/class/lib/monolite-win32/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Xml.XDocument.dll b/mcs/class/lib/monolite-win32/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Xml.XDocument.dll similarity index 100% rename from mcs/class/lib/monolite-win32/A144A63D-652C-4CCF-A9EE-8E5A091547F1/Facades/System.Xml.XDocument.dll rename to mcs/class/lib/monolite-win32/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/System.Xml.XDocument.dll diff --git a/mcs/class/lib/monolite-win32/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/netstandard.dll.REMOVED.git-id b/mcs/class/lib/monolite-win32/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/netstandard.dll.REMOVED.git-id new file mode 100644 index 0000000000..c1b6653057 --- /dev/null +++ b/mcs/class/lib/monolite-win32/ABB721D6-116A-4555-B4FD-9248146D2051/Facades/netstandard.dll.REMOVED.git-id @@ -0,0 +1 @@ +1ff46092b9a120eb841c522b31e0e90e291874fe \ No newline at end of file diff --git a/mcs/class/lib/monolite-win32/ABB721D6-116A-4555-B4FD-9248146D2051/Mono.Cecil.dll.REMOVED.git-id b/mcs/class/lib/monolite-win32/ABB721D6-116A-4555-B4FD-9248146D2051/Mono.Cecil.dll.REMOVED.git-id new file mode 100644 index 0000000000..1e92b9e74a --- /dev/null +++ b/mcs/class/lib/monolite-win32/ABB721D6-116A-4555-B4FD-9248146D2051/Mono.Cecil.dll.REMOVED.git-id @@ -0,0 +1 @@ +c835199ef4f799c5ea6f316c148249ab88cede2a \ No newline at end of file diff --git a/mcs/class/lib/monolite-win32/ABB721D6-116A-4555-B4FD-9248146D2051/Mono.Security.dll.REMOVED.git-id b/mcs/class/lib/monolite-win32/ABB721D6-116A-4555-B4FD-9248146D2051/Mono.Security.dll.REMOVED.git-id new file mode 100644 index 0000000000..62534ee432 --- /dev/null +++ b/mcs/class/lib/monolite-win32/ABB721D6-116A-4555-B4FD-9248146D2051/Mono.Security.dll.REMOVED.git-id @@ -0,0 +1 @@ +10c199f6273088a52230ffe5240dab06dc79ef6a \ No newline at end of file diff --git a/mcs/class/lib/monolite-win32/ABB721D6-116A-4555-B4FD-9248146D2051/System.Configuration.dll.REMOVED.git-id b/mcs/class/lib/monolite-win32/ABB721D6-116A-4555-B4FD-9248146D2051/System.Configuration.dll.REMOVED.git-id new file mode 100644 index 0000000000..89473e8e0a --- /dev/null +++ b/mcs/class/lib/monolite-win32/ABB721D6-116A-4555-B4FD-9248146D2051/System.Configuration.dll.REMOVED.git-id @@ -0,0 +1 @@ +d7c75a5161e4dc77ff72514f81e5bcfee1f66f18 \ No newline at end of file diff --git a/mcs/class/lib/monolite-win32/ABB721D6-116A-4555-B4FD-9248146D2051/System.Core.dll.REMOVED.git-id b/mcs/class/lib/monolite-win32/ABB721D6-116A-4555-B4FD-9248146D2051/System.Core.dll.REMOVED.git-id new file mode 100644 index 0000000000..cf53c6297f --- /dev/null +++ b/mcs/class/lib/monolite-win32/ABB721D6-116A-4555-B4FD-9248146D2051/System.Core.dll.REMOVED.git-id @@ -0,0 +1 @@ +3632d2cb0f353da9f0afa80bf2c3eae827386ab5 \ No newline at end of file diff --git a/mcs/class/lib/monolite-win32/ABB721D6-116A-4555-B4FD-9248146D2051/System.IO.Compression.dll.REMOVED.git-id b/mcs/class/lib/monolite-win32/ABB721D6-116A-4555-B4FD-9248146D2051/System.IO.Compression.dll.REMOVED.git-id new file mode 100644 index 0000000000..9eb794c682 --- /dev/null +++ b/mcs/class/lib/monolite-win32/ABB721D6-116A-4555-B4FD-9248146D2051/System.IO.Compression.dll.REMOVED.git-id @@ -0,0 +1 @@ +5090147e0bd6549ca5cbf10241cacd11d023d17c \ No newline at end of file diff --git a/mcs/class/lib/monolite-win32/ABB721D6-116A-4555-B4FD-9248146D2051/System.Numerics.dll.REMOVED.git-id b/mcs/class/lib/monolite-win32/ABB721D6-116A-4555-B4FD-9248146D2051/System.Numerics.dll.REMOVED.git-id new file mode 100644 index 0000000000..7ad0ca9687 --- /dev/null +++ b/mcs/class/lib/monolite-win32/ABB721D6-116A-4555-B4FD-9248146D2051/System.Numerics.dll.REMOVED.git-id @@ -0,0 +1 @@ +3529d3fc8f191980ad92d1191106ad14ea1e6f0b \ No newline at end of file diff --git a/mcs/class/lib/monolite-win32/A144A63D-652C-4CCF-A9EE-8E5A091547F1/System.Security.dll.REMOVED.git-id b/mcs/class/lib/monolite-win32/ABB721D6-116A-4555-B4FD-9248146D2051/System.Security.dll.REMOVED.git-id similarity index 100% rename from mcs/class/lib/monolite-win32/A144A63D-652C-4CCF-A9EE-8E5A091547F1/System.Security.dll.REMOVED.git-id rename to mcs/class/lib/monolite-win32/ABB721D6-116A-4555-B4FD-9248146D2051/System.Security.dll.REMOVED.git-id diff --git a/mcs/class/lib/monolite-win32/A144A63D-652C-4CCF-A9EE-8E5A091547F1/System.Xml.Linq.dll.REMOVED.git-id b/mcs/class/lib/monolite-win32/ABB721D6-116A-4555-B4FD-9248146D2051/System.Xml.Linq.dll.REMOVED.git-id similarity index 100% rename from mcs/class/lib/monolite-win32/A144A63D-652C-4CCF-A9EE-8E5A091547F1/System.Xml.Linq.dll.REMOVED.git-id rename to mcs/class/lib/monolite-win32/ABB721D6-116A-4555-B4FD-9248146D2051/System.Xml.Linq.dll.REMOVED.git-id diff --git a/mcs/class/lib/monolite-win32/ABB721D6-116A-4555-B4FD-9248146D2051/System.Xml.dll.REMOVED.git-id b/mcs/class/lib/monolite-win32/ABB721D6-116A-4555-B4FD-9248146D2051/System.Xml.dll.REMOVED.git-id new file mode 100644 index 0000000000..4ade6a3678 --- /dev/null +++ b/mcs/class/lib/monolite-win32/ABB721D6-116A-4555-B4FD-9248146D2051/System.Xml.dll.REMOVED.git-id @@ -0,0 +1 @@ +5bf7ee680fde34b85692b0dfd2698af889ab8767 \ No newline at end of file diff --git a/mcs/class/lib/monolite-win32/ABB721D6-116A-4555-B4FD-9248146D2051/System.dll.REMOVED.git-id b/mcs/class/lib/monolite-win32/ABB721D6-116A-4555-B4FD-9248146D2051/System.dll.REMOVED.git-id new file mode 100644 index 0000000000..bbe262d302 --- /dev/null +++ b/mcs/class/lib/monolite-win32/ABB721D6-116A-4555-B4FD-9248146D2051/System.dll.REMOVED.git-id @@ -0,0 +1 @@ +444cfb43e9d19732c08dfc47c74331d659aabd72 \ No newline at end of file diff --git a/mcs/class/lib/monolite-win32/ABB721D6-116A-4555-B4FD-9248146D2051/mcs.exe.REMOVED.git-id b/mcs/class/lib/monolite-win32/ABB721D6-116A-4555-B4FD-9248146D2051/mcs.exe.REMOVED.git-id new file mode 100644 index 0000000000..0bd014855b --- /dev/null +++ b/mcs/class/lib/monolite-win32/ABB721D6-116A-4555-B4FD-9248146D2051/mcs.exe.REMOVED.git-id @@ -0,0 +1 @@ +4f01f6898ed1815cc48192ace724a80bcce666f8 \ No newline at end of file diff --git a/mcs/class/lib/monolite-win32/ABB721D6-116A-4555-B4FD-9248146D2051/mscorlib.dll.REMOVED.git-id b/mcs/class/lib/monolite-win32/ABB721D6-116A-4555-B4FD-9248146D2051/mscorlib.dll.REMOVED.git-id new file mode 100644 index 0000000000..0225f6afb0 --- /dev/null +++ b/mcs/class/lib/monolite-win32/ABB721D6-116A-4555-B4FD-9248146D2051/mscorlib.dll.REMOVED.git-id @@ -0,0 +1 @@ +07c246ad5b11f8c795f696149f3059cc86a761cd \ No newline at end of file diff --git a/mcs/class/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/PrimitiveDataContract.cs b/mcs/class/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/PrimitiveDataContract.cs index e7a7cbd1b3..6feb1ee8c9 100644 --- a/mcs/class/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/PrimitiveDataContract.cs +++ b/mcs/class/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/PrimitiveDataContract.cs @@ -10,6 +10,9 @@ namespace System.Runtime.Serialization using System.Reflection; using System.Xml; using System.Security; +#if MONO + using System.Runtime.CompilerServices; +#endif #if USE_REFEMIT public abstract class PrimitiveDataContract : DataContract @@ -70,6 +73,35 @@ namespace System.Runtime.Serialization internal MethodInfo XmlFormatWriterMethod { +#if MONO + [PreserveDependency ("WriteChar", "System.Runtime.Serialization.XmlWriterDelegator")] + [PreserveDependency ("WriteBoolean", "System.Runtime.Serialization.XmlWriterDelegator")] + [PreserveDependency ("WriteSignedByte", "System.Runtime.Serialization.XmlWriterDelegator")] + [PreserveDependency ("WriteUnsignedByte", "System.Runtime.Serialization.XmlWriterDelegator")] + [PreserveDependency ("WriteShort", "System.Runtime.Serialization.XmlWriterDelegator")] + [PreserveDependency ("WriteUnsignedShort", "System.Runtime.Serialization.XmlWriterDelegator")] + [PreserveDependency ("WriteInt", "System.Runtime.Serialization.XmlWriterDelegator")] + [PreserveDependency ("WriteUnsignedInt", "System.Runtime.Serialization.XmlWriterDelegator")] + [PreserveDependency ("WriteLong", "System.Runtime.Serialization.XmlWriterDelegator")] + [PreserveDependency ("WriteUnsignedLong", "System.Runtime.Serialization.XmlWriterDelegator")] + [PreserveDependency ("WriteFloat", "System.Runtime.Serialization.XmlWriterDelegator")] + [PreserveDependency ("WriteDouble", "System.Runtime.Serialization.XmlWriterDelegator")] + [PreserveDependency ("WriteDecimal", "System.Runtime.Serialization.XmlWriterDelegator")] + [PreserveDependency ("WriteDateTime", "System.Runtime.Serialization.XmlWriterDelegator")] + [PreserveDependency ("WriteString", "System.Runtime.Serialization.XmlWriterDelegator")] + [PreserveDependency ("WriteBase64", "System.Runtime.Serialization.XmlWriterDelegator")] + [PreserveDependency ("WriteAnyType", "System.Runtime.Serialization.XmlWriterDelegator")] + [PreserveDependency ("WriteTimeSpan", "System.Runtime.Serialization.XmlWriterDelegator")] + [PreserveDependency ("WriteGuid", "System.Runtime.Serialization.XmlWriterDelegator")] + [PreserveDependency ("WriteUri", "System.Runtime.Serialization.XmlWriterDelegator")] + [PreserveDependency ("WriteQName", "System.Runtime.Serialization.XmlWriterDelegator")] + + [PreserveDependency ("WriteString", "System.Runtime.Serialization.XmlObjectSerializerWriteContext")] + [PreserveDependency ("WriteBase64", "System.Runtime.Serialization.XmlObjectSerializerWriteContext")] + [PreserveDependency ("WriteAnyType", "System.Runtime.Serialization.XmlObjectSerializerWriteContext")] + [PreserveDependency ("WriteUri", "System.Runtime.Serialization.XmlObjectSerializerWriteContext")] + [PreserveDependency ("WriteQName", "System.Runtime.Serialization.XmlObjectSerializerWriteContext")] +#endif [Fx.Tag.SecurityNote(Critical = "Fetches the critical XmlFormatWriterMethod property.", Safe = "XmlFormatWriterMethod only needs to be protected for write; initialized in getter if null.")] [SecuritySafeCritical] @@ -88,6 +120,35 @@ namespace System.Runtime.Serialization internal MethodInfo XmlFormatContentWriterMethod { +#if MONO + [PreserveDependency ("WriteChar", "System.Runtime.Serialization.XmlWriterDelegator")] + [PreserveDependency ("WriteBoolean", "System.Runtime.Serialization.XmlWriterDelegator")] + [PreserveDependency ("WriteSignedByte", "System.Runtime.Serialization.XmlWriterDelegator")] + [PreserveDependency ("WriteUnsignedByte", "System.Runtime.Serialization.XmlWriterDelegator")] + [PreserveDependency ("WriteShort", "System.Runtime.Serialization.XmlWriterDelegator")] + [PreserveDependency ("WriteUnsignedShort", "System.Runtime.Serialization.XmlWriterDelegator")] + [PreserveDependency ("WriteInt", "System.Runtime.Serialization.XmlWriterDelegator")] + [PreserveDependency ("WriteUnsignedInt", "System.Runtime.Serialization.XmlWriterDelegator")] + [PreserveDependency ("WriteLong", "System.Runtime.Serialization.XmlWriterDelegator")] + [PreserveDependency ("WriteUnsignedLong", "System.Runtime.Serialization.XmlWriterDelegator")] + [PreserveDependency ("WriteFloat", "System.Runtime.Serialization.XmlWriterDelegator")] + [PreserveDependency ("WriteDouble", "System.Runtime.Serialization.XmlWriterDelegator")] + [PreserveDependency ("WriteDecimal", "System.Runtime.Serialization.XmlWriterDelegator")] + [PreserveDependency ("WriteDateTime", "System.Runtime.Serialization.XmlWriterDelegator")] + [PreserveDependency ("WriteString", "System.Runtime.Serialization.XmlWriterDelegator")] + [PreserveDependency ("WriteBase64", "System.Runtime.Serialization.XmlWriterDelegator")] + [PreserveDependency ("WriteAnyType", "System.Runtime.Serialization.XmlWriterDelegator")] + [PreserveDependency ("WriteTimeSpan", "System.Runtime.Serialization.XmlWriterDelegator")] + [PreserveDependency ("WriteGuid", "System.Runtime.Serialization.XmlWriterDelegator")] + [PreserveDependency ("WriteUri", "System.Runtime.Serialization.XmlWriterDelegator")] + [PreserveDependency ("WriteQName", "System.Runtime.Serialization.XmlWriterDelegator")] + + [PreserveDependency ("WriteString", "System.Runtime.Serialization.XmlObjectSerializerWriteContext")] + [PreserveDependency ("WriteBase64", "System.Runtime.Serialization.XmlObjectSerializerWriteContext")] + [PreserveDependency ("WriteAnyType", "System.Runtime.Serialization.XmlObjectSerializerWriteContext")] + [PreserveDependency ("WriteUri", "System.Runtime.Serialization.XmlObjectSerializerWriteContext")] + [PreserveDependency ("WriteQName", "System.Runtime.Serialization.XmlObjectSerializerWriteContext")] +#endif [Fx.Tag.SecurityNote(Critical = "Fetches the critical XmlFormatContentWriterMethod property.", Safe = "XmlFormatContentWriterMethod only needs to be protected for write; initialized in getter if null.")] [SecuritySafeCritical] @@ -106,6 +167,29 @@ namespace System.Runtime.Serialization internal MethodInfo XmlFormatReaderMethod { +#if MONO + [PreserveDependency ("ReadElementContentAsChar", "System.Runtime.Serialization.XmlReaderDelegator")] + [PreserveDependency ("ReadElementContentAsBoolean", "System.Runtime.Serialization.XmlReaderDelegator")] + [PreserveDependency ("ReadElementContentAsSignedByte", "System.Runtime.Serialization.XmlReaderDelegator")] + [PreserveDependency ("ReadElementContentAsUnsignedByte", "System.Runtime.Serialization.XmlReaderDelegator")] + [PreserveDependency ("ReadElementContentAsShort", "System.Runtime.Serialization.XmlReaderDelegator")] + [PreserveDependency ("ReadElementContentAsUnsignedShort", "System.Runtime.Serialization.XmlReaderDelegator")] + [PreserveDependency ("ReadElementContentAsInt", "System.Runtime.Serialization.XmlReaderDelegator")] + [PreserveDependency ("ReadElementContentAsUnsignedInt", "System.Runtime.Serialization.XmlReaderDelegator")] + [PreserveDependency ("ReadElementContentAsLong", "System.Runtime.Serialization.XmlReaderDelegator")] + [PreserveDependency ("ReadElementContentAsUnsignedLong", "System.Runtime.Serialization.XmlReaderDelegator")] + [PreserveDependency ("ReadElementContentAsFloat", "System.Runtime.Serialization.XmlReaderDelegator")] + [PreserveDependency ("ReadElementContentAsDouble", "System.Runtime.Serialization.XmlReaderDelegator")] + [PreserveDependency ("ReadElementContentAsDecimal", "System.Runtime.Serialization.XmlReaderDelegator")] + [PreserveDependency ("ReadElementContentAsDateTime", "System.Runtime.Serialization.XmlReaderDelegator")] + [PreserveDependency ("ReadElementContentAsString", "System.Runtime.Serialization.XmlReaderDelegator")] + [PreserveDependency ("ReadElementContentAsBase64", "System.Runtime.Serialization.XmlReaderDelegator")] + [PreserveDependency ("ReadElementContentAsAnyType", "System.Runtime.Serialization.XmlReaderDelegator")] + [PreserveDependency ("ReadElementContentAsTimeSpan", "System.Runtime.Serialization.XmlReaderDelegator")] + [PreserveDependency ("ReadElementContentAsGuid", "System.Runtime.Serialization.XmlReaderDelegator")] + [PreserveDependency ("ReadElementContentAsUri", "System.Runtime.Serialization.XmlReaderDelegator")] + [PreserveDependency ("ReadElementContentAsQName", "System.Runtime.Serialization.XmlReaderDelegator")] +#endif [Fx.Tag.SecurityNote(Critical = "Fetches the critical XmlFormatReaderMethod property.", Safe = "XmlFormatReaderMethod only needs to be protected for write; initialized in getter if null.")] [SecuritySafeCritical] diff --git a/mcs/class/referencesource/System/net/System/Net/Sockets/Socket.cs.REMOVED.git-id b/mcs/class/referencesource/System/net/System/Net/Sockets/Socket.cs.REMOVED.git-id index 15fbc77927..be183c0d0b 100644 --- a/mcs/class/referencesource/System/net/System/Net/Sockets/Socket.cs.REMOVED.git-id +++ b/mcs/class/referencesource/System/net/System/Net/Sockets/Socket.cs.REMOVED.git-id @@ -1 +1 @@ -78673562a9c1ebd8895e1f6d6fca65d9b978c4d7 \ No newline at end of file +be9e666ae292ad56ce00e255ef9b47967f79d9f1 \ No newline at end of file diff --git a/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/YieldAwaitable.cs b/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/YieldAwaitable.cs index 9a0d1f5aed..08b6de8ceb 100644 --- a/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/YieldAwaitable.cs +++ b/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/YieldAwaitable.cs @@ -42,7 +42,7 @@ namespace System.Runtime.CompilerServices /// Provides an awaitable context for switching into a target environment. /// This type is intended for compiler use only. - public struct YieldAwaitable + public readonly struct YieldAwaitable { /// Gets an awaiter for this . /// An awaiter for this awaitable. @@ -52,7 +52,7 @@ namespace System.Runtime.CompilerServices /// Provides an awaiter that switches into a target environment. /// This type is intended for compiler use only. [HostProtection(Synchronization = true, ExternalThreading = true)] - public struct YieldAwaiter : ICriticalNotifyCompletion + public readonly struct YieldAwaiter : ICriticalNotifyCompletion { /// Gets whether a yield is not required. /// This property is intended for compiler user rather than use directly in code. diff --git a/mcs/jay/Makefile b/mcs/jay/Makefile index 70f6602e45..1af6867ad7 100644 --- a/mcs/jay/Makefile +++ b/mcs/jay/Makefile @@ -46,8 +46,17 @@ dist-local: dist-default test-local run-test-local run-test-ondotnet-local doc-update-local: +ifndef ENABLE_MSVC_ONLY + jay: $(sources:.c=.o) $(CCOMPILE) $(LDFLAGS) -o $@ $^ %.o: %.c $(CCOMPILE) $(JAY_CFLAGS) -c -o $@ $^ + +else # !ENABLE_MSVC_ONLY + +jay: + make -C $(topdir)/../msvc jay + +endif # !ENABLE_MSVC_ONLY diff --git a/mcs/packages/Makefile b/mcs/packages/Makefile index c1e6d36709..342cdc62df 100644 --- a/mcs/packages/Makefile +++ b/mcs/packages/Makefile @@ -30,7 +30,6 @@ ROSLYN_FILES_TO_COPY_FOR_MSBUILD = \ $(ROSLYN_CSC_DIR)/Microsoft.Build.Tasks.CodeAnalysis.dll \ $(ROSLYN_CSC_DIR)/Microsoft.CSharp.Core.targets \ $(ROSLYN_CSC_DIR)/Microsoft.Managed.Core.targets \ - $(ROSLYN_CSC_DIR)/Microsoft.Managed.EditorConfig.targets \ $(ROSLYN_CSC_DIR)/Microsoft.VisualBasic.Core.targets DISTFILES = $(ROSLYN_FILES_FOR_MONO) $(ROSLYN_FILES_TO_COPY_FOR_MSBUILD) csi-test.csx diff --git a/mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.4.0/Microsoft.Build.Tasks.CodeAnalysis.dll.REMOVED.git-id b/mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.4.0/Microsoft.Build.Tasks.CodeAnalysis.dll.REMOVED.git-id deleted file mode 100644 index aa87f64c76..0000000000 --- a/mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.4.0/Microsoft.Build.Tasks.CodeAnalysis.dll.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -ddfb2a7c40933dc3532392c1e6ed0f721ba1b69c \ No newline at end of file diff --git a/mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.4.0/Microsoft.CodeAnalysis.CSharp.dll.REMOVED.git-id b/mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.4.0/Microsoft.CodeAnalysis.CSharp.dll.REMOVED.git-id deleted file mode 100644 index 9c6e2f79d9..0000000000 --- a/mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.4.0/Microsoft.CodeAnalysis.CSharp.dll.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -d4c701f5ef5e0c47d66c3701de98dfb94c3863c2 \ No newline at end of file diff --git a/mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.4.0/Microsoft.CodeAnalysis.Scripting.dll.REMOVED.git-id b/mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.4.0/Microsoft.CodeAnalysis.Scripting.dll.REMOVED.git-id deleted file mode 100644 index fc4a51a6b4..0000000000 --- a/mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.4.0/Microsoft.CodeAnalysis.Scripting.dll.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -2741119d779b36812d9c680a62391635c1bc0bbc \ No newline at end of file diff --git a/mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.4.0/Microsoft.CodeAnalysis.VisualBasic.dll.REMOVED.git-id b/mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.4.0/Microsoft.CodeAnalysis.VisualBasic.dll.REMOVED.git-id deleted file mode 100644 index 34e81a63ae..0000000000 --- a/mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.4.0/Microsoft.CodeAnalysis.VisualBasic.dll.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -cc40681a92642d70544e5a8338fcf191c15e7f91 \ No newline at end of file diff --git a/mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.4.0/Microsoft.CodeAnalysis.dll.REMOVED.git-id b/mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.4.0/Microsoft.CodeAnalysis.dll.REMOVED.git-id deleted file mode 100644 index 9611851cbb..0000000000 --- a/mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.4.0/Microsoft.CodeAnalysis.dll.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -ae8d6064e1a9d642df02483b5e610b18bb57fb6f \ No newline at end of file diff --git a/mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.4.0/Microsoft.Managed.EditorConfig.targets b/mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.4.0/Microsoft.Managed.EditorConfig.targets deleted file mode 100644 index d659d55470..0000000000 --- a/mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.4.0/Microsoft.Managed.EditorConfig.targets +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - <_AllDirectoriesAbove Include="@(Compile->GetPathsOfAllDirectoriesAbove())" Condition="'$(DiscoverEditorConfigFiles)' != 'false'" /> - - - - - - diff --git a/mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/Microsoft.Build.Tasks.CodeAnalysis.dll.REMOVED.git-id b/mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/Microsoft.Build.Tasks.CodeAnalysis.dll.REMOVED.git-id new file mode 100644 index 0000000000..5536b0dba4 --- /dev/null +++ b/mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/Microsoft.Build.Tasks.CodeAnalysis.dll.REMOVED.git-id @@ -0,0 +1 @@ +14c4ba0a932e7d62d715db026dde8455d777a8ea \ No newline at end of file diff --git a/mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/Microsoft.CSharp.Core.targets b/mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/Microsoft.CSharp.Core.targets new file mode 100644 index 0000000000..ed91b90b4f --- /dev/null +++ b/mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/Microsoft.CSharp.Core.targets @@ -0,0 +1,146 @@ + + + + + + + 7.3 + $(MaxSupportedLangVersion) + + + + + + $(NoWarn);1701;1702 + + + + + $(NoWarn);2008 + + + + + $(AppConfig) + + + $(IntermediateOutputPath)$(TargetName).compile.pdb + + + + + + + + + <_CoreCompileResourceInputs Remove="@(_CoreCompileResourceInputs)" /> + + + + + \ No newline at end of file diff --git a/mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/Microsoft.CodeAnalysis.CSharp.Scripting.dll b/mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/Microsoft.CodeAnalysis.CSharp.Scripting.dll new file mode 100644 index 0000000000000000000000000000000000000000..452298dd137319fad42ca323a47aa6dfc6aeb273 GIT binary patch literal 31104 zcmeHw30PA{*YMnXlMn&~5*8H@gSbSLaKnyOluboJQBd5dhU5Z~KrjgkT9jb5+Pd%7 z4QjR;yL(UbR-Od+Y9hW^NKtw0*ztd;7fK|Np&s&pqeN%$b=pXU;5l zZcOVv5itlM0o*TNBD4{n_-aewpMwermNwWVMeCdo1#YBL4+UoC>&=Q{lQGYvDO6}R zMMXx7B8O9$N{STvB1KY{3`L<)$En=hB#msM(~}WOr5Ggt_VjUkZWmBPg$u<(0C2=S zS5*K{1>6;IBjiDFnlCqI;PR7eJ3!!f8AL(7`j5m>@xSV)jl?Xt&J2LK7^y($nL`NB zJ%AMi&nkpm;c-xpP$oS8g>u)t6bSWKnan0F zFiF`e01?668SWZaTWBtoi8B}>A}%W~GuFZD1#XK_0&ris+_7Ha!eyh85cxMnNZAS@ zXTn7&31o^P&s3;?g^l-TkF9iwi-|(0*zAdrWXLc;1vC@Fcr_O>N-tp5QF;Sp1VSYQ zH4onVm+^gklyz#R$aysdjYUCan+LxsfWZMD(u}Zih+7i@DTY8<7sPofp|P6_qyl3- zpn}7&7^y%h#PQqN2&i^*r4#1ZgTWY^2M5qfKb*!_>CZpv<3|9a48YGEM$kA!)MOYG zNnmmTMR*C74R8QLo@@XLf?C5rnU{nyDuCTW#y^dLKv)_=phO8!;=&9If`^lru@O96 zos5m)!5Etm2yG-WDgiihVvK~>40v90(F<>=A|(@%jNO=_kherGkPD5?0cj!=IE%+Z z@%-xgczMZ$wxlf}Xe_A9&qjv;Z9`SnXegjwUUH`w-k?4|nUh@n!W(qvClmYl*kVJ! zm3YcnAyD#L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microsoft.Net.Compilers/3.5.0/Microsoft.CodeAnalysis.CSharp.dll.REMOVED.git-id b/mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/Microsoft.CodeAnalysis.CSharp.dll.REMOVED.git-id new file mode 100644 index 0000000000..e19172eb8d --- /dev/null +++ b/mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/Microsoft.CodeAnalysis.CSharp.dll.REMOVED.git-id @@ -0,0 +1 @@ +d981a20baaac679f86733a8e18d3d952e2e95ba3 \ No newline at end of file diff --git a/mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/Microsoft.CodeAnalysis.Scripting.dll.REMOVED.git-id b/mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/Microsoft.CodeAnalysis.Scripting.dll.REMOVED.git-id new file mode 100644 index 0000000000..0c98b8a3ed --- /dev/null +++ b/mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/Microsoft.CodeAnalysis.Scripting.dll.REMOVED.git-id @@ -0,0 +1 @@ +28a3e4df48150babf00b64489910031d0226e8c1 \ No newline at end of file diff --git a/mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/Microsoft.CodeAnalysis.VisualBasic.dll.REMOVED.git-id b/mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/Microsoft.CodeAnalysis.VisualBasic.dll.REMOVED.git-id new file mode 100644 index 0000000000..3b79397f00 --- /dev/null +++ b/mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/Microsoft.CodeAnalysis.VisualBasic.dll.REMOVED.git-id @@ -0,0 +1 @@ +d2f4cf7f9ecbe4b3a9f3ee6cef1ba8e236b037a4 \ No newline at end of file diff --git a/mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/Microsoft.CodeAnalysis.dll.REMOVED.git-id b/mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/Microsoft.CodeAnalysis.dll.REMOVED.git-id new file mode 100644 index 0000000000..6c42f4ca02 --- /dev/null +++ b/mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/Microsoft.CodeAnalysis.dll.REMOVED.git-id @@ -0,0 +1 @@ +6f35dca52fcb84d0fc5489e78b50a8e4be40a68a \ No newline at end of file diff --git a/mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/Microsoft.Managed.Core.targets b/mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/Microsoft.Managed.Core.targets new file mode 100644 index 0000000000..c87a6590d1 --- /dev/null +++ b/mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/Microsoft.Managed.Core.targets @@ -0,0 +1,169 @@ + + + + + + + + + + + + + + + + + + + + + + + + false + + + + + + + + + + true + + + + + + <_AllDirectoriesAbove Include="@(Compile->GetPathsOfAllDirectoriesAbove())" Condition="'$(DiscoverEditorConfigFiles)' != 'false'" /> + + + + + + + + true + + + + + + + + <_MappedSourceRoot Remove="@(_MappedSourceRoot)" /> + + + + + + + + + + + + + + + true + + + + + + + + + + + <_TopLevelSourceRoot Include="@(SourceRoot)" Condition="'%(SourceRoot.NestedRoot)' == ''"/> + + + + + + + ,$(PathMap) + + + @(_TopLevelSourceRoot->'%(Identity)=%(MappedPath)', ',')$(PathMap) + + + + \ No newline at end of file diff --git a/mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/Microsoft.VisualBasic.Core.targets b/mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/Microsoft.VisualBasic.Core.targets new file mode 100644 index 0000000000..d9e5eaa1c8 --- /dev/null +++ b/mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/Microsoft.VisualBasic.Core.targets @@ -0,0 +1,136 @@ + + + + + + + + <_NoWarnings Condition="'$(WarningLevel)' == '0'">true + <_NoWarnings Condition="'$(WarningLevel)' == '1'">false + + + + + $(IntermediateOutputPath)$(TargetName).compile.pdb + + + + + + + + <_CoreCompileResourceInputs Remove="@(_CoreCompileResourceInputs)" /> + + + + + diff --git a/mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/System.Collections.Immutable.dll.REMOVED.git-id b/mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/System.Collections.Immutable.dll.REMOVED.git-id new file mode 100644 index 0000000000..8b2bc9cb91 --- /dev/null +++ b/mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/System.Collections.Immutable.dll.REMOVED.git-id @@ -0,0 +1 @@ +049149f17929322dd246d994780d0399a24cf90f \ No newline at end of file diff --git a/mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/System.Memory.dll.REMOVED.git-id b/mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/System.Memory.dll.REMOVED.git-id new file mode 100644 index 0000000000..202d1b1e2f --- /dev/null +++ b/mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/System.Memory.dll.REMOVED.git-id @@ -0,0 +1 @@ +bdfc501e9647719549793297acb072d33067d4e5 \ No newline at end of file diff --git a/mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/System.Reflection.Metadata.dll.REMOVED.git-id b/mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/System.Reflection.Metadata.dll.REMOVED.git-id new file mode 100644 index 0000000000..4ef79f39fb --- /dev/null +++ b/mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/System.Reflection.Metadata.dll.REMOVED.git-id @@ -0,0 +1 @@ +52082366b0a69847cb0e6351ad4ac3690746f6b5 \ No newline at end of file diff --git a/mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/System.Runtime.CompilerServices.Unsafe.dll b/mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/System.Runtime.CompilerServices.Unsafe.dll new file mode 100644 index 0000000000000000000000000000000000000000..3156239266db9cceede249731f00c3822e479a1f GIT binary patch literal 23600 zcmeHv2V4|OllW{P=ZwT92MM!eL~@p>BoUCf1PP0~OEi!a5k*juAO=uSR0P3=hrCdY9sDx+=IfUXLNeJ|hiXzhp0VDz?CW;Ui zMX+#kAw-gcNNOA$tg`g1oh>2A9)p8qs!P0POY4EKQfwGD2;v76<{9c&A_xiKH32UI z2q3`D)EmUm`XeEf3|>HQDuzJ2Og2IgH~RZMq@#chc}{?Q?U0BGco~rh{gHqm*a*b^ zAc%dI_8$oeb5%!EF$3IYUV1eeDV_#!JTCy?8`@S-@A(e_l&(ghQUVboQa2NNCsV&W+Uom_4<^PJ*Ysj2(R{q8_?$lS*@hOl$J*94`m6MEG01T|8dRJbH^D!e z))kCB%Nl#@g`;3vJdaM%P2aNW+vhh9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-t?mxAG7_-tQe$?v0FGo;xtQR-dq^#yqG{JXtdi zPMMmQ0al%u@)AxNgj4$AlnZ!5S&F(_sitC$2PJK3j-gx7AUlViaW=(gcX3^Ng_$q7 zuUYWlU?}`raKKq6yv_Y(W8#5FW<^uiFMHo+?yt$tdAQLa&iu9imFF(DY4a5lY%GvF zIoWz5Z<1Dd?z6u1(R!s?3Wk-9!`n+V=yB4BrGxd7+Wy418)DDsT*W@z8T|gj`Ziw1 z3zJ`bUObkFKYhNL>KB;&Cf&G9>|?%(w(L0nmAo4UHOD#zp<~Q>buDpQEVpSdb|&1~ zvFFZ;Vg;|_Re_5}3t#OKpV*jl{N;hPI?2?n(F<3Itc}~ec+`u*NL!kBApK(J_OV-- zVh=u{vw%Gji#@PaP4!O~Kaxp%m^is6ysP(Sb|NL;Vt_SC OyIXQg_#$)@0sTLk9O=pc literal 0 HcmV?d00001 diff --git a/mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/System.Threading.Tasks.Extensions.dll b/mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/System.Threading.Tasks.Extensions.dll new file mode 100644 index 0000000000000000000000000000000000000000..e059050bb2066f749b6e37a5b42e4bffc3f48a70 GIT binary patch literal 33048 zcmeHv2Ut_h((s;>kU;1i0g z;*U2;|2ip#VvSZ?G|)Pg;})B!kmD9H=@}C9+&pnwo-o@yS(uX}mYOGt%=7Yd%rkP# z{llZpv&AVQzPdWkT24A50HF|yh3@I9^lt3!2C_6)r5J?V0i!I#ruKlRIeh!V7a=W@ zr)7L&1m>T7svrgYOHT^M@U0SS^t%N7`PUX4T@1jRtgTXJA((tI8q`oHgkoxL+1Yzfw@%Mia4Qb)6b>22cQ! z(Pe1V7M>JB+A<u zw}4z5ZMN7Lo@&?h3C zJFsFfh;}yiP!HQLu8-~40iF^*M$-N9NM!aq8t8)O!S;*!5ko&f-9D)i27Bg_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{cCmsZx$kOfI!M}|T&di8M3jfI_v*7%PpA1EjM5lCVXR3=X^XCgeEnlD zH_ZOFX;nZ_?~P*)pNXzN_TrDdFIu_vep6R#IY7MrikX$)Cma5k`)~^fw#W2KVz5*G zy8#wCNc+|9T=5{SlyYK>o6c6?2AKMHrzgyhCu47|1Lk;VAA1r~sXDIWqtA{vdrJ+M z>F!jzG;qycPx@^SrsS3a0a{H^a+)bQ$&?&pN>;P=er4BiF_kGPUQqPEQCM)Rtc`8M-_72OpzANEK1mQl*~(|aCSDBpB`J-6pZgUkaGhSQ-%E;~8t zOwr;G!;f70IJZr=rP^b3W~pS2DZaergyol-F3yr@zgX+^2^U9BAF-fA_O_sqi{0xZ zb<|f6;?{J~sBK>cRlqj@y~fj=FBP0 z7l{uI9&*V&qQ9h2GTG{WP$*DMXa>|j0u>7m@UKse!e1ngE{tqFOh#LR^ literal 0 HcmV?d00001 diff --git a/mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/VBCSCompiler.exe b/mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/VBCSCompiler.exe new file mode 100644 index 0000000000000000000000000000000000000000..d0c3890260b8e212094508fdd318629dec6e0916 GIT binary patch literal 88960 zcmcG%37AyH^*&s6@9o>$%rHGm_bkB705e>A7GPk2fl(Gw#06Olf;+eyw6PnF($i!R z#SIr+h`2@EH5&INMvWLGChm!AlyOO7G|@!k5;cbW-}lt*>BdBVKF{}jqqnNgsZ*y; zojO%@s_Ncm@BJ@Owo=N$^Pm4H^#Ef2O_T83gFa-JH9T0R?g>BL^nl*$>85>;J|@$+ zJe@i!z2vyY!d}>AG(jywvCm!E;%<+vg_gT<*Tj_Al-=cp@=CR)0UANDdjTY-_^(m{<-Hg+I8sZN|nq1 zh1drTwdw}neV7K{cY{8X(Il<WV8b-}Nc3Ild^L9OrZ4t)UkfBm(1up~FWT_@*w;Ow@$X++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^;+zuaKD&YZ-M} zzC+iq`n$~E#UHPCY3ZhUmZ-`9IvsDjcJKdhr++aWYg<{_dbRGe`@Phzokq;c+;V*i z&lsCLx*~2g9&Yt6?aB^WFaFN&m`48dZ||q<(ph!9t9yf8^pm|R3BC)?bd^8bnwreG z^+iE%WJ$hHfBpKOo(cM!TwgJ(%haz(&cC{-WPbI*L=%SB$Ho7DncI3+UG)@C*JtTI NvFl1tT~-S)007%0Q+faZ literal 0 HcmV?d00001 diff --git a/mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/VBCSCompiler.exe.config b/mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/VBCSCompiler.exe.config new file mode 100644 index 0000000000..0715c1248c --- /dev/null +++ b/mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/VBCSCompiler.exe.config @@ -0,0 +1,83 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/csc.exe b/mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/csc.exe new file mode 100644 index 0000000000000000000000000000000000000000..346a320519c8faf6e940fabe709fe865351791f4 GIT binary patch literal 56688 zcmcG%3w%`7wFkV;W6nG?WG2ZZ0Rj^sVaQ7YDqv9wFO3BPgopTO49NhaNluuV05Jp; zU#%84476Yo#kThpDr@vhFkK06!VoQ$Uj`r@g+_|mrac(2`^Y$_@W%y3w*UPiP+Gw7@L zy!^1++hLkUL2WkCBcKEnb=r$a<9H6^Vd>&XbR{=(WHI2sxF+-~5*o&J$u&g9@_#;c zP*t10|6QUs&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/Microsoft.Net.Compilers/3.5.0/csc.exe.config b/mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/csc.exe.config new file mode 100644 index 0000000000..910bda51fc --- /dev/null +++ b/mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/csc.exe.config @@ -0,0 +1,72 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/csc.rsp b/mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/csc.rsp new file mode 100644 index 0000000000..ce72ac60cf --- /dev/null +++ b/mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/csc.rsp @@ -0,0 +1,46 @@ +# Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +# This file contains command-line options that the C# +# command line compiler (CSC) will process as part +# of every compilation, unless the "/noconfig" option +# is specified. + +# Reference the common Framework libraries +/r:Accessibility.dll +/r:Microsoft.CSharp.dll +/r:System.Configuration.dll +/r:System.Configuration.Install.dll +/r:System.Core.dll +/r:System.Data.dll +/r:System.Data.DataSetExtensions.dll +/r:System.Data.Linq.dll +/r:System.Data.OracleClient.dll +/r:System.Deployment.dll +/r:System.Design.dll +/r:System.DirectoryServices.dll +/r:System.dll +/r:System.Drawing.Design.dll +/r:System.Drawing.dll +/r:System.EnterpriseServices.dll +/r:System.Management.dll +/r:System.Messaging.dll +/r:System.Runtime.Remoting.dll +/r:System.Runtime.Serialization.dll +/r:System.Runtime.Serialization.Formatters.Soap.dll +/r:System.Security.dll +/r:System.ServiceModel.dll +/r:System.ServiceModel.Web.dll +/r:System.ServiceProcess.dll +/r:System.Transactions.dll +/r:System.Web.dll +/r:System.Web.Extensions.Design.dll +/r:System.Web.Extensions.dll +/r:System.Web.Mobile.dll +/r:System.Web.RegularExpressions.dll +/r:System.Web.Services.dll +/r:System.Windows.Forms.dll +/r:System.Workflow.Activities.dll +/r:System.Workflow.ComponentModel.dll +/r:System.Workflow.Runtime.dll +/r:System.Xml.dll +/r:System.Xml.Linq.dll diff --git a/mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/csi.exe b/mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/csi.exe new file mode 100644 index 0000000000000000000000000000000000000000..6c9a8cce4069a1f533568dcb23f708b63dfe2969 GIT binary patch literal 16448 zcmeHu2Ut^Cx9CnGKoF!@P}%`O5F|NCNJvzWu1FC9!NzDv4v--QlYoE?P!T&e>;jI8 z&IpQSbg(k^UdKUHY$KM@0Sor>);UzC{r~;m{lB^IesA-gb#_^M?X}k~tK<+dst_>{ zLQHr*e@18zyvgK8!M_JN&}`;VWrlVdpLN_r3qR`^o1)NRX#Sk}Xt` zOpZgS6TJKYFSe!W-+EyP8FfH3g7V-FWsaW6)I)hhX8_Pf@dkW%Oc;#L(dx7^sHAxF zgA7U35}pppk7Q3vC^djc@=EfINLoGN>5%*o3g}RzvI0`BkVxL>$N;^;5IO-wjG;{H zAl5^k&7y_szfCr{0h$FE(AVMu@IZGngEe%6S+X@CezwMf1TX=%n-u`IC5`3Qg)DU? zK{pa~2f)$-fiyR3$QsghJ>aE-$*?<3u>oi_1r~?xW=GcA1JF1CFsUL2ewzy&-BSz~~d0N()ry`~@} zXCP#40QnfbR-sPTkrG!yb_Ul40^JVsR0`{ry;YEZi%FfMmif!VXR_Wf}|ShX6PVe z0@NR66hrZaD4cB+&TGg6Wondqphl+V*^=v&0}JQ^eS9EKL&I`rqflBDM&c|+ zUW{-W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n^+X-5=QoEztFr*2H`K?0oC%ZYiOKhU*1OEu=jvwmcV`Z5g*t z)1$V^Om>65yP9}|eajJcJziPaBXHP)E-p3q6t)&OZ)W>#Wb$+4qF$Bz)zlB*njf#u zQ(Yf0wm!$!$X)((U9Wo;wKgKe(Kbbj;?OpDCpsEF?aq3mp&@TpU+=?=(Fw$Yjbio`aiFp&qDwJ literal 0 HcmV?d00001 diff --git a/mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/csi.exe.config b/mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/csi.exe.config new file mode 100644 index 0000000000..5340b6791e --- /dev/null +++ b/mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/csi.exe.config @@ -0,0 +1,82 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/csi.rsp b/mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/csi.rsp new file mode 100644 index 0000000000..f012133ba5 --- /dev/null +++ b/mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/csi.rsp @@ -0,0 +1,15 @@ +/r:System.dll +/r:System.Core.dll +/r:Microsoft.CSharp.dll +/r:Facades/System.Runtime.dll +/r:Facades/netstandard.dll +/u:System +/u:System.IO +/u:System.Collections.Generic +/u:System.Console +/u:System.Diagnostics +/u:System.Dynamic +/u:System.Linq +/u:System.Linq.Expressions +/u:System.Text +/u:System.Threading.Tasks diff --git a/mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/vbc.exe b/mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/vbc.exe new file mode 100644 index 0000000000000000000000000000000000000000..2f326a8c2dbc995227e3d9f45304307b12bb32fa GIT binary patch literal 56688 zcmcG%3w%`7wFkV;W6nG?WF{{H37G&1V_p&v5sFG6ps_%J@Q|vFAsHZ=WWt#V5JNQ4 z*47rSTokpw&}y%?+N#x7e6*s}>aDigYkO<2q@saa%jft2&&=>3Oi#4~l#d?!niH5wqz;uW8$|Xe0G=u(c z>!<$g_Vy-CrJy#G=xd+^6!ol^kjC)5iHD_&A<>oG$dSc>KQT?{U-~0qTo-?uC|~~1 zrVgrV)9=1d)XMociLUoLL{6R{>Yv6LjY5ERsJDjEkNSxb`Eu&|fS;R#H>49g(!iS^ z06>|H730bM#E33#uv2y?h$7pY$S~7~@Z@|JLLm)yq9=)pEGx^*y2(tY&_rvCoNOkk zV7=nQvgzcZd)m;&b|OFU8*|k9z<&^pfcCFG)p1yoReVINSrLa6R=s5->94WDu)l_= zV5UiDg9(Tc-Hw15hon}#1T!6oYH<&cx-z>61(pr{_Z#tvD9YEohLtKsuEugRfs&eH zy>L}=O^t4tp422RTo<2=q%LHif~I=BjA?q!I^Bq4ZY|SuxdD^8Sk;9r25p8c5FipS z=XRe=-HK{~;`jt4L2G9VY9A>=`DEQXV%-K}Y6|KlD*)m#0Pj#GpsFa@b7fK)q2~>qWi_`J!SA#Tp5S2hlUP^%J_2 zk1hkkxWlFzQ`i%>;(4f7oT^59s9MH{Rm5xC8Q+Zf43s6~0D2NC3cLahX>n8zBx?Zz zR@cP6w>{roI!>o5dyZxj^fS z<7Xhzk62Njih0N<=QF`b!ji0-DMtKbKzZzw(GT~FX-7ZY%1kcc`ey>f&jJXHd8!Ko zV`!%3qar?~rQ|_Yo1({IqJf$z`Vg9%oMP3PHD~F@FcWlhSny57#cWB|2$W=&IC%`r ztf{$tAsA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sB_13lsJ@_kz;FYaB=tyuK~d zIef<;Y*J)v(WB2tw#U%cObgmvp^-LsnCtc6@N52#Pp%XiSh^Tl%zQ2!@~iaW^v(W9 P4;O8|TXQ@WrV#%HLMF=F literal 0 HcmV?d00001 diff --git a/mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/vbc.exe.config b/mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/vbc.exe.config new file mode 100644 index 0000000000..78ae05085a --- /dev/null +++ b/mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/vbc.exe.config @@ -0,0 +1,72 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/vbc.rsp b/mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/vbc.rsp new file mode 100644 index 0000000000..473404dad7 --- /dev/null +++ b/mcs/packages/mnt/jenkins/workspace/release-tarball-mono/external/roslyn-binaries/Microsoft.Net.Compilers/3.5.0/vbc.rsp @@ -0,0 +1,55 @@ +# Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +# This file contains command-line options that the VB +# command line compiler (VBC) will process as part +# of every compilation, unless the "/noconfig" option +# is specified. + +# Reference the common Framework libraries +/r:Accessibility.dll +/r:System.Configuration.dll +/r:System.Configuration.Install.dll +/r:System.Data.dll +/r:System.Data.OracleClient.dll +/r:System.Deployment.dll +/r:System.Design.dll +/r:System.DirectoryServices.dll +/r:System.dll +/r:System.Drawing.Design.dll +/r:System.Drawing.dll +/r:System.EnterpriseServices.dll +/r:System.Management.dll +/r:System.Messaging.dll +/r:System.Runtime.Remoting.dll +/r:System.Runtime.Serialization.Formatters.Soap.dll +/r:System.Security.dll +/r:System.ServiceProcess.dll +/r:System.Transactions.dll +/r:System.Web.dll +/r:System.Web.Mobile.dll +/r:System.Web.RegularExpressions.dll +/r:System.Web.Services.dll +/r:System.Windows.Forms.dll +/r:System.Xml.dll + +/r:System.Workflow.Activities.dll +/r:System.Workflow.ComponentModel.dll +/r:System.Workflow.Runtime.dll +/r:System.Runtime.Serialization.dll +/r:System.ServiceModel.dll + +/r:System.Core.dll +/r:System.Xml.Linq.dll +/r:System.Data.Linq.dll +/r:System.Data.DataSetExtensions.dll +/r:System.Web.Extensions.dll +/r:System.Web.Extensions.Design.dll +/r:System.ServiceModel.Web.dll + +# Import System and Microsoft.VisualBasic +/imports:System +/imports:Microsoft.VisualBasic +/imports:System.Linq +/imports:System.Xml.Linq + +/optioninfer+ diff --git a/mcs/tools/aprofutil/Program.cs b/mcs/tools/aprofutil/Program.cs index 12972eb734..43d0b987e3 100644 --- a/mcs/tools/aprofutil/Program.cs +++ b/mcs/tools/aprofutil/Program.cs @@ -4,6 +4,7 @@ using System.IO; using System.Net.Sockets; using System.Text.RegularExpressions; using Mono.Options; +using System.Linq; using Mono.Profiler.Aot; using static System.Console; @@ -20,8 +21,14 @@ namespace aotprofiletool { static bool Verbose; static Regex FilterMethod; + static Regex SkipMethod; static Regex FilterModule; + static Regex SkipModule; static Regex FilterType; + static Regex SkipType; + + static int SkipCount = 0; + static int TakeCount = int.MaxValue; static string Output; @@ -51,14 +58,29 @@ namespace aotprofiletool { "Set adb socket forwarding for Android", v => AdbForward = true }, { "filter-method=", - "Filter by method with regex {VALUE}", + "Include by method with regex {VALUE}", v => FilterMethod = new Regex (v) }, + { "skip-method=", + "Exclude by method with regex {VALUE}", + v => SkipMethod = new Regex (v) }, { "filter-module=", - "Filter by module with regex {VALUE}", + "Include by module with regex {VALUE}", v => FilterModule = new Regex (v) }, + { "skip-module=", + "Exclude by module with regex {VALUE}", + v => SkipModule = new Regex (v) }, { "filter-type=", - "Filter by type with regex {VALUE}", + "Include by type with regex {VALUE}", v => FilterType = new Regex (v) }, + { "skip-type=", + "Exclude by type with regex {VALUE}", + v => SkipType = new Regex (v) }, + { "take-count=", + "Take {VALUE} methods that match", + v => TakeCount = int.Parse (v) }, + { "skip-count=", + "Skip the first {VALUE} matching methods", + v => SkipCount = int.Parse (v) }, { "m|methods", "Show methods in the profile", v => Methods = true }, @@ -182,12 +204,10 @@ namespace aotprofiletool { ICollection modules = new List (pd.Modules); if (FilterMethod != null || FilterType != null || FilterModule != null) { - methods = new List (); types = new HashSet (); modules = new HashSet (); - foreach (var method in pd.Methods) { - + methods = pd.Methods.Where (method => { var type = method.Type; var module = type.Module; @@ -195,24 +215,51 @@ namespace aotprofiletool { var match = FilterModule.Match (module.ToString ()); if (!match.Success) - continue; + return false; + } + + if (SkipModule != null) { + var skip = SkipModule.Match (module.ToString ()); + + if (skip.Success) + return false; } if (FilterType != null) { var match = FilterType.Match (method.Type.ToString ()); if (!match.Success) - continue; + return false; + } + + if (SkipType != null) { + var skip = SkipType.Match (method.Type.ToString ()); + + if (skip.Success) + return false; } if (FilterMethod != null) { var match = FilterMethod.Match (method.ToString ()); if (!match.Success) - continue; + return false; } - methods.Add (method); + if (SkipMethod != null) { + var skip = SkipMethod.Match (method.ToString ()); + + if (skip.Success) + return false; + } + + return true; + }).Skip (SkipCount).Take (TakeCount).ToList (); + + foreach (var method in methods) { + var type = method.Type; + var module = type.Module; + types.Add (type); modules.Add (module); } diff --git a/mcs/tools/linker/Makefile b/mcs/tools/linker/Makefile index 9564a1d4d4..e408fab7d6 100644 --- a/mcs/tools/linker/Makefile +++ b/mcs/tools/linker/Makefile @@ -27,7 +27,6 @@ TEST_CASES := \ ifdef INCLUDE_DISABLED TEST_CASES += \ - System.Core/test-queryable-01.cs \ System.Runtime.Serialization/test-dcs-01.cs \ mscorlib/test-marshaling.cs endif @@ -41,7 +40,15 @@ endif ifndef AOT_FRIENDLY_PROFILE TEST_CASES += \ mscorlib/test-remoting.cs \ - mscorlib/test-reflection.cs + mscorlib/test-reflection.cs \ + System.Core/test-queryable-01.cs \ + System.Core/test-queryable-02.cs +endif + +ifdef MCS_MODE +NO_INSTALL=1 +NO_BUILD=1 +NO_TEST=1 endif TESTS_COMPILER = $(MCS) -nologo -noconfig -unsafe -nostdlib -debug:portable -r:$(topdir)/class/lib/$(PROFILE_DIRECTORY)/mscorlib.dll diff --git a/mcs/tools/linker/monolinker.exe.sources b/mcs/tools/linker/monolinker.exe.sources index e436b3e03e..0eb2620556 100644 --- a/mcs/tools/linker/monolinker.exe.sources +++ b/mcs/tools/linker/monolinker.exe.sources @@ -18,6 +18,7 @@ ../../../external/linker/src/linker/Linker/MarkingHelpers.cs ../../../external/linker/src/linker/Linker/MethodAction.cs ../../../external/linker/src/linker/Linker/MethodBodyScanner.cs +../../../external/linker/src/linker/Linker/OutputException.cs ../../../external/linker/src/linker/Linker/OverrideInformation.cs ../../../external/linker/src/linker/Linker/MethodDefinitionExtensions.cs ../../../external/linker/src/linker/Linker/MethodReferenceExtensions.cs diff --git a/mcs/tools/mkbundle/bundle-mono-api.inc b/mcs/tools/mkbundle/bundle-mono-api.inc index 6af254ff09..013e8901ed 100644 --- a/mcs/tools/mkbundle/bundle-mono-api.inc +++ b/mcs/tools/mkbundle/bundle-mono-api.inc @@ -19,7 +19,7 @@ typedef struct BundleMonoAPI void (*mono_register_bundled_assemblies) (const MonoBundledAssembly **assemblies); void (*mono_register_config_for_assembly) (const char* assembly_name, const char* config_xml); void (*mono_jit_set_aot_mode) (MonoAotMode mode); - void (*mono_aot_register_module) (void* aot_info); + void (*mono_aot_register_module) (void** aot_info); void (*mono_config_parse_memory) (const char *buffer); void (*mono_register_machine_config) (const char *config_xml); } BundleMonoAPI; diff --git a/mcs/tools/mkbundle/template_common.inc b/mcs/tools/mkbundle/template_common.inc index ab0a9a77e4..2f2385b0de 100644 --- a/mcs/tools/mkbundle/template_common.inc +++ b/mcs/tools/mkbundle/template_common.inc @@ -49,12 +49,6 @@ validate_api_struct () exit (1); } -#ifdef USE_DEFAULT_MONO_API_STRUCT -// We don't export in jit.h -// So declare here, and get it from mono -void mono_aot_register_module (void *aot_info); -#endif // USE_DEFAULT_MONO_API_STRUCT - static void init_default_mono_api_struct () { diff --git a/mk/Makefile.in b/mk/Makefile.in index 7f3ee7215a..1cfcf564f3 100644 --- a/mk/Makefile.in +++ b/mk/Makefile.in @@ -214,6 +214,7 @@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTERP_CFLAGS = @INTERP_CFLAGS@ INTL = @INTL@ INVARIANT_AOT_OPTIONS = @INVARIANT_AOT_OPTIONS@ JEMALLOC_AUTOCONF_FLAGS = @JEMALLOC_AUTOCONF_FLAGS@ diff --git a/mono/Makefile.in b/mono/Makefile.in index ac20fa99c4..d9dd3eeba4 100644 --- a/mono/Makefile.in +++ b/mono/Makefile.in @@ -274,6 +274,7 @@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTERP_CFLAGS = @INTERP_CFLAGS@ INTL = @INTL@ INVARIANT_AOT_OPTIONS = @INVARIANT_AOT_OPTIONS@ JEMALLOC_AUTOCONF_FLAGS = @JEMALLOC_AUTOCONF_FLAGS@ diff --git a/mono/arch/Makefile.in b/mono/arch/Makefile.in index 19b446198a..fc5da7b410 100644 --- a/mono/arch/Makefile.in +++ b/mono/arch/Makefile.in @@ -274,6 +274,7 @@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTERP_CFLAGS = @INTERP_CFLAGS@ INTL = @INTL@ INVARIANT_AOT_OPTIONS = @INVARIANT_AOT_OPTIONS@ JEMALLOC_AUTOCONF_FLAGS = @JEMALLOC_AUTOCONF_FLAGS@ diff --git a/mono/arch/amd64/Makefile.in b/mono/arch/amd64/Makefile.in index 3aa891a6e4..ecf14698ce 100644 --- a/mono/arch/amd64/Makefile.in +++ b/mono/arch/amd64/Makefile.in @@ -215,6 +215,7 @@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTERP_CFLAGS = @INTERP_CFLAGS@ INTL = @INTL@ INVARIANT_AOT_OPTIONS = @INVARIANT_AOT_OPTIONS@ JEMALLOC_AUTOCONF_FLAGS = @JEMALLOC_AUTOCONF_FLAGS@ diff --git a/mono/arch/amd64/amd64-codegen.h b/mono/arch/amd64/amd64-codegen.h index 8295a91eb3..7ac86b7180 100644 --- a/mono/arch/amd64/amd64-codegen.h +++ b/mono/arch/amd64/amd64-codegen.h @@ -1165,6 +1165,9 @@ typedef union { #define amd64_sse_prefetch_reg_membase(inst, arg, basereg, disp) emit_sse_reg_membase_op2((inst), (arg), (basereg), (disp), 0x0f, 0x18) +#define amd64_sse_lzcnt_reg_reg_size(inst, dreg, reg, size) emit_sse_reg_reg_size((inst), (dreg), (reg), 0xf3, 0x0f, 0xbd, (size)) +#define amd64_sse_popcnt_reg_reg_size(inst, dreg, reg, size) emit_sse_reg_reg_size((inst), (dreg), (reg), 0xf3, 0x0f, 0xb8, (size)) + /* Generated from x86-codegen.h */ #define amd64_breakpoint_size(inst,size) do { x86_breakpoint(inst); } while (0) diff --git a/mono/arch/arm/Makefile.in b/mono/arch/arm/Makefile.in index 56849bb4db..430636896f 100644 --- a/mono/arch/arm/Makefile.in +++ b/mono/arch/arm/Makefile.in @@ -215,6 +215,7 @@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTERP_CFLAGS = @INTERP_CFLAGS@ INTL = @INTL@ INVARIANT_AOT_OPTIONS = @INVARIANT_AOT_OPTIONS@ JEMALLOC_AUTOCONF_FLAGS = @JEMALLOC_AUTOCONF_FLAGS@ diff --git a/mono/arch/arm64/Makefile.in b/mono/arch/arm64/Makefile.in index 58c4eac17f..4693a32a0d 100644 --- a/mono/arch/arm64/Makefile.in +++ b/mono/arch/arm64/Makefile.in @@ -215,6 +215,7 @@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTERP_CFLAGS = @INTERP_CFLAGS@ INTL = @INTL@ INVARIANT_AOT_OPTIONS = @INVARIANT_AOT_OPTIONS@ JEMALLOC_AUTOCONF_FLAGS = @JEMALLOC_AUTOCONF_FLAGS@ diff --git a/mono/arch/mips/Makefile.in b/mono/arch/mips/Makefile.in index 0593e2e771..8c8ede5094 100644 --- a/mono/arch/mips/Makefile.in +++ b/mono/arch/mips/Makefile.in @@ -266,6 +266,7 @@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTERP_CFLAGS = @INTERP_CFLAGS@ INTL = @INTL@ INVARIANT_AOT_OPTIONS = @INVARIANT_AOT_OPTIONS@ JEMALLOC_AUTOCONF_FLAGS = @JEMALLOC_AUTOCONF_FLAGS@ @@ -529,25 +530,22 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test.Po@am__quote@ .c.o: -@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ -@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: -@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ -@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: -@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ -@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ -@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< diff --git a/mono/arch/ppc/Makefile.in b/mono/arch/ppc/Makefile.in index 40a8decf7a..3b853b5811 100644 --- a/mono/arch/ppc/Makefile.in +++ b/mono/arch/ppc/Makefile.in @@ -215,6 +215,7 @@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTERP_CFLAGS = @INTERP_CFLAGS@ INTL = @INTL@ INVARIANT_AOT_OPTIONS = @INVARIANT_AOT_OPTIONS@ JEMALLOC_AUTOCONF_FLAGS = @JEMALLOC_AUTOCONF_FLAGS@ diff --git a/mono/arch/riscv/Makefile.in b/mono/arch/riscv/Makefile.in index 97159df6ba..44f9bdc251 100644 --- a/mono/arch/riscv/Makefile.in +++ b/mono/arch/riscv/Makefile.in @@ -262,6 +262,7 @@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTERP_CFLAGS = @INTERP_CFLAGS@ INTL = @INTL@ INVARIANT_AOT_OPTIONS = @INVARIANT_AOT_OPTIONS@ JEMALLOC_AUTOCONF_FLAGS = @JEMALLOC_AUTOCONF_FLAGS@ @@ -551,25 +552,22 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/riscv-codegen-test.Po@am__quote@ .c.o: -@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ -@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: -@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ -@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: -@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ -@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ -@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< diff --git a/mono/arch/s390x/Makefile.in b/mono/arch/s390x/Makefile.in index 94c9b0c733..691eeb9c06 100644 --- a/mono/arch/s390x/Makefile.in +++ b/mono/arch/s390x/Makefile.in @@ -260,6 +260,7 @@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTERP_CFLAGS = @INTERP_CFLAGS@ INTL = @INTL@ INVARIANT_AOT_OPTIONS = @INVARIANT_AOT_OPTIONS@ JEMALLOC_AUTOCONF_FLAGS = @JEMALLOC_AUTOCONF_FLAGS@ @@ -510,25 +511,22 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tramp.Plo@am__quote@ .c.o: -@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ -@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: -@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ -@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: -@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ -@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ -@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< diff --git a/mono/arch/s390x/s390x-codegen.h b/mono/arch/s390x/s390x-codegen.h index 12fdd2894e..0980327127 100644 --- a/mono/arch/s390x/s390x-codegen.h +++ b/mono/arch/s390x/s390x-codegen.h @@ -991,7 +991,8 @@ typedef struct { #define S390_VRIa(c,opc,v1,i2,m3) do \ { \ char rxb = (((v1) > 15) << 7); \ - s390_emit16(c, (((opc) & 0xff00) << 8) | ((v1) << 4)); \ + int vr1 = ((v1) % 16); \ + s390_emit16(c, ((opc) & 0xff00) | (vr1 << 4)); \ s390_emit16(c, (i2)); \ s390_emit16(c, (((m3) << 12) | ((rxb) << 8) | ((opc) & 0xff))); \ } while (0) @@ -999,7 +1000,8 @@ typedef struct { #define S390_VRIb(c,opc,v1,i2,i3,m4) do \ { \ char rxb = (((v1) > 15) << 7); \ - s390_emit16(c, (((opc) & 0xff00) << 8) | ((v1) << 4)); \ + int vr1 = ((v1) % 16); \ + s390_emit16(c, ((opc) & 0xff00) | (vr1 << 4)); \ s390_emit16(c, (((i2) << 8) | (i3))); \ s390_emit16(c, (((m4) << 12) | ((rxb) << 8) | ((opc) & 0xff))); \ } while (0) @@ -1008,7 +1010,8 @@ typedef struct { { \ char rxb = (((v1) > 15) << 7) | (((v2) > 15) << 6) | \ (((v3) > 15) << 5); \ - s390_emit16(c, (((opc) & 0xff00) << 8) | ((v1) << 4) | ((v2))); \ + int vr1 = ((v1) % 16), vr3 = ((v3) % 16); \ + s390_emit16(c, ((opc) & 0xff00) | (vr1 << 4) | (vr3)); \ s390_emit16(c, (v4)); \ s390_emit16(c, (((m4) << 12) | ((rxb) << 8) | ((opc) & 0xff))); \ } while (0) @@ -1017,15 +1020,17 @@ typedef struct { { \ char rxb = (((v1) > 15) << 7) | (((v2) > 15) << 6) | \ (((v3) > 15) << 5); \ - s390_emit16(c, (((opc) & 0xff00) << 8) | ((v1) << 4) | ((v2))); \ - s390_emit16(c, ((v3) << 12) | (i2)); \ + int vr1 = ((v1) % 16), vr2 = ((v2) % 16), vr3 = ((v3) % 16); \ + s390_emit16(c, ((opc) & 0xff00) | (vr1 << 4) | (vr2)); \ + s390_emit16(c, (vr3 << 12) | (i2)); \ s390_emit16(c, (((m5) << 12) | ((rxb) << 8) | ((opc) & 0xff))); \ } while (0) #define S390_VRIe(c,opc,v1,v2,i3,m4,m5) do \ { \ char rxb = (((v1) > 15) << 7) | (((v2) > 15) << 6); \ - s390_emit16(c, (((opc) & 0xff00) << 8) | ((v1) << 4) | ((v2))); \ + int vr1 = ((v1) % 16), vr2 = ((v2) % 16); \ + s390_emit16(c, ((opc) & 0xff00) | (vr1 << 4) | (vr2)); \ s390_emit16(c, ((i2) << 8) | (m5)); \ s390_emit16(c, (((m4) << 12) | ((rxb) << 8) | ((opc) & 0xff))); \ } while (0) @@ -1033,7 +1038,8 @@ typedef struct { #define S390_VRRa(c,opc,v1,v2,m3,m4,m5) do \ { \ char rxb = (((v1) > 15) << 7) | (((v2) > 15) << 6); \ - s390_emit16(c, (((opc) & 0xff00) << 8) | ((v1) << 4) | ((v2))); \ + int vr1 = ((v1) % 16), vr2 = ((v2) % 16); \ + s390_emit16(c, ((opc) & 0xff00) | (vr1 << 4) | (vr2)); \ s390_emit16(c, ((m5) << 4) | (m4)); \ s390_emit16(c, (((m3) << 12) | ((rxb) << 8) | ((opc) & 0xff))); \ } while (0) @@ -1042,8 +1048,9 @@ typedef struct { { \ char rxb = (((v1) > 15) << 7) | (((v2) > 15) << 6) | \ (((v3) > 15) << 5); \ - s390_emit16(c, (((opc) & 0xff00) << 8) | ((v1) << 4) | ((v2))); \ - s390_emit16(c, ((v3) << 12) | ((m5) << 4) | (m4)); \ + int vr1 = ((v1) % 16), vr2 = ((v2) % 16), vr3 = ((v3) % 16); \ + s390_emit16(c, ((opc) & 0xff00) | (vr1 << 4) | (vr2)); \ + s390_emit16(c, (vr3 << 12) | ((m5) << 4) | (m4)); \ s390_emit16(c, (((m3) << 12) | ((rxb) << 8) | ((opc) & 0xff))); \ } while (0) @@ -1051,8 +1058,9 @@ typedef struct { { \ char rxb = (((v1) > 15) << 7) | (((v2) > 15) << 6) | \ (((v3) > 15) << 5); \ - s390_emit16(c, (((opc) & 0xff00) << 8) | ((v1) << 4) | ((v2))); \ - s390_emit16(c, (((v3) << 12)| (m5) << 4)); \ + int vr1 = ((v1) % 16), vr2 = ((v2) % 16), vr3 = ((v3) % 16); \ + s390_emit16(c, ((opc) & 0xff00) | (vr1 << 4) | (vr2)); \ + s390_emit16(c, ((vr3 << 12)| (m5) << 4)); \ s390_emit16(c, (((m4) << 12) | ((rxb) << 8) | ((opc) & 0xff))); \ } while (0) @@ -1060,32 +1068,36 @@ typedef struct { { \ char rxb = (((v1) > 15) << 7) | (((v2) > 15) << 6) | \ (((v3) > 15) << 5) | (((v4) > 15) << 4); \ - s390_emit16(c, (((opc) & 0xff00) << 8) | ((v1) << 4) | ((v2))); \ - s390_emit16(c, (((v3) << 12)| ((m6) << 8)) | ((m5) << 4)); \ - s390_emit16(c, (((v4) << 12) | ((rxb) << 8) | ((opc) & 0xff))); \ + int vr1 = ((v1) % 16), vr2 = ((v2) % 16), \ + vr3 = ((v3) % 16); vr4 = ((v4) % 16); \ + s390_emit16(c, ((opc) & 0xff00) | (vr1 << 4) | (vr2)); \ + s390_emit16(c, ((vr3 << 12)| ((m6) << 8)) | ((m5) << 4)); \ + s390_emit16(c, ((vr4 << 12) | ((rxb) << 8) | ((opc) & 0xff))); \ } while (0) #define S390_VRRe(c,opc,v1,v2,v3,m4,m5,m6) do \ { \ char rxb = (((v1) > 15) << 7) | (((v2) > 15) << 6) | \ (((v3) > 15) << 5); \ - s390_emit16(c, (((opc) & 0xff00) << 8) | ((v1) << 4) | ((v2))); \ + int vr1 = ((v1) % 16), vr2 = ((v2) % 16), vr3 = ((v3) % 16); \ + s390_emit16(c, ((opc) & 0xff00) | ((v1) << 4) | ((v2))); \ s390_emit16(c, (((v3) << 12)| ((m6) << 8)) | (m5)); \ s390_emit16(c, (((m4) << 12) | ((rxb) << 8) | ((opc) & 0xff))); \ } while (0) #define S390_VRRf(c,opc,v1,r2) do \ { \ - char rxb = (((v1) > 15) << 7) | (((v2) > 15) << 6); \ - s390_emit16(c, (((opc) & 0xff00) << 8) | ((v1) << 4) | ((v2))); \ + char rxb = (((v1) > 15) << 7); \ + s390_emit16(c, ((opc) & 0xff00) | ((v1) << 4) | ((v2))); \ s390_emit16(c, ((r2) << 12)| ((r3) << r8) | (m5)); \ s390_emit16(c, (((rxb) << 8) | ((opc) & 0xff))); \ } while (0) #define S390_VRSa(c,opc,v1,v3,b2,d2,m4) do \ { \ - char rxb = (((v1) > 15) << 7) | (((v2) > 15) << 6); \ - s390_emit16(c, (((opc) & 0xff00) << 8) | ((v1) << 4) | ((v3))); \ + char rxb = (((v1) > 15) << 7) | (((v3) > 15) << 6); \ + int vr1 = ((v1) % 16), vr3 = ((v3) % 16); \ + s390_emit16(c, ((opc) & 0xff00) | (vr1 << 4) | (vr3)); \ s390_emit16(c, ((b2) << 12)| (d2)); \ s390_emit16(c, (((m4) << 12) | ((rxb) << 8) | ((opc) & 0xff))); \ } while (0) @@ -1093,7 +1105,8 @@ typedef struct { #define S390_VRSb(c,opc,v1,r3,b2,d2,m4) do \ { \ char rxb = (((v1) > 15) << 7); \ - s390_emit16(c, (((opc) & 0xff00) << 8) | ((v1) << 4) | ((r3))); \ + int vr1 = (v1) % 16; \ + s390_emit16(c, ((opc) & 0xff00) | (vr1 << 4) | ((r3))); \ s390_emit16(c, ((b2) << 12)| (d2)); \ s390_emit16(c, (((m4) << 12) | ((rxb) << 8) | ((opc) & 0xff))); \ } while (0) @@ -1101,7 +1114,8 @@ typedef struct { #define S390_VRSc(c,opc,r1,v3,b2,d2,m4) do \ { \ char rxb = (((v1) > 15) << 7); \ - s390_emit16(c, (((opc) & 0xff00) << 8) | ((r1) << 4) | ((v3))); \ + int vr3 = (v3) % 16; \ + s390_emit16(c, ((opc) & 0xff00) | ((r1) << 4) | (vr3)); \ s390_emit16(c, ((b2) << 12)| (d2)); \ s390_emit16(c, (((m4) << 12) | ((rxb) << 8) | ((opc) & 0xff))); \ } while (0) @@ -1109,7 +1123,8 @@ typedef struct { #define S390_VRV(c,opc,v1,v2,b2,d2,m3) do \ { \ char rxb = (((v1) > 15) << 7) | (((v2) > 15) << 6); \ - s390_emit16(c, (((opc) & 0xff00) << 8) | ((v1) << 4) | ((v2))); \ + int vr1 = ((v1) % 16), vr2 = ((v3) % 16); \ + s390_emit16(c, ((opc) & 0xff00) | (vr1 << 4) | (vr2)); \ s390_emit16(c, ((b2) << 12)| (d2)); \ s390_emit16(c, (((m3) << 12) | ((rxb) << 8) | ((opc) & 0xff))); \ } while (0) @@ -1117,7 +1132,8 @@ typedef struct { #define S390_VRX(c,opc,v1,x2,b2,d2,m3) do \ { \ char rxb = ((v1) > 15) << 7; \ - s390_emit16(c, (((opc) & 0xff00) << 8) | ((v1) << 4) | ((x2))); \ + int vr1 = (v1) % 16; \ + s390_emit16(c, ((opc) & 0xff00) | (vr1 << 4) | ((x2))); \ s390_emit16(c, ((b2) << 12)| (d2)); \ s390_emit16(c, (((m3) << 12) | ((rxb) << 8) | ((opc) & 0xff))); \ } while (0) @@ -1496,6 +1512,8 @@ typedef struct { #define s390_tmlh(c, r, m) S390_RI(c, 0xa70, r, m) #define s390_tmll(c, r, m) S390_RI(c, 0xa71, r, m) #define s390_tm(c, b, d, v) S390_SI(c, 0x91, b, d, v) +#define s390_vlm(c, v1, v2, b, d, m) S390_VRSa(c, 0xe736, v1, v2, b, d, m) +#define s390_vstm(c, v1, v2, b, d, m) S390_VRSa(c, 0xe73e, v1, v2, b, d, m) #define s390_x(c, r, x, b, d) S390_RX(c, 0x57, r, x, b, d) #define s390_xihf(c, r, v) S390_RIL_1(c, 0xc06, r, v) #define s390_xilf(c, r, v) S390_RIL_1(c, 0xc07, r, v) diff --git a/mono/arch/s390x/tramp.c b/mono/arch/s390x/tramp.c index a79f64e00e..bdb81f0412 100644 --- a/mono/arch/s390x/tramp.c +++ b/mono/arch/s390x/tramp.c @@ -309,7 +309,7 @@ enum_retvalue: /* */ /*------------------------------------------------------------------*/ -static inline guint8 * +static guint8 * emit_prolog (guint8 *p, MonoMethodSignature *sig, size_data *sz) { guint stack_size; @@ -543,7 +543,7 @@ emit_save_parameters (guint8 *p, MonoMethodSignature *sig, size_data *sz) /* */ /*------------------------------------------------------------------*/ -static inline guint8 * +static guint8 * alloc_code_memory (guint code_size) { guint8 *p; @@ -573,7 +573,7 @@ alloc_code_memory (guint code_size) /* */ /*------------------------------------------------------------------*/ -static inline guint8 * +static guint8 * emit_call_and_store_retval (guint8 *p, MonoMethodSignature *sig, size_data *sz, gboolean string_ctor) { @@ -674,7 +674,7 @@ printf("Returning %d bytes for type %d (%d)\n",retSize,simpletype,sig->pinvoke); /* */ /*------------------------------------------------------------------*/ -static inline guint8 * +static guint8 * emit_epilog (guint8 *p, MonoMethodSignature *sig, size_data *sz) { /* function epilog */ diff --git a/mono/arch/sparc/Makefile.in b/mono/arch/sparc/Makefile.in index d85487ae4e..063c83faef 100644 --- a/mono/arch/sparc/Makefile.in +++ b/mono/arch/sparc/Makefile.in @@ -215,6 +215,7 @@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTERP_CFLAGS = @INTERP_CFLAGS@ INTL = @INTL@ INVARIANT_AOT_OPTIONS = @INVARIANT_AOT_OPTIONS@ JEMALLOC_AUTOCONF_FLAGS = @JEMALLOC_AUTOCONF_FLAGS@ diff --git a/mono/arch/x86/Makefile.in b/mono/arch/x86/Makefile.in index 8760cf7997..8ac962dc94 100644 --- a/mono/arch/x86/Makefile.in +++ b/mono/arch/x86/Makefile.in @@ -215,6 +215,7 @@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTERP_CFLAGS = @INTERP_CFLAGS@ INTL = @INTL@ INVARIANT_AOT_OPTIONS = @INVARIANT_AOT_OPTIONS@ JEMALLOC_AUTOCONF_FLAGS = @JEMALLOC_AUTOCONF_FLAGS@ diff --git a/mono/arch/x86/x86-codegen.h b/mono/arch/x86/x86-codegen.h index e6986687e7..9fd65230d2 100644 --- a/mono/arch/x86/x86-codegen.h +++ b/mono/arch/x86/x86-codegen.h @@ -359,29 +359,65 @@ typedef union { * the instruction is inspected for validity and the correct displacement * is inserted. */ -#define x86_patch(ins,target) \ - do { \ - unsigned char* pos = (ins) + 1; \ - int disp, size = 0; \ - switch (*(unsigned char*)(ins)) { \ - case 0xe8: case 0xe9: ++size; break; /* call, jump32 */ \ - case 0x0f: if (!(*pos >= 0x70 && *pos <= 0x8f)) assert (0); \ - ++size; ++pos; break; /* prefix for 32-bit disp */ \ - case 0xe0: case 0xe1: case 0xe2: /* loop */ \ - case 0xeb: /* jump8 */ \ - /* conditional jump opcodes */ \ - case 0x70: case 0x71: case 0x72: case 0x73: \ - case 0x74: case 0x75: case 0x76: case 0x77: \ - case 0x78: case 0x79: case 0x7a: case 0x7b: \ - case 0x7c: case 0x7d: case 0x7e: case 0x7f: \ - break; \ - default: assert (0); \ - } \ - disp = (target) - pos; \ - if (size) x86_imm_emit32 (pos, disp - 4); \ - else if (x86_is_imm8 (disp - 1)) x86_imm_emit8 (pos, disp - 1); \ - else assert (0); \ - } while (0) +void +mono_x86_patch (guchar* code, gpointer target); + +// This is inline only to share with amd64. +// It is only for use by mono_x86_patch and mono_amd64_patch. +static inline void +mono_x86_patch_inline (guchar* code, gpointer target) +{ + int instruction_size = 2; // 2 or 5 or 6, code handles anything + int offset_size = 1; // 1 or 4 + + switch (*code) { + case 0xe8: case 0xe9: // call, jump32 + instruction_size = 5; + offset_size = 4; + break; + + case 0x0f: // 6byte conditional branches with 32bit offsets. + g_assert (code [1] >= 0x80 && code [1] <= 0x8F); + instruction_size = 6; + offset_size = 4; + break; + + case 0xe0: case 0xe1: case 0xe2: /* loop */ + case 0xeb: /* jump8 */ + /* conditional jump opcodes */ + case 0x70: case 0x71: case 0x72: case 0x73: + case 0x74: case 0x75: case 0x76: case 0x77: + case 0x78: case 0x79: case 0x7a: case 0x7b: + case 0x7c: case 0x7d: case 0x7e: case 0x7f: + break; + + case 0xFF: + // call or jmp indirect; patch the data, not the code. + // amd64 handles this elsewhere (RIP relative). + g_assert (code [1] == 0x15 || code [1] == 0x25); + g_assert (0); // For possible use later. + *(void**)(code + 2) = target; + return; + + default: + g_assert (0); + } + + // Offsets are relative to the end of the instruction. + ptrdiff_t const offset = (guchar*)target - (code + instruction_size); + + if (offset_size == 4) { + g_assert (offset == (gint32)offset); // for amd64 + code += instruction_size - 4; // Next line demands lvalue, not temp. + x86_imm_emit32 (code, offset); + } else { + g_assert (offset == (gint8)offset); + code += instruction_size - 1; // Next line demands lvalue, not temp. + x86_imm_emit8 (code, offset); + } +} + +#define x86_patch(ins, target) (mono_x86_patch ((ins), (target))) #define x86_breakpoint(inst) x86_byte (inst, 0xcc) diff --git a/mono/benchmark/Makefile.in b/mono/benchmark/Makefile.in index 158cb13454..519d52493c 100644 --- a/mono/benchmark/Makefile.in +++ b/mono/benchmark/Makefile.in @@ -215,6 +215,7 @@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTERP_CFLAGS = @INTERP_CFLAGS@ INTL = @INTL@ INVARIANT_AOT_OPTIONS = @INVARIANT_AOT_OPTIONS@ JEMALLOC_AUTOCONF_FLAGS = @JEMALLOC_AUTOCONF_FLAGS@ diff --git a/mono/btls/Makefile.in b/mono/btls/Makefile.in index 335a7abcc6..8daba118bd 100644 --- a/mono/btls/Makefile.in +++ b/mono/btls/Makefile.in @@ -214,6 +214,7 @@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTERP_CFLAGS = @INTERP_CFLAGS@ INTL = @INTL@ INVARIANT_AOT_OPTIONS = @INVARIANT_AOT_OPTIONS@ JEMALLOC_AUTOCONF_FLAGS = @JEMALLOC_AUTOCONF_FLAGS@ diff --git a/mono/btls/btls-pkcs12.c b/mono/btls/btls-pkcs12.c index 180b407604..530ede6762 100644 --- a/mono/btls/btls-pkcs12.c +++ b/mono/btls/btls-pkcs12.c @@ -55,13 +55,13 @@ allocate_btls_password (const void *password) return buffer; } #else -static inline void +static void deallocate_btls_password (char *password) { return; } -static inline char * +static char * allocate_btls_password (const void *password) { return (char *)password; diff --git a/mono/cil/Makefile.in b/mono/cil/Makefile.in index 088045389d..3f1974c9b1 100644 --- a/mono/cil/Makefile.in +++ b/mono/cil/Makefile.in @@ -245,6 +245,7 @@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTERP_CFLAGS = @INTERP_CFLAGS@ INTL = @INTL@ INVARIANT_AOT_OPTIONS = @INVARIANT_AOT_OPTIONS@ JEMALLOC_AUTOCONF_FLAGS = @JEMALLOC_AUTOCONF_FLAGS@ diff --git a/mono/dis/Makefile.am b/mono/dis/Makefile.am index 84730c587f..083bf5356f 100644 --- a/mono/dis/Makefile.am +++ b/mono/dis/Makefile.am @@ -1,5 +1,7 @@ include $(top_srcdir)/mk/common.mk +if !ENABLE_MSVC_ONLY + AM_CPPFLAGS = $(GLIB_CFLAGS) -I$(top_srcdir) if HOST_WIN32 @@ -35,7 +37,12 @@ noinst_LIBRARIES += libmonodismain.a endif endif +endif # !ENABLE_MSVC_ONLY + CFLAGS := $(filter-out @CXX_REMOVE_CFLAGS@, @CFLAGS@) + +if !ENABLE_MSVC_ONLY + libmonodis_a_CFLAGS = $(CFLAGS) @CXX_ADD_CFLAGS@ libmonodismain_a_CFLAGS = $(CFLAGS) @CXX_ADD_CFLAGS@ @@ -85,3 +92,25 @@ endif man_MANS = monodis.1 EXTRA_DIST = $(man_MANS) + +endif # !ENABLE_MSVC_ONLY + +if ENABLE_MSVC_ONLY + +if SUPPORT_SGEN +mono_bin_suffix = sgen +else +mono_bin_suffix = +endif + +all-local: + + make -C $(top_srcdir)/msvc monodis + cp -f $(mono_msvc_build_bin_dir)/monodis-$(mono_bin_suffix)$(EXEEXT) ./monodis$(EXEEXT) + +clean-local: + + make -C $(top_srcdir)/msvc clean-monodis + rm ./monodis$(EXEEXT) + +endif # ENABLE_MSVC_ONLY diff --git a/mono/dis/Makefile.in b/mono/dis/Makefile.in index 242cda6422..07290901ed 100644 --- a/mono/dis/Makefile.in +++ b/mono/dis/Makefile.in @@ -90,8 +90,8 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ -@DISABLE_EXECUTABLES_FALSE@@DISABLE_LIBRARIES_FALSE@bin_PROGRAMS = monodis$(EXEEXT) -@DISABLE_EXECUTABLES_FALSE@@DISABLE_LIBRARIES_FALSE@am__append_1 = libmonodismain.a +@DISABLE_EXECUTABLES_FALSE@@DISABLE_LIBRARIES_FALSE@@ENABLE_MSVC_ONLY_FALSE@bin_PROGRAMS = monodis$(EXEEXT) +@DISABLE_EXECUTABLES_FALSE@@DISABLE_LIBRARIES_FALSE@@ENABLE_MSVC_ONLY_FALSE@am__append_1 = libmonodismain.a subdir = mono/dis ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/apple-target.m4 \ @@ -120,30 +120,40 @@ am__v_AR_0 = @echo " AR " $@; am__v_AR_1 = libmonodis_a_AR = $(AR) $(ARFLAGS) libmonodis_a_LIBADD = -am_libmonodis_a_OBJECTS = libmonodis_a-get.$(OBJEXT) \ - libmonodis_a-dis-cil.$(OBJEXT) libmonodis_a-util.$(OBJEXT) +am__libmonodis_a_SOURCES_DIST = get.c get.h dis-cil.c dis-cil.h util.c \ + util.h +@ENABLE_MSVC_ONLY_FALSE@am_libmonodis_a_OBJECTS = \ +@ENABLE_MSVC_ONLY_FALSE@ libmonodis_a-get.$(OBJEXT) \ +@ENABLE_MSVC_ONLY_FALSE@ libmonodis_a-dis-cil.$(OBJEXT) \ +@ENABLE_MSVC_ONLY_FALSE@ libmonodis_a-util.$(OBJEXT) libmonodis_a_OBJECTS = $(am_libmonodis_a_OBJECTS) libmonodismain_a_AR = $(AR) $(ARFLAGS) libmonodismain_a_LIBADD = -am_libmonodismain_a_OBJECTS = libmonodismain_a-dump.$(OBJEXT) \ - libmonodismain_a-main.$(OBJEXT) \ - libmonodismain_a-declsec.$(OBJEXT) +am__libmonodismain_a_SOURCES_DIST = dump.c dump.h main.c meta.h \ + declsec.c declsec.h +@ENABLE_MSVC_ONLY_FALSE@am_libmonodismain_a_OBJECTS = \ +@ENABLE_MSVC_ONLY_FALSE@ libmonodismain_a-dump.$(OBJEXT) \ +@ENABLE_MSVC_ONLY_FALSE@ libmonodismain_a-main.$(OBJEXT) \ +@ENABLE_MSVC_ONLY_FALSE@ libmonodismain_a-declsec.$(OBJEXT) libmonodismain_a_OBJECTS = $(am_libmonodismain_a_OBJECTS) am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" PROGRAMS = $(bin_PROGRAMS) am_monodis_OBJECTS = monodis_OBJECTS = $(am_monodis_OBJECTS) am__DEPENDENCIES_1 = -@SUPPORT_SGEN_FALSE@am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) -@SUPPORT_SGEN_TRUE@am__DEPENDENCIES_2 = \ -@SUPPORT_SGEN_TRUE@ $(top_builddir)/mono/sgen/libmonosgen.la -am__DEPENDENCIES_3 = $(metadata_lib) $(am__DEPENDENCIES_2) \ - $(top_builddir)/mono/utils/libmonoutils.la $(glib_libs) -@HAVE_STATIC_ZLIB_TRUE@@HAVE_SYS_ZLIB_FALSE@am__DEPENDENCIES_4 = $(am__DEPENDENCIES_1) -monodis_DEPENDENCIES = libmonodismain_a-dump.$(OBJEXT) \ - libmonodismain_a-main.$(OBJEXT) \ - libmonodismain_a-declsec.$(OBJEXT) libmonodis.a \ - $(am__DEPENDENCIES_3) $(glib_libs) $(am__DEPENDENCIES_4) +@ENABLE_MSVC_ONLY_FALSE@@SUPPORT_SGEN_FALSE@am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) +@ENABLE_MSVC_ONLY_FALSE@@SUPPORT_SGEN_TRUE@am__DEPENDENCIES_2 = $(top_builddir)/mono/sgen/libmonosgen.la +@ENABLE_MSVC_ONLY_FALSE@am__DEPENDENCIES_3 = $(metadata_lib) \ +@ENABLE_MSVC_ONLY_FALSE@ $(am__DEPENDENCIES_2) \ +@ENABLE_MSVC_ONLY_FALSE@ $(top_builddir)/mono/utils/libmonoutils.la \ +@ENABLE_MSVC_ONLY_FALSE@ $(glib_libs) +@ENABLE_MSVC_ONLY_FALSE@@HAVE_STATIC_ZLIB_TRUE@@HAVE_SYS_ZLIB_FALSE@am__DEPENDENCIES_4 = $(am__DEPENDENCIES_1) +@ENABLE_MSVC_ONLY_FALSE@monodis_DEPENDENCIES = \ +@ENABLE_MSVC_ONLY_FALSE@ libmonodismain_a-dump.$(OBJEXT) \ +@ENABLE_MSVC_ONLY_FALSE@ libmonodismain_a-main.$(OBJEXT) \ +@ENABLE_MSVC_ONLY_FALSE@ libmonodismain_a-declsec.$(OBJEXT) \ +@ENABLE_MSVC_ONLY_FALSE@ libmonodis.a $(am__DEPENDENCIES_3) \ +@ENABLE_MSVC_ONLY_FALSE@ $(glib_libs) $(am__DEPENDENCIES_4) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent @@ -183,8 +193,8 @@ am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libmonodis_a_SOURCES) $(libmonodismain_a_SOURCES) \ $(monodis_SOURCES) -DIST_SOURCES = $(libmonodis_a_SOURCES) $(libmonodismain_a_SOURCES) \ - $(monodis_SOURCES) +DIST_SOURCES = $(am__libmonodis_a_SOURCES_DIST) \ + $(am__libmonodismain_a_SOURCES_DIST) $(monodis_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ @@ -326,6 +336,7 @@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTERP_CFLAGS = @INTERP_CFLAGS@ INTL = @INTL@ INVARIANT_AOT_OPTIONS = @INVARIANT_AOT_OPTIONS@ JEMALLOC_AUTOCONF_FLAGS = @JEMALLOC_AUTOCONF_FLAGS@ @@ -515,55 +526,58 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MAKEFLAGS := $(MAKEFLAGS) --no-builtin-rules -AM_CPPFLAGS = $(GLIB_CFLAGS) -I$(top_srcdir) -glib_libs = $(top_builddir)/mono/eglib/libeglib.la -@SUPPORT_SGEN_FALSE@metadata_lib = $(top_builddir)/mono/metadata/libmonoruntime.la -@SUPPORT_SGEN_TRUE@metadata_lib = $(top_builddir)/mono/metadata/libmonoruntimesgen.la -@SUPPORT_SGEN_FALSE@gc_lib = $(LIBGC_STATIC_LIBS) -@SUPPORT_SGEN_TRUE@gc_lib = $(top_builddir)/mono/sgen/libmonosgen.la -runtime_lib = \ - $(metadata_lib) \ - $(gc_lib) \ - $(top_builddir)/mono/utils/libmonoutils.la \ - $(glib_libs) +@ENABLE_MSVC_ONLY_FALSE@AM_CPPFLAGS = $(GLIB_CFLAGS) -I$(top_srcdir) +@ENABLE_MSVC_ONLY_FALSE@glib_libs = $(top_builddir)/mono/eglib/libeglib.la +@ENABLE_MSVC_ONLY_FALSE@@SUPPORT_SGEN_FALSE@metadata_lib = $(top_builddir)/mono/metadata/libmonoruntime.la +@ENABLE_MSVC_ONLY_FALSE@@SUPPORT_SGEN_TRUE@metadata_lib = $(top_builddir)/mono/metadata/libmonoruntimesgen.la +@ENABLE_MSVC_ONLY_FALSE@@SUPPORT_SGEN_FALSE@gc_lib = $(LIBGC_STATIC_LIBS) +@ENABLE_MSVC_ONLY_FALSE@@SUPPORT_SGEN_TRUE@gc_lib = $(top_builddir)/mono/sgen/libmonosgen.la +@ENABLE_MSVC_ONLY_FALSE@runtime_lib = \ +@ENABLE_MSVC_ONLY_FALSE@ $(metadata_lib) \ +@ENABLE_MSVC_ONLY_FALSE@ $(gc_lib) \ +@ENABLE_MSVC_ONLY_FALSE@ $(top_builddir)/mono/utils/libmonoutils.la \ +@ENABLE_MSVC_ONLY_FALSE@ $(glib_libs) -noinst_LIBRARIES = libmonodis.a $(am__append_1) -libmonodis_a_CFLAGS = $(CFLAGS) @CXX_ADD_CFLAGS@ -libmonodismain_a_CFLAGS = $(CFLAGS) @CXX_ADD_CFLAGS@ -libmonodis_a_SOURCES = \ - get.c \ - get.h \ - dis-cil.c \ - dis-cil.h \ - util.c \ - util.h +@ENABLE_MSVC_ONLY_FALSE@noinst_LIBRARIES = libmonodis.a \ +@ENABLE_MSVC_ONLY_FALSE@ $(am__append_1) +@ENABLE_MSVC_ONLY_FALSE@libmonodis_a_CFLAGS = $(CFLAGS) @CXX_ADD_CFLAGS@ +@ENABLE_MSVC_ONLY_FALSE@libmonodismain_a_CFLAGS = $(CFLAGS) @CXX_ADD_CFLAGS@ +@ENABLE_MSVC_ONLY_FALSE@libmonodis_a_SOURCES = \ +@ENABLE_MSVC_ONLY_FALSE@ get.c \ +@ENABLE_MSVC_ONLY_FALSE@ get.h \ +@ENABLE_MSVC_ONLY_FALSE@ dis-cil.c \ +@ENABLE_MSVC_ONLY_FALSE@ dis-cil.h \ +@ENABLE_MSVC_ONLY_FALSE@ util.c \ +@ENABLE_MSVC_ONLY_FALSE@ util.h -libmonodismain_a_SOURCES = \ - dump.c \ - dump.h \ - main.c \ - meta.h \ - declsec.c \ - declsec.h +@ENABLE_MSVC_ONLY_FALSE@libmonodismain_a_SOURCES = \ +@ENABLE_MSVC_ONLY_FALSE@ dump.c \ +@ENABLE_MSVC_ONLY_FALSE@ dump.h \ +@ENABLE_MSVC_ONLY_FALSE@ main.c \ +@ENABLE_MSVC_ONLY_FALSE@ meta.h \ +@ENABLE_MSVC_ONLY_FALSE@ declsec.c \ +@ENABLE_MSVC_ONLY_FALSE@ declsec.h -monodis_SOURCES = -@HAVE_STATIC_ZLIB_FALSE@@HAVE_SYS_ZLIB_FALSE@Z_LIBS = -@HAVE_STATIC_ZLIB_TRUE@@HAVE_SYS_ZLIB_FALSE@Z_LIBS = $(STATIC_ZLIB_PATH) -@HAVE_SYS_ZLIB_TRUE@Z_LIBS = -lz -monodis_LDADD = \ - libmonodismain_a-dump.$(OBJEXT) \ - libmonodismain_a-main.$(OBJEXT) \ - libmonodismain_a-declsec.$(OBJEXT) \ - libmonodis.a \ - $(runtime_lib) \ - $(LLVM_LIBS) \ - $(LLVM_LDFLAGS) \ - $(glib_libs) \ - $(Z_LIBS) +@ENABLE_MSVC_ONLY_FALSE@monodis_SOURCES = +@ENABLE_MSVC_ONLY_FALSE@@HAVE_STATIC_ZLIB_FALSE@@HAVE_SYS_ZLIB_FALSE@Z_LIBS = +@ENABLE_MSVC_ONLY_FALSE@@HAVE_STATIC_ZLIB_TRUE@@HAVE_SYS_ZLIB_FALSE@Z_LIBS = $(STATIC_ZLIB_PATH) +@ENABLE_MSVC_ONLY_FALSE@@HAVE_SYS_ZLIB_TRUE@Z_LIBS = -lz +@ENABLE_MSVC_ONLY_FALSE@monodis_LDADD = \ +@ENABLE_MSVC_ONLY_FALSE@ libmonodismain_a-dump.$(OBJEXT) \ +@ENABLE_MSVC_ONLY_FALSE@ libmonodismain_a-main.$(OBJEXT) \ +@ENABLE_MSVC_ONLY_FALSE@ libmonodismain_a-declsec.$(OBJEXT) \ +@ENABLE_MSVC_ONLY_FALSE@ libmonodis.a \ +@ENABLE_MSVC_ONLY_FALSE@ $(runtime_lib) \ +@ENABLE_MSVC_ONLY_FALSE@ $(LLVM_LIBS) \ +@ENABLE_MSVC_ONLY_FALSE@ $(LLVM_LDFLAGS) \ +@ENABLE_MSVC_ONLY_FALSE@ $(glib_libs) \ +@ENABLE_MSVC_ONLY_FALSE@ $(Z_LIBS) -@HOST_DARWIN_TRUE@monodis_LDFLAGS = -framework CoreFoundation -framework Foundation -man_MANS = monodis.1 -EXTRA_DIST = $(man_MANS) +@ENABLE_MSVC_ONLY_FALSE@@HOST_DARWIN_TRUE@monodis_LDFLAGS = -framework CoreFoundation -framework Foundation +@ENABLE_MSVC_ONLY_FALSE@man_MANS = monodis.1 +@ENABLE_MSVC_ONLY_FALSE@EXTRA_DIST = $(man_MANS) +@ENABLE_MSVC_ONLY_TRUE@@SUPPORT_SGEN_FALSE@mono_bin_suffix = +@ENABLE_MSVC_ONLY_TRUE@@SUPPORT_SGEN_TRUE@mono_bin_suffix = sgen all: all-am .SUFFIXES: @@ -679,25 +693,22 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmonodismain_a-main.Po@am__quote@ .c.o: -@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ -@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: -@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ -@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: -@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ -@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ -@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< @@ -921,7 +932,8 @@ distdir: $(DISTFILES) done check-am: all-am check: check-am -all-am: Makefile $(LIBRARIES) $(PROGRAMS) $(MANS) +@ENABLE_MSVC_ONLY_FALSE@all-local: +all-am: Makefile $(LIBRARIES) $(PROGRAMS) $(MANS) all-local installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ @@ -956,9 +968,10 @@ distclean-generic: maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." +@ENABLE_MSVC_ONLY_FALSE@clean-local: clean: clean-am -clean-am: clean-binPROGRAMS clean-generic clean-libtool \ +clean-am: clean-binPROGRAMS clean-generic clean-libtool clean-local \ clean-noinstLIBRARIES mostlyclean-am distclean: distclean-am @@ -1039,8 +1052,8 @@ uninstall-man: uninstall-man1 .MAKE: install-am install-strip -.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \ - clean-binPROGRAMS clean-generic clean-libtool \ +.PHONY: CTAGS GTAGS TAGS all all-am all-local check check-am clean \ + clean-binPROGRAMS clean-generic clean-libtool clean-local \ clean-noinstLIBRARIES cscopelist-am ctags ctags-am distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ @@ -1059,7 +1072,17 @@ uninstall-man: uninstall-man1 .PRECIOUS: Makefile -@HOST_WIN32_TRUE@export HOST_CC +@ENABLE_MSVC_ONLY_FALSE@@HOST_WIN32_TRUE@export HOST_CC + +@ENABLE_MSVC_ONLY_TRUE@all-local: + +@ENABLE_MSVC_ONLY_TRUE@ make -C $(top_srcdir)/msvc monodis +@ENABLE_MSVC_ONLY_TRUE@ cp -f $(mono_msvc_build_bin_dir)/monodis-$(mono_bin_suffix)$(EXEEXT) ./monodis$(EXEEXT) + +@ENABLE_MSVC_ONLY_TRUE@clean-local: + +@ENABLE_MSVC_ONLY_TRUE@ make -C $(top_srcdir)/msvc clean-monodis +@ENABLE_MSVC_ONLY_TRUE@ rm ./monodis$(EXEEXT) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff --git a/mono/dis/dump.c b/mono/dis/dump.c index b3336346df..5d652d07e2 100755 --- a/mono/dis/dump.c +++ b/mono/dis/dump.c @@ -247,13 +247,13 @@ dump_table_memberref (MonoImage *m) case 0: ks = "TypeDef"; xx = get_typedef (m, idx); - x = g_strconcat (xx, ".", mono_metadata_string_heap (m, cols [MONO_MEMBERREF_NAME]), NULL); + x = g_strconcat (xx, ".", mono_metadata_string_heap (m, cols [MONO_MEMBERREF_NAME]), (const char*)NULL); g_free (xx); break; case 1: ks = "TypeRef"; xx = get_typeref (m, idx); - x = g_strconcat (xx, ".", mono_metadata_string_heap (m, cols [MONO_MEMBERREF_NAME]), NULL); + x = g_strconcat (xx, ".", mono_metadata_string_heap (m, cols [MONO_MEMBERREF_NAME]), (const char*)NULL); g_free (xx); break; case 2: @@ -265,7 +265,7 @@ dump_table_memberref (MonoImage *m) case 4: ks = "TypeSpec"; xx = get_typespec (m, idx, FALSE, NULL); - x = g_strconcat (xx, ".", mono_metadata_string_heap (m, cols [MONO_MEMBERREF_NAME]), NULL); + x = g_strconcat (xx, ".", mono_metadata_string_heap (m, cols [MONO_MEMBERREF_NAME]), (const char*)NULL); g_free (xx); break; default: @@ -581,26 +581,26 @@ dump_table_method (MonoImage *m) type_container = mono_metadata_load_generic_params (m, MONO_TOKEN_TYPE_DEF | (current_type - 1), NULL, NULL); if (type_container) { mono_metadata_load_generic_param_constraints_checked (m, MONO_TOKEN_TYPE_DEF | (current_type - 1), type_container, error); - g_assert (mono_error_ok (error)); /*FIXME don't swallow the error message*/ + g_assert (is_ok (error)); /*FIXME don't swallow the error message*/ } } method_container = mono_metadata_load_generic_params (m, MONO_TOKEN_METHOD_DEF | i, type_container, NULL); if (method_container) { mono_metadata_load_generic_param_constraints_checked (m, MONO_TOKEN_METHOD_DEF | i, method_container, error); - g_assert (mono_error_ok (error)); /*FIXME don't swallow the error message*/ + g_assert (is_ok (error)); /*FIXME don't swallow the error message*/ } mono_metadata_decode_table_row (m, MONO_TABLE_METHOD, i - 1, cols, MONO_METHOD_SIZE); sigblob = mono_metadata_blob_heap (m, cols [MONO_METHOD_SIGNATURE]); mono_metadata_decode_blob_size (sigblob, &sigblob); method = mono_metadata_parse_method_signature_full (m, method_container ? method_container : type_container, i, sigblob, &sigblob, error); - if (!mono_error_ok (error)) { + if (!is_ok (error)) { fprintf (output,"%d: failed to parse due to %s\n", i, mono_error_get_message (error)); mono_error_cleanup (error); continue; } - g_assert (mono_error_ok (error)); /*FIXME don't swallow the error message*/ + g_assert (is_ok (error)); /*FIXME don't swallow the error message*/ sig = dis_stringify_method_signature (m, method, i, method_container ? method_container : type_container, FALSE); impl_flags = get_method_impl_flags (cols [MONO_METHOD_IMPLFLAGS]); fprintf (output, "%d: %s (param: %d impl_flags: %s)\n", i, sig, cols [MONO_METHOD_PARAMLIST], impl_flags); @@ -861,9 +861,6 @@ handle_enum: p += 4; break; case MONO_TYPE_U8: - g_string_append_printf (res, "%lld", (long long)read64 (p)); - p += 8; - break; case MONO_TYPE_I8: g_string_append_printf (res, "%lld", (long long)read64 (p)); p += 8; diff --git a/mono/dis/get.c.REMOVED.git-id b/mono/dis/get.c.REMOVED.git-id index 44949df0e5..5196483390 100644 --- a/mono/dis/get.c.REMOVED.git-id +++ b/mono/dis/get.c.REMOVED.git-id @@ -1 +1 @@ -3be34fe7fdc6f20494122f604213f0d64473e0ae \ No newline at end of file +bca6da2a6c601b2152d37920143b1f7aef72095b \ No newline at end of file diff --git a/mono/dis/main.c b/mono/dis/main.c index 846e7e8788..056da620ed 100644 --- a/mono/dis/main.c +++ b/mono/dis/main.c @@ -863,7 +863,7 @@ dis_method_list (const char *klass_name, MonoImage *m, guint32 start, guint32 en if (container) { ERROR_DECL (error); mono_metadata_load_generic_param_constraints_checked (m, MONO_TOKEN_METHOD_DEF | (i + 1), container, error); - g_assert (mono_error_ok (error)); /*FIXME don't swallow the error message*/ + g_assert (is_ok (error)); /*FIXME don't swallow the error message*/ } else { container = type_container; } @@ -1206,7 +1206,7 @@ dis_type (MonoImage *m, int n, int is_nested, int forward) if (container) { ERROR_DECL (error); mono_metadata_load_generic_param_constraints_checked (m, MONO_TOKEN_TYPE_DEF | (n + 1), container, error); - g_assert (mono_error_ok (error)); /*FIXME don't swallow the error message*/ + g_assert (is_ok (error)); /*FIXME don't swallow the error message*/ } esname = get_escaped_name (name); @@ -1634,7 +1634,8 @@ disassemble_file (const char *file) /* FIXME: is this call necessary? */ /* FIXME: if it's necessary, can it be refonly instead? */ MonoAssemblyLoadRequest req; - mono_assembly_request_prepare (&req, sizeof (req), MONO_ASMCTX_DEFAULT); + mono_assembly_request_prepare_load (&req, MONO_ASMCTX_DEFAULT, mono_domain_default_alc (mono_domain_get ())); + mono_assembly_request_load_from (img, file, &req, &status); } @@ -1782,9 +1783,9 @@ sort_filter_elems (void) for (item = filter_list; item; item = item->next) { ifilter = (ImageFilter *)item->data; - qsort (ifilter->types.elems, ifilter->types.count, sizeof (int), int_cmp); - qsort (ifilter->fields.elems, ifilter->fields.count, sizeof (int), int_cmp); - qsort (ifilter->methods.elems, ifilter->methods.count, sizeof (int), int_cmp); + mono_qsort (ifilter->types.elems, ifilter->types.count, sizeof (int), int_cmp); + mono_qsort (ifilter->fields.elems, ifilter->fields.count, sizeof (int), int_cmp); + mono_qsort (ifilter->methods.elems, ifilter->methods.count, sizeof (int), int_cmp); } } @@ -1856,7 +1857,7 @@ try_load_from (MonoAssembly **assembly, gchar *fullpath; *assembly = NULL; - fullpath = g_build_filename (path1, path2, path3, path4, NULL); + fullpath = g_build_filename (path1, path2, path3, path4, (const char*)NULL); if (g_file_test (fullpath, G_FILE_TEST_IS_REGULAR)) *assembly = mono_assembly_request_open (fullpath, req, NULL); @@ -1879,7 +1880,7 @@ real_load (gchar **search_path, const gchar *culture, const gchar *name, const M local_culture = culture; } - filename = g_strconcat (name, ".dll", NULL); + filename = g_strconcat (name, ".dll", (const char*)NULL); len = strlen (filename); for (path = search_path; *path; path++) { @@ -1916,16 +1917,18 @@ real_load (gchar **search_path, const gchar *culture, const gchar *name, const M * Try to load referenced assemblies from assemblies_path. */ static MonoAssembly * -monodis_preload (MonoAssemblyName *aname, - gchar **assemblies_path, - gpointer user_data) +monodis_preload (MonoAssemblyLoadContext *alc, + MonoAssemblyName *aname, + gchar **assemblies_path, + gboolean refonly, + gpointer user_data, + MonoError *error) { MonoAssembly *result = NULL; - gboolean refonly = GPOINTER_TO_UINT (user_data); if (assemblies_path && assemblies_path [0] != NULL) { MonoAssemblyOpenRequest req; - mono_assembly_request_prepare (&req.request, sizeof (req), refonly ? MONO_ASMCTX_REFONLY : MONO_ASMCTX_DEFAULT); + mono_assembly_request_prepare_open (&req, refonly ? MONO_ASMCTX_REFONLY : MONO_ASMCTX_DEFAULT, alc); result = real_load (assemblies_path, aname->culture, aname->name, &req); } @@ -1936,7 +1939,7 @@ monodis_preload (MonoAssemblyName *aname, static GList *loaded_assemblies = NULL; static void -monodis_assembly_load_hook (MonoAssembly *assembly, gpointer user_data) +monodis_assembly_load_hook (MonoAssemblyLoadContext *alc, MonoAssembly *assembly, gpointer user_data, MonoError *error) { loaded_assemblies = g_list_prepend (loaded_assemblies, assembly); } @@ -1977,14 +1980,20 @@ usage (void) } static void -thread_state_init (MonoThreadUnwindState *ctx) +monodis_thread_state_init (MonoThreadUnwindState *ctx) { } +#define monodis_setup_async_callback NULL +#define monodis_thread_state_init_from_sigctx NULL +#define monodis_thread_state_init_from_handle NULL + int main (int argc, char *argv []) { - MonoThreadInfoRuntimeCallbacks ticallbacks; + static const MonoThreadInfoRuntimeCallbacks ticallbacks = { + MONO_THREAD_INFO_RUNTIME_CALLBACKS (MONO_INIT_CALLBACK, monodis) + }; GList *input_files = NULL, *l; int i, j; @@ -2039,14 +2048,12 @@ main (int argc, char *argv []) CHECKED_MONO_INIT (); mono_counters_init (); mono_tls_init_runtime_keys (); - memset (&ticallbacks, 0, sizeof (ticallbacks)); - ticallbacks.thread_state_init = thread_state_init; #ifndef HOST_WIN32 mono_w32handle_init (); #endif mono_thread_info_runtime_init (&ticallbacks); - mono_install_assembly_load_hook (monodis_assembly_load_hook, NULL); + mono_install_assembly_load_hook_v2 (monodis_assembly_load_hook, NULL); mono_install_assembly_search_hook_v2 (monodis_assembly_search_hook, NULL, FALSE, FALSE); /* @@ -2057,7 +2064,7 @@ main (int argc, char *argv []) mono_init_from_assembly (argv [0], filename); - mono_install_assembly_preload_hook (monodis_preload, GUINT_TO_POINTER (FALSE)); + mono_install_assembly_preload_hook_v2 (monodis_preload, GUINT_TO_POINTER (FALSE), FALSE); return disassemble_file (filename); } else { diff --git a/mono/eglib/Makefile.am b/mono/eglib/Makefile.am index ba10873171..0c5132c633 100644 --- a/mono/eglib/Makefile.am +++ b/mono/eglib/Makefile.am @@ -1,9 +1,8 @@ include $(top_srcdir)/mk/common.mk -# FIXME -#SUBDIRS = test +if !ENABLE_MSVC_ONLY -DIST_SUBDIRS = test +SUBDIRS = . test noinst_LTLIBRARIES = libeglib.la @@ -55,8 +54,12 @@ libeglib_la_SOURCES = \ unicode-data.h \ $(os_files) +endif # !ENABLE_MSVC_ONLY + CFLAGS := $(filter-out @CXX_REMOVE_CFLAGS@, @CFLAGS@) @CXX_ADD_CFLAGS@ +if !ENABLE_MSVC_ONLY + eglibdir=$(datadir)/mono-$(API_VER)/mono/eglib eglib_DATA = eglib-config.h @@ -77,3 +80,18 @@ endif MAINTAINERCLEANFILES = Makefile.in EXTRA_DIST = eglib-config.h.in $(win_files) $(unix_files) + +endif # !ENABLE_MSVC_ONLY + +if ENABLE_MSVC_ONLY + +all-local: + + make -C $(top_srcdir)/msvc eglib + +clean-local: + + make -C $(top_srcdir)/msvc clean-eglib + + +endif # ENABLE_MSVC_ONLY diff --git a/mono/eglib/Makefile.in b/mono/eglib/Makefile.in index 327dff7a72..110508477b 100644 --- a/mono/eglib/Makefile.in +++ b/mono/eglib/Makefile.in @@ -91,7 +91,6 @@ build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = mono/eglib -SUBDIRS = ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/apple-target.m4 \ $(top_srcdir)/m4/ax_append_flag.m4 \ @@ -123,27 +122,48 @@ am__libeglib_la_SOURCES_DIST = eglib-remap.h sort.frag.h glib.h \ gdate-win32.c gdir-win32.c gfile-win32.c gmisc-win32.c \ gmodule-win32.c gmodule-win32-internals.h gtimer-win32.c \ gunicode-win32.c -am__objects_1 = libeglib_la-gdate-unix.lo libeglib_la-gdir-unix.lo \ - libeglib_la-gfile-unix.lo libeglib_la-gmisc-unix.lo \ - libeglib_la-gmodule-unix.lo libeglib_la-gtimer-unix.lo -am__objects_2 = libeglib_la-gdate-win32.lo libeglib_la-gdir-win32.lo \ - libeglib_la-gfile-win32.lo libeglib_la-gmisc-win32.lo \ - libeglib_la-gmodule-win32.lo libeglib_la-gtimer-win32.lo \ - libeglib_la-gunicode-win32.lo -@HOST_WIN32_FALSE@am__objects_3 = $(am__objects_1) -@HOST_WIN32_TRUE@am__objects_3 = $(am__objects_2) -am_libeglib_la_OBJECTS = libeglib_la-garray.lo \ - libeglib_la-gbytearray.lo libeglib_la-gerror.lo \ - libeglib_la-ghashtable.lo libeglib_la-giconv.lo \ - libeglib_la-gmem.lo libeglib_la-goutput.lo \ - libeglib_la-gqsort.lo libeglib_la-gstr.lo \ - libeglib_la-gslist.lo libeglib_la-gstring.lo \ - libeglib_la-gptrarray.lo libeglib_la-glist.lo \ - libeglib_la-gqueue.lo libeglib_la-gpath.lo \ - libeglib_la-gshell.lo libeglib_la-gspawn.lo \ - libeglib_la-gfile.lo libeglib_la-gfile-posix.lo \ - libeglib_la-gpattern.lo libeglib_la-gmarkup.lo \ - libeglib_la-gutf8.lo libeglib_la-gunicode.lo $(am__objects_3) +@ENABLE_MSVC_ONLY_FALSE@am__objects_1 = libeglib_la-gdate-unix.lo \ +@ENABLE_MSVC_ONLY_FALSE@ libeglib_la-gdir-unix.lo \ +@ENABLE_MSVC_ONLY_FALSE@ libeglib_la-gfile-unix.lo \ +@ENABLE_MSVC_ONLY_FALSE@ libeglib_la-gmisc-unix.lo \ +@ENABLE_MSVC_ONLY_FALSE@ libeglib_la-gmodule-unix.lo \ +@ENABLE_MSVC_ONLY_FALSE@ libeglib_la-gtimer-unix.lo +@ENABLE_MSVC_ONLY_FALSE@am__objects_2 = libeglib_la-gdate-win32.lo \ +@ENABLE_MSVC_ONLY_FALSE@ libeglib_la-gdir-win32.lo \ +@ENABLE_MSVC_ONLY_FALSE@ libeglib_la-gfile-win32.lo \ +@ENABLE_MSVC_ONLY_FALSE@ libeglib_la-gmisc-win32.lo \ +@ENABLE_MSVC_ONLY_FALSE@ libeglib_la-gmodule-win32.lo \ +@ENABLE_MSVC_ONLY_FALSE@ libeglib_la-gtimer-win32.lo \ +@ENABLE_MSVC_ONLY_FALSE@ libeglib_la-gunicode-win32.lo +@ENABLE_MSVC_ONLY_FALSE@@HOST_WIN32_FALSE@am__objects_3 = \ +@ENABLE_MSVC_ONLY_FALSE@@HOST_WIN32_FALSE@ $(am__objects_1) +@ENABLE_MSVC_ONLY_FALSE@@HOST_WIN32_TRUE@am__objects_3 = \ +@ENABLE_MSVC_ONLY_FALSE@@HOST_WIN32_TRUE@ $(am__objects_2) +@ENABLE_MSVC_ONLY_FALSE@am_libeglib_la_OBJECTS = \ +@ENABLE_MSVC_ONLY_FALSE@ libeglib_la-garray.lo \ +@ENABLE_MSVC_ONLY_FALSE@ libeglib_la-gbytearray.lo \ +@ENABLE_MSVC_ONLY_FALSE@ libeglib_la-gerror.lo \ +@ENABLE_MSVC_ONLY_FALSE@ libeglib_la-ghashtable.lo \ +@ENABLE_MSVC_ONLY_FALSE@ libeglib_la-giconv.lo \ +@ENABLE_MSVC_ONLY_FALSE@ libeglib_la-gmem.lo \ +@ENABLE_MSVC_ONLY_FALSE@ libeglib_la-goutput.lo \ +@ENABLE_MSVC_ONLY_FALSE@ libeglib_la-gqsort.lo \ +@ENABLE_MSVC_ONLY_FALSE@ libeglib_la-gstr.lo \ +@ENABLE_MSVC_ONLY_FALSE@ libeglib_la-gslist.lo \ +@ENABLE_MSVC_ONLY_FALSE@ libeglib_la-gstring.lo \ +@ENABLE_MSVC_ONLY_FALSE@ libeglib_la-gptrarray.lo \ +@ENABLE_MSVC_ONLY_FALSE@ libeglib_la-glist.lo \ +@ENABLE_MSVC_ONLY_FALSE@ libeglib_la-gqueue.lo \ +@ENABLE_MSVC_ONLY_FALSE@ libeglib_la-gpath.lo \ +@ENABLE_MSVC_ONLY_FALSE@ libeglib_la-gshell.lo \ +@ENABLE_MSVC_ONLY_FALSE@ libeglib_la-gspawn.lo \ +@ENABLE_MSVC_ONLY_FALSE@ libeglib_la-gfile.lo \ +@ENABLE_MSVC_ONLY_FALSE@ libeglib_la-gfile-posix.lo \ +@ENABLE_MSVC_ONLY_FALSE@ libeglib_la-gpattern.lo \ +@ENABLE_MSVC_ONLY_FALSE@ libeglib_la-gmarkup.lo \ +@ENABLE_MSVC_ONLY_FALSE@ libeglib_la-gutf8.lo \ +@ENABLE_MSVC_ONLY_FALSE@ libeglib_la-gunicode.lo \ +@ENABLE_MSVC_ONLY_FALSE@ $(am__objects_3) libeglib_la_OBJECTS = $(am_libeglib_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) @@ -152,6 +172,7 @@ am__v_lt_1 = libeglib_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(libeglib_la_CFLAGS) \ $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +@ENABLE_MSVC_ONLY_FALSE@am_libeglib_la_rpath = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false @@ -254,6 +275,7 @@ am__define_uniq_tagged_files = \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags +DIST_SUBDIRS = . test am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/eglib-config.h.in \ $(top_srcdir)/depcomp $(top_srcdir)/mk/common.mk \ $(top_srcdir)/mkinstalldirs @@ -366,6 +388,7 @@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTERP_CFLAGS = @INTERP_CFLAGS@ INTL = @INTL@ INVARIANT_AOT_OPTIONS = @INVARIANT_AOT_OPTIONS@ JEMALLOC_AUTOCONF_FLAGS = @JEMALLOC_AUTOCONF_FLAGS@ @@ -555,63 +578,60 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MAKEFLAGS := $(MAKEFLAGS) --no-builtin-rules +@ENABLE_MSVC_ONLY_FALSE@SUBDIRS = . test +@ENABLE_MSVC_ONLY_FALSE@noinst_LTLIBRARIES = libeglib.la +@ENABLE_MSVC_ONLY_FALSE@AM_CFLAGS = $(WERROR_CFLAGS) +@ENABLE_MSVC_ONLY_FALSE@win_files = \ +@ENABLE_MSVC_ONLY_FALSE@ eglib-config.hw \ +@ENABLE_MSVC_ONLY_FALSE@ gdate-win32.c gdir-win32.c gfile-win32.c gmisc-win32.c \ +@ENABLE_MSVC_ONLY_FALSE@ gmodule-win32.c gmodule-win32-internals.h gtimer-win32.c gunicode-win32.c -# FIXME -#SUBDIRS = test -DIST_SUBDIRS = test -noinst_LTLIBRARIES = libeglib.la -AM_CFLAGS = $(WERROR_CFLAGS) -win_files = \ - eglib-config.hw \ - gdate-win32.c gdir-win32.c gfile-win32.c gmisc-win32.c \ - gmodule-win32.c gmodule-win32-internals.h gtimer-win32.c gunicode-win32.c +@ENABLE_MSVC_ONLY_FALSE@unix_files = \ +@ENABLE_MSVC_ONLY_FALSE@ gdate-unix.c gdir-unix.c gfile-unix.c gmisc-unix.c \ +@ENABLE_MSVC_ONLY_FALSE@ gmodule-unix.c gtimer-unix.c -unix_files = \ - gdate-unix.c gdir-unix.c gfile-unix.c gmisc-unix.c \ - gmodule-unix.c gtimer-unix.c +@ENABLE_MSVC_ONLY_FALSE@@HOST_WIN32_FALSE@os_files = $(unix_files) +@ENABLE_MSVC_ONLY_FALSE@@HOST_WIN32_TRUE@os_files = $(win_files) +@ENABLE_MSVC_ONLY_FALSE@libeglib_la_SOURCES = \ +@ENABLE_MSVC_ONLY_FALSE@ eglib-remap.h \ +@ENABLE_MSVC_ONLY_FALSE@ sort.frag.h \ +@ENABLE_MSVC_ONLY_FALSE@ glib.h \ +@ENABLE_MSVC_ONLY_FALSE@ garray.c \ +@ENABLE_MSVC_ONLY_FALSE@ gbytearray.c \ +@ENABLE_MSVC_ONLY_FALSE@ gerror.c \ +@ENABLE_MSVC_ONLY_FALSE@ ghashtable.c \ +@ENABLE_MSVC_ONLY_FALSE@ giconv.c \ +@ENABLE_MSVC_ONLY_FALSE@ gmem.c \ +@ENABLE_MSVC_ONLY_FALSE@ gmodule.h \ +@ENABLE_MSVC_ONLY_FALSE@ goutput.c \ +@ENABLE_MSVC_ONLY_FALSE@ gqsort.c \ +@ENABLE_MSVC_ONLY_FALSE@ gstr.c \ +@ENABLE_MSVC_ONLY_FALSE@ gslist.c \ +@ENABLE_MSVC_ONLY_FALSE@ gstring.c \ +@ENABLE_MSVC_ONLY_FALSE@ gptrarray.c \ +@ENABLE_MSVC_ONLY_FALSE@ glist.c \ +@ENABLE_MSVC_ONLY_FALSE@ gqueue.c \ +@ENABLE_MSVC_ONLY_FALSE@ gpath.c \ +@ENABLE_MSVC_ONLY_FALSE@ gshell.c \ +@ENABLE_MSVC_ONLY_FALSE@ gspawn.c \ +@ENABLE_MSVC_ONLY_FALSE@ gfile.c \ +@ENABLE_MSVC_ONLY_FALSE@ gfile-posix.c \ +@ENABLE_MSVC_ONLY_FALSE@ gpattern.c \ +@ENABLE_MSVC_ONLY_FALSE@ gmarkup.c \ +@ENABLE_MSVC_ONLY_FALSE@ gutf8.c \ +@ENABLE_MSVC_ONLY_FALSE@ gunicode.c \ +@ENABLE_MSVC_ONLY_FALSE@ unicode-data.h \ +@ENABLE_MSVC_ONLY_FALSE@ $(os_files) -@HOST_WIN32_FALSE@os_files = $(unix_files) -@HOST_WIN32_TRUE@os_files = $(win_files) -libeglib_la_SOURCES = \ - eglib-remap.h \ - sort.frag.h \ - glib.h \ - garray.c \ - gbytearray.c \ - gerror.c \ - ghashtable.c \ - giconv.c \ - gmem.c \ - gmodule.h \ - goutput.c \ - gqsort.c \ - gstr.c \ - gslist.c \ - gstring.c \ - gptrarray.c \ - glist.c \ - gqueue.c \ - gpath.c \ - gshell.c \ - gspawn.c \ - gfile.c \ - gfile-posix.c \ - gpattern.c \ - gmarkup.c \ - gutf8.c \ - gunicode.c \ - unicode-data.h \ - $(os_files) - -eglibdir = $(datadir)/mono-$(API_VER)/mono/eglib -eglib_DATA = eglib-config.h -libeglib_la_CFLAGS = -g -Wall -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -AM_CPPFLAGS = -I$(srcdir) -@HOST_ANDROID_FALSE@@HOST_WIN32_FALSE@libeglib_la_LIBADD = -lm $(LTLIBICONV) -@HOST_ANDROID_FALSE@@HOST_WIN32_TRUE@libeglib_la_LIBADD = -lm -lpsapi $(LTLIBICONV) -@HOST_ANDROID_TRUE@libeglib_la_LIBADD = -lm -llog -MAINTAINERCLEANFILES = Makefile.in -EXTRA_DIST = eglib-config.h.in $(win_files) $(unix_files) +@ENABLE_MSVC_ONLY_FALSE@eglibdir = $(datadir)/mono-$(API_VER)/mono/eglib +@ENABLE_MSVC_ONLY_FALSE@eglib_DATA = eglib-config.h +@ENABLE_MSVC_ONLY_FALSE@libeglib_la_CFLAGS = -g -Wall -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE +@ENABLE_MSVC_ONLY_FALSE@AM_CPPFLAGS = -I$(srcdir) +@ENABLE_MSVC_ONLY_FALSE@@HOST_ANDROID_FALSE@@HOST_WIN32_FALSE@libeglib_la_LIBADD = -lm $(LTLIBICONV) +@ENABLE_MSVC_ONLY_FALSE@@HOST_ANDROID_FALSE@@HOST_WIN32_TRUE@libeglib_la_LIBADD = -lm -lpsapi $(LTLIBICONV) +@ENABLE_MSVC_ONLY_FALSE@@HOST_ANDROID_TRUE@libeglib_la_LIBADD = -lm -llog +@ENABLE_MSVC_ONLY_FALSE@MAINTAINERCLEANFILES = Makefile.in +@ENABLE_MSVC_ONLY_FALSE@EXTRA_DIST = eglib-config.h.in $(win_files) $(unix_files) all: all-recursive .SUFFIXES: @@ -661,7 +681,7 @@ clean-noinstLTLIBRARIES: } libeglib.la: $(libeglib_la_OBJECTS) $(libeglib_la_DEPENDENCIES) $(EXTRA_libeglib_la_DEPENDENCIES) - $(AM_V_CCLD)$(libeglib_la_LINK) $(libeglib_la_OBJECTS) $(libeglib_la_LIBADD) $(LIBS) + $(AM_V_CCLD)$(libeglib_la_LINK) $(am_libeglib_la_rpath) $(libeglib_la_OBJECTS) $(libeglib_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -707,25 +727,22 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libeglib_la-gutf8.Plo@am__quote@ .c.o: -@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ -@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: -@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ -@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: -@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ -@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ -@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< @@ -1167,7 +1184,8 @@ distdir: $(DISTFILES) done check-am: all-am check: check-recursive -all-am: Makefile $(LTLIBRARIES) $(DATA) +@ENABLE_MSVC_ONLY_FALSE@all-local: +all-am: Makefile $(LTLIBRARIES) $(DATA) all-local installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(eglibdir)"; do \ @@ -1204,10 +1222,11 @@ maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) +@ENABLE_MSVC_ONLY_FALSE@clean-local: clean: clean-recursive -clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ - mostlyclean-am +clean-am: clean-generic clean-libtool clean-local \ + clean-noinstLTLIBRARIES mostlyclean-am distclean: distclean-recursive -rm -rf ./$(DEPDIR) @@ -1285,8 +1304,8 @@ uninstall-am: uninstall-eglibDATA .MAKE: $(am__recursive_targets) install-am install-strip -.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ - check-am clean clean-generic clean-libtool \ +.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am all-local \ + check check-am clean clean-generic clean-libtool clean-local \ clean-noinstLTLIBRARIES cscopelist-am ctags ctags-am distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ @@ -1304,6 +1323,14 @@ uninstall-am: uninstall-eglibDATA .PRECIOUS: Makefile +@ENABLE_MSVC_ONLY_TRUE@all-local: + +@ENABLE_MSVC_ONLY_TRUE@ make -C $(top_srcdir)/msvc eglib + +@ENABLE_MSVC_ONLY_TRUE@clean-local: + +@ENABLE_MSVC_ONLY_TRUE@ make -C $(top_srcdir)/msvc clean-eglib + # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: diff --git a/mono/eglib/eglib-remap.h b/mono/eglib/eglib-remap.h index 43d6543b8d..0bbbcab2b9 100644 --- a/mono/eglib/eglib-remap.h +++ b/mono/eglib/eglib-remap.h @@ -16,6 +16,7 @@ #define g_array_set_size monoeg_g_array_set_size #define g_array_sized_new monoeg_g_array_sized_new #define g_ascii_strdown monoeg_g_ascii_strdown +#define g_ascii_strdown_no_alloc monoeg_g_ascii_strdown_no_alloc #define g_ascii_strncasecmp monoeg_g_ascii_strncasecmp #define g_ascii_tolower monoeg_g_ascii_tolower #define g_ascii_xdigit_value monoeg_g_ascii_xdigit_value diff --git a/mono/eglib/gfile-posix.c b/mono/eglib/gfile-posix.c index e927cf5d3f..c18850a862 100644 --- a/mono/eglib/gfile-posix.c +++ b/mono/eglib/gfile-posix.c @@ -141,7 +141,7 @@ g_file_open_tmp (const gchar *tmpl, gchar **name_used, GError **gerror) return -1; } - t = g_build_filename (g_get_tmp_dir (), tmpl, NULL); + t = g_build_filename (g_get_tmp_dir (), tmpl, (const char*)NULL); fd = mkstemp (t); diff --git a/mono/eglib/gfile-win32.c b/mono/eglib/gfile-win32.c index 61e23cbe44..43de30d473 100644 --- a/mono/eglib/gfile-win32.c +++ b/mono/eglib/gfile-win32.c @@ -114,11 +114,8 @@ g_file_test (const gchar *filename, GFileTest test) } if ((test & G_FILE_TEST_IS_EXECUTABLE) != 0) { - size_t len = strlen (filename); - if (len > 4 && strcmp (filename + len-3, "exe")) - return TRUE; - - return FALSE; + /* Testing executable permission on Windows is hard, and this is unused, treat as EXISTS for now. */ + return TRUE; } if ((test & G_FILE_TEST_IS_REGULAR) != 0) { diff --git a/mono/eglib/glib.h b/mono/eglib/glib.h index bbe5fae31f..cb8d46056a 100644 --- a/mono/eglib/glib.h +++ b/mono/eglib/glib.h @@ -403,6 +403,7 @@ gchar *g_stpcpy (gchar *dest, const char *src); gchar g_ascii_tolower (gchar c); gchar g_ascii_toupper (gchar c); gchar *g_ascii_strdown (const gchar *str, gssize len); +void g_ascii_strdown_no_alloc (char* dst, const char* src, gsize len); gchar *g_ascii_strup (const gchar *str, gssize len); gint g_ascii_strncasecmp (const gchar *s1, const gchar *s2, gsize n); gint g_ascii_strcasecmp (const gchar *s1, const gchar *s2); @@ -414,6 +415,32 @@ gint g_ascii_xdigit_value (gchar c); gboolean g_utf16_ascii_equal (const gunichar2 *utf16, size_t ulen, const char *ascii, size_t alen); gboolean g_utf16_asciiz_equal (const gunichar2 *utf16, const char *ascii); +static inline +gboolean g_ascii_equal (const char *s1, gsize len1, const char *s2, gsize len2) +{ + return len1 == len2 && (s1 == s2 || memcmp (s1, s2, len1) == 0); +} + +static inline +gboolean g_asciiz_equal (const char *s1, const char *s2) +{ + return s1 == s2 || strcmp (s1, s2) == 0; +} + +static inline +gboolean +g_ascii_equal_caseinsensitive (const char *s1, gsize len1, const char *s2, gsize len2) +{ + return len1 == len2 && (s1 == s2 || g_ascii_strncasecmp (s1, s2, len1) == 0); +} + +static inline +gboolean +g_asciiz_equal_caseinsensitive (const char *s1, const char *s2) +{ + return s1 == s2 || g_ascii_strcasecmp (s1, s2) == 0; +} + /* FIXME: g_strcasecmp supports utf8 unicode stuff */ #ifdef _MSC_VER #define g_strcasecmp _stricmp @@ -1389,8 +1416,42 @@ glong g_utf8_pointer_to_offset (const gchar *str, const gchar *pos); #define G_HAVE_API_SUPPORT(x) (x) #define G_UNSUPPORTED_API "%s:%d: '%s' not supported.", __FILE__, __LINE__ #define g_unsupported_api(name) G_STMT_START { g_warning (G_UNSUPPORTED_API, name); } G_STMT_END - -G_END_DECLS + +// g_free the result +// No MAX_PATH limit. +gboolean +mono_get_module_filename (gpointer mod, gunichar2 **pstr, guint32 *plength); + +// g_free the result +// No MAX_PATH limit. +gboolean +mono_get_module_filename_ex (gpointer process, gpointer mod, gunichar2 **pstr, guint32 *plength); + +// g_free the result +// No MAX_PATH limit. +gboolean +mono_get_module_basename (gpointer process, gpointer mod, gunichar2 **pstr, guint32 *plength); + +// g_free the result +// No MAX_PATH limit. +gboolean +mono_get_current_directory (gunichar2 **pstr, guint32 *plength); + +G_END_DECLS // FIXME: There is more extern C than there should be. + +static inline +void +mono_qsort (void* base, size_t num, size_t size, int (*compare)(const void*, const void*)) +{ + g_assert (compare); + g_assert (size); + if (num < 2 || !size || !base) + return; + qsort (base, num, size, compare); +} + +#define MONO_DECL_CALLBACK(prefix, ret, name, sig) ret (*name) sig; +#define MONO_INIT_CALLBACK(prefix, ret, name, sig) prefix ## _ ## name, // For each allocator; i.e. returning gpointer that needs to be cast. // Macros do not recurse, so naming function and macro the same is ok. diff --git a/mono/eglib/glist.c b/mono/eglib/glist.c index be473d9702..9fe1748133 100644 --- a/mono/eglib/glist.c +++ b/mono/eglib/glist.c @@ -36,7 +36,7 @@ g_list_alloc (void) return g_new0 (GList, 1); } -static inline GList* +static GList* new_node (GList *prev, gpointer data, GList *next) { GList *node = g_list_alloc (); @@ -50,7 +50,7 @@ new_node (GList *prev, gpointer data, GList *next) return node; } -static inline GList* +static GList* disconnect_node (GList *node) { if (node->next) diff --git a/mono/eglib/gmisc-win32.c b/mono/eglib/gmisc-win32.c index 591c13a324..4efa27ff55 100644 --- a/mono/eglib/gmisc-win32.c +++ b/mono/eglib/gmisc-win32.c @@ -53,7 +53,8 @@ g_getenv(const gchar *variable) gint32 buffer_size = 1024; gint32 retval; var = u8to16(variable); - buffer = g_malloc(buffer_size*sizeof(gunichar2)); + // FIXME This should loop in case another thread is growing the data. + buffer = g_new (gunichar2, buffer_size); retval = GetEnvironmentVariableW (var, buffer, buffer_size); if (retval != 0) { if (retval > buffer_size) { @@ -149,7 +150,7 @@ g_get_known_folder_path (void) #else -static inline gchar * +static gchar * g_get_known_folder_path (void) { return NULL; diff --git a/mono/eglib/gmodule-unix.c b/mono/eglib/gmodule-unix.c index 77f8b8dd51..4c0d53c208 100644 --- a/mono/eglib/gmodule-unix.c +++ b/mono/eglib/gmodule-unix.c @@ -100,6 +100,9 @@ g_module_close (GModule *module) } #elif defined (G_OS_WIN32) +#ifndef PSAPI_VERSION +#define PSAPI_VERSION 2 // Use the Windows 7 or newer version more directly. +#endif #include #include diff --git a/mono/eglib/gmodule-win32.c b/mono/eglib/gmodule-win32.c index d0a18375c2..88dabf1f0f 100644 --- a/mono/eglib/gmodule-win32.c +++ b/mono/eglib/gmodule-win32.c @@ -30,6 +30,9 @@ */ #include #include +#ifndef PSAPI_VERSION +#define PSAPI_VERSION 2 // Use the Windows 7 or newer version more directly. +#endif #include #include #include @@ -189,3 +192,155 @@ g_module_build_path (const gchar *directory, const gchar *module_name) } return g_strdup_printf ("%s%s" LIBSUFFIX, lib_prefix, module_name); } + +// This is not about GModule but is still a close fit. +// This is not named "g_" but that should be ok. +// g_free the result +// No MAX_PATH limit. +// +// Prefer mono_get_module_filename over mono_get_module_filename_ex and mono_get_module_basename. +// Prefer not-ex, not-base. +// +gboolean +mono_get_module_filename (gpointer mod, gunichar2 **pstr, guint32 *plength) +{ + gunichar2 *str = NULL; + guint32 capacity = MAX_PATH; // tunable + guint32 length = 0; + gboolean success = FALSE; + + while (TRUE) + { + length = 0; + if (capacity > (1 << 24)) + break; + str = g_new (gunichar2, capacity); + if (!str) + break; + length = GetModuleFileNameW ((HMODULE)mod, str, capacity); + success = length && length < (capacity - 1); // This function does not truncate, but - 1 anyway. + if (success) + break; + g_free (str); // error or too small + str = NULL; + if (!length) // error + break; + capacity *= 2; + } + *pstr = str; + *plength = length; + return success; +} + +// This is not about GModule but is still a close fit. +// This is not named "g_" but that should be ok. +// g_free the result +// No MAX_PATH limit. +// +// Prefer mono_get_module_filename over mono_get_module_filename_ex and mono_get_module_basename. +// Prefer not-ex, not-base. +// +gboolean +mono_get_module_filename_ex (gpointer process, gpointer mod, gunichar2 **pstr, guint32 *plength) +{ + gunichar2 *str = NULL; + guint32 capacity = MAX_PATH; // tunable + guint32 length = 0; + gboolean success = FALSE; + + while (TRUE) + { + length = 0; + if (capacity > (1 << 24)) + break; + str = g_new (gunichar2, capacity); + if (!str) + break; + length = GetModuleFileNameExW (process, (HMODULE)mod, str, capacity); + success = length && length < (capacity - 1); // This function truncates, thus the - 1. + if (success) + break; + g_free (str); // error or too small + str = NULL; + if (!length) // error + break; + capacity *= 2; + } + *pstr = str; + *plength = length; + return success; +} + +// This is not about GModule but is still a close fit. +// This is not named "g_" but that should be ok. +// g_free the result +// No MAX_PATH limit. +// +// Prefer mono_get_module_filename over mono_get_module_filename_ex and mono_get_module_basename. +// Prefer not-ex, not-base. +// +gboolean +mono_get_module_basename (gpointer process, gpointer mod, gunichar2 **pstr, guint32 *plength) +{ + gunichar2 *str = NULL; + guint32 capacity = MAX_PATH; // tunable + guint32 length = 0; + gboolean success = FALSE; + + while (TRUE) + { + length = 0; + if (capacity > (1 << 24)) + break; + str = g_new (gunichar2, capacity); + if (!str) + break; + length = GetModuleBaseNameW (process, (HMODULE)mod, str, capacity); + success = length && length < (capacity - 1); // This function truncates, thus the - 1. + if (success) + break; + g_free (str); // error or too small + str = NULL; + if (!length) // error + break; + capacity *= 2; + } + *pstr = str; + *plength = length; + return success; +} + +// g_free the result +// No MAX_PATH limit. +gboolean +mono_get_current_directory (gunichar2 **pstr, guint32 *plength) +{ + gunichar2 *str = NULL; + guint32 capacity = MAX_PATH; // tunable + guint32 length = 0; + gboolean success = FALSE; + + while (TRUE) + { + length = 0; + if (capacity > (1 << 24)) + break; + str = g_new (gunichar2, capacity); + if (!str) + break; + // Call in loop, not just twice, in case another thread is changing it. + // Result is transient in currentness and validity (can get deleted or become a file). + length = GetCurrentDirectoryW (capacity, str); + success = length && length < (capacity - 1); + if (success) + break; + g_free (str); // error or too small + str = NULL; + if (!length) // error + break; + capacity *= 2; + } + *pstr = str; + *plength = length; + return success; +} diff --git a/mono/eglib/gpath.c b/mono/eglib/gpath.c index a5f07c18a2..f6ca10ec58 100644 --- a/mono/eglib/gpath.c +++ b/mono/eglib/gpath.c @@ -265,8 +265,8 @@ g_find_program_in_path (const gchar *program) if (!hasSuffix) { listx = 0; while (suffix_list[listx]) { - program_exe = g_strjoin(NULL,program,suffix_list[listx],NULL); - probe_path = g_build_path (G_DIR_SEPARATOR_S, l, program_exe, NULL); + program_exe = g_strjoin (NULL, program, suffix_list [listx], (const char*)NULL); + probe_path = g_build_path (G_DIR_SEPARATOR_S, l, program_exe, (const char*)NULL); #ifdef HAVE_ACCESS if (g_access (probe_path, X_OK) == 0){ /* FIXME: on windows this is just a read permissions test */ g_free (curdir); diff --git a/mono/eglib/gptrarray.c b/mono/eglib/gptrarray.c index 8d08729858..d18d3e8ced 100644 --- a/mono/eglib/gptrarray.c +++ b/mono/eglib/gptrarray.c @@ -214,7 +214,7 @@ void g_ptr_array_sort(GPtrArray *array, GCompareFunc compare) { g_return_if_fail(array != NULL); - qsort(array->pdata, array->len, sizeof(gpointer), compare); + mono_qsort (array->pdata, array->len, sizeof(gpointer), compare); } void diff --git a/mono/eglib/gslist.c b/mono/eglib/gslist.c index 1293564df1..65744eaa73 100644 --- a/mono/eglib/gslist.c +++ b/mono/eglib/gslist.c @@ -63,7 +63,7 @@ g_slist_prepend (GSList *list, gpointer data) * Insert the given data in a new node after the current node. * Return new node. */ -static inline GSList * +static GSList * insert_after (GSList *list, gpointer data) { list->next = g_slist_prepend (list->next, data); @@ -75,7 +75,7 @@ insert_after (GSList *list, gpointer data) * If the list is empty, or the first node contains 'data', return NULL. * If no node contains 'data', return the last node. */ -static inline GSList* +static GSList* find_prev (GSList *list, gconstpointer data) { GSList *prev = NULL; @@ -89,7 +89,7 @@ find_prev (GSList *list, gconstpointer data) } /* like 'find_prev', but searches for node 'link' */ -static inline GSList* +static GSList* find_prev_link (GSList *list, GSList *link) { GSList *prev = NULL; diff --git a/mono/eglib/gspawn.c b/mono/eglib/gspawn.c index 9be865af3d..64ac161f71 100644 --- a/mono/eglib/gspawn.c +++ b/mono/eglib/gspawn.c @@ -96,7 +96,7 @@ extern char **environ; G_END_DECLS #endif -#ifndef G_OS_WIN32 +#if !defined (G_OS_WIN32) && defined (HAVE_FORK) && defined (HAVE_EXECV) static int safe_read (int fd, gchar *buffer, gint count, GError **gerror) { @@ -135,21 +135,12 @@ read_pipes (int outfd, gchar **out_str, int errfd, gchar **err_str, GError **ger if (out_closed && err_closed) break; -#ifdef _MSC_VER -#pragma warning(push) -#pragma warning(disable:4389) -#endif - FD_ZERO (&rfds); if (!out_closed && outfd >= 0) FD_SET (outfd, &rfds); if (!err_closed && errfd >= 0) FD_SET (errfd, &rfds); -#ifdef _MSC_VER -#pragma warning(pop) -#endif - res = select (MAX (outfd, errfd) + 1, &rfds, NULL, NULL, NULL); if (res > 0) { if (buffer == NULL) @@ -203,7 +194,6 @@ create_pipe (int *fds, GError **gerror) } return TRUE; } -#endif /* G_OS_WIN32 */ static int write_all (int fd, const void *vbuf, size_t n) @@ -225,6 +215,7 @@ write_all (int fd, const void *vbuf, size_t n) return nwritten; } +#endif /* !defined (G_OS_WIN32) && defined (HAVE_FORK) && defined (HAVE_EXECV) */ #if !defined(G_OS_WIN32) && defined(HAVE_GETDTABLESIZE) int @@ -257,6 +248,7 @@ g_spawn_command_line_sync (const gchar *command_line, GError **gerror) { #ifdef G_OS_WIN32 + return TRUE; #elif !defined (HAVE_FORK) || !defined (HAVE_EXECV) fprintf (stderr, "g_spawn_command_line_sync not supported on this platform\n"); return FALSE; @@ -334,8 +326,8 @@ g_spawn_command_line_sync (const gchar *command_line, if (WIFEXITED (status) && exit_status) { *exit_status = WEXITSTATUS (status); } -#endif return TRUE; +#endif } /* @@ -356,6 +348,7 @@ g_spawn_async_with_pipes (const gchar *working_directory, GError **gerror) { #ifdef G_OS_WIN32 + return TRUE; #elif !defined (HAVE_FORK) || !defined (HAVE_EXECVE) fprintf (stderr, "g_spawn_async_with_pipes is not supported on this platform\n"); return FALSE; @@ -528,8 +521,6 @@ g_spawn_async_with_pipes (const gchar *working_directory, *standard_output = out_pipe [0]; if (standard_error) *standard_error = err_pipe [0]; -#endif return TRUE; +#endif } - - diff --git a/mono/eglib/gstr.c b/mono/eglib/gstr.c index 758aeb0179..f028501f12 100644 --- a/mono/eglib/gstr.c +++ b/mono/eglib/gstr.c @@ -821,11 +821,20 @@ g_ascii_tolower (gchar c) return c >= 'A' && c <= 'Z' ? c + ('a' - 'A') : c; } +void +g_ascii_strdown_no_alloc (char* dst, const char* src, gsize len) +{ + // dst can equal src. no_alloc means this function does no + // allocation; caller may very well. + + for (gsize i = 0; i < len; ++i) + dst [i] = g_ascii_tolower (src [i]); +} + gchar * g_ascii_strdown (const gchar *str, gssize len) { char *ret; - int i; g_return_val_if_fail (str != NULL, NULL); @@ -833,9 +842,8 @@ g_ascii_strdown (const gchar *str, gssize len) len = strlen (str); ret = g_malloc (len + 1); - for (i = 0; i < len; i++) - ret [i] = (guchar) g_ascii_tolower (str [i]); - ret [i] = 0; + g_ascii_strdown_no_alloc (ret, str, len); + ret [len] = 0; return ret; } @@ -859,26 +867,50 @@ g_ascii_strup (const gchar *str, gssize len) ret = g_malloc (len + 1); for (i = 0; i < len; i++) - ret [i] = (guchar) g_ascii_toupper (str [i]); + ret [i] = g_ascii_toupper (str [i]); ret [i] = 0; return ret; } +static +int +g_ascii_charcmp (char c1, char c2) +{ + // Do not subtract, to avoid overflow. + // Use unsigned to mimic strcmp, and so + // shorter strings compare as less. + + const guchar u1 = (guchar)c1; + const guchar u2 = (guchar)c2; + return (u1 < u2) ? -1 : (u1 > u2) ? 1 : 0; +} + +static +int +g_ascii_charcasecmp (char c1, char c2) +{ + return g_ascii_charcmp (g_ascii_tolower (c1), g_ascii_tolower (c2)); +} + gint g_ascii_strncasecmp (const gchar *s1, const gchar *s2, gsize n) { + // Unlike strncmp etc. this function does not stop at nul, + // unless there is a mismatch. + + if (s1 == s2) + return 0; + gsize i; - + g_return_val_if_fail (s1 != NULL, 0); g_return_val_if_fail (s2 != NULL, 0); for (i = 0; i < n; i++) { - gchar c1 = g_ascii_tolower (*s1++); - gchar c2 = g_ascii_tolower (*s2++); - - if (c1 != c2) - return c1 - c2; + const int j = g_ascii_charcasecmp (*s1++, *s2++); + if (j) + return j; } return 0; @@ -887,21 +919,22 @@ g_ascii_strncasecmp (const gchar *s1, const gchar *s2, gsize n) gint g_ascii_strcasecmp (const gchar *s1, const gchar *s2) { - const char *sp1 = s1; - const char *sp2 = s2; - + if (s1 == s2) + return 0; + g_return_val_if_fail (s1 != NULL, 0); g_return_val_if_fail (s2 != NULL, 0); - - while (*sp1 != '\0') { - char c1 = g_ascii_tolower (*sp1++); - char c2 = g_ascii_tolower (*sp2++); - - if (c1 != c2) - return c1 - c2; + + char c1; + + while ((c1 = *s1)) { + ++s1; + const int j = g_ascii_charcasecmp (c1, *s2++); + if (j) + return j; } - - return (*sp1) - (*sp2); + + return g_ascii_charcmp (0, *s2); } gboolean diff --git a/mono/eglib/test/Makefile.am b/mono/eglib/test/Makefile.am index d9cc587e93..68b68d66a4 100644 --- a/mono/eglib/test/Makefile.am +++ b/mono/eglib/test/Makefile.am @@ -41,15 +41,24 @@ CXXFLAGS += $(GLIB_TEST_FLAGS_COMMON) @CXXFLAGS_COMMON@ test_eglib_LDADD = ../libeglib.la $(LTLIBICONV) assertf_LDADD = ../libeglib.la $(LTLIBICONV) -# Something amiss with subdirs ordering? -../libeglib.la: ../goutput.c # etc - $(MAKE) -C .. $(@F) +abs_srcdir = $(abspath $(srcdir)) -run-eglib: all - srcdir=`readlink -f $(srcdir)` ./test-eglib +if DISABLE_EXECUTABLES +run-eglib: +else +# FIXME: Various unit tests are broken on Win32, see https://github.com/mono/mono/issues/16576 +if HOST_WIN32 +run-eglib: +else +run-eglib: + srcdir="$(abs_srcdir)" ./test-eglib noinst_PROGRAMS = test-eglib assertf +endif # !HOST_WIN32 +endif # DISABLE_EXECUTABLES run-both: run-eglib +check-local: run-both + MAINTAINERCLEANFILES = Makefile.in diff --git a/mono/eglib/test/Makefile.in b/mono/eglib/test/Makefile.in index a6ec36cc06..923d454575 100644 --- a/mono/eglib/test/Makefile.in +++ b/mono/eglib/test/Makefile.in @@ -89,7 +89,8 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ -noinst_PROGRAMS = test-eglib$(EXEEXT) assertf$(EXEEXT) +@DISABLE_EXECUTABLES_FALSE@@HOST_WIN32_FALSE@noinst_PROGRAMS = test-eglib$(EXEEXT) \ +@DISABLE_EXECUTABLES_FALSE@@HOST_WIN32_FALSE@ assertf$(EXEEXT) subdir = mono/eglib/test ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/apple-target.m4 \ @@ -285,6 +286,7 @@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTERP_CFLAGS = @INTERP_CFLAGS@ INTL = @INTL@ INVARIANT_AOT_OPTIONS = @INVARIANT_AOT_OPTIONS@ JEMALLOC_AUTOCONF_FLAGS = @JEMALLOC_AUTOCONF_FLAGS@ @@ -394,7 +396,7 @@ XINERAMA = @XINERAMA@ XMKMF = @XMKMF@ ZLIB_CFLAGS = @ZLIB_CFLAGS@ abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ +abs_srcdir = $(abspath $(srcdir)) abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ @@ -597,49 +599,43 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utf8.Po@am__quote@ .c.o: -@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ -@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: -@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ -@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: -@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ -@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ -@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< .cpp.o: -@am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ -@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ -@am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< .cpp.obj: -@am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ -@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ -@am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cpp.lo: -@am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ -@am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ -@am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $< @@ -735,6 +731,7 @@ distdir: $(DISTFILES) fi; \ done check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) check-local check: check-am all-am: Makefile $(PROGRAMS) installdirs: @@ -848,11 +845,11 @@ test-bundle-am: test-bundle-local uninstall-am: -.MAKE: install-am install-strip +.MAKE: check-am install-am install-strip -.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ - clean-libtool clean-noinstPROGRAMS cscopelist-am ctags \ - ctags-am distclean distclean-compile distclean-generic \ +.PHONY: CTAGS GTAGS TAGS all all-am check check-am check-local clean \ + clean-generic clean-libtool clean-noinstPROGRAMS cscopelist-am \ + ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ @@ -868,15 +865,16 @@ uninstall-am: .PRECIOUS: Makefile -# Something amiss with subdirs ordering? -../libeglib.la: ../goutput.c # etc - $(MAKE) -C .. $(@F) - -run-eglib: all - srcdir=`readlink -f $(srcdir)` ./test-eglib +@DISABLE_EXECUTABLES_TRUE@run-eglib: +# FIXME: Various unit tests are broken on Win32, see https://github.com/mono/mono/issues/16576 +@DISABLE_EXECUTABLES_FALSE@@HOST_WIN32_TRUE@run-eglib: +@DISABLE_EXECUTABLES_FALSE@@HOST_WIN32_FALSE@run-eglib: +@DISABLE_EXECUTABLES_FALSE@@HOST_WIN32_FALSE@ srcdir="$(abs_srcdir)" ./test-eglib run-both: run-eglib +check-local: run-both + # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: diff --git a/mono/eglib/test/file.c b/mono/eglib/test/file.c index feb8d9b5a9..88023c345a 100644 --- a/mono/eglib/test/file.c +++ b/mono/eglib/test/file.c @@ -174,7 +174,7 @@ test_file (void) return FAILED ("3 %s should not be a symlink", path); #ifndef G_OS_WIN32 /* FIXME */ - sympath = g_strconcat (path, "-link", NULL); + sympath = g_strconcat (path, "-link", (const char*)NULL); ignored = symlink (path, sympath); res = g_file_test (sympath, G_FILE_TEST_EXISTS); if (!res) diff --git a/mono/eglib/test/module.c b/mono/eglib/test/module.c index 75000c55ee..94b8340b0e 100644 --- a/mono/eglib/test/module.c +++ b/mono/eglib/test/module.c @@ -14,6 +14,15 @@ #define EXTERNAL_SYMBOL "system" #endif +#if _WIN32 +#ifndef PSAPI_VERSION +#define PSAPI_VERSION 2 // Use the Windows 7 or newer version more directly. +#endif +#include +#include +#include +#endif + void G_MODULE_EXPORT dummy_test_export (void); @@ -57,8 +66,100 @@ test_module_symbol_null (void) return OK; } +static RESULT +test_module_get_module_filename (void) +{ +#if _WIN32 + const HMODULE mods [ ] = {NULL, LoadLibraryW (L"msvcrt.dll"), (HMODULE)(gssize)-1 }; + + for (int i = 0; i < G_N_ELEMENTS (mods); ++i) { + const HMODULE mod = mods [i]; + for (int j = 0; j <= 2; ++j) { + wchar_t* str = { 0 }; + guint32 length = { 0 }; + wchar_t buf2 [999] = { 0 }; + wchar_t buf3 [2] = { 0 }; + gboolean success = { 0 }; + guint32 length2 = { 0 }; + gboolean success2 = { 0 }; + guint32 length3 = { 0 }; + gboolean success3 = { 0 }; + + switch (j) { + case 0: + success = mono_get_module_filename (mod, &str, &length); + length2 = GetModuleFileNameW (mod, buf2, G_N_ELEMENTS (buf2)); // large buf + length3 = GetModuleFileNameW (mod, buf3, 1); // small buf + break; + case 1: + success = mono_get_module_filename_ex (GetCurrentProcess (), mods [i], &str, &length); + length2 = GetModuleFileNameExW (GetCurrentProcess (), mod, buf2, G_N_ELEMENTS (buf2)); // large buf + length3 = GetModuleFileNameExW (GetCurrentProcess (), mod, buf3, 1); // small buf + break; + case 2: + success = mono_get_module_basename (GetCurrentProcess (), mod, &str, &length); + length2 = GetModuleBaseNameW (GetCurrentProcess (), mod, buf2, G_N_ELEMENTS (buf2)); // large buf + length3 = GetModuleBaseNameW (GetCurrentProcess (), mod, buf3, 1); // small buf + break; + } + success2 = length2 && length2 < G_N_ELEMENTS (buf2); + success3 = length3 == 1; + printf ("j:%d s:%X s2:%X s3:%X l:%u l2:%u l3:%u str:%X b2:%X b3:%X\n", + j, + success, success2, success3, + length, length2, length3, + str ? str [0] : 0, buf2 [0], buf3 [0]); + g_assert (success == success2); + g_assert (success == success3 || j > 0); + g_assert (!success || str [0] == buf2 [0]); + //g_assert (!success || str [0] == buf3 [0]); + g_assert (length3 == 0 || length3 == 1); + g_assert (length == (success2 ? wcslen (buf2) :0)); + g_assert (!success || !wcscmp (str, buf2)); + g_assert (!success || str); + if (success) + printf ("%p %ls %ls %d %d\n", mod, str, buf2, length, length2); + else + printf ("!%p %u\n", str, (guint)length); + g_free (str); + } + } +#endif + return OK; +} + +static RESULT +test_get_current_directory (void) +{ +#if _WIN32 + wchar_t* str = { 0 }; + guint32 length = { 0 }; + gboolean success = mono_get_current_directory (&str, &length); + wchar_t buf2 [999] = { 0 }; + const int length2 = GetCurrentDirectoryW (G_N_ELEMENTS (buf2), buf2); + const gboolean success2 = length2 && length2 < G_N_ELEMENTS (buf2); + wchar_t buf3 [2] = { 0 }; + const int length3 = GetCurrentDirectoryW (G_N_ELEMENTS (buf3), buf3); + const gboolean success3 = length3 > 0; + printf ("s:%X s2:%X s3:%X str:%X b2:%X b3:%X\n", success, success2, success3, str ? str [0] : 0, buf2 [0], buf3 [0]); + g_assert (length == length2); + g_assert (success == success2); + g_assert (success == success3); + g_assert (!success || !wcscmp (str, buf2)); + g_assert (!success || str); + if (success) + printf ("%ls\n%ls\n", str, buf2); + else + printf ("!%p %u\n", str, (guint)length); + g_free (str); +#endif + return OK; +} + static Test module_tests [] = { {"g_module_symbol_null", test_module_symbol_null}, + {"module_get_module_filename", test_module_get_module_filename}, + {"get_current_directory", test_get_current_directory}, {NULL, NULL} }; diff --git a/mono/eglib/test/path.c b/mono/eglib/test/path.c index 20d4626863..bd62bb7d78 100644 --- a/mono/eglib/test/path.c +++ b/mono/eglib/test/path.c @@ -23,80 +23,80 @@ test_buildpath (void) const char *buffer = "var/private"; const char *dir = "/"; - s = g_build_path ("/", "hola///", "//mundo", NULL); + s = g_build_path ("/", "hola///", "//mundo", (const char*)NULL); if (strcmp (s, "hola/mundo") != 0) return FAILED ("1 Got wrong result, got: %s", s); g_free (s); - s = g_build_path ("/", "hola/", "/mundo", NULL); + s = g_build_path ("/", "hola/", "/mundo", (const char*)NULL); if (strcmp (s, "hola/mundo") != 0) return FAILED ("2 Got wrong result, got: %s", s); g_free (s); - s = g_build_path ("/", "hola/", "mundo", NULL); + s = g_build_path ("/", "hola/", "mundo", (const char*)NULL); if (strcmp (s, "hola/mundo") != 0) return FAILED ("3 Got wrong result, got: %s", s); g_free (s); - s = g_build_path ("/", "hola", "/mundo", NULL); + s = g_build_path ("/", "hola", "/mundo", (const char*)NULL); if (strcmp (s, "hola/mundo") != 0) return FAILED ("4 Got wrong result, got: %s", s); g_free (s); - s = g_build_path ("/", "/hello", "world/", NULL); + s = g_build_path ("/", "/hello", "world/", (const char*)NULL); if (strcmp (s, "/hello/world/") != 0) return FAILED ("5 Got wrong result, got: %s", s); g_free (s); /* Now test multi-char-separators */ - s = g_build_path ("**", "hello", "world", NULL); + s = g_build_path ("**", "hello", "world", (const char*)NULL); if (strcmp (s, "hello**world") != 0) return FAILED ("6 Got wrong result, got: %s", s); g_free (s); - s = g_build_path ("**", "hello**", "world", NULL); + s = g_build_path ("**", "hello**", "world", (const char*)NULL); if (strcmp (s, "hello**world") != 0) return FAILED ("7 Got wrong result, got: %s", s); g_free (s); - s = g_build_path ("**", "hello**", "**world", NULL); + s = g_build_path ("**", "hello**", "**world", (const char*)NULL); if (strcmp (s, "hello**world") != 0) return FAILED ("8 Got wrong result, got: %s", s); g_free (s); - s = g_build_path ("**", "hello**", "**world", NULL); + s = g_build_path ("**", "hello**", "**world", (const char*)NULL); if (strcmp (s, "hello**world") != 0) return FAILED ("9 Got wrong result, got: %s", s); g_free (s); - s = g_build_path ("1234567890", "hello", "world", NULL); + s = g_build_path ("1234567890", "hello", "world", (const char*)NULL); if (strcmp (s, "hello1234567890world") != 0) return FAILED ("10 Got wrong result, got: %s", s); g_free (s); - s = g_build_path ("1234567890", "hello1234567890", "1234567890world", NULL); + s = g_build_path ("1234567890", "hello1234567890", "1234567890world", (const char*)NULL); if (strcmp (s, "hello1234567890world") != 0) return FAILED ("11 Got wrong result, got: %s", s); g_free (s); - s = g_build_path ("1234567890", "hello12345678901234567890", "1234567890world", NULL); + s = g_build_path ("1234567890", "hello12345678901234567890", "1234567890world", (const char*)NULL); if (strcmp (s, "hello1234567890world") != 0) return FAILED ("12 Got wrong result, got: %s", s); g_free (s); /* Multiple */ - s = g_build_path ("/", "a", "b", "c", "d", NULL); + s = g_build_path ("/", "a", "b", "c", "d", (const char*)NULL); if (strcmp (s, "a/b/c/d") != 0) return FAILED ("13 Got wrong result, got: %s", s); g_free (s); - s = g_build_path ("/", "/a", "", "/c/", NULL); + s = g_build_path ("/", "/a", "", "/c/", (const char*)NULL); if (strcmp (s, "/a/c/") != 0) return FAILED ("14 Got wrong result, got: %s", s); g_free (s); /* Null */ - s = g_build_path ("/", NULL, NULL); + s = g_build_path ("/", NULL, (const char*)NULL); if (s == NULL) return FAILED ("must get a non-NULL return"); if (s [0] != 0) @@ -107,7 +107,7 @@ test_buildpath (void) // and caused all kinds of random errors. dir = "//"; dir++; - s = g_build_filename (dir, buffer, NULL); + s = g_build_filename (dir, buffer, (const char*)NULL); if (s [0] != '/') return FAILED ("Must have a '/' at the start"); @@ -120,7 +120,7 @@ test_buildfname (void) { char *s; - s = g_build_filename ("a", "b", "c", "d", NULL); + s = g_build_filename ("a", "b", "c", "d", (const char*)NULL); #ifdef G_OS_WIN32 if (strcmp (s, "a\\b\\c\\d") != 0) #else @@ -130,16 +130,16 @@ test_buildfname (void) g_free (s); #ifdef G_OS_WIN32 - s = g_build_filename ("C:\\", "a", NULL); + s = g_build_filename ("C:\\", "a", (const char*)NULL); if (strcmp (s, "C:\\a") != 0) #else - s = g_build_filename ("/", "a", NULL); + s = g_build_filename ("/", "a", (const char*)NULL); if (strcmp (s, "/a") != 0) #endif return FAILED ("1 Got wrong result, got: %s", s); #ifndef G_OS_WIN32 - s = g_build_filename ("/", "foo", "/bar", "tolo/", "/meo/", NULL); + s = g_build_filename ("/", "foo", "/bar", "tolo/", "/meo/", (const char*)NULL); if (strcmp (s, "/foo/bar/tolo/meo/") != 0) return FAILED ("1 Got wrong result, got: %s", s); #endif diff --git a/mono/eglib/test/string-util.c b/mono/eglib/test/string-util.c index 7b5b7af32c..fb447229ef 100644 --- a/mono/eglib/test/string-util.c +++ b/mono/eglib/test/string-util.c @@ -22,7 +22,7 @@ test_strfreev (void) static RESULT test_concat (void) { - gchar *x = g_strconcat ("Hello", ", ", "world", NULL); + gchar *x = g_strconcat ("Hello", ", ", "world", (const char*)NULL); if (strcmp (x, "Hello, world") != 0) return FAILED("concat failed, got: %s", x); g_free (x); @@ -344,27 +344,27 @@ test_strjoin (void) { char *s; - s = g_strjoin (NULL, "a", "b", NULL); + s = g_strjoin (NULL, "a", "b", (const char*)NULL); if (strcmp (s, "ab") != 0) return FAILED ("Join of two strings with no separator fails"); g_free (s); - s = g_strjoin ("", "a", "b", NULL); + s = g_strjoin ("", "a", "b", (const char*)NULL); if (strcmp (s, "ab") != 0) return FAILED ("Join of two strings with empty separator fails"); g_free (s); - s = g_strjoin ("-", "a", "b", NULL); + s = g_strjoin ("-", "a", "b", (const char*)NULL); if (strcmp (s, "a-b") != 0) return FAILED ("Join of two strings with separator fails"); g_free (s); - s = g_strjoin ("-", "aaaa", "bbbb", "cccc", "dddd", NULL); + s = g_strjoin ("-", "aaaa", "bbbb", "cccc", "dddd", (const char*)NULL); if (strcmp (s, "aaaa-bbbb-cccc-dddd") != 0) return FAILED ("Join of multiple strings fails"); g_free (s); - s = g_strjoin ("-", NULL); + s = g_strjoin ("-", (const char*)NULL); if (s == NULL || (strcmp (s, "") != 0)) return FAILED ("Failed to join empty arguments"); g_free (s); @@ -624,12 +624,12 @@ test_ascii_strncasecmp (void) return FAILED ("Should have been 0"); n = g_ascii_strncasecmp ("423", "123", 1); - if (n != 3) - return FAILED ("Should have been 3, got %d", n); + if (n <= 0) + return FAILED ("Should have been > 0, got %d", n); n = g_ascii_strncasecmp ("123", "423", 1); - if (n != -3) - return FAILED ("Should have been -3, got %d", n); + if (n >= 0) + return FAILED ("Should have been < 0, got %d", n); n = g_ascii_strncasecmp ("1", "1", 10); if (n != 0) diff --git a/mono/metadata/Makefile.am b/mono/metadata/Makefile.am index 2d7cca46cf..0ca4f7a5fc 100644 --- a/mono/metadata/Makefile.am +++ b/mono/metadata/Makefile.am @@ -1,5 +1,7 @@ include $(top_srcdir)/mk/common.mk +if !ENABLE_MSVC_ONLY + if HOST_WIN32 win32_sources = \ console-win32.c \ @@ -336,7 +338,6 @@ common_sources = \ mono-perfcounters-def.h \ mono-ptr-array.h \ mono-route.c \ - mono-route.h \ monitor.h \ normalization-tables.h \ number-formatter.h \ @@ -376,6 +377,7 @@ common_sources = \ threads-types.h \ threadpool.c \ threadpool.h \ + threadpool-netcore.c \ threadpool-worker.h \ threadpool-io.c \ threadpool-io.h \ @@ -446,10 +448,14 @@ sgen_sources = \ sgen-mono.h \ sgen-client-mono.h +endif # !ENABLE_MSVC_ONLY + # Per-library to workaround CoreFX/native until/unless https://github.com/dotnet/corefx/pull/31342. #CFLAGS := $(filter-out @CXX_REMOVE_CFLAGS@, @CFLAGS@) @CXX_ADD_CFLAGS@ CFLAGS := $(filter-out @CXX_REMOVE_CFLAGS@, @CFLAGS@) +if !ENABLE_MSVC_ONLY + libmonoruntime_la_SOURCES = $(common_sources) $(icall_tables_sources) $(ilgen_sources) $(gc_dependent_sources) $(null_gc_sources) $(boehm_sources) # Add CXX_ADD_CFLAGS per-library until/unless https://github.com/dotnet/corefx/pull/31342. libmonoruntime_la_CFLAGS = $(BOEHM_DEFINES) @CXX_ADD_CFLAGS@ @@ -460,6 +466,8 @@ libmonoruntimesgen_la_SOURCES = $(common_sources) $(icall_tables_sources) $(ilge libmonoruntimesgen_la_CFLAGS = $(SGEN_DEFINES) @CXX_ADD_CFLAGS@ libmonoruntimesgen_la_LIBADD = libmonoruntime-config.la libmonoruntime-support.la +endif # !ENABLE_MSVC_ONLY + libmonoruntimeincludedir = $(includedir)/mono-$(API_VER)/mono/metadata # This list is sorted for easier searching. @@ -494,6 +502,22 @@ libmonoruntimeinclude_HEADERS = \ tokentype.h \ verify.h +if !ENABLE_MSVC_ONLY + EXTRA_DIST = $(null_sources) \ external-only.c \ threadpool-io-poll.c threadpool-io-epoll.c threadpool-io-kqueue.c + +endif # !ENABLE_MSVC_ONLY + +if ENABLE_MSVC_ONLY + +all-local: + + make -C $(top_srcdir)/msvc libmonoruntime + +clean-local: + + make -C $(top_srcdir)/msvc clean-libmonoruntime + +endif # ENABLE_MSVC_ONLY diff --git a/mono/metadata/Makefile.in.REMOVED.git-id b/mono/metadata/Makefile.in.REMOVED.git-id index d8dda21aa7..34be423ba4 100644 --- a/mono/metadata/Makefile.in.REMOVED.git-id +++ b/mono/metadata/Makefile.in.REMOVED.git-id @@ -1 +1 @@ -8ab54e44f984de3b1822772daa64ce40a6c423c3 \ No newline at end of file +b9c8e398458b79f24d4fa97300b2d430d23efd95 \ No newline at end of file diff --git a/mono/metadata/appdomain.c b/mono/metadata/appdomain.c deleted file mode 100644 index c41c1a43d3..0000000000 --- a/mono/metadata/appdomain.c +++ /dev/null @@ -1,3348 +0,0 @@ -/** - * \file - * AppDomain functions - * - * Authors: - * Dietmar Maurer (dietmar@ximian.com) - * Patrik Torstensson - * Gonzalo Paniagua Javier (gonzalo@ximian.com) - * - * Copyright 2001-2003 Ximian, Inc (http://www.ximian.com) - * Copyright 2004-2009 Novell, Inc (http://www.novell.com) - * Copyright 2012 Xamarin Inc - * Licensed under the MIT license. See LICENSE file in the project root for full license information. - */ -#undef ASSEMBLY_LOAD_DEBUG -#include -#include -#include -#include -#include -#include -#include -#ifdef HAVE_SYS_TIME_H -#include -#endif -#ifdef HAVE_UNISTD_H -#include -#endif -#ifdef HAVE_UTIME_H -#include -#else -#ifdef HAVE_SYS_UTIME_H -#include -#endif -#endif - -#include -#include -#include -#include -#include -#include "mono/metadata/metadata-internals.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#ifdef HOST_WIN32 -#include -#endif -#include "object-internals.h" -#include "icall-decl.h" - -typedef struct -{ - int runtime_count; - int assemblybinding_count; - MonoDomain *domain; - gchar *filename; -} RuntimeConfig; - -static gunichar2 process_guid [36]; -static gboolean process_guid_set = FALSE; - -static gboolean no_exec = FALSE; - -#ifdef ENABLE_NETCORE -static int n_appctx_props; -static char **appctx_keys; -static char **appctx_values; -#endif - -static const char * -mono_check_corlib_version_internal (void); - -static MonoAssembly * -mono_domain_assembly_preload (MonoAssemblyLoadContext *alc, - MonoAssemblyName *aname, - gchar **assemblies_path, - gboolean refonly, - gpointer user_data, - MonoError *error); - -static MonoAssembly * -mono_domain_assembly_search (MonoAssemblyLoadContext *alc, MonoAssembly *requesting, - MonoAssemblyName *aname, - gboolean refonly, - gboolean postload, - gpointer user_data, - MonoError *error); - - -static void -mono_domain_fire_assembly_load (MonoAssembly *assembly, gpointer user_data); - -static gboolean -mono_domain_asmctx_from_path (const char *fname, MonoAssembly *requesting_assembly, gpointer user_data, MonoAssemblyContextKind *out_asmctx); - -static void -add_assemblies_to_domain (MonoDomain *domain, MonoAssembly *ass, GHashTable *hash); - -static void -add_assembly_to_alc (MonoAssemblyLoadContext *alc, MonoAssembly *ass); - -static MonoAppDomainHandle -mono_domain_create_appdomain_internal (char *friendly_name, MonoAppDomainSetupHandle setup, MonoError *error); - -static MonoDomain * -mono_domain_create_appdomain_checked (char *friendly_name, char *configuration_file, MonoError *error); - - -static void -mono_context_set_default_context (MonoDomain *domain); - -static char * -get_shadow_assembly_location_base (MonoDomain *domain, MonoError *error); - -static MonoLoadFunc load_function = NULL; - -/* Lazy class loading functions */ -static GENERATE_GET_CLASS_WITH_CACHE (assembly, "System.Reflection", "Assembly"); - -GENERATE_GET_CLASS_WITH_CACHE (appdomain, MONO_APPDOMAIN_CLASS_NAME_SPACE, MONO_APPDOMAIN_CLASS_NAME); -GENERATE_GET_CLASS_WITH_CACHE (appdomain_setup, MONO_APPDOMAIN_SETUP_CLASS_NAME_SPACE, MONO_APPDOMAIN_SETUP_CLASS_NAME); - -static MonoDomain * -mono_domain_from_appdomain_handle (MonoAppDomainHandle appdomain); - -static void -mono_error_set_appdomain_unloaded (MonoError *error) -{ - mono_error_set_generic_error (error, "System", "AppDomainUnloadedException", ""); -} - -void -mono_install_runtime_load (MonoLoadFunc func) -{ - load_function = func; -} - -MonoDomain* -mono_runtime_load (const char *filename, const char *runtime_version) -{ - g_assert (load_function); - return load_function (filename, runtime_version); -} - -/** - * mono_runtime_set_no_exec: - * - * Instructs the runtime to operate in static mode, i.e. avoid/do not - * allow managed code execution. This is useful for running the AOT - * compiler on platforms which allow full-aot execution only. This - * should be called before mono_runtime_init (). - */ -void -mono_runtime_set_no_exec (gboolean val) -{ - no_exec = val; -} - -/** - * mono_runtime_get_no_exec: - * - * If true, then the runtime will not allow managed code execution. - */ -gboolean -mono_runtime_get_no_exec (void) -{ - return no_exec; -} - -static void -create_domain_objects (MonoDomain *domain) -{ - HANDLE_FUNCTION_ENTER (); - ERROR_DECL (error); - - MonoDomain *old_domain = mono_domain_get (); - MonoStringHandle arg; - MonoVTable *string_vt; - MonoClassField *string_empty_fld; - - if (domain != old_domain) { - mono_thread_push_appdomain_ref (domain); - mono_domain_set_internal_with_options (domain, FALSE); - } - - /* - * Initialize String.Empty. This enables the removal of - * the static cctor of the String class. - */ - string_vt = mono_class_vtable_checked (domain, mono_defaults.string_class, error); - mono_error_assert_ok (error); - string_empty_fld = mono_class_get_field_from_name_full (mono_defaults.string_class, "Empty", NULL); - g_assert (string_empty_fld); - MonoStringHandle empty_str = mono_string_new_handle (domain, "", error); - mono_error_assert_ok (error); - empty_str = mono_string_intern_checked (empty_str, error); - mono_error_assert_ok (error); - mono_field_static_set_value_internal (string_vt, string_empty_fld, MONO_HANDLE_RAW (empty_str)); - domain->empty_string = MONO_HANDLE_RAW (empty_str); - - /* - * Create an instance early since we can't do it when there is no memory. - */ - arg = mono_string_new_handle (domain, "Out of memory", error); - mono_error_assert_ok (error); - domain->out_of_memory_ex = MONO_HANDLE_RAW (mono_exception_from_name_two_strings_checked (mono_defaults.corlib, "System", "OutOfMemoryException", arg, NULL_HANDLE_STRING, error)); - mono_error_assert_ok (error); - - /* - * These two are needed because the signal handlers might be executing on - * an alternate stack, and Boehm GC can't handle that. - */ - arg = mono_string_new_handle (domain, "A null value was found where an object instance was required", error); - mono_error_assert_ok (error); - domain->null_reference_ex = MONO_HANDLE_RAW (mono_exception_from_name_two_strings_checked (mono_defaults.corlib, "System", "NullReferenceException", arg, NULL_HANDLE_STRING, error)); - mono_error_assert_ok (error); - arg = mono_string_new_handle (domain, "The requested operation caused a stack overflow.", error); - mono_error_assert_ok (error); - domain->stack_overflow_ex = MONO_HANDLE_RAW (mono_exception_from_name_two_strings_checked (mono_defaults.corlib, "System", "StackOverflowException", arg, NULL_HANDLE_STRING, error)); - mono_error_assert_ok (error); - - /*The ephemeron tombstone i*/ - domain->ephemeron_tombstone = MONO_HANDLE_RAW (mono_object_new_handle (domain, mono_defaults.object_class, error)); - mono_error_assert_ok (error); - - if (domain != old_domain) { - mono_thread_pop_appdomain_ref (); - mono_domain_set_internal_with_options (old_domain, FALSE); - } - - /* - * This class is used during exception handling, so initialize it here, to prevent - * stack overflows while handling stack overflows. - */ - mono_class_init_internal (mono_class_create_array (mono_defaults.int_class, 1)); - HANDLE_FUNCTION_RETURN (); -} - -/** - * mono_runtime_init: - * \param domain domain returned by \c mono_init - * - * Initialize the core AppDomain: this function will run also some - * IL initialization code, so it needs the execution engine to be fully - * operational. - * - * \c AppDomain.SetupInformation is set up in \c mono_runtime_exec_main, where - * we know the \c entry_assembly. - * - */ -void -mono_runtime_init (MonoDomain *domain, MonoThreadStartCB start_cb, MonoThreadAttachCB attach_cb) -{ - ERROR_DECL (error); - mono_runtime_init_checked (domain, start_cb, attach_cb, error); - mono_error_cleanup (error); -} - -void -mono_runtime_init_checked (MonoDomain *domain, MonoThreadStartCB start_cb, MonoThreadAttachCB attach_cb, MonoError *error) -{ - HANDLE_FUNCTION_ENTER (); - - MonoAppDomainSetupHandle setup; - MonoAppDomainHandle ad; - - error_init (error); - - mono_portability_helpers_init (); - - mono_gc_base_init (); - mono_monitor_init (); - mono_marshal_init (); - mono_gc_init_icalls (); - - mono_install_assembly_preload_hook_v2 (mono_domain_assembly_preload, GUINT_TO_POINTER (FALSE), FALSE); - mono_install_assembly_preload_hook_v2 (mono_domain_assembly_preload, GUINT_TO_POINTER (TRUE), TRUE); - mono_install_assembly_search_hook_v2 (mono_domain_assembly_search, GUINT_TO_POINTER (FALSE), FALSE, FALSE); - mono_install_assembly_search_hook_v2 (mono_domain_assembly_search, GUINT_TO_POINTER (TRUE), TRUE, FALSE); - mono_install_assembly_search_hook_v2 (mono_domain_assembly_postload_search, GUINT_TO_POINTER (FALSE), FALSE, TRUE); - mono_install_assembly_search_hook_v2 (mono_domain_assembly_postload_search, GUINT_TO_POINTER (TRUE), TRUE, TRUE); - mono_install_assembly_load_hook (mono_domain_fire_assembly_load, NULL); - mono_install_assembly_asmctx_from_path_hook (mono_domain_asmctx_from_path, NULL); - - mono_thread_init (start_cb, attach_cb); - - if (!mono_runtime_get_no_exec ()) { - MonoClass *klass = mono_class_get_appdomain_setup_class (); - setup = MONO_HANDLE_CAST (MonoAppDomainSetup, mono_object_new_pinned_handle (domain, klass, error)); - goto_if_nok (error, exit); - - klass = mono_class_get_appdomain_class (); - - ad = MONO_HANDLE_CAST (MonoAppDomain, mono_object_new_pinned_handle (domain, klass, error)); - goto_if_nok (error, exit); - - MONO_HANDLE_SETVAL (ad, data, MonoDomain*, domain); - domain->domain = MONO_HANDLE_RAW (ad); - domain->setup = MONO_HANDLE_RAW (setup); - } - - mono_thread_attach (domain); - - mono_type_initialization_init (); - - if (!mono_runtime_get_no_exec ()) - create_domain_objects (domain); - - /* GC init has to happen after thread init */ - mono_gc_init (); - - /* contexts use GC handles, so they must be initialized after the GC */ -#ifndef ENABLE_NETCORE - mono_context_init_checked (domain, error); - goto_if_nok (error, exit); - mono_context_set_default_context (domain); -#endif - -#ifdef ENABLE_NETCORE - if (!mono_runtime_get_no_exec ()) - mono_runtime_install_appctx_properties (); -#endif - -#ifndef DISABLE_SOCKETS - mono_network_init (); -#endif - - mono_console_init (); - mono_attach_init (); - - mono_locks_tracer_init (); - - /* mscorlib is loaded before we install the load hook */ - mono_domain_fire_assembly_load (mono_defaults.corlib->assembly, NULL); - -exit: - HANDLE_FUNCTION_RETURN (); -} - -static void -mono_context_set_default_context (MonoDomain *domain) -{ - if (mono_runtime_get_no_exec ()) - return; - - HANDLE_FUNCTION_ENTER (); - mono_context_set_handle (MONO_HANDLE_NEW (MonoAppContext, domain->default_context)); - HANDLE_FUNCTION_RETURN (); -} - -static char* -mono_get_corlib_version (void) -{ - ERROR_DECL (error); - - MonoClass *klass; - MonoClassField *field; - - klass = mono_class_load_from_name (mono_defaults.corlib, "System", "Environment"); - mono_class_init_internal (klass); - field = mono_class_get_field_from_name_full (klass, "mono_corlib_version", NULL); - if (!field) - return NULL; - - if (! (field->type->attrs & (FIELD_ATTRIBUTE_STATIC | FIELD_ATTRIBUTE_LITERAL))) - return NULL; - - char *value; - MonoTypeEnum field_type; - const char *data = mono_class_get_field_default_value (field, &field_type); - if (field_type != MONO_TYPE_STRING) - return NULL; - mono_metadata_read_constant_value (data, field_type, &value, error); - mono_error_assert_ok (error); - - char *res = mono_string_from_blob (value, error); - mono_error_assert_ok (error); - - return res; -} - -/** - * mono_check_corlib_version: - * Checks that the corlib that is loaded matches the version of this runtime. - * \returns NULL if the runtime will work with the corlib, or a \c g_malloc - * allocated string with the error otherwise. - */ -const char* -mono_check_corlib_version (void) -{ - const char* res; - MONO_ENTER_GC_UNSAFE; - res = mono_check_corlib_version_internal (); - MONO_EXIT_GC_UNSAFE; - return res; -} - -static const char * -mono_check_corlib_version_internal (void) -{ -#if defined(MONO_CROSS_COMPILE) - /* Can't read the corlib version because we only have the target class layouts */ - return NULL; -#endif - - char *result = NULL; - char *version = mono_get_corlib_version (); - if (!version) { - result = g_strdup_printf ("expected corlib string (%s) but not found or not string", MONO_CORLIB_VERSION); - goto exit; - } - if (strcmp (version, MONO_CORLIB_VERSION) != 0) { - result = g_strdup_printf ("The runtime did not find the mscorlib.dll it expected. " - "Expected interface version %s but found %s. Check that " - "your runtime and class libraries are matching.", - MONO_CORLIB_VERSION, version); - goto exit; - } - - /* Check that the managed and unmanaged layout of MonoInternalThread matches */ - guint32 native_offset; - guint32 managed_offset; - native_offset = (guint32) MONO_STRUCT_OFFSET (MonoInternalThread, last); - managed_offset = mono_field_get_offset (mono_class_get_field_from_name_full (mono_defaults.internal_thread_class, "last", NULL)); - if (native_offset != managed_offset) - result = g_strdup_printf ("expected InternalThread.last field offset %u, found %u. See InternalThread.last comment", native_offset, managed_offset); -exit: - g_free (version); - return result; -} - -/** - * mono_context_init: - * \param domain The domain where the \c System.Runtime.Remoting.Context.Context is initialized - * Initializes the \p domain's default \c System.Runtime.Remoting 's Context. - */ -void -mono_context_init (MonoDomain *domain) -{ - ERROR_DECL (error); - mono_context_init_checked (domain, error); - mono_error_cleanup (error); -} - -void -mono_context_init_checked (MonoDomain *domain, MonoError *error) -{ - HANDLE_FUNCTION_ENTER (); - - MonoClass *klass; - MonoAppContextHandle context; - - error_init (error); - if (mono_runtime_get_no_exec ()) - goto exit; - - klass = mono_class_load_from_name (mono_defaults.corlib, "System.Runtime.Remoting.Contexts", "Context"); - context = MONO_HANDLE_CAST (MonoAppContext, mono_object_new_pinned_handle (domain, klass, error)); - goto_if_nok (error, exit); - - MONO_HANDLE_SETVAL (context, domain_id, gint32, domain->domain_id); - MONO_HANDLE_SETVAL (context, context_id, gint32, 0); - mono_threads_register_app_context (context, error); - mono_error_assert_ok (error); - domain->default_context = MONO_HANDLE_RAW (context); -exit: - HANDLE_FUNCTION_RETURN (); -} - -/** - * mono_runtime_cleanup: - * \param domain unused. - * - * Internal routine. - * - * This must not be called while there are still running threads executing - * managed code. - */ -void -mono_runtime_cleanup (MonoDomain *domain) -{ - mono_attach_cleanup (); - - /* This ends up calling any pending pending (for at most 2 seconds) */ - mono_gc_cleanup (); - - mono_thread_cleanup (); - -#ifndef DISABLE_SOCKETS - mono_network_cleanup (); -#endif - mono_marshal_cleanup (); - - mono_type_initialization_cleanup (); - - mono_monitor_cleanup (); -} - -static MonoDomainFunc quit_function = NULL; - -/** - * mono_install_runtime_cleanup: - */ -void -mono_install_runtime_cleanup (MonoDomainFunc func) -{ - quit_function = func; -} - -/** - * mono_runtime_quit: - */ -void -mono_runtime_quit () -{ - if (quit_function != NULL) - quit_function (mono_get_root_domain (), NULL); -} - -/** - * mono_domain_create_appdomain: - * \param friendly_name The friendly name of the appdomain to create - * \param configuration_file The configuration file to initialize the appdomain with - * \returns a \c MonoDomain initialized with the appdomain - */ -MonoDomain * -mono_domain_create_appdomain (char *friendly_name, char *configuration_file) -{ - HANDLE_FUNCTION_ENTER (); - MonoDomain *domain; - MONO_ENTER_GC_UNSAFE; - ERROR_DECL (error); - domain = mono_domain_create_appdomain_checked (friendly_name, configuration_file, error); - mono_error_cleanup (error); - MONO_EXIT_GC_UNSAFE; - HANDLE_FUNCTION_RETURN_VAL (domain); -} - -/** - * mono_domain_create_appdomain_checked: - * \param friendly_name The friendly name of the appdomain to create - * \param configuration_file The configuration file to initialize the appdomain with - * \param error Set on error. - * - * \returns a MonoDomain initialized with the appdomain. On failure sets \p error and returns NULL. - */ -MonoDomain * -mono_domain_create_appdomain_checked (char *friendly_name, char *configuration_file, MonoError *error) -{ - HANDLE_FUNCTION_ENTER (); - error_init (error); - MonoDomain *result = NULL; - - MonoClass *klass = mono_class_get_appdomain_setup_class (); - MonoAppDomainSetupHandle setup = MONO_HANDLE_CAST (MonoAppDomainSetup, mono_object_new_handle (mono_domain_get (), klass, error)); - goto_if_nok (error, leave); - MonoStringHandle config_file; - if (configuration_file != NULL) { - config_file = mono_string_new_handle (mono_domain_get (), configuration_file, error); - goto_if_nok (error, leave); - } else { - config_file = MONO_HANDLE_NEW (MonoString, NULL); - } - MONO_HANDLE_SET (setup, configuration_file, config_file); - - MonoAppDomainHandle ad; - ad = mono_domain_create_appdomain_internal (friendly_name, setup, error); - goto_if_nok (error, leave); - - result = mono_domain_from_appdomain_handle (ad); -leave: - HANDLE_FUNCTION_RETURN_VAL (result); -} - -/** - * mono_domain_set_config: - * \param domain \c MonoDomain initialized with the appdomain we want to change - * \param base_dir new base directory for the appdomain - * \param config_file_name path to the new configuration for the app domain - * - * Used to set the system configuration for an appdomain - * - * Without using this, embedded builds will get 'System.Configuration.ConfigurationErrorsException: - * Error Initializing the configuration system. ---> System.ArgumentException: - * The 'ExeConfigFilename' argument cannot be null.' for some managed calls. - */ -void -mono_domain_set_config (MonoDomain *domain, const char *base_dir, const char *config_file_name) -{ - HANDLE_FUNCTION_ENTER (); - MONO_ENTER_GC_UNSAFE; - ERROR_DECL (error); - mono_domain_set_config_checked (domain, base_dir, config_file_name, error); - mono_error_cleanup (error); - MONO_EXIT_GC_UNSAFE; - HANDLE_FUNCTION_RETURN (); -} - -gboolean -mono_domain_set_config_checked (MonoDomain *domain, const char *base_dir, const char *config_file_name, MonoError *error) -{ - error_init (error); - MonoAppDomainSetupHandle setup = MONO_HANDLE_NEW (MonoAppDomainSetup, domain->setup); - MonoStringHandle base_dir_str = mono_string_new_handle (domain, base_dir, error); - goto_if_nok (error, leave); - MONO_HANDLE_SET (setup, application_base, base_dir_str); - MonoStringHandle config_file_name_str; - config_file_name_str = mono_string_new_handle (domain, config_file_name, error); - goto_if_nok (error, leave); - MONO_HANDLE_SET (setup, configuration_file, config_file_name_str); -leave: - return is_ok (error); -} - -static MonoAppDomainSetupHandle -copy_app_domain_setup (MonoDomain *domain, MonoAppDomainSetupHandle setup, MonoError *error) -{ - HANDLE_FUNCTION_ENTER (); - MonoDomain *caller_domain; - MonoClass *ads_class; - MonoAppDomainSetupHandle result = MONO_HANDLE_NEW (MonoAppDomainSetup, NULL); - - error_init (error); - - caller_domain = mono_domain_get (); - ads_class = mono_class_get_appdomain_setup_class (); - - MonoAppDomainSetupHandle copy = MONO_HANDLE_CAST (MonoAppDomainSetup, mono_object_new_handle(domain, ads_class, error)); - goto_if_nok (error, leave); - - mono_domain_set_internal_with_options (domain, TRUE); - -#define XCOPY_FIELD(type, dst, field, src, error) \ - do { \ - TYPED_HANDLE_NAME (type) src_val = MONO_HANDLE_NEW_GET (type, (src), field); \ - TYPED_HANDLE_NAME (type) copied_val = MONO_HANDLE_CAST (type, mono_marshal_xdomain_copy_value_handle (MONO_HANDLE_CAST (MonoObject, src_val), error)); \ - goto_if_nok (error, leave); \ - MONO_HANDLE_SET ((dst),field,copied_val); \ - } while (0) - -#define COPY_VAL(dst,field,type,src) \ - do { \ - MONO_HANDLE_SETVAL ((dst), field, type, MONO_HANDLE_GETVAL ((src),field)); \ - } while (0) - - XCOPY_FIELD (MonoString, copy, application_base, setup, error); - XCOPY_FIELD (MonoString, copy, application_name, setup, error); - XCOPY_FIELD (MonoString, copy, cache_path, setup, error); - XCOPY_FIELD (MonoString, copy, configuration_file, setup, error); - XCOPY_FIELD (MonoString, copy, dynamic_base, setup, error); - XCOPY_FIELD (MonoString, copy, license_file, setup, error); - XCOPY_FIELD (MonoString, copy, private_bin_path, setup, error); - XCOPY_FIELD (MonoString, copy, private_bin_path_probe, setup, error); - XCOPY_FIELD (MonoString, copy, shadow_copy_directories, setup, error); - XCOPY_FIELD (MonoString, copy, shadow_copy_files, setup, error); - COPY_VAL (copy, publisher_policy, MonoBoolean, setup); - COPY_VAL (copy, path_changed, MonoBoolean, setup); - COPY_VAL (copy, loader_optimization, int, setup); - COPY_VAL (copy, disallow_binding_redirects, MonoBoolean, setup); - COPY_VAL (copy, disallow_code_downloads, MonoBoolean, setup); - XCOPY_FIELD (MonoArray, copy, domain_initializer_args, setup, error); - COPY_VAL (copy, disallow_appbase_probe, MonoBoolean, setup); - XCOPY_FIELD (MonoObject, copy, application_trust, setup, error); - XCOPY_FIELD (MonoArray, copy, configuration_bytes, setup, error); - XCOPY_FIELD (MonoArray, copy, serialized_non_primitives, setup, error); - -#undef XCOPY_FIELD -#undef COPY_VAL - - mono_domain_set_internal_with_options (caller_domain, TRUE); - - MONO_HANDLE_ASSIGN (result, copy); -leave: - HANDLE_FUNCTION_RETURN_REF (MonoAppDomainSetup, result); -} - -static MonoAppDomainHandle -mono_domain_create_appdomain_internal (char *friendly_name, MonoAppDomainSetupHandle setup, MonoError *error) -{ - HANDLE_FUNCTION_ENTER (); - MonoAppDomainHandle result = MONO_HANDLE_NEW (MonoAppDomain, NULL); - MonoClass *adclass; - MonoDomain *data; - - error_init (error); - - adclass = mono_class_get_appdomain_class (); - - /* FIXME: pin all those objects */ - data = mono_domain_create(); - - MonoAppDomainHandle ad = MONO_HANDLE_CAST (MonoAppDomain, mono_object_new_handle (data, adclass, error)); - goto_if_nok (error, leave); - MONO_HANDLE_SETVAL (ad, data, MonoDomain*, data); - data->domain = MONO_HANDLE_RAW (ad); - data->friendly_name = g_strdup (friendly_name); - - MONO_PROFILER_RAISE (domain_name, (data, data->friendly_name)); - - MonoStringHandle app_base; - app_base = MONO_HANDLE_NEW_GET (MonoString, setup, application_base); - if (MONO_HANDLE_IS_NULL (app_base)) { - /* Inherit from the root domain since MS.NET does this */ - MonoDomain *root = mono_get_root_domain (); - MonoAppDomainSetupHandle root_setup = MONO_HANDLE_NEW (MonoAppDomainSetup, root->setup); - MonoStringHandle root_app_base = MONO_HANDLE_NEW_GET (MonoString, root_setup, application_base); - if (!MONO_HANDLE_IS_NULL (root_app_base)) { - /* N.B. new string is in the new domain */ - uint32_t gchandle = mono_gchandle_from_handle (MONO_HANDLE_CAST (MonoObject, root_app_base), TRUE); - MonoStringHandle s = mono_string_new_utf16_handle (data, mono_string_chars_internal (MONO_HANDLE_RAW (root_app_base)), mono_string_handle_length (root_app_base), error); - mono_gchandle_free_internal (gchandle); - if (!is_ok (error)) { - g_free (data->friendly_name); - goto leave; - } - MONO_HANDLE_SET (setup, application_base, s); - } - } - - mono_context_init_checked (data, error); - goto_if_nok (error, leave); - - data->setup = MONO_HANDLE_RAW (copy_app_domain_setup (data, setup, error)); - if (!mono_error_ok (error)) { - g_free (data->friendly_name); - goto leave; - } - - mono_domain_set_options_from_config (data); - add_assemblies_to_domain (data, mono_defaults.corlib->assembly, NULL); - -#ifndef DISABLE_SHADOW_COPY - /*FIXME, guard this for when the debugger is not running */ - char *shadow_location; - shadow_location = get_shadow_assembly_location_base (data, error); - if (!mono_error_ok (error)) { - g_free (data->friendly_name); - goto leave; - } - - g_free (shadow_location); -#endif - - create_domain_objects (data); - - MONO_HANDLE_ASSIGN (result, ad); -leave: - HANDLE_FUNCTION_RETURN_REF (MonoAppDomain, result); -} - -/** - * mono_domain_has_type_resolve: - * \param domain application domain being looked up - * - * \returns TRUE if the \c AppDomain.TypeResolve field has been set. - */ -gboolean -mono_domain_has_type_resolve (MonoDomain *domain) -{ -#ifdef ENABLE_NETCORE - return FALSE; -#else - static MonoClassField *field = NULL; - MonoObject *o; - - if (field == NULL) { - field = mono_class_get_field_from_name_full (mono_defaults.appdomain_class, "TypeResolve", NULL); - g_assert (field); - } - - /*pedump doesn't create an appdomin, so the domain object doesn't exist.*/ - if (!domain->domain) - return FALSE; - - mono_field_get_value_internal ((MonoObject*)(domain->domain), field, &o); - return o != NULL; -#endif -} - -/** - * mono_domain_try_type_resolve: - * \param domain application domain in which to resolve the type - * \param name the name of the type to resolve or NULL. - * \param typebuilder A \c System.Reflection.Emit.TypeBuilder, used if name is NULL. - * - * This routine invokes the internal \c System.AppDomain.DoTypeResolve and returns - * the assembly that matches name, or ((TypeBuilder)typebuilder).FullName. - * - * \returns A \c MonoReflectionAssembly or NULL if not found - */ -MonoReflectionAssembly * -mono_domain_try_type_resolve (MonoDomain *domain, char *name, MonoObject *typebuilder_raw) -{ - HANDLE_FUNCTION_ENTER (); - - g_assert (domain); - g_assert (name || typebuilder_raw); - - ERROR_DECL (error); - - MonoReflectionAssemblyHandle ret = NULL_HANDLE_INIT; - - if (name) { - MonoStringHandle name_handle = mono_string_new_handle (mono_domain_get (), name, error); - goto_if_nok (error, exit); - ret = mono_domain_try_type_resolve_name (domain, name_handle, error); - } else { - MONO_HANDLE_DCL (MonoObject, typebuilder); - ret = mono_domain_try_type_resolve_typebuilder (domain, MONO_HANDLE_CAST (MonoReflectionTypeBuilder, typebuilder), error); - } - -exit: - mono_error_cleanup (error); - HANDLE_FUNCTION_RETURN_OBJ (ret); -} - -/** - * mono_class_get_appdomain_do_type_resolve_method: - * - * This routine returns System.AppDomain.DoTypeResolve. - */ -static MonoMethod * -mono_class_get_appdomain_do_type_resolve_method (MonoError *error) -{ - static MonoMethod *method; // cache - - if (method) - return method; - - // not cached yet, fill cache under caller's lock - - method = mono_class_get_method_from_name_checked (mono_class_get_appdomain_class (), "DoTypeResolve", -1, 0, error); - - if (method == NULL) - g_warning ("%s method AppDomain.DoTypeResolve not found. %s\n", __func__, mono_error_get_message (error)); - - return method; -} - -/** - * mono_class_get_appdomain_do_type_builder_resolve_method: - * - * This routine returns System.AppDomain.DoTypeBuilderResolve. - */ -static MonoMethod * -mono_class_get_appdomain_do_type_builder_resolve_method (MonoError *error) -{ - static MonoMethod *method; // cache - - if (method) - return method; - - // not cached yet, fill cache under caller's lock - - method = mono_class_get_method_from_name_checked (mono_class_get_appdomain_class (), "DoTypeBuilderResolve", -1, 0, error); - - if (method == NULL) - g_warning ("%s method AppDomain.DoTypeBuilderResolve not found. %s\n", __func__, mono_error_get_message (error)); - - return method; -} - -/** - * mono_domain_try_type_resolve_name: - * \param domain application domain in which to resolve the type - * \param name the name of the type to resolve. - * - * This routine invokes the internal \c System.AppDomain.DoTypeResolve and returns - * the assembly that matches name. - * - * \returns A \c MonoReflectionAssembly or NULL if not found - */ -MonoReflectionAssemblyHandle -mono_domain_try_type_resolve_name (MonoDomain *domain, MonoStringHandle name, MonoError *error) -{ - HANDLE_FUNCTION_ENTER (); - - void *params [1] = { 0 }; - - g_assert (domain); - g_assert (MONO_HANDLE_BOOL (name)); - g_assert (error); - - error_init (error); - - MonoMethod *method; - method = mono_class_get_appdomain_do_type_resolve_method (error); - goto_if_nok (error, return_null); - - MonoAppDomainHandle appdomain; - appdomain = MONO_HANDLE_NEW (MonoAppDomain, domain->domain); - - MonoObjectHandle ret; - params [0] = MONO_HANDLE_RAW (name); - ret = mono_runtime_invoke_handle (method, MONO_HANDLE_CAST (MonoObject, appdomain), params, error); - goto_if_nok (error, return_null); - goto exit; -return_null: - ret = NULL_HANDLE; -exit: - HANDLE_FUNCTION_RETURN_REF (MonoReflectionAssembly, MONO_HANDLE_CAST (MonoReflectionAssembly, ret)); -} - -/** - * mono_domain_try_type_resolve_typebuilder: - * \param domain application domain in which to resolve the type - * \param typebuilder A \c System.Reflection.Emit.TypeBuilder; typebuilder.FullName is the name of the type to resolve. - * - * This routine invokes the internal \c System.AppDomain.DoTypeBuilderResolve and returns - * the assembly that matches typebuilder.FullName. - * - * \returns A \c MonoReflectionAssembly or NULL_HANDLE if not found - */ -MonoReflectionAssemblyHandle -mono_domain_try_type_resolve_typebuilder (MonoDomain *domain, MonoReflectionTypeBuilderHandle typebuilder, MonoError *error) -{ - HANDLE_FUNCTION_ENTER (); - - g_assert (domain); - g_assert (MONO_HANDLE_BOOL (typebuilder)); - g_assert (error); - - error_init (error); - - MonoMethod * const method = mono_class_get_appdomain_do_type_builder_resolve_method (error); - goto_if_nok (error, return_null); - - MonoAppDomainHandle appdomain; - appdomain = MONO_HANDLE_NEW (MonoAppDomain, domain->domain); - void *args [1]; - args [0] = MONO_HANDLE_RAW (typebuilder); - - MonoObjectHandle ret; - ret = mono_runtime_invoke_handle (method, MONO_HANDLE_CAST (MonoObject, appdomain), args, error); - goto_if_nok (error, return_null); - goto exit; -return_null: - ret = NULL_HANDLE; -exit: - HANDLE_FUNCTION_RETURN_REF (MonoReflectionAssembly, MONO_HANDLE_CAST (MonoReflectionAssembly, ret)); -} - -/** - * mono_domain_owns_vtable_slot: - * \returns Whether \p vtable_slot is inside a vtable which belongs to \p domain. - */ -gboolean -mono_domain_owns_vtable_slot (MonoDomain *domain, gpointer vtable_slot) -{ - gboolean res; - - mono_domain_lock (domain); - res = mono_mempool_contains_addr (domain->mp, vtable_slot); - mono_domain_unlock (domain); - return res; -} - -gboolean -mono_domain_set_fast (MonoDomain *domain, gboolean force) -{ - MONO_REQ_GC_UNSAFE_MODE; - if (!force && domain->state == MONO_APPDOMAIN_UNLOADED) - return FALSE; - - mono_domain_set_internal_with_options (domain, TRUE); - return TRUE; -} - -MonoObjectHandle -ves_icall_System_AppDomain_GetData (MonoAppDomainHandle ad, MonoStringHandle name, MonoError *error) -{ - error_init (error); - - if (MONO_HANDLE_IS_NULL (name)) { - mono_error_set_argument_null (error, "name", ""); - return NULL_HANDLE; - } - - g_assert (!MONO_HANDLE_IS_NULL (ad)); - MonoDomain *add = MONO_HANDLE_GETVAL (ad, data); - g_assert (add); - - char *str = mono_string_handle_to_utf8 (name, error); - return_val_if_nok (error, NULL_HANDLE); - - mono_domain_lock (add); - - MonoAppDomainSetupHandle ad_setup = MONO_HANDLE_NEW (MonoAppDomainSetup, add->setup); - MonoStringHandle o; - if (!strcmp (str, "APPBASE")) - o = MONO_HANDLE_NEW_GET (MonoString, ad_setup, application_base); - else if (!strcmp (str, "APP_CONFIG_FILE")) - o = MONO_HANDLE_NEW_GET (MonoString, ad_setup, configuration_file); - else if (!strcmp (str, "DYNAMIC_BASE")) - o = MONO_HANDLE_NEW_GET (MonoString, ad_setup, dynamic_base); - else if (!strcmp (str, "APP_NAME")) - o = MONO_HANDLE_NEW_GET (MonoString, ad_setup, application_name); - else if (!strcmp (str, "CACHE_BASE")) - o = MONO_HANDLE_NEW_GET (MonoString, ad_setup, cache_path); - else if (!strcmp (str, "PRIVATE_BINPATH")) - o = MONO_HANDLE_NEW_GET (MonoString, ad_setup, private_bin_path); - else if (!strcmp (str, "BINPATH_PROBE_ONLY")) - o = MONO_HANDLE_NEW_GET (MonoString, ad_setup, private_bin_path_probe); - else if (!strcmp (str, "SHADOW_COPY_DIRS")) - o = MONO_HANDLE_NEW_GET (MonoString, ad_setup, shadow_copy_directories); - else if (!strcmp (str, "FORCE_CACHE_INSTALL")) - o = MONO_HANDLE_NEW_GET (MonoString, ad_setup, shadow_copy_files); - else - o = MONO_HANDLE_NEW (MonoString, (MonoString*)mono_g_hash_table_lookup (add->env, MONO_HANDLE_RAW (name))); - - mono_domain_unlock (add); - g_free (str); - - return MONO_HANDLE_CAST (MonoObject, o); -} - -void -ves_icall_System_AppDomain_SetData (MonoAppDomainHandle ad, MonoStringHandle name, MonoObjectHandle data, MonoError *error) -{ - error_init (error); - - if (MONO_HANDLE_IS_NULL (name)) { - mono_error_set_argument_null (error, "name", ""); - return; - } - - g_assert (!MONO_HANDLE_IS_NULL (ad)); - MonoDomain *add = MONO_HANDLE_GETVAL (ad, data); - g_assert (add); - - mono_domain_lock (add); - - mono_g_hash_table_insert_internal (add->env, MONO_HANDLE_RAW (name), MONO_HANDLE_RAW (data)); - - mono_domain_unlock (add); -} - -MonoAppDomainSetupHandle -ves_icall_System_AppDomain_getSetup (MonoAppDomainHandle ad, MonoError *error) -{ - error_init (error); - g_assert (!MONO_HANDLE_IS_NULL (ad)); - MonoDomain *domain = MONO_HANDLE_GETVAL (ad, data); - g_assert (domain); - - return MONO_HANDLE_NEW (MonoAppDomainSetup, domain->setup); -} - -MonoStringHandle -ves_icall_System_AppDomain_getFriendlyName (MonoAppDomainHandle ad, MonoError *error) -{ - error_init (error); - g_assert (!MONO_HANDLE_IS_NULL (ad)); - MonoDomain *domain = MONO_HANDLE_GETVAL (ad, data); - g_assert (domain); - - return mono_string_new_handle (domain, domain->friendly_name, error); -} - -MonoAppDomainHandle -ves_icall_System_AppDomain_getCurDomain (MonoError *error) -{ - error_init (error); - MonoDomain *add = mono_domain_get (); - - return MONO_HANDLE_NEW (MonoAppDomain, add->domain); -} - -MonoAppDomainHandle -ves_icall_System_AppDomain_getRootDomain (MonoError *error) -{ - error_init (error); - MonoDomain *root = mono_get_root_domain (); - - return MONO_HANDLE_NEW (MonoAppDomain, root->domain); -} - -MonoBoolean -ves_icall_System_CLRConfig_CheckThrowUnobservedTaskExceptions (MonoError *error) -{ - MonoDomain *domain = mono_domain_get (); - - return domain->throw_unobserved_task_exceptions; -} - -static char* -get_attribute_value (const gchar **attribute_names, - const gchar **attribute_values, - const char *att_name) -{ - int n; - for (n = 0; attribute_names [n] != NULL; n++) { - if (strcmp (attribute_names [n], att_name) == 0) - return g_strdup (attribute_values [n]); - } - return NULL; -} - -static void -start_element (GMarkupParseContext *context, - const gchar *element_name, - const gchar **attribute_names, - const gchar **attribute_values, - gpointer user_data, - GError **gerror) -{ - RuntimeConfig *runtime_config = (RuntimeConfig *)user_data; - - if (strcmp (element_name, "runtime") == 0) { - runtime_config->runtime_count++; - return; - } - - if (strcmp (element_name, "assemblyBinding") == 0) { - runtime_config->assemblybinding_count++; - return; - } - - if (runtime_config->runtime_count != 1) - return; - - if (strcmp (element_name, "ThrowUnobservedTaskExceptions") == 0) { - const char *value = get_attribute_value (attribute_names, attribute_values, "enabled"); - - if (value && g_ascii_strcasecmp (value, "true") == 0) - runtime_config->domain->throw_unobserved_task_exceptions = TRUE; - } - - if (runtime_config->assemblybinding_count != 1) - return; - - if (strcmp (element_name, "probing") != 0) - return; - - g_free (runtime_config->domain->private_bin_path); - runtime_config->domain->private_bin_path = get_attribute_value (attribute_names, attribute_values, "privatePath"); - if (runtime_config->domain->private_bin_path && !runtime_config->domain->private_bin_path [0]) { - g_free (runtime_config->domain->private_bin_path); - runtime_config->domain->private_bin_path = NULL; - return; - } -} - -static void -end_element (GMarkupParseContext *context, - const gchar *element_name, - gpointer user_data, - GError **gerror) -{ - RuntimeConfig *runtime_config = (RuntimeConfig *)user_data; - if (strcmp (element_name, "runtime") == 0) - runtime_config->runtime_count--; - else if (strcmp (element_name, "assemblyBinding") == 0) - runtime_config->assemblybinding_count--; -} - -static void -parse_error (GMarkupParseContext *context, GError *gerror, gpointer user_data) -{ - RuntimeConfig *state = (RuntimeConfig *)user_data; - const gchar *msg; - const gchar *filename; - - filename = state && state->filename ? (gchar *) state->filename : ""; - msg = gerror && gerror->message ? gerror->message : ""; - g_warning ("Error parsing %s: %s", filename, msg); -} - -static const GMarkupParser -mono_parser = { - start_element, - end_element, - NULL, - NULL, - parse_error -}; - -void -mono_domain_set_options_from_config (MonoDomain *domain) -{ - ERROR_DECL (error); - gchar *config_file_name = NULL, *text = NULL, *config_file_path = NULL; - gsize len; - GMarkupParseContext *context; - RuntimeConfig runtime_config; - gint offset; - - if (!domain || !domain->setup || !domain->setup->configuration_file) - return; - - config_file_name = mono_string_to_utf8_checked_internal (domain->setup->configuration_file, error); - if (!mono_error_ok (error)) { - mono_error_cleanup (error); - goto free_and_out; - } - - config_file_path = mono_portability_find_file (config_file_name, TRUE); - if (!config_file_path) - config_file_path = config_file_name; - - if (!g_file_get_contents (config_file_path, &text, &len, NULL)) - goto free_and_out; - - runtime_config.runtime_count = 0; - runtime_config.assemblybinding_count = 0; - runtime_config.domain = domain; - runtime_config.filename = config_file_path; - - offset = 0; - if (len > 3 && text [0] == '\xef' && text [1] == (gchar) '\xbb' && text [2] == '\xbf') - offset = 3; /* Skip UTF-8 BOM */ - - context = g_markup_parse_context_new (&mono_parser, (GMarkupParseFlags)0, &runtime_config, NULL); - if (g_markup_parse_context_parse (context, text + offset, len - offset, NULL)) - g_markup_parse_context_end_parse (context, NULL); - g_markup_parse_context_free (context); - - free_and_out: - g_free (text); - if (config_file_name != config_file_path) - g_free (config_file_name); - g_free (config_file_path); -} - -MonoAppDomainHandle -ves_icall_System_AppDomain_createDomain (MonoStringHandle friendly_name, MonoAppDomainSetupHandle setup, MonoError *error) -{ - error_init (error); - MonoAppDomainHandle ad = MONO_HANDLE_NEW (MonoAppDomain, NULL); - -#ifdef DISABLE_APPDOMAINS - mono_error_set_not_supported (error, "AppDomain creation is not supported on this runtime."); -#else - char *fname; - - fname = mono_string_handle_to_utf8 (friendly_name, error); - return_val_if_nok (error, ad); - ad = mono_domain_create_appdomain_internal (fname, setup, error); - g_free (fname); -#endif - return ad; -} - -static gboolean -add_assembly_to_array (MonoDomain *domain, MonoArrayHandle dest, int dest_idx, MonoAssembly* assm, MonoError *error) -{ - HANDLE_FUNCTION_ENTER (); - error_init (error); - MonoReflectionAssemblyHandle assm_obj = mono_assembly_get_object_handle (domain, assm, error); - goto_if_nok (error, leave); - MONO_HANDLE_ARRAY_SETREF (dest, dest_idx, assm_obj); -leave: - HANDLE_FUNCTION_RETURN_VAL (is_ok (error)); -} - -static MonoArrayHandle -get_assembly_array_from_domain (MonoDomain *domain, MonoBoolean refonly, MonoError *error) -{ - int i; - GPtrArray *assemblies; - - assemblies = mono_domain_get_assemblies (domain, refonly); - - MonoArrayHandle res = mono_array_new_handle (domain, mono_class_get_assembly_class (), assemblies->len, error); - goto_if_nok (error, leave); - for (i = 0; i < assemblies->len; ++i) { - if (!add_assembly_to_array (domain, res, i, (MonoAssembly *)g_ptr_array_index (assemblies, i), error)) - goto leave; - } - -leave: - g_ptr_array_free (assemblies, TRUE); - return res; -} - -#ifdef ENABLE_NETCORE -MonoArrayHandle -ves_icall_System_Runtime_Loader_AssemblyLoadContext_InternalGetLoadedAssemblies (MonoError *error) -{ - MonoDomain *domain = mono_domain_get (); - return get_assembly_array_from_domain (domain, FALSE, error); -} -#else -MonoArrayHandle -ves_icall_System_AppDomain_GetAssemblies (MonoAppDomainHandle ad, MonoBoolean refonly, MonoError *error) -{ - MonoDomain *domain = MONO_HANDLE_GETVAL (ad, data); - return get_assembly_array_from_domain (domain, refonly, error); -} -#endif - -MonoAssembly* -mono_try_assembly_resolve (MonoDomain *domain, const char *fname_raw, MonoAssembly *requesting, gboolean refonly, MonoError *error) -{ - HANDLE_FUNCTION_ENTER (); - error_init (error); - MonoAssembly *result = NULL; - MonoStringHandle fname = mono_string_new_handle (domain, fname_raw, error); - goto_if_nok (error, leave); - result = mono_try_assembly_resolve_handle (domain, fname, requesting, refonly, error); -leave: - HANDLE_FUNCTION_RETURN_VAL (result); -} - -MonoAssembly* -mono_try_assembly_resolve_handle (MonoDomain *domain, MonoStringHandle fname, MonoAssembly *requesting, gboolean refonly, MonoError *error) -{ - HANDLE_FUNCTION_ENTER (); - MonoAssembly *ret = NULL; - MonoMethod *method; - MonoBoolean isrefonly; - gpointer params [3]; - - error_init (error); - - if (mono_runtime_get_no_exec ()) - goto leave; - - g_assert (domain != NULL && !MONO_HANDLE_IS_NULL (fname)); - - method = mono_class_get_method_from_name_checked (mono_class_get_appdomain_class (), "DoAssemblyResolve", -1, 0, error); - g_assert (method != NULL); - - isrefonly = refonly ? 1 : 0; - MonoReflectionAssemblyHandle requesting_handle; - if (requesting) { - requesting_handle = mono_assembly_get_object_handle (domain, requesting, error); - goto_if_nok (error, leave); - } - params [0] = MONO_HANDLE_RAW (fname); - params [1] = requesting ? MONO_HANDLE_RAW (requesting_handle) : NULL; - params [2] = &isrefonly; - MonoObject *exc; - exc = NULL; - MonoReflectionAssemblyHandle result; - result = MONO_HANDLE_CAST (MonoReflectionAssembly, MONO_HANDLE_NEW (MonoObject, mono_runtime_try_invoke (method, domain->domain, params, &exc, error))); - if (!is_ok (error) || exc != NULL) { - if (is_ok (error)) - mono_error_set_exception_instance (error, (MonoException*)exc); - goto leave; - } - ret = !MONO_HANDLE_IS_NULL (result) ? MONO_HANDLE_GETVAL (result, assembly) : NULL; - - if (ret && !refonly && mono_asmctx_get_kind (&ret->context) == MONO_ASMCTX_REFONLY) { - /* .NET Framework throws System.IO.FileNotFoundException in this case */ - mono_error_set_file_not_found (error, NULL, "AssemblyResolveEvent handlers cannot return Assemblies loaded for reflection only"); - ret = NULL; - goto leave; - } -leave: - HANDLE_FUNCTION_RETURN_VAL (ret); -} - -MonoAssembly * -mono_domain_assembly_postload_search (MonoAssemblyLoadContext *alc, MonoAssembly *requesting, - MonoAssemblyName *aname, - gboolean refonly, gboolean postload, - gpointer user_data, - MonoError *error_out) -{ - ERROR_DECL (error); - MonoAssembly *assembly; - MonoDomain *domain = mono_domain_get (); - char *aname_str; - - aname_str = mono_stringify_assembly_name (aname); - - /* FIXME: We invoke managed code here, so there is a potential for deadlocks */ - - assembly = mono_try_assembly_resolve (domain, aname_str, requesting, refonly, error); - g_free (aname_str); - mono_error_cleanup (error); - - return assembly; -} - -/* - * LOCKING: assumes assemblies_lock in the domain is already locked. - */ -static void -add_assemblies_to_domain (MonoDomain *domain, MonoAssembly *ass, GHashTable *ht) -{ - gint i; - GSList *tmp; - gboolean destroy_ht = FALSE; - - g_assert (ass != NULL); - - if (!ass->aname.name) - return; - - if (!ht) { - ht = g_hash_table_new (mono_aligned_addr_hash, NULL); - destroy_ht = TRUE; - for (tmp = domain->domain_assemblies; tmp; tmp = tmp->next) { - g_hash_table_insert (ht, tmp->data, tmp->data); - } - } - - /* FIXME: handle lazy loaded assemblies */ - - if (!g_hash_table_lookup (ht, ass)) { - mono_assembly_addref (ass); - g_hash_table_insert (ht, ass, ass); - domain->domain_assemblies = g_slist_append (domain->domain_assemblies, ass); - mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_ASSEMBLY, "Assembly %s[%p] added to domain %s, ref_count=%d", ass->aname.name, ass, domain->friendly_name, ass->ref_count); - } - - if (ass->image->references) { - for (i = 0; i < ass->image->nreferences; i++) { - if (ass->image->references[i] && ass->image->references [i] != REFERENCE_MISSING) { - if (!g_hash_table_lookup (ht, ass->image->references [i])) { - add_assemblies_to_domain (domain, ass->image->references [i], ht); - } - } - } - } - if (destroy_ht) - g_hash_table_destroy (ht); -} - -#ifdef ENABLE_NETCORE -static void -add_assembly_to_alc (MonoAssemblyLoadContext *alc, MonoAssembly *ass) -{ - gint i; - GSList *tmp; - - g_assert (ass != NULL); - - if (!ass->aname.name) - return; - - mono_alc_assemblies_lock (alc); - - for (tmp = alc->loaded_assemblies; tmp; tmp = tmp->next) { - if (tmp->data == ass) { - mono_alc_assemblies_unlock (alc); - return; - } - } - - mono_assembly_addref (ass); - // Prepending here will break the test suite with frequent InvalidCastExceptions, so we have to append - alc->loaded_assemblies = g_slist_append (alc->loaded_assemblies, ass); - mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_ASSEMBLY, "Assembly %s[%p] added to ALC (%p), ref_count=%d", ass->aname.name, ass, (gpointer)alc, ass->ref_count); - - if (ass->image->references) { - for (i = 0; i < ass->image->nreferences; i++) { - // TODO: remove all this after we're confident this assert isn't hit - g_assertf (!ass->image->references [i], "Did not expect reference %d of %s to be resolved", i, ass->image->name); - } - } - - mono_alc_assemblies_unlock (alc); -} -#endif - -static void -mono_domain_fire_assembly_load (MonoAssembly *assembly, gpointer user_data) -{ - HANDLE_FUNCTION_ENTER (); - static MonoClassField *assembly_load_field; - static MonoMethod *assembly_load_method; - ERROR_DECL (error); - MonoDomain *domain = mono_domain_get (); - MonoAssemblyLoadContext *alc = mono_domain_ambient_alc (domain); // FIXME: pass alc via mono_assembly_invoke_load_hook - MonoClass *klass; - MonoObjectHandle appdomain; - - if (!MONO_BOOL (domain->domain)) - goto leave; // This can happen during startup - - if (mono_runtime_get_no_exec ()) - goto leave; - -#ifdef ASSEMBLY_LOAD_DEBUG - fprintf (stderr, "Loading %s into domain %s\n", assembly->aname.name, domain->friendly_name); -#endif - appdomain = MONO_HANDLE_NEW (MonoObject, &domain->domain->mbr.obj); - klass = mono_handle_class (appdomain); - - mono_domain_assemblies_lock (domain); - add_assemblies_to_domain (domain, assembly, NULL); - mono_domain_assemblies_unlock (domain); -#ifdef ENABLE_NETCORE - add_assembly_to_alc (alc, assembly); -#endif - - if (assembly_load_field == NULL) { - assembly_load_field = mono_class_get_field_from_name_full (klass, "AssemblyLoad", NULL); - g_assert (assembly_load_field); - } - - if (!MONO_HANDLE_GET_FIELD_BOOL (appdomain, MonoObject*, assembly_load_field)) - goto leave; // No events waiting to be triggered - - MonoReflectionAssemblyHandle reflection_assembly; - reflection_assembly = mono_assembly_get_object_handle (domain, assembly, error); - mono_error_assert_ok (error); - - if (assembly_load_method == NULL) { - assembly_load_method = mono_class_get_method_from_name_checked (klass, "DoAssemblyLoad", -1, 0, error); - g_assert (assembly_load_method); - } - - void *params [1]; - params [0] = MONO_HANDLE_RAW (reflection_assembly); - mono_runtime_invoke_handle_void (assembly_load_method, appdomain, params, error); -leave: - mono_error_cleanup (error); - HANDLE_FUNCTION_RETURN (); -} - -static gboolean -mono_domain_asmctx_from_path (const char *fname, MonoAssembly *requesting_assembly, gpointer user_data, MonoAssemblyContextKind *out_asmctx) -{ - MonoDomain *domain = mono_domain_get (); - char **search_path = NULL; - - for (search_path = domain->search_path; search_path && *search_path; search_path++) { - if (mono_path_filename_in_basedir (fname, *search_path)) { - *out_asmctx = MONO_ASMCTX_DEFAULT; - return TRUE; - } - } - return FALSE; -} - -/* - * LOCKING: Acquires the domain assemblies lock. - */ -static void -set_domain_search_path (MonoDomain *domain) -{ - HANDLE_FUNCTION_ENTER (); - ERROR_DECL (error); - MonoAppDomainSetupHandle setup; - gchar **tmp; - gchar *search_path = NULL; - gint npaths = 1; - gchar **pvt_split = NULL; - GError *gerror = NULL; - gint appbaselen = -1; - - /* - * We use the low-level domain assemblies lock, since this is called from - * assembly loads hooks, which means this thread might hold the loader lock. - */ - mono_domain_assemblies_lock (domain); - - if (!MONO_BOOL (domain->setup)) - goto exit; - - setup = MONO_HANDLE_NEW (MonoAppDomainSetup, domain->setup); - - if (domain->search_path && !MONO_HANDLE_GET_BOOL (setup, path_changed)) - goto exit; - - if (!MONO_HANDLE_GET_BOOL (setup, application_base)) - goto exit; // Must set application base to get private path working - - if (MONO_HANDLE_GET_BOOL (setup, private_bin_path)) { - search_path = mono_string_handle_to_utf8 (MONO_HANDLE_NEW_GET (MonoString, setup, private_bin_path), error); - if (!mono_error_ok (error)) { /*FIXME maybe we should bubble up the error.*/ - g_warning ("Could not decode AppDomain search path since it contains invalid characters"); - goto exit; - } - } - - if (domain->private_bin_path) { - if (search_path == NULL) - search_path = domain->private_bin_path; - else { - gchar *tmp2 = search_path; - search_path = g_strjoin (";", search_path, domain->private_bin_path, NULL); - g_free (tmp2); - } - } - - if (search_path) { - /* - * As per MSDN documentation, AppDomainSetup.PrivateBinPath contains a list of - * directories relative to ApplicationBase separated by semicolons (see - * http://msdn2.microsoft.com/en-us/library/system.appdomainsetup.privatebinpath.aspx) - * The loop below copes with the fact that some Unix applications may use ':' (or - * System.IO.Path.PathSeparator) as the path search separator. We replace it with - * ';' for the subsequent split. - * - * The issue was reported in bug #81446 - */ -#ifndef TARGET_WIN32 - g_strdelimit (search_path, ':', ';'); -#endif - pvt_split = g_strsplit (search_path, ";", 1000); - g_free (search_path); - for (tmp = pvt_split; *tmp; tmp++, npaths++); - } - - g_strfreev (domain->search_path); - domain->search_path = NULL; - - tmp = g_new (gchar*, npaths + 1); - tmp [npaths] = NULL; - - *tmp = mono_string_handle_to_utf8 (MONO_HANDLE_NEW_GET (MonoString, setup, application_base), error); - if (!mono_error_ok (error)) { - g_free (tmp); - goto exit; - } - - domain->search_path = tmp; - - /* FIXME: is this needed? */ - if (strncmp (*tmp, "file://", 7) == 0) { - gchar *file = *tmp; - gchar *uri = *tmp; - gchar *tmpuri; - - if (uri [7] != '/') - uri = g_strdup_printf ("file:///%s", uri + 7); - - tmpuri = uri; - uri = mono_escape_uri_string (tmpuri); - *tmp = g_filename_from_uri (uri, NULL, &gerror); - g_free (uri); - - if (tmpuri != file) - g_free (tmpuri); - - if (gerror != NULL) { - g_warning ("%s\n", gerror->message); - g_error_free (gerror); - *tmp = file; - } else { - g_free (file); - } - } - - for (gsize i = 1; pvt_split && i < npaths; i++) { - if (g_path_is_absolute (pvt_split [i - 1])) { - tmp [i] = g_strdup (pvt_split [i - 1]); - } else { - tmp [i] = g_build_filename (tmp [0], pvt_split [i - 1], NULL); - } - - if (strchr (tmp [i], '.')) { - gchar *reduced; - gchar *freeme; - - reduced = mono_path_canonicalize (tmp [i]); - if (appbaselen == -1) - appbaselen = strlen (tmp [0]); - - if (strncmp (tmp [0], reduced, appbaselen)) { - g_free (reduced); - g_free (tmp [i]); - tmp [i] = g_strdup (""); - continue; - } - - freeme = tmp [i]; - tmp [i] = reduced; - g_free (freeme); - } - } - - if (MONO_HANDLE_GET_BOOL (setup, private_bin_path_probe)) { - g_free (tmp [0]); - tmp [0] = g_strdup (""); - } - - MONO_HANDLE_SETVAL (setup, path_changed, MonoBoolean, FALSE); -exit: - mono_error_cleanup (error); - g_strfreev (pvt_split); - mono_domain_assemblies_unlock (domain); - HANDLE_FUNCTION_RETURN (); -} - -#ifdef DISABLE_SHADOW_COPY -gboolean -mono_is_shadow_copy_enabled (MonoDomain *domain, const gchar *dir_name) -{ - return FALSE; -} - -char * -mono_make_shadow_copy (const char *filename, MonoError *error) -{ - error_init (error); - return (char *) filename; -} -#else - -typedef enum { - SHADOW_COPY_SIBLING_EXT_APPEND, - SHADOW_COPY_SIBLING_EXT_REPLACE, -} ShadowCopySiblingExt; - -static -gchar * -make_sibling_path (const gchar *path, gint pathlen, const char *extension, ShadowCopySiblingExt extopt) -{ - gchar *result = NULL; - switch (extopt) { - case SHADOW_COPY_SIBLING_EXT_APPEND: { - result = g_strconcat (path, extension, NULL); - break; - } - case SHADOW_COPY_SIBLING_EXT_REPLACE: { - /* expect path to be a .dll or .exe (or some case insensitive variant) */ - g_assert (pathlen >= 4 && path[pathlen - 4] == '.'); - GString *s = g_string_sized_new (pathlen - 4 + strlen (extension)); - g_string_append_len (s, path, pathlen - 4); - g_string_append (s, extension); - result = g_string_free (s, FALSE); - break; - } - default: - g_assert_not_reached (); - } - return result; -} - -static gboolean -shadow_copy_sibling (const gchar *src_pristine, gint srclen, const char *extension, ShadowCopySiblingExt extopt, const gchar *target_pristine, gint targetlen) -{ - gchar *file = NULL; - gunichar2 *orig = NULL; - gunichar2 *dest = NULL; - gboolean copy_result = TRUE; - gchar *target = NULL; - - char *src = make_sibling_path (src_pristine, srclen, extension, extopt); - - if (IS_PORTABILITY_CASE) { - file = mono_portability_find_file (src, TRUE); - if (file == NULL) - goto exit; - } else if (!g_file_test (src, G_FILE_TEST_IS_REGULAR)) - goto exit; - - orig = g_utf8_to_utf16 (src, strlen (src), NULL, NULL, NULL); - - target = make_sibling_path (target_pristine, targetlen, extension, extopt); - - dest = g_utf8_to_utf16 (target, strlen (target), NULL, NULL, NULL); - - mono_w32file_delete (dest); - - gint32 copy_error; - copy_result = mono_w32file_copy (orig, dest, TRUE, ©_error); - - /* Fix for bug #556884 - make sure the files have the correct mode so that they can be - * overwritten when updated in their original locations. */ - if (copy_result) - copy_result = mono_w32file_set_attributes (dest, FILE_ATTRIBUTE_NORMAL); - -exit: - g_free (file); - g_free (orig); - g_free (dest); - g_free (src); - g_free (target); - return copy_result; -} - -static gint32 -get_cstring_hash (const char *str) -{ - const char *p; - gint32 h = 0; - - if (!str || !str [0]) - return 0; - - gsize const len = strlen (str); - p = str; - for (gsize i = 0; i < len; i++) { - h = (h << 5) - h + *p; - p++; - } - - return h; -} - -/* - * Returned memory is malloc'd. Called must free it - */ -static char * -get_shadow_assembly_location_base (MonoDomain *domain, MonoError *error) -{ - MonoAppDomainSetup *setup; - char *cache_path = NULL; - char *appname = NULL; - char *userdir = NULL; - char *location; - - error_init (error); - - setup = domain->setup; - if (setup->cache_path != NULL && setup->application_name != NULL) { - cache_path = mono_string_to_utf8_checked_internal (setup->cache_path, error); - return_val_if_nok (error, NULL); - -#ifndef TARGET_WIN32 - { - gint i; - for (i = strlen (cache_path) - 1; i >= 0; i--) - if (cache_path [i] == '\\') - cache_path [i] = '/'; - } -#endif - - appname = mono_string_to_utf8_checked_internal (setup->application_name, error); - if (!mono_error_ok (error)) { - g_free (cache_path); - return NULL; - } - - location = g_build_filename (cache_path, appname, "assembly", "shadow", NULL); - } else { - userdir = g_strdup_printf ("%s-mono-cachepath", g_get_user_name ()); - location = g_build_filename (g_get_tmp_dir (), userdir, "assembly", "shadow", NULL); - } - g_free (appname); - g_free (cache_path); - g_free (userdir); - return location; -} - -static char * -get_shadow_assembly_location (const char *filename, MonoError *error) -{ - gint32 hash = 0, hash2 = 0; - char name_hash [9]; - char path_hash [30]; - char *bname = g_path_get_basename (filename); - char *dirname = g_path_get_dirname (filename); - char *location, *tmploc; - MonoDomain *domain = mono_domain_get (); - - error_init (error); - - hash = get_cstring_hash (bname); - hash2 = get_cstring_hash (dirname); - g_snprintf (name_hash, sizeof (name_hash), "%08x", hash); - g_snprintf (path_hash, sizeof (path_hash), "%08x_%08x_%08x", hash ^ hash2, hash2, domain->shadow_serial); - tmploc = get_shadow_assembly_location_base (domain, error); - if (!mono_error_ok (error)) { - g_free (bname); - g_free (dirname); - return NULL; - } - - location = g_build_filename (tmploc, name_hash, path_hash, bname, NULL); - g_free (tmploc); - g_free (bname); - g_free (dirname); - return location; -} - -static gboolean -private_file_needs_copying (const char *src, struct stat *sbuf_src, char *dest) -{ - struct stat sbuf_dest; - gchar *stat_src; - gchar *real_src = mono_portability_find_file (src, TRUE); - - if (!real_src) - stat_src = (gchar*)src; - else - stat_src = real_src; - - if (stat (stat_src, sbuf_src) == -1) { - time_t tnow = time (NULL); - - if (real_src) - g_free (real_src); - - memset (sbuf_src, 0, sizeof (*sbuf_src)); - sbuf_src->st_mtime = tnow; - sbuf_src->st_atime = tnow; - return TRUE; - } - - if (real_src) - g_free (real_src); - - if (stat (dest, &sbuf_dest) == -1) - return TRUE; - - if (sbuf_src->st_size == sbuf_dest.st_size && - sbuf_src->st_mtime == sbuf_dest.st_mtime) - return FALSE; - - return TRUE; -} - -static gboolean -shadow_copy_create_ini (const char *shadow, const char *filename) -{ - gunichar2 *u16_ini = NULL; - gboolean result = FALSE; - guint32 n; - HANDLE handle = INVALID_HANDLE_VALUE; - gchar *full_path = NULL; - - char *dir_name = g_path_get_dirname (shadow); - char *ini_file = g_build_filename (dir_name, "__AssemblyInfo__.ini", NULL); - g_free (dir_name); - result = g_file_test (ini_file, G_FILE_TEST_IS_REGULAR); - if (result) - goto exit; - - u16_ini = g_utf8_to_utf16 (ini_file, strlen (ini_file), NULL, NULL, NULL); - if (!u16_ini) - goto exit; - - handle = mono_w32file_create (u16_ini, GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, CREATE_NEW, FileAttributes_Normal); - if (handle == INVALID_HANDLE_VALUE) - goto exit; - - full_path = mono_path_resolve_symlinks (filename); - gint32 win32error; - win32error = 0; - result = mono_w32file_write (handle, full_path, strlen (full_path), &n, &win32error); -exit: - if (handle != INVALID_HANDLE_VALUE) - mono_w32file_close (handle); - g_free (u16_ini); - g_free (full_path); - g_free (ini_file); - return result; -} - -gboolean -mono_is_shadow_copy_enabled (MonoDomain *domain, const gchar *dir_name) -{ - ERROR_DECL (error); - MonoAppDomainSetup *setup; - gchar *all_dirs = NULL; - gchar **dir_ptr; - gchar **directories = NULL; - gchar *shadow_status_string; - gchar *base_dir = NULL; - gboolean shadow_enabled; - gboolean found = FALSE; - - if (domain == NULL) - goto exit; - - setup = domain->setup; - if (setup == NULL || setup->shadow_copy_files == NULL) - goto exit; - - shadow_status_string = mono_string_to_utf8_checked_internal (setup->shadow_copy_files, error); - if (!mono_error_ok (error)) - goto exit; - - shadow_enabled = !g_ascii_strncasecmp (shadow_status_string, "true", 4); - g_free (shadow_status_string); - - if (!shadow_enabled) - goto exit; - - found = (setup->shadow_copy_directories == NULL); - if (found) - goto exit; - - /* Is dir_name a shadow_copy destination already? */ - base_dir = get_shadow_assembly_location_base (domain, error); - if (!mono_error_ok (error)) - goto exit; - - found = !!strstr (dir_name, base_dir); - if (found) - goto exit; - - all_dirs = mono_string_to_utf8_checked_internal (setup->shadow_copy_directories, error); - if (!mono_error_ok (error)) - goto exit; - - directories = g_strsplit (all_dirs, G_SEARCHPATH_SEPARATOR_S, 1000); - dir_ptr = directories; - while (!found && *dir_ptr) { - found = (**dir_ptr != '\0' && !strcmp (*dir_ptr, dir_name)); - dir_ptr++; - } -exit: - mono_error_cleanup (error); - g_free (base_dir); - g_strfreev (directories); - g_free (all_dirs); - return found; -} - -/* -This function raises exceptions so it can cause as sorts of nasty stuff if called -while holding a lock. -Returns old file name if shadow copy is disabled, new shadow copy file name if successful -or NULL if source file not found. -FIXME bubble up the error instead of raising it here -*/ -char * -mono_make_shadow_copy (const char *filename, MonoError *oerror) -{ - ERROR_DECL (error); - gint filename_len, shadow_len; - gunichar2 *orig, *dest; - guint32 attrs; - char *shadow; - gboolean copy_result; - struct stat src_sbuf; - struct utimbuf utbuf; - char *dir_name = g_path_get_dirname (filename); - MonoDomain *domain = mono_domain_get (); - char *shadow_dir; - gint32 copy_error; - - error_init (oerror); - - set_domain_search_path (domain); - - if (!mono_is_shadow_copy_enabled (domain, dir_name)) { - g_free (dir_name); - return (char *) filename; - } - - /* Is dir_name a shadow_copy destination already? */ - shadow_dir = get_shadow_assembly_location_base (domain, error); - if (!mono_error_ok (error)) { - mono_error_cleanup (error); - g_free (dir_name); - mono_error_set_execution_engine (oerror, "Failed to create shadow copy (invalid characters in shadow directory name)."); - return NULL; - } - - if (strstr (dir_name, shadow_dir)) { - g_free (shadow_dir); - g_free (dir_name); - return (char *) filename; - } - g_free (shadow_dir); - g_free (dir_name); - - shadow = get_shadow_assembly_location (filename, error); - if (!mono_error_ok (error)) { - mono_error_cleanup (error); - mono_error_set_execution_engine (oerror, "Failed to create shadow copy (invalid characters in file name)."); - return NULL; - } - - if (g_ensure_directory_exists (shadow) == FALSE) { - g_free (shadow); - mono_error_set_execution_engine (oerror, "Failed to create shadow copy (ensure directory exists)."); - return NULL; - } - - if (!private_file_needs_copying (filename, &src_sbuf, shadow)) - return (char*) shadow; - - orig = g_utf8_to_utf16 (filename, strlen (filename), NULL, NULL, NULL); - dest = g_utf8_to_utf16 (shadow, strlen (shadow), NULL, NULL, NULL); - mono_w32file_delete (dest); - - /* Fix for bug #17066 - make sure we can read the file. if not then don't error but rather - * let the assembly fail to load. This ensures you can do Type.GetType("NS.T, NonExistantAssembly) - * and not have it runtime error" */ - attrs = mono_w32file_get_attributes (orig); - if (attrs == INVALID_FILE_ATTRIBUTES) { - g_free (shadow); - return (char *)filename; - } - - copy_result = mono_w32file_copy (orig, dest, TRUE, ©_error); - - /* Fix for bug #556884 - make sure the files have the correct mode so that they can be - * overwritten when updated in their original locations. */ - if (copy_result) - copy_result = mono_w32file_set_attributes (dest, FILE_ATTRIBUTE_NORMAL); - - g_free (dest); - g_free (orig); - - if (copy_result == FALSE) { - g_free (shadow); - - /* Fix for bug #17251 - if file not found try finding assembly by other means (it is not fatal error) */ - if (mono_w32error_get_last() == ERROR_FILE_NOT_FOUND || mono_w32error_get_last() == ERROR_PATH_NOT_FOUND) - return NULL; /* file not found, shadow copy failed */ - - mono_error_set_execution_engine (oerror, "Failed to create shadow copy (mono_w32file_copy)."); - return NULL; - } - - /* attempt to copy .mdb, .pdb and .config if they exist */ - filename_len = strlen (filename); - shadow_len = strlen (shadow); - - copy_result = shadow_copy_sibling (filename, filename_len, ".mdb", SHADOW_COPY_SIBLING_EXT_APPEND, shadow, shadow_len); - if (copy_result) - copy_result = shadow_copy_sibling (filename, filename_len, ".pdb", SHADOW_COPY_SIBLING_EXT_REPLACE, shadow, shadow_len); - if (copy_result) - copy_result = shadow_copy_sibling (filename, filename_len, ".config", SHADOW_COPY_SIBLING_EXT_APPEND, shadow, shadow_len); - - if (!copy_result) { - g_free (shadow); - mono_error_set_execution_engine (oerror, "Failed to create shadow copy of sibling data (mono_w32file_copy)."); - return NULL; - } - - /* Create a .ini file containing the original assembly location */ - if (!shadow_copy_create_ini (shadow, filename)) { - g_free (shadow); - mono_error_set_execution_engine (oerror, "Failed to create shadow copy .ini file."); - return NULL; - } - - utbuf.actime = src_sbuf.st_atime; - utbuf.modtime = src_sbuf.st_mtime; - utime (shadow, &utbuf); - - return shadow; -} -#endif /* DISABLE_SHADOW_COPY */ - -/** - * mono_domain_from_appdomain: - */ -MonoDomain * -mono_domain_from_appdomain (MonoAppDomain *appdomain_raw) -{ - HANDLE_FUNCTION_ENTER (); - MonoDomain *result; - MONO_ENTER_GC_UNSAFE; - MONO_HANDLE_DCL (MonoAppDomain, appdomain); - result = mono_domain_from_appdomain_handle (appdomain); - MONO_EXIT_GC_UNSAFE; - HANDLE_FUNCTION_RETURN_VAL (result); -} - -MonoDomain * -mono_domain_from_appdomain_handle (MonoAppDomainHandle appdomain) -{ - HANDLE_FUNCTION_ENTER (); - MonoDomain *dom = NULL; - if (MONO_HANDLE_IS_NULL (appdomain)) - goto leave; - - if (mono_class_is_transparent_proxy (mono_handle_class (appdomain))) { - MonoTransparentProxyHandle tp = MONO_HANDLE_CAST (MonoTransparentProxy, appdomain); - MonoRealProxyHandle rp = MONO_HANDLE_NEW_GET (MonoRealProxy, tp, rp); - - dom = mono_domain_get_by_id (MONO_HANDLE_GETVAL (rp, target_domain_id)); - } else - dom = MONO_HANDLE_GETVAL (appdomain, data); - -leave: - HANDLE_FUNCTION_RETURN_VAL (dom); -} - - -static gboolean -try_load_from (MonoAssembly **assembly, - const gchar *path1, const gchar *path2, - const gchar *path3, const gchar *path4, - const MonoAssemblyOpenRequest *req) -{ - gchar *fullpath; - gboolean found = FALSE; - - *assembly = NULL; - fullpath = g_build_filename (path1, path2, path3, path4, NULL); - - if (IS_PORTABILITY_SET) { - gchar *new_fullpath = mono_portability_find_file (fullpath, TRUE); - if (new_fullpath) { - g_free (fullpath); - fullpath = new_fullpath; - found = TRUE; - } - } else - found = g_file_test (fullpath, G_FILE_TEST_IS_REGULAR); - - if (found) { - *assembly = mono_assembly_request_open (fullpath, req, NULL); - } - - g_free (fullpath); - return (*assembly != NULL); -} - -static MonoAssembly * -real_load (gchar **search_path, const gchar *culture, const gchar *name, const MonoAssemblyOpenRequest *req) -{ - MonoAssembly *result = NULL; - gchar **path; - gchar *filename; - const gchar *local_culture; - gint len; - - if (!culture || *culture == '\0') { - local_culture = ""; - } else { - local_culture = culture; - } - - filename = g_strconcat (name, ".dll", NULL); - len = strlen (filename); - - for (path = search_path; *path; path++) { - if (**path == '\0') { - continue; /* Ignore empty ApplicationBase */ - } - - /* See test cases in bug #58992 and bug #57710 */ - /* 1st try: [culture]/[name].dll (culture may be empty) */ - strcpy (filename + len - 4, ".dll"); - if (try_load_from (&result, *path, local_culture, "", filename, req)) - break; - - /* 2nd try: [culture]/[name].exe (culture may be empty) */ - strcpy (filename + len - 4, ".exe"); - if (try_load_from (&result, *path, local_culture, "", filename, req)) - break; - - /* 3rd try: [culture]/[name]/[name].dll (culture may be empty) */ - strcpy (filename + len - 4, ".dll"); - if (try_load_from (&result, *path, local_culture, name, filename, req)) - break; - - /* 4th try: [culture]/[name]/[name].exe (culture may be empty) */ - strcpy (filename + len - 4, ".exe"); - if (try_load_from (&result, *path, local_culture, name, filename, req)) - break; - } - - g_free (filename); - return result; -} - -/* - * Try loading the assembly from ApplicationBase and PrivateBinPath - * and then from assemblies_path if any. - * LOCKING: This is called from the assembly loading code, which means the caller - * might hold the loader lock. Thus, this function must not acquire the domain lock. - */ -static MonoAssembly * -mono_domain_assembly_preload (MonoAssemblyLoadContext *alc, - MonoAssemblyName *aname, - gchar **assemblies_path, - gboolean refonly, - gpointer user_data, - MonoError *error) -{ - MonoDomain *domain = mono_domain_get (); - MonoAssembly *result = NULL; -#ifdef ENABLE_NETCORE - g_assert (alc); - g_assert (mono_alc_domain (alc) == domain); -#endif - - set_domain_search_path (domain); - - MonoAssemblyCandidatePredicate predicate = NULL; - void* predicate_ud = NULL; -#if !defined(DISABLE_DESKTOP_LOADER) - if (G_LIKELY (mono_loader_get_strict_strong_names ())) { - predicate = &mono_assembly_candidate_predicate_sn_same_name; - predicate_ud = aname; - } -#endif - MonoAssemblyOpenRequest req; - mono_assembly_request_prepare (&req.request, sizeof (req), refonly ? MONO_ASMCTX_REFONLY : MONO_ASMCTX_DEFAULT); - req.request.alc = alc; - req.request.predicate = predicate; - req.request.predicate_ud = predicate_ud; - - if (domain->search_path && domain->search_path [0] != NULL) { - if (mono_trace_is_traced (G_LOG_LEVEL_DEBUG, MONO_TRACE_ASSEMBLY)) { - mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_ASSEMBLY, "Domain %s search path is:", domain->friendly_name); - for (int i = 0; domain->search_path [i]; i++) { - const char *p = domain->search_path[i]; - mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_ASSEMBLY, "\tpath[%d] = '%s'", i, p); - } - mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_ASSEMBLY, "End of domain %s search path.", domain->friendly_name); - } - result = real_load (domain->search_path, aname->culture, aname->name, &req); - } - - if (result == NULL && assemblies_path && assemblies_path [0] != NULL) { - result = real_load (assemblies_path, aname->culture, aname->name, &req); - } - - return result; -} - -/** - * mono_assembly_load_from_assemblies_path: - * - * \param assemblies_path directories to search for given assembly name, terminated by NULL - * \param aname assembly name to look for - * \param asmctx assembly load context for this load operation - * - * Given a NULL-terminated array of paths, look for \c name.ext, \c name, \c - * culture/name.ext, \c culture/name/name.ext where \c ext is \c dll and \c - * exe and try to load it in the given assembly load context. - * - * \returns A \c MonoAssembly if probing was successful, or NULL otherwise. - */ -MonoAssembly* -mono_assembly_load_from_assemblies_path (gchar **assemblies_path, MonoAssemblyName *aname, MonoAssemblyContextKind asmctx) -{ - MonoAssemblyCandidatePredicate predicate = NULL; - void* predicate_ud = NULL; -#if !defined(DISABLE_DESKTOP_LOADER) - if (G_LIKELY (mono_loader_get_strict_strong_names ())) { - predicate = &mono_assembly_candidate_predicate_sn_same_name; - predicate_ud = aname; - } -#endif - MonoAssemblyOpenRequest req; - mono_assembly_request_prepare (&req.request, sizeof (req), asmctx); - req.request.predicate = predicate; - req.request.predicate_ud = predicate_ud; - MonoAssembly *result = NULL; - if (assemblies_path && assemblies_path[0] != NULL) { - result = real_load (assemblies_path, aname->culture, aname->name, &req); - } - return result; -} - -/* - * Check whenever a given assembly was already loaded in the current appdomain. - */ -static MonoAssembly * -mono_domain_assembly_search (MonoAssemblyLoadContext *alc, MonoAssembly *requesting, - MonoAssemblyName *aname, - gboolean refonly, - gboolean postload, - gpointer user_data, - MonoError *error) -{ - g_assert (aname != NULL); - GSList *tmp; - MonoAssembly *ass; - const gboolean strong_name = aname->public_key_token[0] != 0; - /* If it's not a strong name, any version that has the right simple - * name is good enough to satisfy the request. .NET Framework also - * ignores case differences in this case. */ - const MonoAssemblyNameEqFlags eq_flags = (MonoAssemblyNameEqFlags)(strong_name ? MONO_ANAME_EQ_IGNORE_CASE : - (MONO_ANAME_EQ_IGNORE_PUBKEY | MONO_ANAME_EQ_IGNORE_VERSION | MONO_ANAME_EQ_IGNORE_CASE)); - -// TODO: this is currently broken due to the lack of proper ALC resolution logic and the load hook not using the correct ALC -#if 0 //def ENABLE_NETCORE - mono_alc_assemblies_lock (alc); - for (tmp = alc->loaded_assemblies; tmp; tmp = tmp->next) { - ass = (MonoAssembly *)tmp->data; - g_assert (ass != NULL); - // TODO: Can dynamic assemblies match here for netcore? Also, this ignores case while exact_sn_match does not. - if (assembly_is_dynamic (ass) || !mono_assembly_names_equal_flags (aname, &ass->aname, eq_flags)) - continue; - - mono_alc_assemblies_unlock (alc); - return ass; - } - mono_alc_assemblies_unlock (alc); -#else - MonoDomain *domain = mono_domain_get (); - mono_domain_assemblies_lock (domain); - for (tmp = domain->domain_assemblies; tmp; tmp = tmp->next) { - ass = (MonoAssembly *)tmp->data; - g_assert (ass != NULL); - /* Dynamic assemblies can't match here in MS.NET */ - gboolean ass_ref_only = mono_asmctx_get_kind (&ass->context) == MONO_ASMCTX_REFONLY; - if (assembly_is_dynamic (ass) || refonly != ass_ref_only || !mono_assembly_names_equal_flags (aname, &ass->aname, eq_flags)) - continue; - - mono_domain_assemblies_unlock (domain); - return ass; - } - mono_domain_assemblies_unlock (domain); -#endif - - return NULL; -} - -#if ENABLE_NETCORE -MonoReflectionAssemblyHandle -ves_icall_System_Reflection_Assembly_InternalLoad (MonoStringHandle name_handle, MonoStackCrawlMark *stack_mark, gpointer load_Context, MonoError *error) -{ - error_init (error); - MonoDomain *domain = mono_domain_get (); - MonoAssembly *ass = NULL; - MonoAssemblyName aname; - MonoAssemblyByNameRequest req; - MonoAssemblyContextKind asmctx; - MonoImageOpenStatus status = MONO_IMAGE_OK; - gboolean parsed; - char *name; - - MonoAssemblyLoadContext *alc = (MonoAssemblyLoadContext *)load_Context; - if (!alc) - alc = mono_domain_default_alc (domain); - g_assert (alc); - asmctx = MONO_ASMCTX_DEFAULT; - mono_assembly_request_prepare (&req.request, sizeof (req), asmctx); - req.request.alc = alc; - req.basedir = NULL; - req.no_postload_search = TRUE; - - name = mono_string_handle_to_utf8 (name_handle, error); - goto_if_nok (error, fail); - parsed = mono_assembly_name_parse (name, &aname); - g_free (name); - if (!parsed) - goto fail; - - ass = mono_assembly_request_byname (&aname, &req, &status); - if (!ass) - goto fail; - - MonoReflectionAssemblyHandle refass; - refass = mono_assembly_get_object_handle (domain, ass, error); - goto_if_nok (error, fail); - return refass; - -fail: - return MONO_HANDLE_CAST (MonoReflectionAssembly, NULL_HANDLE); -} - -#endif - -MonoReflectionAssemblyHandle -ves_icall_System_Reflection_Assembly_LoadFrom (MonoStringHandle fname, MonoBoolean refOnly, MonoStackCrawlMark *stack_mark, MonoError *error) -{ - error_init (error); - MonoDomain *domain = mono_domain_get (); - char *name, *filename; - MonoImageOpenStatus status = MONO_IMAGE_OK; - MonoReflectionAssemblyHandle result = MONO_HANDLE_CAST (MonoReflectionAssembly, NULL_HANDLE); - - name = NULL; - - if (MONO_HANDLE_IS_NULL (fname)) { - mono_error_set_argument_null (error, "assemblyFile", ""); - goto leave; - } - - name = filename = mono_string_handle_to_utf8 (fname, error); - goto_if_nok (error, leave); - - MonoAssembly *requesting_assembly; - requesting_assembly = NULL; - if (!refOnly) - requesting_assembly = mono_runtime_get_caller_from_stack_mark (stack_mark); - - MonoAssembly *ass; - MonoAssemblyOpenRequest req; - mono_assembly_request_prepare (&req.request, sizeof (req), refOnly ? MONO_ASMCTX_REFONLY : MONO_ASMCTX_LOADFROM); - req.requesting_assembly = requesting_assembly; - ass = mono_assembly_request_open (filename, &req, &status); - - if (!ass) { - if (status == MONO_IMAGE_IMAGE_INVALID) - mono_error_set_bad_image_by_name (error, name, "Invalid Image"); - else - mono_error_set_file_not_found (error, name, "Invalid Image"); - goto leave; - } - - result = mono_assembly_get_object_handle (domain, ass, error); - -leave: - g_free (name); - return result; -} - -static -MonoAssembly * -mono_alc_load_file (MonoAssemblyLoadContext *alc, MonoStringHandle fname, MonoAssembly *executing_assembly, MonoError *error) -{ - MonoAssembly *ass = NULL; - HANDLE_FUNCTION_ENTER (); - char *filename = NULL; - if (MONO_HANDLE_IS_NULL (fname)) { - mono_error_set_argument_null (error, "assemblyFile", ""); - goto leave; - } - - filename = mono_string_handle_to_utf8 (fname, error); - goto_if_nok (error, leave); - - if (!g_path_is_absolute (filename)) { - mono_error_set_argument (error, "assemblyFile", "Absolute path information is required."); - goto leave; - } - - - MonoImageOpenStatus status; - MonoAssemblyOpenRequest req; - mono_assembly_request_prepare (&req.request, sizeof (req), MONO_ASMCTX_INDIVIDUAL); - req.requesting_assembly = executing_assembly; - req.request.alc = alc; - ass = mono_assembly_request_open (filename, &req, &status); - if (!ass) { - if (status == MONO_IMAGE_IMAGE_INVALID) - mono_error_set_bad_image_by_name (error, filename, "Invalid Image"); - else - mono_error_set_file_not_found (error, filename, "Invalid Image"); - } - -leave: - g_free (filename); - HANDLE_FUNCTION_RETURN_VAL (ass); -} - -#ifndef ENABLE_NETCORE -MonoReflectionAssemblyHandle -ves_icall_System_Reflection_Assembly_LoadFile_internal (MonoStringHandle fname, MonoStackCrawlMark *stack_mark, MonoError *error) -{ - MonoDomain *domain = mono_domain_get (); - MonoReflectionAssemblyHandle result = MONO_HANDLE_CAST (MonoReflectionAssembly, NULL_HANDLE); - MonoAssembly *executing_assembly; - executing_assembly = mono_runtime_get_caller_from_stack_mark (stack_mark); - MonoAssembly *ass = mono_alc_load_file (mono_domain_default_alc (domain), fname, executing_assembly, error); - goto_if_nok (error, leave); - - result = mono_assembly_get_object_handle (domain, ass, error); -leave: - return result; -} -#else -MonoReflectionAssemblyHandle -ves_icall_System_Runtime_Loader_AssemblyLoadContext_InternalLoadFile (gpointer alc_ptr, MonoStringHandle fname, MonoStackCrawlMark *stack_mark, MonoError *error) -{ - MonoDomain *domain = mono_domain_get (); - MonoReflectionAssemblyHandle result = MONO_HANDLE_CAST (MonoReflectionAssembly, NULL_HANDLE); - MonoAssemblyLoadContext *alc = (MonoAssemblyLoadContext *)alc_ptr; - - MonoAssembly *executing_assembly; - executing_assembly = mono_runtime_get_caller_from_stack_mark (stack_mark); - MonoAssembly *ass = mono_alc_load_file (alc, fname, executing_assembly, error); - goto_if_nok (error, leave); - - result = mono_assembly_get_object_handle (domain, ass, error); - -leave: - return result; -} -#endif - -static MonoAssembly* -mono_alc_load_raw_bytes (MonoAssemblyLoadContext *alc, guint8 *raw_assembly, guint32 raw_assembly_len, guint8 *raw_symbol_data, guint32 raw_symbol_len, gboolean refonly, MonoError *error); - -#ifdef ENABLE_NETCORE -MonoReflectionAssemblyHandle -ves_icall_System_Runtime_Loader_AssemblyLoadContext_InternalLoadFromStream (gpointer native_alc, gpointer raw_assembly_ptr, gint32 raw_assembly_len, gpointer raw_symbols_ptr, gint32 raw_symbols_len, MonoError *error) -{ - MonoDomain *domain = mono_domain_get (); - MonoReflectionAssemblyHandle result = MONO_HANDLE_CAST (MonoReflectionAssembly, NULL_HANDLE); - MonoAssembly *assm = NULL; - assm = mono_alc_load_raw_bytes ((MonoAssemblyLoadContext *)native_alc, (guint8 *)raw_assembly_ptr, raw_assembly_len, (guint8 *)raw_symbols_ptr, raw_symbols_len, FALSE, error); - goto_if_nok (error, leave); - - result = mono_assembly_get_object_handle (domain, assm, error); - -leave: - return result; -} -#else -MonoReflectionAssemblyHandle -ves_icall_System_AppDomain_LoadAssemblyRaw (MonoAppDomainHandle ad, - MonoArrayHandle raw_assembly, - MonoArrayHandle raw_symbol_store, MonoObjectHandle evidence, - MonoBoolean refonly, - MonoError *error) -{ - MonoAssembly *ass; - MonoReflectionAssemblyHandle refass = MONO_HANDLE_CAST (MonoReflectionAssembly, NULL_HANDLE); - MonoDomain *domain = MONO_HANDLE_GETVAL(ad, data); - guint32 raw_assembly_len = mono_array_handle_length (raw_assembly); - - /* Copy the data ourselves to unpin the raw assembly byte array as soon as possible */ - guint8 *assembly_data = (guint8*) g_try_malloc (raw_assembly_len); - if (!assembly_data) { - mono_error_set_out_of_memory (error, "Could not allocate %ud bytes to copy raw assembly data", raw_assembly_len); - return refass; - } - uint32_t gchandle; - mono_byte *raw_data = (mono_byte*) MONO_ARRAY_HANDLE_PIN (raw_assembly, gchar, 0, &gchandle); - memcpy (assembly_data, raw_data, raw_assembly_len); - mono_gchandle_free_internal (gchandle); /* unpin */ - MONO_HANDLE_ASSIGN (raw_assembly, NULL_HANDLE); /* don't reference the data anymore */ - - MonoAssemblyLoadContext *alc = mono_domain_default_alc (domain); - - mono_byte *raw_symbol_data = NULL; - guint32 symbol_len = 0; - uint32_t symbol_gchandle = 0; - if (!MONO_HANDLE_IS_NULL (raw_symbol_store)) { - symbol_len = mono_array_handle_length (raw_symbol_store); - raw_symbol_data = (mono_byte*) MONO_ARRAY_HANDLE_PIN (raw_symbol_store, mono_byte, 0, &symbol_gchandle); - } - - ass = mono_alc_load_raw_bytes (alc, assembly_data, raw_assembly_len, raw_symbol_data, symbol_len, refonly, error); - mono_gchandle_free_internal (symbol_gchandle); - goto_if_nok (error, leave); - - refass = mono_assembly_get_object_handle (domain, ass, error); - if (!MONO_HANDLE_IS_NULL (refass)) - MONO_HANDLE_SET (refass, evidence, evidence); - -leave: - return refass; -} -#endif /* ENABLE_NETCORE */ - -static MonoAssembly* -mono_alc_load_raw_bytes (MonoAssemblyLoadContext *alc, guint8 *assembly_data, guint32 raw_assembly_len, guint8 *raw_symbol_data, guint32 raw_symbol_len, gboolean refonly, MonoError *error) -{ - MonoAssembly *ass = NULL; - MonoImageOpenStatus status; - MonoImage *image = mono_image_open_from_data_internal (alc, (char*)assembly_data, raw_assembly_len, FALSE, NULL, refonly, FALSE, NULL); - - if (!image) { - mono_error_set_bad_image_by_name (error, "In memory assembly", "0x%p", assembly_data); - return ass; - } - - if (raw_symbol_data) - mono_debug_open_image_from_memory (image, raw_symbol_data, raw_symbol_len); - - MonoAssembly* redirected_asm = NULL; - MonoImageOpenStatus new_status = MONO_IMAGE_OK; - if ((redirected_asm = mono_assembly_binding_applies_to_image (image, &new_status))) { - mono_image_close (image); - image = redirected_asm->image; - mono_image_addref (image); /* so that mono_image close, below, has something to do */ - } else if (new_status != MONO_IMAGE_OK) { - mono_image_close (image); - mono_error_set_bad_image_by_name (error, "In Memory assembly", "0x%p was assembly binding redirected to another assembly that failed to load", assembly_data); - return ass; - } - - MonoAssemblyLoadRequest req; - mono_assembly_request_prepare (&req, sizeof (req), refonly? MONO_ASMCTX_REFONLY : MONO_ASMCTX_INDIVIDUAL); - req.alc = alc; - ass = mono_assembly_request_load_from (image, "", &req, &status); - - if (!ass) { - mono_image_close (image); - mono_error_set_bad_image_by_name (error, "In Memory assembly", "0x%p", assembly_data); - return ass; - } - - /* Clear the reference added by mono_image_open_from_data_internal above */ - mono_image_close (image); - - return ass; -} - -MonoReflectionAssemblyHandle -ves_icall_System_AppDomain_LoadAssembly (MonoAppDomainHandle ad, MonoStringHandle assRef, MonoObjectHandle evidence, MonoBoolean refOnly, MonoStackCrawlMark *stack_mark, MonoError *error) -{ - MonoDomain *domain = MONO_HANDLE_GETVAL (ad, data); - MonoImageOpenStatus status = MONO_IMAGE_OK; - MonoAssembly *ass; - MonoAssemblyName aname; - gchar *name = NULL; - gboolean parsed; - - g_assert (!MONO_HANDLE_IS_NULL (assRef)); - - name = mono_string_handle_to_utf8 (assRef, error); - goto_if_nok (error, fail); - parsed = mono_assembly_name_parse (name, &aname); - g_free (name); - - if (!parsed) { - MonoReflectionAssemblyHandle refass = MONO_HANDLE_CAST (MonoReflectionAssembly, NULL_HANDLE); - /* This is a parse error... */ - if (!refOnly) { - MonoAssembly *assm = mono_try_assembly_resolve_handle (domain, assRef, NULL, refOnly, error); - goto_if_nok (error, fail); - if (assm) { - refass = mono_assembly_get_object_handle (domain, assm, error); - goto_if_nok (error, fail); - } - } - return refass; - } - - MonoAssemblyContextKind asmctx; - asmctx = refOnly ? MONO_ASMCTX_REFONLY : MONO_ASMCTX_DEFAULT; - const char *basedir; - basedir = NULL; - if (!refOnly) { - /* Determine if the current assembly is in LoadFrom context. - * If it is, we must include the executing assembly's basedir - * when probing for the given assembly name, and also load the - * requested assembly in LoadFrom context. - */ - MonoAssembly *executing_assembly = mono_runtime_get_caller_from_stack_mark (stack_mark); - if (executing_assembly && mono_asmctx_get_kind (&executing_assembly->context) == MONO_ASMCTX_LOADFROM) { - asmctx = MONO_ASMCTX_LOADFROM; - basedir = executing_assembly->basedir; - } - } - - - MonoAssemblyByNameRequest req; - mono_assembly_request_prepare (&req.request, sizeof (req), asmctx); - req.basedir = basedir; - req.no_postload_search = TRUE; - ass = mono_assembly_request_byname (&aname, &req, &status); - mono_assembly_name_free (&aname); - - if (!ass) { - /* MS.NET doesn't seem to call the assembly resolve handler for refonly assemblies */ - if (!refOnly) { - ass = mono_try_assembly_resolve_handle (domain, assRef, NULL, refOnly, error); - goto_if_nok (error, fail); - } - if (!ass) - goto fail; - } - - g_assert (ass); - MonoReflectionAssemblyHandle refass; - refass = mono_assembly_get_object_handle (domain, ass, error); - goto_if_nok (error, fail); - - MONO_HANDLE_SET (refass, evidence, evidence); - - return refass; -fail: - return MONO_HANDLE_CAST (MonoReflectionAssembly, NULL_HANDLE); -} - -void -ves_icall_System_AppDomain_InternalUnload (gint32 domain_id, MonoError *error) -{ - MonoDomain * domain = mono_domain_get_by_id (domain_id); - - if (NULL == domain) { - mono_error_set_execution_engine (error, "Failed to unload domain, domain id not found"); - return; - } - - if (domain == mono_get_root_domain ()) { - mono_error_set_generic_error (error, "System", "CannotUnloadAppDomainException", "The default appdomain can not be unloaded."); - return; - } - - /* - * Unloading seems to cause problems when running NUnit/NAnt, hence - * this workaround. - */ - if (g_hasenv ("MONO_NO_UNLOAD")) - return; - - MonoException *exc = NULL; - mono_domain_try_unload (domain, (MonoObject**)&exc); - if (exc) - mono_error_set_exception_instance (error, exc); -} - -MonoBoolean -ves_icall_System_AppDomain_InternalIsFinalizingForUnload (gint32 domain_id, MonoError *error) -{ - MonoDomain *domain = mono_domain_get_by_id (domain_id); - - if (!domain) - return TRUE; - - return mono_domain_is_unloading (domain); -} - -void -ves_icall_System_AppDomain_DoUnhandledException (MonoAppDomainHandle ad, MonoExceptionHandle exc, MonoError *error) -{ - mono_unhandled_exception_checked (MONO_HANDLE_CAST (MonoObject, exc), error); - mono_error_assert_ok (error); -} - -gint32 -ves_icall_System_AppDomain_ExecuteAssembly (MonoAppDomainHandle ad, - MonoReflectionAssemblyHandle refass, MonoArrayHandle args, - MonoError *error) -{ - MonoImage *image; - MonoMethod *method; - - g_assert (!MONO_HANDLE_IS_NULL (refass)); - MonoAssembly *assembly = MONO_HANDLE_GETVAL (refass, assembly); - image = assembly->image; - g_assert (image); - - method = mono_get_method_checked (image, mono_image_get_entry_point (image), NULL, NULL, error); - - if (!method) - g_error ("No entry point method found in %s due to %s", image->name, mono_error_get_message (error)); - - if (MONO_HANDLE_IS_NULL (args)) { - MonoDomain *domain = MONO_HANDLE_GETVAL (ad, data); - MONO_HANDLE_ASSIGN (args , mono_array_new_handle (domain, mono_defaults.string_class, 0, error)); - mono_error_assert_ok (error); - } - - int res = mono_runtime_exec_main_checked (method, MONO_HANDLE_RAW (args), error); - return res; -} - -MonoAppDomainHandle -ves_icall_System_AppDomain_InternalSetDomain (MonoAppDomainHandle ad, MonoError* error) -{ - error_init (error); - MonoDomain *old_domain = mono_domain_get (); - - if (!mono_domain_set_fast (MONO_HANDLE_GETVAL (ad, data), FALSE)) { - mono_error_set_appdomain_unloaded (error); - return MONO_HANDLE_CAST (MonoAppDomain, NULL_HANDLE); - } - - return MONO_HANDLE_NEW (MonoAppDomain, old_domain->domain); -} - -MonoAppDomainHandle -ves_icall_System_AppDomain_InternalSetDomainByID (gint32 domainid, MonoError *error) -{ - MonoDomain *current_domain = mono_domain_get (); - MonoDomain *domain = mono_domain_get_by_id (domainid); - - if (!domain || !mono_domain_set_fast (domain, FALSE)) { - mono_error_set_appdomain_unloaded (error); - return MONO_HANDLE_CAST (MonoAppDomain, NULL_HANDLE); - } - - return MONO_HANDLE_NEW (MonoAppDomain, current_domain->domain); -} - -void -ves_icall_System_AppDomain_InternalPushDomainRef (MonoAppDomainHandle ad, MonoError *error) -{ - error_init (error); - mono_thread_push_appdomain_ref (MONO_HANDLE_GETVAL (ad, data)); -} - -void -ves_icall_System_AppDomain_InternalPushDomainRefByID (gint32 domain_id, MonoError *error) -{ - error_init (error); - MonoDomain *domain = mono_domain_get_by_id (domain_id); - - if (!domain) { - /* - * Raise an exception to prevent the managed code from executing a pop - * later. - */ - mono_error_set_appdomain_unloaded (error); - return; - } - - mono_thread_push_appdomain_ref (domain); -} - -void -ves_icall_System_AppDomain_InternalPopDomainRef (MonoError *error) -{ - error_init (error); - mono_thread_pop_appdomain_ref (); -} - -MonoAppContextHandle -ves_icall_System_AppDomain_InternalGetContext (MonoError *error) -{ - error_init (error); - return mono_context_get_handle (); -} - -MonoAppContextHandle -ves_icall_System_AppDomain_InternalGetDefaultContext (MonoError *error) -{ - error_init (error); - return MONO_HANDLE_NEW (MonoAppContext, mono_domain_get ()->default_context); -} - -MonoAppContextHandle -ves_icall_System_AppDomain_InternalSetContext (MonoAppContextHandle mc, MonoError *error) -{ - error_init (error); - MonoAppContextHandle old_context = mono_context_get_handle (); - - mono_context_set_handle (mc); - - return old_context; -} - -MonoStringHandle -ves_icall_System_AppDomain_InternalGetProcessGuid (MonoStringHandle newguid, MonoError *error) -{ - error_init (error); - MonoDomain* mono_root_domain = mono_get_root_domain (); - mono_domain_lock (mono_root_domain); - if (process_guid_set) { - mono_domain_unlock (mono_root_domain); - return mono_string_new_utf16_handle (mono_domain_get (), process_guid, sizeof(process_guid)/2, error); - } - uint32_t gchandle = mono_gchandle_from_handle (MONO_HANDLE_CAST (MonoObject, newguid), TRUE); - memcpy (process_guid, mono_string_chars_internal (MONO_HANDLE_RAW (newguid)), sizeof(process_guid)); - mono_gchandle_free_internal (gchandle); - process_guid_set = TRUE; - mono_domain_unlock (mono_root_domain); - return newguid; -} - -/** - * mono_domain_is_unloading: - */ -gboolean -mono_domain_is_unloading (MonoDomain *domain) -{ - if (domain->state == MONO_APPDOMAIN_UNLOADING || domain->state == MONO_APPDOMAIN_UNLOADED) - return TRUE; - else - return FALSE; -} - -static void -clear_cached_vtable (MonoVTable *vtable) -{ - MonoClass *klass = vtable->klass; - MonoDomain *domain = vtable->domain; - MonoClassRuntimeInfo *runtime_info; - void *data; - - runtime_info = m_class_get_runtime_info (klass); - if (runtime_info && runtime_info->max_domain >= domain->domain_id) - runtime_info->domain_vtables [domain->domain_id] = NULL; - if (m_class_has_static_refs (klass) && (data = mono_vtable_get_static_field_data (vtable))) - mono_gc_free_fixed (data); -} - -static G_GNUC_UNUSED void -zero_static_data (MonoVTable *vtable) -{ - MonoClass *klass = vtable->klass; - void *data; - - if (m_class_has_static_refs (klass) && (data = mono_vtable_get_static_field_data (vtable))) - mono_gc_bzero_aligned (data, mono_class_data_size (klass)); -} - -typedef struct unload_data { - gboolean done; - MonoDomain *domain; - char *failure_reason; - gint32 refcount; -} unload_data; - -static void -unload_data_unref (unload_data *data) -{ - if (!data) - return; - gint32 count; - do { - mono_atomic_load_acquire (count, gint32, &data->refcount); - g_assert (count >= 1 && count <= 2); - if (count == 1) { - g_free (data); - return; - } - } while (mono_atomic_cas_i32 (&data->refcount, count - 1, count) != count); -} - -static void -deregister_reflection_info_roots_from_list (MonoImage *image) -{ - GSList *list = image->reflection_info_unregister_classes; - - while (list) { - MonoClass *klass = (MonoClass *)list->data; - - mono_class_free_ref_info (klass); - - list = list->next; - } - - image->reflection_info_unregister_classes = NULL; -} - -static void -deregister_reflection_info_roots (MonoDomain *domain) -{ - GSList *list; - - mono_domain_assemblies_lock (domain); - for (list = domain->domain_assemblies; list; list = list->next) { - MonoAssembly *assembly = (MonoAssembly *)list->data; - MonoImage *image = assembly->image; - int i; - - /* - * No need to take the image lock here since dynamic images are appdomain bound and - * at this point the mutator is gone. Taking the image lock here would mean - * promoting it from a simple lock to a complex lock, which we better avoid if - * possible. - */ - if (image_is_dynamic (image)) - deregister_reflection_info_roots_from_list (image); - - for (i = 0; i < image->module_count; ++i) { - MonoImage *module = image->modules [i]; - if (module && image_is_dynamic (module)) - deregister_reflection_info_roots_from_list (module); - } - } - mono_domain_assemblies_unlock (domain); -} - -static gsize WINAPI -unload_thread_main (void *arg) -{ - ERROR_DECL (error); - unload_data *data = (unload_data*)arg; - MonoDomain *domain = data->domain; - MonoInternalThread *internal; - int i; - gsize result = 1; // failure - - internal = mono_thread_internal_current (); - - MonoString *thread_name_str = mono_string_new_checked (mono_domain_get (), "Domain unloader", error); - if (is_ok (error)) - mono_thread_set_name_internal (internal, thread_name_str, MonoSetThreadNameFlag_Permanent, error); - if (!is_ok (error)) { - data->failure_reason = g_strdup (mono_error_get_message (error)); - goto failure; - } - - /* - * FIXME: Abort our parent thread last, so we can return a failure - * indication if aborting times out. - */ - if (!mono_threads_abort_appdomain_threads (domain, -1)) { - data->failure_reason = g_strdup_printf ("Aborting of threads in domain %s timed out.", domain->friendly_name); - goto failure; - } - - if (!mono_threadpool_remove_domain_jobs (domain, -1)) { - data->failure_reason = g_strdup_printf ("Cleanup of threadpool jobs of domain %s timed out.", domain->friendly_name); - goto failure; - } - - /* Finalize all finalizable objects in the doomed appdomain */ - if (!mono_domain_finalize (domain, -1)) { - data->failure_reason = g_strdup_printf ("Finalization of domain %s timed out.", domain->friendly_name); - goto failure; - } - - /* Clear references to our vtables in class->runtime_info. - * We also hold the loader lock because we're going to change - * class->runtime_info. - */ - - mono_loader_lock (); //FIXME why do we need the loader lock here? - mono_domain_lock (domain); - /* - * We need to make sure that we don't have any remsets - * pointing into static data of the to-be-freed domain because - * at the next collections they would be invalid. So what we - * do is we first zero all static data and then do a minor - * collection. Because all references in the static data will - * now be null we won't do any unnecessary copies and after - * the collection there won't be any more remsets. - */ - for (i = 0; i < domain->class_vtable_array->len; ++i) - zero_static_data ((MonoVTable *)g_ptr_array_index (domain->class_vtable_array, i)); - mono_gc_collect (0); - for (i = 0; i < domain->class_vtable_array->len; ++i) - clear_cached_vtable ((MonoVTable *)g_ptr_array_index (domain->class_vtable_array, i)); - deregister_reflection_info_roots (domain); - - mono_assembly_cleanup_domain_bindings (domain->domain_id); - - mono_domain_unlock (domain); - mono_loader_unlock (); - - domain->state = MONO_APPDOMAIN_UNLOADED; - - /* printf ("UNLOADED %s.\n", domain->friendly_name); */ - - /* remove from the handle table the items related to this domain */ - mono_gchandle_free_domain (domain); - - mono_domain_free (domain, FALSE); - - mono_gc_collect (mono_gc_max_generation ()); - - result = 0; // success -exit: - mono_error_cleanup (error); - mono_atomic_store_release (&data->done, TRUE); - unload_data_unref (data); - return result; - -failure: - result = 1; - goto exit; -} - -/** - * mono_domain_unload: - * \param domain The domain to unload - * - * Unloads an appdomain. Follows the process outlined in the comment - * for \c mono_domain_try_unload. - */ -void -mono_domain_unload (MonoDomain *domain) -{ - MONO_ENTER_GC_UNSAFE; - MonoObject *exc = NULL; - mono_domain_try_unload (domain, &exc); - MONO_EXIT_GC_UNSAFE; -} - -static MonoThreadInfoWaitRet -guarded_wait (MonoThreadHandle *thread_handle, guint32 timeout, gboolean alertable) -{ - MonoThreadInfoWaitRet result; - - MONO_ENTER_GC_SAFE; - result = mono_thread_info_wait_one_handle (thread_handle, timeout, alertable); - MONO_EXIT_GC_SAFE; - - return result; -} - -/** - * mono_domain_unload: - * \param domain The domain to unload - * \param exc Exception information - * - * Unloads an appdomain. Follows the process outlined in: - * http://blogs.gotdotnet.com/cbrumme - * - * If doing things the 'right' way is too hard or complex, we do it the - * 'simple' way, which means do everything needed to avoid crashes and - * memory leaks, but not much else. - * - * It is required to pass a valid reference to the exc argument, upon return - * from this function *exc will be set to the exception thrown, if any. - * - * If this method is not called from an icall (embedded scenario for instance), - * it must not be called with any managed frames on the stack, since the unload - * process could end up trying to abort the current thread. - */ -void -mono_domain_try_unload (MonoDomain *domain, MonoObject **exc) -{ - HANDLE_FUNCTION_ENTER (); - ERROR_DECL (error); - MonoThreadHandle *thread_handle = NULL; - MonoAppDomainState prev_state; - MonoMethod *method; - unload_data *thread_data = NULL; - MonoInternalThreadHandle internal; - MonoDomain *caller_domain = mono_domain_get (); - - /* printf ("UNLOAD STARTING FOR %s (%p) IN THREAD 0x%x.\n", domain->friendly_name, domain, mono_native_thread_id_get ()); */ - - /* Atomically change our state to UNLOADING */ - prev_state = (MonoAppDomainState)mono_atomic_cas_i32 ((gint32*)&domain->state, - MONO_APPDOMAIN_UNLOADING_START, - MONO_APPDOMAIN_CREATED); - if (prev_state != MONO_APPDOMAIN_CREATED) { - switch (prev_state) { - case MONO_APPDOMAIN_UNLOADING_START: - case MONO_APPDOMAIN_UNLOADING: - *exc = (MonoObject *) mono_get_exception_cannot_unload_appdomain ("Appdomain is already being unloaded."); - goto exit; - case MONO_APPDOMAIN_UNLOADED: - *exc = (MonoObject *) mono_get_exception_cannot_unload_appdomain ("Appdomain is already unloaded."); - goto exit; - default: - g_warning ("Invalid appdomain state %d", prev_state); - g_assert_not_reached (); - } - } - - mono_domain_set_fast (domain, FALSE); - /* Notify OnDomainUnload listeners */ - method = mono_class_get_method_from_name_checked (domain->domain->mbr.obj.vtable->klass, "DoDomainUnload", -1, 0, error); - g_assert (method); - - mono_runtime_try_invoke (method, domain->domain, NULL, exc, error); - - if (!mono_error_ok (error)) { - if (*exc) - mono_error_cleanup (error); - else - *exc = (MonoObject*)mono_error_convert_to_exception (error); - } - - if (*exc) { - /* Roll back the state change */ - domain->state = MONO_APPDOMAIN_CREATED; - mono_domain_set_fast (caller_domain, FALSE); - goto exit; - } - mono_domain_set_fast (caller_domain, FALSE); - - thread_data = g_new0 (unload_data, 1); - thread_data->domain = domain; - thread_data->failure_reason = NULL; - thread_data->done = FALSE; - thread_data->refcount = 2; /*Must be 2: unload thread + initiator */ - - /*The managed callback finished successfully, now we start tearing down the appdomain*/ - domain->state = MONO_APPDOMAIN_UNLOADING; - /* - * First we create a separate thread for unloading, since - * we might have to abort some threads, including the current one. - * - * Have to attach to the runtime so shutdown can wait for this thread. - * - * Force it to be attached to avoid racing during shutdown. - */ - internal = mono_thread_create_internal_handle (mono_get_root_domain (), unload_thread_main, thread_data, MONO_THREAD_CREATE_FLAGS_FORCE_CREATE, error); - mono_error_assert_ok (error); - - thread_handle = mono_threads_open_thread_handle (MONO_HANDLE_GETVAL (internal, handle)); - - /* Wait for the thread */ - while (!thread_data->done && guarded_wait (thread_handle, MONO_INFINITE_WAIT, TRUE) == MONO_THREAD_INFO_WAIT_RET_ALERTED) { - if (mono_thread_internal_has_appdomain_ref (mono_thread_internal_current (), domain) && (mono_thread_interruption_requested ())) { - /* The unload thread tries to abort us */ - /* The icall wrapper will execute the abort */ - goto exit; - } - } - - if (thread_data->failure_reason) { - /* Roll back the state change */ - domain->state = MONO_APPDOMAIN_CREATED; - - g_warning ("%s", thread_data->failure_reason); - - *exc = (MonoObject *) mono_get_exception_cannot_unload_appdomain (thread_data->failure_reason); - - g_free (thread_data->failure_reason); - thread_data->failure_reason = NULL; - } - -exit: - mono_threads_close_thread_handle (thread_handle); - unload_data_unref (thread_data); - HANDLE_FUNCTION_RETURN (); -} - -#ifdef ENABLE_NETCORE - -/* Remember properties so they can be be installed in AppContext during runtime init */ -void -mono_runtime_register_appctx_properties (int nprops, const char **keys, const char **values) -{ - n_appctx_props = nprops; - appctx_keys = g_new0 (char*, nprops); - appctx_values = g_new0 (char*, nprops); - - for (int i = 0; i < nprops; ++i) { - appctx_keys [i] = g_strdup (keys [i]); - appctx_values [i] = g_strdup (values [i]); - } -} - -static GENERATE_GET_CLASS_WITH_CACHE (appctx, "System", "AppContext") - -/* Install properties into AppContext */ -void -mono_runtime_install_appctx_properties (void) -{ - ERROR_DECL (error); - gpointer args [3]; - - MonoMethod *setup = mono_class_get_method_from_name_checked (mono_class_get_appctx_class (), "Setup", 3, 0, error); - g_assert (setup); - - // FIXME: TRUSTED_PLATFORM_ASSEMBLIES is very large - - /* internal static unsafe void Setup(char** pNames, char** pValues, int count) */ - args [0] = appctx_keys; - args [1] = appctx_values; - args [2] = &n_appctx_props; - - mono_runtime_invoke_checked (setup, NULL, args, error); - mono_error_assert_ok (error); - - /* No longer needed */ - for (int i = 0; i < n_appctx_props; ++i) { - g_free (appctx_keys [i]); - g_free (appctx_values [i]); - } - g_free (appctx_keys); - g_free (appctx_values); - appctx_keys = NULL; - appctx_values = NULL; -} - -#endif - diff --git a/mono/metadata/appdomain.c.REMOVED.git-id b/mono/metadata/appdomain.c.REMOVED.git-id new file mode 100644 index 0000000000..f2dc147292 --- /dev/null +++ b/mono/metadata/appdomain.c.REMOVED.git-id @@ -0,0 +1 @@ +afe43a069e7f09e89af052299b2672e80db09bf5 \ No newline at end of file diff --git a/mono/metadata/appdomain.h b/mono/metadata/appdomain.h index fc82e198b1..ab260646e9 100644 --- a/mono/metadata/appdomain.h +++ b/mono/metadata/appdomain.h @@ -49,7 +49,7 @@ mono_runtime_cleanup (MonoDomain *domain); MONO_API void mono_install_runtime_cleanup (MonoDomainFunc func); -MONO_API void +MONO_API MONO_RT_EXTERNAL_ONLY void mono_runtime_quit (void); MONO_API void diff --git a/mono/metadata/assembly-internals.h b/mono/metadata/assembly-internals.h index 75702c8331..96e7da3013 100644 --- a/mono/metadata/assembly-internals.h +++ b/mono/metadata/assembly-internals.h @@ -47,7 +47,7 @@ mono_assembly_get_assemblyref_checked (MonoImage *image, int index, MonoAssembly MONO_API MonoImage* mono_assembly_load_module_checked (MonoAssembly *assembly, uint32_t idx, MonoError *error); -MonoAssembly* mono_assembly_load_with_partial_name_internal (const char *name, MonoImageOpenStatus *status); +MonoAssembly* mono_assembly_load_with_partial_name_internal (const char *name, MonoAssemblyLoadContext *alc, MonoImageOpenStatus *status); typedef gboolean (*MonoAssemblyAsmCtxFromPathFunc) (const char *absfname, MonoAssembly *requesting_assembly, gpointer user_data, MonoAssemblyContextKind *out_asmctx); @@ -56,12 +56,20 @@ void mono_install_assembly_asmctx_from_path_hook (MonoAssemblyAsmCtxFromPathFunc typedef MonoAssembly * (*MonoAssemblyPreLoadFuncV2) (MonoAssemblyLoadContext *alc, MonoAssemblyName *aname, char **assemblies_path, gboolean refonly, gpointer user_data, MonoError *error); -void mono_install_assembly_preload_hook_v2 (MonoAssemblyPreLoadFuncV2 func, void *user_data, gboolean refonly); +void mono_install_assembly_preload_hook_v2 (MonoAssemblyPreLoadFuncV2 func, gpointer user_data, gboolean refonly); typedef MonoAssembly * (*MonoAssemblySearchFuncV2) (MonoAssemblyLoadContext *alc, MonoAssembly *requesting, MonoAssemblyName *aname, gboolean refonly, gboolean postload, gpointer user_data, MonoError *error); void -mono_install_assembly_search_hook_v2 (MonoAssemblySearchFuncV2 func, void *user_data, gboolean refonly, gboolean postload); +mono_install_assembly_search_hook_v2 (MonoAssemblySearchFuncV2 func, gpointer user_data, gboolean refonly, gboolean postload); + +typedef void (*MonoAssemblyLoadFuncV2) (MonoAssemblyLoadContext *alc, MonoAssembly *assembly, gpointer user_data, MonoError *error); + +void +mono_install_assembly_load_hook_v2 (MonoAssemblyLoadFuncV2 func, gpointer user_data); + +void +mono_assembly_invoke_load_hook_internal (MonoAssemblyLoadContext *alc, MonoAssembly *ass); /* If predicate returns true assembly should be loaded, if false ignore it. */ typedef gboolean (*MonoAssemblyCandidatePredicate)(MonoAssembly *, gpointer); @@ -94,9 +102,17 @@ typedef struct MonoAssemblyByNameRequest { /* FIXME: predicate unused? */ } MonoAssemblyByNameRequest; -void mono_assembly_request_prepare (MonoAssemblyLoadRequest *req, - size_t req_size, - MonoAssemblyContextKind asmctx); +void mono_assembly_request_prepare_load (MonoAssemblyLoadRequest *req, + MonoAssemblyContextKind asmctx, + MonoAssemblyLoadContext *alc); + +void mono_assembly_request_prepare_open (MonoAssemblyOpenRequest *req, + MonoAssemblyContextKind asmctx, + MonoAssemblyLoadContext *alc); + +void mono_assembly_request_prepare_byname (MonoAssemblyByNameRequest *req, + MonoAssemblyContextKind asmctx, + MonoAssemblyLoadContext *alc); MonoAssembly* mono_assembly_request_open (const char *filename, const MonoAssemblyOpenRequest *req, @@ -119,7 +135,7 @@ gboolean mono_assembly_candidate_predicate_sn_same_name (MonoAssembly *candidate, gpointer wanted_name); MonoAssembly* -mono_assembly_binding_applies_to_image (MonoImage* image, MonoImageOpenStatus *status); +mono_assembly_binding_applies_to_image (MonoAssemblyLoadContext *alc, MonoImage* image, MonoImageOpenStatus *status); MonoAssembly* mono_assembly_load_from_assemblies_path (gchar **assemblies_path, MonoAssemblyName *aname, MonoAssemblyContextKind asmctx); diff --git a/mono/metadata/assembly-load-context.c b/mono/metadata/assembly-load-context.c index e33ba7f615..1370de2845 100644 --- a/mono/metadata/assembly-load-context.c +++ b/mono/metadata/assembly-load-context.c @@ -1,18 +1,17 @@ #include "config.h" +#include "mono/utils/mono-compiler.h" + +#ifdef ENABLE_NETCORE // MonoAssemblyLoadContext support only in netcore Mono + #include "mono/metadata/assembly.h" #include "mono/metadata/domain-internals.h" +#include "mono/metadata/exception-internals.h" #include "mono/metadata/icall-decl.h" #include "mono/metadata/loader-internals.h" #include "mono/metadata/loaded-images-internals.h" #include "mono/utils/mono-error-internals.h" #include "mono/utils/mono-logger-internals.h" -#ifdef ENABLE_NETCORE -/* MonoAssemblyLoadContext support only in netcore Mono */ - -static -GENERATE_GET_CLASS_WITH_CACHE_DECL (assembly_load_context); - GENERATE_GET_CLASS_WITH_CACHE (assembly_load_context, "System.Runtime.Loader", "AssemblyLoadContext"); void @@ -39,8 +38,8 @@ mono_alc_cleanup (MonoAssemblyLoadContext *alc) * be less than optimal on netcore, but its removal is too likely to cause issues for now. * 2. An ALC will have been removed from the domain before cleanup. */ - GSList *tmp; - MonoDomain *domain = alc->domain; + //GSList *tmp; + //MonoDomain *domain = alc->domain; /* * Missing steps: @@ -107,6 +106,37 @@ ves_icall_System_Runtime_Loader_AssemblyLoadContext_GetLoadContextForAssembly (M return GUINT_TO_POINTER (alc->gchandle); } +gpointer +ves_icall_System_Runtime_Loader_AssemblyLoadContext_InternalLoadUnmanagedDllFromPath (MonoStringHandle fname, MonoError *error) +{ + gpointer res = NULL; + MonoDl *lib = NULL; + char *filename = NULL; + char *local_error = NULL; + + g_assert (!MONO_HANDLE_IS_NULL (fname)); // should have already been checked in managed, so we assert + + filename = mono_string_handle_to_utf8 (fname, error); + goto_if_nok (error, exit); + + g_assert (g_path_is_absolute (filename)); // again, checked in managed + + lib = mono_dl_open (filename, MONO_DL_LAZY, &local_error); + + if (lib == NULL) { + mono_error_set_file_not_found (error, filename, "%s", local_error); + goto exit; + } + + res = lib->handle; + +exit: + g_free (lib); + g_free (filename); + g_free (local_error); + return res; +} + gboolean mono_alc_is_default (MonoAssemblyLoadContext *alc) { @@ -118,16 +148,21 @@ invoke_resolve_method (MonoMethod *resolve_method, MonoAssemblyLoadContext *alc, { MonoAssembly *result = NULL; char* aname_str = NULL; + + if (mono_runtime_get_no_exec ()) + return NULL; + HANDLE_FUNCTION_ENTER (); aname_str = mono_stringify_assembly_name (aname); - MonoStringHandle aname_obj = mono_string_new_handle (mono_domain_get (), aname_str, error); + MonoStringHandle aname_obj = mono_string_new_handle (mono_alc_domain (alc), aname_str, error); goto_if_nok (error, leave); MonoReflectionAssemblyHandle assm; - gpointer args[2]; - args [0] = GUINT_TO_POINTER (alc->gchandle); + gpointer gchandle = GUINT_TO_POINTER (alc->gchandle); + gpointer args [2]; + args [0] = &gchandle; args [1] = MONO_HANDLE_RAW (aname_obj); assm = MONO_HANDLE_CAST (MonoReflectionAssembly, mono_runtime_try_invoke_handle (resolve_method, NULL_HANDLE, args, error)); goto_if_nok (error, leave); @@ -239,6 +274,6 @@ mono_alc_invoke_resolve_using_resolve_satellite_nofail (MonoAssemblyLoadContext return result; } - - #endif /* ENABLE_NETCORE */ + +MONO_EMPTY_SOURCE_FILE (assembly_load_context) diff --git a/mono/metadata/assembly.c.REMOVED.git-id b/mono/metadata/assembly.c.REMOVED.git-id index dad339fa84..46bc1ac87b 100644 --- a/mono/metadata/assembly.c.REMOVED.git-id +++ b/mono/metadata/assembly.c.REMOVED.git-id @@ -1 +1 @@ -043019526d24994448309d8e0df36f0de6c1d013 \ No newline at end of file +fc7656937a997d785ce49d5ed636027ccaa5a649 \ No newline at end of file diff --git a/mono/metadata/assembly.h b/mono/metadata/assembly.h index d0e4a3d7fa..272e4fc710 100644 --- a/mono/metadata/assembly.h +++ b/mono/metadata/assembly.h @@ -63,7 +63,8 @@ MONO_API char* mono_stringify_assembly_name (MonoAssemblyName *aname); /* Installs a function which is called each time a new assembly is loaded. */ typedef void (*MonoAssemblyLoadFunc) (MonoAssembly *assembly, void* user_data); -MONO_API void mono_install_assembly_load_hook (MonoAssemblyLoadFunc func, void* user_data); +MONO_API MONO_RT_EXTERNAL_ONLY void +mono_install_assembly_load_hook (MonoAssemblyLoadFunc func, void* user_data); /* * Installs a new function which is used to search the list of loaded @@ -98,12 +99,13 @@ typedef MonoAssembly * (*MonoAssemblyPreLoadFunc) (MonoAssemblyName *aname, char **assemblies_path, void* user_data); -MONO_API void mono_install_assembly_preload_hook (MonoAssemblyPreLoadFunc func, - void* user_data); -MONO_API void mono_install_assembly_refonly_preload_hook (MonoAssemblyPreLoadFunc func, - void* user_data); +MONO_API MONO_RT_EXTERNAL_ONLY +void mono_install_assembly_preload_hook (MonoAssemblyPreLoadFunc func, void* user_data); +MONO_API MONO_RT_EXTERNAL_ONLY +void mono_install_assembly_refonly_preload_hook (MonoAssemblyPreLoadFunc func, void* user_data); -MONO_API void mono_assembly_invoke_load_hook (MonoAssembly *ass); +MONO_API MONO_RT_EXTERNAL_ONLY void +mono_assembly_invoke_load_hook (MonoAssembly *ass); MONO_API MonoAssemblyName* mono_assembly_name_new (const char *name); MONO_API const char* mono_assembly_name_get_name (MonoAssemblyName *aname); diff --git a/mono/metadata/attach.c b/mono/metadata/attach.c index 45fdc3634f..72d994dea3 100644 --- a/mono/metadata/attach.c +++ b/mono/metadata/attach.c @@ -97,7 +97,7 @@ static char *server_uri; static MonoThreadHandle *receiver_thread_handle; -static gboolean stop_receiver_thread; +static volatile gboolean stop_receiver_thread; static gboolean needs_to_start, started; @@ -110,30 +110,26 @@ static void transport_start_receive (void); /* * Functions to decode protocol data */ -static inline int -decode_byte (guint8 *buf, guint8 **endbuf, guint8 *limit) +static int +decode_byte (guint8 const *buf, guint8 const **endbuf, guint8 const *limit) { *endbuf = buf + 1; g_assert (*endbuf <= limit); return buf [0]; } -static inline int -decode_int (guint8 *buf, guint8 **endbuf, guint8 *limit) +static int +decode_int (const guint8 *buf) { - *endbuf = buf + 4; - g_assert (*endbuf <= limit); - return (((int)buf [0]) << 0) | (((int)buf [1]) << 8) | (((int)buf [2]) << 16) | (((int)buf [3]) << 24); } -static char* -decode_string_value (guint8 *buf, guint8 **endbuf, guint8 *limit) +static const char* +decode_string_value (guint8 const *buf, guint8 const **endbuf, guint8 const *limit) { int type; - gint32 length; - guint8 *p = buf; - char *s; + gint32 length; + guint8 const *p = buf; type = decode_byte (p, &p, limit); if (type == PRIM_TYPE_NULL) { @@ -154,12 +150,10 @@ decode_string_value (guint8 *buf, guint8 **endbuf, guint8 *limit) g_assert (length < (1 << 16)); - s = (char *)g_malloc (length + 1); + const char *s = (const char*)p; + p += length + 1; - g_assert (p + length <= limit); - memcpy (s, p, length); - s [length] = '\0'; - p += length; + g_assert (p <= limit); *endbuf = p; @@ -265,24 +259,27 @@ mono_attach_cleanup (void) } static int -mono_attach_load_agent (MonoDomain *domain, char *agent, char *args, MonoObject **exc) +mono_attach_load_agent (MonoDomain *domain, const char *agent, const char *args) { + HANDLE_FUNCTION_ENTER (); + ERROR_DECL (error); MonoAssembly *agent_assembly; MonoImage *image; MonoMethod *method; guint32 entry; - MonoArray *main_args; + MonoArrayHandle main_args; gpointer pa [1]; MonoImageOpenStatus open_status; + int result = 0; MonoAssemblyOpenRequest req; - mono_assembly_request_prepare (&req.request, sizeof (req), MONO_ASMCTX_DEFAULT); + mono_assembly_request_prepare_open (&req, MONO_ASMCTX_DEFAULT, mono_domain_default_alc (mono_domain_get ())); agent_assembly = mono_assembly_request_open (agent, &req, &open_status); if (!agent_assembly) { fprintf (stderr, "Cannot open agent assembly '%s': %s.\n", agent, mono_image_strerror (open_status)); - g_free (agent); - return 2; + result = 2; + goto exit; } /* @@ -293,51 +290,47 @@ mono_attach_load_agent (MonoDomain *domain, char *agent, char *args, MonoObject entry = mono_image_get_entry_point (image); if (!entry) { g_print ("Assembly '%s' doesn't have an entry point.\n", mono_image_get_filename (image)); - g_free (agent); - return 1; + result = 1; + goto exit; } method = mono_get_method_checked (image, entry, NULL, NULL, error); if (method == NULL){ g_print ("The entry point method of assembly '%s' could not be loaded due to %s\n", agent, mono_error_get_message (error)); - mono_error_cleanup (error); - g_free (agent); - return 1; + result = 1; + goto exit; } - - main_args = (MonoArray*)mono_array_new_checked (domain, mono_defaults.string_class, (args == NULL) ? 0 : 1, error); - if (main_args == NULL) { + main_args = mono_array_new_handle (domain, mono_defaults.string_class, (args == NULL) ? 0 : 1, error); + if (MONO_HANDLE_IS_NULL (main_args)) { g_print ("Could not allocate main method args due to %s\n", mono_error_get_message (error)); - mono_error_cleanup (error); - g_free (agent); - return 1; + result = 1; + goto exit; } if (args) { - MonoString *args_str = mono_string_new_checked (domain, args, error); + MonoStringHandle args_str = mono_string_new_handle (domain, args, error); if (!is_ok (error)) { g_print ("Could not allocate main method arg string due to %s\n", mono_error_get_message (error)); - mono_error_cleanup (error); - g_free (agent); - return 1; + result = 1; + goto exit; } - mono_array_set_internal (main_args, MonoString*, 0, args_str); + MONO_HANDLE_ARRAY_SETREF (main_args, 0, args_str); } - - pa [0] = main_args; - mono_runtime_try_invoke (method, NULL, pa, exc, error); + pa [0] = MONO_HANDLE_RAW (main_args); + MonoObject *exc; + mono_runtime_try_invoke (method, NULL, pa, &exc, error); if (!is_ok (error)) { g_print ("The entry point method of assembly '%s' could not be executed due to %s\n", agent, mono_error_get_message (error)); - mono_error_cleanup (error); - g_free (agent); - return 1; + result = 1; + goto exit; } - g_free (agent); - - return 0; + result = 0; +exit: + mono_error_cleanup (error); + HANDLE_FUNCTION_RETURN_VAL (result); } /* @@ -503,18 +496,10 @@ transport_start_receive (void) static gsize WINAPI receiver_thread (void *arg) { - ERROR_DECL (error); - int res, content_len; - guint8 buffer [256]; - guint8 *p, *p_end; - MonoObject *exc; - MonoInternalThread *internal; + MonoInternalThread *internal = mono_thread_internal_current (); + + mono_thread_set_name_constant_ignore_error (internal, "Attach receiver", MonoSetThreadNameFlag_Permanent); - internal = mono_thread_internal_current (); - MonoString *attach_str = mono_string_new_checked (mono_domain_get (), "Attach receiver", error); - mono_error_assert_ok (error); - mono_thread_set_name_internal (internal, attach_str, MonoSetThreadNameFlag_Permanent, error); - mono_error_assert_ok (error); /* Ask the runtime to not abort this thread */ //internal->flags |= MONO_THREAD_FLAG_DONT_MANAGE; /* Ask the runtime to not wait for this thread */ @@ -530,12 +515,13 @@ receiver_thread (void *arg) printf ("attach: Connected.\n"); + guint8* body = NULL; + while (TRUE) { - char *cmd, *agent_name, *agent_args; - guint8 *body; + guint8 buffer [6]; /* Read Header */ - res = read (conn_fd, buffer, 6); + int res = read (conn_fd, buffer, 6); if (res == -1 && errno == EINTR) continue; @@ -546,7 +532,7 @@ receiver_thread (void *arg) if (res != 6) break; - if ((strncmp ((char*)buffer, "MONO", 4) != 0) || buffer [4] != 1 || buffer [5] != 0) { + if (memcmp (buffer, "MONO", 4) != 0 || buffer [4] != 1 || buffer [5] != 0) { fprintf (stderr, "attach: message from server has unknown header.\n"); break; } @@ -556,34 +542,39 @@ receiver_thread (void *arg) if (res != 4) break; - p = buffer; - p_end = p + 8; - - content_len = decode_int (p, &p, p_end); + const int content_len = decode_int (buffer); /* Read message body */ body = (guint8 *)g_malloc (content_len); res = read (conn_fd, body, content_len); - - p = body; - p_end = body + content_len; + if (res != content_len) + break; - cmd = decode_string_value (p, &p, p_end); + guint8 const * p = body; + guint8 const * const p_end = body + content_len; + + char const * const cmd = decode_string_value (p, &p, p_end); if (cmd == NULL) break; - g_assert (!strcmp (cmd, "attach")); - agent_name = decode_string_value (p, &p, p_end); - agent_args = decode_string_value (p, &p, p_end); + // 10: 7:attach\0 + one byte each for the types of cmd, name, args. + g_assert (content_len >= 10 && !memcmp (cmd, "attach", 7)); + + char const * const agent_name = decode_string_value (p, &p, p_end); + char const * const agent_args = decode_string_value (p, &p, p_end); printf ("attach: Loading agent '%s'.\n", agent_name); - mono_attach_load_agent (mono_domain_get (), agent_name, agent_args, &exc); + mono_attach_load_agent (mono_domain_get (), agent_name, agent_args); g_free (body); + body = NULL; // FIXME: Send back a result } + g_free (body); + body = NULL; + close (conn_fd); conn_fd = 0; diff --git a/mono/metadata/boehm-gc.c b/mono/metadata/boehm-gc.c index 8414e24e23..2e8a69b875 100644 --- a/mono/metadata/boehm-gc.c +++ b/mono/metadata/boehm-gc.c @@ -900,13 +900,13 @@ mono_gc_wbarrier_set_arrayref_internal (MonoArray *arr, gpointer slot_ptr, MonoO } void -mono_gc_wbarrier_arrayref_copy_internal (gpointer dest_ptr, gpointer src_ptr, int count) +mono_gc_wbarrier_arrayref_copy_internal (gpointer dest_ptr, gconstpointer src_ptr, int count) { mono_gc_memmove_aligned (dest_ptr, src_ptr, count * sizeof (gpointer)); } void -mono_gc_wbarrier_generic_store_internal (gpointer ptr, MonoObject* value) +mono_gc_wbarrier_generic_store_internal (void volatile* ptr, MonoObject* value) { *(void**)ptr = value; } @@ -923,7 +923,7 @@ mono_gc_wbarrier_generic_nostore_internal (gpointer ptr) } void -mono_gc_wbarrier_value_copy_internal (gpointer dest, gpointer src, int count, MonoClass *klass) +mono_gc_wbarrier_value_copy_internal (gpointer dest, gconstpointer src, int count, MonoClass *klass) { mono_gc_memmove_atomic (dest, src, count * mono_class_value_size (klass, NULL)); } @@ -959,371 +959,9 @@ mono_gc_get_restart_signal (void) } #if defined(USE_COMPILER_TLS) && defined(__linux__) && (defined(__i386__) || defined(__x86_64__)) -extern __thread void* GC_thread_tls; -#include "metadata-internals.h" - -static int -shift_amount (int v) -{ - int i = 0; - while (!(v & (1 << i))) - i++; - return i; -} - -enum { - ATYPE_FREEPTR, - ATYPE_FREEPTR_FOR_BOX, - ATYPE_NORMAL, - ATYPE_GCJ, - ATYPE_STRING, - ATYPE_NUM -}; - -static MonoMethod* -create_allocator (int atype, int tls_key, gboolean slowpath) -{ - int index_var, bytes_var, my_fl_var, my_entry_var; - guint32 no_freelist_branch, not_small_enough_branch = 0; - guint32 size_overflow_branch = 0; - MonoMethodBuilder *mb; - MonoMethod *res; - MonoMethodSignature *csig; - const char *name = NULL; - WrapperInfo *info; - - g_assert_not_reached (); - - if (atype == ATYPE_FREEPTR) { - name = slowpath ? "SlowAllocPtrfree" : "AllocPtrfree"; - } else if (atype == ATYPE_FREEPTR_FOR_BOX) { - name = slowpath ? "SlowAllocPtrfreeBox" : "AllocPtrfreeBox"; - } else if (atype == ATYPE_NORMAL) { - name = slowpath ? "SlowAlloc" : "Alloc"; - } else if (atype == ATYPE_GCJ) { - name = slowpath ? "SlowAllocGcj" : "AllocGcj"; - } else if (atype == ATYPE_STRING) { - name = slowpath ? "SlowAllocString" : "AllocString"; - } else { - g_assert_not_reached (); - } - - csig = mono_metadata_signature_alloc (mono_defaults.corlib, 2); - - if (atype == ATYPE_STRING) { - csig->ret = m_class_get_byval_arg (mono_defaults.string_class); - csig->params [0] = mono_get_int_type (); - csig->params [1] = mono_get_int32_type (); - } else { - csig->ret = mono_get_object_type (); - csig->params [0] = mono_get_int_type (); - csig->params [1] = mono_get_int32_type (); - } - - mb = mono_mb_new (mono_defaults.object_class, name, MONO_WRAPPER_ALLOC); - - if (slowpath) - goto always_slowpath; - - bytes_var = mono_mb_add_local (mb, mono_get_int32_type ()); - if (atype == ATYPE_STRING) { - /* a string alloator method takes the args: (vtable, len) */ - /* bytes = (offsetof (MonoString, chars) + ((len + 1) * 2)); */ - mono_mb_emit_ldarg (mb, 1); - mono_mb_emit_icon (mb, 1); - mono_mb_emit_byte (mb, MONO_CEE_ADD); - mono_mb_emit_icon (mb, 1); - mono_mb_emit_byte (mb, MONO_CEE_SHL); - // sizeof (MonoString) might include padding - mono_mb_emit_icon (mb, G_STRUCT_OFFSET (MonoString, chars)); - mono_mb_emit_byte (mb, MONO_CEE_ADD); - mono_mb_emit_stloc (mb, bytes_var); - } else { - mono_mb_emit_ldarg (mb, 1); - mono_mb_emit_stloc (mb, bytes_var); - } - - /* this is needed for strings/arrays only as the other big types are never allocated with this method */ - if (atype == ATYPE_STRING) { - /* check for size */ - /* if (!SMALL_ENOUGH (bytes)) jump slow_path;*/ - mono_mb_emit_ldloc (mb, bytes_var); - mono_mb_emit_icon (mb, (NFREELISTS-1) * GRANULARITY); - not_small_enough_branch = mono_mb_emit_short_branch (mb, MONO_CEE_BGT_UN_S); - /* check for overflow */ - mono_mb_emit_ldloc (mb, bytes_var); - mono_mb_emit_icon (mb, sizeof (MonoString)); - size_overflow_branch = mono_mb_emit_short_branch (mb, MONO_CEE_BLE_UN_S); - } - - /* int index = INDEX_FROM_BYTES(bytes); */ - index_var = mono_mb_add_local (mb, mono_get_int32_type ()); - - mono_mb_emit_ldloc (mb, bytes_var); - mono_mb_emit_icon (mb, GRANULARITY - 1); - mono_mb_emit_byte (mb, MONO_CEE_ADD); - mono_mb_emit_icon (mb, shift_amount (GRANULARITY)); - mono_mb_emit_byte (mb, MONO_CEE_SHR_UN); - mono_mb_emit_icon (mb, shift_amount (sizeof (gpointer))); - mono_mb_emit_byte (mb, MONO_CEE_SHL); - /* index var is already adjusted into bytes */ - mono_mb_emit_stloc (mb, index_var); - - my_fl_var = mono_mb_add_local (mb, mono_get_int_type ()); - my_entry_var = mono_mb_add_local (mb, mono_get_int_type ()); - /* my_fl = ((GC_thread)tsd) -> ptrfree_freelists + index; */ - mono_mb_emit_byte (mb, MONO_CUSTOM_PREFIX); - mono_mb_emit_byte (mb, 0x0D); /* CEE_MONO_TLS */ - mono_mb_emit_i4 (mb, tls_key); - if (atype == ATYPE_FREEPTR || atype == ATYPE_FREEPTR_FOR_BOX || atype == ATYPE_STRING) - mono_mb_emit_icon (mb, G_STRUCT_OFFSET (struct GC_Thread_Rep, tlfs) - + G_STRUCT_OFFSET (struct thread_local_freelists, - ptrfree_freelists)); - else if (atype == ATYPE_NORMAL) - mono_mb_emit_icon (mb, G_STRUCT_OFFSET (struct GC_Thread_Rep, tlfs) - + G_STRUCT_OFFSET (struct thread_local_freelists, - normal_freelists)); - else if (atype == ATYPE_GCJ) - mono_mb_emit_icon (mb, G_STRUCT_OFFSET (struct GC_Thread_Rep, tlfs) - + G_STRUCT_OFFSET (struct thread_local_freelists, - gcj_freelists)); - else - g_assert_not_reached (); - mono_mb_emit_byte (mb, MONO_CEE_ADD); - mono_mb_emit_ldloc (mb, index_var); - mono_mb_emit_byte (mb, MONO_CEE_ADD); - mono_mb_emit_stloc (mb, my_fl_var); - - /* my_entry = *my_fl; */ - mono_mb_emit_ldloc (mb, my_fl_var); - mono_mb_emit_byte (mb, MONO_CEE_LDIND_I); - mono_mb_emit_stloc (mb, my_entry_var); - - /* if (EXPECT((word)my_entry >= HBLKSIZE, 1)) { */ - mono_mb_emit_ldloc (mb, my_entry_var); - mono_mb_emit_icon (mb, HBLKSIZE); - no_freelist_branch = mono_mb_emit_short_branch (mb, MONO_CEE_BLT_UN_S); - - /* ptr_t next = obj_link(my_entry); *my_fl = next; */ - mono_mb_emit_ldloc (mb, my_fl_var); - mono_mb_emit_ldloc (mb, my_entry_var); - mono_mb_emit_byte (mb, MONO_CEE_LDIND_I); - mono_mb_emit_byte (mb, MONO_CEE_STIND_I); - - /* set the vtable and clear the words in the object */ - mono_mb_emit_ldloc (mb, my_entry_var); - mono_mb_emit_ldarg (mb, 0); - mono_mb_emit_byte (mb, MONO_CEE_STIND_I); - - if (atype == ATYPE_FREEPTR) { - int start_var, end_var, start_loop; - /* end = my_entry + bytes; start = my_entry + sizeof (gpointer); - */ - start_var = mono_mb_add_local (mb, mono_get_int_type ()); - end_var = mono_mb_add_local (mb, mono_get_int_type ()); - mono_mb_emit_ldloc (mb, my_entry_var); - mono_mb_emit_ldloc (mb, bytes_var); - mono_mb_emit_byte (mb, MONO_CEE_ADD); - mono_mb_emit_stloc (mb, end_var); - mono_mb_emit_ldloc (mb, my_entry_var); - mono_mb_emit_icon (mb, G_STRUCT_OFFSET (MonoObject, synchronisation)); - mono_mb_emit_byte (mb, MONO_CEE_ADD); - mono_mb_emit_stloc (mb, start_var); - /* - * do { - * *start++ = NULL; - * } while (start < end); - */ - start_loop = mono_mb_get_label (mb); - mono_mb_emit_ldloc (mb, start_var); - mono_mb_emit_icon (mb, 0); - mono_mb_emit_byte (mb, MONO_CEE_STIND_I); - mono_mb_emit_ldloc (mb, start_var); - mono_mb_emit_icon (mb, sizeof (gpointer)); - mono_mb_emit_byte (mb, MONO_CEE_ADD); - mono_mb_emit_stloc (mb, start_var); - - mono_mb_emit_ldloc (mb, start_var); - mono_mb_emit_ldloc (mb, end_var); - mono_mb_emit_byte (mb, MONO_CEE_BLT_UN_S); - mono_mb_emit_byte (mb, start_loop - (mono_mb_get_label (mb) + 1)); - } else if (atype == ATYPE_FREEPTR_FOR_BOX || atype == ATYPE_STRING) { - /* need to clear just the sync pointer */ - mono_mb_emit_ldloc (mb, my_entry_var); - mono_mb_emit_icon (mb, G_STRUCT_OFFSET (MonoObject, synchronisation)); - mono_mb_emit_byte (mb, MONO_CEE_ADD); - mono_mb_emit_icon (mb, 0); - mono_mb_emit_byte (mb, MONO_CEE_STIND_I); - } - - if (atype == ATYPE_STRING) { - /* need to set length and clear the last char */ - /* s->length = len; */ - mono_mb_emit_ldloc (mb, my_entry_var); - mono_mb_emit_icon (mb, G_STRUCT_OFFSET (MonoString, length)); - mono_mb_emit_byte (mb, MONO_CEE_ADD); - mono_mb_emit_ldarg (mb, 1); - mono_mb_emit_byte (mb, MONO_CEE_STIND_I4); - /* s->chars [len] = 0; */ - mono_mb_emit_ldloc (mb, my_entry_var); - mono_mb_emit_ldloc (mb, bytes_var); - mono_mb_emit_icon (mb, 2); - mono_mb_emit_byte (mb, MONO_CEE_SUB); - mono_mb_emit_byte (mb, MONO_CEE_ADD); - mono_mb_emit_icon (mb, 0); - mono_mb_emit_byte (mb, MONO_CEE_STIND_I2); - } - - /* return my_entry; */ - mono_mb_emit_ldloc (mb, my_entry_var); - mono_mb_emit_byte (mb, MONO_CEE_RET); - - mono_mb_patch_short_branch (mb, no_freelist_branch); - if (not_small_enough_branch > 0) - mono_mb_patch_short_branch (mb, not_small_enough_branch); - if (size_overflow_branch > 0) - mono_mb_patch_short_branch (mb, size_overflow_branch); - - /* the slow path: we just call back into the runtime */ - always_slowpath: - if (atype == ATYPE_STRING) { - mono_mb_emit_ldarg (mb, 1); - mono_mb_emit_icall (mb, ves_icall_string_alloc); - } else { - mono_mb_emit_ldarg (mb, 0); - mono_mb_emit_icall (mb, ves_icall_object_new_specific); - } - - mono_mb_emit_byte (mb, MONO_CEE_RET); - - info = mono_wrapper_info_create (mb, WRAPPER_SUBTYPE_NONE); - info->d.alloc.gc_name = "boehm"; - info->d.alloc.alloc_type = atype; - mb->init_locals = FALSE; - - res = mono_mb_create (mb, csig, 8, info); - mono_mb_free (mb); - - return res; -} - -static MonoMethod* alloc_method_cache [ATYPE_NUM]; -static MonoMethod* slowpath_alloc_method_cache [ATYPE_NUM]; - -gboolean -mono_gc_is_critical_method (MonoMethod *method) -{ - int i; - - for (i = 0; i < ATYPE_NUM; ++i) - if (method == alloc_method_cache [i] || method == slowpath_alloc_method_cache [i]) - return TRUE; - - return FALSE; -} - -/* - * If possible, generate a managed method that can quickly allocate objects in class - * @klass. The method will typically have an thread-local inline allocation sequence. - * The signature of the called method is: - * object allocate (MonoVTable *vtable) - * The thread local alloc logic is taken from libgc/pthread_support.c. - */ -MonoMethod* -mono_gc_get_managed_allocator (MonoClass *klass, gboolean for_box, gboolean known_instance_size) -{ - int atype; - - /* - * Tls implementation changed, we jump to tls native getters/setters. - * Is boehm managed allocator ok with this ? Do we even care ? - */ - return NULL; - - if (!SMALL_ENOUGH (m_class_get_instance_size (klass))) - return NULL; - if (mono_class_has_finalizer (klass) || mono_class_is_marshalbyref (klass)) - return NULL; - if (G_UNLIKELY (mono_profiler_allocations_enabled ())) - return NULL; - if (m_class_get_rank (klass)) - return NULL; - if (mono_class_is_open_constructed_type (m_class_get_byval_arg (klass))) - return NULL; - if (m_class_get_byval_arg (klass)->type == MONO_TYPE_STRING) { - atype = ATYPE_STRING; - } else if (!known_instance_size) { - return NULL; - } else if (!m_class_has_references (klass)) { - if (for_box) - atype = ATYPE_FREEPTR_FOR_BOX; - else - atype = ATYPE_FREEPTR; - } else { - return NULL; - /* - * disabled because we currently do a runtime choice anyway, to - * deal with multiple appdomains. - if (vtable->gc_descr != GC_NO_DESCRIPTOR) - atype = ATYPE_GCJ; - else - atype = ATYPE_NORMAL; - */ - } - return mono_gc_get_managed_allocator_by_type (atype, MANAGED_ALLOCATOR_REGULAR); -} - -MonoMethod* -mono_gc_get_managed_array_allocator (MonoClass *klass) -{ - return NULL; -} - -/** - * mono_gc_get_managed_allocator_by_type: - * - * Return a managed allocator method corresponding to allocator type ATYPE. - */ -MonoMethod* -mono_gc_get_managed_allocator_by_type (int atype, ManagedAllocatorVariant variant) -{ - MonoMethod *res; - gboolean slowpath = variant != MANAGED_ALLOCATOR_REGULAR; - MonoMethod **cache = slowpath ? slowpath_alloc_method_cache : alloc_method_cache; - - return NULL; - - res = cache [atype]; - if (res) - return res; - - res = create_allocator (atype, -1, slowpath); - mono_os_mutex_lock (&mono_gc_lock); - if (cache [atype]) { - mono_free_method (res); - res = cache [atype]; - } else { - mono_memory_barrier (); - cache [atype] = res; - } - mono_os_mutex_unlock (&mono_gc_lock); - return res; -} - -guint32 -mono_gc_get_managed_allocator_types (void) -{ - return ATYPE_NUM; -} - -MonoMethod* -mono_gc_get_write_barrier (void) -{ - g_assert_not_reached (); - return NULL; -} - -#else +// Look at history around late August 2019 if this is to be restored. +// The code was effectively dead, not merely deleted to avoid maintaining it. +#endif gboolean mono_gc_is_critical_method (MonoMethod *method) @@ -1362,8 +1000,6 @@ mono_gc_get_write_barrier (void) return NULL; } -#endif - MonoMethod* mono_gc_get_specific_write_barrier (gboolean is_concurrent) { @@ -1683,17 +1319,17 @@ mono_gc_register_finalizer_callbacks (MonoGCFinalizerCallbacks *callbacks) #define BITMAP_SIZE (sizeof (*((HandleData *)NULL)->bitmap) * CHAR_BIT) -static inline gboolean +static gboolean slot_occupied (HandleData *handles, guint slot) { return handles->bitmap [slot / BITMAP_SIZE] & (1 << (slot % BITMAP_SIZE)); } -static inline void +static void vacate_slot (HandleData *handles, guint slot) { handles->bitmap [slot / BITMAP_SIZE] &= ~(1 << (slot % BITMAP_SIZE)); } -static inline void +static void occupy_slot (HandleData *handles, guint slot) { handles->bitmap [slot / BITMAP_SIZE] |= 1 << (slot % BITMAP_SIZE); } @@ -2067,6 +1703,12 @@ mono_gchandle_free_domain (MonoDomain *domain) } +guint64 +mono_gc_get_total_allocated_bytes (MonoBoolean precise) +{ + return 0; +} + void mono_gc_register_obj_with_weak_fields (void *obj) { diff --git a/mono/metadata/class-init.c.REMOVED.git-id b/mono/metadata/class-init.c.REMOVED.git-id index bdfb2484c8..30e59d402d 100644 --- a/mono/metadata/class-init.c.REMOVED.git-id +++ b/mono/metadata/class-init.c.REMOVED.git-id @@ -1 +1 @@ -67b63637354afae46a56b66701bd8da931814203 \ No newline at end of file +cc50f15e04f6001df2502d66eb15a3d1d685a735 \ No newline at end of file diff --git a/mono/metadata/class-internals.h b/mono/metadata/class-internals.h index 586940e0e7..a07a13ffba 100644 --- a/mono/metadata/class-internals.h +++ b/mono/metadata/class-internals.h @@ -14,6 +14,7 @@ #include "mono/utils/mono-compiler.h" #include "mono/utils/mono-error.h" #include "mono/sgen/gc-internal-agnostic.h" +#include "mono/utils/mono-error-internals.h" #define MONO_CLASS_IS_ARRAY(c) (m_class_get_rank (c)) @@ -23,6 +24,7 @@ extern gboolean mono_print_vtable; extern gboolean mono_align_small_structs; +extern gint32 mono_simd_register_size; typedef struct _MonoMethodWrapper MonoMethodWrapper; typedef struct _MonoMethodInflated MonoMethodInflated; @@ -846,10 +848,34 @@ MONO_PROFILER_API MonoGenericContext* mono_class_get_context (MonoClass *klass); MONO_PROFILER_API MonoMethodSignature* -mono_method_signature_checked (MonoMethod *m, MonoError *err); +mono_method_signature_checked_slow (MonoMethod *m, MonoError *err); MONO_PROFILER_API MonoMethodSignature* -mono_method_signature_internal (MonoMethod *m); +mono_method_signature_internal_slow (MonoMethod *m); + +/** + * mono_method_signature_checked: + * + * Return the signature of the method M. On failure, returns NULL, and ERR is set. + */ +static inline MonoMethodSignature* +mono_method_signature_checked (MonoMethod *m, MonoError *error) +{ + error_init (error); + MonoMethodSignature* sig = m->signature; + return sig ? sig : mono_method_signature_checked_slow (m, error); +} + +/** + * mono_method_signature_internal: + * \returns the signature of the method \p m. On failure, returns NULL. + */ +static inline MonoMethodSignature* +mono_method_signature_internal (MonoMethod *m) +{ + MonoMethodSignature* sig = m->signature; + return sig ? sig : mono_method_signature_internal_slow (m); +} MonoGenericContext* mono_method_get_context_general (MonoMethod *method, gboolean uninflated); @@ -1023,6 +1049,11 @@ GENERATE_TRY_GET_CLASS_WITH_CACHE_DECL (appdomain_unloaded_exception) GENERATE_GET_CLASS_WITH_CACHE_DECL (valuetype) GENERATE_TRY_GET_CLASS_WITH_CACHE_DECL(handleref) + +#ifdef ENABLE_NETCORE +GENERATE_GET_CLASS_WITH_CACHE_DECL (assembly_load_context) +#endif + /* If you need a MonoType, use one of the mono_get_*_type () functions in class-inlines.h */ extern MonoDefaults mono_defaults; diff --git a/mono/metadata/class.c.REMOVED.git-id b/mono/metadata/class.c.REMOVED.git-id index 25ef2799c1..77095b3e37 100644 --- a/mono/metadata/class.c.REMOVED.git-id +++ b/mono/metadata/class.c.REMOVED.git-id @@ -1 +1 @@ -1252e71887f2acd94cdb180b7c4cd92de9c8fef7 \ No newline at end of file +dda0dfb0056182f5373def220522145ee38c43e7 \ No newline at end of file diff --git a/mono/metadata/cominterop.c.REMOVED.git-id b/mono/metadata/cominterop.c.REMOVED.git-id index 654755d5dd..469da5d2f1 100644 --- a/mono/metadata/cominterop.c.REMOVED.git-id +++ b/mono/metadata/cominterop.c.REMOVED.git-id @@ -1 +1 @@ -bd2b87531f5229d7fce6c1bfa11d486502ad5e1a \ No newline at end of file +20f61293e61a78ef7bdba3de480886d23e8f9ffe \ No newline at end of file diff --git a/mono/metadata/console-unix.c b/mono/metadata/console-unix.c index 9e3bbdb54d..cc9e543ff3 100644 --- a/mono/metadata/console-unix.c +++ b/mono/metadata/console-unix.c @@ -36,6 +36,11 @@ #include #include #include +#include +#include +#include "icall-decl.h" + +#ifndef ENABLE_NETCORE /* On solaris, curses.h must come before both termios.h and term.h */ #ifdef HAVE_CURSES_H @@ -56,10 +61,6 @@ # include #endif -#include -#include -#include "icall-decl.h" - static gboolean setup_finished; static gboolean atexit_called; @@ -77,10 +78,8 @@ static struct termios mono_attr; /* static void console_restore_signal_handlers (void); */ static void console_set_signal_handlers (void); - static GENERATE_TRY_GET_CLASS_WITH_CACHE (console, "System", "Console"); - void mono_console_init (void) { @@ -511,3 +510,17 @@ ves_icall_System_ConsoleDriver_TtySetup (MonoStringHandle keypad, MonoStringHand return TRUE; } + +#else /* ENABLE_NETCORE */ + +void +mono_console_init (void) +{ +} + +void +mono_console_handle_async_ops (void) +{ +} + +#endif diff --git a/mono/metadata/coree.c b/mono/metadata/coree.c index cf32c19099..cee0560162 100644 --- a/mono/metadata/coree.c +++ b/mono/metadata/coree.c @@ -80,6 +80,7 @@ BOOL STDMETHODCALLTYPE _CorDllMain(HINSTANCE hInst, DWORD dwReason, LPVOID lpRes MonoImage* image; gchar* file_name; gchar* error; + MonoAssemblyLoadContext *alc = mono_domain_default_alc (mono_get_root_domain ()); switch (dwReason) { @@ -89,7 +90,7 @@ BOOL STDMETHODCALLTYPE _CorDllMain(HINSTANCE hInst, DWORD dwReason, LPVOID lpRes file_name = mono_get_module_file_name (hInst); if (mono_get_root_domain ()) { - image = mono_image_open_from_module_handle (mono_domain_default_alc (mono_get_root_domain ()), hInst, mono_path_resolve_symlinks (file_name), TRUE, NULL); + image = mono_image_open_from_module_handle (alc, hInst, mono_path_resolve_symlinks (file_name), TRUE, NULL); } else { init_from_coree = TRUE; mono_runtime_load (file_name, NULL); @@ -97,7 +98,7 @@ BOOL STDMETHODCALLTYPE _CorDllMain(HINSTANCE hInst, DWORD dwReason, LPVOID lpRes if (error) { g_free (error); g_free (file_name); - mono_runtime_quit (); + mono_runtime_quit_internal (); return FALSE; } @@ -122,7 +123,7 @@ BOOL STDMETHODCALLTYPE _CorDllMain(HINSTANCE hInst, DWORD dwReason, LPVOID lpRes */ if (image->tables [MONO_TABLE_ASSEMBLY].rows && image->image_info->cli_cli_header.ch_vtable_fixups.rva) { MonoAssemblyOpenRequest req; - mono_assembly_request_prepare (&req.request, sizeof (req), MONO_ASMCTX_DEFAULT); + mono_assembly_request_prepare_open (&req, MONO_ASMCTX_DEFAULT, alc); assembly = mono_assembly_request_open (file_name, &req, NULL); } @@ -133,7 +134,7 @@ BOOL STDMETHODCALLTYPE _CorDllMain(HINSTANCE hInst, DWORD dwReason, LPVOID lpRes /* The process is terminating. */ return TRUE; file_name = mono_get_module_file_name (hInst); - image = mono_image_loaded_internal (mono_domain_default_alc (mono_get_root_domain ()), file_name, FALSE); + image = mono_image_loaded_internal (alc, file_name, FALSE); if (image) mono_image_close (image); @@ -171,18 +172,18 @@ __int32 STDMETHODCALLTYPE _CorExeMain(void) g_free (corlib_version_error); g_free (file_name); MessageBox (NULL, L"Corlib not in sync with this runtime.", NULL, MB_ICONERROR); - mono_runtime_quit (); + mono_runtime_quit_internal (); ExitProcess (1); } MonoAssemblyOpenRequest req; - mono_assembly_request_prepare (&req.request, sizeof (req), MONO_ASMCTX_DEFAULT); + mono_assembly_request_prepare_open (&req, MONO_ASMCTX_DEFAULT, mono_domain_default_alc (mono_get_root_domain ())); assembly = mono_assembly_request_open (file_name, &req, NULL); mono_close_exe_image (); if (!assembly) { g_free (file_name); MessageBox (NULL, L"Cannot open assembly.", NULL, MB_ICONERROR); - mono_runtime_quit (); + mono_runtime_quit_internal (); ExitProcess (1); } @@ -191,7 +192,7 @@ __int32 STDMETHODCALLTYPE _CorExeMain(void) if (!entry) { g_free (file_name); MessageBox (NULL, L"Assembly doesn't have an entry point.", NULL, MB_ICONERROR); - mono_runtime_quit (); + mono_runtime_quit_internal (); ExitProcess (1); } @@ -200,7 +201,7 @@ __int32 STDMETHODCALLTYPE _CorExeMain(void) g_free (file_name); mono_error_cleanup (error); /* FIXME don't swallow the error */ MessageBox (NULL, L"The entry point method could not be loaded.", NULL, MB_ICONERROR); - mono_runtime_quit (); + mono_runtime_quit_internal (); ExitProcess (1); } @@ -213,9 +214,9 @@ __int32 STDMETHODCALLTYPE _CorExeMain(void) mono_runtime_run_main_checked (method, argc, argv, error); mono_error_raise_exception_deprecated (error); /* OK, triggers unhandled exn handler */ - mono_thread_manage (); + mono_thread_manage_internal (); - mono_runtime_quit (); + mono_runtime_quit_internal (); /* return does not terminate the process. */ ExitProcess (mono_environment_exitcode_get ()); @@ -230,7 +231,7 @@ void STDMETHODCALLTYPE CorExitProcess(int exitCode) if (mono_get_root_domain () && !mono_runtime_is_shutting_down ()) { mono_runtime_set_shutting_down (); mono_thread_suspend_all_other_threads (); - mono_runtime_quit (); + mono_runtime_quit_internal (); } #endif ExitProcess (exitCode); diff --git a/mono/metadata/custom-attrs-internals.h b/mono/metadata/custom-attrs-internals.h index 21e36df2da..c55ece8a0b 100644 --- a/mono/metadata/custom-attrs-internals.h +++ b/mono/metadata/custom-attrs-internals.h @@ -26,6 +26,9 @@ mono_assembly_is_weak_field (MonoImage *image, guint32 field_idx); void mono_assembly_init_weak_fields (MonoImage *image); +void +mono_reflection_create_custom_attr_data_args (MonoImage *image, MonoMethod *method, const guchar *data, guint32 len, MonoArrayHandleOut typed_args_out, MonoArrayHandleOut named_args_out, CattrNamedArg **named_arg_info, MonoError *error); + void mono_reflection_create_custom_attr_data_args_noalloc (MonoImage *image, MonoMethod *method, const guchar *data, guint32 len, gpointer **typed_args_out, gpointer **named_args_out, int *num_named_args, diff --git a/mono/metadata/custom-attrs.c b/mono/metadata/custom-attrs.c index 8e613078ae..5e125c69d5 100644 --- a/mono/metadata/custom-attrs.c +++ b/mono/metadata/custom-attrs.c @@ -25,6 +25,7 @@ #include "mono/metadata/tabledefs.h" #include "mono/metadata/tokentype.h" #include "mono/metadata/verify-internals.h" +#include "mono/metadata/icall-decl.h" #include "mono/utils/checked-build.h" #define CHECK_ADD4_OVERFLOW_UN(a, b) ((guint32)(0xFFFFFFFFU) - (guint32)(b) < (guint32)(a)) @@ -1014,7 +1015,7 @@ create_custom_attr_into_array (MonoImage *image, MonoMethod *method, const gucha * NAMED_ARG_INFO will contain information about the named arguments. */ void -mono_reflection_create_custom_attr_data_args (MonoImage *image, MonoMethod *method, const guchar *data, guint32 len, MonoArray **typed_args_out, MonoArray **named_args_out, CattrNamedArg **named_arg_info, MonoError *error) +mono_reflection_create_custom_attr_data_args (MonoImage *image, MonoMethod *method, const guchar *data, guint32 len, MonoArrayHandleOut typed_args_h, MonoArrayHandleOut named_args_h, CattrNamedArg **named_arg_info, MonoError *error) { MonoArray *typed_args, *named_args; MonoClass *attrklass; @@ -1025,8 +1026,8 @@ mono_reflection_create_custom_attr_data_args (MonoImage *image, MonoMethod *meth guint32 i, j, num_named; CattrNamedArg *arginfo = NULL; - *typed_args_out = NULL; - *named_args_out = NULL; + MONO_HANDLE_ASSIGN_RAW (typed_args_h, NULL); + MONO_HANDLE_ASSIGN_RAW (named_args_h, NULL); *named_arg_info = NULL; typed_args = NULL; @@ -1051,6 +1052,7 @@ mono_reflection_create_custom_attr_data_args (MonoImage *image, MonoMethod *meth */ typed_args = mono_array_new_checked (domain, mono_get_object_class (), mono_method_signature_internal (method)->param_count, error); return_if_nok (error); + MONO_HANDLE_ASSIGN_RAW (typed_args_h, typed_args); for (i = 0; i < mono_method_signature_internal (method)->param_count; ++i) { MonoObject *obj; @@ -1068,6 +1070,7 @@ mono_reflection_create_custom_attr_data_args (MonoImage *image, MonoMethod *meth num_named = read16 (named); named_args = mono_array_new_checked (domain, mono_get_object_class (), num_named, error); return_if_nok (error); + MONO_HANDLE_ASSIGN_RAW (named_args_h, named_args); named += 2; attrklass = method->klass; @@ -1159,8 +1162,6 @@ mono_reflection_create_custom_attr_data_args (MonoImage *image, MonoMethod *meth g_free (name); } - *typed_args_out = typed_args; - *named_args_out = named_args; return; fail: mono_error_set_generic_error (error, "System.Reflection", "CustomAttributeFormatException", "Binary format of the specified custom attribute was invalid."); @@ -1322,26 +1323,30 @@ fail: *named_arg_info = NULL; } -static gboolean -reflection_resolve_custom_attribute_data (MonoReflectionMethod *ref_method, MonoReflectionAssembly *assembly, gpointer data, guint32 len, MonoArray **ctor_args, MonoArray **named_args_out, MonoError *error) +void +ves_icall_System_Reflection_CustomAttributeData_ResolveArgumentsInternal (MonoReflectionMethodHandle ref_method_h, MonoReflectionAssemblyHandle assembly_h, + gpointer data, guint32 len, + MonoArrayHandleOut ctor_args_h, MonoArrayHandleOut named_args_h, + MonoError *error) { MonoDomain *domain; MonoArray *typed_args, *named_args; MonoImage *image; MonoMethod *method; CattrNamedArg *arginfo = NULL; + MonoReflectionMethod *ref_method = MONO_HANDLE_RAW (ref_method_h); + MonoReflectionAssembly *assembly = MONO_HANDLE_RAW (assembly_h); + MonoMethodSignature *sig; + MonoObjectHandle obj_h, namedarg_h, typedarg_h, minfo_h; int i; - error_init (error); - - *ctor_args = NULL; - *named_args_out = NULL; - - typed_args = NULL; - named_args = NULL; - if (len == 0) - return TRUE; + return; + + obj_h = MONO_HANDLE_NEW (MonoObject, NULL); + namedarg_h = MONO_HANDLE_NEW (MonoObject, NULL); + typedarg_h = MONO_HANDLE_NEW (MonoObject, NULL); + minfo_h = MONO_HANDLE_NEW (MonoObject, NULL); image = assembly->assembly->image; method = ref_method->method; @@ -1352,30 +1357,38 @@ reflection_resolve_custom_attribute_data (MonoReflectionMethod *ref_method, Mono goto leave; } - mono_reflection_create_custom_attr_data_args (image, method, (const guchar *)data, len, &typed_args, &named_args, &arginfo, error); + // FIXME: Handles + mono_reflection_create_custom_attr_data_args (image, method, (const guchar *)data, len, ctor_args_h, named_args_h, &arginfo, error); goto_if_nok (error, leave); + typed_args = MONO_HANDLE_RAW (ctor_args_h); + named_args = MONO_HANDLE_RAW (named_args_h); if (!typed_args || !named_args) goto leave; - for (i = 0; i < mono_method_signature_internal (method)->param_count; ++i) { - MonoObject *obj = mono_array_get_internal (typed_args, MonoObject*, i); + sig = mono_method_signature_internal (method); + for (i = 0; i < sig->param_count; ++i) { + MonoObject *obj; MonoObject *typedarg; MonoType *t; + obj = mono_array_get_internal (typed_args, MonoObject*, i); + MONO_HANDLE_ASSIGN_RAW (obj_h, obj); + t = mono_method_signature_internal (method)->params [i]; if (t->type == MONO_TYPE_OBJECT && obj) t = m_class_get_byval_arg (obj->vtable->klass); typedarg = create_cattr_typed_arg (t, obj, error); - goto_if_nok (error, leave); mono_array_setref_internal (typed_args, i, typedarg); } for (i = 0; i < mono_array_length_internal (named_args); ++i) { - MonoObject *obj = mono_array_get_internal (named_args, MonoObject*, i); + MonoObject *obj; MonoObject *namedarg, *minfo; + obj = mono_array_get_internal (named_args, MonoObject*, i); + MONO_HANDLE_ASSIGN_RAW (obj_h, obj); if (arginfo [i].prop) { minfo = (MonoObject*)mono_property_get_object_checked (domain, arginfo [i].prop->parent, arginfo [i].prop, error); if (!minfo) @@ -1384,33 +1397,25 @@ reflection_resolve_custom_attribute_data (MonoReflectionMethod *ref_method, Mono minfo = (MonoObject*)mono_field_get_object_checked (domain, NULL, arginfo [i].field, error); goto_if_nok (error, leave); } + MONO_HANDLE_ASSIGN_RAW (minfo_h, minfo); #if ENABLE_NETCORE namedarg = create_cattr_named_arg (minfo, obj, error); + MONO_HANDLE_ASSIGN_RAW (namedarg_h, namedarg); #else MonoObject* typedarg = create_cattr_typed_arg (arginfo [i].type, obj, error); + MONO_HANDLE_ASSIGN_RAW (typedarg_h, typedarg); goto_if_nok (error, leave); namedarg = create_cattr_named_arg (minfo, typedarg, error); + MONO_HANDLE_ASSIGN_RAW (namedarg_h, namedarg); #endif goto_if_nok (error, leave); mono_array_setref_internal (named_args, i, namedarg); } - *ctor_args = typed_args; - *named_args_out = named_args; - leave: g_free (arginfo); - return mono_error_ok (error); -} - -void -ves_icall_System_Reflection_CustomAttributeData_ResolveArgumentsInternal (MonoReflectionMethod *ref_method, MonoReflectionAssembly *assembly, gpointer data, guint32 len, MonoArray **ctor_args, MonoArray **named_args) -{ - ERROR_DECL (error); - (void) reflection_resolve_custom_attribute_data (ref_method, assembly, data, len, ctor_args, named_args, error); - mono_error_set_pending_exception (error); } static MonoClass* @@ -2289,8 +2294,6 @@ mono_reflection_get_custom_attrs_data_checked (MonoObjectHandle obj, MonoError * MonoArrayHandle result = MONO_HANDLE_NEW (MonoArray, NULL); MonoCustomAttrInfo *cinfo; - error_init (error); - cinfo = mono_reflection_get_custom_attrs_info_checked (obj, error); goto_if_nok (error, leave); if (cinfo) { diff --git a/mono/metadata/debug-mono-ppdb.c b/mono/metadata/debug-mono-ppdb.c index 13c3ebfa97..7d3dbda2ad 100644 --- a/mono/metadata/debug-mono-ppdb.c +++ b/mono/metadata/debug-mono-ppdb.c @@ -159,7 +159,7 @@ mono_ppdb_load_file (MonoImage *image, const guint8 *raw_contents, int size) gint32 pe_timestamp; guint8 *ppdb_data = NULL; guint8 *to_free = NULL; - int ppdb_size, ppdb_compressed_size; + int ppdb_size = 0, ppdb_compressed_size = 0; if (image->tables [MONO_TABLE_DOCUMENT].rows) { /* Embedded ppdb */ diff --git a/mono/metadata/domain-internals.h b/mono/metadata/domain-internals.h index d92a35a4b7..544554b172 100644 --- a/mono/metadata/domain-internals.h +++ b/mono/metadata/domain-internals.h @@ -507,6 +507,9 @@ typedef void (*MonoFreeDomainFunc) (MonoDomain *domain); void mono_install_free_domain_hook (MonoFreeDomainFunc func); +void +mono_runtime_quit_internal (void); + void mono_cleanup (void); @@ -639,7 +642,7 @@ MonoImage *mono_assembly_open_from_bundle (MonoAssemblyLoadContext *alc, gboolean refonly); MonoAssembly * -mono_try_assembly_resolve (MonoDomain *domain, const char *fname, MonoAssembly *requesting, gboolean refonly, MonoError *error); +mono_try_assembly_resolve (MonoAssemblyLoadContext *alc, const char *fname, MonoAssembly *requesting, gboolean refonly, MonoError *error); MonoAssembly * mono_domain_assembly_postload_search (MonoAssemblyLoadContext *alc, MonoAssembly *requesting, MonoAssemblyName *aname, gboolean refonly, gboolean postload, gpointer user_data, MonoError *error); diff --git a/mono/metadata/domain.c b/mono/metadata/domain.c index 35794914f4..0b50926b9e 100644 --- a/mono/metadata/domain.c +++ b/mono/metadata/domain.c @@ -614,7 +614,7 @@ mono_init_internal (const char *filename, const char *exe_filename, const char * if ((status != MONO_IMAGE_OK) || (ass == NULL)) { switch (status){ case MONO_IMAGE_ERROR_ERRNO: { - char *corlib_file = g_build_filename (mono_assembly_getrootdir (), "mono", current_runtime->framework_version, "mscorlib.dll", NULL); + char *corlib_file = g_build_filename (mono_assembly_getrootdir (), "mono", current_runtime->framework_version, "mscorlib.dll", (const char*)NULL); g_print ("The assembly mscorlib.dll was not found or could not be loaded.\n"); g_print ("It should have been installed in the `%s' directory.\n", corlib_file); g_free (corlib_file); @@ -1059,8 +1059,7 @@ mono_domain_assembly_open_internal (MonoDomain *domain, MonoAssemblyLoadContext #endif MonoAssemblyOpenRequest req; - mono_assembly_request_prepare (&req.request, sizeof (req), MONO_ASMCTX_DEFAULT); - req.request.alc = alc; + mono_assembly_request_prepare_open (&req, MONO_ASMCTX_DEFAULT, alc); if (domain != mono_domain_get ()) { current = mono_domain_get (); @@ -1850,7 +1849,7 @@ app_config_parse (const char *exe_filename) text = g_strdup (bundled_config); len = strlen (text); } else { - config_filename = g_strconcat (exe_filename, ".config", NULL); + config_filename = g_strconcat (exe_filename, ".config", (const char*)NULL); if (!g_file_get_contents (config_filename, &text, &len, NULL)) { g_free (config_filename); diff --git a/mono/metadata/dynamic-image.c b/mono/metadata/dynamic-image.c index 9ba6ca6da6..3b149cfe0c 100644 --- a/mono/metadata/dynamic-image.c +++ b/mono/metadata/dynamic-image.c @@ -33,13 +33,13 @@ static GPtrArray *dynamic_images; static mono_mutex_t dynamic_images_mutex; -static inline void +static void dynamic_images_lock (void) { mono_os_mutex_lock (&dynamic_images_mutex); } -static inline void +static void dynamic_images_unlock (void) { mono_os_mutex_unlock (&dynamic_images_mutex); @@ -122,7 +122,7 @@ mono_find_dynamic_image_owner (void *ptr) return owner; } -static inline void +static void dynamic_image_lock (MonoDynamicImage *image) { MONO_ENTER_GC_SAFE; @@ -130,7 +130,7 @@ dynamic_image_lock (MonoDynamicImage *image) MONO_EXIT_GC_SAFE; } -static inline void +static void dynamic_image_unlock (MonoDynamicImage *image) { mono_image_unlock ((MonoImage*)image); diff --git a/mono/metadata/environment.c b/mono/metadata/environment.c index 7b6ec01d66..f0a5ae8229 100644 --- a/mono/metadata/environment.c +++ b/mono/metadata/environment.c @@ -45,6 +45,7 @@ mono_environment_exitcode_set (gint32 value) exitcode=value; } +#ifndef ENABLE_NETCORE /* note: we better manipulate the string in managed code (easier and safer) */ MonoStringHandle ves_icall_System_Environment_GetOSVersionString (MonoError *error) @@ -89,4 +90,4 @@ ves_icall_System_Environment_GetOSVersionString (MonoError *error) #endif return mono_string_new_handle (mono_domain_get (), "0.0.0.0", error); } - +#endif diff --git a/mono/metadata/exception.c b/mono/metadata/exception.c index 38fb92823e..48f96bff7e 100644 --- a/mono/metadata/exception.c +++ b/mono/metadata/exception.c @@ -1506,6 +1506,6 @@ mono_error_convert_to_exception_handle (MonoError *error) { //FIXMEcoop mono_error_convert_to_exception is raw pointer // The "optimization" here is important to significantly reduce handle usage. - return mono_error_ok (error) ? MONO_HANDLE_CAST (MonoException, NULL_HANDLE) + return is_ok (error) ? MONO_HANDLE_CAST (MonoException, NULL_HANDLE) : MONO_HANDLE_NEW (MonoException, mono_error_convert_to_exception (error)); } diff --git a/mono/metadata/external-only.c b/mono/metadata/external-only.c index 290db63535..1ecbd5d950 100644 --- a/mono/metadata/external-only.c +++ b/mono/metadata/external-only.c @@ -19,6 +19,9 @@ #include "class-init.h" #include "marshal.h" #include "object.h" +#include "external-only.h" +#include "threads.h" +#include "threads-types.h" /** * mono_gchandle_new: @@ -107,6 +110,11 @@ mono_gchandle_free (uint32_t gchandle) /** * mono_gc_wbarrier_set_field: + * \param obj object containing the destination field + * \param field_ptr address of field inside the object + * \param value reference to the object to be stored + * Stores an object reference inside another object, executing a write barrier + * if needed. */ void mono_gc_wbarrier_set_field (MonoObject *obj, void* field_ptr, MonoObject* value) @@ -116,6 +124,11 @@ mono_gc_wbarrier_set_field (MonoObject *obj, void* field_ptr, MonoObject* value) /** * mono_gc_wbarrier_set_arrayref: + * \param arr array containing the destination slot + * \param slot_ptr address of slot inside the array + * \param value reference to the object to be stored + * Stores an object reference inside an array of objects, executing a write + * barrier if needed. */ void mono_gc_wbarrier_set_arrayref (MonoArray *arr, void* slot_ptr, MonoObject* value) @@ -123,14 +136,26 @@ mono_gc_wbarrier_set_arrayref (MonoArray *arr, void* slot_ptr, MonoObject* value MONO_EXTERNAL_ONLY_GC_UNSAFE_VOID (mono_gc_wbarrier_set_arrayref_internal (arr, slot_ptr, value)); } +/** + * mono_gc_wbarrier_arrayref_copy: + * \param dest_ptr destination slot address + * \param src_ptr source slot address + * \param count number of references to copy + * Copies \p count references from one array to another, executing a write + * barrier if needed. + */ void -mono_gc_wbarrier_arrayref_copy (void* dest_ptr, void* src_ptr, int count) +mono_gc_wbarrier_arrayref_copy (void* dest_ptr, /*const*/ void* src_ptr, int count) { MONO_EXTERNAL_ONLY_GC_UNSAFE_VOID (mono_gc_wbarrier_arrayref_copy_internal (dest_ptr, src_ptr, count)); } /** * mono_gc_wbarrier_generic_store: + * \param ptr address of field + * \param obj object to store + * Stores the \p value object inside the field represented by \p ptr, + * executing a write barrier if needed. */ void mono_gc_wbarrier_generic_store (void* ptr, MonoObject* value) @@ -139,7 +164,7 @@ mono_gc_wbarrier_generic_store (void* ptr, MonoObject* value) } /** - * mono_gc_wbarrier_generic_store_atomic_internal: + * mono_gc_wbarrier_generic_store_atomic: * Same as \c mono_gc_wbarrier_generic_store but performs the store * as an atomic operation with release semantics. */ @@ -149,12 +174,26 @@ mono_gc_wbarrier_generic_store_atomic (void *ptr, MonoObject *value) MONO_EXTERNAL_ONLY_GC_UNSAFE_VOID (mono_gc_wbarrier_generic_store_atomic_internal (ptr, value)); } +/** + * mono_gc_wbarrier_generic_nostore: + * Executes a write barrier for an address, informing the GC that + * the reference stored at that address has been changed. + */ void mono_gc_wbarrier_generic_nostore (void* ptr) { MONO_EXTERNAL_ONLY_GC_UNSAFE_VOID (mono_gc_wbarrier_generic_nostore_internal (ptr)); } +/** + * mono_gc_wbarrier_object_copy: + * \param dest destination address + * \param src source address + * \param count number of elements to copy + * \param klass type of elements to copy + * Copies \p count elements of type \p klass from \p src address to + * \dest address, executing any necessary write barriers. + */ void mono_gc_wbarrier_value_copy (void* dest, /*const*/ void* src, int count, MonoClass *klass) { @@ -163,8 +202,10 @@ mono_gc_wbarrier_value_copy (void* dest, /*const*/ void* src, int count, MonoCla /** * mono_gc_wbarrier_object_copy: - * - * Write barrier to call when \p obj is the result of a clone or copy of an object. + * \param obj destination object + * \param src source object + * Copies contents of \p src to \p obj, executing any necessary write + * barriers. */ void mono_gc_wbarrier_object_copy (MonoObject* obj, MonoObject *src) @@ -284,3 +325,14 @@ mono_domain_set (MonoDomain *domain, gboolean force) MONO_EXTERNAL_ONLY_GC_UNSAFE_VOID (mono_domain_set_internal_with_options (domain, TRUE)); return TRUE; } + +/** + * mono_thread_manage: + * + */ +void +mono_thread_manage (void) +{ + MONO_EXTERNAL_ONLY_GC_UNSAFE_VOID (mono_thread_manage_internal ()); +} + diff --git a/mono/metadata/gc-internals.h b/mono/metadata/gc-internals.h index 9adc971020..a305259b9f 100644 --- a/mono/metadata/gc-internals.h +++ b/mono/metadata/gc-internals.h @@ -313,6 +313,8 @@ int mono_gc_get_los_limit (void); guint64 mono_gc_get_allocated_bytes_for_current_thread (void); +guint64 mono_gc_get_total_allocated_bytes (MonoBoolean precise); + guint8* mono_gc_get_card_table (int *shift_bits, gpointer *card_mask); guint8* mono_gc_get_target_card_table (int *shift_bits, target_mgreg_t *card_mask); gboolean mono_gc_card_table_nursery_check (void); diff --git a/mono/metadata/gc.c b/mono/metadata/gc.c index 09b588b30f..dcdb6822b5 100644 --- a/mono/metadata/gc.c +++ b/mono/metadata/gc.c @@ -114,7 +114,7 @@ typedef struct { MonoCoopMutex *mutex; } BreakCoopAlertableWaitUD; -static inline void +static void break_coop_alertable_wait (gpointer user_data) { BreakCoopAlertableWaitUD *ud = (BreakCoopAlertableWaitUD*)user_data; @@ -132,7 +132,7 @@ break_coop_alertable_wait (gpointer user_data) * Wait on COND/MUTEX. If ALERTABLE is non-null, the wait can be interrupted. * In that case, *ALERTABLE will be set to TRUE, and 0 is returned. */ -static inline gint +static gint coop_cond_timedwait_alertable (MonoCoopCond *cond, MonoCoopMutex *mutex, guint32 timeout_ms, gboolean *alertable) { BreakCoopAlertableWaitUD *ud; @@ -943,13 +943,9 @@ mono_runtime_do_background_work (void) static gsize WINAPI finalizer_thread (gpointer unused) { - ERROR_DECL (error); gboolean wait = TRUE; - MonoString *finalizer = mono_string_new_checked (mono_get_root_domain (), "Finalizer", error); - mono_error_assert_ok (error); - mono_thread_set_name_internal (mono_thread_internal_current (), finalizer, MonoSetThreadNameFlag_None, error); - mono_error_assert_ok (error); + mono_thread_set_name_constant_ignore_error (mono_thread_internal_current (), "Finalizer", MonoSetThreadNameFlag_None); /* Register a hazard free queue pump callback */ mono_hazard_pointer_install_free_queue_size_callback (hazard_free_queue_is_too_big); diff --git a/mono/metadata/handle-decl.h b/mono/metadata/handle-decl.h index a6085bed86..931824cf5f 100644 --- a/mono/metadata/handle-decl.h +++ b/mono/metadata/handle-decl.h @@ -67,6 +67,7 @@ Handle macros/functions MONO_IF_CPLUSPLUS ( \ MONO_ALWAYS_INLINE \ TYPE * GetRaw () const { return __raw ? *__raw : NULL; } \ + TYPE * volatile * Ref () { g_assert (__raw); return __raw; } \ ) \ TYPE * volatile *__raw; \ } TYPED_HANDLE_NAME (TYPE), \ diff --git a/mono/metadata/handle.c b/mono/metadata/handle.c index eff56a62b1..a06ebab57e 100644 --- a/mono/metadata/handle.c +++ b/mono/metadata/handle.c @@ -62,12 +62,6 @@ Combine: MonoDefaults, GENERATE_GET_CLASS_WITH_CACHE, TYPED_HANDLE_DECL and frie * chunk should be updated before an object is written into the * handle, and chunks to be scanned (between bottom and top) should * always be valid. - * - * Note that the handle stack is scanned PRECISELY (see - * sgen_client_scan_thread_data ()). That means there should not be - * stale objects scanned. So when we manipulate the size of a chunk, - * we must ensure that the newly scannable slot is either null or - * points to a valid value. */ static HandleStack* @@ -94,8 +88,6 @@ free_handle_chunk (HandleChunk *chunk) g_free (chunk); } -const MonoObjectHandle mono_null_value_handle = { 0 }; - #define THIS_IS_AN_OK_NUMBER_OF_HANDLES 100 static HandleChunkElem* @@ -171,12 +163,16 @@ mono_handle_new (MonoObject *obj, MonoThreadInfo *info, const char *owner) #endif { info = info ? info : mono_thread_info_current (); + HandleStack *handles = info->handle_stack; HandleChunk *top = handles->top; #ifdef MONO_HANDLE_TRACK_SP mono_handle_chunk_leak_check (handles); #endif + // FIXME: Since we scan the handle stack inprecisely, some of the + // membars could be removed + retry: if (G_LIKELY (top->size < OBJECTS_PER_HANDLES_CHUNK)) { int idx = top->size; @@ -319,14 +315,11 @@ mono_handle_stack_scan (HandleStack *stack, GcScanFunc func, gpointer gc_data, g check_handle_stack_monotonic (stack); /* - We're called twice - on the imprecise pass we do nothing. - Interior pointers are retained in managed frames. - On the precise pass, we scan all the objects where the handles point to the start of - the object. - - Note that if we're running, we know the world is stopped. - */ - if (!precise) + * We're called twice, on the precise pass we do nothing. + * On the inprecise pass, we pin the objects pointed to by the handles. + * Note that if we're running, we know the world is stopped. + */ + if (precise) return; HandleChunk *cur = stack->bottom; @@ -345,9 +338,11 @@ mono_handle_stack_scan (HandleStack *stack, GcScanFunc func, gpointer gc_data, g } } -void +MonoThreadInfo* mono_stack_mark_record_size (MonoThreadInfo *info, HandleStackMark *stackmark, const char *func_name) { + info = info ? info : mono_thread_info_current (); + HandleStack *handles = info->handle_stack; HandleChunk *cur = stackmark->chunk; int size = -stackmark->size; //discard the starting point of the stack @@ -360,6 +355,8 @@ mono_stack_mark_record_size (MonoThreadInfo *info, HandleStackMark *stackmark, c if (size > THIS_IS_AN_OK_NUMBER_OF_HANDLES) g_warning ("%s USED %d handles\n", func_name, size); + + return info; } /* diff --git a/mono/metadata/handle.h b/mono/metadata/handle.h index 8fbe79aed9..1e6dea997f 100644 --- a/mono/metadata/handle.h +++ b/mono/metadata/handle.h @@ -134,7 +134,7 @@ gboolean mono_handle_stack_is_empty (HandleStack *stack); HandleStack* mono_handle_stack_alloc (void); void mono_handle_stack_free (HandleStack *handlestack); MonoRawHandle mono_stack_mark_pop_value (MonoThreadInfo *info, HandleStackMark *stackmark, MonoRawHandle value); -void mono_stack_mark_record_size (MonoThreadInfo *info, HandleStackMark *stackmark, const char *func_name); +MonoThreadInfo* mono_stack_mark_record_size (MonoThreadInfo *info, HandleStackMark *stackmark, const char *func_name); void mono_handle_stack_free_domain (HandleStack *stack, MonoDomain *domain); #ifdef MONO_HANDLE_TRACK_SP @@ -187,17 +187,18 @@ Icall macros #define CLEAR_ICALL_COMMON \ mono_error_set_pending_exception (error); +// FIXME There should be fast and slow versions of this, i.e. with and without local variable. #define SETUP_ICALL_FRAME \ HandleStackMark __mark; \ - mono_stack_mark_init (mono_thread_info_current_var, &__mark); + mono_stack_mark_init (mono_thread_info_current_var ? mono_thread_info_current_var : mono_thread_info_current (), &__mark); +// FIXME This should be one function call since it is not fully inlined. #define CLEAR_ICALL_FRAME \ - mono_stack_mark_record_size (mono_thread_info_current_var, &__mark, __FUNCTION__); \ - mono_stack_mark_pop (mono_thread_info_current_var, &__mark); + mono_stack_mark_pop (mono_stack_mark_record_size (mono_thread_info_current_var, &__mark, __FUNCTION__), &__mark); +// FIXME This should be one function call since it is not fully inlined. #define CLEAR_ICALL_FRAME_VALUE(RESULT, HANDLE) \ - mono_stack_mark_record_size (mono_thread_info_current_var, &__mark, __FUNCTION__); \ - (RESULT) = g_cast (mono_stack_mark_pop_value (mono_thread_info_current_var, &__mark, (HANDLE))); + (RESULT) = g_cast (mono_stack_mark_pop_value (mono_stack_mark_record_size (mono_thread_info_current_var, &__mark, __FUNCTION__), &__mark, (HANDLE))); #define HANDLE_FUNCTION_ENTER() do { \ MONO_DISABLE_WARNING(4459) /* declaration of 'identifier' hides global declaration */ \ @@ -210,12 +211,31 @@ Icall macros CLEAR_ICALL_FRAME; \ } while (0) -#define HANDLE_LOOP_PREPARE \ +// Do not do this often, but icall state can be manually managed. +// +// SETUP_ICALL_FUNCTION +// loop { // Does not have to be a loop. +// SETUP_ICALL_FRAME +// .. +// CLEAR_ICALL_FRAME +// } +// +// As with HANDLE_FUNCTION_RETURN, you must not +// skip CLEAR_ICALL_FRAME -- no break, continue, return, or goto (goto label at CLEAR_ICALL_FRAME is idiom). +// +#define SETUP_ICALL_FUNCTION \ MONO_DISABLE_WARNING(4459) /* declaration of 'identifier' hides global declaration */ \ /* There are deliberately locals and a constant NULL global with this same name. */ \ MonoThreadInfo *mono_thread_info_current_var = mono_thread_info_current () \ MONO_RESTORE_WARNING +// A common use of manual icall frame management is for loop. +// It can also be used for conditionality, where only some paths +// through a function allocate handles and frame teardown does +// coincide with function return. For example: emit_invoke_call. +// +#define HANDLE_LOOP_PREPARE SETUP_ICALL_FUNCTION + // Return a non-pointer or non-managed pointer, e.g. gboolean. // VAL should be a local variable or at least not use handles in the current frame. // i.e. it is "val", not "expr". @@ -322,6 +342,10 @@ typedef struct _MonoTypeofCastHelper *MonoTypeofCastHelper; // a pointer type un #define MONO_TYPEOF_CAST(typeexpr, expr) ((__typeof__ (typeexpr))(expr)) #endif +/* + * Create handle for the object OBJECT. + * The handle will keep the object alive and pinned. + */ #ifndef MONO_HANDLE_TRACK_OWNER #define MONO_HANDLE_NEW(type, object) \ @@ -335,6 +359,12 @@ typedef struct _MonoTypeofCastHelper *MonoTypeofCastHelper; // a pointer type un #endif #define MONO_HANDLE_CAST(type, value) (MONO_HANDLE_CAST_FOR (type) ((value).__raw)) + +/* + * Return the raw object reference stored in the handle. + * The objref is valid while the handle is alive and + * points to it. + */ #ifdef __cplusplus #define MONO_HANDLE_RAW(handle) ((handle).GetRaw()) #else @@ -515,13 +545,41 @@ Constant handles may be initialized to it, but non-constant handles must be NEW'ed. Uses of these are suspicious and should be reviewed and probably changed FIXME. */ -extern const MonoObjectHandle mono_null_value_handle; -#define NULL_HANDLE mono_null_value_handle +#define NULL_HANDLE (mono_null_value_handle ()) #define NULL_HANDLE_INIT { 0 } +static inline MonoObjectHandle +mono_null_value_handle (void) +{ + MonoObjectHandle result = NULL_HANDLE_INIT; + return result; +} #define NULL_HANDLE_STRING (MONO_HANDLE_CAST (MonoString, NULL_HANDLE)) #define NULL_HANDLE_ARRAY (MONO_HANDLE_CAST (MonoArray, NULL_HANDLE)) #define NULL_HANDLE_STRING_BUILDER (MONO_HANDLE_CAST (MonoStringBuilder, NULL_HANDLE)) +#if __cplusplus + +// Use this to convert a THandle to a raw T** such as for a ref or out parameter, without +// copying back and forth through an intermediate. The handle must already be allocated, +// such as icall marshaling does for out and ref parameters. +#define MONO_HANDLE_REF(h) (h.Ref ()) + +#else + +static inline void volatile* +mono_handle_ref (void volatile* p) +{ + g_assert (p); + return p; +} + +// Use this to convert a THandle to a raw T** such as for a ref or out parameter, without +// copying back and forth through an intermediate. The handle must already be allocated, +// such as icall marshaling does for out and ref parameters. +#define MONO_HANDLE_REF(handle) (MONO_TYPEOF_CAST ((handle).__raw, mono_handle_ref ((handle).__raw))) + +#endif + static inline MonoObjectHandle mono_handle_assign_raw (MonoObjectHandleOut dest, void *src) { @@ -550,7 +608,7 @@ mono_handle_array_getref (MonoObjectHandleOut dest, MonoArrayHandle array, uintp #define mono_handle_class(o) MONO_HANDLE_SUPPRESS (mono_object_class (MONO_HANDLE_RAW (MONO_HANDLE_UNSUPPRESS (o)))) -#define mono_handle_vtable(o) MONO_HANDLE_SUPPRESS (MONO_HANDLE_RAW (MONO_HANDLE_UNSUPPRESS (o))->vtable) +#define mono_handle_vtable(o) MONO_HANDLE_GETVAL (o, vtable) /* Local handles to global GC handles and back */ diff --git a/mono/metadata/icall-decl.h b/mono/metadata/icall-decl.h index f667d64437..e3a38a1f1f 100644 --- a/mono/metadata/icall-decl.h +++ b/mono/metadata/icall-decl.h @@ -19,7 +19,6 @@ #include "marshal.h" #include "monitor.h" #include "mono-perfcounters.h" -#include "mono-route.h" #include "object-forward.h" #include "object-internals.h" #include "rand.h" @@ -83,11 +82,6 @@ ICALL_EXPORT MonoBoolean ves_icall_System_IO_DriveInfo_GetDiskFreeSpace (const g ICALL_EXPORT MonoBoolean ves_icall_System_Reflection_AssemblyName_ParseAssemblyName (const char*, MonoAssemblyName*, MonoBoolean*, MonoBoolean* is_token_defined_arg); ICALL_EXPORT MonoBoolean ves_icall_System_Runtime_CompilerServices_RuntimeHelpers_SufficientExecutionStack (void); ICALL_EXPORT MonoBoolean ves_icall_System_Threading_Thread_YieldInternal (void); -ICALL_EXPORT MonoObject* ves_icall_InternalExecute (MonoReflectionMethod*, MonoObject*, MonoArray*, MonoArray**); -ICALL_EXPORT MonoObject* ves_icall_InternalInvoke (MonoReflectionMethod*, MonoObject*, MonoArray*, MonoException**); -ICALL_EXPORT MonoObject* ves_icall_RuntimeFieldInfo_GetRawConstantValue (MonoReflectionField* rfield); -ICALL_EXPORT MonoObject* ves_icall_RuntimeFieldInfo_GetValueInternal (MonoReflectionField* field, MonoObject* obj); -ICALL_EXPORT MonoObject* ves_icall_property_info_get_default_value (MonoReflectionProperty*); ICALL_EXPORT void ves_icall_System_ArgIterator_Setup (MonoArgIterator*, char*, char*); ICALL_EXPORT MonoType* ves_icall_System_ArgIterator_IntGetNextArgType (MonoArgIterator*); ICALL_EXPORT void ves_icall_System_ArgIterator_IntGetNextArg (MonoArgIterator*, MonoTypedRef*); @@ -210,4 +204,6 @@ ICALL_EXPORT gint32 ves_icall_System_Net_NetworkInformation_LinuxNetworkChange_R ICALL_EXPORT gpointer ves_icall_System_Net_NetworkInformation_LinuxNetworkChange_CloseNLSocket (gpointer sock); #endif +ICALL_EXPORT MonoBoolean ves_icall_Mono_TlsProviderFactory_IsBtlsSupported (void); + #endif // __MONO_METADATA_ICALL_H__ diff --git a/mono/metadata/icall-def.h.REMOVED.git-id b/mono/metadata/icall-def.h.REMOVED.git-id index eae9e08379..325f554328 100644 --- a/mono/metadata/icall-def.h.REMOVED.git-id +++ b/mono/metadata/icall-def.h.REMOVED.git-id @@ -1 +1 @@ -7eb1e0b2d6cd10984359448c4cae86145e4f3d42 \ No newline at end of file +48b5bd54d07522e790ce6dda6c0940a7941e33bf \ No newline at end of file diff --git a/mono/metadata/icall-table.c b/mono/metadata/icall-table.c index 1bffd3fe0b..f019858ae7 100644 --- a/mono/metadata/icall-table.c +++ b/mono/metadata/icall-table.c @@ -302,7 +302,7 @@ mono_lookup_icall_symbol_internal (gpointer func) // Initialize with identity mapping. One line is easier to step over. for (T i = 0; i < N; ++i) functions_sorted [i] = i; - qsort (functions_sorted, N, sizeof (T), mono_qsort_icall_function_compare_indirect); + mono_qsort (functions_sorted, N, sizeof (T), mono_qsort_icall_function_compare_indirect); gpointer old = mono_atomic_cas_ptr ((gpointer*)&static_functions_sorted, functions_sorted, NULL); if (old) diff --git a/mono/metadata/icall-table.h b/mono/metadata/icall-table.h index e9d2283a89..acc38723c9 100644 --- a/mono/metadata/icall-table.h +++ b/mono/metadata/icall-table.h @@ -47,7 +47,10 @@ typedef int *int_ptr; typedef int **int_ptr_ref; typedef guint8 **guint8_ptr_ref; typedef GPtrArray *GPtrArray_ptr; +// HANDLE is not used just to avoid duplicate typedef warnings with some compilers. +// gpointer == void* == HANDLE == FILE_HANDLE == PROCESS_HANDLE. typedef gpointer PROCESS_HANDLE; +typedef gpointer FILE_HANDLE; typedef MonoAssemblyName *MonoAssemblyName_ptr; typedef MonoBoolean *MonoBoolean_ptr; typedef MonoClass *MonoClass_ptr; @@ -90,16 +93,18 @@ typedef MonoW32ProcessInfo *MonoW32ProcessInfo_ref; // Maybe do this in TYPED_HANDLE_DECL. typedef MonoArray MonoArrayOut; typedef MonoArray MonoArrayInOut; +typedef MonoArrayHandle MonoArrayOutHandle; +typedef MonoArrayHandle MonoArrayInOutHandle; +typedef MonoException MonoExceptionOut; +typedef MonoExceptionHandle MonoExceptionOutHandle; typedef MonoObject MonoObjectOut; typedef MonoObject MonoObjectInOut; typedef MonoObjectHandle MonoObjectOutHandle; typedef MonoObjectHandle MonoObjectInOutHandle; -typedef MonoArrayHandle MonoArrayOutHandle; -typedef MonoArrayHandle MonoArrayInOutHandle; -typedef MonoString MonoStringOut; -typedef MonoStringHandle MonoStringOutHandle; typedef MonoReflectionModule MonoReflectionModuleOut; typedef MonoReflectionModuleHandle MonoReflectionModuleOutHandle; +typedef MonoString MonoStringOut; +typedef MonoStringHandle MonoStringOutHandle; // How the arguments and return value of an icall should be wrapped. // The names and meanings are from marshal-ilgen.c. @@ -171,8 +176,11 @@ typedef MonoReflectionModuleHandle MonoReflectionModuleOutHandle; #define MONO_HANDLE_TYPE_WRAP_guint8_ptr_ref ICALL_HANDLES_WRAP_VALUETYPE_REF #define MONO_HANDLE_TYPE_WRAP_MonoResolveTokenError_ref ICALL_HANDLES_WRAP_VALUETYPE_REF +// HANDLE is not used just to avoid duplicate typedef warnings with some compilers. +// gpointer == void* == HANDLE == FILE_HANDLE == PROCESS_HANDLE. #define MONO_HANDLE_TYPE_WRAP_char_ptr ICALL_HANDLES_WRAP_NONE #define MONO_HANDLE_TYPE_WRAP_const_char_ptr ICALL_HANDLES_WRAP_NONE +#define MONO_HANDLE_TYPE_WRAP_FILE_HANDLE ICALL_HANDLES_WRAP_NONE #define MONO_HANDLE_TYPE_WRAP_MonoClass_ptr ICALL_HANDLES_WRAP_NONE #define MONO_HANDLE_TYPE_WRAP_MonoEvent_ptr ICALL_HANDLES_WRAP_NONE #define MONO_HANDLE_TYPE_WRAP_MonoGenericParamInfo_ptr ICALL_HANDLES_WRAP_NONE @@ -182,27 +190,29 @@ typedef MonoReflectionModuleHandle MonoReflectionModuleOutHandle; #define MONO_HANDLE_TYPE_WRAP_MonoStackCrawlMark_ptr ICALL_HANDLES_WRAP_NONE #define MONO_HANDLE_TYPE_WRAP_gint32_ptr ICALL_HANDLES_WRAP_NONE #define MONO_HANDLE_TYPE_WRAP_gpointer_ptr ICALL_HANDLES_WRAP_NONE -#define MONO_HANDLE_TYPE_WRAP_PROCESS_HANDLE ICALL_HANDLES_WRAP_NONE +#define MONO_HANDLE_TYPE_WRAP_PROCESS_HANDLE ICALL_HANDLES_WRAP_NONE // Please keep this sorted (grep ICALL_HANDLES_WRAP_OBJ$ | sort) #define MONO_HANDLE_TYPE_WRAP_MonoAppContext ICALL_HANDLES_WRAP_OBJ #define MONO_HANDLE_TYPE_WRAP_MonoAppDomain ICALL_HANDLES_WRAP_OBJ #define MONO_HANDLE_TYPE_WRAP_MonoAppDomainSetup ICALL_HANDLES_WRAP_OBJ #define MONO_HANDLE_TYPE_WRAP_MonoArray ICALL_HANDLES_WRAP_OBJ +#define MONO_HANDLE_TYPE_WRAP_MonoAsyncResult ICALL_HANDLES_WRAP_OBJ #define MONO_HANDLE_TYPE_WRAP_MonoCalendarData ICALL_HANDLES_WRAP_OBJ #define MONO_HANDLE_TYPE_WRAP_MonoComInteropProxy ICALL_HANDLES_WRAP_OBJ #define MONO_HANDLE_TYPE_WRAP_MonoComObject ICALL_HANDLES_WRAP_OBJ #define MONO_HANDLE_TYPE_WRAP_MonoCultureData ICALL_HANDLES_WRAP_OBJ #define MONO_HANDLE_TYPE_WRAP_MonoCultureInfo ICALL_HANDLES_WRAP_OBJ #define MONO_HANDLE_TYPE_WRAP_MonoDelegate ICALL_HANDLES_WRAP_OBJ -#define MONO_HANDLE_TYPE_WRAP_MonoReflectionDynamicMethod ICALL_HANDLES_WRAP_OBJ #define MONO_HANDLE_TYPE_WRAP_MonoException ICALL_HANDLES_WRAP_OBJ #define MONO_HANDLE_TYPE_WRAP_MonoInternalThread ICALL_HANDLES_WRAP_OBJ +#define MONO_HANDLE_TYPE_WRAP_MonoIOSelectorJob ICALL_HANDLES_WRAP_OBJ #define MONO_HANDLE_TYPE_WRAP_MonoObject ICALL_HANDLES_WRAP_OBJ #define MONO_HANDLE_TYPE_WRAP_MonoManifestResourceInfo ICALL_HANDLES_WRAP_OBJ #define MONO_HANDLE_TYPE_WRAP_MonoMulticastDelegate ICALL_HANDLES_WRAP_OBJ #define MONO_HANDLE_TYPE_WRAP_MonoReflectionAssembly ICALL_HANDLES_WRAP_OBJ #define MONO_HANDLE_TYPE_WRAP_MonoReflectionAssemblyBuilder ICALL_HANDLES_WRAP_OBJ +#define MONO_HANDLE_TYPE_WRAP_MonoReflectionDynamicMethod ICALL_HANDLES_WRAP_OBJ #define MONO_HANDLE_TYPE_WRAP_MonoReflectionEvent ICALL_HANDLES_WRAP_OBJ #define MONO_HANDLE_TYPE_WRAP_MonoReflectionMonoEvent ICALL_HANDLES_WRAP_OBJ #define MONO_HANDLE_TYPE_WRAP_MonoReflectionField ICALL_HANDLES_WRAP_OBJ @@ -223,6 +233,7 @@ typedef MonoReflectionModuleHandle MonoReflectionModuleOutHandle; #define MONO_HANDLE_TYPE_WRAP_MonoTransparentProxy ICALL_HANDLES_WRAP_OBJ #define MONO_HANDLE_TYPE_WRAP_MonoW32ProcessStartInfo ICALL_HANDLES_WRAP_OBJ +#define MONO_HANDLE_TYPE_WRAP_MonoExceptionOut ICALL_HANDLES_WRAP_OBJ_OUT #define MONO_HANDLE_TYPE_WRAP_MonoObjectOut ICALL_HANDLES_WRAP_OBJ_OUT #define MONO_HANDLE_TYPE_WRAP_MonoStringOut ICALL_HANDLES_WRAP_OBJ_OUT #define MONO_HANDLE_TYPE_WRAP_MonoArrayOut ICALL_HANDLES_WRAP_OBJ_OUT diff --git a/mono/metadata/icall.c.REMOVED.git-id b/mono/metadata/icall.c.REMOVED.git-id index a5388a0015..7fe971bac9 100644 --- a/mono/metadata/icall.c.REMOVED.git-id +++ b/mono/metadata/icall.c.REMOVED.git-id @@ -1 +1 @@ -acdecb311a252beab6c5bd5bd74400af5a63b675 \ No newline at end of file +7f5957aa9f7af2309900b0d456b8e286d9659ed0 \ No newline at end of file diff --git a/mono/metadata/image.c b/mono/metadata/image.c index 0d653265cd..9e05d37ce8 100644 --- a/mono/metadata/image.c +++ b/mono/metadata/image.c @@ -685,14 +685,6 @@ load_modules (MonoImage *image) MonoImage* mono_image_load_module_checked (MonoImage *image, int idx, MonoError *error) { - MonoTableInfo *t; - MonoTableInfo *file_table; - int i; - char *base_dir; - gboolean refonly = image->ref_only; - GList *list_iter, *valid_modules = NULL; - MonoImageOpenStatus status; - error_init (error); if ((image->module_count == 0) || (idx > image->module_count || idx <= 0)) @@ -704,6 +696,13 @@ mono_image_load_module_checked (MonoImage *image, int idx, MonoError *error) /* SRE still uses image->modules, but they are not loaded from files, so the rest of this function is dead code for netcore */ g_assert_not_reached (); #else + MonoTableInfo *t; + MonoTableInfo *file_table; + int i; + char *base_dir; + gboolean refonly = image->ref_only; + GList *list_iter, *valid_modules = NULL; + MonoImageOpenStatus status; mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_ASSEMBLY, "Loading module %d of %s (%s)", idx, image->assembly ? image->assembly->aname.name : "some assembly", image->name); @@ -738,7 +737,7 @@ mono_image_load_module_checked (MonoImage *image, int idx, MonoError *error) if (valid) { MonoAssemblyLoadContext *alc = mono_image_get_alc (image); MonoLoadedImages *li = mono_image_get_loaded_images_for_modules (image); - module_ref = g_build_filename (base_dir, name, NULL); + module_ref = g_build_filename (base_dir, name, (const char*)NULL); MonoImage *moduleImage = mono_image_open_a_lot_parameterized (li, alc, module_ref, &status, refonly, FALSE, NULL); if (moduleImage) { if (!assign_assembly_parent_for_netmodule (moduleImage, image, error)) { @@ -1336,15 +1335,12 @@ do_mono_image_load (MonoImage *image, MonoImageOpenStatus *status, gboolean care_about_cli, gboolean care_about_pecoff) { ERROR_DECL (error); - MonoCLIImageInfo *iinfo; GSList *l; MONO_PROFILER_RAISE (image_loading, (image)); mono_image_init (image); - iinfo = image->image_info; - if (!image->metadata_only) { for (l = image_loaders; l; l = l->next) { MonoImageLoader *loader = (MonoImageLoader *)l->data; @@ -1831,6 +1827,7 @@ mono_image_open_from_data_internal (MonoAssemblyLoadContext *alc, char *data, gu image->storage = storage; mono_image_init_raw_data (image, storage); image->name = (name == NULL) ? g_strdup_printf ("data-%p", datac) : g_strdup(name); + image->filename = name ? g_strdup (name) : NULL; iinfo = g_new0 (MonoCLIImageInfo, 1); image->image_info = iinfo; image->ref_only = refonly; @@ -1930,6 +1927,7 @@ mono_image_open_from_module_handle (MonoAssemblyLoadContext *alc, HMODULE module iinfo = g_new0 (MonoCLIImageInfo, 1); image->image_info = iinfo; image->name = fname; + image->filename = g_strdup (image->name); image->ref_count = has_entry_point ? 0 : 1; #ifdef ENABLE_NETCORE image->alc = alc; @@ -2275,7 +2273,7 @@ mono_dynamic_stream_reset (MonoDynamicStream* stream) } } -static inline void +static void free_hash (GHashTable *hash) { if (hash) @@ -2808,7 +2806,7 @@ mono_image_load_file_for_image_checked (MonoImage *image, int fileidx, MonoError fname_id = mono_metadata_decode_row_col (t, fileidx - 1, MONO_FILE_NAME); fname = mono_metadata_string_heap (image, fname_id); base_dir = g_path_get_dirname (image->name); - name = g_build_filename (base_dir, fname, NULL); + name = g_build_filename (base_dir, fname, (const char*)NULL); res = mono_image_open (name, NULL); if (!res) goto done; diff --git a/mono/metadata/jit-icall-reg.h b/mono/metadata/jit-icall-reg.h index 4bc81d14de..91c0ce6f48 100644 --- a/mono/metadata/jit-icall-reg.h +++ b/mono/metadata/jit-icall-reg.h @@ -125,6 +125,8 @@ MONO_JIT_ICALL (cominterop_get_function_pointer) \ MONO_JIT_ICALL (cominterop_get_interface) \ MONO_JIT_ICALL (cominterop_get_method_interface) \ MONO_JIT_ICALL (cominterop_object_is_rcw) \ +MONO_JIT_ICALL (cominterop_restore_domain) \ +MONO_JIT_ICALL (cominterop_set_ccw_object_domain) \ MONO_JIT_ICALL (cominterop_type_from_handle) \ MONO_JIT_ICALL (g_free) \ MONO_JIT_ICALL (interp_to_native_trampoline) \ diff --git a/mono/metadata/loader-internals.h b/mono/metadata/loader-internals.h index d240f6a365..9d61ed4245 100644 --- a/mono/metadata/loader-internals.h +++ b/mono/metadata/loader-internals.h @@ -6,6 +6,7 @@ #define _MONO_METADATA_LOADER_INTERNALS_H_ #include +#include #include #include #include @@ -48,12 +49,6 @@ mono_alc_assemblies_lock (MonoAssemblyLoadContext *alc); void mono_alc_assemblies_unlock (MonoAssemblyLoadContext *alc); -static inline MonoDomain * -mono_alc_domain (MonoAssemblyLoadContext *alc) -{ - return alc->domain; -} - gboolean mono_alc_is_default (MonoAssemblyLoadContext *alc); @@ -68,6 +63,16 @@ mono_alc_invoke_resolve_using_resolve_satellite_nofail (MonoAssemblyLoadContext #endif /* ENABLE_NETCORE */ +static inline MonoDomain * +mono_alc_domain (MonoAssemblyLoadContext *alc) +{ +#ifdef ENABLE_NETCORE + return alc->domain; +#else + return mono_domain_get (); +#endif +} + MonoLoadedImages * mono_alc_get_loaded_images (MonoAssemblyLoadContext *alc); diff --git a/mono/metadata/loader.c b/mono/metadata/loader.c index 1d6624bfe4..baf724180f 100644 --- a/mono/metadata/loader.c +++ b/mono/metadata/loader.c @@ -405,11 +405,11 @@ find_method_in_class (MonoClass *klass, const char *name, const char *qname, con continue; method = mono_get_method_checked (klass_image, MONO_TOKEN_METHOD_DEF | (first_idx + i + 1), klass, NULL, error); - if (!mono_error_ok (error)) //bail out if we hit a loader error + if (!is_ok (error)) //bail out if we hit a loader error return NULL; if (method) { other_sig = mono_method_signature_checked (method, error); - if (!mono_error_ok (error)) //bail out if we hit a loader error + if (!is_ok (error)) //bail out if we hit a loader error return NULL; if (other_sig && (sig->call_convention != MONO_CALL_VARARG) && mono_metadata_signature_equal (sig, other_sig)) return method; @@ -445,7 +445,7 @@ find_method_in_class (MonoClass *klass, const char *name, const char *qname, con (name && !strcmp (m->name, name)))) continue; msig = mono_method_signature_checked (m, error); - if (!mono_error_ok (error)) //bail out if we hit a loader error + if (!is_ok (error)) //bail out if we hit a loader error return NULL; if (!msig) @@ -480,10 +480,10 @@ find_method (MonoClass *in_class, MonoClass *ic, const char* name, MonoMethodSig if (ic) { class_name = mono_type_get_name_full (m_class_get_byval_arg (ic), MONO_TYPE_NAME_FORMAT_IL); - qname = g_strconcat (class_name, ".", name, NULL); + qname = g_strconcat (class_name, ".", name, (const char*)NULL); const char *ic_name_space = m_class_get_name_space (ic); if (ic_name_space && ic_name_space [0]) - fqname = g_strconcat (ic_name_space, ".", class_name, ".", name, NULL); + fqname = g_strconcat (ic_name_space, ".", class_name, ".", name, (const char*)NULL); else fqname = NULL; } else @@ -492,7 +492,7 @@ find_method (MonoClass *in_class, MonoClass *ic, const char* name, MonoMethodSig while (in_class) { g_assert (from_class); result = find_method_in_class (in_class, name, qname, fqname, sig, from_class, error); - if (result || !mono_error_ok (error)) + if (result || !is_ok (error)) goto out; if (name [0] == '.' && (!strcmp (name, ".ctor") || !strcmp (name, ".cctor"))) @@ -517,10 +517,10 @@ find_method (MonoClass *in_class, MonoClass *ic, const char* name, MonoMethodSig char *ic_qname, *ic_fqname, *ic_class_name; ic_class_name = mono_type_get_name_full (m_class_get_byval_arg (in_ic), MONO_TYPE_NAME_FORMAT_IL); - ic_qname = g_strconcat (ic_class_name, ".", name, NULL); + ic_qname = g_strconcat (ic_class_name, ".", name, (const char*)NULL); const char *in_ic_name_space = m_class_get_name_space (in_ic); if (in_ic_name_space && in_ic_name_space [0]) - ic_fqname = g_strconcat (in_ic_name_space, ".", ic_class_name, ".", name, NULL); + ic_fqname = g_strconcat (in_ic_name_space, ".", ic_class_name, ".", name, (const char*)NULL); else ic_fqname = NULL; @@ -528,7 +528,7 @@ find_method (MonoClass *in_class, MonoClass *ic, const char* name, MonoMethodSig g_free (ic_class_name); g_free (ic_fqname); g_free (ic_qname); - if (result || !mono_error_ok (error)) + if (result || !is_ok (error)) goto out; } @@ -541,7 +541,7 @@ find_method (MonoClass *in_class, MonoClass *ic, const char* name, MonoMethodSig result = find_method_in_class (mono_defaults.object_class, name, qname, fqname, sig, mono_defaults.object_class, error); //we did not find the method - if (!result && mono_error_ok (error)) + if (!result && is_ok (error)) mono_error_set_method_missing (error, initial_class, name, sig, NULL); out: @@ -566,12 +566,12 @@ inflate_generic_signature_checked (MonoImage *image, MonoMethodSignature *sig, M res->param_count = sig->param_count; res->sentinelpos = -1; res->ret = mono_class_inflate_generic_type_checked (sig->ret, context, error); - if (!mono_error_ok (error)) + if (!is_ok (error)) goto fail; is_open = mono_class_is_open_constructed_type (res->ret); for (i = 0; i < sig->param_count; ++i) { res->params [i] = mono_class_inflate_generic_type_checked (sig->params [i], context, error); - if (!mono_error_ok (error)) + if (!is_ok (error)) goto fail; if (!is_open) @@ -609,7 +609,7 @@ mono_inflate_generic_signature (MonoMethodSignature *sig, MonoGenericContext *co MonoMethodSignature *res, *cached; res = inflate_generic_signature_checked (NULL, sig, context, error); - if (!mono_error_ok (error)) + if (!is_ok (error)) return NULL; cached = mono_metadata_get_inflated_signature (res, context); if (cached != res) @@ -738,7 +738,7 @@ mono_method_get_signature_checked (MonoMethod *method, MonoImage *image, guint32 /* This signature is not owned by a MonoMethod, so need to cache */ sig = inflate_generic_signature_checked (image, sig, context, error); - if (!mono_error_ok (error)) + if (!is_ok (error)) return NULL; cached = mono_metadata_get_inflated_signature (sig, context); @@ -749,7 +749,7 @@ mono_method_get_signature_checked (MonoMethod *method, MonoImage *image, guint32 sig = cached; } - g_assert (mono_error_ok (error)); + g_assert (is_ok (error)); return sig; } @@ -893,13 +893,13 @@ method_from_memberref (MonoImage *image, guint32 idx, MonoGenericContext *typesp goto fail; } - if (!method && mono_error_ok (error)) + if (!method && is_ok (error)) mono_error_set_method_missing (error, klass, mname, sig, "Failed to load due to unknown reasons"); return method; fail: - g_assert (!mono_error_ok (error)); + g_assert (!is_ok (error)); return NULL; } @@ -936,7 +936,7 @@ method_from_methodspec (MonoImage *image, MonoGenericContext *context, guint32 i if (context && inst->is_open) { inst = mono_metadata_inflate_generic_inst (inst, context, error); - if (!mono_error_ok (error)) + if (!is_ok (error)) return NULL; } @@ -1768,23 +1768,23 @@ pinvoke_probe_for_symbol (MonoDl *module, MonoMethodPInvoke *piinfo, const char case PINVOKE_ATTRIBUTE_CHAR_SET_UNICODE: /* Try the mangled name first */ if (mangle_charset == 0) - mangled_name = g_strconcat (import, "W", NULL); + mangled_name = g_strconcat (import, "W", (const char*)NULL); break; case PINVOKE_ATTRIBUTE_CHAR_SET_AUTO: #ifdef HOST_WIN32 if (mangle_charset == 0) - mangled_name = g_strconcat (import, "W", NULL); + mangled_name = g_strconcat (import, "W", (const char*)NULL); #else /* Try the mangled name last */ if (mangle_charset == 1) - mangled_name = g_strconcat (import, "A", NULL); + mangled_name = g_strconcat (import, "A", (const char*)NULL); #endif break; case PINVOKE_ATTRIBUTE_CHAR_SET_ANSI: default: /* Try the mangled name last */ if (mangle_charset == 1) - mangled_name = g_strconcat (import, "A", NULL); + mangled_name = g_strconcat (import, "A", (const char*)NULL); break; } @@ -2194,6 +2194,9 @@ mono_get_method_constrained_checked (MonoImage *image, guint32 token, MonoClass void mono_free_method (MonoMethod *method) { + if (!method) + return; + MONO_PROFILER_RAISE (method_free, (method)); /* FIXME: This hack will go away when the profiler will support freeing methods */ @@ -2670,12 +2673,13 @@ mono_loader_unlock_if_inited (void) } /** - * mono_method_signature_checked: + * mono_method_signature_checked_slow: * * Return the signature of the method M. On failure, returns NULL, and ERR is set. + * Call mono_method_signature_checked instead. */ MonoMethodSignature* -mono_method_signature_checked (MonoMethod *m, MonoError *error) +mono_method_signature_checked_slow (MonoMethod *m, MonoError *error) { int idx; MonoImage* img; @@ -2699,7 +2703,7 @@ mono_method_signature_checked (MonoMethod *m, MonoError *error) /* the lock is recursive */ signature = mono_method_signature_internal (imethod->declaring); signature = inflate_generic_signature_checked (m_class_get_image (imethod->declaring->klass), signature, mono_method_get_context (m), error); - if (!mono_error_ok (error)) + if (!is_ok (error)) return NULL; mono_atomic_fetch_add_i32 (&inflated_signatures_size, mono_metadata_signature_size (signature)); @@ -2829,11 +2833,12 @@ mono_method_signature_checked (MonoMethod *m, MonoError *error) } /** - * mono_method_signature_internal: + * mono_method_signature_internal_slow: * \returns the signature of the method \p m. On failure, returns NULL. + * Call mono_method_signature_internal instead. */ MonoMethodSignature* -mono_method_signature_internal (MonoMethod *m) +mono_method_signature_internal_slow (MonoMethod *m) { ERROR_DECL (error); MonoMethodSignature *sig = mono_method_signature_checked (m, error); diff --git a/mono/metadata/marshal-ilgen.c.REMOVED.git-id b/mono/metadata/marshal-ilgen.c.REMOVED.git-id index 794b05a37e..34d6a3ecc5 100644 --- a/mono/metadata/marshal-ilgen.c.REMOVED.git-id +++ b/mono/metadata/marshal-ilgen.c.REMOVED.git-id @@ -1 +1 @@ -ea90d87c4867a8666ada8acae9f8d44ef95a18b8 \ No newline at end of file +e8516be2d4507b0bdff989d4bedc9c9f83f8b660 \ No newline at end of file diff --git a/mono/metadata/marshal.c.REMOVED.git-id b/mono/metadata/marshal.c.REMOVED.git-id index 4fb0d59b4d..5195c96e9a 100644 --- a/mono/metadata/marshal.c.REMOVED.git-id +++ b/mono/metadata/marshal.c.REMOVED.git-id @@ -1 +1 @@ -34722314579cbef967dc0d8a9c48fe7612688b62 \ No newline at end of file +e6c326dbe7faf987800aa406b538ed08f344b5ad \ No newline at end of file diff --git a/mono/metadata/marshal.h b/mono/metadata/marshal.h index dbfc07d17c..f19be3994d 100644 --- a/mono/metadata/marshal.h +++ b/mono/metadata/marshal.h @@ -131,7 +131,8 @@ typedef enum { WRAPPER_SUBTYPE_GSHAREDVT_OUT_SIG, WRAPPER_SUBTYPE_INTERP_IN, WRAPPER_SUBTYPE_INTERP_LMF, - WRAPPER_SUBTYPE_AOT_INIT + WRAPPER_SUBTYPE_AOT_INIT, + WRAPPER_SUBTYPE_LLVM_FUNC } WrapperSubtype; typedef struct { @@ -224,6 +225,17 @@ typedef struct { MonoAotInitSubtype subtype; } AOTInitWrapperInfo; +typedef enum { + LLVM_FUNC_WRAPPER_GC_POLL = 0 +} MonoLLVMFuncWrapperSubtype; + +typedef struct { + // We emit this code when we init the module, + // and later match up the native code with this method + // using the name. + MonoLLVMFuncWrapperSubtype subtype; +} LLVMFuncWrapperInfo; + /* * This structure contains additional information to uniquely identify a given wrapper * method. It can be retrieved by mono_marshal_get_wrapper_info () for certain types @@ -270,6 +282,8 @@ typedef struct { InterpInWrapperInfo interp_in; /* AOT_INIT */ AOTInitWrapperInfo aot_init; + /* LLVM_FUNC */ + LLVMFuncWrapperInfo llvm_func; } d; } WrapperInfo; @@ -441,6 +455,9 @@ mono_marshal_get_aot_init_wrapper (MonoAotInitSubtype subtype) MONO_LLVM_INTERNA const char * mono_marshal_get_aot_init_wrapper_name (MonoAotInitSubtype subtype) MONO_LLVM_INTERNAL; +MonoMethod * +mono_marshal_get_llvm_func_wrapper (MonoLLVMFuncWrapperSubtype subtype) MONO_LLVM_INTERNAL; + MonoMethod * mono_marshal_get_native_wrapper (MonoMethod *method, gboolean check_exceptions, gboolean aot); @@ -583,6 +600,10 @@ ICALL_EXPORT guint32 ves_icall_System_Runtime_InteropServices_Marshal_GetLastWin32Error (void); +ICALL_EXPORT +void +ves_icall_System_Runtime_InteropServices_Marshal_SetLastWin32Error (guint32 err); + ICALL_EXPORT mono_bstr ves_icall_System_Runtime_InteropServices_Marshal_BufferToBSTR (const gunichar2 *ptr, int len); diff --git a/mono/metadata/metadata-internals.h b/mono/metadata/metadata-internals.h index 840a6f8fdd..b033439c43 100644 --- a/mono/metadata/metadata-internals.h +++ b/mono/metadata/metadata-internals.h @@ -1184,9 +1184,26 @@ m_image_has_entry_point (MonoImage *image) { return image->storage ? image->storage->has_entry_point : FALSE; } - #endif +static inline const char * +m_image_get_name (MonoImage *image) +{ + return image->name; +} + +static inline const char * +m_image_get_filename (MonoImage *image) +{ + return image->filename; +} + +static inline const char * +m_image_get_assembly_name (MonoImage *image) +{ + return image->assembly_name; +} + static inline MonoAssemblyLoadContext * mono_image_get_alc (MonoImage *image) @@ -1205,4 +1222,71 @@ mono_assembly_get_alc (MonoAssembly *assm) return mono_image_get_alc (assm->image); } +/** + * mono_type_get_type_internal: + * \param type the \c MonoType operated on + * \returns the IL type value for \p type. This is one of the \c MonoTypeEnum + * enum members like \c MONO_TYPE_I4 or \c MONO_TYPE_STRING. + */ +static inline int +mono_type_get_type_internal (MonoType *type) +{ + return type->type; +} + +/** + * mono_type_get_signature: + * \param type the \c MonoType operated on + * It is only valid to call this function if \p type is a \c MONO_TYPE_FNPTR . + * \returns the \c MonoMethodSignature pointer that describes the signature + * of the function pointer \p type represents. + */ +static inline MonoMethodSignature* +mono_type_get_signature_internal (MonoType *type) +{ + g_assert (type->type == MONO_TYPE_FNPTR); + return type->data.method; +} + +/** + * mono_type_is_byref_internal: + * \param type the \c MonoType operated on + * \returns TRUE if \p type represents a type passed by reference, + * FALSE otherwise. + */ +static inline mono_bool +mono_type_is_byref_internal (MonoType *type) +{ + return type->byref; +} + +/** + * mono_type_get_class_internal: + * \param type the \c MonoType operated on + * It is only valid to call this function if \p type is a \c MONO_TYPE_CLASS or a + * \c MONO_TYPE_VALUETYPE . For more general functionality, use \c mono_class_from_mono_type_internal, + * instead. + * \returns the \c MonoClass pointer that describes the class that \p type represents. + */ +static inline MonoClass* +mono_type_get_class_internal (MonoType *type) +{ + /* FIXME: review the runtime users before adding the assert here */ + return type->data.klass; +} + +/** + * mono_type_get_array_type_internal: + * \param type the \c MonoType operated on + * It is only valid to call this function if \p type is a \c MONO_TYPE_ARRAY . + * \returns a \c MonoArrayType struct describing the array type that \p type + * represents. The info includes details such as rank, array element type + * and the sizes and bounds of multidimensional arrays. + */ +static inline MonoArrayType* +mono_type_get_array_type_internal (MonoType *type) +{ + return type->data.array; +} + #endif /* __MONO_METADATA_INTERNALS_H__ */ diff --git a/mono/metadata/metadata-verify.c.REMOVED.git-id b/mono/metadata/metadata-verify.c.REMOVED.git-id index 119f12326d..6751f6211c 100644 --- a/mono/metadata/metadata-verify.c.REMOVED.git-id +++ b/mono/metadata/metadata-verify.c.REMOVED.git-id @@ -1 +1 @@ -33fd435e147b5d88898cbd57fcd6b6662f549581 \ No newline at end of file +eaa22e104ab56fffa436f746b74698386702e7f3 \ No newline at end of file diff --git a/mono/metadata/metadata.c.REMOVED.git-id b/mono/metadata/metadata.c.REMOVED.git-id index 79603af246..b0967ee7e7 100644 --- a/mono/metadata/metadata.c.REMOVED.git-id +++ b/mono/metadata/metadata.c.REMOVED.git-id @@ -1 +1 @@ -9f0c68953288205a96686e305f6f1068b4730cf1 \ No newline at end of file +ecc4414cc92dc2f53d51365c34f4ae2e99f1c90e \ No newline at end of file diff --git a/mono/metadata/metadata.h b/mono/metadata/metadata.h index 643cf4444b..f6646d6be2 100644 --- a/mono/metadata/metadata.h +++ b/mono/metadata/metadata.h @@ -337,18 +337,18 @@ typedef enum { MONO_PARSE_FIELD } MonoParseTypeMode; -MONO_API mono_bool +MONO_API MONO_RT_EXTERNAL_ONLY mono_bool mono_type_is_byref (MonoType *type); -MONO_API int +MONO_API MONO_RT_EXTERNAL_ONLY int mono_type_get_type (MonoType *type); /* For MONO_TYPE_FNPTR */ -MONO_API MonoMethodSignature* +MONO_API MONO_RT_EXTERNAL_ONLY MonoMethodSignature* mono_type_get_signature (MonoType *type); /* For MONO_TYPE_CLASS, VALUETYPE */ -MONO_API MonoClass* +MONO_API MONO_RT_EXTERNAL_ONLY MonoClass* mono_type_get_class (MonoType *type); MONO_API MonoArrayType* diff --git a/mono/metadata/monitor.c b/mono/metadata/monitor.c index 8f0bcc1b93..f807b31c11 100644 --- a/mono/metadata/monitor.c +++ b/mono/metadata/monitor.c @@ -34,6 +34,7 @@ #include #include #include "external-only.h" +#include "icall-decl.h" /* * Pull the list of opcodes @@ -90,19 +91,19 @@ static int array_size = 16; /* MonoThreadsSync status helpers */ -static inline guint32 +static guint32 mon_status_get_owner (guint32 status) { return status & OWNER_MASK; } -static inline guint32 +static guint32 mon_status_set_owner (guint32 status, guint32 owner) { return (status & ENTRY_COUNT_MASK) | owner; } -static inline gint32 +static gint32 mon_status_get_entry_count (guint32 status) { gint32 entry_count = (gint32)((status & ENTRY_COUNT_MASK) >> ENTRY_COUNT_SHIFT); @@ -110,13 +111,13 @@ mon_status_get_entry_count (guint32 status) return entry_count - zero; } -static inline guint32 +static guint32 mon_status_init_entry_count (guint32 status) { return (status & OWNER_MASK) | ENTRY_COUNT_ZERO; } -static inline guint32 +static guint32 mon_status_add_entry_count (guint32 status, int val) { if (val > 0) @@ -125,7 +126,7 @@ mon_status_add_entry_count (guint32 status, int val) return status - ((-val) << ENTRY_COUNT_SHIFT); } -static inline gboolean +static gboolean mon_status_have_waiters (guint32 status) { return status & ENTRY_COUNT_WAITERS; @@ -133,26 +134,26 @@ mon_status_have_waiters (guint32 status) /* LockWord helpers */ -static inline MonoThreadsSync* +static MonoThreadsSync* lock_word_get_inflated_lock (LockWord lw) { lw.lock_word &= (~LOCK_WORD_STATUS_MASK); return lw.sync; } -static inline gboolean +static gboolean lock_word_is_inflated (LockWord lw) { return lw.lock_word & LOCK_WORD_INFLATED; } -static inline gboolean +static gboolean lock_word_has_hash (LockWord lw) { return lw.lock_word & LOCK_WORD_HAS_HASH; } -static inline LockWord +static LockWord lock_word_set_has_hash (LockWord lw) { LockWord nlw; @@ -160,26 +161,26 @@ lock_word_set_has_hash (LockWord lw) return nlw; } -static inline gboolean +static gboolean lock_word_is_free (LockWord lw) { return !lw.lock_word; } -static inline gboolean +static gboolean lock_word_is_flat (LockWord lw) { /* Return whether the lock is flat or free */ return (lw.lock_word & LOCK_WORD_STATUS_MASK) == LOCK_WORD_FLAT; } -static inline gint32 +static gint32 lock_word_get_hash (LockWord lw) { return (gint32) (lw.lock_word >> LOCK_WORD_HASH_SHIFT); } -static inline gint32 +static gint32 lock_word_get_nest (LockWord lw) { if (lock_word_is_free (lw)) @@ -188,39 +189,39 @@ lock_word_get_nest (LockWord lw) return ((lw.lock_word & LOCK_WORD_NEST_MASK) >> LOCK_WORD_NEST_SHIFT) + 1; } -static inline gboolean +static gboolean lock_word_is_nested (LockWord lw) { return lw.lock_word & LOCK_WORD_NEST_MASK; } -static inline gboolean +static gboolean lock_word_is_max_nest (LockWord lw) { return (lw.lock_word & LOCK_WORD_NEST_MASK) == LOCK_WORD_NEST_MASK; } -static inline LockWord +static LockWord lock_word_increment_nest (LockWord lw) { lw.lock_word += 1 << LOCK_WORD_NEST_SHIFT; return lw; } -static inline LockWord +static LockWord lock_word_decrement_nest (LockWord lw) { lw.lock_word -= 1 << LOCK_WORD_NEST_SHIFT; return lw; } -static inline gint32 +static gint32 lock_word_get_owner (LockWord lw) { return lw.lock_word >> LOCK_WORD_OWNER_SHIFT; } -static inline LockWord +static LockWord lock_word_new_thin_hash (gint32 hash) { LockWord lw; @@ -229,7 +230,7 @@ lock_word_new_thin_hash (gint32 hash) return lw; } -static inline LockWord +static LockWord lock_word_new_inflated (MonoThreadsSync *mon) { LockWord lw; @@ -238,7 +239,7 @@ lock_word_new_inflated (MonoThreadsSync *mon) return lw; } -static inline LockWord +static LockWord lock_word_new_flat (gint32 owner) { LockWord lw; @@ -561,6 +562,7 @@ int mono_object_hash_internal (MonoObject* obj) { #ifdef HAVE_MOVING_COLLECTOR + LockWord lw; unsigned int hash; if (!obj) @@ -619,13 +621,22 @@ mono_object_hash_internal (MonoObject* obj) mono_memory_write_barrier (); obj->synchronisation = lw.sync; return hash; + #else + /* * Wang's address-based hash function: * http://www.concentric.net/~Ttwang/tech/addrhash.htm */ return (GPOINTER_TO_UINT (obj) >> MONO_OBJECT_ALIGNMENT_SHIFT) * 2654435761u; #endif + +} + +int +mono_object_hash_icall (MonoObjectHandle obj, MonoError* error) +{ + return mono_object_hash_internal (MONO_HANDLE_RAW (obj)); } /* @@ -637,6 +648,7 @@ mono_object_hash_internal (MonoObject* obj) int mono_object_hash (MonoObject* obj) { + // FIXME slow? MONO_EXTERNAL_ONLY (int, mono_object_hash_internal (obj)); } @@ -782,7 +794,7 @@ signal_monitor (gpointer mon_untyped) /* If allow_interruption==TRUE, the method will be interrupted if abort or suspend * is requested. In this case it returns -1. */ -static inline gint32 +static gint32 mono_monitor_try_enter_inflated (MonoObject *obj, guint32 ms, gboolean allow_interruption, guint32 id) { LockWord lw; @@ -969,7 +981,7 @@ retry_contended: * If allow_interruption == TRUE, the method will be interrupted if abort or suspend * is requested. In this case it returns -1. */ -static inline gint32 +static gint32 mono_monitor_try_enter_internal (MonoObject *obj, guint32 ms, gboolean allow_interruption) { LockWord lw; @@ -1062,6 +1074,7 @@ mono_monitor_enter_internal (MonoObject *obj) gboolean mono_monitor_enter (MonoObject *obj) { + // FIXME slow? MONO_EXTERNAL_ONLY (gboolean, mono_monitor_enter_internal (obj)); } @@ -1117,6 +1130,12 @@ mono_monitor_exit_internal (MonoObject *obj) mono_monitor_exit_flat (obj, lw); } +void +mono_monitor_exit_icall (MonoObjectHandle obj, MonoError* error) +{ + mono_monitor_exit_internal (MONO_HANDLE_RAW (obj)); +} + /** * mono_monitor_exit: */ @@ -1159,24 +1178,38 @@ mono_monitor_threads_sync_members_offset (int *status_offset, int *nest_offset) *nest_offset = ENCODE_OFF_SIZE (MONO_STRUCT_OFFSET (MonoThreadsSync, nest), sizeof (ts.nest)); } -void -ves_icall_System_Threading_Monitor_Monitor_try_enter_with_atomic_var (MonoObject *obj, guint32 ms, MonoBoolean *lockTaken) +static void +mono_monitor_try_enter_with_atomic_var (MonoObject *obj, guint32 ms, MonoBoolean *lockTaken, MonoError* error) { + // The use of error here is unusual, but expedient, and easy enough to understand. + // Maybe clean it up later. + gint32 res; gboolean allow_interruption = TRUE; + if (G_UNLIKELY (!obj)) { - ERROR_DECL (error); - mono_error_set_argument_null (error, "obj", ""); - mono_error_set_pending_exception (error); + if (error) { + mono_error_set_argument_null (error, "obj", ""); + } else { + ERROR_DECL (error); + mono_error_set_argument_null (error, "obj", ""); + mono_error_set_pending_exception (error); + } return; } + do { res = mono_monitor_try_enter_internal (obj, ms, allow_interruption); /*This means we got interrupted during the wait and didn't got the monitor.*/ if (res == -1) { MonoException *exc = mono_thread_interruption_checkpoint (); if (exc) { - mono_set_pending_exception (exc); + if (error) { // implies icall and coop handle frame -- a little gross + MONO_HANDLE_NEW (MonoException, exc); + mono_error_set_exception_instance (error, exc); + } else { + mono_set_pending_exception (exc); + } return; } else { //we detected a pending interruption but it turned out to be a false positive, we ignore it from now on (this feels like a hack, right?, threads.c should give us less confusing directions) @@ -1184,10 +1217,17 @@ ves_icall_System_Threading_Monitor_Monitor_try_enter_with_atomic_var (MonoObject } } } while (res == -1); + /*It's safe to do it from here since interruption would happen only on the wrapper.*/ *lockTaken = res == 1; } +void +ves_icall_System_Threading_Monitor_Monitor_try_enter_with_atomic_var (MonoObjectHandle obj, guint32 ms, MonoBoolean* lockTaken, MonoError* error) +{ + mono_monitor_try_enter_with_atomic_var (MONO_HANDLE_RAW (obj), ms, lockTaken, error); +} + /** * mono_monitor_enter_v4: */ @@ -1195,7 +1235,7 @@ void mono_monitor_enter_v4 (MonoObject *obj, char *lock_taken) { g_static_assert (sizeof (MonoBoolean) == 1); - mono_monitor_enter_v4_internal (obj, (MonoBoolean*)lock_taken); + mono_monitor_enter_v4_internal (obj, (MonoBoolean*)lock_taken); } /* Called from JITted code */ @@ -1208,8 +1248,7 @@ mono_monitor_enter_v4_internal (MonoObject *obj, MonoBoolean *lock_taken) mono_error_set_pending_exception (error); return; } - - ves_icall_System_Threading_Monitor_Monitor_try_enter_with_atomic_var (obj, MONO_INFINITE_WAIT, lock_taken); + mono_monitor_try_enter_with_atomic_var (obj, MONO_INFINITE_WAIT, lock_taken, NULL); } /* @@ -1223,18 +1262,19 @@ mono_monitor_enter_v4_internal (MonoObject *obj, MonoBoolean *lock_taken) guint32 mono_monitor_enter_v4_fast (MonoObject *obj, MonoBoolean *lock_taken) { - if (*lock_taken == 1) + if (*lock_taken == 1 || G_UNLIKELY (!obj)) return FALSE; - if (G_UNLIKELY (!obj)) - return FALSE; - gint32 res = mono_monitor_try_enter_internal (obj, 0, TRUE); - *lock_taken = res == 1; - return res == 1; + + gboolean const res = mono_monitor_try_enter_internal (obj, 0, TRUE) == 1; + *lock_taken = (MonoBoolean)res; + return (guint32)res; } MonoBoolean -ves_icall_System_Threading_Monitor_Monitor_test_owner (MonoObject *obj) +ves_icall_System_Threading_Monitor_Monitor_test_owner (MonoObjectHandle obj_handle, MonoError* error) { + MonoObject* const obj = MONO_HANDLE_RAW (obj_handle); + LockWord lw; LOCK_DEBUG (g_message ("%s: Testing if %p is owned by thread %d", __func__, obj, mono_thread_info_get_small_id())); @@ -1247,12 +1287,14 @@ ves_icall_System_Threading_Monitor_Monitor_test_owner (MonoObject *obj) return mon_status_get_owner (lock_word_get_inflated_lock (lw)->status) == mono_thread_info_get_small_id (); } - return(FALSE); + return FALSE; } MonoBoolean -ves_icall_System_Threading_Monitor_Monitor_test_synchronised (MonoObject *obj) +ves_icall_System_Threading_Monitor_Monitor_test_synchronised (MonoObjectHandle obj_handle, MonoError* error) { + MonoObject* const obj = MONO_HANDLE_RAW (obj_handle); + LockWord lw; LOCK_DEBUG (g_message("%s: (%d) Testing if %p is owned by any thread", __func__, mono_thread_info_get_small_id (), obj)); @@ -1307,20 +1349,22 @@ mono_monitor_pulse (MonoObject *obj, const char *func, gboolean all) } void -ves_icall_System_Threading_Monitor_Monitor_pulse (MonoObject *obj) +ves_icall_System_Threading_Monitor_Monitor_pulse (MonoObjectHandle obj, MonoError* error) { - mono_monitor_pulse (obj, __func__, FALSE); + mono_monitor_pulse (MONO_HANDLE_RAW (obj), __func__, FALSE); } void -ves_icall_System_Threading_Monitor_Monitor_pulse_all (MonoObject *obj) +ves_icall_System_Threading_Monitor_Monitor_pulse_all (MonoObjectHandle obj, MonoError* error) { - mono_monitor_pulse (obj, __func__, TRUE); + mono_monitor_pulse (MONO_HANDLE_RAW (obj), __func__, TRUE); } MonoBoolean -ves_icall_System_Threading_Monitor_Monitor_wait (MonoObject *obj, guint32 ms) +ves_icall_System_Threading_Monitor_Monitor_wait (MonoObjectHandle obj_handle, guint32 ms, MonoError* error) { + MonoObject* const obj = MONO_HANDLE_RAW (obj_handle); + LockWord lw; MonoThreadsSync *mon; HANDLE event; @@ -1434,7 +1478,19 @@ ves_icall_System_Threading_Monitor_Monitor_wait (MonoObject *obj, guint32 ms) } void -ves_icall_System_Threading_Monitor_Monitor_Enter (MonoObject *obj) +ves_icall_System_Threading_Monitor_Monitor_Enter (MonoObjectHandle obj, MonoError* error) { - mono_monitor_enter_internal (obj); + mono_monitor_enter_internal (MONO_HANDLE_RAW (obj)); } + +#if ENABLE_NETCORE +gint64 +ves_icall_System_Threading_Monitor_Monitor_LockContentionCount (void) +{ +#ifndef DISABLE_PERFCOUNTERS + return mono_perfcounters->thread_contentions; +#else + return 0; +#endif +} +#endif \ No newline at end of file diff --git a/mono/metadata/monitor.h b/mono/metadata/monitor.h index 76322c41d9..8646a58c03 100644 --- a/mono/metadata/monitor.h +++ b/mono/metadata/monitor.h @@ -126,32 +126,10 @@ mono_monitor_threads_sync_members_offset (int *status_offset, int *nest_offset); #define MONO_THREADS_SYNC_MEMBER_OFFSET(o) ((o)>>8) #define MONO_THREADS_SYNC_MEMBER_SIZE(o) ((o)&0xff) +#if ENABLE_NETCORE ICALL_EXPORT -MonoBoolean -ves_icall_System_Threading_Monitor_Monitor_test_owner (MonoObject *obj); - -ICALL_EXPORT -MonoBoolean -ves_icall_System_Threading_Monitor_Monitor_test_synchronised (MonoObject *obj); - -ICALL_EXPORT -void -ves_icall_System_Threading_Monitor_Monitor_pulse (MonoObject *obj); - -ICALL_EXPORT -void -ves_icall_System_Threading_Monitor_Monitor_pulse_all (MonoObject *obj); - -ICALL_EXPORT -MonoBoolean -ves_icall_System_Threading_Monitor_Monitor_wait (MonoObject *obj, guint32 ms); - -ICALL_EXPORT -void -ves_icall_System_Threading_Monitor_Monitor_try_enter_with_atomic_var (MonoObject *obj, guint32 ms, MonoBoolean *lockTaken); - -ICALL_EXPORT -void -ves_icall_System_Threading_Monitor_Monitor_Enter (MonoObject *obj); +gint64 +ves_icall_System_Threading_Monitor_Monitor_LockContentionCount (void); +#endif #endif /* _MONO_METADATA_MONITOR_H_ */ diff --git a/mono/metadata/mono-basic-block.c b/mono/metadata/mono-basic-block.c index a19d445fe8..6dd0a679fe 100644 --- a/mono/metadata/mono-basic-block.c +++ b/mono/metadata/mono-basic-block.c @@ -543,11 +543,11 @@ mono_basic_block_split (MonoMethod *method, MonoError *error, MonoMethodHeader * root = bb; bb_formation_il_pass (start, end, bb, &root, method, error); - if (!mono_error_ok (error)) + if (!is_ok (error)) goto fail; bb_formation_eh_pass (header, bb, &root, method, error); - if (!mono_error_ok (error)) + if (!is_ok (error)) goto fail; bb_liveness (bb); diff --git a/mono/metadata/mono-conc-hash.c b/mono/metadata/mono-conc-hash.c index cd13110d31..f0bdcc4002 100644 --- a/mono/metadata/mono-conc-hash.c +++ b/mono/metadata/mono-conc-hash.c @@ -108,7 +108,7 @@ mix_hash (int hash) } -static inline void +static void set_key (conc_table *table, int slot, gpointer key) { gpointer *key_addr = &table->keys [slot]; @@ -118,7 +118,7 @@ set_key (conc_table *table, int slot, gpointer key) *key_addr = key; } -static inline void +static void set_key_to_tombstone (conc_table *table, int slot) { gpointer *key_addr = &table->keys [slot]; @@ -128,7 +128,7 @@ set_key_to_tombstone (conc_table *table, int slot) *key_addr = PTR_TOMBSTONE; } -static inline void +static void set_value (conc_table *table, int slot, gpointer value) { gpointer *value_addr = &table->values [slot]; diff --git a/mono/metadata/mono-config.c b/mono/metadata/mono-config.c index 287fa2afc0..aa9e554aea 100644 --- a/mono/metadata/mono-config.c +++ b/mono/metadata/mono-config.c @@ -637,13 +637,13 @@ mono_config_for_assembly_internal (MonoImage *assembly) } for (i = 0; (aname = get_assembly_filename (assembly, i)) != NULL; ++i) { - cfg = g_build_filename (cfg_dir, "mono", "assemblies", aname, cfg_name, NULL); + cfg = g_build_filename (cfg_dir, "mono", "assemblies", aname, cfg_name, (const char*)NULL); got_it += mono_config_parse_file_with_context (&state, cfg); g_free (cfg); #ifdef TARGET_WIN32 const char *home = g_get_home_dir (); - cfg = g_build_filename (home, ".mono", "assemblies", aname, cfg_name, NULL); + cfg = g_build_filename (home, ".mono", "assemblies", aname, cfg_name, (const char*)NULL); got_it += mono_config_parse_file_with_context (&state, cfg); g_free (cfg); #endif @@ -676,14 +676,14 @@ mono_config_parse (const char *filename) const char *cfg_dir = mono_get_config_dir (); if (cfg_dir) { - char *mono_cfg = g_build_filename (cfg_dir, "mono", "config", (const char *)NULL); + char *mono_cfg = g_build_filename (cfg_dir, "mono", "config", (const char*)NULL); mono_config_parse_file (mono_cfg); g_free (mono_cfg); } #if !defined(TARGET_WIN32) home = g_get_home_dir (); - char *user_cfg = g_strconcat (home, G_DIR_SEPARATOR_S, ".mono/config", (const char *)NULL); + char *user_cfg = g_strconcat (home, G_DIR_SEPARATOR_S, ".mono/config", (const char*)NULL); mono_config_parse_file (user_cfg); g_free (user_cfg); #endif diff --git a/mono/metadata/mono-debug.c b/mono/metadata/mono-debug.c index 295afda66b..da69c5ab33 100644 --- a/mono/metadata/mono-debug.c +++ b/mono/metadata/mono-debug.c @@ -66,11 +66,11 @@ static gboolean is_attached = FALSE; static MonoDebugHandle *mono_debug_open_image (MonoImage *image, const guint8 *raw_contents, int size); static MonoDebugHandle *mono_debug_get_image (MonoImage *image); -static void add_assembly (MonoAssembly *assembly, gpointer user_data); +static void add_assembly (MonoAssemblyLoadContext *alc, MonoAssembly *assembly, gpointer user_data, MonoError *error); static MonoDebugHandle *open_symfile_from_bundle (MonoImage *image); -static inline DebugDomainInfo* +static DebugDomainInfo* get_domain_info (MonoDomain *domain) { g_assert (domain->debug_info); @@ -114,7 +114,7 @@ mono_debug_init (MonoDebugFormat format) mono_debug_handles = g_hash_table_new_full (NULL, NULL, NULL, (GDestroyNotify) free_debug_handle); - mono_install_assembly_load_hook (add_assembly, NULL); + mono_install_assembly_load_hook_v2 (add_assembly, NULL); mono_debugger_unlock (); } @@ -245,7 +245,7 @@ mono_debug_open_image (MonoImage *image, const guint8 *raw_contents, int size) } static void -add_assembly (MonoAssembly *assembly, gpointer user_data) +add_assembly (MonoAssemblyLoadContext *alc, MonoAssembly *assembly, gpointer user_data, MonoError *error) { MonoDebugHandle *handle; MonoImage *image; @@ -351,7 +351,7 @@ mono_debug_image_has_debug_info (MonoImage *image) return data.found; } -static inline void +static void write_leb128 (guint32 value, guint8 *ptr, guint8 **rptr) { do { @@ -365,7 +365,7 @@ write_leb128 (guint32 value, guint8 *ptr, guint8 **rptr) *rptr = ptr; } -static inline void +static void write_sleb128 (gint32 value, guint8 *ptr, guint8 **rptr) { gboolean more = 1; @@ -526,7 +526,7 @@ mono_debug_add_delegate_trampoline (gpointer code, int size) { } -static inline guint32 +static guint32 read_leb128 (guint8 *ptr, guint8 **rptr) { guint32 result = 0, shift = 0; @@ -544,7 +544,7 @@ read_leb128 (guint8 *ptr, guint8 **rptr) return result; } -static inline gint32 +static gint32 read_sleb128 (guint8 *ptr, guint8 **rptr) { gint32 result = 0; diff --git a/mono/metadata/mono-endian.h b/mono/metadata/mono-endian.h index 8704dc5959..6fdd09cc7c 100644 --- a/mono/metadata/mono-endian.h +++ b/mono/metadata/mono-endian.h @@ -20,43 +20,9 @@ typedef union { #if defined(__s390x__) -#define read16(x) s390x_read16(*(guint16 *)(x)) -#define read32(x) s390x_read32(*(guint32 *)(x)) -#define read64(x) s390x_read64(*(guint64 *)(x)) - -static __inline__ guint16 -s390x_read16(guint16 x) -{ - guint16 ret; - - __asm__ (" lrvr %0,%1\n" - " sra %0,16\n" - : "=r" (ret) : "r" (x)); - - return(ret); -} - -static __inline__ guint32 -s390x_read32(guint32 x) -{ - guint32 ret; - - __asm__ (" lrvr %0,%1\n" - : "=r" (ret) : "r" (x)); - - return(ret); -} - -static __inline__ guint64 -s390x_read64(guint64 x) -{ - guint64 ret; - - __asm__ (" lrvgr %0,%1\n" - : "=r" (ret) : "r" (x)); - - return(ret); -} +#define read16(x) __builtin_bswap16(*((guint16 *)(x))) +#define read32(x) __builtin_bswap32(*((guint32 *)(x))) +#define read64(x) __builtin_bswap64(*((guint64 *)(x))) #else diff --git a/mono/metadata/mono-gc.h b/mono/metadata/mono-gc.h index 247e32eaab..86111ac345 100644 --- a/mono/metadata/mono-gc.h +++ b/mono/metadata/mono-gc.h @@ -96,6 +96,10 @@ typedef enum { * Roots in the ephemeron arrays. This is a pseudo-root. */ MONO_ROOT_SOURCE_EPHEMERON = 15, + /** + * Roots in the toggleref arrays. This is a pseudo-root. + */ + MONO_ROOT_SOURCE_TOGGLEREF = 16, } MonoGCRootSource; typedef enum { diff --git a/mono/metadata/mono-hash.c b/mono/metadata/mono-hash.c index 0323f012c4..8fa9d26dcf 100644 --- a/mono/metadata/mono-hash.c +++ b/mono/metadata/mono-hash.c @@ -91,7 +91,7 @@ calc_prime (int x) /* We triple the table size at rehash time, similar with previous implementation */ #define HASH_TABLE_RESIZE_RATIO 3 -static inline void mono_g_hash_table_key_store (MonoGHashTable *hash, int slot, MonoObject* key) +static void mono_g_hash_table_key_store (MonoGHashTable *hash, int slot, MonoObject* key) { MonoObject **key_addr = &hash->keys [slot]; if (hash->gc_type & MONO_HASH_KEY_GC) @@ -100,7 +100,7 @@ static inline void mono_g_hash_table_key_store (MonoGHashTable *hash, int slot, *key_addr = key; } -static inline void mono_g_hash_table_value_store (MonoGHashTable *hash, int slot, MonoObject* value) +static void mono_g_hash_table_value_store (MonoGHashTable *hash, int slot, MonoObject* value) { MonoObject **value_addr = &hash->values [slot]; if (hash->gc_type & MONO_HASH_VALUE_GC) @@ -110,7 +110,7 @@ static inline void mono_g_hash_table_value_store (MonoGHashTable *hash, int slot } /* Returns position of key or of an empty slot for it */ -static inline int mono_g_hash_table_find_slot (MonoGHashTable *hash, const MonoObject *key) +static int mono_g_hash_table_find_slot (MonoGHashTable *hash, const MonoObject *key) { guint start = ((*hash->hash_func) (key)) % hash->table_size; guint i = start; diff --git a/mono/metadata/mono-perfcounters.c b/mono/metadata/mono-perfcounters.c index 2970e083dc..569f2cbcb9 100644 --- a/mono/metadata/mono-perfcounters.c +++ b/mono/metadata/mono-perfcounters.c @@ -1946,6 +1946,8 @@ mono_perfcounter_foreach (PerfCounterEnumCallback cb, gpointer data) #else +#ifndef ENABLE_NETCORE + void* mono_perfcounter_get_impl (const gunichar2 *category, gint32 category_length, const gunichar2 *counter, gint32 counter_length, @@ -2025,4 +2027,12 @@ mono_perfcounter_instance_names (const gunichar2 *category, gint32 category_leng g_assert_not_reached (); } +#endif /* ENABLE_NETCORE */ + +void +mono_perfcounter_foreach (PerfCounterEnumCallback cb, gpointer data) +{ + g_assert_not_reached (); +} + #endif diff --git a/mono/metadata/mono-ptr-array.h b/mono/metadata/mono-ptr-array.h index 70694eff8f..b0c612258a 100644 --- a/mono/metadata/mono-ptr-array.h +++ b/mono/metadata/mono-ptr-array.h @@ -60,7 +60,7 @@ typedef struct { } while (0) #define mono_ptr_array_sort(ARRAY, COMPARE_FUNC) do { \ - qsort ((ARRAY).data, (ARRAY).size, sizeof (gpointer), (COMPARE_FUNC)); \ + mono_qsort ((ARRAY).data, (ARRAY).size, sizeof (gpointer), (COMPARE_FUNC)); \ } while (0) #define mono_ptr_array_set(ARRAY, IDX, VALUE) do { \ diff --git a/mono/metadata/mono-route.c b/mono/metadata/mono-route.c index defd245c59..e07991be24 100644 --- a/mono/metadata/mono-route.c +++ b/mono/metadata/mono-route.c @@ -7,12 +7,12 @@ * Ben Woods (woodsb02@gmail.com) */ -#include +#include "config.h" -#include -#include +#ifndef ENABLE_NETCORE +#if HOST_DARWIN || HOST_BSD -#if defined(HOST_DARWIN) || defined(HOST_BSD) +#include #include #include #include @@ -22,71 +22,87 @@ #include #include -extern MonoBoolean ves_icall_System_Net_NetworkInformation_MacOsIPInterfaceProperties_ParseRouteInfo_internal(MonoString *iface, MonoArray **gw_addr_list) +#if HOST_IOS || HOST_WATCHOS || HOST_TVOS +// The iOS SDK does not provide the net/route.h header but using the Darwin version works fine. +#include "../../support/ios/net/route.h" +#else +#include +#endif + +static in_addr_t +gateway_from_rtm (struct rt_msghdr *rtm); + +#include "object.h" +#include "icall-decl.h" + +MonoBoolean +ves_icall_System_Net_NetworkInformation_MacOsIPInterfaceProperties_ParseRouteInfo_internal (MonoStringHandle iface_handle, MonoArrayHandleOut gw_addr_list_handle, MonoError *error) { - ERROR_DECL (error); + MonoString *iface = MONO_HANDLE_RAW (iface_handle); + MONO_HANDLE_ASSIGN_RAW (gw_addr_list_handle, NULL); + size_t needed; in_addr_t in; - int mib[6]; - int num_gws=0, gwnum=0; + int mib [6]; + int num_gws = 0, gwnum = 0; unsigned int ifindex = 0; - char *buf, *next, *lim, *ifacename; + char *buf = NULL; + char *next, *lim; + char *ifacename = NULL; struct rt_msghdr *rtm; - + MonoArray *gw_addr_list = NULL; + MonoStringHandle addr_string_handle = NULL_HANDLE_INIT; // FIXME probably overkill MonoDomain *domain = mono_domain_get (); + MonoBoolean result = FALSE; ifacename = mono_string_to_utf8_checked_internal (iface, error); - if (mono_error_set_pending_exception (error)) - return FALSE; + goto_if_nok (error, fail); - if ((ifindex = if_nametoindex(ifacename)) == 0) - return FALSE; - g_free(ifacename); + if ((ifindex = if_nametoindex (ifacename)) == 0) + goto fail; // MIB array defining data to read from sysctl - mib[0] = CTL_NET; // Networking - mib[1] = PF_ROUTE; // Routing messages - mib[2] = 0; // Protocol number (always zero) - mib[3] = AF_INET; // Address family (IPv4) - mib[4] = NET_RT_DUMP; // Dump routing table - mib[5] = 0; // + mib [0] = CTL_NET; // Networking + mib [1] = PF_ROUTE; // Routing messages + mib [2] = 0; // Protocol number (always zero) + mib [3] = AF_INET; // Address family (IPv4) + mib [4] = NET_RT_DUMP; // Dump routing table + mib [5] = 0; // // First sysctl call with oldp set to NULL to determine size of available data if (sysctl(mib, G_N_ELEMENTS(mib), NULL, &needed, NULL, 0) < 0) - return FALSE; + goto fail; // Allocate suffcient memory for available data based on the previous sysctl call if ((buf = g_malloc (needed)) == NULL) - return FALSE; + goto fail; // Second sysctl call to retrieve data into appropriately sized buffer - if (sysctl(mib, G_N_ELEMENTS(mib), buf, &needed, NULL, 0) < 0) { - g_free (buf); - return FALSE; - } + if (sysctl (mib, G_N_ELEMENTS (mib), buf, &needed, NULL, 0) < 0) + goto fail; lim = buf + needed; for (next = buf; next < lim; next += rtm->rtm_msglen) { rtm = (struct rt_msghdr *)next; - if (rtm->rtm_version != RTM_VERSION) - continue; - if (rtm->rtm_index != ifindex) - continue; - if((in = gateway_from_rtm(rtm)) == 0) + if (rtm->rtm_version != RTM_VERSION + || rtm->rtm_index != ifindex + || (in = gateway_from_rtm (rtm)) == 0) continue; num_gws++; } - *gw_addr_list = mono_array_new_checked (domain, mono_get_string_class (), num_gws, error); + gw_addr_list = mono_array_new_checked (domain, mono_get_string_class (), num_gws, error); goto_if_nok (error, leave); + MONO_HANDLE_ASSIGN_RAW (gw_addr_list_handle, gw_addr_list); + + addr_string_handle = MONO_HANDLE_NEW (MonoString, NULL); // FIXME probably overkill + for (next = buf; next < lim; next += rtm->rtm_msglen) { rtm = (struct rt_msghdr *)next; - if (rtm->rtm_version != RTM_VERSION) - continue; - if (rtm->rtm_index != ifindex) - continue; - if ((in = gateway_from_rtm(rtm)) == 0) + if (rtm->rtm_version != RTM_VERSION + || rtm->rtm_index != ifindex + || (in = gateway_from_rtm (rtm)) == 0) continue; MonoString *addr_string; @@ -94,27 +110,32 @@ extern MonoBoolean ves_icall_System_Net_NetworkInformation_MacOsIPInterfacePrope int len; ptr = (char *) ∈ - len = snprintf(addr, sizeof(addr), "%u.%u.%u.%u", + len = snprintf(addr, sizeof (addr), "%u.%u.%u.%u", (unsigned char) ptr [0], (unsigned char) ptr [1], (unsigned char) ptr [2], (unsigned char) ptr [3]); - if ((len >= sizeof(addr)) || (len < 0)) + if (len >= sizeof (addr) || len < 0) // snprintf output truncated continue; addr_string = mono_string_new_checked (domain, addr, error); goto_if_nok (error, leave); - mono_array_setref_internal (*gw_addr_list, gwnum, addr_string); + MONO_HANDLE_ASSIGN_RAW (addr_string_handle, addr_string); // FIXME probably overkill + mono_array_setref_internal (gw_addr_list, gwnum, addr_string); gwnum++; } leave: + result = is_ok (error); +fail: + g_free (ifacename); g_free (buf); - return is_ok (error); + return result; } -in_addr_t gateway_from_rtm(struct rt_msghdr *rtm) +static in_addr_t +gateway_from_rtm(struct rt_msghdr *rtm) { struct sockaddr *gw; unsigned int l; @@ -133,13 +154,8 @@ in_addr_t gateway_from_rtm(struct rt_msghdr *rtm) return 0; } -#else +#endif +#endif -MonoBoolean -ves_icall_System_Net_NetworkInformation_MacOsIPInterfaceProperties_ParseRouteInfo_internal(MonoString *iface, MonoArray **gw_addr_list) -{ - g_assert_not_reached (); - return FALSE; -} - -#endif /* #if defined(HOST_DARWIN) || defined(HOST_BSD) */ +extern const char mono_route_empty_file_no_warning; +const char mono_route_empty_file_no_warning = 0; diff --git a/mono/metadata/mono-route.h b/mono/metadata/mono-route.h deleted file mode 100644 index 514b080ad4..0000000000 --- a/mono/metadata/mono-route.h +++ /dev/null @@ -1,32 +0,0 @@ -/** - * \file - */ - -#ifndef __MONO_ROUTE_H__ -#define __MONO_ROUTE_H__ - -#if defined(HOST_DARWIN) || defined(HOST_BSD) - -#include -#include -#include /* in_addr_t */ - -#if defined (HOST_IOS) || defined (HOST_WATCHOS) || defined (HOST_TVOS) -// The iOS SDK does not provide the net/route.h header but using the Darwin version works fine. -#include "../../support/ios/net/route.h" -#else -#include -#endif - -in_addr_t gateway_from_rtm (struct rt_msghdr *rtm); - -#endif /* #if defined(HOST_DARWIN) || defined(HOST_BSD) */ - -#include -#include - -/* Category icalls */ -ICALL_EXPORT -MonoBoolean ves_icall_System_Net_NetworkInformation_MacOsIPInterfaceProperties_ParseRouteInfo_internal (MonoString *iface, MonoArray **gw_addr_list); - -#endif /* __MONO_ROUTE_H__ */ diff --git a/mono/metadata/mono-security.c b/mono/metadata/mono-security.c index 9d187a0ad4..b3b8b3059c 100644 --- a/mono/metadata/mono-security.c +++ b/mono/metadata/mono-security.c @@ -22,6 +22,9 @@ #include #include "reflection-internals.h" #include "icall-decl.h" + +#ifndef ENABLE_NETCORE + #ifndef HOST_WIN32 #ifdef HAVE_GRP_H #include @@ -39,19 +42,23 @@ #if defined(__GNUC__) +#ifdef HAVE_GRP_H #ifndef HAVE_GETGRGID_R #warning Non-thread safe getgrgid being used! #endif #ifndef HAVE_GETGRNAM_R #warning Non-thread safe getgrnam being used! #endif +#endif + +#ifdef HAVE_PWD_H #ifndef HAVE_GETPWNAM_R #warning Non-thread safe getpwnam being used! #endif #ifndef HAVE_GETPWUID_R #warning Non-thread safe getpwuid being used! #endif - +#endif #endif /* defined(__GNUC__) */ #endif /* !HOST_WIN32 */ @@ -607,11 +614,12 @@ mono_invoke_protected_memory_method (MonoArrayHandle data, MonoObjectHandle scop { if (!*method) { MonoDomain *domain = mono_domain_get (); + MonoAssemblyLoadContext *alc = mono_domain_default_alc (domain); if (system_security_assembly == NULL) { - system_security_assembly = mono_image_loaded_internal (mono_domain_default_alc (domain), "System.Security", FALSE); + system_security_assembly = mono_image_loaded_internal (alc, "System.Security", FALSE); if (!system_security_assembly) { MonoAssemblyOpenRequest req; - mono_assembly_request_prepare (&req.request, sizeof (req), MONO_ASMCTX_DEFAULT); + mono_assembly_request_prepare_open (&req, MONO_ASMCTX_DEFAULT, alc); MonoAssembly *sa = mono_assembly_request_open ("System.Security.dll", &req, NULL); g_assert (sa); system_security_assembly = mono_assembly_get_image_internal (sa); @@ -640,3 +648,9 @@ ves_icall_System_Security_SecureString_EncryptInternal (MonoArrayHandle data, Mo { mono_invoke_protected_memory_method (data, scope, "Protect", &mono_method_securestring_encrypt, error); } + +#else + +MONO_EMPTY_SOURCE_FILE (mono_security); + +#endif /* ENABLE_NETCORE */ diff --git a/mono/metadata/null-gc-handles.c b/mono/metadata/null-gc-handles.c index ee4debad44..6ba1c0fe7f 100644 --- a/mono/metadata/null-gc-handles.c +++ b/mono/metadata/null-gc-handles.c @@ -82,17 +82,17 @@ mono_gc_weak_link_get (void **link_addr) return obj; } -static inline gboolean +static gboolean slot_occupied (HandleData *handles, guint slot) { return handles->bitmap [slot / BITMAP_SIZE] & (1 << (slot % BITMAP_SIZE)); } -static inline void +static void vacate_slot (HandleData *handles, guint slot) { handles->bitmap [slot / BITMAP_SIZE] &= ~(1 << (slot % BITMAP_SIZE)); } -static inline void +static void occupy_slot (HandleData *handles, guint slot) { handles->bitmap [slot / BITMAP_SIZE] |= 1 << (slot % BITMAP_SIZE); } diff --git a/mono/metadata/null-gc.c b/mono/metadata/null-gc.c index a18336b8c5..7ec29fdd82 100644 --- a/mono/metadata/null-gc.c +++ b/mono/metadata/null-gc.c @@ -265,13 +265,13 @@ mono_gc_wbarrier_set_arrayref_internal (MonoArray *arr, gpointer slot_ptr, MonoO } void -mono_gc_wbarrier_arrayref_copy_internal (gpointer dest_ptr, gpointer src_ptr, int count) +mono_gc_wbarrier_arrayref_copy_internal (gpointer dest_ptr, gconstpointer src_ptr, int count) { mono_gc_memmove_aligned (dest_ptr, src_ptr, count * sizeof (gpointer)); } void -mono_gc_wbarrier_generic_store_internal (gpointer ptr, MonoObject* value) +mono_gc_wbarrier_generic_store_internal (void volatile* ptr, MonoObject* value) { *(void**)ptr = value; } @@ -288,7 +288,7 @@ mono_gc_wbarrier_generic_nostore_internal (gpointer ptr) } void -mono_gc_wbarrier_value_copy_internal (gpointer dest, gpointer src, int count, MonoClass *klass) +mono_gc_wbarrier_value_copy_internal (gpointer dest, gconstpointer src, int count, MonoClass *klass) { mono_gc_memmove_atomic (dest, src, count * mono_class_value_size (klass, NULL)); } @@ -606,6 +606,11 @@ mono_gc_ephemeron_array_add (MonoObject *obj) return TRUE; } +guint64 mono_gc_get_total_allocated_bytes (MonoBoolean precise) +{ + return 0; +} + #else MONO_EMPTY_SOURCE_FILE (null_gc); diff --git a/mono/metadata/object-internals.h b/mono/metadata/object-internals.h index 2ea86cc943..ff5298a47e 100644 --- a/mono/metadata/object-internals.h +++ b/mono/metadata/object-internals.h @@ -555,6 +555,13 @@ typedef enum { struct _MonoThreadInfo; +typedef struct MonoThreadName { + char* volatile chars; // null check outside of lock + gsize volatile generation; // read outside of lock + gint32 free; + gint32 length; +} MonoThreadName; + void mono_gstring_append_thread_name (GString*, MonoInternalThread*); @@ -573,8 +580,7 @@ struct _MonoInternalThread { volatile int lock_thread_id; /* to be used as the pre-shifted thread id in thin locks. Used for appdomain_ref push/pop */ MonoThreadHandle *handle; gpointer native_handle; - gunichar2 *name; - guint32 name_len; + MonoThreadName name; guint32 state; /* must be accessed while longlived->synch_cs is locked */ MonoException *abort_exc; int abort_state_handle; @@ -858,10 +864,6 @@ MONO_COLD void mono_set_pending_exception (MonoException *exc); MonoAsyncResult * mono_async_result_new (MonoDomain *domain, gpointer handle, MonoObject *state, gpointer data, MonoObject *object_data, MonoError *error); -ICALL_EXPORT -MonoObject * -ves_icall_System_Runtime_Remoting_Messaging_AsyncResult_Invoke (MonoAsyncResult *ares); - MonoWaitHandle * mono_wait_handle_new (MonoDomain *domain, gpointer handle, MonoError *error); @@ -872,10 +874,6 @@ gboolean mono_message_init (MonoDomain *domain, MonoMethodMessage *this_obj, MonoReflectionMethod *method, MonoArray *out_args, MonoError *error); -MonoObject * -mono_message_invoke (MonoObject *target, MonoMethodMessage *msg, - MonoObject **exc, MonoArray **out_args, MonoError *error); - MonoMethodMessage * mono_method_call_message_new (MonoMethod *method, gpointer *params, MonoMethod *invoke, MonoDelegate **cb, MonoObject **state, MonoError *error); @@ -1631,6 +1629,11 @@ typedef struct { MonoBoolean visible; } MonoReflectionComVisibleAttribute; +typedef struct { + MonoObject object; + MonoReflectionType *type; +} MonoReflectionComDefaultInterfaceAttribute; + enum { RESOURCE_LOCATION_EMBEDDED = 1, RESOURCE_LOCATION_ANOTHER_ASSEMBLY = 2, @@ -1705,7 +1708,6 @@ ves_icall_SymbolType_create_unmanaged_type (MonoReflectionType *type); void mono_reflection_register_with_runtime (MonoReflectionType *type); -void mono_reflection_create_custom_attr_data_args (MonoImage *image, MonoMethod *method, const guchar *data, guint32 len, MonoArray **typed_args_out, MonoArray **named_args_out, CattrNamedArg **named_arg_info, MonoError *error); MonoMethodSignature * mono_reflection_lookup_signature (MonoImage *image, MonoMethod *method, guint32 token, MonoError *error); MonoArrayHandle mono_param_get_objects_internal (MonoDomain *domain, MonoMethod *method, MonoClass *refclass, MonoError *error); @@ -1730,15 +1732,11 @@ mono_reflection_lookup_dynamic_token (MonoImage *image, guint32 token, gboolean gboolean mono_reflection_call_is_assignable_to (MonoClass *klass, MonoClass *oklass, MonoError *error); -ICALL_EXPORT -void -ves_icall_System_Reflection_CustomAttributeData_ResolveArgumentsInternal (MonoReflectionMethod *method, MonoReflectionAssembly *assembly, gpointer data, guint32 data_length, MonoArray **ctor_args, MonoArray ** named_args); - gboolean mono_image_build_metadata (MonoReflectionModuleBuilder *module, MonoError *error); -int -mono_get_constant_value_from_blob (MonoDomain* domain, MonoTypeEnum type, const char *blob, void *value, MonoError *error); +gboolean +mono_get_constant_value_from_blob (MonoDomain* domain, MonoTypeEnum type, const char *blob, void *value, MonoStringHandleOut string_handle, MonoError *error); gboolean mono_metadata_read_constant_value (const char *blob, MonoTypeEnum type, void *value, MonoError *error); @@ -1958,8 +1956,8 @@ mono_object_xdomain_representation (MonoObjectHandle obj, MonoDomain *target_dom gboolean mono_class_is_reflection_method_or_constructor (MonoClass *klass); -MonoObject * -mono_get_object_from_blob (MonoDomain *domain, MonoType *type, const char *blob, MonoError *error); +MonoObjectHandle +mono_get_object_from_blob (MonoDomain *domain, MonoType *type, const char *blob, MonoStringHandleOut string_handle, MonoError *error); gboolean mono_class_has_ref_info (MonoClass *klass); @@ -1997,10 +1995,10 @@ void mono_field_get_value_internal (MonoObject *obj, MonoClassField *field, void *value); void -mono_field_static_get_value_checked (MonoVTable *vt, MonoClassField *field, void *value, MonoError *error); +mono_field_static_get_value_checked (MonoVTable *vt, MonoClassField *field, void *value, MonoStringHandleOut string_handle, MonoError *error); void -mono_field_static_get_value_for_thread (MonoInternalThread *thread, MonoVTable *vt, MonoClassField *field, void *value, MonoError *error); +mono_field_static_get_value_for_thread (MonoInternalThread *thread, MonoVTable *vt, MonoClassField *field, void *value, MonoStringHandleOut string_handle, MonoError *error); MonoMethod* mono_object_handle_get_virtual_method (MonoObjectHandle obj, MonoMethod *method, MonoError *error); @@ -2211,20 +2209,8 @@ mono_runtime_exec_main_checked (MonoMethod *method, MonoArray *args, MonoError * int mono_runtime_try_exec_main (MonoMethod *method, MonoArray *args, MonoObject **exc); -ICALL_EXPORT -void -ves_icall_ModuleBuilder_WriteToFile (MonoReflectionModuleBuilder *mb, gpointer file); - -ICALL_EXPORT -void -ves_icall_ModuleBuilder_build_metadata (MonoReflectionModuleBuilder *mb); - -ICALL_EXPORT -MonoArray* -ves_icall_CustomAttributeBuilder_GetBlob (MonoReflectionAssembly *assembly, MonoObject *ctor, MonoArray *ctorArgs, MonoArray *properties, MonoArray *propValues, MonoArray *fields, MonoArray* fieldValues); - MonoAssembly* -mono_try_assembly_resolve_handle (MonoDomain *domain, MonoStringHandle fname, MonoAssembly *requesting, gboolean refonly, MonoError *error); +mono_try_assembly_resolve_handle (MonoAssemblyLoadContext *alc, MonoStringHandle fname, MonoAssembly *requesting, gboolean refonly, MonoError *error); gboolean mono_runtime_object_init_handle (MonoObjectHandle this_obj, MonoError *error); @@ -2239,8 +2225,16 @@ mono_class_get_virtual_method (MonoClass *klass, MonoMethod *method, gboolean is MonoStringHandle mono_string_empty_handle (MonoDomain *domain); -gpointer -mono_object_get_data (MonoObject *o); +/* + * mono_object_get_data: + * + * Return a pointer to the beginning of data inside a MonoObject. + */ +static inline gpointer +mono_object_get_data (MonoObject *o) +{ + return (guint8*)o + MONO_ABI_SIZEOF (MonoObject); +} #define mono_handle_get_data_unsafe(handle) ((gpointer)((guint8*)MONO_HANDLE_RAW (handle) + MONO_ABI_SIZEOF (MonoObject))) @@ -2257,11 +2251,19 @@ mono_vtype_get_field_addr (gpointer vtype, MonoClassField *field); mono_gc_wbarrier_generic_store_internal (&((s)->field), (MonoObject*)(value)); \ } while (0) -mono_unichar2* -mono_string_chars_internal (MonoString *s); +static inline gunichar2* +mono_string_chars_internal (MonoString *s) +{ + MONO_REQ_GC_UNSAFE_MODE; + return s->chars; +} -int -mono_string_length_internal (MonoString *s); +static inline int +mono_string_length_internal (MonoString *s) +{ + MONO_REQ_GC_UNSAFE_MODE; + return s->length; +} MonoString* mono_string_empty_internal (MonoDomain *domain); @@ -2278,12 +2280,11 @@ mono_string_equal_internal (MonoString *s1, MonoString *s2); unsigned mono_string_hash_internal (MonoString *s); -ICALL_EXPORT int mono_object_hash_internal (MonoObject* obj); void -mono_value_copy_internal (void* dest, /*const*/ void* src, MonoClass *klass); +mono_value_copy_internal (void* dest, const void* src, MonoClass *klass); void mono_value_copy_array_internal (MonoArray *dest, int dest_idx, const void* src, int count); @@ -2293,8 +2294,13 @@ MONO_PROFILER_API MonoVTable* mono_object_get_vtable_internal (MonoObject *obj); MonoDomain* mono_object_get_domain_internal (MonoObject *obj); -void* -mono_object_unbox_internal (MonoObject *obj); +static inline gpointer +mono_object_unbox_internal (MonoObject *obj) +{ + /* add assert for valuetypes? */ + g_assert (m_class_is_valuetype (mono_object_class (obj))); + return mono_object_get_data (obj); +} ICALL_EXPORT void @@ -2394,10 +2400,10 @@ void mono_gc_wbarrier_set_arrayref_internal (MonoArray *arr, void* slot_ptr, MonoObject* value); void -mono_gc_wbarrier_arrayref_copy_internal (void* dest_ptr, void* src_ptr, int count); +mono_gc_wbarrier_arrayref_copy_internal (void* dest_ptr, const void* src_ptr, int count); void -mono_gc_wbarrier_generic_store_internal (void* ptr, MonoObject* value); +mono_gc_wbarrier_generic_store_internal (void volatile* ptr, MonoObject* value); void mono_gc_wbarrier_generic_store_atomic_internal (void *ptr, MonoObject *value); @@ -2406,7 +2412,7 @@ void mono_gc_wbarrier_generic_nostore_internal (void* ptr); void -mono_gc_wbarrier_value_copy_internal (void* dest, /*const*/ void* src, int count, MonoClass *klass); +mono_gc_wbarrier_value_copy_internal (void* dest, const void* src, int count, MonoClass *klass); void mono_gc_wbarrier_object_copy_internal (MonoObject* obj, MonoObject *src); diff --git a/mono/metadata/object-offsets.h b/mono/metadata/object-offsets.h index b1546d4869..185028b9de 100644 --- a/mono/metadata/object-offsets.h +++ b/mono/metadata/object-offsets.h @@ -136,7 +136,7 @@ DECL_OFFSET(MonoProfilerCallContext, method) DECL_OFFSET(MonoProfilerCallContext, return_value) DECL_OFFSET(MonoProfilerCallContext, args) -DECL_OFFSET(MonoError, init) +DECL_OFFSET(MonoErrorExternal, init) #ifdef HAVE_SGEN_GC DECL_OFFSET(SgenClientThreadInfo, in_critical_region) @@ -247,8 +247,6 @@ DECL_OFFSET (MonoContext, fregs) DECL_OFFSET(MonoLMF, lmf_addr) -DECL_OFFSET(SeqPointInfo, ss_trigger_page) - DECL_OFFSET(DynCallArgs, res) DECL_OFFSET(DynCallArgs, res2) #endif @@ -260,6 +258,8 @@ DECL_OFFSET(GSharedVtCallInfo, vret_arg_reg) DECL_OFFSET(GSharedVtCallInfo, ret_marshal) DECL_OFFSET(GSharedVtCallInfo, vret_slot) DECL_OFFSET(GSharedVtCallInfo, gsharedvt_in) + +DECL_OFFSET(SeqPointInfo, ss_trigger_page) #endif #if defined(TARGET_ARM64) @@ -277,9 +277,7 @@ DECL_OFFSET(SeqPointInfo, ss_tramp_addr) #if defined(TARGET_AMD64) || defined(TARGET_ARM) || defined(TARGET_ARM64) DECL_OFFSET(SeqPointInfo, bp_addrs) -#endif -#if defined(TARGET_AMD64) || defined(TARGET_ARM) || defined(TARGET_ARM64) DECL_OFFSET(CallContext, gregs) DECL_OFFSET(CallContext, fregs) DECL_OFFSET(CallContext, stack_size) diff --git a/mono/metadata/object.c.REMOVED.git-id b/mono/metadata/object.c.REMOVED.git-id index a542b474c6..3bc2268896 100644 --- a/mono/metadata/object.c.REMOVED.git-id +++ b/mono/metadata/object.c.REMOVED.git-id @@ -1 +1 @@ -f959d679ac1bb8c2578572567958e49b046f35d3 \ No newline at end of file +4b67e8843a2a4a3fa8f21da4e79ced8a330f6dbb \ No newline at end of file diff --git a/mono/metadata/object.h b/mono/metadata/object.h index 88f07e4897..9428405b4b 100644 --- a/mono/metadata/object.h +++ b/mono/metadata/object.h @@ -387,7 +387,7 @@ MONO_API MONO_RT_EXTERNAL_ONLY mono_bool mono_gc_reference_queue_add (MonoRefere /* GC write barriers support */ MONO_API MONO_RT_EXTERNAL_ONLY void mono_gc_wbarrier_set_field (MonoObject *obj, void* field_ptr, MonoObject* value); MONO_API MONO_RT_EXTERNAL_ONLY void mono_gc_wbarrier_set_arrayref (MonoArray *arr, void* slot_ptr, MonoObject* value); -MONO_API MONO_RT_EXTERNAL_ONLY void mono_gc_wbarrier_arrayref_copy (void* dest_ptr, void* src_ptr, int count); +MONO_API MONO_RT_EXTERNAL_ONLY void mono_gc_wbarrier_arrayref_copy (void* dest_ptr, /*const*/ void* src_ptr, int count); MONO_API MONO_RT_EXTERNAL_ONLY void mono_gc_wbarrier_generic_store (void* ptr, MonoObject* value); MONO_API MONO_RT_EXTERNAL_ONLY void mono_gc_wbarrier_generic_store_atomic (void *ptr, MonoObject *value); MONO_API MONO_RT_EXTERNAL_ONLY void mono_gc_wbarrier_generic_nostore (void* ptr); diff --git a/mono/metadata/profiler-private.h b/mono/metadata/profiler-private.h index 389a98f9fb..ca06b7279d 100644 --- a/mono/metadata/profiler-private.h +++ b/mono/metadata/profiler-private.h @@ -97,12 +97,14 @@ typedef struct { extern MonoProfilerState mono_profiler_state; +typedef struct { + guchar *cil_code; + guint32 count; +} MonoProfilerCoverageInfoEntry; + typedef struct { guint32 entries; - struct { - guchar *cil_code; - guint32 count; - } data [1]; + MonoProfilerCoverageInfoEntry data [MONO_ZERO_LEN_ARRAY]; } MonoProfilerCoverageInfo; void mono_profiler_started (void); diff --git a/mono/metadata/profiler.c b/mono/metadata/profiler.c index 7b6b971f1c..1435981ea7 100644 --- a/mono/metadata/profiler.c +++ b/mono/metadata/profiler.c @@ -435,7 +435,7 @@ mono_profiler_coverage_alloc (MonoMethod *method, guint32 entries) coverage_lock (); - MonoProfilerCoverageInfo *info = g_malloc0 (sizeof (MonoProfilerCoverageInfo) + SIZEOF_VOID_P * 2 * entries); + MonoProfilerCoverageInfo *info = g_malloc0 (sizeof (MonoProfilerCoverageInfo) + sizeof (MonoProfilerCoverageInfoEntry) * entries); info->entries = entries; diff --git a/mono/metadata/rand.c b/mono/metadata/rand.c index a041a99c8a..8ce627ea4d 100644 --- a/mono/metadata/rand.c +++ b/mono/metadata/rand.c @@ -21,6 +21,8 @@ #include "utils/mono-rand.h" #include "icall-decl.h" +#ifndef ENABLE_NETCORE + MonoBoolean ves_icall_System_Security_Cryptography_RNGCryptoServiceProvider_RngOpen (MonoError *error) { @@ -46,3 +48,9 @@ ves_icall_System_Security_Cryptography_RNGCryptoServiceProvider_RngClose (gpoint { mono_rand_close (handle); } + +#else + +MONO_EMPTY_SOURCE_FILE (rand); + +#endif /* ENABLE_NETCORE */ diff --git a/mono/metadata/reflection-internals.h b/mono/metadata/reflection-internals.h index da4e51c6e3..0f1c96a9a5 100644 --- a/mono/metadata/reflection-internals.h +++ b/mono/metadata/reflection-internals.h @@ -61,7 +61,7 @@ mono_reflection_get_custom_attrs_data_checked (MonoObjectHandle obj, MonoError * MonoArrayHandle mono_reflection_get_custom_attrs_by_type_handle (MonoObjectHandle obj, MonoClass *attr_klass, MonoError *error); -MonoArray* +MonoArrayHandle mono_reflection_get_custom_attrs_blob_checked (MonoReflectionAssembly *assembly, MonoObject *ctor, MonoArray *ctorArgs, MonoArray *properties, MonoArray *propValues, MonoArray *fields, MonoArray* fieldValues, MonoError *error); MonoCustomAttrInfo* diff --git a/mono/metadata/reflection.c.REMOVED.git-id b/mono/metadata/reflection.c.REMOVED.git-id index c885b06251..813b48bbbf 100644 --- a/mono/metadata/reflection.c.REMOVED.git-id +++ b/mono/metadata/reflection.c.REMOVED.git-id @@ -1 +1 @@ -1b3955a79ba087e84840cf017c3e78a0ccccc9fc \ No newline at end of file +77efb3c8491c9f71695144a8bd26975632817644 \ No newline at end of file diff --git a/mono/metadata/remoting.c b/mono/metadata/remoting.c index 292709f71f..4574ae0f74 100644 --- a/mono/metadata/remoting.c +++ b/mono/metadata/remoting.c @@ -116,14 +116,14 @@ mono_compile_method_icall (MonoMethod *method); #define register_icall(func, sig, save) \ (mono_register_jit_icall_info (&mono_get_jit_icall_info ()->func, func, #func, (sig), (save), NULL)) -static inline void +static void remoting_lock (void) { g_assert (remoting_mutex_inited); mono_os_mutex_lock (&remoting_mutex); } -static inline void +static void remoting_unlock (void) { g_assert (remoting_mutex_inited); @@ -306,7 +306,7 @@ mono_mb_emit_contextbound_check (MonoMethodBuilder *mb, int branch_code) } #endif /* !DISABLE_JIT */ -static inline MonoMethod* +static MonoMethod* mono_marshal_remoting_find_in_cache (MonoMethod *method, int wrapper_type) { MonoMethod *res = NULL; @@ -334,7 +334,7 @@ mono_marshal_remoting_find_in_cache (MonoMethod *method, int wrapper_type) } /* Create the method from the builder and place it in the cache */ -static inline MonoMethod* +static MonoMethod* mono_remoting_mb_create_and_cache (MonoMethod *key, MonoMethodBuilder *mb, MonoMethodSignature *sig, int max_stack, WrapperInfo *info) { diff --git a/mono/metadata/runtime.c b/mono/metadata/runtime.c index d779517492..36164b8006 100644 --- a/mono/metadata/runtime.c +++ b/mono/metadata/runtime.c @@ -121,7 +121,7 @@ mono_runtime_try_shutdown (void) /*TODO move the follow to here: mono_thread_suspend_all_other_threads (); OR mono_thread_wait_all_other_threads - mono_runtime_quit (); + mono_runtime_quit_internal (); */ return TRUE; diff --git a/mono/metadata/security-core-clr.c b/mono/metadata/security-core-clr.c index 3993880688..582a3fcb3e 100644 --- a/mono/metadata/security-core-clr.c +++ b/mono/metadata/security-core-clr.c @@ -523,7 +523,7 @@ check_field_access (MonoMethod *caller, MonoClassField *field) /* this check can occur before the field's type is resolved (and that can fail) */ mono_field_get_type_checked (field, error); - if (!mono_error_ok (error)) { + if (!is_ok (error)) { mono_error_cleanup (error); return FALSE; } diff --git a/mono/metadata/sgen-bridge.c b/mono/metadata/sgen-bridge.c index 271e360915..558a073efb 100644 --- a/mono/metadata/sgen-bridge.c +++ b/mono/metadata/sgen-bridge.c @@ -431,8 +431,8 @@ sgen_compare_bridge_processor_results (SgenBridgeProcessor *a, SgenBridgeProcess b_xrefs [i].dst_scc_index = *scc_index_ptr; } - qsort (a_xrefs, a->num_xrefs, sizeof (MonoGCBridgeXRef), compare_xrefs); - qsort (b_xrefs, a->num_xrefs, sizeof (MonoGCBridgeXRef), compare_xrefs); + mono_qsort (a_xrefs, a->num_xrefs, sizeof (MonoGCBridgeXRef), compare_xrefs); + mono_qsort (b_xrefs, a->num_xrefs, sizeof (MonoGCBridgeXRef), compare_xrefs); for (i = 0; i < a->num_xrefs; ++i) { g_assert (a_xrefs [i].src_scc_index == b_xrefs [i].src_scc_index); diff --git a/mono/metadata/sgen-mono-ilgen.c b/mono/metadata/sgen-mono-ilgen.c index c2cb055c6e..0d2a7d453a 100644 --- a/mono/metadata/sgen-mono-ilgen.c +++ b/mono/metadata/sgen-mono-ilgen.c @@ -173,7 +173,7 @@ emit_nursery_check_ilgen (MonoMethodBuilder *mb, gboolean is_concurrent) } static void -emit_managed_allocater_ilgen (MonoMethodBuilder *mb, gboolean slowpath, gboolean profiler, int atype) +emit_managed_allocator_ilgen (MonoMethodBuilder *mb, gboolean slowpath, gboolean profiler, int atype) { #ifdef MANAGED_ALLOCATION int p_var, size_var, real_size_var, thread_var G_GNUC_UNUSED; @@ -550,7 +550,7 @@ mono_sgen_mono_ilgen_init (void) MonoSgenMonoCallbacks cb; cb.version = MONO_SGEN_MONO_CALLBACKS_VERSION; cb.emit_nursery_check = emit_nursery_check_ilgen; - cb.emit_managed_allocater = emit_managed_allocater_ilgen; + cb.emit_managed_allocator = emit_managed_allocator_ilgen; mono_install_sgen_mono_callbacks (&cb); } #endif diff --git a/mono/metadata/sgen-mono.c b/mono/metadata/sgen-mono.c index 61d019dfcb..c0d2788912 100644 --- a/mono/metadata/sgen-mono.c +++ b/mono/metadata/sgen-mono.c @@ -100,7 +100,7 @@ scan_object_for_binary_protocol_copy_wbarrier (gpointer dest, char *start, mword #endif void -mono_gc_wbarrier_value_copy_internal (gpointer dest, gpointer src, int count, MonoClass *klass) +mono_gc_wbarrier_value_copy_internal (gpointer dest, gconstpointer src, int count, MonoClass *klass) { HEAVY_STAT (++stat_wbarrier_value_copy); g_assert (m_class_is_valuetype (klass)); @@ -121,7 +121,7 @@ mono_gc_wbarrier_value_copy_internal (gpointer dest, gpointer src, int count, Mo for (i = 0; i < count; ++i) { scan_object_for_binary_protocol_copy_wbarrier ((char*)dest + i * element_size, (char*)src + i * element_size - MONO_ABI_SIZEOF (MonoObject), - (mword) klass->gc_descr); + (mword) m_class_get_gc_descr (klass)); } } #endif @@ -254,7 +254,7 @@ emit_nursery_check_noilgen (MonoMethodBuilder *mb, gboolean is_concurrent) } static void -emit_managed_allocater_noilgen (MonoMethodBuilder *mb, gboolean slowpath, gboolean profiler, int atype) +emit_managed_allocator_noilgen (MonoMethodBuilder *mb, gboolean slowpath, gboolean profiler, int atype) { } @@ -264,7 +264,7 @@ install_noilgen (void) MonoSgenMonoCallbacks cb; cb.version = MONO_SGEN_MONO_CALLBACKS_VERSION; cb.emit_nursery_check = emit_nursery_check_noilgen; - cb.emit_managed_allocater = emit_managed_allocater_noilgen; + cb.emit_managed_allocator = emit_managed_allocator_noilgen; mono_install_sgen_mono_callbacks (&cb); } @@ -1042,7 +1042,7 @@ create_allocator (int atype, ManagedAllocatorVariant variant) mb = mono_mb_new (mono_defaults.object_class, name, MONO_WRAPPER_ALLOC); - get_sgen_mono_cb ()->emit_managed_allocater (mb, slowpath, profiler, atype); + get_sgen_mono_cb ()->emit_managed_allocator (mb, slowpath, profiler, atype); info = mono_wrapper_info_create (mb, WRAPPER_SUBTYPE_NONE); info->d.alloc.gc_name = "sgen"; @@ -1456,6 +1456,7 @@ mono_gc_set_string_length (MonoString *str, gint32 new_length) #define SPECIAL_ADDRESS_FIN_QUEUE ((mono_byte*)1) #define SPECIAL_ADDRESS_CRIT_FIN_QUEUE ((mono_byte*)2) #define SPECIAL_ADDRESS_EPHEMERON ((mono_byte*)3) +#define SPECIAL_ADDRESS_TOGGLEREF ((mono_byte*)4) typedef struct { int count; /* must be the first field */ @@ -1643,6 +1644,116 @@ report_handle_stack_roots (GCRootReport *report, SgenThreadInfo *info, gboolean mono_handle_stack_scan (info->client_info.info.handle_stack, report_handle_stack_root, &ud, ud.precise, FALSE); } +static void* +get_aligned_stack_start (SgenThreadInfo *info) +{ + void* aligned_stack_start = (void*)(mword) ALIGN_TO ((mword)info->client_info.stack_start, SIZEOF_VOID_P); +#if _WIN32 +// Due to the guard page mechanism providing gradual commit of Windows stacks, +// stack pages must be touched in order. +// +// This mechanism is only transparent (kernel handles page faults and user never sees them), +// for the thread touching its own stack. Not for cross-thread stack references as are being +// done here. +// +// Here is a small program that demonstrates the behavior: +// +// #include +// #include +// +// #pragma optimize ("x", on) +// +// int volatile * volatile Event1; +// int volatile Event2; +// HANDLE ThreadHandle; +// +// DWORD __stdcall thread (void* x) +// { +// while (!Event1) +// _mm_pause (); +// +// __try { +// *Event1 = 0x123; +// } __except (GetExceptionCode () == STATUS_GUARD_PAGE_VIOLATION) { +// printf ("oops\n"); +// } +// Event2 = 1; +// return 0; +// } +// +// int unlucky; +// int print = 1; +// +// __declspec (noinline) +// __declspec (safebuffers) +// void f (void) +// { +// int local [5]; +// +// while (unlucky && ((size_t)_AddressOfReturnAddress () - 8) & 0xFFF) +// f (); +// +// unlucky = 0; +// Event1 = local; +// +// while (!Event2) +// _mm_pause (); +// +// if (print) { +// printf ("%X\n", local [0]); +// print = 0; +// } +// +// if (ThreadHandle) { +// WaitForSingleObject (ThreadHandle, INFINITE); +// ThreadHandle = NULL; +// } +// } +// +// int main (int argc, char** argv) +// { +// unlucky = argc > 1; +// ThreadHandle = CreateThread (0, 0, thread, 0, 0, 0); +// f (); +// } +// +// This would seem to be a problem otherwise, not just for garbage collectors. +// +// We therefore have a few choices: +// +// 1. Historical slow code: VirtualQuery and check for guard page. Slow. +// +// MEMORY_BASIC_INFORMATION mem_info; +// SIZE_T result = VirtualQuery (info->client_info.stack_start, &mem_info, sizeof(mem_info)); +// g_assert (result != 0); +// if (mem_info.Protect & PAGE_GUARD) { +// aligned_stack_start = ((char*) mem_info.BaseAddress) + mem_info.RegionSize; +// } +// +// VirtualQuery not historically allowed in UWP, but it is now. +// +// 2. Touch page under __try / __except and handle STATUS_GUARD_PAGE_VIOLATION. +// Good but compiler specific. +// +// __try { +// *(volatile char*)aligned_stack_start; +// } __except (GetExceptionCode () == STATUS_GUARD_PAGE_VIOLATION) { +// MEMORY_BASIC_INFORMATION mem_info; +// const SIZE_T result = VirtualQuery(aligned_stack_start, &mem_info, sizeof(mem_info)); +// g_assert (result >= sizeof (mem_info)); +// VirtualProtect (aligned_stack_start, 1, mem_info.Protect | PAGE_GUARD, &mem_info.Protect); +// } +// +// 3. Vectored exception handler. Not terrible. Not compiler specific. +// +// 4. Check against the high watermark in the TIB. That is done. +// TIB is the public prefix TEB. It is Windows.h, ntddk.h, etc. +// + aligned_stack_start = MAX (aligned_stack_start, info->client_info.info.windows_tib->StackLimit); +#endif + return aligned_stack_start; +} + static void report_stack_roots (void) { @@ -1661,23 +1772,7 @@ report_stack_roots (void) g_assert (info->client_info.stack_start); g_assert (info->client_info.info.stack_end); - aligned_stack_start = (void*)(mword) ALIGN_TO ((mword)info->client_info.stack_start, SIZEOF_VOID_P); -#ifdef HOST_WIN32 - /* Windows uses a guard page before the committed stack memory pages to detect when the - stack needs to be grown. If we suspend a thread just after a function prolog has - decremented the stack pointer to point into the guard page but before the thread has - been able to read or write to that page, starting the stack scan at aligned_stack_start - will raise a STATUS_GUARD_PAGE_VIOLATION and the process will crash. This code uses - VirtualQuery() to determine whether stack_start points into the guard page and then - updates aligned_stack_start to point at the next non-guard page. */ - MEMORY_BASIC_INFORMATION mem_info; - SIZE_T result = VirtualQuery (info->client_info.stack_start, &mem_info, sizeof(mem_info)); - g_assert (result != 0); - if (mem_info.Protect & PAGE_GUARD) { - aligned_stack_start = ((char*) mem_info.BaseAddress) + mem_info.RegionSize; - } -#endif - + aligned_stack_start = get_aligned_stack_start (info); g_assert (info->client_info.suspend_done); report_conservative_roots (&report, aligned_stack_start, (void **)aligned_stack_start, (void **)info->client_info.info.stack_end); @@ -1784,6 +1879,20 @@ report_ephemeron_roots (void) notify_gc_roots (&report); } +static void +report_toggleref_root (MonoObject* obj, gpointer data) +{ + report_gc_root ((GCRootReport*)data, SPECIAL_ADDRESS_TOGGLEREF, obj); +} + +static void +report_toggleref_roots (void) +{ + GCRootReport report = { 0 }; + sgen_foreach_toggleref_root (report_toggleref_root, &report); + notify_gc_roots (&report); +} + static void sgen_report_all_roots (SgenPointerQueue *fin_ready_queue, SgenPointerQueue *critical_fin_queue) { @@ -1792,6 +1901,7 @@ sgen_report_all_roots (SgenPointerQueue *fin_ready_queue, SgenPointerQueue *crit report_registered_roots (); report_ephemeron_roots (); + report_toggleref_roots (); report_pin_queue (); report_finalizer_roots_from_queue (fin_ready_queue, SPECIAL_ADDRESS_FIN_QUEUE); report_finalizer_roots_from_queue (critical_fin_queue, SPECIAL_ADDRESS_CRIT_FIN_QUEUE); @@ -2055,6 +2165,8 @@ sgen_client_thread_detach_with_lock (SgenThreadInfo *p) mono_tls_set_sgen_thread_info (NULL); + sgen_increment_bytes_allocated_detached (p->total_bytes_allocated); + tid = mono_thread_info_get_tid (p); mono_threads_add_joinable_runtime_thread (&p->client_info.info); @@ -2176,6 +2288,11 @@ sgen_client_scan_thread_data (void *start_nursery, void *end_nursery, gboolean p return; #endif + SGEN_TV_DECLARE (scan_thread_data_start); + SGEN_TV_DECLARE (scan_thread_data_end); + + SGEN_TV_GETTIME (scan_thread_data_start); + FOREACH_THREAD_EXCLUDE (info, MONO_THREAD_INFO_FLAGS_NO_GC) { int skip_reason = 0; void *aligned_stack_start; @@ -2208,23 +2325,7 @@ sgen_client_scan_thread_data (void *start_nursery, void *end_nursery, gboolean p g_assert (info->client_info.stack_start); g_assert (info->client_info.info.stack_end); - aligned_stack_start = (void*)(mword) ALIGN_TO ((mword)info->client_info.stack_start, SIZEOF_VOID_P); -#ifdef HOST_WIN32 - /* Windows uses a guard page before the committed stack memory pages to detect when the - stack needs to be grown. If we suspend a thread just after a function prolog has - decremented the stack pointer to point into the guard page but before the thread has - been able to read or write to that page, starting the stack scan at aligned_stack_start - will raise a STATUS_GUARD_PAGE_VIOLATION and the process will crash. This code uses - VirtualQuery() to determine whether stack_start points into the guard page and then - updates aligned_stack_start to point at the next non-guard page. */ - MEMORY_BASIC_INFORMATION mem_info; - SIZE_T result = VirtualQuery(info->client_info.stack_start, &mem_info, sizeof(mem_info)); - g_assert (result != 0); - if (mem_info.Protect & PAGE_GUARD) { - aligned_stack_start = ((char*) mem_info.BaseAddress) + mem_info.RegionSize; - } -#endif - + aligned_stack_start = get_aligned_stack_start (info); g_assert (info->client_info.suspend_done); SGEN_LOG (3, "Scanning thread %p, range: %p-%p, size: %zd, pinned=%zd", info, info->client_info.stack_start, info->client_info.info.stack_end, (char*)info->client_info.info.stack_end - (char*)info->client_info.stack_start, sgen_get_pinned_count ()); if (mono_gc_get_gc_callbacks ()->thread_mark_func && !conservative_stack_mark) { @@ -2271,6 +2372,9 @@ sgen_client_scan_thread_data (void *start_nursery, void *end_nursery, gboolean p } } } FOREACH_THREAD_END + + SGEN_TV_GETTIME (scan_thread_data_end); + SGEN_LOG (2, "Scanning thread data: %lld usecs", (long long)(SGEN_TV_ELAPSED (scan_thread_data_start, scan_thread_data_end) / 10)); } /* @@ -2505,6 +2609,12 @@ mono_gc_get_allocated_bytes_for_current_thread (void) return info->total_bytes_allocated + info->tlab_next - info->tlab_start; } +guint64 +mono_gc_get_total_allocated_bytes (MonoBoolean precise) +{ + return sgen_get_total_allocated_bytes (precise); +} + gpointer sgen_client_default_metadata (void) { @@ -2993,6 +3103,7 @@ sgen_client_binary_protocol_collection_begin (int minor_gc_count, int generation MONO_PROFILER_RAISE (gc_root_register, (SPECIAL_ADDRESS_FIN_QUEUE, 1, MONO_ROOT_SOURCE_FINALIZER_QUEUE, NULL, "Finalizer Queue")); MONO_PROFILER_RAISE (gc_root_register, (SPECIAL_ADDRESS_CRIT_FIN_QUEUE, 1, MONO_ROOT_SOURCE_FINALIZER_QUEUE, NULL, "Finalizer Queue (Critical)")); MONO_PROFILER_RAISE (gc_root_register, (SPECIAL_ADDRESS_EPHEMERON, 1, MONO_ROOT_SOURCE_EPHEMERON, NULL, "Ephemerons")); + MONO_PROFILER_RAISE (gc_root_register, (SPECIAL_ADDRESS_TOGGLEREF, 1, MONO_ROOT_SOURCE_TOGGLEREF, NULL, "ToggleRefs")); } #ifndef DISABLE_PERFCOUNTERS diff --git a/mono/metadata/sgen-mono.h b/mono/metadata/sgen-mono.h index cbce48db0f..9d45fcacbb 100644 --- a/mono/metadata/sgen-mono.h +++ b/mono/metadata/sgen-mono.h @@ -11,7 +11,7 @@ typedef struct { int version; void (*emit_nursery_check) (MonoMethodBuilder *mb, gboolean is_concurrent); - void (*emit_managed_allocater) (MonoMethodBuilder *mb, gboolean slowpath, gboolean profiler, int atype); + void (*emit_managed_allocator) (MonoMethodBuilder *mb, gboolean slowpath, gboolean profiler, int atype); } MonoSgenMonoCallbacks; void diff --git a/mono/metadata/sgen-stw.c b/mono/metadata/sgen-stw.c index c107dab3ac..737e0326ea 100644 --- a/mono/metadata/sgen-stw.c +++ b/mono/metadata/sgen-stw.c @@ -95,7 +95,7 @@ release_gc_locks (void) } static TV_DECLARE (stop_world_time); -static unsigned long max_pause_usec = 0; +static unsigned long max_stw_pause_time = 0; static guint64 time_stop_world; static guint64 time_restart_world; @@ -128,7 +128,10 @@ sgen_client_stop_world (int generation, gboolean serial_collection) MONO_PROFILER_RAISE (gc_event, (MONO_GC_EVENT_POST_STOP_WORLD, generation, serial_collection)); TV_GETTIME (end_handshake); - time_stop_world += TV_ELAPSED (stop_world_time, end_handshake); + + unsigned long stop_world_tv_elapsed = TV_ELAPSED (stop_world_time, end_handshake); + SGEN_LOG (2, "stopping world (time: %d usec)", (int)stop_world_tv_elapsed / 10); + time_stop_world += stop_world_tv_elapsed; sgen_memgov_collection_start (generation); if (sgen_need_bridge_processing ()) @@ -141,7 +144,6 @@ sgen_client_restart_world (int generation, gboolean serial_collection, gint64 *s { TV_DECLARE (end_sw); TV_DECLARE (start_handshake); - unsigned long usec; /* notify the profiler of the leftovers */ /* FIXME this is the wrong spot at we can STW for non collection reasons. */ @@ -163,12 +165,16 @@ sgen_client_restart_world (int generation, gboolean serial_collection, gint64 *s sgen_unified_suspend_restart_world (); TV_GETTIME (end_sw); - time_restart_world += TV_ELAPSED (start_handshake, end_sw); - usec = TV_ELAPSED (stop_world_time, end_sw); - max_pause_usec = MAX (usec, max_pause_usec); + + unsigned long restart_world_tv_elapsed = TV_ELAPSED (start_handshake, end_sw); + SGEN_LOG (2, "restarting world (time: %d usec)", (int)restart_world_tv_elapsed / 10); + time_restart_world += restart_world_tv_elapsed; + + unsigned long stw_pause_time = TV_ELAPSED (stop_world_time, end_sw); + max_stw_pause_time = MAX (stw_pause_time, max_stw_pause_time); end_of_last_stw = end_sw; - SGEN_LOG (2, "restarted (pause time: %d usec, max: %d)", (int)usec, (int)max_pause_usec); + SGEN_LOG (2, "restarted (pause time: %d usec, max: %d usec)", (int)stw_pause_time / 10, (int)max_stw_pause_time / 10); MONO_PROFILER_RAISE (gc_event, (MONO_GC_EVENT_POST_START_WORLD, generation, serial_collection)); @@ -186,7 +192,7 @@ sgen_client_restart_world (int generation, gboolean serial_collection, gint64 *s MONO_PROFILER_RAISE (gc_event, (MONO_GC_EVENT_POST_START_WORLD_UNLOCKED, generation, serial_collection)); - *stw_time = usec; + *stw_time = stw_pause_time; } void diff --git a/mono/metadata/sgen-tarjan-bridge.c b/mono/metadata/sgen-tarjan-bridge.c index ffda4d85b3..b8b0d02fb9 100644 --- a/mono/metadata/sgen-tarjan-bridge.c +++ b/mono/metadata/sgen-tarjan-bridge.c @@ -153,7 +153,7 @@ typedef struct _ScanData { /* Should color be made visible to client even though it has no bridges? * True if we predict the number of reduced edges to be enough to justify the extra node. */ -static inline gboolean +static gboolean bridgeless_color_is_heavy (ColorData *data) { int fanin = data->incoming_colors; int fanout = dyn_array_ptr_size (&data->other_colors); @@ -162,7 +162,7 @@ bridgeless_color_is_heavy (ColorData *data) { } // Should color be made visible to client? -static inline gboolean +static gboolean color_visible_to_client (ColorData *data) { return dyn_array_ptr_size (&data->bridges) || bridgeless_color_is_heavy (data); } diff --git a/mono/metadata/sgen-toggleref.c b/mono/metadata/sgen-toggleref.c index 09f5cfa46e..3fa53bd333 100644 --- a/mono/metadata/sgen-toggleref.c +++ b/mono/metadata/sgen-toggleref.c @@ -101,6 +101,16 @@ void sgen_client_mark_togglerefs (char *start, char *end, ScanCopyContext ctx) sgen_drain_gray_stack (ctx); } +void +sgen_foreach_toggleref_root (void (*callback)(MonoObject*, gpointer), gpointer data) +{ + int i; + for (i = 0; i < toggleref_array_size; ++i) { + if (toggleref_array [i].strong_ref) + callback (toggleref_array [i].strong_ref, data); + } +} + void sgen_client_clear_togglerefs (char *start, char *end, ScanCopyContext ctx) { CopyOrMarkObjectFunc copy_func = ctx.ops->copy_or_mark_object; diff --git a/mono/metadata/sre-encode.c b/mono/metadata/sre-encode.c index 97868a4bef..86e2c2923e 100644 --- a/mono/metadata/sre-encode.c +++ b/mono/metadata/sre-encode.c @@ -695,7 +695,7 @@ mono_dynimage_encode_fieldref_signature (MonoDynamicImage *assembly, MonoImage * if (field_image) { ERROR_DECL (error); MonoClass *klass = mono_class_get_checked (field_image, cmods->modifiers [i].token, error); - g_assert (mono_error_ok (error)); /* FIXME don't swallow the error */ + g_assert (is_ok (error)); /* FIXME don't swallow the error */ token = mono_image_typedef_or_ref (assembly, m_class_get_byval_arg (klass)); } else { diff --git a/mono/metadata/sre-save.c.REMOVED.git-id b/mono/metadata/sre-save.c.REMOVED.git-id index 410e1d6a14..580b0eb4bd 100644 --- a/mono/metadata/sre-save.c.REMOVED.git-id +++ b/mono/metadata/sre-save.c.REMOVED.git-id @@ -1 +1 @@ -0af60e50d721615d32af6cf5c46120ce39d96376 \ No newline at end of file +f2371b511b65494723d659580b0fd41924aa45ba \ No newline at end of file diff --git a/mono/metadata/sre.c.REMOVED.git-id b/mono/metadata/sre.c.REMOVED.git-id index 3ee1373801..afad05efbb 100644 --- a/mono/metadata/sre.c.REMOVED.git-id +++ b/mono/metadata/sre.c.REMOVED.git-id @@ -1 +1 @@ -97f1d8e077e9c636d89442c9e3a07fe7ba57d205 \ No newline at end of file +2ecc3e82bc25b8880cacaaf37af5aa6dbe981258 \ No newline at end of file diff --git a/mono/metadata/threadpool-io-poll.c b/mono/metadata/threadpool-io-poll.c index 2c29d89cad..ac57194d9d 100644 --- a/mono/metadata/threadpool-io-poll.c +++ b/mono/metadata/threadpool-io-poll.c @@ -8,7 +8,7 @@ static mono_pollfd *poll_fds; static guint poll_fds_capacity; static guint poll_fds_size; -static inline void +static void POLL_INIT_FD (mono_pollfd *poll_fd, gint fd, gint events) { poll_fd->fd = fd; @@ -113,7 +113,7 @@ poll_remove_fd (gint fd) poll_fds_size -= 1; } -static inline gint +static gint poll_mark_bad_fds (mono_pollfd *fds, gint size) { gint i, ready = 0; diff --git a/mono/metadata/threadpool-io.c b/mono/metadata/threadpool-io.c index 45f99ed82d..abaf8a6b3e 100644 --- a/mono/metadata/threadpool-io.c +++ b/mono/metadata/threadpool-io.c @@ -326,13 +326,11 @@ selector_thread_interrupt (gpointer unused) static gsize WINAPI selector_thread (gpointer data) { - ERROR_DECL (error); MonoGHashTable *states; - MonoString *thread_name = mono_string_new_checked (mono_get_root_domain (), "Thread Pool I/O Selector", error); - mono_error_assert_ok (error); - mono_thread_set_name_internal (mono_thread_internal_current (), thread_name, MonoSetThreadNameFlag_Reset, error); - mono_error_assert_ok (error); + mono_thread_set_name_constant_ignore_error (mono_thread_internal_current (), "Thread Pool I/O Selector", MonoSetThreadNameFlag_Reset); + + ERROR_DECL (error); if (mono_runtime_is_shutting_down ()) { io_selector_running = FALSE; @@ -601,10 +599,11 @@ mono_threadpool_io_cleanup (void) mono_lazy_cleanup (&io_status, cleanup); } +#ifndef ENABLE_NETCORE void -ves_icall_System_IOSelector_Add (gpointer handle, MonoIOSelectorJob *job) +ves_icall_System_IOSelector_Add (gpointer handle, MonoIOSelectorJobHandle job_handle, MonoError* error) { - ERROR_DECL (error); + MonoIOSelectorJob* const job = MONO_HANDLE_RAW (job_handle); ThreadPoolIOUpdate *update; g_assert (handle); @@ -626,13 +625,12 @@ ves_icall_System_IOSelector_Add (gpointer handle, MonoIOSelectorJob *job) return; } - int fd = GPOINTER_TO_INT (handle); + int const fd = GPOINTER_TO_INT (handle); if (!threadpool_io->backend.can_register_fd (fd)) { mono_coop_mutex_unlock (&threadpool_io->updates_lock); mono_trace (G_LOG_LEVEL_WARNING, MONO_TRACE_IO_SELECTOR, "Could not register to wait for file descriptor %d", fd); mono_error_set_not_supported (error, "Could not register to wait for file descriptor %d", fd); - mono_error_set_pending_exception (error); return; } @@ -646,6 +644,7 @@ ves_icall_System_IOSelector_Add (gpointer handle, MonoIOSelectorJob *job) mono_coop_mutex_unlock (&threadpool_io->updates_lock); } +#endif void ves_icall_System_IOSelector_Remove (gpointer handle) @@ -710,7 +709,7 @@ mono_threadpool_io_remove_domain_jobs (MonoDomain *domain) #else void -ves_icall_System_IOSelector_Add (gpointer handle, MonoIOSelectorJob *job) +ves_icall_System_IOSelector_Add (gpointer handle, MonoIOSelectorJobHandle job_handle, MonoError* error) { g_assert_not_reached (); } diff --git a/mono/metadata/threadpool-io.h b/mono/metadata/threadpool-io.h index a71a9f8280..da753529b4 100644 --- a/mono/metadata/threadpool-io.h +++ b/mono/metadata/threadpool-io.h @@ -13,9 +13,7 @@ typedef struct _MonoIOSelectorJob MonoIOSelectorJob; -ICALL_EXPORT -void -ves_icall_System_IOSelector_Add (gpointer handle, MonoIOSelectorJob *job); +TYPED_HANDLE_DECL (MonoIOSelectorJob); ICALL_EXPORT void diff --git a/mono/metadata/threadpool-netcore.c b/mono/metadata/threadpool-netcore.c new file mode 100644 index 0000000000..eea3321bfc --- /dev/null +++ b/mono/metadata/threadpool-netcore.c @@ -0,0 +1,625 @@ +/** + * \file + * Microsoft threadpool runtime support + * + * Author: + * Ludovic Henry (ludovic.henry@xamarin.com) + * + * Copyright 2015 Xamarin, Inc (http://www.xamarin.com) + * Licensed under the MIT license. See LICENSE file in the project root for full license information. + */ + +// +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +// +// Files: +// - src/vm/comthreadpool.cpp +// - src/vm/win32threadpoolcpp +// - src/vm/threadpoolrequest.cpp +// - src/vm/hillclimbing.cpp +// +// Ported from C++ to C and adjusted to Mono runtime + +// +// NETCORE version, based on threadpool.c with domains support removed +// + +#include + +#ifdef ENABLE_NETCORE + +#include +#define _USE_MATH_DEFINES // needed by MSVC to define math constants +#include + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "monitor.h" +#include "icall-decl.h" + +// consistency with coreclr https://github.com/dotnet/coreclr/blob/643b09f966e68e06d5f0930755985a01a2a2b096/src/vm/win32threadpool.h#L111 +#define MAX_POSSIBLE_THREADS 0x7fff + +typedef union { + struct { + gint16 starting; /* starting, but not yet in worker_callback */ + gint16 working; /* executing worker_callback */ + } _; + gint32 as_gint32; +} ThreadPoolCounter; + +typedef struct { + MonoRefCount ref; + + MonoCoopMutex tp_lock; + + ThreadPoolCounter counters; + + /* Number of outstanding jobs */ + gint32 outstanding_request; + /* Number of currently executing jobs */ + gint32 threadpool_jobs; + /* Signalled when threadpool_jobs + outstanding_request is 0 */ + /* Protected by tp_lock */ + MonoCoopCond cleanup_cond; + + gint32 limit_io_min; + gint32 limit_io_max; +} ThreadPool; + +static mono_lazy_init_t status = MONO_LAZY_INIT_STATUS_NOT_INITIALIZED; + +static ThreadPool threadpool; + +#define COUNTER_ATOMIC(var,block) \ + do { \ + ThreadPoolCounter __old; \ + do { \ + (var) = __old = COUNTER_READ (); \ + { block; } \ + if (!(counter._.starting >= 0)) \ + g_error ("%s: counter._.starting = %d, but should be >= 0", __func__, counter._.starting); \ + if (!(counter._.working >= 0)) \ + g_error ("%s: counter._.working = %d, but should be >= 0", __func__, counter._.working); \ + } while (mono_atomic_cas_i32 (&threadpool.counters.as_gint32, (var).as_gint32, __old.as_gint32) != __old.as_gint32); \ + } while (0) + +static inline ThreadPoolCounter +COUNTER_READ (void) +{ + ThreadPoolCounter counter; + counter.as_gint32 = mono_atomic_load_i32 (&threadpool.counters.as_gint32); + return counter; +} + +static inline void +tp_lock (void) +{ + mono_coop_mutex_lock (&threadpool.tp_lock); +} + +static inline void +tp_unlock (void) +{ + mono_coop_mutex_unlock (&threadpool.tp_lock); +} + +static void +destroy (gpointer unused) +{ + mono_coop_mutex_destroy (&threadpool.tp_lock); +} + +static gsize +set_thread_name (MonoInternalThread *thread) +{ + return mono_thread_set_name_constant_ignore_error (thread, "Thread Pool Worker", MonoSetThreadNameFlag_Reset); +} + +static void +worker_callback (void); + +static void +initialize (void) +{ + g_assert (sizeof (ThreadPoolCounter) == sizeof (gint32)); + + mono_refcount_init (&threadpool, destroy); + + mono_coop_mutex_init (&threadpool.tp_lock); + + threadpool.limit_io_min = mono_cpu_count (); + threadpool.limit_io_max = CLAMP (threadpool.limit_io_min * 100, MIN (threadpool.limit_io_min, 200), MAX (threadpool.limit_io_min, 200)); + + mono_coop_cond_init (&threadpool.cleanup_cond); + + mono_threadpool_worker_init (worker_callback); +} + +static void +cleanup (void) +{ + mono_threadpool_worker_cleanup (); + + mono_refcount_dec (&threadpool); +} + +gboolean +mono_threadpool_enqueue_work_item (MonoDomain *domain, MonoObject *work_item, MonoError *error) +{ + static MonoClass *threadpool_class = NULL; + static MonoMethod *unsafe_queue_custom_work_item_method = NULL; + MonoBoolean f; + gpointer args [2]; + + error_init (error); + g_assert (work_item); + + g_assert (domain == mono_get_root_domain ()); + + if (!threadpool_class) + threadpool_class = mono_class_load_from_name (mono_defaults.corlib, "System.Threading", "ThreadPool"); + + if (!unsafe_queue_custom_work_item_method) { + unsafe_queue_custom_work_item_method = mono_class_get_method_from_name_checked (threadpool_class, "UnsafeQueueCustomWorkItem", 2, 0, error); + mono_error_assert_ok (error); + } + g_assert (unsafe_queue_custom_work_item_method); + + f = FALSE; + + args [0] = (gpointer) work_item; + args [1] = (gpointer) &f; + + mono_runtime_invoke_checked (unsafe_queue_custom_work_item_method, NULL, args, error); + return is_ok (error); +} + +static MonoObject* +try_invoke_perform_wait_callback (MonoObject** exc, MonoError *error) +{ + HANDLE_FUNCTION_ENTER (); + error_init (error); + MonoObject * const res = mono_runtime_try_invoke (mono_defaults.threadpool_perform_wait_callback_method, NULL, NULL, exc, error); + HANDLE_FUNCTION_RETURN_VAL (res); +} + +static void +worker_callback (void) +{ + ERROR_DECL (error); + ThreadPoolCounter counter; + MonoInternalThread *thread; + + if (!mono_refcount_tryinc (&threadpool)) + return; + + thread = mono_thread_internal_current (); + + COUNTER_ATOMIC (counter, { + if (!(counter._.working < 32767 /* G_MAXINT16 */)) + g_error ("%s: counter._.working = %d, but should be < 32767", __func__, counter._.working); + + counter._.starting --; + counter._.working ++; + }); + + if (mono_runtime_is_shutting_down ()) { + COUNTER_ATOMIC (counter, { + counter._.working --; + }); + + mono_refcount_dec (&threadpool); + return; + } + + /* + * This is needed so there is always an lmf frame in the runtime invoke call below, + * so ThreadAbortExceptions are caught even if the thread is in native code. + */ + mono_defaults.threadpool_perform_wait_callback_method->save_lmf = TRUE; + + tp_lock (); + + gsize name_generation = thread->name.generation; + /* Set the name if this is the first call to worker_callback on this thread */ + if (name_generation == 0) + name_generation = set_thread_name (thread); + + while (!mono_runtime_is_shutting_down ()) { + gboolean retire = FALSE; + + if (thread->state & (ThreadState_AbortRequested | ThreadState_SuspendRequested)) { + tp_unlock (); + if (mono_thread_interruption_checkpoint_bool ()) { + tp_lock (); + continue; + } + tp_lock (); + } + + if (threadpool.outstanding_request == 0) + break; + + threadpool.outstanding_request --; + g_assert (threadpool.outstanding_request >= 0); + + mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_THREADPOOL, "[%p] worker (outstanding requests %d)", + GUINT_TO_POINTER (MONO_NATIVE_THREAD_ID_TO_UINT (mono_native_thread_id_get ())), threadpool.outstanding_request); + + g_assert (threadpool.threadpool_jobs >= 0); + threadpool.threadpool_jobs ++; + + tp_unlock (); + + // Any thread can set any other thread name at any time. + // So this is unavoidably racy. + // This only partly fights against that -- i.e. not atomic and not a loop. + // It is reliable against the thread setting its own name, and somewhat + // reliable against other threads setting this thread's name. + if (name_generation != thread->name.generation) + name_generation = set_thread_name (thread); + + mono_thread_clear_and_set_state (thread, + (MonoThreadState)~ThreadState_Background, + ThreadState_Background); + + MonoObject *exc = NULL, *res; + + res = try_invoke_perform_wait_callback (&exc, error); + if (exc || !is_ok (error)) { + if (exc == NULL) + exc = (MonoObject *) mono_error_convert_to_exception (error); + else + mono_error_cleanup (error); + mono_thread_internal_unhandled_exception (exc); + } else if (res && *(MonoBoolean*) mono_object_unbox_internal (res) == FALSE) { + retire = TRUE; + } + + /* Reset name after every callback */ + if (name_generation != thread->name.generation) + name_generation = set_thread_name (thread); + + tp_lock (); + + threadpool.threadpool_jobs --; + g_assert (threadpool.threadpool_jobs >= 0); + + if (retire) + break; + } + + tp_unlock (); + + COUNTER_ATOMIC (counter, { + counter._.working --; + }); + + mono_refcount_dec (&threadpool); +} + +void +mono_threadpool_cleanup (void) +{ +#ifndef DISABLE_SOCKETS + mono_threadpool_io_cleanup (); +#endif + mono_lazy_cleanup (&status, cleanup); +} + +MonoAsyncResult * +mono_threadpool_begin_invoke (MonoDomain *domain, MonoObject *target, MonoMethod *method, gpointer *params, MonoError *error) +{ + static MonoClass *async_call_klass = NULL; + MonoMethodMessage *message; + MonoAsyncResult *async_result; + MonoAsyncCall *async_call; + MonoDelegate *async_callback = NULL; + MonoObject *state = NULL; + + if (!async_call_klass) + async_call_klass = mono_class_load_from_name (mono_defaults.corlib, "System", "MonoAsyncCall"); + + error_init (error); + + message = mono_method_call_message_new (method, params, mono_get_delegate_invoke_internal (method->klass), (params != NULL) ? (&async_callback) : NULL, (params != NULL) ? (&state) : NULL, error); + return_val_if_nok (error, NULL); + + async_call = (MonoAsyncCall*) mono_object_new_checked (domain, async_call_klass, error); + return_val_if_nok (error, NULL); + + MONO_OBJECT_SETREF_INTERNAL (async_call, msg, message); + MONO_OBJECT_SETREF_INTERNAL (async_call, state, state); + + if (async_callback) { + MONO_OBJECT_SETREF_INTERNAL (async_call, cb_method, mono_get_delegate_invoke_internal (((MonoObject*) async_callback)->vtable->klass)); + MONO_OBJECT_SETREF_INTERNAL (async_call, cb_target, async_callback); + } + + async_result = mono_async_result_new (domain, NULL, async_call->state, NULL, (MonoObject*) async_call, error); + return_val_if_nok (error, NULL); + MONO_OBJECT_SETREF_INTERNAL (async_result, async_delegate, target); + + mono_threadpool_enqueue_work_item (domain, (MonoObject*) async_result, error); + return_val_if_nok (error, NULL); + + return async_result; +} + +MonoObject * +mono_threadpool_end_invoke (MonoAsyncResult *ares, MonoArray **out_args, MonoObject **exc, MonoError *error) +{ + MonoAsyncCall *ac; + + error_init (error); + g_assert (exc); + g_assert (out_args); + + *exc = NULL; + *out_args = NULL; + + /* check if already finished */ + mono_monitor_enter_internal ((MonoObject*) ares); + + if (ares->endinvoke_called) { + mono_error_set_invalid_operation(error, "Delegate EndInvoke method called more than once"); + mono_monitor_exit_internal ((MonoObject*) ares); + return NULL; + } + + ares->endinvoke_called = 1; + + /* wait until we are really finished */ + if (ares->completed) { + mono_monitor_exit_internal ((MonoObject *) ares); + } else { + gpointer wait_event; + if (ares->handle) { + wait_event = mono_wait_handle_get_handle ((MonoWaitHandle*) ares->handle); + } else { + wait_event = mono_w32event_create (TRUE, FALSE); + g_assert(wait_event); + MonoWaitHandle *wait_handle = mono_wait_handle_new (mono_object_domain (ares), wait_event, error); + if (!is_ok (error)) { + mono_w32event_close (wait_event); + return NULL; + } + MONO_OBJECT_SETREF_INTERNAL (ares, handle, (MonoObject*) wait_handle); + } + mono_monitor_exit_internal ((MonoObject*) ares); + mono_w32handle_wait_one (wait_event, MONO_INFINITE_WAIT, TRUE); + } + + ac = (MonoAsyncCall*) ares->object_data; + g_assert (ac); + + *exc = ac->msg->exc; /* FIXME: GC add write barrier */ + *out_args = ac->out_args; + return ac->res; +} + +void +mono_threadpool_suspend (void) +{ + if (mono_lazy_is_initialized (&status)) + mono_threadpool_worker_set_suspended (TRUE); +} + +void +mono_threadpool_resume (void) +{ + if (mono_lazy_is_initialized (&status)) + mono_threadpool_worker_set_suspended (FALSE); +} + +void +ves_icall_System_Threading_ThreadPool_GetAvailableThreadsNative (gint32 *worker_threads, gint32 *completion_port_threads, MonoError *error) +{ + ThreadPoolCounter counter; + + if (!worker_threads || !completion_port_threads) + return; + + if (!mono_lazy_initialize (&status, initialize) || !mono_refcount_tryinc (&threadpool)) { + *worker_threads = 0; + *completion_port_threads = 0; + return; + } + + counter = COUNTER_READ (); + + *worker_threads = MAX (0, mono_threadpool_worker_get_max () - counter._.working); + *completion_port_threads = threadpool.limit_io_max; + + mono_refcount_dec (&threadpool); +} + +void +ves_icall_System_Threading_ThreadPool_GetMinThreadsNative (gint32 *worker_threads, gint32 *completion_port_threads, MonoError *error) +{ + if (!worker_threads || !completion_port_threads) + return; + + if (!mono_lazy_initialize (&status, initialize) || !mono_refcount_tryinc (&threadpool)) { + *worker_threads = 0; + *completion_port_threads = 0; + return; + } + + *worker_threads = mono_threadpool_worker_get_min (); + *completion_port_threads = threadpool.limit_io_min; + + mono_refcount_dec (&threadpool); +} + +void +ves_icall_System_Threading_ThreadPool_GetMaxThreadsNative (gint32 *worker_threads, gint32 *completion_port_threads, MonoError *error) +{ + if (!worker_threads || !completion_port_threads) + return; + + if (!mono_lazy_initialize (&status, initialize) || !mono_refcount_tryinc (&threadpool)) { + *worker_threads = 0; + *completion_port_threads = 0; + return; + } + + *worker_threads = mono_threadpool_worker_get_max (); + *completion_port_threads = threadpool.limit_io_max; + + mono_refcount_dec (&threadpool); +} + +MonoBoolean +ves_icall_System_Threading_ThreadPool_SetMinThreadsNative (gint32 worker_threads, gint32 completion_port_threads, MonoError *error) +{ + if (!mono_lazy_initialize (&status, initialize) || !mono_refcount_tryinc (&threadpool)) + return FALSE; + + if (completion_port_threads <= 0 || completion_port_threads > threadpool.limit_io_max) + return FALSE; + + if (!mono_threadpool_worker_set_min (worker_threads)) { + mono_refcount_dec (&threadpool); + return FALSE; + } + + threadpool.limit_io_min = completion_port_threads; + + mono_refcount_dec (&threadpool); + return TRUE; +} + +MonoBoolean +ves_icall_System_Threading_ThreadPool_SetMaxThreadsNative (gint32 worker_threads, gint32 completion_port_threads, MonoError *error) +{ + if (!mono_lazy_initialize (&status, initialize) || !mono_refcount_tryinc (&threadpool)) + return FALSE; + + worker_threads = MIN (worker_threads, MAX_POSSIBLE_THREADS); + completion_port_threads = MIN (completion_port_threads, MAX_POSSIBLE_THREADS); + + gint cpu_count = mono_cpu_count (); + + if (completion_port_threads < threadpool.limit_io_min || completion_port_threads < cpu_count) + return FALSE; + + if (!mono_threadpool_worker_set_max (worker_threads)) { + mono_refcount_dec (&threadpool); + return FALSE; + } + + threadpool.limit_io_max = completion_port_threads; + + mono_refcount_dec (&threadpool); + return TRUE; +} + +gint32 +ves_icall_System_Threading_ThreadPool_GetThreadCount (MonoError *error) +{ + return mono_threadpool_worker_get_threads_count (); +} + +gint64 +ves_icall_System_Threading_ThreadPool_GetCompletedWorkItemCount (MonoError *error) +{ + return mono_threadpool_worker_get_completed_threads_count (); +} + +void +ves_icall_System_Threading_ThreadPool_InitializeVMTp (MonoBoolean *enable_worker_tracking, MonoError *error) +{ + if (enable_worker_tracking) { + // TODO implement some kind of switch to have the possibily to use it + *enable_worker_tracking = FALSE; + } + + mono_lazy_initialize (&status, initialize); +} + +MonoBoolean +ves_icall_System_Threading_ThreadPool_NotifyWorkItemComplete (MonoError *error) +{ + if (mono_runtime_is_shutting_down ()) + return FALSE; + + return mono_threadpool_worker_notify_completed (); +} + +void +ves_icall_System_Threading_ThreadPool_NotifyWorkItemProgressNative (MonoError *error) +{ + mono_threadpool_worker_notify_completed (); +} + +void +ves_icall_System_Threading_ThreadPool_NotifyWorkItemQueued (MonoError *error) +// FIXME Move to managed. +{ +#ifndef DISABLE_PERFCOUNTERS + mono_atomic_inc_i64 (&mono_perfcounters->threadpool_workitems); +#endif +} + +void +ves_icall_System_Threading_ThreadPool_ReportThreadStatus (MonoBoolean is_working, MonoError *error) +{ + // TODO + mono_error_set_not_implemented (error, ""); +} + +MonoBoolean +ves_icall_System_Threading_ThreadPool_RequestWorkerThread (MonoError *error) +{ + ThreadPoolCounter counter; + + if (!mono_lazy_initialize (&status, initialize) || !mono_refcount_tryinc (&threadpool)) { + /* threadpool has been destroyed, we are shutting down */ + return FALSE; + } + + tp_lock (); + threadpool.outstanding_request ++; + g_assert (threadpool.outstanding_request >= 1); + tp_unlock (); + + COUNTER_ATOMIC (counter, { + if (counter._.starting == 16) { + mono_refcount_dec (&threadpool); + return TRUE; + } + + counter._.starting ++; + }); + + mono_threadpool_worker_request (); + + mono_refcount_dec (&threadpool); + return TRUE; +} + +#endif /* ENABLE_NETCORE */ diff --git a/mono/metadata/threadpool-worker-default.c b/mono/metadata/threadpool-worker-default.c index d7122937e2..bca8404e68 100644 --- a/mono/metadata/threadpool-worker-default.c +++ b/mono/metadata/threadpool-worker-default.c @@ -30,7 +30,6 @@ #include #include #include -#include #include #include #include // This header has defines to muck with names, so put it late. @@ -104,7 +103,6 @@ typedef struct { gdouble *thread_counts; guint32 current_sample_interval; - gpointer random_interval_generator; gint32 accumulated_completion_count; gdouble accumulated_sample_duration; @@ -186,7 +184,7 @@ static ThreadPoolWorker worker; } while (mono_atomic_cas_i64 (&worker.counters.as_gint64, (var).as_gint64, __old.as_gint64) != __old.as_gint64); \ } while (0) -static inline ThreadPoolWorkerCounter +static ThreadPoolWorkerCounter COUNTER_READ (void) { ThreadPoolWorkerCounter counter; @@ -194,19 +192,25 @@ COUNTER_READ (void) return counter; } -static gpointer -rand_create (void) +static gint16 +counter_num_active (ThreadPoolWorkerCounter counter) { - mono_rand_open (); - return mono_rand_init (NULL, 0); + gint16 num_active = counter._.starting + counter._.working + counter._.parked; + g_assert (num_active >= 0); + return num_active; } static guint32 -rand_next (gpointer *handle, guint32 min, guint32 max) +rand_next (guint32 min, guint32 max) { ERROR_DECL (error); - guint32 val; - mono_rand_try_get_uint32 (handle, &val, min, max, error); + +#ifdef HOST_WIN32 + guint32 val = (rand () % (max - min)) + min; +#else + guint32 val = (random () % (max - min)) + min; +#endif + // FIXME handle error mono_error_assert_ok (error); return val; @@ -245,8 +249,6 @@ mono_threadpool_worker_init (MonoThreadPoolWorkerCallback callback) worker.heuristic_adjustment_interval = 10; mono_coop_mutex_init (&worker.heuristic_lock); - mono_rand_open (); - hc = &worker.heuristic_hill_climbing; hc->wave_period = HILL_CLIMBING_WAVE_PERIOD; @@ -271,8 +273,7 @@ mono_threadpool_worker_init (MonoThreadPoolWorkerCallback callback) hc->accumulated_sample_duration = 0; hc->samples = g_new0 (gdouble, hc->samples_to_measure); hc->thread_counts = g_new0 (gdouble, hc->samples_to_measure); - hc->random_interval_generator = rand_create (); - hc->current_sample_interval = rand_next (&hc->random_interval_generator, hc->sample_interval_low, hc->sample_interval_high); + hc->current_sample_interval = rand_next (hc->sample_interval_low, hc->sample_interval_high); if (!(threads_per_cpu_env = g_getenv ("MONO_THREADS_PER_CPU"))) threads_per_cpu = 1; @@ -356,6 +357,19 @@ mono_threadpool_worker_request (void) mono_refcount_dec (&worker); } +#ifdef ENABLE_NETCORE +gint64 mono_threadpool_worker_get_completed_threads_count (void) +{ + return worker.heuristic_completions; +} + +gint32 mono_threadpool_worker_get_threads_count (void) +{ + ThreadPoolWorkerCounter const counter = COUNTER_READ (); + return counter._.working; +} +#endif + /* return TRUE if timeout, FALSE otherwise (worker unpark or interrupt) */ static gboolean worker_park (void) @@ -368,14 +382,8 @@ worker_park (void) GUINT_TO_POINTER (MONO_NATIVE_THREAD_ID_TO_UINT (mono_native_thread_id_get ()))); if (!mono_runtime_is_shutting_down ()) { - static gpointer rand_handle = NULL; ThreadPoolWorkerCounter counter; - if (!rand_handle) { - rand_handle = rand_create (); - g_assert (rand_handle); - } - COUNTER_ATOMIC (counter, { counter._.working --; counter._.parked ++; @@ -388,7 +396,7 @@ worker_park (void) new_ = old + 1; } while (mono_atomic_cas_i32 (&worker.parked_threads_count, new_, old) != old); - switch (mono_coop_sem_timedwait (&worker.parked_threads_sem, rand_next (&rand_handle, 5 * 1000, 60 * 1000), MONO_SEM_FLAGS_ALERTABLE)) { + switch (mono_coop_sem_timedwait (&worker.parked_threads_sem, rand_next (5 * 1000, 60 * 1000), MONO_SEM_FLAGS_ALERTABLE)) { case MONO_SEM_TIMEDWAIT_RET_SUCCESS: break; case MONO_SEM_TIMEDWAIT_RET_ALERTED: @@ -453,6 +461,8 @@ worker_try_unpark (void) return res; } +static void hill_climbing_force_change (gint16 new_thread_count, ThreadPoolHeuristicStateTransition transition); + static gsize WINAPI worker_thread (gpointer unused) { @@ -473,6 +483,7 @@ worker_thread (gpointer unused) thread = mono_thread_internal_current (); g_assert (thread); + gboolean worker_timed_out = FALSE; while (!mono_runtime_is_shutting_down ()) { if (mono_thread_interruption_checkpoint_bool ()) continue; @@ -488,8 +499,10 @@ worker_thread (gpointer unused) if (!work_item_try_pop ()) { gboolean const timeout = worker_park (); - if (timeout) + if (timeout) { + worker_timed_out = TRUE; break; + } continue; } @@ -504,6 +517,19 @@ worker_thread (gpointer unused) counter._.working --; }); + if (worker_timed_out) { + gint16 decr_max_working; + COUNTER_ATOMIC (counter, { + decr_max_working = MAX (worker.limit_worker_min, MIN (counter_num_active (counter), counter._.max_working)); + counter._.max_working = decr_max_working; + }); + mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_THREADPOOL, "[%p] worker timed out, starting = %d working = %d parked = %d, setting max_working to %d", + GUINT_TO_POINTER (MONO_NATIVE_THREAD_ID_TO_UINT (mono_native_thread_id_get ())), + counter._.starting, counter._.working, counter._.parked, + decr_max_working); + hill_climbing_force_change (decr_max_working, TRANSITION_THREAD_TIMED_OUT); + } + mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_THREADPOOL, "[%p] worker finishing", GUINT_TO_POINTER (MONO_NATIVE_THREAD_ID_TO_UINT (mono_native_thread_id_get ()))); @@ -664,8 +690,6 @@ monitor_sufficient_delay_since_last_dequeue (void) return mono_msec_ticks () >= worker.heuristic_last_dequeue + threshold; } -static void hill_climbing_force_change (gint16 new_thread_count, ThreadPoolHeuristicStateTransition transition); - static gsize WINAPI monitor_thread (gpointer unused) { @@ -693,9 +717,16 @@ monitor_thread (gpointer unused) g_assert (worker.monitor_status != MONITOR_STATUS_NOT_RUNNING); - // counter = COUNTER_READ (); - // printf ("monitor_thread: starting = %d working = %d parked = %d max_working = %d\n", - // counter._.starting, counter._.working, counter._.parked, counter._.max_working); +#if 0 + // This is ifdef'd out because otherwise we flood the log every + // MONITOR_INTERVAL ms, which is pretty noisy. + if (mono_trace_is_traced (G_LOG_LEVEL_DEBUG, MONO_TRACE_THREADPOOL)) { + ThreadPoolWorkerCounter trace_counter = COUNTER_READ (); + gint32 work_items = work_item_count (); + mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_THREADPOOL, "monitor_thread: work items = %d, starting = %d working = %d parked = %d max_working = %d\n", + work_items, trace_counter._.starting, trace_counter._.working, trace_counter._.parked, trace_counter._.max_working); + } +#endif do { gint64 ts; @@ -726,20 +757,33 @@ monitor_thread (gpointer unused) if (!monitor_sufficient_delay_since_last_dequeue ()) continue; - limit_worker_max_reached = FALSE; + gboolean active_max_reached; COUNTER_ATOMIC (counter, { + limit_worker_max_reached = FALSE; + active_max_reached = FALSE; if (counter._.max_working >= worker.limit_worker_max) { limit_worker_max_reached = TRUE; + if (counter_num_active (counter) >= counter._.max_working) + active_max_reached = TRUE; break; } counter._.max_working ++; }); - if (limit_worker_max_reached) - continue; - - hill_climbing_force_change (counter._.max_working, TRANSITION_STARVATION); + if (limit_worker_max_reached) { + mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_THREADPOOL, "[%p] monitor thread, limit_worker_max (%d) reached", + GUINT_TO_POINTER (MONO_NATIVE_THREAD_ID_TO_UINT (mono_native_thread_id_get ())), + worker.limit_worker_max); + if (active_max_reached) + continue; + else + mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_THREADPOOL, "[%p] monitor thread, num_active (%d) < max_working, allowing active thread increase", + GUINT_TO_POINTER (MONO_NATIVE_THREAD_ID_TO_UINT (mono_native_thread_id_get ())), + counter_num_active (counter)); + } + else + hill_climbing_force_change (counter._.max_working, TRANSITION_STARVATION); for (i = 0; i < 5; ++i) { if (mono_runtime_is_shutting_down ()) @@ -812,7 +856,7 @@ hill_climbing_change_thread_count (gint16 new_thread_count, ThreadPoolHeuristicS GUINT_TO_POINTER (MONO_NATIVE_THREAD_ID_TO_UINT (mono_native_thread_id_get ())), new_thread_count); hc->last_thread_count = new_thread_count; - hc->current_sample_interval = rand_next (&hc->random_interval_generator, hc->sample_interval_low, hc->sample_interval_high); + hc->current_sample_interval = rand_next (hc->sample_interval_low, hc->sample_interval_high); hc->elapsed_since_last_change = 0; hc->completions_since_last_change = 0; } @@ -1095,6 +1139,7 @@ heuristic_adjust (void) counter._.max_working = new_thread_count; }); + /* FIXME: this can never be true. we only leave COUNTER_ATOMIC() if the assignment and CAS succeeded */ if (new_thread_count > counter._.max_working) worker_request (); diff --git a/mono/metadata/threadpool-worker-wasm.c b/mono/metadata/threadpool-worker-wasm.c index 8877df9602..9eaa348f49 100644 --- a/mono/metadata/threadpool-worker-wasm.c +++ b/mono/metadata/threadpool-worker-wasm.c @@ -75,3 +75,15 @@ mono_threadpool_worker_notify_completed (void) { return FALSE; } + +#ifdef ENABLE_NETCORE +gint64 mono_threadpool_worker_get_completed_threads_count (void) +{ + return 0; +} + +gint32 mono_threadpool_worker_get_threads_count (void) +{ + return 0; +} +#endif diff --git a/mono/metadata/threadpool-worker.h b/mono/metadata/threadpool-worker.h index 9b2c51d7f6..99bf52e38d 100644 --- a/mono/metadata/threadpool-worker.h +++ b/mono/metadata/threadpool-worker.h @@ -21,6 +21,14 @@ mono_threadpool_worker_request (void); gboolean mono_threadpool_worker_notify_completed (void); +#ifdef ENABLE_NETCORE +gint64 +mono_threadpool_worker_get_completed_threads_count (void); + +gint32 +mono_threadpool_worker_get_threads_count (void); +#endif + gint32 mono_threadpool_worker_get_min (void); gboolean diff --git a/mono/metadata/threadpool.c b/mono/metadata/threadpool.c index 1a24a64a36..494b91112a 100644 --- a/mono/metadata/threadpool.c +++ b/mono/metadata/threadpool.c @@ -21,10 +21,13 @@ // // Ported from C++ to C and adjusted to Mono runtime +#include + +#ifndef ENABLE_NETCORE + #include #define _USE_MATH_DEFINES // needed by MSVC to define math constants #include -#include #include #include @@ -102,7 +105,7 @@ static ThreadPool threadpool; } while (mono_atomic_cas_i32 (&threadpool.counters.as_gint32, (var).as_gint32, __old.as_gint32) != __old.as_gint32); \ } while (0) -static inline ThreadPoolCounter +static ThreadPoolCounter COUNTER_READ (void) { ThreadPoolCounter counter; @@ -110,13 +113,13 @@ COUNTER_READ (void) return counter; } -static inline void +static void domains_lock (void) { mono_coop_mutex_lock (&threadpool.domains_lock); } -static inline void +static void domains_unlock (void) { mono_coop_mutex_unlock (&threadpool.domains_lock); @@ -285,10 +288,15 @@ try_invoke_perform_wait_callback (MonoObject** exc, MonoError *error) HANDLE_FUNCTION_RETURN_VAL (res); } +static gsize +set_thread_name (MonoInternalThread *thread) +{ + return mono_thread_set_name_constant_ignore_error (thread, "Thread Pool Worker", MonoSetThreadNameFlag_Reset); +} + static void worker_callback (void) { - ERROR_DECL (error); ThreadPoolDomain *tpdomain, *previous_tpdomain; ThreadPoolCounter counter; MonoInternalThread *thread; @@ -321,6 +329,11 @@ worker_callback (void) */ mono_defaults.threadpool_perform_wait_callback_method->save_lmf = TRUE; + gsize name_generation = thread->name.generation; + /* Set the name if this is the first call to worker_callback on this thread */ + if (name_generation == 0) + name_generation = set_thread_name (thread); + domains_lock (); previous_tpdomain = NULL; @@ -352,10 +365,13 @@ worker_callback (void) domains_unlock (); - MonoString *thread_name = mono_string_new_checked (mono_get_root_domain (), "Thread Pool Worker", error); - mono_error_assert_ok (error); - mono_thread_set_name_internal (thread, thread_name, MonoSetThreadNameFlag_Reset, error); - mono_error_assert_ok (error); + // Any thread can set any other thread name at any time. + // So this is unavoidably racy. + // This only partly fights against that -- i.e. not atomic and not a loop. + // It is reliable against the thread setting its own name, and somewhat + // reliable against other threads setting this thread's name. + if (name_generation != thread->name.generation) + name_generation = set_thread_name (thread); mono_thread_clear_and_set_state (thread, (MonoThreadState)~ThreadState_Background, @@ -365,8 +381,10 @@ worker_callback (void) if (mono_domain_set_fast (tpdomain->domain, FALSE)) { MonoObject *exc = NULL, *res; + ERROR_DECL (error); + res = try_invoke_perform_wait_callback (&exc, error); - if (exc || !mono_error_ok(error)) { + if (exc || !is_ok(error)) { if (exc == NULL) exc = (MonoObject *) mono_error_convert_to_exception (error); else @@ -380,6 +398,10 @@ worker_callback (void) } mono_thread_pop_appdomain_ref (); + /* Reset name after every callback */ + if (name_generation != thread->name.generation) + name_generation = set_thread_name (thread); + domains_lock (); tpdomain->threadpool_jobs --; @@ -799,3 +821,5 @@ ves_icall_System_Threading_ThreadPool_RequestWorkerThread (MonoError *error) mono_refcount_dec (&threadpool); return TRUE; } + +#endif /* !ENABLE_NETCORE */ diff --git a/mono/metadata/threads-types.h b/mono/metadata/threads-types.h index fc4e58fc73..2eed6ddda8 100644 --- a/mono/metadata/threads-types.h +++ b/mono/metadata/threads-types.h @@ -106,6 +106,9 @@ mono_thread_create_internal_handle (MonoDomain *domain, T func, gpointer arg, Mo } #endif +void +mono_thread_manage_internal (void); + /* Data owned by a MonoInternalThread that must live until both the finalizer * for MonoInternalThread has run, and the underlying machine thread has * detached. @@ -156,7 +159,7 @@ ICALL_EXPORT gint64 ves_icall_System_Threading_Interlocked_Exchange_Long(gint64 *location, gint64 value); ICALL_EXPORT -MonoObject *ves_icall_System_Threading_Interlocked_Exchange_Object(MonoObject **location, MonoObject *value); +void ves_icall_System_Threading_Interlocked_Exchange_Object (MonoObject *volatile*location, MonoObject *volatile*value, MonoObject *volatile*res); ICALL_EXPORT gpointer ves_icall_System_Threading_Interlocked_Exchange_IntPtr(gpointer *location, gpointer value); @@ -177,7 +180,7 @@ ICALL_EXPORT gint64 ves_icall_System_Threading_Interlocked_CompareExchange_Long(gint64 *location, gint64 value, gint64 comparand); ICALL_EXPORT -MonoObject *ves_icall_System_Threading_Interlocked_CompareExchange_Object(MonoObject **location, MonoObject *value, MonoObject *comparand); +void ves_icall_System_Threading_Interlocked_CompareExchange_Object (MonoObject *volatile*location, MonoObject *volatile*value, MonoObject *volatile*comparand, MonoObject *volatile*res); ICALL_EXPORT gpointer ves_icall_System_Threading_Interlocked_CompareExchange_IntPtr(gpointer *location, gpointer value, gpointer comparand); @@ -189,10 +192,10 @@ ICALL_EXPORT gdouble ves_icall_System_Threading_Interlocked_CompareExchange_Double(gdouble *location, gdouble value, gdouble comparand); ICALL_EXPORT -MonoObject* ves_icall_System_Threading_Interlocked_CompareExchange_T(MonoObject **location, MonoObject *value, MonoObject *comparand); +void ves_icall_System_Threading_Interlocked_CompareExchange_T (MonoObject *volatile*location, MonoObject *volatile*value, MonoObject *volatile*comparand, MonoObject *volatile*res); ICALL_EXPORT -MonoObject* ves_icall_System_Threading_Interlocked_Exchange_T(MonoObject **location, MonoObject *value); +void ves_icall_System_Threading_Interlocked_Exchange_T (MonoObject *volatile*location, MonoObject *volatile*value, MonoObject *volatile*res); ICALL_EXPORT gint32 ves_icall_System_Threading_Interlocked_Add_Int(gint32 *location, gint32 value); @@ -344,16 +347,21 @@ typedef enum { MonoSetThreadNameFlag_None = 0x0000, MonoSetThreadNameFlag_Permanent = 0x0001, MonoSetThreadNameFlag_Reset = 0x0002, - //MonoSetThreadNameFlag_Constant = 0x0004, + MonoSetThreadNameFlag_Constant = 0x0004, } MonoSetThreadNameFlags; G_ENUM_FUNCTIONS (MonoSetThreadNameFlags) MONO_PROFILER_API -void -mono_thread_set_name_internal (MonoInternalThread *thread, - MonoString *name, - MonoSetThreadNameFlags flags, MonoError *error); +gsize +mono_thread_set_name (MonoInternalThread *thread, + const char* name8, size_t name8_length, const gunichar2* name16, + MonoSetThreadNameFlags flags, MonoError *error); + +#define mono_thread_set_name_constant_ignore_error(thread, name, flags) \ + mono_thread_set_name ((thread), name, G_N_ELEMENTS (name) - 1, \ + MONO_THREAD_NAME_WINDOWS_CONSTANT (name), \ + (flags) | MonoSetThreadNameFlag_Constant, NULL) void mono_thread_suspend_all_other_threads (void); gboolean mono_threads_abort_appdomain_threads (MonoDomain *domain, int timeout); @@ -377,7 +385,17 @@ MonoExceptionHandle mono_thread_interruption_checkpoint_handle (void); MonoException* mono_thread_force_interruption_checkpoint_noraise (void); -gint32* mono_thread_interruption_request_flag (void); + +/** + * mono_thread_interruption_request_flag: + * + * A flag that will be non-zero if an interruption has + * been requested for a thread. The thread to interrupt may not be the current + * thread, so an additional call to mono_thread_interruption_requested () or + * mono_thread_interruption_checkpoint () is always needed if the flag is not + * zero. + */ +extern gint32 mono_thread_interruption_request_flag; uint32_t mono_alloc_special_static_data (uint32_t static_type, uint32_t size, uint32_t align, uintptr_t *bitmap, int numbits); void* mono_get_special_static_data (uint32_t offset); @@ -405,9 +423,6 @@ void mono_threads_add_joinable_thread (gpointer tid); void mono_threads_join_threads (void); void mono_thread_join (gpointer tid); -ICALL_EXPORT -void ves_icall_System_Threading_Thread_GetStackTraces (MonoArray **out_threads, MonoArray **out_stack_traces); - MONO_API gpointer mono_threads_attach_coop (MonoDomain *domain, gpointer *dummy); @@ -541,7 +556,7 @@ typedef struct { } MonoThreadSummary; void -mono_threads_summarize_init (const char *timeline_dir); +mono_threads_summarize_init (void); gboolean mono_threads_summarize (MonoContext *ctx, gchar **out, MonoStackHash *hashes, gboolean silent, gboolean signal_handler_controller, gchar *mem, size_t provided_size); diff --git a/mono/metadata/threads.c.REMOVED.git-id b/mono/metadata/threads.c.REMOVED.git-id index f6883da536..f9e772c840 100644 --- a/mono/metadata/threads.c.REMOVED.git-id +++ b/mono/metadata/threads.c.REMOVED.git-id @@ -1 +1 @@ -a3d7bdfd75812369831f8d78ffcc8ad3a0643367 \ No newline at end of file +6183c9591fe7e8ffa7f3d9705fd2e00de952aad8 \ No newline at end of file diff --git a/mono/metadata/threads.h b/mono/metadata/threads.h index 65020eb039..b1b9103cd3 100644 --- a/mono/metadata/threads.h +++ b/mono/metadata/threads.h @@ -24,7 +24,8 @@ typedef mono_bool (*MonoThreadManageCallback) (MonoThread* thread); MONO_API void mono_thread_init (MonoThreadStartCB start_cb, MonoThreadAttachCB attach_cb); MONO_API void mono_thread_cleanup (void); -MONO_API void mono_thread_manage(void); +MONO_API MONO_RT_EXTERNAL_ONLY +void mono_thread_manage(void); MONO_API MonoThread *mono_thread_current (void); @@ -43,6 +44,9 @@ MONO_API MonoThread *mono_thread_attach (MonoDomain *domain); MONO_API void mono_thread_detach (MonoThread *thread); MONO_API void mono_thread_exit (void); +MONO_API MONO_RT_EXTERNAL_ONLY void +mono_threads_attach_tools_thread (void); + MONO_API char *mono_thread_get_name_utf8 (MonoThread *thread); MONO_API int32_t mono_thread_get_managed_id (MonoThread *thread); diff --git a/mono/metadata/verify.c.REMOVED.git-id b/mono/metadata/verify.c.REMOVED.git-id index 859f8facfe..2697e35fef 100644 --- a/mono/metadata/verify.c.REMOVED.git-id +++ b/mono/metadata/verify.c.REMOVED.git-id @@ -1 +1 @@ -4e5bbc8f82a58e8a222d50a6d963aad863ac9c18 \ No newline at end of file +768de3da9de6f0413e202628dab49667d09c2d5d \ No newline at end of file diff --git a/mono/metadata/w32event-unix.c b/mono/metadata/w32event-unix.c index 4d38307ac2..abc9bf98b2 100644 --- a/mono/metadata/w32event-unix.c +++ b/mono/metadata/w32event-unix.c @@ -378,6 +378,7 @@ ves_icall_System_Threading_Events_CloseEvent_internal (gpointer handle) mono_w32handle_close (handle); } +#ifndef ENABLE_NETCORE gpointer ves_icall_System_Threading_Events_OpenEvent_icall (const gunichar2 *name, gint32 name_length, gint32 rights, gint32 *win32error, MonoError *error) @@ -389,6 +390,7 @@ ves_icall_System_Threading_Events_OpenEvent_icall (const gunichar2 *name, gint32 g_free (utf8_name); return handle; } +#endif gpointer mono_w32event_open (const gchar *utf8_name, gint32 rights G_GNUC_UNUSED, gint32 *win32error) diff --git a/mono/metadata/w32file-unix.c.REMOVED.git-id b/mono/metadata/w32file-unix.c.REMOVED.git-id index c5e2516a21..db8cd3b095 100644 --- a/mono/metadata/w32file-unix.c.REMOVED.git-id +++ b/mono/metadata/w32file-unix.c.REMOVED.git-id @@ -1 +1 @@ -2fbc74f5986c6429c5ca8c95cc927c03f5542049 \ No newline at end of file +4203e154ab2239c657b58879a64c497b630ff8b9 \ No newline at end of file diff --git a/mono/metadata/w32handle.c b/mono/metadata/w32handle.c index ac3efe9ef9..c7077aac85 100644 --- a/mono/metadata/w32handle.c +++ b/mono/metadata/w32handle.c @@ -922,7 +922,7 @@ mono_w32handle_has_duplicates (MonoW32Handle *handles [ ], gsize nhandles) MonoW32Handle *sorted [MONO_W32HANDLE_MAXIMUM_WAIT_OBJECTS]; // 64 memcpy (sorted, handles, nhandles * sizeof (handles[0])); - qsort (sorted, nhandles, sizeof (sorted [0]), g_direct_equal); + mono_qsort (sorted, nhandles, sizeof (sorted [0]), g_direct_equal); for (gsize i = 1; i < nhandles; ++i) { MonoW32Handle * const h1 = sorted [i - 1]; MonoW32Handle * const h2 = sorted [i]; diff --git a/mono/metadata/w32process-unix.c.REMOVED.git-id b/mono/metadata/w32process-unix.c.REMOVED.git-id index c5dadf5ba3..f3f6dc2b31 100644 --- a/mono/metadata/w32process-unix.c.REMOVED.git-id +++ b/mono/metadata/w32process-unix.c.REMOVED.git-id @@ -1 +1 @@ -db08857be64d0dffe6c0411262bafae3559f59e0 \ No newline at end of file +1713237f1ab2b296e471681b8cbd1b065922ed7c \ No newline at end of file diff --git a/mono/metadata/w32process-win32.c b/mono/metadata/w32process-win32.c index ba6555df1c..95c1b10a39 100644 --- a/mono/metadata/w32process-win32.c +++ b/mono/metadata/w32process-win32.c @@ -198,48 +198,22 @@ process_quote_path (const gchar *path) } /* Only used when UseShellExecute is false */ -static gboolean -process_complete_path (const gunichar2 *appname, gchar **completed) +static gchar* +process_complete_path (const gunichar2 *appname) { // FIXME This function should stick to gunichar2. char *utf8app; char *utf8appmemory = NULL; - char *found = NULL; - gboolean result, file_test_result; + char *result; utf8appmemory = g_utf16_to_utf8 (appname, -1, NULL, NULL, NULL); utf8app = process_unquote_application_name (utf8appmemory); - if (g_path_is_absolute (utf8app)) { - *completed = process_quote_path (utf8app); - result = TRUE; - goto exit; - } + result = process_quote_path (utf8app); - MONO_ENTER_GC_SAFE; - file_test_result = g_file_test (utf8app, G_FILE_TEST_IS_EXECUTABLE) && !g_file_test (utf8app, G_FILE_TEST_IS_DIR); - MONO_EXIT_GC_SAFE; - if (file_test_result) { - *completed = process_quote_path (utf8app); - result = TRUE; - goto exit; - } - - MONO_ENTER_GC_SAFE; - found = g_find_program_in_path (utf8app); - MONO_EXIT_GC_SAFE; - if (found == NULL) { - *completed = NULL; - result = FALSE; - goto exit; - } - - *completed = process_quote_path (found); - result = TRUE; -exit: - g_free (found); g_free (utf8appmemory); + return result; } @@ -256,20 +230,20 @@ process_get_shell_arguments (MonoCreateProcessCoop *proc_start_info, MonoStringH // We are either returning spath, or spath + " " + cmd. // Just use gunichar2. Maybe move logic to C#. - if (process_complete_path (proc_start_info->filename, &spath)) { - /* Seems like our CreateProcess does not work as the windows one. - * This hack is needed to deal with paths containing spaces */ - if (!MONO_HANDLE_IS_NULL (*cmd)) { - cmd_utf8 = mono_string_handle_to_utf8 (*cmd, error); - goto_if_nok (error, error); - new_cmd = g_strdup_printf ("%s %s", spath, cmd_utf8); - *cmd = mono_string_new_utf8_len (mono_domain_get (), new_cmd, strlen (new_cmd), error); - goto_if_nok (error, error); - } - else { - *cmd = mono_string_new_utf8_len (mono_domain_get (), spath, strlen (spath), error); - goto_if_nok (error, error); - } + spath = process_complete_path (proc_start_info->filename); + + /* Seems like our CreateProcess does not work as the windows one. + * This hack is needed to deal with paths containing spaces */ + if (!MONO_HANDLE_IS_NULL (*cmd)) { + cmd_utf8 = mono_string_handle_to_utf8 (*cmd, error); + goto_if_nok (error, error); + new_cmd = g_strdup_printf ("%s %s", spath, cmd_utf8); + *cmd = mono_string_new_utf8_len (mono_domain_get (), new_cmd, strlen (new_cmd), error); + goto_if_nok (error, error); + } + else { + *cmd = mono_string_new_utf8_len (mono_domain_get (), spath, strlen (spath), error); + goto_if_nok (error, error); } exit: diff --git a/mono/metadata/w32process.c b/mono/metadata/w32process.c index ebf1cd1123..ea7fb03802 100644 --- a/mono/metadata/w32process.c +++ b/mono/metadata/w32process.c @@ -423,6 +423,7 @@ cleanup: #endif // G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT) +#ifndef ENABLE_NETCORE void ves_icall_System_Diagnostics_FileVersionInfo_GetVersionInfo_internal (MonoObjectHandle this_obj, const gunichar2 *filename, int filename_length, MonoError *error) @@ -436,6 +437,7 @@ ves_icall_System_Diagnostics_FileVersionInfo_GetVersionInfo_internal (MonoObject process_set_field_utf16 (this_obj, str, "filename", filename, filename_length, error); } +#endif #if G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT) @@ -551,6 +553,7 @@ exit: HANDLE_FUNCTION_RETURN (); } +#ifndef ENABLE_NETCORE /* Returns an array of System.Diagnostics.ProcessModule */ MonoArrayHandle ves_icall_System_Diagnostics_Process_GetModules_internal (MonoObjectHandle this_obj, HANDLE process, MonoError *error) @@ -649,6 +652,7 @@ ves_icall_System_Diagnostics_Process_ProcessName_internal (HANDLE process, MonoE g_free (name); return res; } +#endif /* ENABLE_NETCORE */ #endif // G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT) && defined(HOST_WIN32) diff --git a/mono/metadata/w32socket-unix.c b/mono/metadata/w32socket-unix.c index 394cfdbaae..bd5baf36f7 100644 --- a/mono/metadata/w32socket-unix.c +++ b/mono/metadata/w32socket-unix.c @@ -1555,6 +1555,7 @@ mono_w32socket_convert_error (gint error) } } +#ifndef ENABLE_NETCORE MonoBoolean ves_icall_System_Net_Sockets_Socket_SupportPortReuse (MonoProtocolType proto, MonoError *error) { @@ -1570,6 +1571,7 @@ ves_icall_System_Net_Sockets_Socket_SupportPortReuse (MonoProtocolType proto, Mo return FALSE; #endif } +#endif gboolean mono_w32socket_duplicate (gpointer handle, gint32 targetProcessId, gpointer *duplicate_handle) diff --git a/mono/metadata/w32socket.c b/mono/metadata/w32socket.c index 0f6b0b89aa..cecb93d94e 100644 --- a/mono/metadata/w32socket.c +++ b/mono/metadata/w32socket.c @@ -16,7 +16,9 @@ #include -#ifndef DISABLE_SOCKETS +#include + +#if !defined(DISABLE_SOCKETS) && !defined(ENABLE_NETCORE) #if defined(__APPLE__) || defined(__FreeBSD__) #define __APPLE_USE_RFC_3542 @@ -66,7 +68,6 @@ #include #include #include -#include #include #include @@ -721,11 +722,12 @@ get_socket_assembly (void) if (domain->socket_assembly == NULL) { MonoImage *socket_assembly; + MonoAssemblyLoadContext *alc = mono_domain_default_alc (domain); - socket_assembly = mono_image_loaded_internal (mono_domain_default_alc (domain), "System", FALSE); + socket_assembly = mono_image_loaded_internal (alc, "System", FALSE); if (!socket_assembly) { MonoAssemblyOpenRequest req; - mono_assembly_request_prepare (&req.request, sizeof (req), MONO_ASMCTX_DEFAULT); + mono_assembly_request_prepare_open (&req, MONO_ASMCTX_DEFAULT, alc); MonoAssembly *sa = mono_assembly_request_open ("System.dll", &req, NULL); if (!sa) { @@ -740,6 +742,7 @@ get_socket_assembly (void) return domain->socket_assembly; } +#ifndef ENABLE_NETCORE gpointer ves_icall_System_Net_Sockets_Socket_Socket_internal (MonoObjectHandle this_obj, gint32 family, gint32 type, gint32 proto, gint32 *werror, MonoError *error) { @@ -796,6 +799,7 @@ ves_icall_System_Net_Sockets_Socket_Close_internal (gsize sock, gint32 *werror, mono_w32socket_close ((SOCKET) sock); } +#endif gint32 ves_icall_System_Net_Sockets_SocketException_WSAGetLastError_internal (void) @@ -805,6 +809,7 @@ ves_icall_System_Net_Sockets_SocketException_WSAGetLastError_internal (void) return mono_w32socket_get_last_error (); } +#ifndef ENABLE_NETCORE gint32 ves_icall_System_Net_Sockets_Socket_Available_internal (gsize sock, gint32 *werror, MonoError *error) { @@ -866,6 +871,7 @@ ves_icall_System_Net_Sockets_Socket_Listen_internal(gsize sock, guint32 backlog, if (ret == SOCKET_ERROR) *werror = mono_w32socket_get_last_error (); } +#endif #ifdef HAVE_STRUCT_SOCKADDR_IN6 // Check whether it's ::ffff::0:0. @@ -1080,6 +1086,7 @@ exit: return result; } +#ifndef ENABLE_NETCORE MonoObjectHandle ves_icall_System_Net_Sockets_Socket_LocalEndPoint_internal (gsize sock, gint32 af, gint32 *werror, MonoError *error) { @@ -1091,6 +1098,7 @@ ves_icall_System_Net_Sockets_Socket_RemoteEndPoint_internal (gsize sock, gint32 { return mono_w32socket_getname (sock, af, FALSE, werror, error); } +#endif static struct sockaddr* create_sockaddr_from_handle (MonoObjectHandle saddr_obj, socklen_t *sa_size, gint32 *werror, MonoError *error) @@ -1217,6 +1225,7 @@ create_sockaddr_from_handle (MonoObjectHandle saddr_obj, socklen_t *sa_size, gin } } +#ifndef ENABLE_NETCORE void ves_icall_System_Net_Sockets_Socket_Bind_internal (gsize sock, MonoObjectHandle sockaddr, gint32 *werror, MonoError *error) { @@ -1555,6 +1564,7 @@ ves_icall_System_Net_Sockets_Socket_SendTo_internal (gsize sock, gchar *buffer, g_free(sa); return ret; } +#endif /* ENABLE_NETCORE */ static SOCKET Socket_to_SOCKET (MonoObjectHandle sockobj) @@ -1625,6 +1635,7 @@ leave: HANDLE_FUNCTION_RETURN (); } +#ifndef ENABLE_NETCORE void ves_icall_System_Net_Sockets_Socket_Select_internal (MonoArrayHandleOut sockets, gint32 timeout, gint32 *werror, MonoError *error) { @@ -1849,10 +1860,11 @@ ves_icall_System_Net_Sockets_Socket_GetSocketOption_obj_internal (gsize sock, gi static MonoImage *mono_posix_image = NULL; if (mono_posix_image == NULL) { - mono_posix_image = mono_image_loaded_internal (mono_domain_default_alc (domain), "Mono.Posix", FALSE); + MonoAssemblyLoadContext *alc = mono_domain_default_alc (domain); + mono_posix_image = mono_image_loaded_internal (alc, "Mono.Posix", FALSE); if (!mono_posix_image) { MonoAssemblyOpenRequest req; - mono_assembly_request_prepare (&req.request, sizeof (req), MONO_ASMCTX_DEFAULT); + mono_assembly_request_prepare_open (&req, MONO_ASMCTX_DEFAULT, alc); MonoAssembly *sa = mono_assembly_request_open ("Mono.Posix.dll", &req, NULL); if (!sa) { *werror = WSAENOPROTOOPT; @@ -1890,7 +1902,6 @@ ves_icall_System_Net_Sockets_Socket_GetSocketOption_obj_internal (gsize sock, gi } } } - void ves_icall_System_Net_Sockets_Socket_GetSocketOption_arr_internal (gsize sock, gint32 level, gint32 name, MonoArrayHandle byte_val, gint32 *werror, MonoError *error) { @@ -1923,6 +1934,7 @@ ves_icall_System_Net_Sockets_Socket_GetSocketOption_arr_internal (gsize sock, gi if (ret == SOCKET_ERROR) *werror = mono_w32socket_get_last_error (); } +#endif #if defined(HAVE_STRUCT_IP_MREQN) || defined(HAVE_STRUCT_IP_MREQ) static struct in_addr @@ -1973,8 +1985,8 @@ ipaddress_handle_to_struct_in6_addr (MonoObjectHandle ipaddr) #endif #endif +#ifdef HAVE_STRUCT_SOCKADDR_IN6 #if defined(__APPLE__) || defined(__FreeBSD__) - static int get_local_interface_id (int family) { @@ -2005,9 +2017,10 @@ get_local_interface_id (int family) return idx; #endif } - #endif /* defined(__APPLE__) || defined(__FreeBSD__) */ +#endif /* HAVE_STRUCT_SOCKADDR_IN6 */ +#ifndef ENABLE_NETCORE void ves_icall_System_Net_Sockets_Socket_SetSocketOption_internal (gsize sock, gint32 level, gint32 name, MonoObjectHandle obj_val, MonoArrayHandle byte_val, gint32 int_val, gint32 *werror, MonoError *error) { @@ -2308,6 +2321,7 @@ ves_icall_System_Net_Sockets_Socket_IOControl_internal (gsize sock, gint32 code, return (gint)output_bytes; } +#endif static gboolean addrinfo_add_string (MonoDomain *domain, const char *s, MonoArrayHandle arr, int index, MonoError *error) @@ -2441,6 +2455,7 @@ leave: HANDLE_FUNCTION_RETURN_VAL (is_ok (error)); } +#ifndef ENABLE_NETCORE MonoBoolean ves_icall_System_Net_Dns_GetHostByName_internal (MonoStringHandle host, MonoStringHandleOut h_name, MonoArrayHandleOut h_aliases, MonoArrayHandleOut h_addr_list, gint32 hint, MonoError *error) { @@ -2627,6 +2642,7 @@ ves_icall_System_Net_Sockets_Socket_SendFile_internal (gsize sock, MonoStringHan return ret; } #endif /* G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT | HAVE_UWP_WINAPI_SUPPORT) */ +#endif /* ENABLE_NETCORE */ void mono_network_init (void) @@ -2642,6 +2658,7 @@ mono_network_cleanup (void) mono_networking_shutdown (); } +#ifndef ENABLE_NETCORE void ves_icall_cancel_blocking_socket_operation (MonoThreadObjectHandle thread, MonoError *error) { @@ -2652,5 +2669,18 @@ ves_icall_cancel_blocking_socket_operation (MonoThreadObjectHandle thread, MonoE guint64 tid = mono_internal_thread_handle_ptr (internal)->tid; mono_thread_info_abort_socket_syscall_for_close (MONO_UINT_TO_NATIVE_THREAD_ID (tid)); } +#endif + +#else + +void +mono_network_init (void) +{ +} + +void +mono_network_cleanup (void) +{ +} #endif /* #ifndef DISABLE_SOCKETS */ diff --git a/mono/metadata/w32subset.h b/mono/metadata/w32subset.h index d2035bd9d4..7cfdcab9e8 100644 --- a/mono/metadata/w32subset.h +++ b/mono/metadata/w32subset.h @@ -211,14 +211,6 @@ #endif #endif -#ifndef HAVE_LOADLIBRARY -#if G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT) -#define HAVE_LOADLIBRARY 1 -#else -#define HAVE_LOADLIBRARY 0 -#endif -#endif - #ifndef HAVE_SET_THREAD_DESCRIPTION #define HAVE_SET_THREAD_DESCRIPTION 0 #endif diff --git a/mono/mini/Makefile.am b/mono/mini/Makefile.am index 1160c07df9..5f530661df 100644 --- a/mono/mini/Makefile.am +++ b/mono/mini/Makefile.am @@ -16,6 +16,8 @@ else PLATFORM_PATH_SEPARATOR=: endif +if !ENABLE_MSVC_ONLY + # This is needed for automake dependency generation if SUPPORT_NULLGC libgc_libs= @@ -52,6 +54,7 @@ $(mono_build_root)/llvm/llvm_config.mk: endif +endif # !ENABLE_MSVC_ONLY if FULL_AOT_TESTS # if the tests are going to run with framework assemblies compiled with @@ -71,9 +74,11 @@ TOOLS_RUNTIME = MONO_PATH=$(mcs_topdir)/class/lib/build $(top_builddir)/runtime/ INTERP_RUNTIME = $(MINI_RUNTIME) --interpreter RUNTIME_AOTCHECK = MONO_PATH="$(CLASS)$(PLATFORM_PATH_SEPARATOR)." $(RUNTIME_EXECUTABLE) -MCS = CSC_SDK_PATH_DISABLED= $(TOOLS_RUNTIME) --clr-memory-model $(CSC) -langversion:7.2 -nostdlib -unsafe -nowarn:0162 -nologo -noconfig -r:$(CLASS)/mscorlib.dll -r:$(CLASS)/System.dll -r:$(CLASS)/System.Core.dll +MCS = CSC_SDK_PATH_DISABLED= $(TOOLS_RUNTIME) $(CSC) -langversion:7.2 -nostdlib -unsafe -nowarn:0162 -nologo -noconfig -r:$(CLASS)/mscorlib.dll -r:$(CLASS)/System.dll -r:$(CLASS)/System.Core.dll ILASM = $(TOOLS_RUNTIME) $(mcs_topdir)/class/lib/build/ilasm.exe +if !ENABLE_MSVC_ONLY + AM_CFLAGS = \ -I$(top_srcdir) \ $(GLIB_CFLAGS) \ @@ -81,7 +86,7 @@ AM_CFLAGS = \ $(JEMALLOC_CFLAGS) \ $(PLATFORM_CFLAGS) $(ARCH_CFLAGS) $(SHARED_CFLAGS) -AM_CXXFLAGS = $(LLVM_CXXFLAGS) $(GLIB_CFLAGS) +AM_CXXFLAGS = -I$(top_srcdir) $(LLVM_CXXFLAGS) $(GLIB_CFLAGS) if HOST_WIN32 export HOST_CC @@ -115,6 +120,8 @@ boehm_static_libraries = libmini.la $(interp_libs_with_mini) $(dbg_libs_with_min boehm_binaries = mono-boehm endif +endif # !ENABLE_MSVC_ONLY + if SUPPORT_SGEN mono_bin_suffix = sgen libmono_suffix = sgen @@ -125,17 +132,39 @@ endif if DISABLE_EXECUTABLES else +if !ENABLE_MSVC_ONLY mono: mono-$(mono_bin_suffix) ln -sf $< $@ mono.exe: mono-$(mono_bin_suffix).exe ln -sf $< $@ +else # !ENABLE_MSVC_ONLY +.PHONY: mono +mono: + make -C $(top_srcdir)/msvc mono + ln -sf $(mono_msvc_build_bin_dir)/mono-$(mono_bin_suffix)$(EXEEXT) ./mono.exe +if SUPPORT_SGEN + ln -sf $(mono_msvc_build_bin_dir)/mono-$(mono_bin_suffix)$(EXEEXT) ./mono-sgen.exe +endif + +mono.exe: mono + +monow.exe: mono + +all-local: mono + +clean-mono: + make -C $(top_srcdir)/msvc clean-mono + +endif # !ENABLE_MSVC_ONLY install-exec-hook: (cd $(DESTDIR)$(bindir) && ln -sf mono-$(mono_bin_suffix)$(EXEEXT) mono$(EXEEXT)) (cd $(DESTDIR)$(libdir); shopt -s nullglob 2>/dev/null; for i in libmono$(libmono_suffix)*; do ln -sf $$i `echo $$i | sed s/$(libmono_suffix)//` ; done) endif +if !ENABLE_MSVC_ONLY + if DISABLE_EXECUTABLES else if HOST_WIN32 @@ -483,9 +512,11 @@ common_sources = \ branch-opts.c \ mini-generic-sharing.c \ simd-methods.h \ + simd-methods-netcore.h \ tasklets.c \ tasklets.h \ simd-intrinsics.c \ + simd-intrinsics-netcore.c \ mini-native-types.c \ mini-unwind.h \ unwind.c \ @@ -521,6 +552,8 @@ common_sources = \ ee.h \ mini-runtime.h +endif # !ENABLE_MSVC_ONLY + # keep in sync with mcs/class/Mono.Runtime.Tests test_sources = \ basic-calls.cs \ @@ -576,6 +609,8 @@ endif regtests = $(filter-out $(regtests_DISABLED),$(regtests_UNIVERSAL)) +if !ENABLE_MSVC_ONLY + if WASM arch_sources = $(wasm_sources) arch_built=cpu-wasm.h @@ -691,7 +726,7 @@ libmonoldflags += $(JEMALLOC_LDFLAGS) endif libmono_ee_interp_la_SOURCES = $(interp_sources) -libmono_ee_interp_la_CFLAGS = $(AM_CFLAGS) @CXX_ADD_CFLAGS@ +libmono_ee_interp_la_CFLAGS = $(AM_CFLAGS) @CXX_ADD_CFLAGS@ $(INTERP_CFLAGS) if BITCODE libmono_ee_interp_la_LDFLAGS = $(libmonoldflags) if DISABLE_INTERPRETER @@ -741,6 +776,8 @@ libmonosgen_2_0_la_CFLAGS = $(mono_sgen_CFLAGS) @CXX_ADD_CFLAGS@ libmonosgen_2_0_la_LIBADD = libmini.la $(interp_libs_with_mini) $(dbg_libs_with_mini) $(sgen_libs) $(LIBMONO_DTRACE_OBJECT) $(LLVMMONOF) libmonosgen_2_0_la_LDFLAGS = $(libmonoldflags) $(monobin_platform_ldflags) +endif # !ENABLE_MSVC_ONLY + libmonoincludedir = $(includedir)/mono-$(API_VER)/mono/jit # These are public headers. @@ -882,17 +919,17 @@ gctest: mono gc-test.exe LLVM_AOT_RUNTIME_OPTS=$(if $(LLVM),--llvm,) if AMD64 -LLVM_AOT_COMPILER_OPTS=$(if $(LLVM),"=llvmllc=-mcpu=generic -mattr=+sse3",) +LLVM_AOT_COMPILER_OPTS=$(if $(LLVM),llvmllc=-mattr=+sse3,) else LLVM_AOT_COMPILER_OPTS= endif GSHAREDVT_RUNTIME_OPTS=$(if $(GSHAREDVT),-O=gsharedvt,) aotcheck: mono $(regtests) - rm -rf *.exe.so *.exe.dylib *.exe.dylib.dSYM - $(MINI_RUNTIME) $(LLVM_AOT_RUNTIME_OPTS) --aot$(LLVM_AOT_COMPILER_OPTS) $(regtests) || exit 1 + rm -rf *.exe.so *.exe.dylib *.exe.dylib.dSYM *.exe.dll + $(MINI_RUNTIME) $(LLVM_AOT_RUNTIME_OPTS) --aot="$(LLVM_AOT_COMPILER_OPTS)" $(regtests) || exit 1 for i in $(regtests); do $(RUNTIME_AOTCHECK) --regression $$i || exit 1; done - rm -rf *.exe.so *.exe.dylib *.exe.dylib.dSYM + rm -rf *.exe.so *.exe.dylib *.exe.dylib.dSYM *.exe.dll llvmaotcheck: $(MAKE) aotcheck LLVM=1 @@ -944,6 +981,12 @@ endif FULLAOT_LIBS = $(filter-out $(FULLAOT_LIBS_DISABLED),$(FULLAOT_LIBS_UNIVERSAL)) FULLAOT_TMP_DIR=$(top_builddir)/mono/mini/fullaot-tmp +if FULL_AOT_TESTS +# use the available testing profile +FULLAOT_MONO_PATH=$(CLASS) +else +FULLAOT_MONO_PATH=$(FULLAOT_TMP_DIR) +endif FULLAOT_AOT_ARGS=$(if $(HYBRID),hybrid,full,interp),$(MONO_FULLAOT_ADDITIONAL_ARGS)$(INVARIANT_AOT_OPTIONS) FULLAOT_ARGS=$(if $(HYBRID),--hybrid-aot,--full-aot) @@ -952,12 +995,14 @@ FULLAOT_ARGS=$(if $(HYBRID),--hybrid-aot,--full-aot) fullaotcheck: $(mono) $(fullaot_regtests) $(fullaot_testing_deps) rm -rf $(FULLAOT_TMP_DIR) mkdir $(FULLAOT_TMP_DIR) +if !FULL_AOT_TESTS $(MAKE) fullaot-libs AOT_FLAGS="$(FULLAOT_AOT_ARGS)" +endif cp $(fullaot_regtests) $(fullaot_testing_deps) $(FULLAOT_TMP_DIR)/ - MONO_PATH=$(FULLAOT_TMP_DIR) $(top_builddir)/runtime/mono-wrapper $(MOBILE_RUNTIME_ARG) $(LLVM_AOT_RUNTIME_OPTS) $(GSHAREDVT_RUNTIME_OPTS) --aot="$(FULLAOT_AOT_ARGS)" $(FULLAOT_TMP_DIR)/{$(fullaot_testing_deps_commas),*.exe} || exit 1 + MONO_PATH=$(FULLAOT_MONO_PATH) $(top_builddir)/runtime/mono-wrapper $(MOBILE_RUNTIME_ARG) $(LLVM_AOT_RUNTIME_OPTS) $(GSHAREDVT_RUNTIME_OPTS) --aot="$(FULLAOT_AOT_ARGS),$(LLVM_AOT_COMPILER_OPTS)" $(FULLAOT_TMP_DIR)/{$(fullaot_testing_deps_commas),*.exe} || exit 1 ln -s $(if $(MONO_EXECUTABLE),$(MONO_EXECUTABLE),$$PWD/mono) $(FULLAOT_TMP_DIR)/ - for i in $(fullaot_regtests); do echo $$i; MONO_PATH=$(FULLAOT_TMP_DIR) $(top_builddir)/runtime/mono-wrapper $(MOBILE_RUNTIME_ARG) $(FULLAOT_ARGS) $(FULLAOT_TMP_DIR)/$$i --exclude '!FULLAOT' $(ARCH_FULLAOT_EXCLUDE) || exit 1; done - if test x$(MIXED) == x1; then failed=0;i=0; while test $$i -lt 900; do i=`expr $$i + 1`; bash -c "echo -n '.'"; MONO_PATH=$(FULLAOT_TMP_DIR) MONO_DEBUG=aot-skip=$$i $(top_builddir)/runtime/mono-wrapper --full-aot-interp $(FULLAOT_TMP_DIR)/basic.exe > $(FULLAOT_TMP_DIR)/mixed.log || failed=1; if test $$failed -eq 1; then echo "Failed at $$i"; exit $$failed; fi; done; fi + for i in $(fullaot_regtests); do echo $$i; MONO_PATH=$(FULLAOT_MONO_PATH) $(top_builddir)/runtime/mono-wrapper $(MOBILE_RUNTIME_ARG) $(FULLAOT_ARGS) $(FULLAOT_TMP_DIR)/$$i --exclude '!FULLAOT' $(ARCH_FULLAOT_EXCLUDE) || exit 1; done + if test x$(MIXED) == x1; then failed=0;i=0; while test $$i -lt 900; do i=`expr $$i + 1`; bash -c "echo -n '.'"; MONO_PATH=$(FULLAOT_MONO_PATH) MONO_DEBUG=aot-skip=$$i $(top_builddir)/runtime/mono-wrapper --full-aot-interp $(FULLAOT_TMP_DIR)/basic.exe > $(FULLAOT_TMP_DIR)/mixed.log || failed=1; if test $$failed -eq 1; then echo "Failed at $$i"; exit $$failed; fi; done; fi # This can run in parallel fullaot-libs: $(patsubst %,fullaot-tmp/%.dylib,$(FULLAOT_LIBS)) @@ -1012,7 +1057,7 @@ check_local_targets = $(if $(EMIT_NUNIT), rcheck-nunit, rcheck) check-local: $(check_local_targets) clean-local: - rm -f mono a.out gmon.out *.o buildver-boehm.h buildver-sgen.h test.exe regressionexitcode.out TestResult-op_il_seq_point.xml* + rm -f mono mono.exe monow.exe mono-sgen.exe a.out gmon.out *.o buildver-boehm.h buildver-sgen.h test.exe regressionexitcode.out TestResult-op_il_seq_point.xml* pkgconfigdir = $(libdir)/pkgconfig diff --git a/mono/mini/Makefile.am.in b/mono/mini/Makefile.am.in index 1160c07df9..5f530661df 100755 --- a/mono/mini/Makefile.am.in +++ b/mono/mini/Makefile.am.in @@ -16,6 +16,8 @@ else PLATFORM_PATH_SEPARATOR=: endif +if !ENABLE_MSVC_ONLY + # This is needed for automake dependency generation if SUPPORT_NULLGC libgc_libs= @@ -52,6 +54,7 @@ $(mono_build_root)/llvm/llvm_config.mk: endif +endif # !ENABLE_MSVC_ONLY if FULL_AOT_TESTS # if the tests are going to run with framework assemblies compiled with @@ -71,9 +74,11 @@ TOOLS_RUNTIME = MONO_PATH=$(mcs_topdir)/class/lib/build $(top_builddir)/runtime/ INTERP_RUNTIME = $(MINI_RUNTIME) --interpreter RUNTIME_AOTCHECK = MONO_PATH="$(CLASS)$(PLATFORM_PATH_SEPARATOR)." $(RUNTIME_EXECUTABLE) -MCS = CSC_SDK_PATH_DISABLED= $(TOOLS_RUNTIME) --clr-memory-model $(CSC) -langversion:7.2 -nostdlib -unsafe -nowarn:0162 -nologo -noconfig -r:$(CLASS)/mscorlib.dll -r:$(CLASS)/System.dll -r:$(CLASS)/System.Core.dll +MCS = CSC_SDK_PATH_DISABLED= $(TOOLS_RUNTIME) $(CSC) -langversion:7.2 -nostdlib -unsafe -nowarn:0162 -nologo -noconfig -r:$(CLASS)/mscorlib.dll -r:$(CLASS)/System.dll -r:$(CLASS)/System.Core.dll ILASM = $(TOOLS_RUNTIME) $(mcs_topdir)/class/lib/build/ilasm.exe +if !ENABLE_MSVC_ONLY + AM_CFLAGS = \ -I$(top_srcdir) \ $(GLIB_CFLAGS) \ @@ -81,7 +86,7 @@ AM_CFLAGS = \ $(JEMALLOC_CFLAGS) \ $(PLATFORM_CFLAGS) $(ARCH_CFLAGS) $(SHARED_CFLAGS) -AM_CXXFLAGS = $(LLVM_CXXFLAGS) $(GLIB_CFLAGS) +AM_CXXFLAGS = -I$(top_srcdir) $(LLVM_CXXFLAGS) $(GLIB_CFLAGS) if HOST_WIN32 export HOST_CC @@ -115,6 +120,8 @@ boehm_static_libraries = libmini.la $(interp_libs_with_mini) $(dbg_libs_with_min boehm_binaries = mono-boehm endif +endif # !ENABLE_MSVC_ONLY + if SUPPORT_SGEN mono_bin_suffix = sgen libmono_suffix = sgen @@ -125,17 +132,39 @@ endif if DISABLE_EXECUTABLES else +if !ENABLE_MSVC_ONLY mono: mono-$(mono_bin_suffix) ln -sf $< $@ mono.exe: mono-$(mono_bin_suffix).exe ln -sf $< $@ +else # !ENABLE_MSVC_ONLY +.PHONY: mono +mono: + make -C $(top_srcdir)/msvc mono + ln -sf $(mono_msvc_build_bin_dir)/mono-$(mono_bin_suffix)$(EXEEXT) ./mono.exe +if SUPPORT_SGEN + ln -sf $(mono_msvc_build_bin_dir)/mono-$(mono_bin_suffix)$(EXEEXT) ./mono-sgen.exe +endif + +mono.exe: mono + +monow.exe: mono + +all-local: mono + +clean-mono: + make -C $(top_srcdir)/msvc clean-mono + +endif # !ENABLE_MSVC_ONLY install-exec-hook: (cd $(DESTDIR)$(bindir) && ln -sf mono-$(mono_bin_suffix)$(EXEEXT) mono$(EXEEXT)) (cd $(DESTDIR)$(libdir); shopt -s nullglob 2>/dev/null; for i in libmono$(libmono_suffix)*; do ln -sf $$i `echo $$i | sed s/$(libmono_suffix)//` ; done) endif +if !ENABLE_MSVC_ONLY + if DISABLE_EXECUTABLES else if HOST_WIN32 @@ -483,9 +512,11 @@ common_sources = \ branch-opts.c \ mini-generic-sharing.c \ simd-methods.h \ + simd-methods-netcore.h \ tasklets.c \ tasklets.h \ simd-intrinsics.c \ + simd-intrinsics-netcore.c \ mini-native-types.c \ mini-unwind.h \ unwind.c \ @@ -521,6 +552,8 @@ common_sources = \ ee.h \ mini-runtime.h +endif # !ENABLE_MSVC_ONLY + # keep in sync with mcs/class/Mono.Runtime.Tests test_sources = \ basic-calls.cs \ @@ -576,6 +609,8 @@ endif regtests = $(filter-out $(regtests_DISABLED),$(regtests_UNIVERSAL)) +if !ENABLE_MSVC_ONLY + if WASM arch_sources = $(wasm_sources) arch_built=cpu-wasm.h @@ -691,7 +726,7 @@ libmonoldflags += $(JEMALLOC_LDFLAGS) endif libmono_ee_interp_la_SOURCES = $(interp_sources) -libmono_ee_interp_la_CFLAGS = $(AM_CFLAGS) @CXX_ADD_CFLAGS@ +libmono_ee_interp_la_CFLAGS = $(AM_CFLAGS) @CXX_ADD_CFLAGS@ $(INTERP_CFLAGS) if BITCODE libmono_ee_interp_la_LDFLAGS = $(libmonoldflags) if DISABLE_INTERPRETER @@ -741,6 +776,8 @@ libmonosgen_2_0_la_CFLAGS = $(mono_sgen_CFLAGS) @CXX_ADD_CFLAGS@ libmonosgen_2_0_la_LIBADD = libmini.la $(interp_libs_with_mini) $(dbg_libs_with_mini) $(sgen_libs) $(LIBMONO_DTRACE_OBJECT) $(LLVMMONOF) libmonosgen_2_0_la_LDFLAGS = $(libmonoldflags) $(monobin_platform_ldflags) +endif # !ENABLE_MSVC_ONLY + libmonoincludedir = $(includedir)/mono-$(API_VER)/mono/jit # These are public headers. @@ -882,17 +919,17 @@ gctest: mono gc-test.exe LLVM_AOT_RUNTIME_OPTS=$(if $(LLVM),--llvm,) if AMD64 -LLVM_AOT_COMPILER_OPTS=$(if $(LLVM),"=llvmllc=-mcpu=generic -mattr=+sse3",) +LLVM_AOT_COMPILER_OPTS=$(if $(LLVM),llvmllc=-mattr=+sse3,) else LLVM_AOT_COMPILER_OPTS= endif GSHAREDVT_RUNTIME_OPTS=$(if $(GSHAREDVT),-O=gsharedvt,) aotcheck: mono $(regtests) - rm -rf *.exe.so *.exe.dylib *.exe.dylib.dSYM - $(MINI_RUNTIME) $(LLVM_AOT_RUNTIME_OPTS) --aot$(LLVM_AOT_COMPILER_OPTS) $(regtests) || exit 1 + rm -rf *.exe.so *.exe.dylib *.exe.dylib.dSYM *.exe.dll + $(MINI_RUNTIME) $(LLVM_AOT_RUNTIME_OPTS) --aot="$(LLVM_AOT_COMPILER_OPTS)" $(regtests) || exit 1 for i in $(regtests); do $(RUNTIME_AOTCHECK) --regression $$i || exit 1; done - rm -rf *.exe.so *.exe.dylib *.exe.dylib.dSYM + rm -rf *.exe.so *.exe.dylib *.exe.dylib.dSYM *.exe.dll llvmaotcheck: $(MAKE) aotcheck LLVM=1 @@ -944,6 +981,12 @@ endif FULLAOT_LIBS = $(filter-out $(FULLAOT_LIBS_DISABLED),$(FULLAOT_LIBS_UNIVERSAL)) FULLAOT_TMP_DIR=$(top_builddir)/mono/mini/fullaot-tmp +if FULL_AOT_TESTS +# use the available testing profile +FULLAOT_MONO_PATH=$(CLASS) +else +FULLAOT_MONO_PATH=$(FULLAOT_TMP_DIR) +endif FULLAOT_AOT_ARGS=$(if $(HYBRID),hybrid,full,interp),$(MONO_FULLAOT_ADDITIONAL_ARGS)$(INVARIANT_AOT_OPTIONS) FULLAOT_ARGS=$(if $(HYBRID),--hybrid-aot,--full-aot) @@ -952,12 +995,14 @@ FULLAOT_ARGS=$(if $(HYBRID),--hybrid-aot,--full-aot) fullaotcheck: $(mono) $(fullaot_regtests) $(fullaot_testing_deps) rm -rf $(FULLAOT_TMP_DIR) mkdir $(FULLAOT_TMP_DIR) +if !FULL_AOT_TESTS $(MAKE) fullaot-libs AOT_FLAGS="$(FULLAOT_AOT_ARGS)" +endif cp $(fullaot_regtests) $(fullaot_testing_deps) $(FULLAOT_TMP_DIR)/ - MONO_PATH=$(FULLAOT_TMP_DIR) $(top_builddir)/runtime/mono-wrapper $(MOBILE_RUNTIME_ARG) $(LLVM_AOT_RUNTIME_OPTS) $(GSHAREDVT_RUNTIME_OPTS) --aot="$(FULLAOT_AOT_ARGS)" $(FULLAOT_TMP_DIR)/{$(fullaot_testing_deps_commas),*.exe} || exit 1 + MONO_PATH=$(FULLAOT_MONO_PATH) $(top_builddir)/runtime/mono-wrapper $(MOBILE_RUNTIME_ARG) $(LLVM_AOT_RUNTIME_OPTS) $(GSHAREDVT_RUNTIME_OPTS) --aot="$(FULLAOT_AOT_ARGS),$(LLVM_AOT_COMPILER_OPTS)" $(FULLAOT_TMP_DIR)/{$(fullaot_testing_deps_commas),*.exe} || exit 1 ln -s $(if $(MONO_EXECUTABLE),$(MONO_EXECUTABLE),$$PWD/mono) $(FULLAOT_TMP_DIR)/ - for i in $(fullaot_regtests); do echo $$i; MONO_PATH=$(FULLAOT_TMP_DIR) $(top_builddir)/runtime/mono-wrapper $(MOBILE_RUNTIME_ARG) $(FULLAOT_ARGS) $(FULLAOT_TMP_DIR)/$$i --exclude '!FULLAOT' $(ARCH_FULLAOT_EXCLUDE) || exit 1; done - if test x$(MIXED) == x1; then failed=0;i=0; while test $$i -lt 900; do i=`expr $$i + 1`; bash -c "echo -n '.'"; MONO_PATH=$(FULLAOT_TMP_DIR) MONO_DEBUG=aot-skip=$$i $(top_builddir)/runtime/mono-wrapper --full-aot-interp $(FULLAOT_TMP_DIR)/basic.exe > $(FULLAOT_TMP_DIR)/mixed.log || failed=1; if test $$failed -eq 1; then echo "Failed at $$i"; exit $$failed; fi; done; fi + for i in $(fullaot_regtests); do echo $$i; MONO_PATH=$(FULLAOT_MONO_PATH) $(top_builddir)/runtime/mono-wrapper $(MOBILE_RUNTIME_ARG) $(FULLAOT_ARGS) $(FULLAOT_TMP_DIR)/$$i --exclude '!FULLAOT' $(ARCH_FULLAOT_EXCLUDE) || exit 1; done + if test x$(MIXED) == x1; then failed=0;i=0; while test $$i -lt 900; do i=`expr $$i + 1`; bash -c "echo -n '.'"; MONO_PATH=$(FULLAOT_MONO_PATH) MONO_DEBUG=aot-skip=$$i $(top_builddir)/runtime/mono-wrapper --full-aot-interp $(FULLAOT_TMP_DIR)/basic.exe > $(FULLAOT_TMP_DIR)/mixed.log || failed=1; if test $$failed -eq 1; then echo "Failed at $$i"; exit $$failed; fi; done; fi # This can run in parallel fullaot-libs: $(patsubst %,fullaot-tmp/%.dylib,$(FULLAOT_LIBS)) @@ -1012,7 +1057,7 @@ check_local_targets = $(if $(EMIT_NUNIT), rcheck-nunit, rcheck) check-local: $(check_local_targets) clean-local: - rm -f mono a.out gmon.out *.o buildver-boehm.h buildver-sgen.h test.exe regressionexitcode.out TestResult-op_il_seq_point.xml* + rm -f mono mono.exe monow.exe mono-sgen.exe a.out gmon.out *.o buildver-boehm.h buildver-sgen.h test.exe regressionexitcode.out TestResult-op_il_seq_point.xml* pkgconfigdir = $(libdir)/pkgconfig diff --git a/mono/mini/Makefile.in.REMOVED.git-id b/mono/mini/Makefile.in.REMOVED.git-id index 95f3183de3..7336d1e6f8 100644 --- a/mono/mini/Makefile.in.REMOVED.git-id +++ b/mono/mini/Makefile.in.REMOVED.git-id @@ -1 +1 @@ -8a3c959d851c5f17490d07211554424f072aeba3 \ No newline at end of file +49bf90a7988012164677d07cf311bd8666dc7a12 \ No newline at end of file diff --git a/mono/mini/abcremoval.c b/mono/mini/abcremoval.c index 1c54ef809f..7c72112369 100644 --- a/mono/mini/abcremoval.c +++ b/mono/mini/abcremoval.c @@ -102,10 +102,10 @@ print_summarized_value (MonoSummarizedValue *value) { printf ("ANY"); break; case MONO_CONSTANT_SUMMARIZED_VALUE: - printf ("CONSTANT %d", value->value.constant.value); + printf ("CONSTANT %d, not-null = %d", value->value.constant.value, value->value.constant.nullness); break; case MONO_VARIABLE_SUMMARIZED_VALUE: - printf ("VARIABLE %d, delta %d", value->value.variable.variable, value->value.variable.delta); + printf ("VARIABLE %d, delta %d, not-null = %d", value->value.variable.variable, value->value.variable.delta, value->value.variable.nullness); break; case MONO_PHI_SUMMARIZED_VALUE: { int phi; @@ -182,7 +182,9 @@ print_evaluation_context_status (MonoRelationsEvaluationStatus status) { static void print_evaluation_context_ranges (MonoRelationsEvaluationRanges *ranges) { - printf ("(ranges: zero [%d,%d], variable [%d,%d])", ranges->zero.lower, ranges->zero.upper, ranges->variable.lower, ranges->variable.upper); + printf ("(ranges: zero [%d,%d] (not-null = %d), variable [%d,%d])", + ranges->zero.lower, ranges->zero.upper, ranges->zero.nullness, + ranges->variable.lower, ranges->variable.upper); } static void @@ -271,16 +273,19 @@ get_relation_from_ins (MonoVariableRelationsEvaluationArea *area, MonoInst *ins, case OP_ICONST: value->type = MONO_CONSTANT_SUMMARIZED_VALUE; value->value.constant.value = ins->inst_c0; + value->value.constant.nullness = MONO_VALUE_MAYBE_NULL; break; case OP_MOVE: value->type = MONO_VARIABLE_SUMMARIZED_VALUE; value->value.variable.variable = ins->sreg1; value->value.variable.delta = 0; + value->value.variable.nullness = (MonoValueNullness) (MONO_VALUE_IS_VARIABLE | MONO_VALUE_MAYBE_NULL); break; case OP_SEXT_I4: value->type = MONO_VARIABLE_SUMMARIZED_VALUE; value->value.variable.variable = ins->sreg1; value->value.variable.delta = 0; + value->value.variable.nullness = MONO_VALUE_MAYBE_NULL; value_kind = MONO_INTEGER_VALUE_SIZE_8; break; case OP_PHI: @@ -292,6 +297,7 @@ get_relation_from_ins (MonoVariableRelationsEvaluationArea *area, MonoInst *ins, value->type = MONO_VARIABLE_SUMMARIZED_VALUE; value->value.variable.variable = ins->sreg1; value->value.variable.delta = ins->inst_imm; + value->value.variable.nullness = MONO_VALUE_MAYBE_NULL; /* FIXME: */ //check_delta_safety (area, result); break; @@ -299,6 +305,7 @@ get_relation_from_ins (MonoVariableRelationsEvaluationArea *area, MonoInst *ins, value->type = MONO_VARIABLE_SUMMARIZED_VALUE; value->value.variable.variable = ins->sreg1; value->value.variable.delta = -ins->inst_imm; + value->value.variable.nullness = MONO_VALUE_MAYBE_NULL; /* FIXME: */ //check_delta_safety (area, result); break; @@ -308,6 +315,7 @@ get_relation_from_ins (MonoVariableRelationsEvaluationArea *area, MonoInst *ins, value->type = MONO_VARIABLE_SUMMARIZED_VALUE; value->value.variable.variable = ins->sreg2; value->value.variable.delta = 0; + value->value.variable.nullness = MONO_VALUE_MAYBE_NULL; value_kind = MONO_UNSIGNED_INTEGER_VALUE_SIZE_4; break; case OP_LDLEN: @@ -318,19 +326,22 @@ get_relation_from_ins (MonoVariableRelationsEvaluationArea *area, MonoInst *ins, value->type = MONO_VARIABLE_SUMMARIZED_VALUE; value->value.variable.variable = ins->sreg1; value->value.variable.delta = 0; + value->value.variable.nullness = MONO_VALUE_MAYBE_NULL; value_kind = MONO_UNSIGNED_INTEGER_VALUE_SIZE_4; break; case OP_NEWARR: value->type = MONO_VARIABLE_SUMMARIZED_VALUE; value->value.variable.variable = ins->sreg1; value->value.variable.delta = 0; + value->value.variable.nullness = MONO_VALUE_NOT_NULL; area->defs [ins->dreg] = ins; break; case OP_LDADDR: /* The result is non-null */ - result->relation = MONO_GT_RELATION; + result->relation = MONO_GE_RELATION; value->type = MONO_CONSTANT_SUMMARIZED_VALUE; - value->value.constant.value = 0; + value->value.constant.value = INT_MIN; + value->value.constant.nullness = MONO_VALUE_NOT_NULL; break; /* FIXME: Add more opcodes */ @@ -487,17 +498,20 @@ get_relations_from_previous_bb (MonoVariableRelationsEvaluationArea *area, MonoB relations->relation1.relation.related_value.type = MONO_VARIABLE_SUMMARIZED_VALUE; relations->relation1.relation.related_value.value.variable.variable = compare->sreg2; relations->relation1.relation.related_value.value.variable.delta = 0; + relations->relation1.relation.related_value.value.variable.nullness = MONO_VALUE_MAYBE_NULL; relations->relation2.variable = compare->sreg2; relations->relation2.relation.relation = symmetric_relation; relations->relation2.relation.related_value.type = MONO_VARIABLE_SUMMARIZED_VALUE; relations->relation2.relation.related_value.value.variable.variable = compare->sreg1; relations->relation2.relation.related_value.value.variable.delta = 0; + relations->relation1.relation.related_value.value.variable.nullness = MONO_VALUE_MAYBE_NULL; } else if (compare->opcode == OP_ICOMPARE_IMM) { relations->relation1.variable = compare->sreg1; relations->relation1.relation.relation = branch_relation; relations->relation1.relation.related_value.type = MONO_CONSTANT_SUMMARIZED_VALUE; relations->relation1.relation.related_value.value.constant.value = compare->inst_imm; + relations->relation1.relation.related_value.value.constant.nullness = MONO_VALUE_MAYBE_NULL; } } } @@ -544,6 +558,25 @@ clean_contexts (MonoVariableRelationsEvaluationArea *area, int number) memset(area->statuses, MONO_RELATIONS_EVALUATION_NOT_STARTED, number * sizeof(MonoRelationsEvaluationStatus)); } +static void +union_nullness (MonoRelationsEvaluationRange *range, MonoValueNullness n) +{ + range->nullness = (MonoValueNullness) (range->nullness & (MONO_VALUE_NULLNESS_MASK & n)); +} + +static void +intersect_nullness (MonoRelationsEvaluationRange *range, MonoValueNullness n, MonoValueRelation relation) +{ + switch (relation) { + case MONO_NO_RELATION: + case MONO_ANY_RELATION: + case MONO_NE_RELATION: + range->nullness = MONO_VALUE_MAYBE_NULL; + break; + default: + range->nullness = (MonoValueNullness) (range->nullness | (MONO_VALUE_NULLNESS_MASK & n)); + } +} /* * Perform the intersection of a range and a constant value (taking into @@ -553,7 +586,7 @@ clean_contexts (MonoVariableRelationsEvaluationArea *area, int number) * relation: the relation between the range and the value */ static void -intersect_value( MonoRelationsEvaluationRange *range, int value, MonoValueRelation relation ) +intersect_value( MonoRelationsEvaluationRange *range, MonoSummarizedConstantValue value, MonoValueRelation relation ) { switch (relation) { case MONO_NO_RELATION: @@ -562,28 +595,29 @@ intersect_value( MonoRelationsEvaluationRange *range, int value, MonoValueRelati case MONO_ANY_RELATION: break; case MONO_EQ_RELATION: - MONO_UPPER_EVALUATION_RANGE_INTERSECTION (range->upper, value); - MONO_LOWER_EVALUATION_RANGE_INTERSECTION (range->lower, value); + MONO_UPPER_EVALUATION_RANGE_INTERSECTION (range->upper, value.value); + MONO_LOWER_EVALUATION_RANGE_INTERSECTION (range->lower, value.value); break; case MONO_NE_RELATION: { /* IMPROVEMENT Figure this out! (ignoring it is safe anyway) */ break; } case MONO_LT_RELATION: - MONO_UPPER_EVALUATION_RANGE_INTERSECTION (range->upper, MONO_UPPER_EVALUATION_RANGE_NOT_EQUAL (value)); + MONO_UPPER_EVALUATION_RANGE_INTERSECTION (range->upper, MONO_UPPER_EVALUATION_RANGE_NOT_EQUAL (value.value)); break; case MONO_LE_RELATION: - MONO_UPPER_EVALUATION_RANGE_INTERSECTION (range->upper, value); + MONO_UPPER_EVALUATION_RANGE_INTERSECTION (range->upper, value.value); break; case MONO_GT_RELATION: - MONO_LOWER_EVALUATION_RANGE_INTERSECTION (range->lower, MONO_LOWER_EVALUATION_RANGE_NOT_EQUAL (value)); + MONO_LOWER_EVALUATION_RANGE_INTERSECTION (range->lower, MONO_LOWER_EVALUATION_RANGE_NOT_EQUAL (value.value)); break; case MONO_GE_RELATION: - MONO_LOWER_EVALUATION_RANGE_INTERSECTION (range->lower, value); + MONO_LOWER_EVALUATION_RANGE_INTERSECTION (range->lower, value.value); break; default: g_assert_not_reached(); } + intersect_nullness (range, value.nullness, relation); } @@ -596,9 +630,9 @@ intersect_value( MonoRelationsEvaluationRange *range, int value, MonoValueRelati * relation: the relation between the pairs of ranges */ static void -intersect_ranges( MonoRelationsEvaluationRanges *ranges, MonoRelationsEvaluationRanges *other_ranges, int delta, MonoValueRelation relation ) +intersect_ranges (MonoRelationsEvaluationRanges *ranges, MonoRelationsEvaluationRanges *other_ranges, MonoSummarizedVariableValue value, MonoValueRelation relation) { - if (delta == 0) { + if (value.delta == 0) { switch (relation) { case MONO_NO_RELATION: MONO_MAKE_RELATIONS_EVALUATION_RANGES_IMPOSSIBLE (*ranges); @@ -631,10 +665,15 @@ intersect_ranges( MonoRelationsEvaluationRanges *ranges, MonoRelationsEvaluation default: g_assert_not_reached(); } + if (value.nullness & MONO_VALUE_IS_VARIABLE) + intersect_nullness (&ranges->zero, other_ranges->zero.nullness, relation); + intersect_nullness (&ranges->zero, value.nullness, relation); } else { MonoRelationsEvaluationRanges translated_ranges = *other_ranges; - MONO_ADD_DELTA_SAFELY_TO_RANGES (translated_ranges, delta); - intersect_ranges( ranges, &translated_ranges, FALSE, relation ); + MONO_ADD_DELTA_SAFELY_TO_RANGES (translated_ranges, value.delta); + MonoSummarizedVariableValue translated_value = value; + translated_value.delta = 0; + intersect_ranges (ranges, &translated_ranges, translated_value, relation); } } @@ -666,7 +705,7 @@ evaluate_relation_with_target_variable (MonoVariableRelationsEvaluationArea *are MonoSummarizedValueRelation *relation = &(area->relations [variable]); if (TRACE_ABC_REMOVAL) { - printf ("Evaluating variable %d (target variable %d)\n", variable, target_variable); + printf ("Evaluating variable %d (target variable %d); ", variable, target_variable); print_summarized_value_relation (relation); printf ("\n"); } @@ -704,7 +743,7 @@ evaluate_relation_with_target_variable (MonoVariableRelationsEvaluationArea *are break; case MONO_CONSTANT_SUMMARIZED_VALUE: // Intersect range with constant (taking into account the relation) - intersect_value (&(context->ranges.zero), relation->related_value.value.constant.value, relation->relation); + intersect_value (&(context->ranges.zero), relation->related_value.value.constant, relation->relation); break; case MONO_VARIABLE_SUMMARIZED_VALUE: // Generally, evaluate related variable and intersect ranges. @@ -754,7 +793,7 @@ evaluate_relation_with_target_variable (MonoVariableRelationsEvaluationArea *are } } else { // If we are not (the common case) intersect the result - intersect_ranges( &(context->ranges), &(related_context->ranges), relation->related_value.value.variable.delta, relation->relation ); + intersect_ranges (&(context->ranges), &(related_context->ranges), relation->related_value.value.variable, relation->relation); } } else { if (TRACE_ABC_REMOVAL) { @@ -773,6 +812,7 @@ evaluate_relation_with_target_variable (MonoVariableRelationsEvaluationArea *are gboolean is_descending = FALSE; MONO_MAKE_RELATIONS_EVALUATION_RANGES_IMPOSSIBLE (phi_ranges); + phi_ranges.zero.nullness = relation->related_value.value.phi.number_of_alternatives > 0 ? MONO_VALUE_NOT_NULL : MONO_VALUE_MAYBE_NULL; for (phi = 0; phi < relation->related_value.value.phi.number_of_alternatives; phi++) { int phi_alternative = relation->related_value.value.phi.phi_alternatives [phi]; evaluate_relation_with_target_variable (area, phi_alternative, target_variable, context); @@ -794,11 +834,13 @@ evaluate_relation_with_target_variable (MonoVariableRelationsEvaluationArea *are is_ascending = TRUE; is_descending = TRUE; } + phi_ranges.zero.nullness = MONO_VALUE_MAYBE_NULL; // Clear "recursivity" bits in the status (recursion has been handled) *status = MONO_RELATIONS_EVALUATION_IN_PROGRESS; } else { MONO_RELATIONS_EVALUATION_RANGES_UNION (phi_ranges, area->contexts [phi_alternative].ranges); + union_nullness (&phi_ranges.zero, area->contexts [phi_alternative].ranges.zero.nullness); } } @@ -814,6 +856,7 @@ evaluate_relation_with_target_variable (MonoVariableRelationsEvaluationArea *are // Intersect final result MONO_RELATIONS_EVALUATION_RANGES_INTERSECTION (context->ranges, phi_ranges); + intersect_nullness (&context->ranges.zero, phi_ranges.zero.nullness, MONO_EQ_RELATION); break; } default: @@ -1023,7 +1066,7 @@ eval_non_null (MonoVariableRelationsEvaluationArea *area, int reg) clean_contexts (area, area->cfg->next_vreg); evaluate_relation_with_target_variable (area, reg, reg, NULL); - return context->ranges.zero.lower > 0; + return context->ranges.zero.nullness == MONO_VALUE_NOT_NULL; } static void @@ -1034,9 +1077,10 @@ add_non_null (MonoVariableRelationsEvaluationArea *area, MonoCompile *cfg, int r rel = (MonoAdditionalVariableRelation *)mono_mempool_alloc0 (cfg->mempool, sizeof (MonoAdditionalVariableRelation)); rel->variable = reg; - rel->relation.relation = MONO_GT_RELATION; + rel->relation.relation = MONO_GE_RELATION; rel->relation.related_value.type = MONO_CONSTANT_SUMMARIZED_VALUE; - rel->relation.related_value.value.constant.value = 0; + rel->relation.related_value.value.constant.value = INT_MIN; + rel->relation.related_value.value.constant.nullness = MONO_VALUE_NOT_NULL; apply_change_to_evaluation_area (area, rel); @@ -1107,6 +1151,7 @@ process_block (MonoCompile *cfg, MonoBasicBlock *bb, MonoVariableRelationsEvalua rel->relation.related_value.type = MONO_VARIABLE_SUMMARIZED_VALUE; rel->relation.related_value.value.variable.variable = array_var; rel->relation.related_value.value.variable.delta = 0; + rel->relation.related_value.value.variable.nullness = MONO_VALUE_MAYBE_NULL; apply_change_to_evaluation_area (area, rel); @@ -1117,6 +1162,7 @@ process_block (MonoCompile *cfg, MonoBasicBlock *bb, MonoVariableRelationsEvalua rel->relation.relation = MONO_GE_RELATION; rel->relation.related_value.type = MONO_CONSTANT_SUMMARIZED_VALUE; rel->relation.related_value.value.constant.value = 0; + rel->relation.related_value.value.constant.nullness = MONO_VALUE_MAYBE_NULL; apply_change_to_evaluation_area (area, rel); @@ -1127,7 +1173,7 @@ process_block (MonoCompile *cfg, MonoBasicBlock *bb, MonoVariableRelationsEvalua if (ins->opcode == OP_CHECK_THIS) { if (eval_non_null (area, ins->sreg1)) { if (REPORT_ABC_REMOVAL) - printf ("ARRAY-ACCESS: removed check_this instruction.\n"); + printf ("ARRAY-ACCESS: removed check_this instruction for R%d.\n", ins->sreg1); NULLIFY_INS (ins); } } @@ -1138,16 +1184,12 @@ process_block (MonoCompile *cfg, MonoBasicBlock *bb, MonoVariableRelationsEvalua if (ins->opcode == OP_COMPARE_IMM && ins->inst_imm == 0 && ins->next && ins->next->opcode == OP_COND_EXC_EQ) { if (eval_non_null (area, ins->sreg1)) { if (REPORT_ABC_REMOVAL) - printf ("ARRAY-ACCESS: Removed null check.\n"); + printf ("ARRAY-ACCESS: Removed null check for R%d.\n", ins->sreg1); NULLIFY_INS (ins->next); NULLIFY_INS (ins); } } - /* - * FIXME: abcrem equates an array with its length, - * so a = new int [100] implies a != null, but a = new int [0] doesn't. - */ /* * Eliminate MONO_INST_FAULT flags if possible. */ @@ -1367,12 +1409,17 @@ mono_perform_abc_removal (MonoCompile *cfg) if (area.relations [i].related_value.type == MONO_VARIABLE_SUMMARIZED_VALUE) { int related_index = cfg->next_vreg + i; int related_variable = area.relations [i].related_value.value.variable.variable; + MonoValueNullness symmetric_nullness = MONO_VALUE_MAYBE_NULL; + if (area.relations [i].related_value.value.variable.nullness & MONO_VALUE_IS_VARIABLE) { + symmetric_nullness = area.relations [i].related_value.value.variable.nullness; + } area.relations [related_index].relation = MONO_EQ_RELATION; area.relations [related_index].relation_is_static_definition = TRUE; area.relations [related_index].related_value.type = MONO_VARIABLE_SUMMARIZED_VALUE; area.relations [related_index].related_value.value.variable.variable = i; area.relations [related_index].related_value.value.variable.delta = - area.relations [i].related_value.value.variable.delta; + area.relations [related_index].related_value.value.variable.nullness = symmetric_nullness; area.relations [related_index].next = area.relations [related_variable].next; area.relations [related_variable].next = &(area.relations [related_index]); diff --git a/mono/mini/abcremoval.h b/mono/mini/abcremoval.h index ac52857ea7..8bc91ad4d7 100644 --- a/mono/mini/abcremoval.h +++ b/mono/mini/abcremoval.h @@ -15,6 +15,20 @@ #include "mini.h" +typedef enum { + MONO_VALUE_MAYBE_NULL = 0, + MONO_VALUE_NOT_NULL = 1, + + MONO_VALUE_NULLNESS_MASK = 1, + + /* + * If this bit is set, and the enclosing MonoSummarizedValue is a + * MONO_VARIABLE_SUMMARIZED_VALUE, then the "nullness" value is related + * to the variable referenced in MonoSummarizedVariableValue. Otherwise, + * the "nullness" value is constant. + */ + MONO_VALUE_IS_VARIABLE = 2, +} MonoValueNullness; /** * All handled value types (expressions) in variable definitions and branch @@ -37,6 +51,7 @@ typedef enum { */ typedef struct MonoSummarizedConstantValue { int value; + MonoValueNullness nullness; } MonoSummarizedConstantValue; /** @@ -47,6 +62,7 @@ typedef struct MonoSummarizedConstantValue { typedef struct MonoSummarizedVariableValue { int variable; int delta; + MonoValueNullness nullness; } MonoSummarizedVariableValue; /** @@ -166,6 +182,7 @@ typedef enum { typedef struct MonoRelationsEvaluationRange { int lower; int upper; + MonoValueNullness nullness; } MonoRelationsEvaluationRange; /** @@ -197,6 +214,7 @@ typedef struct MonoRelationsEvaluationContext { #define MONO_MAKE_RELATIONS_EVALUATION_RANGE_WEAK(r) do{\ (r).lower = INT_MIN;\ (r).upper = INT_MAX;\ + (r).nullness = MONO_VALUE_MAYBE_NULL; \ } while (0) #define MONO_MAKE_RELATIONS_EVALUATION_RANGES_WEAK(rs) do{\ MONO_MAKE_RELATIONS_EVALUATION_RANGE_WEAK ((rs).zero); \ @@ -205,6 +223,7 @@ typedef struct MonoRelationsEvaluationContext { #define MONO_MAKE_RELATIONS_EVALUATION_RANGE_IMPOSSIBLE(r) do{\ (r).lower = INT_MAX;\ (r).upper = INT_MIN;\ + (r).nullness = MONO_VALUE_MAYBE_NULL; \ } while (0) #define MONO_MAKE_RELATIONS_EVALUATION_RANGES_IMPOSSIBLE(rs) do{\ MONO_MAKE_RELATIONS_EVALUATION_RANGE_IMPOSSIBLE ((rs).zero); \ diff --git a/mono/mini/alias-analysis.c b/mono/mini/alias-analysis.c index 9ebbaaa603..b473fe27b7 100644 --- a/mono/mini/alias-analysis.c +++ b/mono/mini/alias-analysis.c @@ -22,7 +22,7 @@ static gboolean is_int_stack_size (int type) { #if TARGET_SIZEOF_VOID_P == 4 - return type == STACK_I4 || type == STACK_MP; + return type == STACK_I4 || type == STACK_MP || type == STACK_PTR; #else return type == STACK_I4; #endif @@ -32,7 +32,7 @@ static gboolean is_long_stack_size (int type) { #if TARGET_SIZEOF_VOID_P == 8 - return type == STACK_I8 || type == STACK_MP; + return type == STACK_I8 || type == STACK_MP || type == STACK_PTR; #else return type == STACK_I8; #endif @@ -303,6 +303,12 @@ handle_instruction: } } g_hash_table_destroy (addr_loads); + +#ifdef ENABLE_NETCORE + /* There could be ldaddr instructions which already got eliminated */ + if (COMPILE_LLVM (cfg)) + return TRUE; +#endif return needs_dce; } diff --git a/mono/mini/aot-compiler.c.REMOVED.git-id b/mono/mini/aot-compiler.c.REMOVED.git-id index f4236aebc2..a7ceb4d0cb 100644 --- a/mono/mini/aot-compiler.c.REMOVED.git-id +++ b/mono/mini/aot-compiler.c.REMOVED.git-id @@ -1 +1 @@ -ed52e8bc35d3a175c15a6684089d25b800e0cce4 \ No newline at end of file +f6f632d978b47445c2c13d231c60bf1079b2788c \ No newline at end of file diff --git a/mono/mini/aot-compiler.h b/mono/mini/aot-compiler.h index 6b8803b343..a379c01885 100644 --- a/mono/mini/aot-compiler.h +++ b/mono/mini/aot-compiler.h @@ -23,9 +23,6 @@ char* mono_aot_get_direct_call_symbol (MonoJumpInfoType type, gconstpointe int mono_aot_get_method_index (MonoMethod *method) MONO_LLVM_INTERNAL; MonoJumpInfo* mono_aot_patch_info_dup (MonoJumpInfo* ji) MONO_LLVM_INTERNAL; gboolean mono_aot_can_specialize (MonoMethod *method) MONO_LLVM_INTERNAL; +gboolean mono_aot_can_enter_interp (MonoMethod *method) MONO_LLVM_INTERNAL; #endif - - - - diff --git a/mono/mini/aot-runtime-wasm.c b/mono/mini/aot-runtime-wasm.c index cbfbf05495..f989b113fe 100644 --- a/mono/mini/aot-runtime-wasm.c +++ b/mono/mini/aot-runtime-wasm.c @@ -79,7 +79,7 @@ typedef union { } pair; } interp_pair; -static inline gint64 +static gint64 get_long_arg (InterpMethodArguments *margs, int idx) { interp_pair p; diff --git a/mono/mini/aot-runtime.c.REMOVED.git-id b/mono/mini/aot-runtime.c.REMOVED.git-id index 8ae7dd033a..a26f42a7bf 100644 --- a/mono/mini/aot-runtime.c.REMOVED.git-id +++ b/mono/mini/aot-runtime.c.REMOVED.git-id @@ -1 +1 @@ -b99841c60ea289599e9489509cbd6f8cf9ac23bb \ No newline at end of file +8b231d887dfa8227f79e4deb5f2eb0e70f5e9376 \ No newline at end of file diff --git a/mono/mini/aot-runtime.h b/mono/mini/aot-runtime.h index 4f8949c3f0..31940084c2 100644 --- a/mono/mini/aot-runtime.h +++ b/mono/mini/aot-runtime.h @@ -11,7 +11,7 @@ #include "mini.h" /* Version number of the AOT file format */ -#define MONO_AOT_FILE_VERSION 170 +#define MONO_AOT_FILE_VERSION 171 #define MONO_AOT_TRAMP_PAGE_SIZE 16384 diff --git a/mono/mini/aot-tests.cs b/mono/mini/aot-tests.cs index ed17e9b1d3..e3ee8793d4 100644 --- a/mono/mini/aot-tests.cs +++ b/mono/mini/aot-tests.cs @@ -577,7 +577,6 @@ class Tests } [Category ("DYNCALL")] - [Category ("!WASM")] //Interp fails public static int test_0_large_nullable_invoke () { var s = new LargeStruct () { a = 1, b = 2, c = 3, d = 4 }; diff --git a/mono/mini/calls.c b/mono/mini/calls.c index 08930f849d..9d8c522273 100644 --- a/mono/mini/calls.c +++ b/mono/mini/calls.c @@ -13,6 +13,7 @@ #include "llvmonly-runtime.h" #include "mini-llvm.h" #include "jit-icalls.h" +#include "aot-compiler.h" #include #include #include @@ -425,9 +426,15 @@ can_enter_interp (MonoCompile *cfg, MonoMethod *method, gboolean virtual_) { if (method->wrapper_type) return FALSE; - /* Virtual calls from corlib can go outside corlib */ - if ((m_class_get_image (method->klass) == m_class_get_image (cfg->method->klass)) && !virtual_) - return FALSE; + + if (m_class_get_image (method->klass) == m_class_get_image (cfg->method->klass)) { + /* When using AOT profiling, the method might not be AOTed */ + if (cfg->compile_aot && mono_aot_can_enter_interp (method)) + return TRUE; + /* Virtual calls from corlib can go outside corlib */ + if (!virtual_) + return FALSE; + } /* See needs_extra_arg () in mini-llvm.c */ if (method->string_ctor) @@ -590,6 +597,9 @@ mini_emit_method_call_full (MonoCompile *cfg, MonoMethod *method, MonoMethodSign if (!virtual_ && cfg->llvm_only && cfg->interp && !tailcall && can_enter_interp (cfg, method, FALSE)) { MonoInst *ftndesc = mini_emit_get_rgctx_method (cfg, -1, method, MONO_RGCTX_INFO_METHOD_FTNDESC); + /* Need wrappers for this signature to be able to enter interpreter */ + cfg->interp_in_signatures = g_slist_prepend_mempool (cfg->mempool, cfg->interp_in_signatures, sig); + /* This call might need to enter the interpreter so make it indirect */ return mini_emit_llvmonly_calli (cfg, sig, args, ftndesc); } else if (!virtual_) { diff --git a/mono/mini/cfold.c b/mono/mini/cfold.c index d413196c33..737f5ab5cf 100644 --- a/mono/mini/cfold.c +++ b/mono/mini/cfold.c @@ -49,6 +49,12 @@ mono_is_power_of_two (guint32 val) *(double *)dest->inst_p0 = (*((double *) arg1->inst_p0)) op (*((double *) arg2->inst_p0)); \ break; +#define FOLD_RBINOP(name, op) \ + case name: \ + dest->inst_p0 = (float *)mono_domain_alloc (cfg->domain, sizeof (float)); \ + *(float *)dest->inst_p0 = (*((float *) arg1->inst_p0)) op (*((float *) arg2->inst_p0)); \ + break; + #define FOLD_BINOPC(name,op,cast) \ case name: \ dest->inst_c0 = (cast)arg1->inst_c0 op (cast)arg2->inst_c0; \ @@ -97,7 +103,7 @@ mono_constant_fold_ins (MonoCompile *cfg, MonoInst *ins, MonoInst *arg1, MonoIns switch (ins->opcode) { case OP_FADD: case OP_FMUL: - if (arg2->opcode == OP_R8CONST && arg2->opcode == OP_R8CONST){ + if (arg1->opcode == OP_R8CONST && arg2->opcode == OP_R8CONST) { ALLOC_DEST (cfg, dest, ins); switch (ins->opcode) { FOLD_FBINOP (OP_FADD, +); @@ -107,6 +113,18 @@ mono_constant_fold_ins (MonoCompile *cfg, MonoInst *ins, MonoInst *arg1, MonoIns MONO_INST_NULLIFY_SREGS (dest); } break; + case OP_RADD: + case OP_RMUL: + if (arg1->opcode == OP_R4CONST && arg2->opcode == OP_R4CONST) { + ALLOC_DEST (cfg, dest, ins); + switch (ins->opcode) { + FOLD_RBINOP (OP_RADD, +); + FOLD_RBINOP (OP_RMUL, *); + } + dest->opcode = OP_R4CONST; + MONO_INST_NULLIFY_SREGS (dest); + } + break; case OP_IMUL: case OP_IADD: case OP_IAND: @@ -258,6 +276,22 @@ mono_constant_fold_ins (MonoCompile *cfg, MonoInst *ins, MonoInst *arg1, MonoIns dest->inst_c0 = arg1->inst_c0; } break; + case OP_FMOVE: + if (arg1->opcode == OP_R8CONST) { + ALLOC_DEST (cfg, dest, ins); + dest->opcode = arg1->opcode; + dest->sreg1 = -1; + dest->inst_p0 = arg1->inst_p0; + } + break; + case OP_RMOVE: + if (arg1->opcode == OP_R4CONST) { + ALLOC_DEST (cfg, dest, ins); + dest->opcode = arg1->opcode; + dest->sreg1 = -1; + dest->inst_p0 = arg1->inst_p0; + } + break; case OP_VMOVE: if (arg1->opcode == OP_VZERO) { ALLOC_DEST (cfg, dest, ins); @@ -407,14 +441,6 @@ mono_constant_fold_ins (MonoCompile *cfg, MonoInst *ins, MonoInst *arg1, MonoIns } break; } - case OP_FMOVE: - if (arg1->opcode == OP_R8CONST) { - ALLOC_DEST (cfg, dest, ins); - dest->opcode = OP_R8CONST; - dest->sreg1 = -1; - dest->inst_p0 = arg1->inst_p0; - } - break; /* * TODO: diff --git a/mono/mini/cpu-amd64.md b/mono/mini/cpu-amd64.md index b58cfb2f47..ecf358c05f 100644 --- a/mono/mini/cpu-amd64.md +++ b/mono/mini/cpu-amd64.md @@ -827,3 +827,8 @@ generic_class_init: src1:A len:32 clob:c get_last_error: dest:i len:32 fill_prof_call_ctx: src1:i len:128 + +lzcnt32: dest:i src1:i len:16 +lzcnt64: dest:i src1:i len:16 +popcnt32: dest:i src1:i len:16 +popcnt64: dest:i src1:i len:16 diff --git a/mono/mini/debug-mini.c b/mono/mini/debug-mini.c index cad22ae629..3c92884eb7 100644 --- a/mono/mini/debug-mini.c +++ b/mono/mini/debug-mini.c @@ -35,7 +35,7 @@ typedef struct guint32 breakpoint_id; } MiniDebugMethodInfo; -static inline void +static void record_line_number (MiniDebugMethodInfo *info, guint32 address, guint32 offset) { MonoDebugLineNumberEntry lne; @@ -352,7 +352,7 @@ mono_debug_open_block (MonoCompile *cfg, MonoBasicBlock *bb, guint32 address) record_line_number (info, address, offset); } -static inline void +static void encode_value (gint32 value, guint8 *buf, guint8 **endbuf) { guint8 *p = buf; @@ -388,7 +388,7 @@ encode_value (gint32 value, guint8 *buf, guint8 **endbuf) *endbuf = p; } -static inline gint32 +static gint32 decode_value (guint8 *ptr, guint8 **rptr) { guint8 b = *ptr; diff --git a/mono/mini/debugger-agent.c.REMOVED.git-id b/mono/mini/debugger-agent.c.REMOVED.git-id index 3dfdb5107c..9b4b1daadf 100644 --- a/mono/mini/debugger-agent.c.REMOVED.git-id +++ b/mono/mini/debugger-agent.c.REMOVED.git-id @@ -1 +1 @@ -df6329391df4d8d574efdcff9e616e4e5ca30e85 \ No newline at end of file +d167406e0407e102e668e6c1728f05dd093f6b4b \ No newline at end of file diff --git a/mono/mini/debugger-engine.c b/mono/mini/debugger-engine.c index f22b031e91..fc5624c70d 100644 --- a/mono/mini/debugger-engine.c +++ b/mono/mini/debugger-engine.c @@ -259,7 +259,7 @@ remove_breakpoint (BreakpointInstance *inst) /* * This doesn't take any locks. */ -static inline gboolean +static gboolean bp_matches_method (MonoBreakpoint *bp, MonoMethod *method) { int i; @@ -466,7 +466,7 @@ mono_de_set_breakpoint (MonoMethod *method, long il_offset, EventRequest *req, M g_ptr_array_free (method_domains, TRUE); g_ptr_array_free (method_seq_points, TRUE); - if (error && !mono_error_ok (error)) { + if (error && !is_ok (error)) { mono_de_clear_breakpoint (bp); return NULL; } diff --git a/mono/mini/decompose.c b/mono/mini/decompose.c index cded93cc09..392f89c66c 100644 --- a/mono/mini/decompose.c +++ b/mono/mini/decompose.c @@ -1252,7 +1252,7 @@ mono_decompose_vtype_opts (MonoCompile *cfg) if (m_class_get_image (ins->klass) == mono_defaults.corlib && !strcmp (m_class_get_name (ins->klass), "MonoError")) { // Used in icall wrappers, optimize initialization - MONO_EMIT_NEW_STORE_MEMBASE_IMM (cfg, OP_STOREI4_MEMBASE_IMM, dest->dreg, MONO_STRUCT_OFFSET (MonoError, init), 0); + MONO_EMIT_NEW_STORE_MEMBASE_IMM (cfg, OP_STOREI4_MEMBASE_IMM, dest->dreg, MONO_STRUCT_OFFSET (MonoErrorExternal, init), 0); } else { mini_emit_initobj (cfg, dest, NULL, ins->klass); } @@ -1555,9 +1555,9 @@ mono_decompose_array_access_opts (MonoCompile *cfg) if (COMPILE_LLVM (cfg)) { int index2_reg = alloc_preg (cfg); MONO_EMIT_NEW_UNALU (cfg, OP_SEXT_I4, index2_reg, ins->sreg2); - MONO_EMIT_DEFAULT_BOUNDS_CHECK (cfg, ins->sreg1, ins->inst_imm, index2_reg, ins->flags & MONO_INST_FAULT); + MONO_EMIT_DEFAULT_BOUNDS_CHECK (cfg, ins->sreg1, ins->inst_imm, index2_reg, ins->flags & MONO_INST_FAULT, ins->inst_p0); } else { - MONO_ARCH_EMIT_BOUNDS_CHECK (cfg, ins->sreg1, ins->inst_imm, ins->sreg2); + MONO_ARCH_EMIT_BOUNDS_CHECK (cfg, ins->sreg1, ins->inst_imm, ins->sreg2, ins->inst_p0); } break; case OP_NEWARR: diff --git a/mono/mini/dominators.c b/mono/mini/dominators.c index 3c11cf9c41..01093eb9d1 100644 --- a/mono/mini/dominators.c +++ b/mono/mini/dominators.c @@ -259,7 +259,7 @@ compute_dominance_frontier (MonoCompile *cfg) cfg->comp_done |= MONO_COMP_DFRONTIER; } -static inline void +static void df_set (MonoCompile *m, MonoBitSet* dest, MonoBitSet *set) { int i; diff --git a/mono/mini/driver.c b/mono/mini/driver.c index 850a34cf9e..291c014b6d 100644 --- a/mono/mini/driver.c +++ b/mono/mini/driver.c @@ -76,8 +76,8 @@ static FILE *mini_stats_fd; static void mini_usage (void); -static void mono_runtime_set_execution_mode (MonoEEMode mode); -static void mono_runtime_set_execution_mode_full (MonoEEMode mode, gboolean override); +static void mono_runtime_set_execution_mode (int mode); +static void mono_runtime_set_execution_mode_full (int mode, gboolean override); static int mono_jit_exec_internal (MonoDomain *domain, MonoAssembly *assembly, int argc, char *argv[]); #ifdef HOST_WIN32 @@ -666,7 +666,7 @@ mini_regression_list (int verbose, int count, char *images []) total_run = total = 0; for (i = 0; i < count; ++i) { MonoAssemblyOpenRequest req; - mono_assembly_request_prepare (&req.request, sizeof (req), MONO_ASMCTX_DEFAULT); + mono_assembly_request_prepare_open (&req, MONO_ASMCTX_DEFAULT, mono_domain_default_alc (mono_get_root_domain ())); ass = mono_assembly_request_open (images [i], &req, NULL); if (!ass) { g_warning ("failed to load assembly: %s", images [i]); @@ -721,7 +721,7 @@ interp_regression_step (MonoImage *image, int verbose, int *total_run, int *tota } result_obj = mini_get_interp_callbacks ()->runtime_invoke (method, NULL, NULL, &exc, interp_error); - if (!mono_error_ok (interp_error)) { + if (!is_ok (interp_error)) { cfailed++; g_print ("Test '%s' execution failed.\n", method->name); } else if (exc != NULL) { @@ -793,7 +793,7 @@ mono_interp_regression_list (int verbose, int count, char *images []) total_run = total = 0; for (i = 0; i < count; ++i) { MonoAssemblyOpenRequest req; - mono_assembly_request_prepare (&req.request, sizeof (req), MONO_ASMCTX_DEFAULT); + mono_assembly_request_prepare_open (&req, MONO_ASMCTX_DEFAULT, mono_domain_default_alc (mono_get_root_domain ())); MonoAssembly *ass = mono_assembly_request_open (images [i], &req, NULL); if (!ass) { g_warning ("failed to load assembly: %s", images [i]); @@ -1203,14 +1203,14 @@ compile_all_methods_thread_main_inner (CompileAllThreadArgs *args) if (mono_use_interpreter) { mini_get_interp_callbacks ()->create_method_pointer (method, TRUE, error); // FIXME There are a few failures due to DllNotFoundException related to System.Native - if (verbose && !mono_error_ok (error)) + if (verbose && !is_ok (error)) g_print ("Compilation of %s failed\n", mono_method_full_name (method, TRUE)); } else { cfg = mini_method_compile (method, mono_get_optimizations_for_method (method, args->opts), mono_get_root_domain (), (JitFlags)JIT_FLAG_DISCARD_RESULTS, 0, -1); if (cfg->exception_type != MONO_EXCEPTION_NONE) { const char *msg = cfg->exception_message; if (cfg->exception_type == MONO_EXCEPTION_MONO_ERROR) - msg = mono_error_get_message (&cfg->error); + msg = mono_error_get_message (cfg->error); g_print ("Compilation of %s failed with exception '%s':\n", mono_method_full_name (cfg->method, TRUE), msg); fail_count ++; } @@ -1249,7 +1249,7 @@ compile_all_methods (MonoAssembly *ass, int verbose, guint32 opts, guint32 recom mono_thread_create_checked (mono_domain_get (), (gpointer)compile_all_methods_thread_main, &args, error); mono_error_assert_ok (error); - mono_thread_manage (); + mono_thread_manage_internal (); } /** @@ -1429,7 +1429,7 @@ load_agent (MonoDomain *domain, char *desc) } MonoAssemblyOpenRequest req; - mono_assembly_request_prepare (&req.request, sizeof (req), MONO_ASMCTX_DEFAULT); + mono_assembly_request_prepare_open (&req, MONO_ASMCTX_DEFAULT, mono_domain_default_alc (mono_get_root_domain ())); agent_assembly = mono_assembly_request_open (agent, &req, &open_status); if (!agent_assembly) { fprintf (stderr, "Cannot open agent assembly '%s': %s.\n", agent, mono_image_strerror (open_status)); @@ -1677,6 +1677,7 @@ mono_get_version_info (void) #endif #endif + mono_threads_suspend_policy_init (); g_string_append_printf (output, "\tSuspend: %s\n", mono_threads_suspend_policy_name (mono_threads_suspend_policy ())); return g_string_free (output, FALSE); @@ -1979,7 +1980,6 @@ mono_main (int argc, char* argv[]) MonoAssembly *assembly; MonoMethodDesc *desc; MonoMethod *method; - MonoCompile *cfg; MonoDomain *domain; MonoImageOpenStatus open_status; const char* aname, *mname = NULL; @@ -2346,6 +2346,8 @@ mono_main (int argc, char* argv[]) #endif } else if (strcmp (argv [i], "--nollvm") == 0){ mono_use_llvm = FALSE; + } else if (strcmp (argv [i], "--ffast-math") == 0){ + mono_use_fast_math = TRUE; } else if ((strcmp (argv [i], "--interpreter") == 0) || !strcmp (argv [i], "--interp")) { mono_runtime_set_execution_mode (MONO_EE_MODE_INTERP); } else if (strncmp (argv [i], "--interp=", 9) == 0) { @@ -2583,8 +2585,7 @@ mono_main (int argc, char* argv[]) } MonoAssemblyOpenRequest open_req; - mono_assembly_request_prepare (&open_req.request, sizeof (open_req), MONO_ASMCTX_DEFAULT); - open_req.request.alc = mono_domain_default_alc (mono_get_root_domain ()); + mono_assembly_request_prepare_open (&open_req, MONO_ASMCTX_DEFAULT, mono_domain_default_alc (mono_get_root_domain ())); assembly = mono_assembly_request_open (aname, &open_req, &open_status); if (!assembly && !mono_compile_aot) { fprintf (stderr, "Cannot open assembly '%s': %s.\n", aname, mono_image_strerror (open_status)); @@ -2621,7 +2622,7 @@ mono_main (int argc, char* argv[]) main_args.opts = opt; main_args.aot_options = aot_options; main_thread_handler (&main_args); - mono_thread_manage (); + mono_thread_manage_internal (); mini_cleanup (domain); @@ -2649,6 +2650,7 @@ mono_main (int argc, char* argv[]) } #ifndef DISABLE_JIT + MonoCompile *cfg; if (action == DO_DRAW) { int part = 0; @@ -2752,7 +2754,9 @@ mono_main (int argc, char* argv[]) MonoDomain * mono_jit_init (const char *file) { - return mini_init (file, NULL); + MonoDomain *ret = mini_init (file, NULL); + MONO_ENTER_GC_SAFE_UNBALANCED; //once it is not executing any managed code yet, it's safe to run the gc + return ret; } /** @@ -2778,7 +2782,16 @@ mono_jit_init (const char *file) MonoDomain * mono_jit_init_version (const char *domain_name, const char *runtime_version) { - return mini_init (domain_name, runtime_version); + MonoDomain *ret = mini_init (domain_name, runtime_version); + MONO_ENTER_GC_SAFE_UNBALANCED; //once it is not executing any managed code yet, it's safe to run the gc + return ret; +} + +MonoDomain * +mono_jit_init_version_for_test_only (const char *domain_name, const char *runtime_version) +{ + MonoDomain *ret = mini_init (domain_name, runtime_version); + return ret; } /** @@ -2787,11 +2800,16 @@ mono_jit_init_version (const char *domain_name, const char *runtime_version) void mono_jit_cleanup (MonoDomain *domain) { - MONO_ENTER_GC_UNSAFE; - mono_thread_manage (); + MONO_STACKDATA (dummy); + (void) mono_threads_enter_gc_unsafe_region_unbalanced_internal (&dummy); + + // after mini_cleanup everything is cleaned up so MONO_EXIT_GC_UNSAFE + // can't work and doesn't make sense. + + mono_thread_manage_internal (); mini_cleanup (domain); - MONO_EXIT_GC_UNSAFE; + } void @@ -2802,7 +2820,7 @@ mono_jit_set_aot_only (gboolean val) } static void -mono_runtime_set_execution_mode_full (MonoEEMode mode, gboolean override) +mono_runtime_set_execution_mode_full (int mode, gboolean override) { static gboolean mode_initialized = FALSE; if (mode_initialized && !override) @@ -2869,7 +2887,7 @@ mono_runtime_set_execution_mode_full (MonoEEMode mode, gboolean override) } static void -mono_runtime_set_execution_mode (MonoEEMode mode) +mono_runtime_set_execution_mode (int mode) { mono_runtime_set_execution_mode_full (mode, TRUE); } @@ -2887,7 +2905,7 @@ mono_jit_set_aot_mode (MonoAotMode mode) mono_aot_mode = mode; inited = TRUE; - mono_runtime_set_execution_mode ((MonoEEMode)mode); + mono_runtime_set_execution_mode (mode); } mono_bool @@ -3129,13 +3147,13 @@ mono_win32_parse_options (const char *options, int *ref_argc, char **ref_argv [] return NULL; } -static inline char * +static char * mono_parse_response_options (const char *options, int *ref_argc, char **ref_argv [], gboolean prepend) { return mono_win32_parse_options (options, ref_argc, ref_argv, prepend); } #else -static inline char * +static char * mono_parse_response_options (const char *options, int *ref_argc, char **ref_argv [], gboolean prepend) { return mono_parse_options (options, ref_argc, ref_argv, prepend); diff --git a/mono/mini/dwarfwriter.c b/mono/mini/dwarfwriter.c index 4e91d4bb01..bf2ff736fe 100644 --- a/mono/mini/dwarfwriter.c +++ b/mono/mini/dwarfwriter.c @@ -109,85 +109,85 @@ mono_dwarf_writer_get_il_file_line_index (MonoDwarfWriter *w) /* Wrappers around the image writer functions */ -static inline void +static void emit_section_change (MonoDwarfWriter *w, const char *section_name, int subsection_index) { mono_img_writer_emit_section_change (w->w, section_name, subsection_index); } -static inline void +static void emit_push_section (MonoDwarfWriter *w, const char *section_name, int subsection) { mono_img_writer_emit_push_section (w->w, section_name, subsection); } -static inline void +static void emit_pop_section (MonoDwarfWriter *w) { mono_img_writer_emit_pop_section (w->w); } -static inline void +static void emit_label (MonoDwarfWriter *w, const char *name) { mono_img_writer_emit_label (w->w, name); } -static inline void +static void emit_bytes (MonoDwarfWriter *w, const guint8* buf, int size) { mono_img_writer_emit_bytes (w->w, buf, size); } -static inline void +static void emit_string (MonoDwarfWriter *w, const char *value) { mono_img_writer_emit_string (w->w, value); } -static inline void +static void emit_line (MonoDwarfWriter *w) { mono_img_writer_emit_line (w->w); } -static inline void +static void emit_alignment (MonoDwarfWriter *w, int size) { mono_img_writer_emit_alignment (w->w, size); } -static inline void +static void emit_pointer_unaligned (MonoDwarfWriter *w, const char *target) { mono_img_writer_emit_pointer_unaligned (w->w, target); } -static inline void +static void emit_pointer (MonoDwarfWriter *w, const char *target) { mono_img_writer_emit_pointer (w->w, target); } -static inline void +static void emit_int16 (MonoDwarfWriter *w, int value) { mono_img_writer_emit_int16 (w->w, value); } -static inline void +static void emit_int32 (MonoDwarfWriter *w, int value) { mono_img_writer_emit_int32 (w->w, value); } -static inline void +static void emit_symbol_diff (MonoDwarfWriter *w, const char *end, const char* start, int offset) { mono_img_writer_emit_symbol_diff (w->w, end, start, offset); } -static inline void +static void emit_byte (MonoDwarfWriter *w, guint8 val) { mono_img_writer_emit_byte (w->w, val); @@ -1318,7 +1318,7 @@ token_handler (MonoDisHelper *dh, MonoMethod *method, guint32 token) klass = (MonoClass *)data; } else { klass = mono_class_get_checked (m_class_get_image (method->klass), token, error); - g_assert (mono_error_ok (error)); /* FIXME error handling */ + g_assert (is_ok (error)); /* FIXME error handling */ } res = g_strdup_printf ("<%s>", m_class_get_name (klass)); break; @@ -1354,7 +1354,7 @@ token_handler (MonoDisHelper *dh, MonoMethod *method, guint32 token) field = (MonoClassField *)data; } else { field = mono_field_from_token_checked (m_class_get_image (method->klass), token, &klass, NULL, error); - g_assert (mono_error_ok (error)); /* FIXME error handling */ + g_assert (is_ok (error)); /* FIXME error handling */ } desc = mono_field_full_name (field); res = g_strdup_printf ("<%s>", desc); @@ -1444,7 +1444,7 @@ il_offset_from_address (MonoMethod *method, MonoDebugMethodJitInfo *jit, static int max_special_addr_diff = 0; -static inline void +static void emit_advance_op (MonoDwarfWriter *w, int line_diff, int addr_diff) { gint64 opcode = 0; @@ -1519,7 +1519,7 @@ emit_line_number_info (MonoDwarfWriter *w, MonoMethod *method, ln_array = g_new0 (MonoDebugLineNumberEntry, debug_info->num_line_numbers); memcpy (ln_array, debug_info->line_numbers, debug_info->num_line_numbers * sizeof (MonoDebugLineNumberEntry)); - qsort (ln_array, debug_info->num_line_numbers, sizeof (MonoDebugLineNumberEntry), (int (*)(const void *, const void *))compare_lne); + mono_qsort (ln_array, debug_info->num_line_numbers, sizeof (MonoDebugLineNumberEntry), (int (*)(const void *, const void *))compare_lne); native_to_il_offset = g_new0 (int, code_size + 1); diff --git a/mono/mini/ee.h b/mono/mini/ee.h index 1c2595bf52..2bd5da535a 100644 --- a/mono/mini/ee.h +++ b/mono/mini/ee.h @@ -15,7 +15,7 @@ #ifndef __MONO_EE_H__ #define __MONO_EE_H__ -#define MONO_EE_API_VERSION 0xc +#define MONO_EE_API_VERSION 0xd typedef struct _MonoInterpStackIter MonoInterpStackIter; @@ -36,6 +36,7 @@ typedef gpointer MonoInterpFrameHandle; MONO_EE_CALLBACK (void, delegate_ctor, (MonoObjectHandle this_obj, MonoObjectHandle target, gpointer addr, MonoError *error)) \ MONO_EE_CALLBACK (gpointer, get_remoting_invoke, (MonoMethod *method, gpointer imethod, MonoError *error)) \ MONO_EE_CALLBACK (void, set_resume_state, (MonoJitTlsData *jit_tls, MonoException *ex, MonoJitExceptionInfo *ei, MonoInterpFrameHandle interp_frame, gpointer handler_ip)) \ + MONO_EE_CALLBACK (void, get_resume_state, (const MonoJitTlsData *jit_tls, gboolean *has_resume_state, MonoInterpFrameHandle *interp_frame, gpointer *handler_ip)) \ MONO_EE_CALLBACK (gboolean, run_finally, (StackFrameInfo *frame, int clause_index, gpointer handler_ip, gpointer handler_ip_end)) \ MONO_EE_CALLBACK (gboolean, run_filter, (StackFrameInfo *frame, MonoException *ex, int clause_index, gpointer handler_ip, gpointer handler_ip_end)) \ MONO_EE_CALLBACK (void, frame_iter_init, (MonoInterpStackIter *iter, gpointer interp_exit_data)) \ @@ -50,12 +51,13 @@ typedef gpointer MonoInterpFrameHandle; MONO_EE_CALLBACK (gpointer, frame_get_this, (MonoInterpFrameHandle frame)) \ MONO_EE_CALLBACK (gpointer, frame_get_res, (MonoInterpFrameHandle frame)) \ MONO_EE_CALLBACK (void, frame_arg_to_data, (MonoInterpFrameHandle frame, MonoMethodSignature *sig, int index, gpointer data)) \ - MONO_EE_CALLBACK (void, data_to_frame_arg, (MonoInterpFrameHandle frame, MonoMethodSignature *sig, int index, gpointer data)) \ + MONO_EE_CALLBACK (void, data_to_frame_arg, (MonoInterpFrameHandle frame, MonoMethodSignature *sig, int index, gconstpointer data)) \ MONO_EE_CALLBACK (gpointer, frame_arg_to_storage, (MonoInterpFrameHandle frame, MonoMethodSignature *sig, int index)) \ MONO_EE_CALLBACK (void, frame_arg_set_storage, (MonoInterpFrameHandle frame, MonoMethodSignature *sig, int index, gpointer storage)) \ MONO_EE_CALLBACK (MonoInterpFrameHandle, frame_get_parent, (MonoInterpFrameHandle frame)) \ MONO_EE_CALLBACK (void, start_single_stepping, (void)) \ MONO_EE_CALLBACK (void, stop_single_stepping, (void)) \ + MONO_EE_CALLBACK (void, cleanup, (void)) \ typedef struct _MonoEECallbacks { diff --git a/mono/mini/exceptions-amd64.c b/mono/mini/exceptions-amd64.c index 4bb8728c03..e3e79abe08 100644 --- a/mono/mini/exceptions-amd64.c +++ b/mono/mini/exceptions-amd64.c @@ -83,8 +83,10 @@ get_win32_restore_stack (void) if (start) return start; + const int size = 128; + /* restore_stack (void) */ - start = code = mono_global_codeman_reserve (128); + start = code = mono_global_codeman_reserve (size); amd64_push_reg (code, AMD64_RBP); amd64_mov_reg_reg (code, AMD64_RBP, AMD64_RSP, 8); @@ -110,7 +112,7 @@ get_win32_restore_stack (void) amd64_mov_reg_imm (code, AMD64_R11, mono_restore_context); amd64_call_reg (code, AMD64_R11); - g_assert ((code - start) < 128); + g_assertf ((code - start) <= size, "%d %d", (int)(code - start), size); mono_arch_flush_icache (start, code - start); MONO_PROFILER_RAISE (jit_code_buffer, (start, code - start, MONO_PROFILER_CODE_BUFFER_EXCEPTION_HANDLING, NULL)); @@ -249,7 +251,9 @@ mono_arch_get_restore_context (MonoTrampInfo **info, gboolean aot) /* restore_contect (MonoContext *ctx) */ - start = code = (guint8 *)mono_global_codeman_reserve (256); + const int size = 256; + + start = code = (guint8 *)mono_global_codeman_reserve (size); amd64_mov_reg_reg (code, AMD64_R11, AMD64_ARG_REG1, 8); @@ -275,6 +279,8 @@ mono_arch_get_restore_context (MonoTrampInfo **info, gboolean aot) /* jump to the saved IP */ amd64_jump_reg (code, AMD64_R11); + g_assertf ((code - start) <= size, "%d %d", (int)(code - start), size); + mono_arch_flush_icache (start, code - start); MONO_PROFILER_RAISE (jit_code_buffer, (start, code - start, MONO_PROFILER_CODE_BUFFER_EXCEPTION_HANDLING, NULL)); @@ -300,7 +306,7 @@ mono_arch_get_call_filter (MonoTrampInfo **info, gboolean aot) guint32 pos; MonoJumpInfo *ji = NULL; GSList *unwind_ops = NULL; - const guint kMaxCodeSize = 128; + const int kMaxCodeSize = 128; start = code = (guint8 *)mono_global_codeman_reserve (kMaxCodeSize); @@ -361,7 +367,7 @@ mono_arch_get_call_filter (MonoTrampInfo **info, gboolean aot) #endif amd64_ret (code); - g_assert ((code - start) < kMaxCodeSize); + g_assertf ((code - start) <= kMaxCodeSize, "%d %d", (int)(code - start), kMaxCodeSize); mono_arch_flush_icache (start, code - start); MONO_PROFILER_RAISE (jit_code_buffer, (start, code - start, MONO_PROFILER_CODE_BUFFER_EXCEPTION_HANDLING, NULL)); @@ -454,7 +460,7 @@ get_throw_trampoline (MonoTrampInfo **info, gboolean rethrow, gboolean corlib, g MonoJumpInfo *ji = NULL; GSList *unwind_ops = NULL; int i, stack_size, arg_offsets [16], ctx_offset, regs_offset; - const guint kMaxCodeSize = 256; + const int kMaxCodeSize = 256; #ifdef TARGET_WIN32 const int dummy_stack_space = 6 * sizeof (target_mgreg_t); /* Windows expects stack space allocated for all 6 dummy args. */ @@ -550,7 +556,7 @@ get_throw_trampoline (MonoTrampInfo **info, gboolean rethrow, gboolean corlib, g mono_arch_flush_icache (start, code - start); - g_assert ((code - start) < kMaxCodeSize); + g_assertf ((code - start) <= kMaxCodeSize, "%d %d", (int)(code - start), kMaxCodeSize); g_assert_checked (mono_arch_unwindinfo_validate_size (unwind_ops, MONO_MAX_TRAMPOLINE_UNWINDINFO_SIZE)); MONO_PROFILER_RAISE (jit_code_buffer, (start, code - start, MONO_PROFILER_CODE_BUFFER_EXCEPTION_HANDLING, NULL)); @@ -1268,7 +1274,7 @@ fast_find_range_in_table_no_lock_ex (gsize begin_range, gsize end_range, gboolea return found_entry; } -static inline DynamicFunctionTableEntry * +static DynamicFunctionTableEntry * fast_find_range_in_table_no_lock (gsize begin_range, gsize end_range, gboolean *continue_search) { GList *found_entry = fast_find_range_in_table_no_lock_ex (begin_range, end_range, continue_search); @@ -1304,7 +1310,7 @@ find_range_in_table_no_lock_ex (const gpointer code_block, gsize block_size) return found_entry; } -static inline DynamicFunctionTableEntry * +static DynamicFunctionTableEntry * find_range_in_table_no_lock (const gpointer code_block, gsize block_size) { GList *found_entry = find_range_in_table_no_lock_ex (code_block, block_size); @@ -1340,7 +1346,7 @@ find_pc_in_table_no_lock_ex (const gpointer pc) return found_entry; } -static inline DynamicFunctionTableEntry * +static DynamicFunctionTableEntry * find_pc_in_table_no_lock (const gpointer pc) { GList *found_entry = find_pc_in_table_no_lock_ex (pc); @@ -1379,7 +1385,7 @@ validate_table_no_lock (void) #else -static inline void +static void validate_table_no_lock (void) { } @@ -1586,7 +1592,7 @@ mono_arch_unwindinfo_find_rt_func_in_table (const gpointer code, gsize code_size return found_rt_func; } -static inline PRUNTIME_FUNCTION +static PRUNTIME_FUNCTION mono_arch_unwindinfo_find_pc_rt_func_in_table (const gpointer pc) { return mono_arch_unwindinfo_find_rt_func_in_table (pc, 0); @@ -1624,7 +1630,7 @@ validate_rt_funcs_in_table_no_lock (DynamicFunctionTableEntry *entry) #else -static inline void +static void validate_rt_funcs_in_table_no_lock (DynamicFunctionTableEntry *entry) { } @@ -1904,8 +1910,7 @@ mono_tasklets_arch_restore (void) static guint8* saved = NULL; guint8 *code, *start; int cont_reg = AMD64_R9; /* register usable on both call conventions */ - const guint kMaxCodeSize = 64; - + const int kMaxCodeSize = 64; if (saved) return (MonoContinuationRestore)saved; @@ -1941,7 +1946,7 @@ mono_tasklets_arch_restore (void) /* state is already in rax */ amd64_jump_membase (code, cont_reg, MONO_STRUCT_OFFSET (MonoContinuation, return_ip)); - g_assert ((code - start) <= kMaxCodeSize); + g_assertf ((code - start) <= kMaxCodeSize, "%d %d", (int)(code - start), kMaxCodeSize); mono_arch_flush_icache (start, code - start); MONO_PROFILER_RAISE (jit_code_buffer, (start, code - start, MONO_PROFILER_CODE_BUFFER_EXCEPTION_HANDLING, NULL)); diff --git a/mono/mini/exceptions-s390x.c b/mono/mini/exceptions-s390x.c index 91011e5543..fe5ca321bc 100644 --- a/mono/mini/exceptions-s390x.c +++ b/mono/mini/exceptions-s390x.c @@ -57,6 +57,7 @@ #include #include #include +#include #include "mini.h" #include "mini-s390x.h" @@ -339,6 +340,7 @@ mono_arch_get_throw_exception_generic (int size, MonoTrampInfo **info, int corli s390_std (code, i, 0, STK_BASE, pos); pos += sizeof (gdouble); } + /*------------------------------------------------------*/ /* save the access registers */ /*------------------------------------------------------*/ @@ -499,7 +501,7 @@ mono_arch_unwind_frame (MonoDomain *domain, MonoJitTlsData *jit_tls, *new_ctx = *ctx; if (ji != NULL) { - gint64 address; + uintptr_t address; guint8 *cfa; guint32 unwind_info_len; guint8 *unwind_info; @@ -633,7 +635,7 @@ mono_arch_setup_async_callback (MonoContext *ctx, void (*async_cb)(void *fun), g ctx->uc_mcontext.gregs[2] = (gsize)user_data; sp -= S390_MINIMAL_STACK_SIZE; - *(unsigned long *)sp = MONO_CONTEXT_GET_SP(ctx); + *(unsigned long *)sp = (uintptr_t) MONO_CONTEXT_GET_SP(ctx); MONO_CONTEXT_SET_BP(ctx, sp); MONO_CONTEXT_SET_IP(ctx, (gsize)async_cb); } diff --git a/mono/mini/exceptions-x86.c b/mono/mini/exceptions-x86.c index c44b95d4b6..e1ccad3e42 100644 --- a/mono/mini/exceptions-x86.c +++ b/mono/mini/exceptions-x86.c @@ -58,7 +58,7 @@ extern int (*gUnhandledExceptionHandler)(EXCEPTION_POINTERS*); #define W32_SEH_HANDLE_EX(_ex) \ if (_ex##_handler) _ex##_handler(er->ExceptionCode, &info, ctx) -LONG CALLBACK seh_unhandled_exception_filter(EXCEPTION_POINTERS* ep) +static LONG CALLBACK seh_unhandled_exception_filter(EXCEPTION_POINTERS* ep) { #ifndef MONO_CROSS_COMPILE if (mono_old_win_toplevel_exception_filter) { @@ -86,8 +86,10 @@ mono_win32_get_handle_stackoverflow (void) if (start) return start; + const int size = 128; + /* restore_contect (void *sigctx) */ - start = code = mono_global_codeman_reserve (128); + start = code = mono_global_codeman_reserve (size); /* load context into ebx */ x86_mov_reg_membase (code, X86_EBX, X86_ESP, 4, 4); @@ -116,6 +118,8 @@ mono_win32_get_handle_stackoverflow (void) /* return */ x86_ret (code); + g_assertf ((code - start) <= size, "%d %d", (int)(code - start), size); + mono_arch_flush_icache (start, code - start); MONO_PROFILER_RAISE (jit_code_buffer, (start, code - start, MONO_PROFILER_CODE_BUFFER_EXCEPTION_HANDLING, NULL)); @@ -138,8 +142,6 @@ mono_win32_get_handle_stackoverflow (void) static void win32_handle_stack_overflow (EXCEPTION_POINTERS* ep, CONTEXT *sctx) { - SYSTEM_INFO si; - DWORD page_size; MonoDomain *domain = mono_domain_get (); MonoJitInfo rji; MonoJitTlsData *jit_tls = mono_tls_get_jit_tls (); @@ -150,10 +152,6 @@ win32_handle_stack_overflow (EXCEPTION_POINTERS* ep, CONTEXT *sctx) StackFrameInfo frame; mono_sigctx_to_monoctx (sctx, &ctx); - - /* get our os page size */ - GetSystemInfo(&si); - page_size = si.dwPageSize; /* Let's walk the stack to recover * the needed stack space (if possible) @@ -193,7 +191,7 @@ win32_handle_stack_overflow (EXCEPTION_POINTERS* ep, CONTEXT *sctx) * Unhandled Exception Filter * Top-level per-process exception handler. */ -LONG CALLBACK seh_vectored_exception_handler(EXCEPTION_POINTERS* ep) +static LONG CALLBACK seh_vectored_exception_handler(EXCEPTION_POINTERS* ep) { EXCEPTION_RECORD* er; CONTEXT* ctx; @@ -297,7 +295,9 @@ mono_arch_get_restore_context (MonoTrampInfo **info, gboolean aot) /* restore_contect (MonoContext *ctx) */ - start = code = mono_global_codeman_reserve (128); + const int size = 128; + + start = code = mono_global_codeman_reserve (size); /* load ctx */ x86_mov_reg_membase (code, X86_EAX, X86_ESP, 4, 4); @@ -362,6 +362,8 @@ mono_arch_get_restore_context (MonoTrampInfo **info, gboolean aot) g_slist_free (unwind_ops); } + g_assertf ((code - start) <= size, "%d %d", (int)(code - start), size); + mono_arch_flush_icache (start, code - start); MONO_PROFILER_RAISE (jit_code_buffer, (start, code - start, MONO_PROFILER_CODE_BUFFER_EXCEPTION_HANDLING, NULL)); @@ -382,7 +384,7 @@ mono_arch_get_call_filter (MonoTrampInfo **info, gboolean aot) guint8 *code; MonoJumpInfo *ji = NULL; GSList *unwind_ops = NULL; - guint kMaxCodeSize = 64; + const int kMaxCodeSize = 64; /* call_filter (MonoContext *ctx, unsigned long eip) */ start = code = mono_global_codeman_reserve (kMaxCodeSize); @@ -443,7 +445,7 @@ mono_arch_get_call_filter (MonoTrampInfo **info, gboolean aot) mono_arch_flush_icache (start, code - start); MONO_PROFILER_RAISE (jit_code_buffer, (start, code - start, MONO_PROFILER_CODE_BUFFER_EXCEPTION_HANDLING, NULL)); - g_assert ((code - start) < kMaxCodeSize); + g_assertf ((code - start) <= kMaxCodeSize, "%d %d", (int)(code - start), kMaxCodeSize); return start; } @@ -546,7 +548,7 @@ get_throw_trampoline (const char *name, gboolean rethrow, gboolean llvm, gboolea int i, stack_size, stack_offset, arg_offsets [5], regs_offset; MonoJumpInfo *ji = NULL; GSList *unwind_ops = NULL; - guint kMaxCodeSize = 192; + const int kMaxCodeSize = 192; start = code = mono_global_codeman_reserve (kMaxCodeSize); @@ -672,7 +674,7 @@ get_throw_trampoline (const char *name, gboolean rethrow, gboolean llvm, gboolea } x86_breakpoint (code); - g_assert ((code - start) < kMaxCodeSize); + g_assertf ((code - start) <= kMaxCodeSize, "%d %d", (int)(code - start), kMaxCodeSize); if (info) *info = mono_tramp_info_create (name, start, code - start, ji, unwind_ops); @@ -952,7 +954,9 @@ mono_x86_get_signal_exception_trampoline (MonoTrampInfo **info, gboolean aot) GSList *unwind_ops = NULL; int stack_size; - start = code = mono_global_codeman_reserve (128); + const int size = 128; + + start = code = mono_global_codeman_reserve (size); /* FIXME no unwind before we push ip */ /* Caller ip */ @@ -972,7 +976,7 @@ mono_x86_get_signal_exception_trampoline (MonoTrampInfo **info, gboolean aot) /* Branch to target */ x86_call_reg (code, X86_EDX); - g_assert ((code - start) < 128); + g_assertf ((code - start) <= size, "%d %d", (int)(code - start), size); if (info) *info = mono_tramp_info_create ("x86_signal_exception_trampoline", start, code - start, ji, unwind_ops); @@ -984,6 +988,8 @@ mono_x86_get_signal_exception_trampoline (MonoTrampInfo **info, gboolean aot) g_slist_free (unwind_ops); } + g_assertf ((code - start) <= size, "%d %d", (int)(code - start), size); + mono_arch_flush_icache (start, code - start); MONO_PROFILER_RAISE (jit_code_buffer, (start, code - start, MONO_PROFILER_CODE_BUFFER_EXCEPTION_HANDLING, NULL)); @@ -1055,6 +1061,7 @@ mono_arch_handle_exception (void *sigctx, gpointer obj) #endif } +#if defined (MONO_ARCH_USE_SIGACTION) && !defined (MONO_CROSS_COMPILE) static MonoObject* restore_soft_guard_pages (void) { @@ -1089,7 +1096,6 @@ prepare_for_guard_pages (MonoContext *mctx) mctx->esp = (unsigned long)sp; } - static void altstack_handle_and_restore (MonoContext *ctx, gpointer obj, gboolean stack_ovf) { @@ -1105,6 +1111,7 @@ altstack_handle_and_restore (MonoContext *ctx, gpointer obj, gboolean stack_ovf) } mono_restore_context (&mctx); } +#endif void mono_arch_handle_altstack_exception (void *sigctx, MONO_SIG_HANDLER_INFO_TYPE *siginfo, gpointer fault_addr, gboolean stack_ovf) @@ -1176,7 +1183,10 @@ mono_tasklets_arch_restore (void) if (saved) return (MonoContinuationRestore)saved; - code = start = mono_global_codeman_reserve (48); + + const int size = 48; + + code = start = mono_global_codeman_reserve (size); /* the signature is: restore (MonoContinuation *cont, int state, MonoLMF **lmf_addr) */ /* put cont in edx */ x86_mov_reg_membase (code, X86_EDX, X86_ESP, 4, 4); @@ -1205,6 +1215,8 @@ mono_tasklets_arch_restore (void) x86_jump_membase (code, X86_EDX, MONO_STRUCT_OFFSET (MonoContinuation, return_ip)); + g_assertf ((code - start) <= size, "%d %d", (int)(code - start), size); + mono_arch_flush_icache (start, code - start); MONO_PROFILER_RAISE (jit_code_buffer, (start, code - start, MONO_PROFILER_CODE_BUFFER_EXCEPTION_HANDLING, NULL)); g_assert ((code - start) <= 48); diff --git a/mono/mini/exceptions.cs b/mono/mini/exceptions.cs index 5db7e5e6f3..fe5bc32817 100644 --- a/mono/mini/exceptions.cs +++ b/mono/mini/exceptions.cs @@ -1469,7 +1469,6 @@ class Tests return 0; } - [Category ("!WASM")] // reported as https://github.com/kripken/emscripten/issues/5603 public static int test_0_simple_double_casts () { double d = 0xffffffff; diff --git a/mono/mini/iltests.il b/mono/mini/iltests.il index f931a0b4de..5ed1651f55 100644 --- a/mono/mini/iltests.il +++ b/mono/mini/iltests.il @@ -25,6 +25,132 @@ ret } + .method hidebysig static int32 comp_ptr_i8(void* arg, int64 v) cil managed + { + .maxstack 2 + + ldarg.0 + ldarg.1 + ceq + ret + } + + .method hidebysig static int64 add_ptr_i4(void* arg) cil managed + { + .maxstack 2 + + ldarg.0 + ldc.i4.2 + add + ret + } + + .method hidebysig static int64 add_ptr_i8(void* arg, int64 v) cil managed + { + .maxstack 2 + + ldarg.0 + ldarg.1 + add + ret + } + + .method hidebysig static int64 and_ptr_i8(void* arg, int64 v) cil managed + { + .maxstack 2 + + ldarg.0 + ldarg.1 + and + ret + } + + .method hidebysig static int32 i8_ptr_arithm_x64() cil managed + { + .maxstack 3 + + ldc.i4.1 + ldc.i8 0x1111222233334444 + call int64 class Tests::add_ptr_i4(void*) + ldc.i8 0x1111222233334446 + bne.un FAIL1 + pop + + ldc.i4.2 + ldc.i8 0x1111222233334444 + ldc.i8 0x2 + call int64 class Tests::add_ptr_i8(void*,int64) + ldc.i8 0x1111222233334446 + bne.un FAIL1 + pop + + ldc.i4.3 + ldc.i8 0x1111222233334444 + ldc.i4 0x2 + call int64 class Tests::add_ptr_i8(void*,int64) + ldc.i8 0x1111222233334446 + bne.un FAIL1 + pop + + ldc.i4.4 + ldc.i8 0x1111222233334444 + ldc.i8 0x0000FFFF00000000 + call int64 class Tests::and_ptr_i8(void*,int64) + ldc.i8 0x0000222200000000 + bne.un FAIL1 + pop + + ldc.i4.5 + ldc.i8 0x1111222233334444 + ldc.i4 0xFFFF0000 + call int64 class Tests::and_ptr_i8(void*,int64) + ldc.i8 0x1111222233330000 + bne.un FAIL1 + pop + + ldc.i4.6 + ldc.i8 0x1111222233334444 + ldc.i4 0xFFFF0000 + and + ldc.i8 0x1111222233330000 + bne.un FAIL1 + pop + + ldc.i4.7 + ldc.i8 0x1111222233334444 + ldc.i8 0x1111222233334444 + call int32 class Tests::comp_ptr_i8(void*,int64) + ldc.i4.1 + bne.un FAIL1 + pop + + ldc.i4.8 + ldc.i8 0x1111222233334444 + ldc.i4 0x1111 + add + ldc.i8 0x1111222233335555 + bne.un FAIL1 + pop + + ldc.i4.0 +FAIL1: + ret + } + + .method static public int32 test_0_i8_ptr_arithm() cil managed { + .maxstack 2 + + sizeof [mscorlib]System.IntPtr + ldc.i4.8 + bne.un OK1 + call int32 class Tests::i8_ptr_arithm_x64() + ret + +OK1: + ldc.i4.0 + ret + } + // make sure the register allocator works when the return value of // 'div' is discarded .method static public int32 test_0_div_regalloc () il managed { diff --git a/mono/mini/image-writer.c b/mono/mini/image-writer.c index 08b4002a4f..7314c5ee83 100644 --- a/mono/mini/image-writer.c +++ b/mono/mini/image-writer.c @@ -1700,7 +1700,7 @@ asm_writer_emit_section_change (MonoImageWriter *acfg, const char *section_name, #endif } -static inline +static const char *get_label (const char *s) { #ifdef TARGET_ASM_APPLE @@ -1896,7 +1896,7 @@ asm_writer_emit_bytes (MonoImageWriter *acfg, const guint8* buf, int size) } } -static inline void +static void asm_writer_emit_int16 (MonoImageWriter *acfg, int value) { if (acfg->mode != EMIT_WORD) { @@ -1910,7 +1910,7 @@ asm_writer_emit_int16 (MonoImageWriter *acfg, int value) fprintf (acfg->fp, "%d", value); } -static inline void +static void asm_writer_emit_int32 (MonoImageWriter *acfg, int value) { if (acfg->mode != EMIT_LONG) { diff --git a/mono/mini/interp-stubs.c b/mono/mini/interp-stubs.c index 78cc3cea09..a77e85c29a 100644 --- a/mono/mini/interp-stubs.c +++ b/mono/mini/interp-stubs.c @@ -81,12 +81,23 @@ stub_stop_single_stepping (void) { } +static void +stub_cleanup (void) +{ +} + static void stub_set_resume_state (MonoJitTlsData *jit_tls, MonoException *ex, MonoJitExceptionInfo *ei, MonoInterpFrameHandle interp_frame, gpointer handler_ip) { g_assert_not_reached (); } +static void +stub_get_resume_state (const MonoJitTlsData *jit_tls, gboolean *has_resume_state, MonoInterpFrameHandle *interp_frame, gpointer *handler_ip) +{ + *has_resume_state = FALSE; +} + static gboolean stub_run_finally (StackFrameInfo *frame, int clause_index, gpointer handler_ip, gpointer handler_ip_end) { @@ -172,7 +183,7 @@ g_assert_not_reached (); } static void -stub_data_to_frame_arg (MonoInterpFrameHandle frame, MonoMethodSignature *sig, int index, gpointer data) +stub_data_to_frame_arg (MonoInterpFrameHandle frame, MonoMethodSignature *sig, int index, gconstpointer data) { g_assert_not_reached (); } diff --git a/mono/mini/interp/interp-internals.h b/mono/mini/interp/interp-internals.h index e29b9a6571..d509e62f1c 100644 --- a/mono/mini/interp/interp-internals.h +++ b/mono/mini/interp/interp-internals.h @@ -39,7 +39,9 @@ enum { }; enum { - INTERP_OPT_INLINE = 1 + INTERP_OPT_INLINE = 1, + INTERP_OPT_CPROP = 2, + INTERP_OPT_DEFAULT = INTERP_OPT_INLINE | INTERP_OPT_CPROP }; #if SIZEOF_VOID_P == 4 @@ -50,6 +52,50 @@ typedef guint64 mono_u; typedef gint64 mono_i; #endif + +/* + * GC SAFETY: + * + * The interpreter executes in gc unsafe (non-preempt) mode. On wasm, the C stack is + * scannable but the wasm stack is not, so to make the code GC safe, the following rules + * should be followed: + * - every objref handled by the code needs to either be stored volatile or stored + * into a volatile; volatile stores are stack packable, volatile values are not. + * Use either OBJREF or stackval->data.o. + * This will ensure the objects are pinned. A volatile local + * is on the stack and not in registers. Volatile stores ditto. + * - minimize the number of MonoObject* locals/arguments (or make them volatile). + * + * Volatile on a type/local forces all reads and writes to go to memory/stack, + * and each such local to have a unique address. + * + * Volatile absence on a type/local allows multiple locals to share storage, + * if their lifetimes do not overlap. This is called "stack packing". + * + * Volatile absence on a type/local allows the variable to live in + * both stack and register, for fast reads and "write through". + */ +#ifdef TARGET_WASM + +#define WASM_VOLATILE volatile + +static inline MonoObject * WASM_VOLATILE * +mono_interp_objref (MonoObject **o) +{ + return o; +} + +#define OBJREF(x) (*mono_interp_objref (&x)) + +#else + +#define WASM_VOLATILE /* nothing */ + +#define OBJREF(x) x + +#endif + + /* * Value types are represented on the eval stack as pointers to the * actual storage. The size field tells how much storage is allocated. @@ -65,11 +111,7 @@ typedef struct { } pair; float f_r4; double f; -#ifdef TARGET_WASM - MonoObject * volatile o; -#else - MonoObject *o; -#endif + MonoObject * WASM_VOLATILE o; /* native size integer and pointer types */ gpointer p; mono_u nati; @@ -131,39 +173,34 @@ struct _InterpFrame { InterpFrame *parent; /* parent */ InterpMethod *imethod; /* parent */ stackval *retval; /* parent */ - char *args; - char *varargs; stackval *stack_args; /* parent */ stackval *stack; - unsigned char *locals; - /* - * For GC tracking of local objrefs in exec_method (). - * Storing into this field will keep the object pinned - * until the objref can be stored into stackval->data.o. - */ -#ifdef TARGET_WASM - MonoObject* volatile o; -#endif /* exception info */ const unsigned short *ip; - MonoException *ex; - GSList *finally_ips; - const unsigned short *endfinally_ip; }; +#define frame_locals(frame) (((guchar*)((frame)->stack)) + (frame)->imethod->stack_size + (frame)->imethod->vt_stack_size) + typedef struct { - /* Resume state for resuming execution in mixed mode */ - gboolean has_resume_state; + /* Lets interpreter know it has to resume execution after EH */ + gboolean has_resume_state; /* Frame to resume execution at */ InterpFrame *handler_frame; /* IP to resume execution at */ - guint16 *handler_ip; + const guint16 *handler_ip; /* Clause that we are resuming to */ MonoJitExceptionInfo *handler_ei; + /* Exception that is being thrown. Set with rest of resume state */ + guint32 exc_gchandle; } ThreadContext; typedef struct { gint64 transform_time; + gint64 cprop_time; + gint32 stloc_nps; + gint32 movlocs; + gint32 copy_propagations; + gint32 killed_instructions; gint32 inlined_methods; gint32 inline_failures; } MonoInterpStats; diff --git a/mono/mini/interp/interp.c.REMOVED.git-id b/mono/mini/interp/interp.c.REMOVED.git-id index 1bb90804ee..e57016cfa5 100644 --- a/mono/mini/interp/interp.c.REMOVED.git-id +++ b/mono/mini/interp/interp.c.REMOVED.git-id @@ -1 +1 @@ -948207b430fa24ab2eeb79e23040c4754394818b \ No newline at end of file +53b777c07f649f70e4938cd89fcfc4e3b1f47d08 \ No newline at end of file diff --git a/mono/mini/interp/mintops.c b/mono/mini/interp/mintops.c index 1a6321dec8..f7528bc5f0 100644 --- a/mono/mini/interp/mintops.c +++ b/mono/mini/interp/mintops.c @@ -10,28 +10,60 @@ #include #include "mintops.h" -#define OPDEF(a,b,c,d) \ - b, -const char *mono_interp_opname[] = { +// This, instead of an array of pointers, to optimize away a pointer and a relocation per string. +struct MonoInterpOpnameCharacters { +#define OPDEF(a,b,c,d,e,f) char a [sizeof (b)]; #include "mintops.def" - "" }; #undef OPDEF -#define OPDEF(a,b,c,d) \ - c, -unsigned char mono_interp_oplen[] = { +const MonoInterpOpnameCharacters mono_interp_opname_characters = { +#define OPDEF(a,b,c,d,e,f) b, #include "mintops.def" - 0 }; #undef OPDEF - -#define OPDEF(a,b,c,d) \ - d, -MintOpArgType mono_interp_opargtype[] = { +const guint16 mono_interp_opname_offsets [] = { +#define OPDEF(a,b,c,d,e,f) offsetof (MonoInterpOpnameCharacters, a), +#include "mintops.def" +#undef OPDEF +}; + +#define OPDEF(a,b,c,d,e,f) c, +unsigned char const mono_interp_oplen [] = { +#include "mintops.def" +}; +#undef OPDEF + +#define Push0 0 +#define Push1 1 +#define Push2 2 +#define Pop0 0 +#define Pop1 1 +#define Pop2 2 +#define Pop3 3 +#define Pop4 4 +#define Pop5 5 +#define Pop6 6 +#define PopAll MINT_POP_ALL +#define VarPush MINT_VAR_PUSH +#define VarPop MINT_VAR_POP + +#define OPDEF(a,b,c,d,e,f) d, +int const mono_interp_oppop[] = { +#include "mintops.def" +}; +#undef OPDEF + +#define OPDEF(a,b,c,d,e,f) e, +int const mono_interp_oppush[] = { +#include "mintops.def" +}; +#undef OPDEF + +#define OPDEF(a,b,c,d,e,f) f, +MintOpArgType const mono_interp_opargtype [] = { #include "mintops.def" - (MintOpArgType)0 }; #undef OPDEF @@ -58,7 +90,7 @@ mono_interp_dis_mintop(const guint16 *base, const guint16 *ip) guint32 token; int target; - g_string_append_printf (str, "IL_%04x: %-10s", (int)(ip - base), mono_interp_opname [*ip]); + g_string_append_printf (str, "IR_%04x: %-10s", (int)(ip - base), mono_interp_opname (*ip)); switch (mono_interp_opargtype [*ip]) { case MintOpNoArgs: break; @@ -98,11 +130,11 @@ mono_interp_dis_mintop(const guint16 *base, const guint16 *ip) } case MintOpShortBranch: target = ip + * (short *)(ip + 1) - base; - g_string_append_printf (str, " IL_%04x", target); + g_string_append_printf (str, " IR_%04x", target); break; case MintOpBranch: target = ip + (gint32)READ32 (ip + 1) - base; - g_string_append_printf (str, " IL_%04x", target); + g_string_append_printf (str, " IR_%04x", target); break; case MintOpSwitch: { const guint16 *p = ip + 1; @@ -115,7 +147,7 @@ mono_interp_dis_mintop(const guint16 *base, const guint16 *ip) if (i > 0) g_string_append_printf (str, ", "); offset = (gint32)READ32 (p); - g_string_append_printf (str, "IL_%04x", (int)(p + offset - base)); + g_string_append_printf (str, "IR_%04x", (int)(p + offset - base)); p += 2; } g_string_append_printf (str, ")"); @@ -128,3 +160,8 @@ mono_interp_dis_mintop(const guint16 *base, const guint16 *ip) return g_string_free (str, FALSE); } +const char* +mono_interp_opname (int op) +{ + return ((const char*)&mono_interp_opname_characters) + mono_interp_opname_offsets [op]; +} diff --git a/mono/mini/interp/mintops.def b/mono/mini/interp/mintops.def index 0b2e887b03..9a95e56eaa 100644 --- a/mono/mini/interp/mintops.def +++ b/mono/mini/interp/mintops.def @@ -6,716 +6,723 @@ * */ -/* OPDEF (opsymbol, opstring, oplength (in uint16s), optype) */ - -OPDEF(MINT_NOP, "nop", 1, MintOpNoArgs) -OPDEF(MINT_NIY, "niy", 1, MintOpNoArgs) -OPDEF(MINT_BREAK, "break", 1, MintOpNoArgs) -OPDEF(MINT_BREAKPOINT, "breakpoint", 1, MintOpNoArgs) -OPDEF(MINT_LDNULL, "ldnull", 1, MintOpNoArgs) -OPDEF(MINT_DUP, "dup", 1, MintOpNoArgs) -OPDEF(MINT_DUP_VT, "dup.vt", 3, MintOpInt) -OPDEF(MINT_POP, "pop", 2, MintOpShortInt) - -OPDEF(MINT_RET, "ret", 1, MintOpNoArgs) -OPDEF(MINT_RET_VOID, "ret.void", 1, MintOpNoArgs) -OPDEF(MINT_RET_VT, "ret.vt", 3, MintOpInt) - -OPDEF(MINT_VTRESULT, "vtresult", 4, MintOpShortAndInt) /*FIX should be unsigned*/ - -OPDEF(MINT_LDC_I4_M1, "ldc.i4.m1", 1, MintOpNoArgs) -OPDEF(MINT_LDC_I4_0, "ldc.i4.0", 1, MintOpNoArgs) -OPDEF(MINT_LDC_I4_1, "ldc.i4.1", 1, MintOpNoArgs) -OPDEF(MINT_LDC_I4_2, "ldc.i4.2", 1, MintOpNoArgs) -OPDEF(MINT_LDC_I4_3, "ldc.i4.3", 1, MintOpNoArgs) -OPDEF(MINT_LDC_I4_4, "ldc.i4.4", 1, MintOpNoArgs) -OPDEF(MINT_LDC_I4_5, "ldc.i4.5", 1, MintOpNoArgs) -OPDEF(MINT_LDC_I4_6, "ldc.i4.6", 1, MintOpNoArgs) -OPDEF(MINT_LDC_I4_7, "ldc.i4.7", 1, MintOpNoArgs) -OPDEF(MINT_LDC_I4_8, "ldc.i4.8", 1, MintOpNoArgs) - -OPDEF(MINT_LDC_I4_S, "ldc.i4.s", 2, MintOpShortInt) -OPDEF(MINT_LDC_I4, "ldc.i4", 3, MintOpInt) -OPDEF(MINT_LDC_I8, "ldc.i8", 5, MintOpLongInt) -OPDEF(MINT_LDC_I8_S, "ldc.i8.s", 2, MintOpShortInt) - -OPDEF(MINT_LDC_R4, "ldc.r4", 3, MintOpFloat) -OPDEF(MINT_LDC_R8, "ldc.r8", 5, MintOpDouble) - -OPDEF(MINT_ARGLIST, "arglist", 1, MintOpNoArgs) - -OPDEF(MINT_LDARG_I1, "ldarg.i1", 2, MintOpUShortInt) -OPDEF(MINT_LDARG_U1, "ldarg.u1", 2, MintOpUShortInt) -OPDEF(MINT_LDARG_I2, "ldarg.i2", 2, MintOpUShortInt) -OPDEF(MINT_LDARG_U2, "ldarg.u2", 2, MintOpUShortInt) -OPDEF(MINT_LDARG_I4, "ldarg.i4", 2, MintOpUShortInt) -OPDEF(MINT_LDARG_I8, "ldarg.i8", 2, MintOpUShortInt) -OPDEF(MINT_LDARG_R4, "ldarg.r4", 2, MintOpUShortInt) -OPDEF(MINT_LDARG_R8, "ldarg.r8", 2, MintOpUShortInt) -OPDEF(MINT_LDARG_O, "ldarg.o", 2, MintOpUShortInt) -OPDEF(MINT_LDARG_P, "ldarg.p", 2, MintOpUShortInt) -OPDEF(MINT_LDARG_VT, "ldarg.vt", 4, MintOpShortAndInt) - -OPDEF(MINT_STARG_I1, "starg.i1", 2, MintOpUShortInt) -OPDEF(MINT_STARG_U1, "starg.u1", 2, MintOpUShortInt) -OPDEF(MINT_STARG_I2, "starg.i2", 2, MintOpUShortInt) -OPDEF(MINT_STARG_U2, "starg.u2", 2, MintOpUShortInt) -OPDEF(MINT_STARG_I4, "starg.i4", 2, MintOpUShortInt) -OPDEF(MINT_STARG_I8, "starg.i8", 2, MintOpUShortInt) -OPDEF(MINT_STARG_R4, "starg.r4", 2, MintOpUShortInt) -OPDEF(MINT_STARG_R8, "starg.r8", 2, MintOpUShortInt) -OPDEF(MINT_STARG_O, "starg.o", 2, MintOpUShortInt) -OPDEF(MINT_STARG_P, "starg.p", 2, MintOpUShortInt) -OPDEF(MINT_STARG_VT, "starg.vt", 4, MintOpShortAndInt) - -OPDEF(MINT_LDARGA, "ldarga", 2, MintOpUShortInt) -OPDEF(MINT_LDARGA_VT, "ldarga.vt", 2, MintOpUShortInt) - -OPDEF(MINT_LDFLD_I1, "ldfld.i1", 2, MintOpUShortInt) -OPDEF(MINT_LDFLD_U1, "ldfld.u1", 2, MintOpUShortInt) -OPDEF(MINT_LDFLD_I2, "ldfld.i2", 2, MintOpUShortInt) -OPDEF(MINT_LDFLD_U2, "ldfld.u2", 2, MintOpUShortInt) -OPDEF(MINT_LDFLD_I4, "ldfld.i4", 2, MintOpUShortInt) -OPDEF(MINT_LDFLD_I8, "ldfld.i8", 2, MintOpUShortInt) -OPDEF(MINT_LDFLD_R4, "ldfld.r4", 2, MintOpUShortInt) -OPDEF(MINT_LDFLD_R8, "ldfld.r8", 2, MintOpUShortInt) -OPDEF(MINT_LDFLD_O, "ldfld.o", 2, MintOpUShortInt) -OPDEF(MINT_LDFLD_P, "ldfld.p", 2, MintOpUShortInt) -OPDEF(MINT_LDFLD_VT, "ldfld.vt", 4, MintOpShortAndInt) -OPDEF(MINT_LDFLD_I8_UNALIGNED, "ldfld.i8.unaligned", 2, MintOpUShortInt) -OPDEF(MINT_LDFLD_R8_UNALIGNED, "ldfld.r8.unaligned", 2, MintOpUShortInt) - -OPDEF(MINT_LDRMFLD, "ldrmfld", 2, MintOpFieldToken) -OPDEF(MINT_LDRMFLD_VT, "ldrmfld.vt", 2, MintOpUShortInt) - -OPDEF(MINT_LDFLDA, "ldflda", 2, MintOpUShortInt) -OPDEF(MINT_LDFLDA_UNSAFE, "ldflda.unsafe", 2, MintOpUShortInt) - -OPDEF(MINT_STFLD_I1, "stfld.i1", 2, MintOpUShortInt) -OPDEF(MINT_STFLD_U1, "stfld.u1", 2, MintOpUShortInt) -OPDEF(MINT_STFLD_I2, "stfld.i2", 2, MintOpUShortInt) -OPDEF(MINT_STFLD_U2, "stfld.u2", 2, MintOpUShortInt) -OPDEF(MINT_STFLD_I4, "stfld.i4", 2, MintOpUShortInt) -OPDEF(MINT_STFLD_I8, "stfld.i8", 2, MintOpUShortInt) -OPDEF(MINT_STFLD_R4, "stfld.r4", 2, MintOpUShortInt) -OPDEF(MINT_STFLD_R8, "stfld.r8", 2, MintOpUShortInt) -OPDEF(MINT_STFLD_O, "stfld.o", 2, MintOpUShortInt) -OPDEF(MINT_STFLD_P, "stfld.p", 2, MintOpUShortInt) -OPDEF(MINT_STFLD_VT, "stfld.vt", 3, MintOpTwoShorts) -OPDEF(MINT_STFLD_I8_UNALIGNED, "stfld.i8.unaligned", 2, MintOpUShortInt) -OPDEF(MINT_STFLD_R8_UNALIGNED, "stfld.r8.unaligned", 2, MintOpUShortInt) - -OPDEF(MINT_STRMFLD, "strmfld", 2, MintOpFieldToken) -OPDEF(MINT_STRMFLD_VT, "strmfld.vt", 2, MintOpUShortInt) - -OPDEF(MINT_LDTSFLD_I1, "ldtsfld.i1", 3, MintOpInt) -OPDEF(MINT_LDTSFLD_U1, "ldtsfld.u1", 3, MintOpInt) -OPDEF(MINT_LDTSFLD_I2, "ldtsfld.i2", 3, MintOpInt) -OPDEF(MINT_LDTSFLD_U2, "ldtsfld.u2", 3, MintOpInt) -OPDEF(MINT_LDTSFLD_I4, "ldtsfld.i4", 3, MintOpInt) -OPDEF(MINT_LDTSFLD_I8, "ldtsfld.i8", 3, MintOpInt) -OPDEF(MINT_LDTSFLD_R4, "ldtsfld.r4", 3, MintOpInt) -OPDEF(MINT_LDTSFLD_R8, "ldtsfld.r8", 3, MintOpInt) -OPDEF(MINT_LDTSFLD_O, "ldtsfld.o", 3, MintOpInt) -OPDEF(MINT_LDTSFLD_P, "ldtsfld.p", 3, MintOpInt) -OPDEF(MINT_LDSSFLD, "ldssfld", 4, MintOpFieldToken) -OPDEF(MINT_LDSSFLD_VT, "ldssfld.vt", 5, MintOpInt) - -OPDEF(MINT_LDSFLD_I1, "ldsfld.i1", 3, MintOpUShortInt) -OPDEF(MINT_LDSFLD_U1, "ldsfld.u1", 3, MintOpUShortInt) -OPDEF(MINT_LDSFLD_I2, "ldsfld.i2", 3, MintOpUShortInt) -OPDEF(MINT_LDSFLD_U2, "ldsfld.u2", 3, MintOpUShortInt) -OPDEF(MINT_LDSFLD_I4, "ldsfld.i4", 3, MintOpUShortInt) -OPDEF(MINT_LDSFLD_I8, "ldsfld.i8", 3, MintOpUShortInt) -OPDEF(MINT_LDSFLD_R4, "ldsfld.r4", 3, MintOpUShortInt) -OPDEF(MINT_LDSFLD_R8, "ldsfld.r8", 3, MintOpUShortInt) -OPDEF(MINT_LDSFLD_O, "ldsfld.o", 3, MintOpUShortInt) -OPDEF(MINT_LDSFLD_P, "ldsfld.p", 3, MintOpUShortInt) -OPDEF(MINT_LDSFLD_VT, "ldsfld.vt", 5, MintOpTwoShorts) - -OPDEF(MINT_STTSFLD_I1, "sttsfld.i1", 3, MintOpInt) -OPDEF(MINT_STTSFLD_U1, "sttsfld.u1", 3, MintOpInt) -OPDEF(MINT_STTSFLD_I2, "sttsfld.i2", 3, MintOpInt) -OPDEF(MINT_STTSFLD_U2, "sttsfld.u2", 3, MintOpInt) -OPDEF(MINT_STTSFLD_I4, "sttsfld.i4", 3, MintOpInt) -OPDEF(MINT_STTSFLD_I8, "sttsfld.i8", 3, MintOpInt) -OPDEF(MINT_STTSFLD_R4, "sttsfld.r4", 3, MintOpInt) -OPDEF(MINT_STTSFLD_R8, "sttsfld.r8", 3, MintOpInt) -OPDEF(MINT_STTSFLD_O, "sttsfld.o", 3, MintOpInt) -OPDEF(MINT_STTSFLD_P, "sttsfld.p", 3, MintOpInt) -OPDEF(MINT_STSSFLD, "stssfld", 4, MintOpFieldToken) -OPDEF(MINT_STSSFLD_VT, "stssfld.vt", 5, MintOpInt) -OPDEF(MINT_STSFLD_I1, "stsfld.i1", 3, MintOpUShortInt) -OPDEF(MINT_STSFLD_U1, "stsfld.u1", 3, MintOpUShortInt) -OPDEF(MINT_STSFLD_I2, "stsfld.i2", 3, MintOpUShortInt) -OPDEF(MINT_STSFLD_U2, "stsfld.u2", 3, MintOpUShortInt) -OPDEF(MINT_STSFLD_I4, "stsfld.i4", 3, MintOpUShortInt) -OPDEF(MINT_STSFLD_I8, "stsfld.i8", 3, MintOpUShortInt) -OPDEF(MINT_STSFLD_R4, "stsfld.r4", 3, MintOpUShortInt) -OPDEF(MINT_STSFLD_R8, "stsfld.r8", 3, MintOpUShortInt) -OPDEF(MINT_STSFLD_O, "stsfld.o", 3, MintOpUShortInt) -OPDEF(MINT_STSFLD_P, "stsfld.p", 3, MintOpUShortInt) -OPDEF(MINT_STSFLD_VT, "stsfld.vt", 5, MintOpTwoShorts) -OPDEF(MINT_LDSFLDA, "ldsflda", 3, MintOpTwoShorts) -OPDEF(MINT_LDSSFLDA, "ldssflda", 4, MintOpInt) - -OPDEF(MINT_LDLOC_I1, "ldloc.i1", 2, MintOpUShortInt) -OPDEF(MINT_LDLOC_U1, "ldloc.u1", 2, MintOpUShortInt) -OPDEF(MINT_LDLOC_I2, "ldloc.i2", 2, MintOpUShortInt) -OPDEF(MINT_LDLOC_U2, "ldloc.u2", 2, MintOpUShortInt) -OPDEF(MINT_LDLOC_I4, "ldloc.i4", 2, MintOpUShortInt) -OPDEF(MINT_LDLOC_I8, "ldloc.i8", 2, MintOpUShortInt) -OPDEF(MINT_LDLOC_R4, "ldloc.r4", 2, MintOpUShortInt) -OPDEF(MINT_LDLOC_R8, "ldloc.r8", 2, MintOpUShortInt) -OPDEF(MINT_LDLOC_O, "ldloc.o", 2, MintOpUShortInt) -OPDEF(MINT_LDLOC_P, "ldloc.p", 2, MintOpUShortInt) -OPDEF(MINT_LDLOC_VT, "ldloc.vt", 4, MintOpShortAndInt) - -OPDEF(MINT_STLOC_I1, "stloc.i1", 2, MintOpUShortInt) -OPDEF(MINT_STLOC_U1, "stloc.u1", 2, MintOpUShortInt) -OPDEF(MINT_STLOC_I2, "stloc.i2", 2, MintOpUShortInt) -OPDEF(MINT_STLOC_U2, "stloc.u2", 2, MintOpUShortInt) -OPDEF(MINT_STLOC_I4, "stloc.i4", 2, MintOpUShortInt) -OPDEF(MINT_STLOC_I8, "stloc.i8", 2, MintOpUShortInt) -OPDEF(MINT_STLOC_R4, "stloc.r4", 2, MintOpUShortInt) -OPDEF(MINT_STLOC_R8, "stloc.r8", 2, MintOpUShortInt) -OPDEF(MINT_STLOC_O, "stloc.o", 2, MintOpUShortInt) -OPDEF(MINT_STLOC_P, "stloc.p", 2, MintOpUShortInt) -OPDEF(MINT_STLOC_VT, "stloc.vt", 4, MintOpShortAndInt) - -OPDEF(MINT_STLOC_NP_I4, "stloc.np.i4", 2, MintOpUShortInt) -OPDEF(MINT_STLOC_NP_O, "stloc.np.o", 2, MintOpUShortInt) - -OPDEF(MINT_LDLOCA_S, "ldloca.s", 2, MintOpUShortInt) - -OPDEF(MINT_LDIND_I1_CHECK, "ldind.i1.check", 1, MintOpNoArgs) -OPDEF(MINT_LDIND_U1_CHECK, "ldind.u1.check", 1, MintOpNoArgs) -OPDEF(MINT_LDIND_I2_CHECK, "ldind.i2.check", 1, MintOpNoArgs) -OPDEF(MINT_LDIND_U2_CHECK, "ldind.u2.check", 1, MintOpNoArgs) -OPDEF(MINT_LDIND_I4_CHECK, "ldind.i4.check", 1, MintOpNoArgs) -OPDEF(MINT_LDIND_U4_CHECK, "ldind.u4.check", 1, MintOpNoArgs) -OPDEF(MINT_LDIND_I8_CHECK, "ldind.i8.check", 1, MintOpNoArgs) -OPDEF(MINT_LDIND_I, "ldind.i", 2, MintOpUShortInt) -OPDEF(MINT_LDIND_I8, "ldind.i8", 2, MintOpUShortInt) -OPDEF(MINT_LDIND_R4_CHECK, "ldind.r4.check", 1, MintOpNoArgs) -OPDEF(MINT_LDIND_R8_CHECK, "ldind.r8.check", 1, MintOpNoArgs) -OPDEF(MINT_LDIND_REF, "ldind.ref", 1, MintOpNoArgs) -OPDEF(MINT_LDIND_REF_CHECK, "ldind.ref.check", 1, MintOpNoArgs) -OPDEF(MINT_STIND_I1, "stind.i1", 1, MintOpNoArgs) -OPDEF(MINT_STIND_I2, "stind.i2", 1, MintOpNoArgs) -OPDEF(MINT_STIND_I4, "stind.i4", 1, MintOpNoArgs) -OPDEF(MINT_STIND_I8, "stind.i8", 1, MintOpNoArgs) -OPDEF(MINT_STIND_I, "stind.i", 1, MintOpNoArgs) -OPDEF(MINT_STIND_R4, "stind.r4", 1, MintOpNoArgs) -OPDEF(MINT_STIND_R8, "stind.r8", 1, MintOpNoArgs) -OPDEF(MINT_STIND_REF, "stind.ref", 1, MintOpNoArgs) - -OPDEF(MINT_BR, "br", 3, MintOpBranch) -OPDEF(MINT_LEAVE, "leave", 3, MintOpBranch) -OPDEF(MINT_LEAVE_CHECK, "leave.check", 3, MintOpBranch) -OPDEF(MINT_BR_S, "br.s", 2, MintOpShortBranch) -OPDEF(MINT_LEAVE_S, "leave.s", 2, MintOpShortBranch) -OPDEF(MINT_LEAVE_S_CHECK, "leave.s.check", 2, MintOpShortBranch) - -OPDEF(MINT_THROW, "throw", 1, MintOpNoArgs) -OPDEF(MINT_RETHROW, "rethrow", 2, MintOpUShortInt) -OPDEF(MINT_ENDFINALLY, "endfinally", 2, MintOpNoArgs) -OPDEF(MINT_MONO_RETHROW, "mono_rethrow", 1, MintOpNoArgs) - -OPDEF(MINT_CHECKPOINT, "checkpoint", 1, MintOpNoArgs) -OPDEF(MINT_SAFEPOINT, "safepoint", 1, MintOpNoArgs) - -OPDEF(MINT_BRFALSE_I4, "brfalse.i4", 3, MintOpBranch) -OPDEF(MINT_BRFALSE_I8, "brfalse.i8", 3, MintOpBranch) -OPDEF(MINT_BRFALSE_R4, "brfalse.r4", 3, MintOpBranch) -OPDEF(MINT_BRFALSE_R8, "brfalse.r8", 3, MintOpBranch) -OPDEF(MINT_BRTRUE_I4, "brtrue.i4", 3, MintOpBranch) -OPDEF(MINT_BRTRUE_I8, "brtrue.i8", 3, MintOpBranch) -OPDEF(MINT_BRTRUE_R4, "brtrue.r4", 3, MintOpBranch) -OPDEF(MINT_BRTRUE_R8, "brtrue.r8", 3, MintOpBranch) - -OPDEF(MINT_BRFALSE_I4_S, "brfalse.i4.s", 2, MintOpShortBranch) -OPDEF(MINT_BRFALSE_I8_S, "brfalse.i8.s", 2, MintOpShortBranch) -OPDEF(MINT_BRFALSE_R4_S, "brfalse.r4.s", 2, MintOpShortBranch) -OPDEF(MINT_BRFALSE_R8_S, "brfalse.r8.s", 2, MintOpShortBranch) -OPDEF(MINT_BRTRUE_I4_S, "brtrue.i4.s", 2, MintOpShortBranch) -OPDEF(MINT_BRTRUE_I8_S, "brtrue.i8.s", 2, MintOpShortBranch) -OPDEF(MINT_BRTRUE_R4_S, "brtrue.r4.s", 2, MintOpShortBranch) -OPDEF(MINT_BRTRUE_R8_S, "brtrue.r8.s", 2, MintOpShortBranch) - -OPDEF(MINT_BEQ_I4, "beq.i4", 3, MintOpBranch) -OPDEF(MINT_BEQ_I8, "beq.i8", 3, MintOpBranch) -OPDEF(MINT_BEQ_R4, "beq.r4", 3, MintOpBranch) -OPDEF(MINT_BEQ_R8, "beq.r8", 3, MintOpBranch) -OPDEF(MINT_BGE_I4, "bge.i4", 3, MintOpBranch) -OPDEF(MINT_BGE_I8, "bge.i8", 3, MintOpBranch) -OPDEF(MINT_BGE_R4, "bge.r4", 3, MintOpBranch) -OPDEF(MINT_BGE_R8, "bge.r8", 3, MintOpBranch) -OPDEF(MINT_BGT_I4, "bgt.i4", 3, MintOpBranch) -OPDEF(MINT_BGT_I8, "bgt.i8", 3, MintOpBranch) -OPDEF(MINT_BGT_R4, "bgt.r4", 3, MintOpBranch) -OPDEF(MINT_BGT_R8, "bgt.r8", 3, MintOpBranch) -OPDEF(MINT_BLT_I4, "blt.i4", 3, MintOpBranch) -OPDEF(MINT_BLT_I8, "blt.i8", 3, MintOpBranch) -OPDEF(MINT_BLT_R4, "blt.r4", 3, MintOpBranch) -OPDEF(MINT_BLT_R8, "blt.r8", 3, MintOpBranch) -OPDEF(MINT_BLE_I4, "ble.i4", 3, MintOpBranch) -OPDEF(MINT_BLE_I8, "ble.i8", 3, MintOpBranch) -OPDEF(MINT_BLE_R4, "ble.r4", 3, MintOpBranch) -OPDEF(MINT_BLE_R8, "ble.r8", 3, MintOpBranch) - -OPDEF(MINT_BNE_UN_I4, "bne.un.i4", 3, MintOpBranch) -OPDEF(MINT_BNE_UN_I8, "bne.un.i8", 3, MintOpBranch) -OPDEF(MINT_BNE_UN_R4, "bne.un.r4", 3, MintOpBranch) -OPDEF(MINT_BNE_UN_R8, "bne.un.r8", 3, MintOpBranch) -OPDEF(MINT_BGE_UN_I4, "bge.un.i4", 3, MintOpBranch) -OPDEF(MINT_BGE_UN_I8, "bge.un.i8", 3, MintOpBranch) -OPDEF(MINT_BGE_UN_R4, "bge.un.r4", 3, MintOpBranch) -OPDEF(MINT_BGE_UN_R8, "bge.un.r8", 3, MintOpBranch) -OPDEF(MINT_BGT_UN_I4, "bgt.un.i4", 3, MintOpBranch) -OPDEF(MINT_BGT_UN_I8, "bgt.un.i8", 3, MintOpBranch) -OPDEF(MINT_BGT_UN_R4, "bgt.un.r4", 3, MintOpBranch) -OPDEF(MINT_BGT_UN_R8, "bgt.un.r8", 3, MintOpBranch) -OPDEF(MINT_BLE_UN_I4, "ble.un.i4", 3, MintOpBranch) -OPDEF(MINT_BLE_UN_I8, "ble.un.i8", 3, MintOpBranch) -OPDEF(MINT_BLE_UN_R4, "ble.un.r4", 3, MintOpBranch) -OPDEF(MINT_BLE_UN_R8, "ble.un.r8", 3, MintOpBranch) -OPDEF(MINT_BLT_UN_I4, "blt.un.i4", 3, MintOpBranch) -OPDEF(MINT_BLT_UN_I8, "blt.un.i8", 3, MintOpBranch) -OPDEF(MINT_BLT_UN_R4, "blt.un.r4", 3, MintOpBranch) -OPDEF(MINT_BLT_UN_R8, "blt.un.r8", 3, MintOpBranch) - -OPDEF(MINT_BEQ_I4_S, "beq.i4.s", 2, MintOpShortBranch) -OPDEF(MINT_BEQ_I8_S, "beq.i8.s", 2, MintOpShortBranch) -OPDEF(MINT_BEQ_R4_S, "beq.r4.s", 2, MintOpShortBranch) -OPDEF(MINT_BEQ_R8_S, "beq.r8.s", 2, MintOpShortBranch) -OPDEF(MINT_BGE_I4_S, "bge.i4.s", 2, MintOpShortBranch) -OPDEF(MINT_BGE_I8_S, "bge.i8.s", 2, MintOpShortBranch) -OPDEF(MINT_BGE_R4_S, "bge.r4.s", 2, MintOpShortBranch) -OPDEF(MINT_BGE_R8_S, "bge.r8.s", 2, MintOpShortBranch) -OPDEF(MINT_BGT_I4_S, "bgt.i4.s", 2, MintOpShortBranch) -OPDEF(MINT_BGT_I8_S, "bgt.i8.s", 2, MintOpShortBranch) -OPDEF(MINT_BGT_R4_S, "bgt.r4.s", 2, MintOpShortBranch) -OPDEF(MINT_BGT_R8_S, "bgt.r8.s", 2, MintOpShortBranch) -OPDEF(MINT_BLT_I4_S, "blt.i4.s", 2, MintOpShortBranch) -OPDEF(MINT_BLT_I8_S, "blt.i8.s", 2, MintOpShortBranch) -OPDEF(MINT_BLT_R4_S, "blt.r4.s", 2, MintOpShortBranch) -OPDEF(MINT_BLT_R8_S, "blt.r8.s", 2, MintOpShortBranch) -OPDEF(MINT_BLE_I4_S, "ble.i4.s", 2, MintOpShortBranch) -OPDEF(MINT_BLE_I8_S, "ble.i8.s", 2, MintOpShortBranch) -OPDEF(MINT_BLE_R4_S, "ble.r4.s", 2, MintOpShortBranch) -OPDEF(MINT_BLE_R8_S, "ble.r8.s", 2, MintOpShortBranch) - -OPDEF(MINT_BNE_UN_I4_S, "bne.un.i4.s", 2, MintOpShortBranch) -OPDEF(MINT_BNE_UN_I8_S, "bne.un.i8.s", 2, MintOpShortBranch) -OPDEF(MINT_BNE_UN_R4_S, "bne.un.r4.s", 2, MintOpShortBranch) -OPDEF(MINT_BNE_UN_R8_S, "bne.un.r8.s", 2, MintOpShortBranch) -OPDEF(MINT_BGE_UN_I4_S, "bge.un.i4.s", 2, MintOpShortBranch) -OPDEF(MINT_BGE_UN_I8_S, "bge.un.i8.s", 2, MintOpShortBranch) -OPDEF(MINT_BGE_UN_R4_S, "bge.un.r4.s", 2, MintOpShortBranch) -OPDEF(MINT_BGE_UN_R8_S, "bge.un.r8.s", 2, MintOpShortBranch) -OPDEF(MINT_BGT_UN_I4_S, "bgt.un.i4.s", 2, MintOpShortBranch) -OPDEF(MINT_BGT_UN_I8_S, "bgt.un.i8.s", 2, MintOpShortBranch) -OPDEF(MINT_BGT_UN_R4_S, "bgt.un.r4.s", 2, MintOpShortBranch) -OPDEF(MINT_BGT_UN_R8_S, "bgt.un.r8.s", 2, MintOpShortBranch) -OPDEF(MINT_BLE_UN_I4_S, "ble.un.i4.s", 2, MintOpShortBranch) -OPDEF(MINT_BLE_UN_I8_S, "ble.un.i8.s", 2, MintOpShortBranch) -OPDEF(MINT_BLE_UN_R4_S, "ble.un.r4.s", 2, MintOpShortBranch) -OPDEF(MINT_BLE_UN_R8_S, "ble.un.r8.s", 2, MintOpShortBranch) -OPDEF(MINT_BLT_UN_I4_S, "blt.un.i4.s", 2, MintOpShortBranch) -OPDEF(MINT_BLT_UN_I8_S, "blt.un.i8.s", 2, MintOpShortBranch) -OPDEF(MINT_BLT_UN_R4_S, "blt.un.r4.s", 2, MintOpShortBranch) -OPDEF(MINT_BLT_UN_R8_S, "blt.un.r8.s", 2, MintOpShortBranch) - -OPDEF(MINT_SWITCH, "switch", 0, MintOpSwitch) - -OPDEF(MINT_LDSTR, "ldstr", 2, MintOpMethodToken) /* not really */ -OPDEF(MINT_LDSTR_TOKEN, "ldstr.token", 2, MintOpMethodToken) /* not really */ - -OPDEF(MINT_CALL, "call", 2, MintOpMethodToken) -OPDEF(MINT_VCALL, "vcall", 2, MintOpMethodToken) -OPDEF(MINT_CALLVIRT, "callvirt", 2, MintOpMethodToken) -OPDEF(MINT_VCALLVIRT, "vcallvirt", 2, MintOpMethodToken) -OPDEF(MINT_CALLVIRT_FAST, "callvirt.fast", 3, MintOpMethodToken) -OPDEF(MINT_VCALLVIRT_FAST, "vcallvirt.fast", 3, MintOpMethodToken) -OPDEF(MINT_CALLI, "calli", 2, MintOpMethodToken) -OPDEF(MINT_CALLI_NAT, "calli.nat", 3, MintOpMethodToken) -OPDEF(MINT_CALLI_NAT_FAST, "calli.nat.fast", 4, MintOpMethodToken) -OPDEF(MINT_CALL_VARARG, "call.vararg", 3, MintOpMethodToken) -OPDEF(MINT_JMP, "jmp", 2, MintOpMethodToken) - -OPDEF(MINT_CALLRUN, "callrun", 3, MintOpNoArgs) - -OPDEF(MINT_ENDFILTER, "endfilter", 1, MintOpNoArgs) - -OPDEF(MINT_NEWOBJ, "newobj", 2, MintOpMethodToken) -OPDEF(MINT_NEWOBJ_ARRAY, "newobj_array", 3, MintOpMethodToken) -OPDEF(MINT_NEWOBJ_FAST, "newobj_fast", 4, MintOpMethodToken) -OPDEF(MINT_NEWOBJ_VT_FAST, "newobj_vt_fast", 3, MintOpMethodToken) -OPDEF(MINT_NEWOBJ_VTST_FAST, "newobj_vtst_fast", 4, MintOpMethodToken) -OPDEF(MINT_NEWOBJ_MAGIC, "newobj_magic", 2, MintOpMethodToken) -OPDEF(MINT_INITOBJ, "initobj", 3, MintOpInt) -OPDEF(MINT_CASTCLASS, "castclass", 2, MintOpClassToken) -OPDEF(MINT_ISINST, "isinst", 2, MintOpClassToken) -OPDEF(MINT_CASTCLASS_INTERFACE, "castclass.interface", 2, MintOpClassToken) -OPDEF(MINT_ISINST_INTERFACE, "isinst.interface", 2, MintOpClassToken) -OPDEF(MINT_CASTCLASS_COMMON, "castclass.common", 2, MintOpClassToken) -OPDEF(MINT_ISINST_COMMON, "isinst.common", 2, MintOpClassToken) -OPDEF(MINT_NEWARR, "newarr", 2, MintOpClassToken) -OPDEF(MINT_BOX, "box", 3, MintOpTwoShorts) -OPDEF(MINT_BOX_VT, "box.vt", 3, MintOpTwoShorts) -OPDEF(MINT_BOX_NULLABLE, "box.nullable", 3, MintOpTwoShorts) -OPDEF(MINT_UNBOX, "unbox", 2, MintOpClassToken) -OPDEF(MINT_LDTOKEN, "ldtoken", 2, MintOpClassToken) /* not really */ -OPDEF(MINT_LDFTN, "ldftn", 2, MintOpMethodToken) -OPDEF(MINT_LDFTN_DYNAMIC, "ldftn.dynamic", 1, MintOpMethodToken) -OPDEF(MINT_LDVIRTFTN, "ldvirtftn", 2, MintOpMethodToken) -OPDEF(MINT_CPOBJ, "cpobj", 2, MintOpClassToken) -OPDEF(MINT_CPOBJ_VT, "cpobj.vt", 2, MintOpClassToken) -OPDEF(MINT_LDOBJ_VT, "ldobj.vt", 3, MintOpInt) -OPDEF(MINT_STOBJ_VT, "stobj.vt", 2, MintOpClassToken) -OPDEF(MINT_CPBLK, "cpblk", 1, MintOpNoArgs) -OPDEF(MINT_INITBLK, "initblk", 1, MintOpNoArgs) -OPDEF(MINT_LOCALLOC, "localloc", 1, MintOpNoArgs) -OPDEF(MINT_INITLOCALS, "initlocals", 1, MintOpNoArgs) - -OPDEF(MINT_LDELEM_I, "ldelem.i", 1, MintOpNoArgs) -OPDEF(MINT_LDELEM_I1, "ldelem.i1", 1, MintOpNoArgs) -OPDEF(MINT_LDELEM_U1, "ldelem.u1", 1, MintOpNoArgs) -OPDEF(MINT_LDELEM_I2, "ldelem.i2", 1, MintOpNoArgs) -OPDEF(MINT_LDELEM_U2, "ldelem.u2", 1, MintOpNoArgs) -OPDEF(MINT_LDELEM_I4, "ldelem.i4", 1, MintOpNoArgs) -OPDEF(MINT_LDELEM_U4, "ldelem.u4", 1, MintOpNoArgs) -OPDEF(MINT_LDELEM_I8, "ldelem.i8", 1, MintOpNoArgs) -OPDEF(MINT_LDELEM_R4, "ldelem.r4", 1, MintOpNoArgs) -OPDEF(MINT_LDELEM_R8, "ldelem.r8", 1, MintOpNoArgs) -OPDEF(MINT_LDELEM_REF, "ldelem.ref", 1, MintOpNoArgs) -OPDEF(MINT_LDELEM_VT, "ldelem.vt", 3, MintOpInt) - -OPDEF(MINT_LDELEMA, "ldelema", 3, MintOpTwoShorts) -OPDEF(MINT_LDELEMA_TC, "ldelema.tc", 3, MintOpTwoShorts) -OPDEF(MINT_LDELEMA_FAST, "ldelema.fast", 3, MintOpInt) - -OPDEF(MINT_STELEM_I, "stelem.i", 1, MintOpNoArgs) -OPDEF(MINT_STELEM_I1, "stelem.i1", 1, MintOpNoArgs) -OPDEF(MINT_STELEM_U1, "stelem.u1", 1, MintOpNoArgs) -OPDEF(MINT_STELEM_I2, "stelem.i2", 1, MintOpNoArgs) -OPDEF(MINT_STELEM_U2, "stelem.u2", 1, MintOpNoArgs) -OPDEF(MINT_STELEM_I4, "stelem.i4", 1, MintOpNoArgs) -OPDEF(MINT_STELEM_I8, "stelem.i8", 1, MintOpNoArgs) -OPDEF(MINT_STELEM_R4, "stelem.r4", 1, MintOpNoArgs) -OPDEF(MINT_STELEM_R8, "stelem.r8", 1, MintOpNoArgs) -OPDEF(MINT_STELEM_REF, "stelem.ref", 1, MintOpNoArgs) -OPDEF(MINT_STELEM_VT, "stelem.vt", 4, MintOpShortAndInt) - -OPDEF(MINT_LDLEN, "ldlen", 1, MintOpNoArgs) -OPDEF(MINT_LDLEN_SPAN, "ldlen.span", 2, MintOpShortInt) - -OPDEF(MINT_GETITEM_SPAN, "getitem.span", 4, MintOpShortAndInt) - -OPDEF(MINT_ADD_I4, "add.i4", 1, MintOpNoArgs) -OPDEF(MINT_ADD_I8, "add.i8", 1, MintOpNoArgs) -OPDEF(MINT_ADD_R4, "add.r4", 1, MintOpNoArgs) -OPDEF(MINT_ADD_R8, "add.r8", 1, MintOpNoArgs) - -OPDEF(MINT_ADD1_I4, "add1.i4", 1, MintOpNoArgs) -OPDEF(MINT_ADD1_I8, "add1.i8", 1, MintOpNoArgs) - -OPDEF(MINT_SUB_I4, "sub.i4", 1, MintOpNoArgs) -OPDEF(MINT_SUB_I8, "sub.i8", 1, MintOpNoArgs) -OPDEF(MINT_SUB_R4, "sub.r4", 1, MintOpNoArgs) -OPDEF(MINT_SUB_R8, "sub.r8", 1, MintOpNoArgs) - -OPDEF(MINT_SUB1_I4, "sub1.i4", 1, MintOpNoArgs) -OPDEF(MINT_SUB1_I8, "sub1.i8", 1, MintOpNoArgs) - -OPDEF(MINT_MUL_I4, "mul.i4", 1, MintOpNoArgs) -OPDEF(MINT_MUL_I8, "mul.i8", 1, MintOpNoArgs) -OPDEF(MINT_MUL_R4, "mul.r4", 1, MintOpNoArgs) -OPDEF(MINT_MUL_R8, "mul.r8", 1, MintOpNoArgs) - -OPDEF(MINT_DIV_I4, "div.i4", 1, MintOpNoArgs) -OPDEF(MINT_DIV_I8, "div.i8", 1, MintOpNoArgs) -OPDEF(MINT_DIV_R4, "div.r4", 1, MintOpNoArgs) -OPDEF(MINT_DIV_R8, "div.r8", 1, MintOpNoArgs) - -OPDEF(MINT_DIV_UN_I4, "div.un.i4", 1, MintOpNoArgs) -OPDEF(MINT_DIV_UN_I8, "div.un.i8", 1, MintOpNoArgs) - -OPDEF(MINT_ADD_OVF_I4, "add.ovf.i4", 1, MintOpNoArgs) -OPDEF(MINT_ADD_OVF_I8, "add.ovf.i8", 1, MintOpNoArgs) - -OPDEF(MINT_ADD_OVF_UN_I4, "add.ovf.un.i4", 1, MintOpNoArgs) -OPDEF(MINT_ADD_OVF_UN_I8, "add.ovf.un.i8", 1, MintOpNoArgs) - -OPDEF(MINT_MUL_OVF_I4, "mul.ovf.i4", 1, MintOpNoArgs) -OPDEF(MINT_MUL_OVF_I8, "mul.ovf.i8", 1, MintOpNoArgs) - -OPDEF(MINT_MUL_OVF_UN_I4, "mul.ovf.un.i4", 1, MintOpNoArgs) -OPDEF(MINT_MUL_OVF_UN_I8, "mul.ovf.un.i8", 1, MintOpNoArgs) - -OPDEF(MINT_SUB_OVF_I4, "sub.ovf.i4", 1, MintOpNoArgs) -OPDEF(MINT_SUB_OVF_I8, "sub.ovf.i8", 1, MintOpNoArgs) - -OPDEF(MINT_SUB_OVF_UN_I4, "sub.ovf.un.i4", 1, MintOpNoArgs) -OPDEF(MINT_SUB_OVF_UN_I8, "sub.ovf.un.i8", 1, MintOpNoArgs) - -OPDEF(MINT_NEG_I4, "neg.i4", 1, MintOpNoArgs) -OPDEF(MINT_NEG_I8, "neg.i8", 1, MintOpNoArgs) -OPDEF(MINT_NEG_R4, "neg.r4", 1, MintOpNoArgs) -OPDEF(MINT_NEG_R8, "neg.r8", 1, MintOpNoArgs) - -OPDEF(MINT_NOT_I4, "not.i4", 1, MintOpNoArgs) -OPDEF(MINT_NOT_I8, "not.i8", 1, MintOpNoArgs) - -OPDEF(MINT_AND_I4, "and.i4", 1, MintOpNoArgs) -OPDEF(MINT_AND_I8, "and.i8", 1, MintOpNoArgs) - -OPDEF(MINT_OR_I4, "or.i4", 1, MintOpNoArgs) -OPDEF(MINT_OR_I8, "or.i8", 1, MintOpNoArgs) - -OPDEF(MINT_XOR_I4, "xor.i4", 1, MintOpNoArgs) -OPDEF(MINT_XOR_I8, "xor.i8", 1, MintOpNoArgs) - -OPDEF(MINT_REM_I4, "rem.i4", 1, MintOpNoArgs) -OPDEF(MINT_REM_I8, "rem.i8", 1, MintOpNoArgs) -OPDEF(MINT_REM_R4, "rem.r4", 1, MintOpNoArgs) -OPDEF(MINT_REM_R8, "rem.r8", 1, MintOpNoArgs) - -OPDEF(MINT_REM_UN_I4, "rem.un.i4", 1, MintOpNoArgs) -OPDEF(MINT_REM_UN_I8, "rem.un.i8", 1, MintOpNoArgs) - -OPDEF(MINT_SHR_UN_I4, "shr.un.i4", 1, MintOpNoArgs) -OPDEF(MINT_SHR_UN_I8, "shr.un.i8", 1, MintOpNoArgs) -OPDEF(MINT_SHL_I4, "shl.i4", 1, MintOpNoArgs) -OPDEF(MINT_SHL_I8, "shl.i8", 1, MintOpNoArgs) -OPDEF(MINT_SHR_I4, "shr.i4", 1, MintOpNoArgs) -OPDEF(MINT_SHR_I8, "shr.i8", 1, MintOpNoArgs) - -OPDEF(MINT_CONV_R_UN_I4, "conv.r.un.i4", 1, MintOpNoArgs) -OPDEF(MINT_CONV_R_UN_I8, "conv.r.un.i8", 1, MintOpNoArgs) - -OPDEF(MINT_CONV_I1_I4, "conv.i1.i4", 1, MintOpNoArgs) -OPDEF(MINT_CONV_I1_I8, "conv.i1.i8", 1, MintOpNoArgs) -OPDEF(MINT_CONV_I1_R4, "conv.i1.r4", 1, MintOpNoArgs) -OPDEF(MINT_CONV_I1_R8, "conv.i1.r8", 1, MintOpNoArgs) - -OPDEF(MINT_CONV_U1_I4, "conv.u1.i4", 1, MintOpNoArgs) -OPDEF(MINT_CONV_U1_I8, "conv.u1.i8", 1, MintOpNoArgs) -OPDEF(MINT_CONV_U1_R4, "conv.u1.r4", 1, MintOpNoArgs) -OPDEF(MINT_CONV_U1_R8, "conv.u1.r8", 1, MintOpNoArgs) +/* OPDEF (opsymbol, opstring, oplength (in uint16s), pop_n, push_n, optype) */ + +OPDEF(MINT_NOP, "nop", 0, Pop0, Push0, MintOpNoArgs) +OPDEF(MINT_NIY, "niy", 1, Pop0, Push0, MintOpNoArgs) +OPDEF(MINT_BREAK, "break", 1, Pop0, Push0, MintOpNoArgs) +OPDEF(MINT_BREAKPOINT, "breakpoint", 1, Pop0, Push0, MintOpNoArgs) +OPDEF(MINT_LDNULL, "ldnull", 1, Pop0, Push1, MintOpNoArgs) +OPDEF(MINT_DUP, "dup", 1, Pop1, Push2, MintOpNoArgs) +OPDEF(MINT_DUP_VT, "dup.vt", 3, Pop1, Push2, MintOpInt) +OPDEF(MINT_POP, "pop", 2, Pop1, Push0, MintOpShortInt) + +OPDEF(MINT_RET, "ret", 1, Pop1, Push0, MintOpNoArgs) +OPDEF(MINT_RET_VOID, "ret.void", 1, Pop0, Push0, MintOpNoArgs) +OPDEF(MINT_RET_VT, "ret.vt", 3, Pop1, Push0, MintOpInt) + +/* FIXME if ret_size != null it clobbers sp [-1] */ +OPDEF(MINT_VTRESULT, "vtresult", 4, Pop0, Push0, MintOpShortAndInt) /*FIX should be unsigned*/ + +OPDEF(MINT_LDC_I4_M1, "ldc.i4.m1", 1, Pop0, Push1, MintOpNoArgs) +OPDEF(MINT_LDC_I4_0, "ldc.i4.0", 1, Pop0, Push1, MintOpNoArgs) +OPDEF(MINT_LDC_I4_1, "ldc.i4.1", 1, Pop0, Push1, MintOpNoArgs) +OPDEF(MINT_LDC_I4_2, "ldc.i4.2", 1, Pop0, Push1, MintOpNoArgs) +OPDEF(MINT_LDC_I4_3, "ldc.i4.3", 1, Pop0, Push1, MintOpNoArgs) +OPDEF(MINT_LDC_I4_4, "ldc.i4.4", 1, Pop0, Push1, MintOpNoArgs) +OPDEF(MINT_LDC_I4_5, "ldc.i4.5", 1, Pop0, Push1, MintOpNoArgs) +OPDEF(MINT_LDC_I4_6, "ldc.i4.6", 1, Pop0, Push1, MintOpNoArgs) +OPDEF(MINT_LDC_I4_7, "ldc.i4.7", 1, Pop0, Push1, MintOpNoArgs) +OPDEF(MINT_LDC_I4_8, "ldc.i4.8", 1, Pop0, Push1, MintOpNoArgs) + +OPDEF(MINT_LDC_I4_S, "ldc.i4.s", 2, Pop0, Push1, MintOpShortInt) +OPDEF(MINT_LDC_I4, "ldc.i4", 3, Pop0, Push1, MintOpInt) +OPDEF(MINT_LDC_I8, "ldc.i8", 5, Pop0, Push1, MintOpLongInt) +OPDEF(MINT_LDC_I8_S, "ldc.i8.s", 2, Pop0, Push1, MintOpShortInt) + +OPDEF(MINT_LDC_R4, "ldc.r4", 3, Pop0, Push1, MintOpFloat) +OPDEF(MINT_LDC_R8, "ldc.r8", 5, Pop0, Push1, MintOpDouble) + +OPDEF(MINT_ARGLIST, "arglist", 1, Pop0, Push1, MintOpNoArgs) + +OPDEF(MINT_LDARG_I1, "ldarg.i1", 2, Pop0, Push1, MintOpUShortInt) +OPDEF(MINT_LDARG_U1, "ldarg.u1", 2, Pop0, Push1, MintOpUShortInt) +OPDEF(MINT_LDARG_I2, "ldarg.i2", 2, Pop0, Push1, MintOpUShortInt) +OPDEF(MINT_LDARG_U2, "ldarg.u2", 2, Pop0, Push1, MintOpUShortInt) +OPDEF(MINT_LDARG_I4, "ldarg.i4", 2, Pop0, Push1, MintOpUShortInt) +OPDEF(MINT_LDARG_I8, "ldarg.i8", 2, Pop0, Push1, MintOpUShortInt) +OPDEF(MINT_LDARG_R4, "ldarg.r4", 2, Pop0, Push1, MintOpUShortInt) +OPDEF(MINT_LDARG_R8, "ldarg.r8", 2, Pop0, Push1, MintOpUShortInt) +OPDEF(MINT_LDARG_O, "ldarg.o", 2, Pop0, Push1, MintOpUShortInt) +OPDEF(MINT_LDARG_P, "ldarg.p", 2, Pop0, Push1, MintOpUShortInt) +OPDEF(MINT_LDARG_P0, "ldarg.p0", 1, Pop0, Push1, MintOpNoArgs) +OPDEF(MINT_LDARG_VT, "ldarg.vt", 4, Pop0, Push1, MintOpShortAndInt) + +OPDEF(MINT_STARG_I1, "starg.i1", 2, Pop1, Push0, MintOpUShortInt) +OPDEF(MINT_STARG_U1, "starg.u1", 2, Pop1, Push0, MintOpUShortInt) +OPDEF(MINT_STARG_I2, "starg.i2", 2, Pop1, Push0, MintOpUShortInt) +OPDEF(MINT_STARG_U2, "starg.u2", 2, Pop1, Push0, MintOpUShortInt) +OPDEF(MINT_STARG_I4, "starg.i4", 2, Pop1, Push0, MintOpUShortInt) +OPDEF(MINT_STARG_I8, "starg.i8", 2, Pop1, Push0, MintOpUShortInt) +OPDEF(MINT_STARG_R4, "starg.r4", 2, Pop1, Push0, MintOpUShortInt) +OPDEF(MINT_STARG_R8, "starg.r8", 2, Pop1, Push0, MintOpUShortInt) +OPDEF(MINT_STARG_O, "starg.o", 2, Pop1, Push0, MintOpUShortInt) +OPDEF(MINT_STARG_P, "starg.p", 2, Pop1, Push0, MintOpUShortInt) +OPDEF(MINT_STARG_VT, "starg.vt", 4, Pop1, Push0, MintOpShortAndInt) + +OPDEF(MINT_LDARGA, "ldarga", 2, Pop0, Push1, MintOpUShortInt) +OPDEF(MINT_LDARGA_VT, "ldarga.vt", 2, Pop0, Push1, MintOpUShortInt) + +OPDEF(MINT_LDFLD_I1, "ldfld.i1", 2, Pop1, Push1, MintOpUShortInt) +OPDEF(MINT_LDFLD_U1, "ldfld.u1", 2, Pop1, Push1, MintOpUShortInt) +OPDEF(MINT_LDFLD_I2, "ldfld.i2", 2, Pop1, Push1, MintOpUShortInt) +OPDEF(MINT_LDFLD_U2, "ldfld.u2", 2, Pop1, Push1, MintOpUShortInt) +OPDEF(MINT_LDFLD_I4, "ldfld.i4", 2, Pop1, Push1, MintOpUShortInt) +OPDEF(MINT_LDFLD_I8, "ldfld.i8", 2, Pop1, Push1, MintOpUShortInt) +OPDEF(MINT_LDFLD_R4, "ldfld.r4", 2, Pop1, Push1, MintOpUShortInt) +OPDEF(MINT_LDFLD_R8, "ldfld.r8", 2, Pop1, Push1, MintOpUShortInt) +OPDEF(MINT_LDFLD_O, "ldfld.o", 2, Pop1, Push1, MintOpUShortInt) +OPDEF(MINT_LDFLD_P, "ldfld.p", 2, Pop1, Push1, MintOpUShortInt) +OPDEF(MINT_LDFLD_VT, "ldfld.vt", 4, Pop1, Push1, MintOpShortAndInt) +OPDEF(MINT_LDFLD_I8_UNALIGNED, "ldfld.i8.unaligned", 2, Pop1, Push1, MintOpUShortInt) +OPDEF(MINT_LDFLD_R8_UNALIGNED, "ldfld.r8.unaligned", 2, Pop1, Push1, MintOpUShortInt) + +OPDEF(MINT_LDRMFLD, "ldrmfld", 2, Pop1, Push1, MintOpFieldToken) +OPDEF(MINT_LDRMFLD_VT, "ldrmfld.vt", 2, Pop1, Push1, MintOpUShortInt) + +OPDEF(MINT_LDFLDA, "ldflda", 2, Pop1, Push1, MintOpUShortInt) +OPDEF(MINT_LDFLDA_UNSAFE, "ldflda.unsafe", 2, Pop1, Push1, MintOpUShortInt) + +OPDEF(MINT_STFLD_I1, "stfld.i1", 2, Pop2, Push0, MintOpUShortInt) +OPDEF(MINT_STFLD_U1, "stfld.u1", 2, Pop2, Push0, MintOpUShortInt) +OPDEF(MINT_STFLD_I2, "stfld.i2", 2, Pop2, Push0, MintOpUShortInt) +OPDEF(MINT_STFLD_U2, "stfld.u2", 2, Pop2, Push0, MintOpUShortInt) +OPDEF(MINT_STFLD_I4, "stfld.i4", 2, Pop2, Push0, MintOpUShortInt) +OPDEF(MINT_STFLD_I8, "stfld.i8", 2, Pop2, Push0, MintOpUShortInt) +OPDEF(MINT_STFLD_R4, "stfld.r4", 2, Pop2, Push0, MintOpUShortInt) +OPDEF(MINT_STFLD_R8, "stfld.r8", 2, Pop2, Push0, MintOpUShortInt) +OPDEF(MINT_STFLD_O, "stfld.o", 2, Pop2, Push0, MintOpUShortInt) +OPDEF(MINT_STFLD_P, "stfld.p", 2, Pop2, Push0, MintOpUShortInt) +OPDEF(MINT_STFLD_VT, "stfld.vt", 3, Pop2, Push0, MintOpTwoShorts) +OPDEF(MINT_STFLD_I8_UNALIGNED, "stfld.i8.unaligned", 2, Pop2, Push0, MintOpUShortInt) +OPDEF(MINT_STFLD_R8_UNALIGNED, "stfld.r8.unaligned", 2, Pop2, Push0, MintOpUShortInt) + +OPDEF(MINT_STRMFLD, "strmfld", 2, Pop2, Push0, MintOpFieldToken) +OPDEF(MINT_STRMFLD_VT, "strmfld.vt", 2, Pop2, Push0, MintOpUShortInt) + +OPDEF(MINT_LDTSFLD_I1, "ldtsfld.i1", 3, Pop0, Push1, MintOpInt) +OPDEF(MINT_LDTSFLD_U1, "ldtsfld.u1", 3, Pop0, Push1, MintOpInt) +OPDEF(MINT_LDTSFLD_I2, "ldtsfld.i2", 3, Pop0, Push1, MintOpInt) +OPDEF(MINT_LDTSFLD_U2, "ldtsfld.u2", 3, Pop0, Push1, MintOpInt) +OPDEF(MINT_LDTSFLD_I4, "ldtsfld.i4", 3, Pop0, Push1, MintOpInt) +OPDEF(MINT_LDTSFLD_I8, "ldtsfld.i8", 3, Pop0, Push1, MintOpInt) +OPDEF(MINT_LDTSFLD_R4, "ldtsfld.r4", 3, Pop0, Push1, MintOpInt) +OPDEF(MINT_LDTSFLD_R8, "ldtsfld.r8", 3, Pop0, Push1, MintOpInt) +OPDEF(MINT_LDTSFLD_O, "ldtsfld.o", 3, Pop0, Push1, MintOpInt) +OPDEF(MINT_LDTSFLD_P, "ldtsfld.p", 3, Pop0, Push1, MintOpInt) +OPDEF(MINT_LDSSFLD, "ldssfld", 4, Pop0, Push1, MintOpFieldToken) +OPDEF(MINT_LDSSFLD_VT, "ldssfld.vt", 5, Pop0, Push1, MintOpInt) + +OPDEF(MINT_LDSFLD_I1, "ldsfld.i1", 3, Pop0, Push1, MintOpUShortInt) +OPDEF(MINT_LDSFLD_U1, "ldsfld.u1", 3, Pop0, Push1, MintOpUShortInt) +OPDEF(MINT_LDSFLD_I2, "ldsfld.i2", 3, Pop0, Push1, MintOpUShortInt) +OPDEF(MINT_LDSFLD_U2, "ldsfld.u2", 3, Pop0, Push1, MintOpUShortInt) +OPDEF(MINT_LDSFLD_I4, "ldsfld.i4", 3, Pop0, Push1, MintOpUShortInt) +OPDEF(MINT_LDSFLD_I8, "ldsfld.i8", 3, Pop0, Push1, MintOpUShortInt) +OPDEF(MINT_LDSFLD_R4, "ldsfld.r4", 3, Pop0, Push1, MintOpUShortInt) +OPDEF(MINT_LDSFLD_R8, "ldsfld.r8", 3, Pop0, Push1, MintOpUShortInt) +OPDEF(MINT_LDSFLD_O, "ldsfld.o", 3, Pop0, Push1, MintOpUShortInt) +OPDEF(MINT_LDSFLD_P, "ldsfld.p", 3, Pop0, Push1, MintOpUShortInt) +OPDEF(MINT_LDSFLD_VT, "ldsfld.vt", 5, Pop0, Push1, MintOpTwoShorts) + +OPDEF(MINT_STTSFLD_I1, "sttsfld.i1", 3, Pop1, Push0, MintOpInt) +OPDEF(MINT_STTSFLD_U1, "sttsfld.u1", 3, Pop1, Push0, MintOpInt) +OPDEF(MINT_STTSFLD_I2, "sttsfld.i2", 3, Pop1, Push0, MintOpInt) +OPDEF(MINT_STTSFLD_U2, "sttsfld.u2", 3, Pop1, Push0, MintOpInt) +OPDEF(MINT_STTSFLD_I4, "sttsfld.i4", 3, Pop1, Push0, MintOpInt) +OPDEF(MINT_STTSFLD_I8, "sttsfld.i8", 3, Pop1, Push0, MintOpInt) +OPDEF(MINT_STTSFLD_R4, "sttsfld.r4", 3, Pop1, Push0, MintOpInt) +OPDEF(MINT_STTSFLD_R8, "sttsfld.r8", 3, Pop1, Push0, MintOpInt) +OPDEF(MINT_STTSFLD_O, "sttsfld.o", 3, Pop1, Push0, MintOpInt) +OPDEF(MINT_STTSFLD_P, "sttsfld.p", 3, Pop1, Push0, MintOpInt) +OPDEF(MINT_STSSFLD, "stssfld", 4, Pop1, Push0, MintOpFieldToken) +OPDEF(MINT_STSSFLD_VT, "stssfld.vt", 5, Pop1, Push0, MintOpInt) +OPDEF(MINT_STSFLD_I1, "stsfld.i1", 3, Pop1, Push0, MintOpUShortInt) +OPDEF(MINT_STSFLD_U1, "stsfld.u1", 3, Pop1, Push0, MintOpUShortInt) +OPDEF(MINT_STSFLD_I2, "stsfld.i2", 3, Pop1, Push0, MintOpUShortInt) +OPDEF(MINT_STSFLD_U2, "stsfld.u2", 3, Pop1, Push0, MintOpUShortInt) +OPDEF(MINT_STSFLD_I4, "stsfld.i4", 3, Pop1, Push0, MintOpUShortInt) +OPDEF(MINT_STSFLD_I8, "stsfld.i8", 3, Pop1, Push0, MintOpUShortInt) +OPDEF(MINT_STSFLD_R4, "stsfld.r4", 3, Pop1, Push0, MintOpUShortInt) +OPDEF(MINT_STSFLD_R8, "stsfld.r8", 3, Pop1, Push0, MintOpUShortInt) +OPDEF(MINT_STSFLD_O, "stsfld.o", 3, Pop1, Push0, MintOpUShortInt) +OPDEF(MINT_STSFLD_P, "stsfld.p", 3, Pop1, Push0, MintOpUShortInt) +OPDEF(MINT_STSFLD_VT, "stsfld.vt", 5, Pop1, Push0, MintOpTwoShorts) +OPDEF(MINT_LDSFLDA, "ldsflda", 3, Pop0, Push1, MintOpTwoShorts) +OPDEF(MINT_LDSSFLDA, "ldssflda", 3, Pop0, Push1, MintOpInt) + +OPDEF(MINT_LDLOC_I1, "ldloc.i1", 2, Pop0, Push1, MintOpUShortInt) +OPDEF(MINT_LDLOC_U1, "ldloc.u1", 2, Pop0, Push1, MintOpUShortInt) +OPDEF(MINT_LDLOC_I2, "ldloc.i2", 2, Pop0, Push1, MintOpUShortInt) +OPDEF(MINT_LDLOC_U2, "ldloc.u2", 2, Pop0, Push1, MintOpUShortInt) +OPDEF(MINT_LDLOC_I4, "ldloc.i4", 2, Pop0, Push1, MintOpUShortInt) +OPDEF(MINT_LDLOC_I8, "ldloc.i8", 2, Pop0, Push1, MintOpUShortInt) +OPDEF(MINT_LDLOC_R4, "ldloc.r4", 2, Pop0, Push1, MintOpUShortInt) +OPDEF(MINT_LDLOC_R8, "ldloc.r8", 2, Pop0, Push1, MintOpUShortInt) +OPDEF(MINT_LDLOC_O, "ldloc.o", 2, Pop0, Push1, MintOpUShortInt) +OPDEF(MINT_LDLOC_P, "ldloc.p", 2, Pop0, Push1, MintOpUShortInt) +OPDEF(MINT_LDLOC_VT, "ldloc.vt", 4, Pop0, Push1, MintOpShortAndInt) + +OPDEF(MINT_STLOC_I1, "stloc.i1", 2, Pop1, Push0, MintOpUShortInt) +OPDEF(MINT_STLOC_U1, "stloc.u1", 2, Pop1, Push0, MintOpUShortInt) +OPDEF(MINT_STLOC_I2, "stloc.i2", 2, Pop1, Push0, MintOpUShortInt) +OPDEF(MINT_STLOC_U2, "stloc.u2", 2, Pop1, Push0, MintOpUShortInt) +OPDEF(MINT_STLOC_I4, "stloc.i4", 2, Pop1, Push0, MintOpUShortInt) +OPDEF(MINT_STLOC_I8, "stloc.i8", 2, Pop1, Push0, MintOpUShortInt) +OPDEF(MINT_STLOC_R4, "stloc.r4", 2, Pop1, Push0, MintOpUShortInt) +OPDEF(MINT_STLOC_R8, "stloc.r8", 2, Pop1, Push0, MintOpUShortInt) +OPDEF(MINT_STLOC_O, "stloc.o", 2, Pop1, Push0, MintOpUShortInt) +OPDEF(MINT_STLOC_P, "stloc.p", 2, Pop1, Push0, MintOpUShortInt) +OPDEF(MINT_STLOC_VT, "stloc.vt", 4, Pop1, Push0, MintOpShortAndInt) + +OPDEF(MINT_STLOC_NP_I4, "stloc.np.i4", 2, Pop0, Push0, MintOpUShortInt) +OPDEF(MINT_STLOC_NP_O, "stloc.np.o", 2, Pop0, Push0, MintOpUShortInt) + +OPDEF(MINT_MOVLOC_1, "movloc.1", 3, Pop0, Push0, MintOpTwoShorts) +OPDEF(MINT_MOVLOC_2, "movloc.2", 3, Pop0, Push0, MintOpTwoShorts) +OPDEF(MINT_MOVLOC_4, "movloc.4", 3, Pop0, Push0, MintOpTwoShorts) +OPDEF(MINT_MOVLOC_8, "movloc.8", 3, Pop0, Push0, MintOpTwoShorts) +OPDEF(MINT_MOVLOC_VT, "movloc.vt", 5, Pop0, Push0, MintOpTwoShorts) + +OPDEF(MINT_LDLOCA_S, "ldloca.s", 2, Pop0, Push1, MintOpUShortInt) + +OPDEF(MINT_LDIND_I1_CHECK, "ldind.i1.check", 1, Pop1, Push1, MintOpNoArgs) +OPDEF(MINT_LDIND_U1_CHECK, "ldind.u1.check", 1, Pop1, Push1, MintOpNoArgs) +OPDEF(MINT_LDIND_I2_CHECK, "ldind.i2.check", 1, Pop1, Push1, MintOpNoArgs) +OPDEF(MINT_LDIND_U2_CHECK, "ldind.u2.check", 1, Pop1, Push1, MintOpNoArgs) +OPDEF(MINT_LDIND_I4_CHECK, "ldind.i4.check", 1, Pop1, Push1, MintOpNoArgs) +OPDEF(MINT_LDIND_U4_CHECK, "ldind.u4.check", 1, Pop1, Push1, MintOpNoArgs) +OPDEF(MINT_LDIND_I8_CHECK, "ldind.i8.check", 1, Pop1, Push1, MintOpNoArgs) +OPDEF(MINT_LDIND_I, "ldind.i", 2, Pop1, Push1, MintOpUShortInt) +OPDEF(MINT_LDIND_I8, "ldind.i8", 2, Pop1, Push1, MintOpUShortInt) +OPDEF(MINT_LDIND_R4_CHECK, "ldind.r4.check", 1, Pop1, Push1, MintOpNoArgs) +OPDEF(MINT_LDIND_R8_CHECK, "ldind.r8.check", 1, Pop1, Push1, MintOpNoArgs) +OPDEF(MINT_LDIND_REF, "ldind.ref", 1, Pop1, Push1, MintOpNoArgs) +OPDEF(MINT_LDIND_REF_CHECK, "ldind.ref.check", 1, Pop1, Push1, MintOpNoArgs) +OPDEF(MINT_STIND_I1, "stind.i1", 1, Pop2, Push0, MintOpNoArgs) +OPDEF(MINT_STIND_I2, "stind.i2", 1, Pop2, Push0, MintOpNoArgs) +OPDEF(MINT_STIND_I4, "stind.i4", 1, Pop2, Push0, MintOpNoArgs) +OPDEF(MINT_STIND_I8, "stind.i8", 1, Pop2, Push0, MintOpNoArgs) +OPDEF(MINT_STIND_I, "stind.i", 1, Pop2, Push0, MintOpNoArgs) +OPDEF(MINT_STIND_R4, "stind.r4", 1, Pop2, Push0, MintOpNoArgs) +OPDEF(MINT_STIND_R8, "stind.r8", 1, Pop2, Push0, MintOpNoArgs) +OPDEF(MINT_STIND_REF, "stind.ref", 1, Pop2, Push0, MintOpNoArgs) + +OPDEF(MINT_BR, "br", 3, Pop0, Push0, MintOpBranch) +OPDEF(MINT_LEAVE, "leave", 3, PopAll, Push0, MintOpBranch) +OPDEF(MINT_LEAVE_CHECK, "leave.check", 3, PopAll, Push0, MintOpBranch) +OPDEF(MINT_BR_S, "br.s", 2, Pop0, Push0, MintOpShortBranch) +OPDEF(MINT_LEAVE_S, "leave.s", 2, PopAll, Push0, MintOpShortBranch) +OPDEF(MINT_LEAVE_S_CHECK, "leave.s.check", 2, PopAll, Push0, MintOpShortBranch) + +OPDEF(MINT_THROW, "throw", 1, Pop1, Push0, MintOpNoArgs) +OPDEF(MINT_RETHROW, "rethrow", 2, Pop0, Push0, MintOpUShortInt) +OPDEF(MINT_ENDFINALLY, "endfinally", 2, PopAll, Push0, MintOpNoArgs) +OPDEF(MINT_MONO_RETHROW, "mono_rethrow", 1, Pop1, Push0, MintOpNoArgs) + +OPDEF(MINT_CHECKPOINT, "checkpoint", 1, Pop0, Push0, MintOpNoArgs) +OPDEF(MINT_SAFEPOINT, "safepoint", 1, Pop0, Push0, MintOpNoArgs) + +OPDEF(MINT_BRFALSE_I4, "brfalse.i4", 3, Pop1, Push0, MintOpBranch) +OPDEF(MINT_BRFALSE_I8, "brfalse.i8", 3, Pop1, Push0, MintOpBranch) +OPDEF(MINT_BRFALSE_R4, "brfalse.r4", 3, Pop1, Push0, MintOpBranch) +OPDEF(MINT_BRFALSE_R8, "brfalse.r8", 3, Pop1, Push0, MintOpBranch) +OPDEF(MINT_BRTRUE_I4, "brtrue.i4", 3, Pop1, Push0, MintOpBranch) +OPDEF(MINT_BRTRUE_I8, "brtrue.i8", 3, Pop1, Push0, MintOpBranch) +OPDEF(MINT_BRTRUE_R4, "brtrue.r4", 3, Pop1, Push0, MintOpBranch) +OPDEF(MINT_BRTRUE_R8, "brtrue.r8", 3, Pop1, Push0, MintOpBranch) + +OPDEF(MINT_BRFALSE_I4_S, "brfalse.i4.s", 2, Pop1, Push0, MintOpShortBranch) +OPDEF(MINT_BRFALSE_I8_S, "brfalse.i8.s", 2, Pop1, Push0, MintOpShortBranch) +OPDEF(MINT_BRFALSE_R4_S, "brfalse.r4.s", 2, Pop1, Push0, MintOpShortBranch) +OPDEF(MINT_BRFALSE_R8_S, "brfalse.r8.s", 2, Pop1, Push0, MintOpShortBranch) +OPDEF(MINT_BRTRUE_I4_S, "brtrue.i4.s", 2, Pop1, Push0, MintOpShortBranch) +OPDEF(MINT_BRTRUE_I8_S, "brtrue.i8.s", 2, Pop1, Push0, MintOpShortBranch) +OPDEF(MINT_BRTRUE_R4_S, "brtrue.r4.s", 2, Pop1, Push0, MintOpShortBranch) +OPDEF(MINT_BRTRUE_R8_S, "brtrue.r8.s", 2, Pop1, Push0, MintOpShortBranch) + +OPDEF(MINT_BEQ_I4, "beq.i4", 3, Pop2, Push0, MintOpBranch) +OPDEF(MINT_BEQ_I8, "beq.i8", 3, Pop2, Push0, MintOpBranch) +OPDEF(MINT_BEQ_R4, "beq.r4", 3, Pop2, Push0, MintOpBranch) +OPDEF(MINT_BEQ_R8, "beq.r8", 3, Pop2, Push0, MintOpBranch) +OPDEF(MINT_BGE_I4, "bge.i4", 3, Pop2, Push0, MintOpBranch) +OPDEF(MINT_BGE_I8, "bge.i8", 3, Pop2, Push0, MintOpBranch) +OPDEF(MINT_BGE_R4, "bge.r4", 3, Pop2, Push0, MintOpBranch) +OPDEF(MINT_BGE_R8, "bge.r8", 3, Pop2, Push0, MintOpBranch) +OPDEF(MINT_BGT_I4, "bgt.i4", 3, Pop2, Push0, MintOpBranch) +OPDEF(MINT_BGT_I8, "bgt.i8", 3, Pop2, Push0, MintOpBranch) +OPDEF(MINT_BGT_R4, "bgt.r4", 3, Pop2, Push0, MintOpBranch) +OPDEF(MINT_BGT_R8, "bgt.r8", 3, Pop2, Push0, MintOpBranch) +OPDEF(MINT_BLT_I4, "blt.i4", 3, Pop2, Push0, MintOpBranch) +OPDEF(MINT_BLT_I8, "blt.i8", 3, Pop2, Push0, MintOpBranch) +OPDEF(MINT_BLT_R4, "blt.r4", 3, Pop2, Push0, MintOpBranch) +OPDEF(MINT_BLT_R8, "blt.r8", 3, Pop2, Push0, MintOpBranch) +OPDEF(MINT_BLE_I4, "ble.i4", 3, Pop2, Push0, MintOpBranch) +OPDEF(MINT_BLE_I8, "ble.i8", 3, Pop2, Push0, MintOpBranch) +OPDEF(MINT_BLE_R4, "ble.r4", 3, Pop2, Push0, MintOpBranch) +OPDEF(MINT_BLE_R8, "ble.r8", 3, Pop2, Push0, MintOpBranch) + +OPDEF(MINT_BNE_UN_I4, "bne.un.i4", 3, Pop2, Push0, MintOpBranch) +OPDEF(MINT_BNE_UN_I8, "bne.un.i8", 3, Pop2, Push0, MintOpBranch) +OPDEF(MINT_BNE_UN_R4, "bne.un.r4", 3, Pop2, Push0, MintOpBranch) +OPDEF(MINT_BNE_UN_R8, "bne.un.r8", 3, Pop2, Push0, MintOpBranch) +OPDEF(MINT_BGE_UN_I4, "bge.un.i4", 3, Pop2, Push0, MintOpBranch) +OPDEF(MINT_BGE_UN_I8, "bge.un.i8", 3, Pop2, Push0, MintOpBranch) +OPDEF(MINT_BGE_UN_R4, "bge.un.r4", 3, Pop2, Push0, MintOpBranch) +OPDEF(MINT_BGE_UN_R8, "bge.un.r8", 3, Pop2, Push0, MintOpBranch) +OPDEF(MINT_BGT_UN_I4, "bgt.un.i4", 3, Pop2, Push0, MintOpBranch) +OPDEF(MINT_BGT_UN_I8, "bgt.un.i8", 3, Pop2, Push0, MintOpBranch) +OPDEF(MINT_BGT_UN_R4, "bgt.un.r4", 3, Pop2, Push0, MintOpBranch) +OPDEF(MINT_BGT_UN_R8, "bgt.un.r8", 3, Pop2, Push0, MintOpBranch) +OPDEF(MINT_BLE_UN_I4, "ble.un.i4", 3, Pop2, Push0, MintOpBranch) +OPDEF(MINT_BLE_UN_I8, "ble.un.i8", 3, Pop2, Push0, MintOpBranch) +OPDEF(MINT_BLE_UN_R4, "ble.un.r4", 3, Pop2, Push0, MintOpBranch) +OPDEF(MINT_BLE_UN_R8, "ble.un.r8", 3, Pop2, Push0, MintOpBranch) +OPDEF(MINT_BLT_UN_I4, "blt.un.i4", 3, Pop2, Push0, MintOpBranch) +OPDEF(MINT_BLT_UN_I8, "blt.un.i8", 3, Pop2, Push0, MintOpBranch) +OPDEF(MINT_BLT_UN_R4, "blt.un.r4", 3, Pop2, Push0, MintOpBranch) +OPDEF(MINT_BLT_UN_R8, "blt.un.r8", 3, Pop2, Push0, MintOpBranch) + +OPDEF(MINT_BEQ_I4_S, "beq.i4.s", 2, Pop2, Push0, MintOpShortBranch) +OPDEF(MINT_BEQ_I8_S, "beq.i8.s", 2, Pop2, Push0, MintOpShortBranch) +OPDEF(MINT_BEQ_R4_S, "beq.r4.s", 2, Pop2, Push0, MintOpShortBranch) +OPDEF(MINT_BEQ_R8_S, "beq.r8.s", 2, Pop2, Push0, MintOpShortBranch) +OPDEF(MINT_BGE_I4_S, "bge.i4.s", 2, Pop2, Push0, MintOpShortBranch) +OPDEF(MINT_BGE_I8_S, "bge.i8.s", 2, Pop2, Push0, MintOpShortBranch) +OPDEF(MINT_BGE_R4_S, "bge.r4.s", 2, Pop2, Push0, MintOpShortBranch) +OPDEF(MINT_BGE_R8_S, "bge.r8.s", 2, Pop2, Push0, MintOpShortBranch) +OPDEF(MINT_BGT_I4_S, "bgt.i4.s", 2, Pop2, Push0, MintOpShortBranch) +OPDEF(MINT_BGT_I8_S, "bgt.i8.s", 2, Pop2, Push0, MintOpShortBranch) +OPDEF(MINT_BGT_R4_S, "bgt.r4.s", 2, Pop2, Push0, MintOpShortBranch) +OPDEF(MINT_BGT_R8_S, "bgt.r8.s", 2, Pop2, Push0, MintOpShortBranch) +OPDEF(MINT_BLT_I4_S, "blt.i4.s", 2, Pop2, Push0, MintOpShortBranch) +OPDEF(MINT_BLT_I8_S, "blt.i8.s", 2, Pop2, Push0, MintOpShortBranch) +OPDEF(MINT_BLT_R4_S, "blt.r4.s", 2, Pop2, Push0, MintOpShortBranch) +OPDEF(MINT_BLT_R8_S, "blt.r8.s", 2, Pop2, Push0, MintOpShortBranch) +OPDEF(MINT_BLE_I4_S, "ble.i4.s", 2, Pop2, Push0, MintOpShortBranch) +OPDEF(MINT_BLE_I8_S, "ble.i8.s", 2, Pop2, Push0, MintOpShortBranch) +OPDEF(MINT_BLE_R4_S, "ble.r4.s", 2, Pop2, Push0, MintOpShortBranch) +OPDEF(MINT_BLE_R8_S, "ble.r8.s", 2, Pop2, Push0, MintOpShortBranch) + +OPDEF(MINT_BNE_UN_I4_S, "bne.un.i4.s", 2, Pop2, Push0, MintOpShortBranch) +OPDEF(MINT_BNE_UN_I8_S, "bne.un.i8.s", 2, Pop2, Push0, MintOpShortBranch) +OPDEF(MINT_BNE_UN_R4_S, "bne.un.r4.s", 2, Pop2, Push0, MintOpShortBranch) +OPDEF(MINT_BNE_UN_R8_S, "bne.un.r8.s", 2, Pop2, Push0, MintOpShortBranch) +OPDEF(MINT_BGE_UN_I4_S, "bge.un.i4.s", 2, Pop2, Push0, MintOpShortBranch) +OPDEF(MINT_BGE_UN_I8_S, "bge.un.i8.s", 2, Pop2, Push0, MintOpShortBranch) +OPDEF(MINT_BGE_UN_R4_S, "bge.un.r4.s", 2, Pop2, Push0, MintOpShortBranch) +OPDEF(MINT_BGE_UN_R8_S, "bge.un.r8.s", 2, Pop2, Push0, MintOpShortBranch) +OPDEF(MINT_BGT_UN_I4_S, "bgt.un.i4.s", 2, Pop2, Push0, MintOpShortBranch) +OPDEF(MINT_BGT_UN_I8_S, "bgt.un.i8.s", 2, Pop2, Push0, MintOpShortBranch) +OPDEF(MINT_BGT_UN_R4_S, "bgt.un.r4.s", 2, Pop2, Push0, MintOpShortBranch) +OPDEF(MINT_BGT_UN_R8_S, "bgt.un.r8.s", 2, Pop2, Push0, MintOpShortBranch) +OPDEF(MINT_BLE_UN_I4_S, "ble.un.i4.s", 2, Pop2, Push0, MintOpShortBranch) +OPDEF(MINT_BLE_UN_I8_S, "ble.un.i8.s", 2, Pop2, Push0, MintOpShortBranch) +OPDEF(MINT_BLE_UN_R4_S, "ble.un.r4.s", 2, Pop2, Push0, MintOpShortBranch) +OPDEF(MINT_BLE_UN_R8_S, "ble.un.r8.s", 2, Pop2, Push0, MintOpShortBranch) +OPDEF(MINT_BLT_UN_I4_S, "blt.un.i4.s", 2, Pop2, Push0, MintOpShortBranch) +OPDEF(MINT_BLT_UN_I8_S, "blt.un.i8.s", 2, Pop2, Push0, MintOpShortBranch) +OPDEF(MINT_BLT_UN_R4_S, "blt.un.r4.s", 2, Pop2, Push0, MintOpShortBranch) +OPDEF(MINT_BLT_UN_R8_S, "blt.un.r8.s", 2, Pop2, Push0, MintOpShortBranch) + +OPDEF(MINT_SWITCH, "switch", 0, Pop1, Push0, MintOpSwitch) + +OPDEF(MINT_LDSTR, "ldstr", 2, Pop0, Push1, MintOpMethodToken) /* not really */ +OPDEF(MINT_LDSTR_TOKEN, "ldstr.token", 2, Pop0, Push1, MintOpMethodToken) /* not really */ + +OPDEF(MINT_CALL, "call", 2, VarPop, Push1, MintOpMethodToken) +OPDEF(MINT_VCALL, "vcall", 2, VarPop, Push0, MintOpMethodToken) +OPDEF(MINT_CALLVIRT, "callvirt", 2, VarPop, Push1, MintOpMethodToken) +OPDEF(MINT_VCALLVIRT, "vcallvirt", 2, VarPop, Push0, MintOpMethodToken) +OPDEF(MINT_CALLVIRT_FAST, "callvirt.fast", 3, VarPop, Push1, MintOpMethodToken) +OPDEF(MINT_VCALLVIRT_FAST, "vcallvirt.fast", 3, VarPop, Push0, MintOpMethodToken) +OPDEF(MINT_CALLI, "calli", 2, VarPop, VarPush, MintOpMethodToken) +OPDEF(MINT_CALLI_NAT, "calli.nat", 3, VarPop, VarPush, MintOpMethodToken) +OPDEF(MINT_CALLI_NAT_FAST, "calli.nat.fast", 4, VarPop, VarPush, MintOpMethodToken) +OPDEF(MINT_CALL_VARARG, "call.vararg", 3, VarPop, VarPush, MintOpMethodToken) +OPDEF(MINT_JMP, "jmp", 2, Pop0, Push0, MintOpMethodToken) + +OPDEF(MINT_CALLRUN, "callrun", 3, VarPop, VarPush, MintOpNoArgs) + +OPDEF(MINT_ENDFILTER, "endfilter", 1, Pop0, Push0, MintOpNoArgs) + +OPDEF(MINT_NEWOBJ, "newobj", 2, VarPop, Push1, MintOpMethodToken) +OPDEF(MINT_NEWOBJ_ARRAY, "newobj_array", 3, VarPop, Push1, MintOpMethodToken) +OPDEF(MINT_NEWOBJ_FAST, "newobj_fast", 4, VarPop, Push1, MintOpMethodToken) +OPDEF(MINT_NEWOBJ_VT_FAST, "newobj_vt_fast", 3, VarPop, Push1, MintOpMethodToken) +OPDEF(MINT_NEWOBJ_VTST_FAST, "newobj_vtst_fast", 4, VarPop, Push1, MintOpMethodToken) +OPDEF(MINT_NEWOBJ_MAGIC, "newobj_magic", 2, Pop0, Push0, MintOpMethodToken) +OPDEF(MINT_INITOBJ, "initobj", 3, Pop1, Push0, MintOpInt) +OPDEF(MINT_CASTCLASS, "castclass", 2, Pop0, Push0, MintOpClassToken) +OPDEF(MINT_ISINST, "isinst", 2, Pop1, Push1, MintOpClassToken) +OPDEF(MINT_CASTCLASS_INTERFACE, "castclass.interface", 2, Pop0, Push0, MintOpClassToken) +OPDEF(MINT_ISINST_INTERFACE, "isinst.interface", 2, Pop1, Push1, MintOpClassToken) +OPDEF(MINT_CASTCLASS_COMMON, "castclass.common", 2, Pop0, Push0, MintOpClassToken) +OPDEF(MINT_ISINST_COMMON, "isinst.common", 2, Pop1, Push1, MintOpClassToken) +OPDEF(MINT_NEWARR, "newarr", 2, Pop1, Push1, MintOpClassToken) +OPDEF(MINT_BOX, "box", 3, Pop0, Push0, MintOpTwoShorts) +OPDEF(MINT_BOX_VT, "box.vt", 3, Pop0, Push0, MintOpTwoShorts) +OPDEF(MINT_BOX_NULLABLE, "box.nullable", 3, Pop0, Push0, MintOpTwoShorts) +OPDEF(MINT_UNBOX, "unbox", 2, Pop1, Push1, MintOpClassToken) +OPDEF(MINT_LDTOKEN, "ldtoken", 2, Pop0, Push1, MintOpClassToken) /* not really */ +OPDEF(MINT_LDFTN, "ldftn", 2, Pop0, Push1, MintOpMethodToken) +OPDEF(MINT_LDFTN_DYNAMIC, "ldftn.dynamic", 1, Pop1, Push1, MintOpMethodToken) +OPDEF(MINT_LDVIRTFTN, "ldvirtftn", 2, Pop1, Push1, MintOpMethodToken) +OPDEF(MINT_CPOBJ, "cpobj", 2, Pop2, Push0, MintOpClassToken) +OPDEF(MINT_CPOBJ_VT, "cpobj.vt", 2, Pop2, Push0, MintOpClassToken) +OPDEF(MINT_LDOBJ_VT, "ldobj.vt", 3, Pop1, Push1, MintOpInt) +OPDEF(MINT_STOBJ_VT, "stobj.vt", 2, Pop2, Push0, MintOpClassToken) +OPDEF(MINT_CPBLK, "cpblk", 1, Pop3, Push0, MintOpNoArgs) +OPDEF(MINT_INITBLK, "initblk", 1, Pop3, Push0, MintOpNoArgs) +OPDEF(MINT_LOCALLOC, "localloc", 1, Pop1, Push1, MintOpNoArgs) +OPDEF(MINT_INITLOCALS, "initlocals", 1, Pop0, Push0, MintOpNoArgs) + +OPDEF(MINT_LDELEM_I, "ldelem.i", 1, Pop2, Push1, MintOpNoArgs) +OPDEF(MINT_LDELEM_I1, "ldelem.i1", 1, Pop2, Push1, MintOpNoArgs) +OPDEF(MINT_LDELEM_U1, "ldelem.u1", 1, Pop2, Push1, MintOpNoArgs) +OPDEF(MINT_LDELEM_I2, "ldelem.i2", 1, Pop2, Push1, MintOpNoArgs) +OPDEF(MINT_LDELEM_U2, "ldelem.u2", 1, Pop2, Push1, MintOpNoArgs) +OPDEF(MINT_LDELEM_I4, "ldelem.i4", 1, Pop2, Push1, MintOpNoArgs) +OPDEF(MINT_LDELEM_U4, "ldelem.u4", 1, Pop2, Push1, MintOpNoArgs) +OPDEF(MINT_LDELEM_I8, "ldelem.i8", 1, Pop2, Push1, MintOpNoArgs) +OPDEF(MINT_LDELEM_R4, "ldelem.r4", 1, Pop2, Push1, MintOpNoArgs) +OPDEF(MINT_LDELEM_R8, "ldelem.r8", 1, Pop2, Push1, MintOpNoArgs) +OPDEF(MINT_LDELEM_REF, "ldelem.ref", 1, Pop2, Push1, MintOpNoArgs) +OPDEF(MINT_LDELEM_VT, "ldelem.vt", 3, Pop2, Push1, MintOpInt) + +OPDEF(MINT_LDELEMA1, "ldelema1", 3, Pop2, Push1, MintOpInt) +OPDEF(MINT_LDELEMA, "ldelema", 4, VarPop, Push1, MintOpTwoShorts) +OPDEF(MINT_LDELEMA_TC, "ldelema.tc", 3, VarPop, Push1, MintOpTwoShorts) + +OPDEF(MINT_STELEM_I, "stelem.i", 1, Pop3, Push0, MintOpNoArgs) +OPDEF(MINT_STELEM_I1, "stelem.i1", 1, Pop3, Push0, MintOpNoArgs) +OPDEF(MINT_STELEM_U1, "stelem.u1", 1, Pop3, Push0, MintOpNoArgs) +OPDEF(MINT_STELEM_I2, "stelem.i2", 1, Pop3, Push0, MintOpNoArgs) +OPDEF(MINT_STELEM_U2, "stelem.u2", 1, Pop3, Push0, MintOpNoArgs) +OPDEF(MINT_STELEM_I4, "stelem.i4", 1, Pop3, Push0, MintOpNoArgs) +OPDEF(MINT_STELEM_I8, "stelem.i8", 1, Pop3, Push0, MintOpNoArgs) +OPDEF(MINT_STELEM_R4, "stelem.r4", 1, Pop3, Push0, MintOpNoArgs) +OPDEF(MINT_STELEM_R8, "stelem.r8", 1, Pop3, Push0, MintOpNoArgs) +OPDEF(MINT_STELEM_REF, "stelem.ref", 1, Pop3, Push0, MintOpNoArgs) +OPDEF(MINT_STELEM_VT, "stelem.vt", 4, Pop3, Push0, MintOpShortAndInt) + +OPDEF(MINT_LDLEN, "ldlen", 1, Pop1, Push1, MintOpNoArgs) +OPDEF(MINT_LDLEN_SPAN, "ldlen.span", 2, Pop1, Push1, MintOpShortInt) + +OPDEF(MINT_GETITEM_SPAN, "getitem.span", 4, Pop2, Push1, MintOpShortAndInt) + +OPDEF(MINT_ADD_I4, "add.i4", 1, Pop2, Push1, MintOpNoArgs) +OPDEF(MINT_ADD_I8, "add.i8", 1, Pop2, Push1, MintOpNoArgs) +OPDEF(MINT_ADD_R4, "add.r4", 1, Pop2, Push1, MintOpNoArgs) +OPDEF(MINT_ADD_R8, "add.r8", 1, Pop2, Push1, MintOpNoArgs) + +OPDEF(MINT_ADD1_I4, "add1.i4", 1, Pop1, Push1, MintOpNoArgs) +OPDEF(MINT_ADD1_I8, "add1.i8", 1, Pop1, Push1, MintOpNoArgs) + +OPDEF(MINT_SUB_I4, "sub.i4", 1, Pop2, Push1, MintOpNoArgs) +OPDEF(MINT_SUB_I8, "sub.i8", 1, Pop2, Push1, MintOpNoArgs) +OPDEF(MINT_SUB_R4, "sub.r4", 1, Pop2, Push1, MintOpNoArgs) +OPDEF(MINT_SUB_R8, "sub.r8", 1, Pop2, Push1, MintOpNoArgs) + +OPDEF(MINT_SUB1_I4, "sub1.i4", 1, Pop1, Push1, MintOpNoArgs) +OPDEF(MINT_SUB1_I8, "sub1.i8", 1, Pop1, Push1, MintOpNoArgs) + +OPDEF(MINT_MUL_I4, "mul.i4", 1, Pop2, Push1, MintOpNoArgs) +OPDEF(MINT_MUL_I8, "mul.i8", 1, Pop2, Push1, MintOpNoArgs) +OPDEF(MINT_MUL_R4, "mul.r4", 1, Pop2, Push1, MintOpNoArgs) +OPDEF(MINT_MUL_R8, "mul.r8", 1, Pop2, Push1, MintOpNoArgs) + +OPDEF(MINT_DIV_I4, "div.i4", 1, Pop2, Push1, MintOpNoArgs) +OPDEF(MINT_DIV_I8, "div.i8", 1, Pop2, Push1, MintOpNoArgs) +OPDEF(MINT_DIV_R4, "div.r4", 1, Pop2, Push1, MintOpNoArgs) +OPDEF(MINT_DIV_R8, "div.r8", 1, Pop2, Push1, MintOpNoArgs) + +OPDEF(MINT_DIV_UN_I4, "div.un.i4", 1, Pop2, Push1, MintOpNoArgs) +OPDEF(MINT_DIV_UN_I8, "div.un.i8", 1, Pop2, Push1, MintOpNoArgs) + +OPDEF(MINT_ADD_OVF_I4, "add.ovf.i4", 1, Pop2, Push1, MintOpNoArgs) +OPDEF(MINT_ADD_OVF_I8, "add.ovf.i8", 1, Pop2, Push1, MintOpNoArgs) + +OPDEF(MINT_ADD_OVF_UN_I4, "add.ovf.un.i4", 1, Pop2, Push1, MintOpNoArgs) +OPDEF(MINT_ADD_OVF_UN_I8, "add.ovf.un.i8", 1, Pop2, Push1, MintOpNoArgs) + +OPDEF(MINT_MUL_OVF_I4, "mul.ovf.i4", 1, Pop2, Push1, MintOpNoArgs) +OPDEF(MINT_MUL_OVF_I8, "mul.ovf.i8", 1, Pop2, Push1, MintOpNoArgs) + +OPDEF(MINT_MUL_OVF_UN_I4, "mul.ovf.un.i4", 1, Pop2, Push1, MintOpNoArgs) +OPDEF(MINT_MUL_OVF_UN_I8, "mul.ovf.un.i8", 1, Pop2, Push1, MintOpNoArgs) + +OPDEF(MINT_SUB_OVF_I4, "sub.ovf.i4", 1, Pop2, Push1, MintOpNoArgs) +OPDEF(MINT_SUB_OVF_I8, "sub.ovf.i8", 1, Pop2, Push1, MintOpNoArgs) + +OPDEF(MINT_SUB_OVF_UN_I4, "sub.ovf.un.i4", 1, Pop2, Push1, MintOpNoArgs) +OPDEF(MINT_SUB_OVF_UN_I8, "sub.ovf.un.i8", 1, Pop2, Push1, MintOpNoArgs) + +OPDEF(MINT_NEG_I4, "neg.i4", 1, Pop1, Push1, MintOpNoArgs) +OPDEF(MINT_NEG_I8, "neg.i8", 1, Pop1, Push1, MintOpNoArgs) +OPDEF(MINT_NEG_R4, "neg.r4", 1, Pop1, Push1, MintOpNoArgs) +OPDEF(MINT_NEG_R8, "neg.r8", 1, Pop1, Push1, MintOpNoArgs) + +OPDEF(MINT_NOT_I4, "not.i4", 1, Pop1, Push1, MintOpNoArgs) +OPDEF(MINT_NOT_I8, "not.i8", 1, Pop1, Push1, MintOpNoArgs) + +OPDEF(MINT_AND_I4, "and.i4", 1, Pop2, Push1, MintOpNoArgs) +OPDEF(MINT_AND_I8, "and.i8", 1, Pop2, Push1, MintOpNoArgs) + +OPDEF(MINT_OR_I4, "or.i4", 1, Pop2, Push1, MintOpNoArgs) +OPDEF(MINT_OR_I8, "or.i8", 1, Pop2, Push1, MintOpNoArgs) + +OPDEF(MINT_XOR_I4, "xor.i4", 1, Pop2, Push1, MintOpNoArgs) +OPDEF(MINT_XOR_I8, "xor.i8", 1, Pop2, Push1, MintOpNoArgs) + +OPDEF(MINT_REM_I4, "rem.i4", 1, Pop2, Push1, MintOpNoArgs) +OPDEF(MINT_REM_I8, "rem.i8", 1, Pop2, Push1, MintOpNoArgs) +OPDEF(MINT_REM_R4, "rem.r4", 1, Pop2, Push1, MintOpNoArgs) +OPDEF(MINT_REM_R8, "rem.r8", 1, Pop2, Push1, MintOpNoArgs) + +OPDEF(MINT_REM_UN_I4, "rem.un.i4", 1, Pop2, Push1, MintOpNoArgs) +OPDEF(MINT_REM_UN_I8, "rem.un.i8", 1, Pop2, Push1, MintOpNoArgs) + +OPDEF(MINT_SHR_UN_I4, "shr.un.i4", 1, Pop2, Push1, MintOpNoArgs) +OPDEF(MINT_SHR_UN_I8, "shr.un.i8", 1, Pop2, Push1, MintOpNoArgs) +OPDEF(MINT_SHL_I4, "shl.i4", 1, Pop2, Push1, MintOpNoArgs) +OPDEF(MINT_SHL_I8, "shl.i8", 1, Pop2, Push1, MintOpNoArgs) +OPDEF(MINT_SHR_I4, "shr.i4", 1, Pop2, Push1, MintOpNoArgs) +OPDEF(MINT_SHR_I8, "shr.i8", 1, Pop2, Push1, MintOpNoArgs) + +OPDEF(MINT_CONV_R_UN_I4, "conv.r.un.i4", 1, Pop1, Push1, MintOpNoArgs) +OPDEF(MINT_CONV_R_UN_I8, "conv.r.un.i8", 1, Pop1, Push1, MintOpNoArgs) + +OPDEF(MINT_CONV_I1_I4, "conv.i1.i4", 1, Pop1, Push1, MintOpNoArgs) +OPDEF(MINT_CONV_I1_I8, "conv.i1.i8", 1, Pop1, Push1, MintOpNoArgs) +OPDEF(MINT_CONV_I1_R4, "conv.i1.r4", 1, Pop1, Push1, MintOpNoArgs) +OPDEF(MINT_CONV_I1_R8, "conv.i1.r8", 1, Pop1, Push1, MintOpNoArgs) + +OPDEF(MINT_CONV_U1_I4, "conv.u1.i4", 1, Pop1, Push1, MintOpNoArgs) +OPDEF(MINT_CONV_U1_I8, "conv.u1.i8", 1, Pop1, Push1, MintOpNoArgs) +OPDEF(MINT_CONV_U1_R4, "conv.u1.r4", 1, Pop1, Push1, MintOpNoArgs) +OPDEF(MINT_CONV_U1_R8, "conv.u1.r8", 1, Pop1, Push1, MintOpNoArgs) -OPDEF(MINT_CONV_I2_I4, "conv.i2.i4", 1, MintOpNoArgs) -OPDEF(MINT_CONV_I2_I8, "conv.i2.i8", 1, MintOpNoArgs) -OPDEF(MINT_CONV_I2_R4, "conv.i2.r4", 1, MintOpNoArgs) -OPDEF(MINT_CONV_I2_R8, "conv.i2.r8", 1, MintOpNoArgs) +OPDEF(MINT_CONV_I2_I4, "conv.i2.i4", 1, Pop1, Push1, MintOpNoArgs) +OPDEF(MINT_CONV_I2_I8, "conv.i2.i8", 1, Pop1, Push1, MintOpNoArgs) +OPDEF(MINT_CONV_I2_R4, "conv.i2.r4", 1, Pop1, Push1, MintOpNoArgs) +OPDEF(MINT_CONV_I2_R8, "conv.i2.r8", 1, Pop1, Push1, MintOpNoArgs) -OPDEF(MINT_CONV_U2_I4, "conv.u2.i4", 1, MintOpNoArgs) -OPDEF(MINT_CONV_U2_I8, "conv.u2.i8", 1, MintOpNoArgs) -OPDEF(MINT_CONV_U2_R4, "conv.u2.r4", 1, MintOpNoArgs) -OPDEF(MINT_CONV_U2_R8, "conv.u2.r8", 1, MintOpNoArgs) - -OPDEF(MINT_CONV_I4_I8, "conv.i4.i8", 1, MintOpNoArgs) -OPDEF(MINT_CONV_I4_R4, "conv.i4.r4", 1, MintOpNoArgs) -OPDEF(MINT_CONV_I4_R8, "conv.i4.r8", 1, MintOpNoArgs) +OPDEF(MINT_CONV_U2_I4, "conv.u2.i4", 1, Pop1, Push1, MintOpNoArgs) +OPDEF(MINT_CONV_U2_I8, "conv.u2.i8", 1, Pop1, Push1, MintOpNoArgs) +OPDEF(MINT_CONV_U2_R4, "conv.u2.r4", 1, Pop1, Push1, MintOpNoArgs) +OPDEF(MINT_CONV_U2_R8, "conv.u2.r8", 1, Pop1, Push1, MintOpNoArgs) + +OPDEF(MINT_CONV_I4_I8, "conv.i4.i8", 1, Pop1, Push1, MintOpNoArgs) +OPDEF(MINT_CONV_I4_R4, "conv.i4.r4", 1, Pop1, Push1, MintOpNoArgs) +OPDEF(MINT_CONV_I4_R8, "conv.i4.r8", 1, Pop1, Push1, MintOpNoArgs) -OPDEF(MINT_CONV_U4_I8, "conv.u4.i8", 1, MintOpNoArgs) -OPDEF(MINT_CONV_U4_R4, "conv.u4.r4", 1, MintOpNoArgs) -OPDEF(MINT_CONV_U4_R8, "conv.u4.r8", 1, MintOpNoArgs) - -OPDEF(MINT_CONV_I8_I4, "conv.i8.i4", 1, MintOpNoArgs) -OPDEF(MINT_CONV_I8_U4, "conv.i8.u4", 1, MintOpNoArgs) -OPDEF(MINT_CONV_I8_R4, "conv.i8.r4", 1, MintOpNoArgs) -OPDEF(MINT_CONV_I8_R8, "conv.i8.r8", 1, MintOpNoArgs) - -OPDEF(MINT_CONV_R4_I4, "conv.r4.i4", 1, MintOpNoArgs) -OPDEF(MINT_CONV_R4_I8, "conv.r4.i8", 1, MintOpNoArgs) -OPDEF(MINT_CONV_R4_R8, "conv.r4.r8", 1, MintOpNoArgs) - -OPDEF(MINT_CONV_R8_I4, "conv.r8.i4", 1, MintOpNoArgs) -OPDEF(MINT_CONV_R8_I8, "conv.r8.i8", 1, MintOpNoArgs) -OPDEF(MINT_CONV_R8_R4, "conv.r8.r4", 1, MintOpNoArgs) - -OPDEF(MINT_CONV_I4_I8_SP, "conv.i4.i8.sp", 1, MintOpNoArgs) /* special for narrowing sp[-2] on 64 bits */ -OPDEF(MINT_CONV_I8_I4_SP, "conv.i8.i4.sp", 1, MintOpNoArgs) /* special for widening sp[-2] on 64 bits */ -OPDEF(MINT_CONV_R8_R4_SP, "conv.r8.r4.sp", 1, MintOpNoArgs) - -OPDEF(MINT_CONV_U8_I4, "conv.u8.i4", 1, MintOpNoArgs) -OPDEF(MINT_CONV_U8_R4, "conv.u8.r4", 1, MintOpNoArgs) -OPDEF(MINT_CONV_U8_R8, "conv.u8.r8", 1, MintOpNoArgs) - -OPDEF(MINT_CONV_OVF_I1_I4, "conv.ovf.i1.i4", 1, MintOpNoArgs) -OPDEF(MINT_CONV_OVF_I1_I8, "conv.ovf.i1.i8", 1, MintOpNoArgs) -OPDEF(MINT_CONV_OVF_I1_R8, "conv.ovf.i1.r8", 1, MintOpNoArgs) - -OPDEF(MINT_CONV_OVF_I1_U4, "conv.ovf.i1.u4", 1, MintOpNoArgs) -OPDEF(MINT_CONV_OVF_I1_U8, "conv.ovf.i1.u8", 1, MintOpNoArgs) -OPDEF(MINT_CONV_OVF_I1_UN_R8, "conv.ovf.i1.un.r8", 1, MintOpNoArgs) - -OPDEF(MINT_CONV_OVF_U1_I4, "conv.ovf.u1.i4", 1, MintOpNoArgs) -OPDEF(MINT_CONV_OVF_U1_I8, "conv.ovf.u1.i8", 1, MintOpNoArgs) -OPDEF(MINT_CONV_OVF_U1_R8, "conv.ovf.u1.r8", 1, MintOpNoArgs) - -OPDEF(MINT_CONV_OVF_I2_I4, "conv.ovf.i2.i4", 1, MintOpNoArgs) -OPDEF(MINT_CONV_OVF_I2_I8, "conv.ovf.i2.i8", 1, MintOpNoArgs) -OPDEF(MINT_CONV_OVF_I2_R8, "conv.ovf.i2.r8", 1, MintOpNoArgs) - -OPDEF(MINT_CONV_OVF_I2_U4, "conv.ovf.i2.u4", 1, MintOpNoArgs) -OPDEF(MINT_CONV_OVF_I2_U8, "conv.ovf.i2.u8", 1, MintOpNoArgs) -OPDEF(MINT_CONV_OVF_I2_UN_R8, "conv.ovf.i2.un.r8", 1, MintOpNoArgs) - -OPDEF(MINT_CONV_OVF_U2_I4, "conv.ovf.u2.i4", 1, MintOpNoArgs) -OPDEF(MINT_CONV_OVF_U2_I8, "conv.ovf.u2.i8", 1, MintOpNoArgs) -OPDEF(MINT_CONV_OVF_U2_R8, "conv.ovf.u2.r8", 1, MintOpNoArgs) - -OPDEF(MINT_CONV_OVF_I4_U4, "conv.ovf.i4.u4", 1, MintOpNoArgs) -OPDEF(MINT_CONV_OVF_I4_I8, "conv.ovf.i4.i8", 1, MintOpNoArgs) -OPDEF(MINT_CONV_OVF_I4_U8, "conv.ovf.i4.u8", 1, MintOpNoArgs) -OPDEF(MINT_CONV_OVF_I4_R4, "conv.ovf.i4.r4", 1, MintOpNoArgs) -OPDEF(MINT_CONV_OVF_I4_R8, "conv.ovf.i4.r8", 1, MintOpNoArgs) - -OPDEF(MINT_CONV_OVF_I4_UN_I8, "conv.ovf.i4.un.i8", 1, MintOpNoArgs) -OPDEF(MINT_CONV_OVF_I4_UN_R8, "conv.ovf.i4.un.r8", 1, MintOpNoArgs) - -OPDEF(MINT_CONV_OVF_U4_I4, "conv.ovf.u4.i4", 1, MintOpNoArgs) -OPDEF(MINT_CONV_OVF_U4_I8, "conv.ovf.u4.i8", 1, MintOpNoArgs) -OPDEF(MINT_CONV_OVF_U4_R4, "conv.ovf.u4.r4", 1, MintOpNoArgs) -OPDEF(MINT_CONV_OVF_U4_R8, "conv.ovf.u4.r8", 1, MintOpNoArgs) - -OPDEF(MINT_CONV_OVF_I8_U8, "conv.ovf.i8.u8", 1, MintOpNoArgs) -OPDEF(MINT_CONV_OVF_I8_R4, "conv.ovf.i8.r4", 1, MintOpNoArgs) -OPDEF(MINT_CONV_OVF_I8_R8, "conv.ovf.i8.r8", 1, MintOpNoArgs) - -OPDEF(MINT_CONV_OVF_I8_UN_R8, "conv.ovf.i8.un.r8", 1, MintOpNoArgs) -OPDEF(MINT_CONV_OVF_I8_UN_R4, "conv.ovf.i8.un.r4", 1, MintOpNoArgs) - -OPDEF(MINT_CONV_OVF_U8_I4, "conv.ovf.u8.i4", 1, MintOpNoArgs) -OPDEF(MINT_CONV_OVF_U8_I8, "conv.ovf.u8.i8", 1, MintOpNoArgs) -OPDEF(MINT_CONV_OVF_U8_R4, "conv.ovf.u8.r4", 1, MintOpNoArgs) -OPDEF(MINT_CONV_OVF_U8_R8, "conv.ovf.u8.r8", 1, MintOpNoArgs) - -OPDEF(MINT_CEQ_I4, "ceq.i4", 1, MintOpNoArgs) -OPDEF(MINT_CEQ_I8, "ceq.i8", 1, MintOpNoArgs) -OPDEF(MINT_CEQ_R4, "ceq.r4", 1, MintOpNoArgs) -OPDEF(MINT_CEQ_R8, "ceq.r8", 1, MintOpNoArgs) - -OPDEF(MINT_CNE_I4, "cne.i4", 1, MintOpNoArgs) -OPDEF(MINT_CNE_I8, "cne.i8", 1, MintOpNoArgs) -OPDEF(MINT_CNE_R4, "cne.r4", 1, MintOpNoArgs) -OPDEF(MINT_CNE_R8, "cne.r8", 1, MintOpNoArgs) - -OPDEF(MINT_CEQ0_I4, "ceq0.i4", 1, MintOpNoArgs) - -OPDEF(MINT_CGT_I4, "cgt.i4", 1, MintOpNoArgs) -OPDEF(MINT_CGT_I8, "cgt.i8", 1, MintOpNoArgs) -OPDEF(MINT_CGT_R4, "cgt.r4", 1, MintOpNoArgs) -OPDEF(MINT_CGT_R8, "cgt.r8", 1, MintOpNoArgs) - -OPDEF(MINT_CGE_I4, "cge.i4", 1, MintOpNoArgs) -OPDEF(MINT_CGE_I8, "cge.i8", 1, MintOpNoArgs) -OPDEF(MINT_CGE_R4, "cge.r4", 1, MintOpNoArgs) -OPDEF(MINT_CGE_R8, "cge.r8", 1, MintOpNoArgs) - -OPDEF(MINT_CGE_UN_I4, "cge.un.i4", 1, MintOpNoArgs) -OPDEF(MINT_CGE_UN_I8, "cge.un.i8", 1, MintOpNoArgs) - -OPDEF(MINT_CGT_UN_I4, "cgt.un.i4", 1, MintOpNoArgs) -OPDEF(MINT_CGT_UN_I8, "cgt.un.i8", 1, MintOpNoArgs) -OPDEF(MINT_CGT_UN_R4, "cgt.un.r4", 1, MintOpNoArgs) -OPDEF(MINT_CGT_UN_R8, "cgt.un.r8", 1, MintOpNoArgs) - -OPDEF(MINT_CLT_I4, "clt.i4", 1, MintOpNoArgs) -OPDEF(MINT_CLT_I8, "clt.i8", 1, MintOpNoArgs) -OPDEF(MINT_CLT_R4, "clt.r4", 1, MintOpNoArgs) -OPDEF(MINT_CLT_R8, "clt.r8", 1, MintOpNoArgs) - -OPDEF(MINT_CLE_I4, "cle.i4", 1, MintOpNoArgs) -OPDEF(MINT_CLE_I8, "cle.i8", 1, MintOpNoArgs) -OPDEF(MINT_CLE_R4, "cle.r4", 1, MintOpNoArgs) -OPDEF(MINT_CLE_R8, "cle.r8", 1, MintOpNoArgs) - -OPDEF(MINT_CLE_UN_I4, "cle.un.i4", 1, MintOpNoArgs) -OPDEF(MINT_CLE_UN_I8, "cle.un.i8", 1, MintOpNoArgs) - -OPDEF(MINT_CLT_UN_I4, "clt.un.i4", 1, MintOpNoArgs) -OPDEF(MINT_CLT_UN_I8, "clt.un.i8", 1, MintOpNoArgs) -OPDEF(MINT_CLT_UN_R4, "clt.un.r4", 1, MintOpNoArgs) -OPDEF(MINT_CLT_UN_R8, "clt.un.r8", 1, MintOpNoArgs) - -OPDEF(MINT_CKFINITE, "ckfinite", 1, MintOpNoArgs) -OPDEF(MINT_MKREFANY, "mkrefany", 2, MintOpClassToken) -OPDEF(MINT_REFANYTYPE, "refanytype", 1, MintOpNoArgs) -OPDEF(MINT_REFANYVAL, "refanyval", 2, MintOpNoArgs) - -OPDEF(MINT_CKNULL_N, "cknull_n", 2, MintOpUShortInt) - -OPDEF(MINT_GETCHR, "getchr", 1, MintOpNoArgs) -OPDEF(MINT_STRLEN, "strlen", 1, MintOpNoArgs) -OPDEF(MINT_ARRAY_RANK, "array_rank", 1, MintOpNoArgs) - -OPDEF(MINT_ICALL_V_V, "mono_icall_v_v", 2, MintOpClassToken) /* not really */ -OPDEF(MINT_ICALL_V_P, "mono_icall_v_p", 2, MintOpClassToken) -OPDEF(MINT_ICALL_P_V, "mono_icall_p_v", 2, MintOpClassToken) -OPDEF(MINT_ICALL_P_P, "mono_icall_p_p", 2, MintOpClassToken) -OPDEF(MINT_ICALL_PP_V, "mono_icall_pp_v", 2, MintOpClassToken) -OPDEF(MINT_ICALL_PP_P, "mono_icall_pp_p", 2, MintOpClassToken) -OPDEF(MINT_ICALL_PPP_V, "mono_icall_ppp_v", 2, MintOpClassToken) -OPDEF(MINT_ICALL_PPP_P, "mono_icall_ppp_p", 2, MintOpClassToken) -OPDEF(MINT_ICALL_PPPP_V, "mono_icall_pppp_v", 2, MintOpClassToken) -OPDEF(MINT_ICALL_PPPP_P, "mono_icall_pppp_p", 2, MintOpClassToken) -OPDEF(MINT_ICALL_PPPPP_V, "mono_icall_ppppp_v", 2, MintOpClassToken) -OPDEF(MINT_ICALL_PPPPP_P, "mono_icall_ppppp_p", 2, MintOpClassToken) -OPDEF(MINT_ICALL_PPPPPP_V, "mono_icall_pppppp_v", 2, MintOpClassToken) -OPDEF(MINT_ICALL_PPPPPP_P, "mono_icall_pppppp_p", 2, MintOpClassToken) -OPDEF(MINT_MONO_LDPTR, "mono_ldptr", 2, MintOpClassToken) -OPDEF(MINT_MONO_SGEN_THREAD_INFO, "mono_sgen_thread_info", 1, MintOpNoArgs) -OPDEF(MINT_MONO_NEWOBJ, "mono_newobj", 2, MintOpClassToken) -OPDEF(MINT_MONO_RETOBJ, "mono_retobj", 1, MintOpNoArgs) -OPDEF(MINT_MONO_FREE, "mono_free", 1, MintOpNoArgs) -OPDEF(MINT_MONO_ATOMIC_STORE_I4, "mono_atomic.store.i4", 1, MintOpNoArgs) -OPDEF(MINT_MONO_MEMORY_BARRIER, "mono_memory_barrier", 1, MintOpNoArgs) -OPDEF(MINT_MONO_LDDOMAIN, "mono_lddomain", 1, MintOpNoArgs) +OPDEF(MINT_CONV_U4_I8, "conv.u4.i8", 1, Pop1, Push1, MintOpNoArgs) +OPDEF(MINT_CONV_U4_R4, "conv.u4.r4", 1, Pop1, Push1, MintOpNoArgs) +OPDEF(MINT_CONV_U4_R8, "conv.u4.r8", 1, Pop1, Push1, MintOpNoArgs) + +OPDEF(MINT_CONV_I8_I4, "conv.i8.i4", 1, Pop1, Push1, MintOpNoArgs) +OPDEF(MINT_CONV_I8_U4, "conv.i8.u4", 1, Pop1, Push1, MintOpNoArgs) +OPDEF(MINT_CONV_I8_R4, "conv.i8.r4", 1, Pop1, Push1, MintOpNoArgs) +OPDEF(MINT_CONV_I8_R8, "conv.i8.r8", 1, Pop1, Push1, MintOpNoArgs) + +OPDEF(MINT_CONV_R4_I4, "conv.r4.i4", 1, Pop1, Push1, MintOpNoArgs) +OPDEF(MINT_CONV_R4_I8, "conv.r4.i8", 1, Pop1, Push1, MintOpNoArgs) +OPDEF(MINT_CONV_R4_R8, "conv.r4.r8", 1, Pop1, Push1, MintOpNoArgs) + +OPDEF(MINT_CONV_R8_I4, "conv.r8.i4", 1, Pop1, Push1, MintOpNoArgs) +OPDEF(MINT_CONV_R8_I8, "conv.r8.i8", 1, Pop1, Push1, MintOpNoArgs) +OPDEF(MINT_CONV_R8_R4, "conv.r8.r4", 1, Pop1, Push1, MintOpNoArgs) + +OPDEF(MINT_CONV_I4_I8_SP, "conv.i4.i8.sp", 1, Pop1, Push1, MintOpNoArgs) /* special for narrowing sp[-2] on 64 bits */ +OPDEF(MINT_CONV_I8_I4_SP, "conv.i8.i4.sp", 1, Pop1, Push1, MintOpNoArgs) /* special for widening sp[-2] on 64 bits */ +OPDEF(MINT_CONV_R8_R4_SP, "conv.r8.r4.sp", 1, Pop1, Push1, MintOpNoArgs) + +OPDEF(MINT_CONV_U8_I4, "conv.u8.i4", 1, Pop1, Push1, MintOpNoArgs) +OPDEF(MINT_CONV_U8_R4, "conv.u8.r4", 1, Pop1, Push1, MintOpNoArgs) +OPDEF(MINT_CONV_U8_R8, "conv.u8.r8", 1, Pop1, Push1, MintOpNoArgs) + +OPDEF(MINT_CONV_OVF_I1_I4, "conv.ovf.i1.i4", 1, Pop1, Push1, MintOpNoArgs) +OPDEF(MINT_CONV_OVF_I1_I8, "conv.ovf.i1.i8", 1, Pop1, Push1, MintOpNoArgs) +OPDEF(MINT_CONV_OVF_I1_R8, "conv.ovf.i1.r8", 1, Pop1, Push1, MintOpNoArgs) + +OPDEF(MINT_CONV_OVF_I1_U4, "conv.ovf.i1.u4", 1, Pop1, Push1, MintOpNoArgs) +OPDEF(MINT_CONV_OVF_I1_U8, "conv.ovf.i1.u8", 1, Pop1, Push1, MintOpNoArgs) +OPDEF(MINT_CONV_OVF_I1_UN_R8, "conv.ovf.i1.un.r8", 1, Pop1, Push1, MintOpNoArgs) + +OPDEF(MINT_CONV_OVF_U1_I4, "conv.ovf.u1.i4", 1, Pop1, Push1, MintOpNoArgs) +OPDEF(MINT_CONV_OVF_U1_I8, "conv.ovf.u1.i8", 1, Pop1, Push1, MintOpNoArgs) +OPDEF(MINT_CONV_OVF_U1_R8, "conv.ovf.u1.r8", 1, Pop1, Push1, MintOpNoArgs) + +OPDEF(MINT_CONV_OVF_I2_I4, "conv.ovf.i2.i4", 1, Pop1, Push1, MintOpNoArgs) +OPDEF(MINT_CONV_OVF_I2_I8, "conv.ovf.i2.i8", 1, Pop1, Push1, MintOpNoArgs) +OPDEF(MINT_CONV_OVF_I2_R8, "conv.ovf.i2.r8", 1, Pop1, Push1, MintOpNoArgs) + +OPDEF(MINT_CONV_OVF_I2_U4, "conv.ovf.i2.u4", 1, Pop1, Push1, MintOpNoArgs) +OPDEF(MINT_CONV_OVF_I2_U8, "conv.ovf.i2.u8", 1, Pop1, Push1, MintOpNoArgs) +OPDEF(MINT_CONV_OVF_I2_UN_R8, "conv.ovf.i2.un.r8", 1, Pop1, Push1, MintOpNoArgs) + +OPDEF(MINT_CONV_OVF_U2_I4, "conv.ovf.u2.i4", 1, Pop1, Push1, MintOpNoArgs) +OPDEF(MINT_CONV_OVF_U2_I8, "conv.ovf.u2.i8", 1, Pop1, Push1, MintOpNoArgs) +OPDEF(MINT_CONV_OVF_U2_R8, "conv.ovf.u2.r8", 1, Pop1, Push1, MintOpNoArgs) + +OPDEF(MINT_CONV_OVF_I4_U4, "conv.ovf.i4.u4", 1, Pop1, Push1, MintOpNoArgs) +OPDEF(MINT_CONV_OVF_I4_I8, "conv.ovf.i4.i8", 1, Pop1, Push1, MintOpNoArgs) +OPDEF(MINT_CONV_OVF_I4_U8, "conv.ovf.i4.u8", 1, Pop1, Push1, MintOpNoArgs) +OPDEF(MINT_CONV_OVF_I4_R4, "conv.ovf.i4.r4", 1, Pop1, Push1, MintOpNoArgs) +OPDEF(MINT_CONV_OVF_I4_R8, "conv.ovf.i4.r8", 1, Pop1, Push1, MintOpNoArgs) + +OPDEF(MINT_CONV_OVF_I4_UN_I8, "conv.ovf.i4.un.i8", 1, Pop1, Push1, MintOpNoArgs) +OPDEF(MINT_CONV_OVF_I4_UN_R8, "conv.ovf.i4.un.r8", 1, Pop1, Push1, MintOpNoArgs) + +OPDEF(MINT_CONV_OVF_U4_I4, "conv.ovf.u4.i4", 1, Pop1, Push1, MintOpNoArgs) +OPDEF(MINT_CONV_OVF_U4_I8, "conv.ovf.u4.i8", 1, Pop1, Push1, MintOpNoArgs) +OPDEF(MINT_CONV_OVF_U4_R4, "conv.ovf.u4.r4", 1, Pop1, Push1, MintOpNoArgs) +OPDEF(MINT_CONV_OVF_U4_R8, "conv.ovf.u4.r8", 1, Pop1, Push1, MintOpNoArgs) + +OPDEF(MINT_CONV_OVF_I8_U8, "conv.ovf.i8.u8", 1, Pop1, Push1, MintOpNoArgs) +OPDEF(MINT_CONV_OVF_I8_R4, "conv.ovf.i8.r4", 1, Pop1, Push1, MintOpNoArgs) +OPDEF(MINT_CONV_OVF_I8_R8, "conv.ovf.i8.r8", 1, Pop1, Push1, MintOpNoArgs) + +OPDEF(MINT_CONV_OVF_I8_UN_R8, "conv.ovf.i8.un.r8", 1, Pop1, Push1, MintOpNoArgs) +OPDEF(MINT_CONV_OVF_I8_UN_R4, "conv.ovf.i8.un.r4", 1, Pop1, Push1, MintOpNoArgs) + +OPDEF(MINT_CONV_OVF_U8_I4, "conv.ovf.u8.i4", 1, Pop1, Push1, MintOpNoArgs) +OPDEF(MINT_CONV_OVF_U8_I8, "conv.ovf.u8.i8", 1, Pop1, Push1, MintOpNoArgs) +OPDEF(MINT_CONV_OVF_U8_R4, "conv.ovf.u8.r4", 1, Pop1, Push1, MintOpNoArgs) +OPDEF(MINT_CONV_OVF_U8_R8, "conv.ovf.u8.r8", 1, Pop1, Push1, MintOpNoArgs) + +OPDEF(MINT_CEQ_I4, "ceq.i4", 1, Pop2, Push1, MintOpNoArgs) +OPDEF(MINT_CEQ_I8, "ceq.i8", 1, Pop2, Push1, MintOpNoArgs) +OPDEF(MINT_CEQ_R4, "ceq.r4", 1, Pop2, Push1, MintOpNoArgs) +OPDEF(MINT_CEQ_R8, "ceq.r8", 1, Pop2, Push1, MintOpNoArgs) + +OPDEF(MINT_CNE_I4, "cne.i4", 1, Pop2, Push1, MintOpNoArgs) +OPDEF(MINT_CNE_I8, "cne.i8", 1, Pop2, Push1, MintOpNoArgs) +OPDEF(MINT_CNE_R4, "cne.r4", 1, Pop2, Push1, MintOpNoArgs) +OPDEF(MINT_CNE_R8, "cne.r8", 1, Pop2, Push1, MintOpNoArgs) + +OPDEF(MINT_CEQ0_I4, "ceq0.i4", 1, Pop1, Push1, MintOpNoArgs) + +OPDEF(MINT_CGT_I4, "cgt.i4", 1, Pop2, Push1, MintOpNoArgs) +OPDEF(MINT_CGT_I8, "cgt.i8", 1, Pop2, Push1, MintOpNoArgs) +OPDEF(MINT_CGT_R4, "cgt.r4", 1, Pop2, Push1, MintOpNoArgs) +OPDEF(MINT_CGT_R8, "cgt.r8", 1, Pop2, Push1, MintOpNoArgs) + +OPDEF(MINT_CGE_I4, "cge.i4", 1, Pop2, Push1, MintOpNoArgs) +OPDEF(MINT_CGE_I8, "cge.i8", 1, Pop2, Push1, MintOpNoArgs) +OPDEF(MINT_CGE_R4, "cge.r4", 1, Pop2, Push1, MintOpNoArgs) +OPDEF(MINT_CGE_R8, "cge.r8", 1, Pop2, Push1, MintOpNoArgs) + +OPDEF(MINT_CGE_UN_I4, "cge.un.i4", 1, Pop2, Push1, MintOpNoArgs) +OPDEF(MINT_CGE_UN_I8, "cge.un.i8", 1, Pop2, Push1, MintOpNoArgs) + +OPDEF(MINT_CGT_UN_I4, "cgt.un.i4", 1, Pop2, Push1, MintOpNoArgs) +OPDEF(MINT_CGT_UN_I8, "cgt.un.i8", 1, Pop2, Push1, MintOpNoArgs) +OPDEF(MINT_CGT_UN_R4, "cgt.un.r4", 1, Pop2, Push1, MintOpNoArgs) +OPDEF(MINT_CGT_UN_R8, "cgt.un.r8", 1, Pop2, Push1, MintOpNoArgs) + +OPDEF(MINT_CLT_I4, "clt.i4", 1, Pop2, Push1, MintOpNoArgs) +OPDEF(MINT_CLT_I8, "clt.i8", 1, Pop2, Push1, MintOpNoArgs) +OPDEF(MINT_CLT_R4, "clt.r4", 1, Pop2, Push1, MintOpNoArgs) +OPDEF(MINT_CLT_R8, "clt.r8", 1, Pop2, Push1, MintOpNoArgs) + +OPDEF(MINT_CLE_I4, "cle.i4", 1, Pop2, Push1, MintOpNoArgs) +OPDEF(MINT_CLE_I8, "cle.i8", 1, Pop2, Push1, MintOpNoArgs) +OPDEF(MINT_CLE_R4, "cle.r4", 1, Pop2, Push1, MintOpNoArgs) +OPDEF(MINT_CLE_R8, "cle.r8", 1, Pop2, Push1, MintOpNoArgs) + +OPDEF(MINT_CLE_UN_I4, "cle.un.i4", 1, Pop2, Push1, MintOpNoArgs) +OPDEF(MINT_CLE_UN_I8, "cle.un.i8", 1, Pop2, Push1, MintOpNoArgs) + +OPDEF(MINT_CLT_UN_I4, "clt.un.i4", 1, Pop2, Push1, MintOpNoArgs) +OPDEF(MINT_CLT_UN_I8, "clt.un.i8", 1, Pop2, Push1, MintOpNoArgs) +OPDEF(MINT_CLT_UN_R4, "clt.un.r4", 1, Pop2, Push1, MintOpNoArgs) +OPDEF(MINT_CLT_UN_R8, "clt.un.r8", 1, Pop2, Push1, MintOpNoArgs) + +OPDEF(MINT_CKFINITE, "ckfinite", 1, Pop1, Push1, MintOpNoArgs) +OPDEF(MINT_MKREFANY, "mkrefany", 2, Pop1, Push1, MintOpClassToken) +OPDEF(MINT_REFANYTYPE, "refanytype", 1, Pop1, Push1, MintOpNoArgs) +OPDEF(MINT_REFANYVAL, "refanyval", 2, Pop1, Push1, MintOpNoArgs) + +OPDEF(MINT_CKNULL_N, "cknull_n", 2, Pop0, Push0, MintOpUShortInt) + +OPDEF(MINT_GETCHR, "getchr", 1, Pop2, Push1, MintOpNoArgs) +OPDEF(MINT_STRLEN, "strlen", 1, Pop1, Push1, MintOpNoArgs) +OPDEF(MINT_ARRAY_RANK, "array_rank", 1, Pop1, Push1, MintOpNoArgs) + +OPDEF(MINT_ICALL_V_V, "mono_icall_v_v", 2, Pop0, Push0, MintOpClassToken) /* not really */ +OPDEF(MINT_ICALL_V_P, "mono_icall_v_p", 2, Pop0, Push1, MintOpClassToken) +OPDEF(MINT_ICALL_P_V, "mono_icall_p_v", 2, Pop1, Push0, MintOpClassToken) +OPDEF(MINT_ICALL_P_P, "mono_icall_p_p", 2, Pop1, Push1, MintOpClassToken) +OPDEF(MINT_ICALL_PP_V, "mono_icall_pp_v", 2, Pop2, Push0, MintOpClassToken) +OPDEF(MINT_ICALL_PP_P, "mono_icall_pp_p", 2, Pop2, Push1, MintOpClassToken) +OPDEF(MINT_ICALL_PPP_V, "mono_icall_ppp_v", 2, Pop3, Push0, MintOpClassToken) +OPDEF(MINT_ICALL_PPP_P, "mono_icall_ppp_p", 2, Pop3, Push1, MintOpClassToken) +OPDEF(MINT_ICALL_PPPP_V, "mono_icall_pppp_v", 2, Pop4, Push0, MintOpClassToken) +OPDEF(MINT_ICALL_PPPP_P, "mono_icall_pppp_p", 2, Pop4, Push1, MintOpClassToken) +OPDEF(MINT_ICALL_PPPPP_V, "mono_icall_ppppp_v", 2, Pop5, Push0, MintOpClassToken) +OPDEF(MINT_ICALL_PPPPP_P, "mono_icall_ppppp_p", 2, Pop5, Push1, MintOpClassToken) +OPDEF(MINT_ICALL_PPPPPP_V, "mono_icall_pppppp_v", 2, Pop6, Push0, MintOpClassToken) +OPDEF(MINT_ICALL_PPPPPP_P, "mono_icall_pppppp_p", 2, Pop6, Push1, MintOpClassToken) +OPDEF(MINT_MONO_LDPTR, "mono_ldptr", 2, Pop0, Push1, MintOpClassToken) +OPDEF(MINT_MONO_SGEN_THREAD_INFO, "mono_sgen_thread_info", 1, Pop0, Push1, MintOpNoArgs) +OPDEF(MINT_MONO_NEWOBJ, "mono_newobj", 2, Pop0, Push1, MintOpClassToken) +OPDEF(MINT_MONO_RETOBJ, "mono_retobj", 1, Pop1, Push0, MintOpNoArgs) +OPDEF(MINT_MONO_ATOMIC_STORE_I4, "mono_atomic.store.i4", 1, Pop2, Push0, MintOpNoArgs) +OPDEF(MINT_MONO_MEMORY_BARRIER, "mono_memory_barrier", 1, Pop0, Push0, MintOpNoArgs) +OPDEF(MINT_MONO_LDDOMAIN, "mono_lddomain", 1, Pop0, Push1, MintOpNoArgs) // FIXME: MintOp -OPDEF(MINT_JIT_CALL, "mono_jit_call", 2, MintOpNoArgs) -OPDEF(MINT_SDB_INTR_LOC, "sdb_intr_loc", 1, MintOpNoArgs) -OPDEF(MINT_SDB_SEQ_POINT, "sdb_seq_point", 1, MintOpNoArgs) -OPDEF(MINT_SDB_BREAKPOINT, "sdb_breakpoint", 1, MintOpNoArgs) -OPDEF(MINT_LD_DELEGATE_METHOD_PTR, "ld_delegate_method_ptr", 1, MintOpNoArgs) -OPDEF(MINT_LD_DELEGATE_INVOKE_IMPL, "ld_delegate_invoke_impl", 2, MintOpNoArgs) +OPDEF(MINT_JIT_CALL, "mono_jit_call", 2, VarPop, VarPush, MintOpNoArgs) +OPDEF(MINT_SDB_INTR_LOC, "sdb_intr_loc", 1, Pop0, Push0, MintOpNoArgs) +OPDEF(MINT_SDB_SEQ_POINT, "sdb_seq_point", 1, Pop0, Push0, MintOpNoArgs) +OPDEF(MINT_SDB_BREAKPOINT, "sdb_breakpoint", 1, Pop0, Push0, MintOpNoArgs) +OPDEF(MINT_LD_DELEGATE_METHOD_PTR, "ld_delegate_method_ptr", 1, Pop1, Push1, MintOpNoArgs) +OPDEF(MINT_LD_DELEGATE_INVOKE_IMPL, "ld_delegate_invoke_impl", 2, Pop0, Push1, MintOpNoArgs) -OPDEF(MINT_START_ABORT_PROT, "start_abort_protected", 1, MintOpNoArgs) +OPDEF(MINT_START_ABORT_PROT, "start_abort_protected", 1, Pop0, Push0, MintOpNoArgs) // Math intrinsics -OPDEF(MINT_ABS, "abs", 1, MintOpNoArgs) -OPDEF(MINT_ASIN, "asin", 1, MintOpNoArgs) -OPDEF(MINT_ASINH, "asinh", 1, MintOpNoArgs) -OPDEF(MINT_ACOS, "acos", 1, MintOpNoArgs) -OPDEF(MINT_ACOSH, "acosh", 1, MintOpNoArgs) -OPDEF(MINT_ATAN, "atan", 1, MintOpNoArgs) -OPDEF(MINT_ATANH, "atanh", 1, MintOpNoArgs) -OPDEF(MINT_COS, "cos", 1, MintOpNoArgs) -OPDEF(MINT_CBRT, "cbrt", 1, MintOpNoArgs) -OPDEF(MINT_COSH, "cosh", 1, MintOpNoArgs) -OPDEF(MINT_SIN, "sin", 1, MintOpNoArgs) -OPDEF(MINT_SQRT, "sqrt", 1, MintOpNoArgs) -OPDEF(MINT_SINH, "sinh", 1, MintOpNoArgs) -OPDEF(MINT_TAN, "tan", 1, MintOpNoArgs) -OPDEF(MINT_TANH, "tanh", 1, MintOpNoArgs) +OPDEF(MINT_ABS, "abs", 1, Pop1, Push1, MintOpNoArgs) +OPDEF(MINT_ASIN, "asin", 1, Pop1, Push1, MintOpNoArgs) +OPDEF(MINT_ASINH, "asinh", 1, Pop1, Push1, MintOpNoArgs) +OPDEF(MINT_ACOS, "acos", 1, Pop1, Push1, MintOpNoArgs) +OPDEF(MINT_ACOSH, "acosh", 1, Pop1, Push1, MintOpNoArgs) +OPDEF(MINT_ATAN, "atan", 1, Pop1, Push1, MintOpNoArgs) +OPDEF(MINT_ATANH, "atanh", 1, Pop1, Push1, MintOpNoArgs) +OPDEF(MINT_COS, "cos", 1, Pop1, Push1, MintOpNoArgs) +OPDEF(MINT_CBRT, "cbrt", 1, Pop1, Push1, MintOpNoArgs) +OPDEF(MINT_COSH, "cosh", 1, Pop1, Push1, MintOpNoArgs) +OPDEF(MINT_SIN, "sin", 1, Pop1, Push1, MintOpNoArgs) +OPDEF(MINT_SQRT, "sqrt", 1, Pop1, Push1, MintOpNoArgs) +OPDEF(MINT_SINH, "sinh", 1, Pop1, Push1, MintOpNoArgs) +OPDEF(MINT_TAN, "tan", 1, Pop1, Push1, MintOpNoArgs) +OPDEF(MINT_TANH, "tanh", 1, Pop1, Push1, MintOpNoArgs) /* * This needs to be an opcode because we need to trigger the enter event after * the STINARG* opcodes have executed. */ -OPDEF(MINT_PROF_ENTER, "prof_enter", 1, MintOpNoArgs) -OPDEF(MINT_TRACE_ENTER, "trace_enter", 1, MintOpNoArgs) -OPDEF(MINT_TRACE_EXIT, "trace_exit", 3, MintOpInt) +OPDEF(MINT_PROF_ENTER, "prof_enter", 1, Pop0, Push0, MintOpNoArgs) +OPDEF(MINT_TRACE_ENTER, "trace_enter", 1, Pop0, Push0, MintOpNoArgs) +OPDEF(MINT_TRACE_EXIT, "trace_exit", 3, Pop0, Push0, MintOpInt) -OPDEF(MINT_INTRINS_ENUM_HASFLAG, "intrins_enum_hasflag", 2, MintOpClassToken) -OPDEF(MINT_INTRINS_GET_HASHCODE, "intrins_get_hashcode", 1, MintOpNoArgs) -OPDEF(MINT_INTRINS_GET_TYPE, "intrins_get_type", 1, MintOpNoArgs) -OPDEF(MINT_INTRINS_BYREFERENCE_CTOR, "intrins_byreference_ctor", 2, MintOpClassToken) -OPDEF(MINT_INTRINS_BYREFERENCE_GET_VALUE, "intrins_byreference_get_value", 1, MintOpNoArgs) -OPDEF(MINT_INTRINS_UNSAFE_ADD_BYTE_OFFSET, "intrins_unsafe_add_byte_offset", 1, MintOpNoArgs) -OPDEF(MINT_INTRINS_UNSAFE_BYTE_OFFSET, "intrins_unsafe_byte_offset", 1, MintOpNoArgs) -OPDEF(MINT_INTRINS_RUNTIMEHELPERS_OBJECT_HAS_COMPONENT_SIZE, "intrins_runtimehelpers_object_has_component_size", 1, MintOpNoArgs) +OPDEF(MINT_INTRINS_ENUM_HASFLAG, "intrins_enum_hasflag", 2, Pop2, Push1, MintOpClassToken) +OPDEF(MINT_INTRINS_GET_HASHCODE, "intrins_get_hashcode", 1, Pop1, Push1, MintOpNoArgs) +OPDEF(MINT_INTRINS_GET_TYPE, "intrins_get_type", 1, Pop1, Push1, MintOpNoArgs) +OPDEF(MINT_INTRINS_BYREFERENCE_CTOR, "intrins_byreference_ctor", 2, VarPop, Push1, MintOpClassToken) +OPDEF(MINT_INTRINS_BYREFERENCE_GET_VALUE, "intrins_byreference_get_value", 1, Pop1, Push1, MintOpNoArgs) +OPDEF(MINT_INTRINS_UNSAFE_ADD_BYTE_OFFSET, "intrins_unsafe_add_byte_offset", 1, Pop2, Push1, MintOpNoArgs) +OPDEF(MINT_INTRINS_UNSAFE_BYTE_OFFSET, "intrins_unsafe_byte_offset", 1, Pop2, Push1, MintOpNoArgs) +OPDEF(MINT_INTRINS_RUNTIMEHELPERS_OBJECT_HAS_COMPONENT_SIZE, "intrins_runtimehelpers_object_has_component_size", 1, Pop1, Push1, MintOpNoArgs) diff --git a/mono/mini/interp/mintops.h b/mono/mini/interp/mintops.h index 2920224511..b70a88dc21 100644 --- a/mono/mini/interp/mintops.h +++ b/mono/mini/interp/mintops.h @@ -26,12 +26,11 @@ typedef enum MintOpShortAndInt } MintOpArgType; -#define OPDEF(a,b,c,d) \ - a, -enum { +#define OPDEF(a,b,c,d,e,f) a, +typedef enum { #include "mintops.def" MINT_LASTOP -}; +} MintOpcode; #undef OPDEF #if NO_UNALIGNED_ACCESS @@ -55,11 +54,28 @@ enum { #define MINT_SWITCH_LEN(n) (3 + (n) * 2) -extern const char *mono_interp_opname[]; -extern unsigned char mono_interp_oplen[]; -extern MintOpArgType mono_interp_opargtype[]; -extern char* mono_interp_dis_mintop(const unsigned short *base, const guint16 *ip); +#define MINT_IS_LDLOC(op) ((op) >= MINT_LDLOC_I1 && (op) <= MINT_LDLOC_VT) +#define MINT_IS_STLOC(op) ((op) >= MINT_STLOC_I1 && (op) <= MINT_STLOC_VT) +#define MINT_IS_MOVLOC(op) ((op) >= MINT_MOVLOC_1 && (op) <= MINT_MOVLOC_VT) +#define MINT_IS_STLOC_NP(op) ((op) >= MINT_STLOC_NP_I4 && (op) <= MINT_STLOC_NP_O) + +#define MINT_POP_ALL -2 +#define MINT_VAR_PUSH -1 +#define MINT_VAR_POP -1 + +extern unsigned char const mono_interp_oplen[]; +extern int const mono_interp_oppop[]; +extern int const mono_interp_oppush[]; +extern MintOpArgType const mono_interp_opargtype[]; +extern char* mono_interp_dis_mintop (const unsigned short *base, const guint16 *ip); extern const guint16* mono_interp_dis_mintop_len (const guint16 *ip); -#endif +// This, instead of an array of pointers, to optimize away a pointer and a relocation per string. +extern const guint16 mono_interp_opname_offsets [ ]; +typedef struct MonoInterpOpnameCharacters MonoInterpOpnameCharacters; +extern const MonoInterpOpnameCharacters mono_interp_opname_characters; +const char* +mono_interp_opname (int op); + +#endif diff --git a/mono/mini/interp/transform.c.REMOVED.git-id b/mono/mini/interp/transform.c.REMOVED.git-id index d7c6024942..98045bf4ba 100644 --- a/mono/mini/interp/transform.c.REMOVED.git-id +++ b/mono/mini/interp/transform.c.REMOVED.git-id @@ -1 +1 @@ -54c49a0168b2db1ef92fb9cd1fb7c088942ee2a6 \ No newline at end of file +c4ad519aad929d2a11536a2626ec21db424cc23c \ No newline at end of file diff --git a/mono/mini/intrinsics.c b/mono/mini/intrinsics.c index cb7a41cb42..4b03d7da01 100644 --- a/mono/mini/intrinsics.c +++ b/mono/mini/intrinsics.c @@ -34,6 +34,8 @@ emit_array_generic_access (MonoCompile *cfg, MonoMethodSignature *fsig, MonoInst MonoType *etype = m_class_get_byval_arg (eklass); if (is_set) { EMIT_NEW_LOAD_MEMBASE_TYPE (cfg, load, etype, args [2]->dreg, 0); + if (!mini_debug_options.weak_memory_model && mini_type_is_reference (etype)) + mini_emit_memory_barrier (cfg, MONO_MEMORY_BARRIER_REL); EMIT_NEW_STORE_MEMBASE_TYPE (cfg, store, etype, addr->dreg, 0, load->dreg); if (mini_type_is_reference (etype)) mini_emit_write_barrier (cfg, addr, load); @@ -109,47 +111,151 @@ llvm_emit_inst_for_method (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSign { MonoInst *ins = NULL; int opcode = 0; + // Convert Math and MathF methods into LLVM intrinsics, e.g. MathF.Sin -> @llvm.sin.f32 + if (in_corlib && !strcmp (m_class_get_name (cmethod->klass), "MathF") && cfg->r4fp) { + // (float) + if (fsig->param_count == 1 && fsig->params [0]->type == MONO_TYPE_R4) { + if (!strcmp (cmethod->name, "Ceiling")) { + opcode = OP_CEILF; + } else if (!strcmp (cmethod->name, "Cos")) { + opcode = OP_COSF; + } else if (!strcmp (cmethod->name, "Exp")) { + opcode = OP_EXPF; + } else if (!strcmp (cmethod->name, "Floor")) { + opcode = OP_FLOORF; + } else if (!strcmp (cmethod->name, "Log2")) { + opcode = OP_LOG2F; + } else if (!strcmp (cmethod->name, "Log10")) { + opcode = OP_LOG10F; + } else if (!strcmp (cmethod->name, "Sin")) { + opcode = OP_SINF; + } else if (!strcmp (cmethod->name, "Sqrt")) { + opcode = OP_SQRTF; + } else if (!strcmp (cmethod->name, "Truncate")) { + opcode = OP_TRUNCF; + } +#if defined(TARGET_X86) || defined(TARGET_AMD64) + else if (!strcmp (cmethod->name, "Round") && !cfg->compile_aot && (mono_arch_cpu_enumerate_simd_versions () & SIMD_VERSION_SSE41)) { + // special case: emit vroundps for MathF.Round directly instead of what llvm.round.f32 emits + // to align with CoreCLR behavior + int xreg = alloc_xreg (cfg); + EMIT_NEW_UNALU (cfg, ins, OP_FCONV_TO_R4_X, xreg, args [0]->dreg); + EMIT_NEW_UNALU (cfg, ins, OP_SSE41_ROUNDSS, xreg, xreg); + ins->inst_c0 = 0x4; // vroundss xmm0, xmm0, xmm0, 0x4 (mode for rounding) + int dreg = alloc_freg (cfg); + EMIT_NEW_UNALU (cfg, ins, OP_EXTRACT_R4, dreg, xreg); + return ins; + } +#endif + } + // (float, float) + if (fsig->param_count == 2 && fsig->params [0]->type == MONO_TYPE_R4 && fsig->params [1]->type == MONO_TYPE_R4) { + if (!strcmp (cmethod->name, "Pow")) { + opcode = OP_RPOW; + } else if (!strcmp (cmethod->name, "CopySign")) { + opcode = OP_RCOPYSIGN; + } + } + // (float, float, float) + if (fsig->param_count == 3 && fsig->params [0]->type == MONO_TYPE_R4 && fsig->params [1]->type == MONO_TYPE_R4 && fsig->params [2]->type == MONO_TYPE_R4) { + if (!strcmp (cmethod->name, "FusedMultiplyAdd")) { + opcode = OP_FMAF; + } + } - if (in_corlib && !strcmp (m_class_get_name (cmethod->klass), "MathF") && fsig->param_count && fsig->params [0]->type == MONO_TYPE_R4 && cfg->r4fp) { - if (!strcmp (cmethod->name, "Sin")) - opcode = OP_SINF; - else if (!strcmp (cmethod->name, "Cos")) - opcode = OP_COSF; - else if (!strcmp (cmethod->name, "Abs")) - opcode = OP_ABSF; - else if (!strcmp (cmethod->name, "Sqrt")) - opcode = OP_SQRTF; - else if (!strcmp (cmethod->name, "Max")) - opcode = OP_RMAX; - else if (!strcmp (cmethod->name, "Pow")) - opcode = OP_RPOW; if (opcode) { MONO_INST_NEW (cfg, ins, opcode); ins->type = STACK_R8; ins->dreg = mono_alloc_dreg (cfg, (MonoStackType)ins->type); ins->sreg1 = args [0]->dreg; - if (fsig->param_count == 2) + if (fsig->param_count > 1) { ins->sreg2 = args [1]->dreg; + } + if (fsig->param_count > 2) { + ins->sreg3 = args [2]->dreg; + } + g_assert (fsig->param_count <= 3); MONO_ADD_INS (cfg->cbb, ins); } } - /* The LLVM backend supports these intrinsics */ + if (cmethod->klass == mono_class_try_get_math_class ()) { - if (strcmp (cmethod->name, "Sin") == 0) { - opcode = OP_SIN; - } else if (strcmp (cmethod->name, "Cos") == 0) { - opcode = OP_COS; - } else if (strcmp (cmethod->name, "Sqrt") == 0) { - opcode = OP_SQRT; - } else if (strcmp (cmethod->name, "Abs") == 0 && fsig->params [0]->type == MONO_TYPE_R8) { - opcode = OP_ABS; + // (double) + if (fsig->param_count == 1 && fsig->params [0]->type == MONO_TYPE_R8) { + if (!strcmp (cmethod->name, "Abs")) { + opcode = OP_ABS; + } else if (!strcmp (cmethod->name, "Ceiling")) { + opcode = OP_CEIL; + } else if (!strcmp (cmethod->name, "Cos")) { + opcode = OP_COS; + } else if (!strcmp (cmethod->name, "Exp")) { + opcode = OP_EXP; + } else if (!strcmp (cmethod->name, "Floor")) { + opcode = OP_FLOOR; + } else if (!strcmp (cmethod->name, "Log")) { + opcode = OP_LOG; + } else if (!strcmp (cmethod->name, "Log2")) { + opcode = OP_LOG2; + } else if (!strcmp (cmethod->name, "Log10")) { + opcode = OP_LOG10; + } else if (!strcmp (cmethod->name, "Sin")) { + opcode = OP_SIN; + } else if (!strcmp (cmethod->name, "Sqrt")) { + opcode = OP_SQRT; + } else if (!strcmp (cmethod->name, "Truncate")) { + opcode = OP_TRUNC; + } + } + // (double, double) + if (fsig->param_count == 2 && fsig->params [0]->type == MONO_TYPE_R8 && fsig->params [1]->type == MONO_TYPE_R8) { + // Max and Min can only be optimized in fast math mode + if (!strcmp (cmethod->name, "Max") && mono_use_fast_math) { + opcode = OP_FMAX; + } else if (!strcmp (cmethod->name, "Min") && mono_use_fast_math) { + opcode = OP_FMIN; + } else if (!strcmp (cmethod->name, "Pow")) { + opcode = OP_FPOW; + } else if (!strcmp (cmethod->name, "CopySign")) { + opcode = OP_FCOPYSIGN; + } + } + // (double, double, double) + if (fsig->param_count == 3 && fsig->params [0]->type == MONO_TYPE_R8 && fsig->params [1]->type == MONO_TYPE_R8 && fsig->params [2]->type == MONO_TYPE_R8) { + if (!strcmp (cmethod->name, "FusedMultiplyAdd")) { + opcode = OP_FMA; + } } - if (opcode && fsig->param_count == 1) { + // Math also contains overloads for floats (MathF inlines them) + // (float) + if (fsig->param_count == 1 && fsig->params [0]->type == MONO_TYPE_R4) { + if (!strcmp (cmethod->name, "Abs")) { + opcode = OP_ABSF; + } + } + // (float, float) + if (fsig->param_count == 2 && fsig->params [0]->type == MONO_TYPE_R4 && fsig->params [1]->type == MONO_TYPE_R4) { + if (!strcmp (cmethod->name, "Max") && mono_use_fast_math) { + opcode = OP_RMAX; + } else if (!strcmp (cmethod->name, "Min") && mono_use_fast_math) { + opcode = OP_RMIN; + } else if (!strcmp (cmethod->name, "Pow")) { + opcode = OP_RPOW; + } + } + + if (opcode && fsig->param_count > 0) { MONO_INST_NEW (cfg, ins, opcode); ins->type = STACK_R8; ins->dreg = mono_alloc_dreg (cfg, (MonoStackType)ins->type); ins->sreg1 = args [0]->dreg; + if (fsig->param_count > 1) { + ins->sreg2 = args [1]->dreg; + } + if (fsig->param_count > 2) { + ins->sreg3 = args [2]->dreg; + } + g_assert (fsig->param_count <= 3); MONO_ADD_INS (cfg->cbb, ins); } @@ -186,6 +292,22 @@ llvm_emit_inst_for_method (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSign } } + if (in_corlib && !strcmp (m_class_get_name (cmethod->klass), "Buffer")) { + if (!strcmp (cmethod->name, "Memmove") && fsig->param_count == 3 && fsig->params [0]->type == MONO_TYPE_PTR && fsig->params [1]->type == MONO_TYPE_PTR) { + // throw NRE if src or dst are nulls + MONO_EMIT_NEW_BIALU_IMM (cfg, OP_COMPARE_IMM, -1, args [0]->dreg, 0); + MONO_EMIT_NEW_COND_EXC (cfg, EQ, "NullReferenceException"); + MONO_EMIT_NEW_BIALU_IMM (cfg, OP_COMPARE_IMM, -1, args [1]->dreg, 0); + MONO_EMIT_NEW_COND_EXC (cfg, EQ, "NullReferenceException"); + + MONO_INST_NEW (cfg, ins, OP_MEMMOVE); + ins->sreg1 = args [0]->dreg; // i1* dst + ins->sreg2 = args [1]->dreg; // i1* src + ins->sreg3 = args [2]->dreg; // i32/i64 len + MONO_ADD_INS (cfg->cbb, ins); + } + } + return ins; } @@ -219,7 +341,7 @@ emit_span_intrinsics (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSignature int index_reg = mini_emit_sext_index_reg (cfg, args [1]); - MONO_EMIT_BOUNDS_CHECK_OFFSET(cfg, span_reg, length_field->offset - MONO_ABI_SIZEOF (MonoObject), index_reg); + mini_emit_bounds_check_offset (cfg, span_reg, length_field->offset - MONO_ABI_SIZEOF (MonoObject), index_reg, NULL); // FIXME: Sign extend index ? @@ -268,6 +390,9 @@ emit_unsafe_intrinsics (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSignatu g_assert (ctx); g_assert (ctx->method_inst); + t = ctx->method_inst->type_argv [0]; + if (mini_is_gsharedvt_variable_type (t)) + return NULL; if (ctx->method_inst->type_argc == 2) { dreg = alloc_preg (cfg); EMIT_NEW_UNALU (cfg, ins, OP_MOVE, dreg, args [0]->dreg); @@ -440,6 +565,16 @@ emit_unsafe_intrinsics (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSignatu ins->type = STACK_PTR; return ins; } +#ifdef ENABLE_NETCORE + else if (!strcmp (cmethod->name, "InitBlockUnaligned")) { + g_assert (fsig->param_count == 3); + + mini_emit_memory_init_bytes (cfg, args [0], args [1], args [2], MONO_INST_UNALIGNED); + MONO_INST_NEW (cfg, ins, OP_NOP); + MONO_ADD_INS (cfg->cbb, ins); + return ins; + } +#endif return NULL; } @@ -503,6 +638,14 @@ emit_jit_helpers_intrinsics (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSi return NULL; } +static gboolean +byref_arg_is_reference (MonoType *t) +{ + g_assert (t->byref); + + return mini_type_is_reference (m_class_get_byval_arg (mono_class_from_mono_type_internal (t))); +} + MonoInst* mini_emit_inst_for_method (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSignature *fsig, MonoInst **args) { @@ -603,11 +746,11 @@ mini_emit_inst_for_method (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSign } else return NULL; } else if (cmethod->klass == mono_defaults.array_class) { - if (strcmp (cmethod->name, "GetGenericValueImpl") == 0 && fsig->param_count + fsig->hasthis == 3 && !cfg->gsharedvt) + if (fsig->param_count + fsig->hasthis == 3 && !cfg->gsharedvt && strcmp (cmethod->name, "GetGenericValueImpl") == 0) return emit_array_generic_access (cfg, fsig, args, FALSE); - else if (strcmp (cmethod->name, "SetGenericValueImpl") == 0 && fsig->param_count + fsig->hasthis == 3 && !cfg->gsharedvt) + else if (fsig->param_count + fsig->hasthis == 3 && !cfg->gsharedvt && strcmp (cmethod->name, "SetGenericValueImpl") == 0) return emit_array_generic_access (cfg, fsig, args, TRUE); - else if (!strcmp (cmethod->name, "GetRawSzArrayData")) { + else if (!strcmp (cmethod->name, "GetRawSzArrayData") || !strcmp (cmethod->name, "GetRawArrayData")) { int dreg = alloc_preg (cfg); EMIT_NEW_BIALU_IMM (cfg, ins, OP_PADD_IMM, dreg, args [0]->dreg, MONO_STRUCT_OFFSET (MonoArray, vector)); return ins; @@ -798,9 +941,9 @@ mini_emit_inst_for_method (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSign return ins; } else if (strcmp (cmethod->name, "MemoryBarrier") == 0 && fsig->param_count == 0) { return mini_emit_memory_barrier (cfg, MONO_MEMORY_BARRIER_SEQ); - } else if (!strcmp (cmethod->name, "VolatileRead") && fsig->param_count == 1) { + } else if (!strcmp (cmethod->name, "VolatileRead") && fsig->param_count == 1 && fsig->params [0]->byref) { guint32 opcode = 0; - gboolean is_ref = mini_type_is_reference (fsig->params [0]); + gboolean is_ref = byref_arg_is_reference (fsig->params [0]); if (fsig->params [0]->type == MONO_TYPE_I1) opcode = OP_LOADI1_MEMBASE; @@ -872,9 +1015,9 @@ mini_emit_inst_for_method (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSign return ins; } - } else if (!strcmp (cmethod->name, "VolatileWrite") && fsig->param_count == 2) { + } else if (!strcmp (cmethod->name, "VolatileWrite") && fsig->param_count == 2 && fsig->params [0]->byref) { guint32 opcode = 0; - gboolean is_ref = mini_type_is_reference (fsig->params [0]); + gboolean is_ref = byref_arg_is_reference (fsig->params [0]); if (fsig->params [0]->type == MONO_TYPE_I1 || fsig->params [0]->type == MONO_TYPE_U1) opcode = OP_STOREI1_MEMBASE_REG; @@ -1019,10 +1162,10 @@ mini_emit_inst_for_method (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSign MONO_ADD_INS (cfg->cbb, ins); } } - else if (strcmp (cmethod->name, "Exchange") == 0 && fsig->param_count == 2) { + else if (strcmp (cmethod->name, "Exchange") == 0 && fsig->param_count == 2 && fsig->params [0]->byref) { MonoInst *f2i = NULL, *i2f; guint32 opcode, f2i_opcode, i2f_opcode; - gboolean is_ref = mini_type_is_reference (fsig->params [0]); + gboolean is_ref = byref_arg_is_reference (fsig->params [0]); gboolean is_float = fsig->params [0]->type == MONO_TYPE_R4 || fsig->params [0]->type == MONO_TYPE_R8; if (fsig->params [0]->type == MONO_TYPE_I4 || @@ -1066,6 +1209,9 @@ mini_emit_inst_for_method (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSign MONO_ADD_INS (cfg->cbb, f2i); } + if (is_ref && !mini_debug_options.weak_memory_model) + mini_emit_memory_barrier (cfg, MONO_MEMORY_BARRIER_REL); + MONO_INST_NEW (cfg, ins, opcode); ins->dreg = is_ref ? mono_alloc_ireg_ref (cfg) : mono_alloc_ireg (cfg); ins->inst_basereg = args [0]->dreg; @@ -1092,7 +1238,7 @@ mini_emit_inst_for_method (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSign ins->type = STACK_R8; break; default: - g_assert (mini_type_is_reference (fsig->params [0])); + g_assert (is_ref); ins->type = STACK_OBJ; break; } @@ -1166,6 +1312,9 @@ mini_emit_inst_for_method (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSign MONO_ADD_INS (cfg->cbb, f2i_cmp); } + if (is_ref && !mini_debug_options.weak_memory_model) + mini_emit_memory_barrier (cfg, MONO_MEMORY_BARRIER_REL); + MONO_INST_NEW (cfg, ins, opcode); ins->dreg = is_ref ? alloc_ireg_ref (cfg) : alloc_ireg (cfg); ins->sreg1 = args [0]->dreg; @@ -1264,8 +1413,7 @@ mini_emit_inst_for_method (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSign gboolean is_float = t->type == MONO_TYPE_R4 || t->type == MONO_TYPE_R8; g_assert (t->byref); - /* t is a byref type, so the reference check is more complicated */ - is_ref = mini_type_is_reference (m_class_get_byval_arg (mono_class_from_mono_type_internal (t))); + is_ref = byref_arg_is_reference (t); if (t->type == MONO_TYPE_I1) opcode = OP_ATOMIC_LOAD_I1; else if (t->type == MONO_TYPE_U1 || t->type == MONO_TYPE_BOOLEAN) @@ -1346,7 +1494,7 @@ mini_emit_inst_for_method (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSign gboolean is_ref; g_assert (t->byref); - is_ref = mini_type_is_reference (m_class_get_byval_arg (mono_class_from_mono_type_internal (t))); + is_ref = byref_arg_is_reference (t); if (t->type == MONO_TYPE_I1) opcode = OP_ATOMIC_STORE_I1; else if (t->type == MONO_TYPE_U1 || t->type == MONO_TYPE_BOOLEAN) @@ -1621,8 +1769,8 @@ mini_emit_inst_for_method (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSign NULLIFY_INS (args [0]); - s = mono_ldstr_utf8 (ji->image, mono_metadata_token_index (ji->token), &cfg->error); - return_val_if_nok (&cfg->error, NULL); + s = mono_ldstr_utf8 (ji->image, mono_metadata_token_index (ji->token), cfg->error); + return_val_if_nok (cfg->error, NULL); MONO_INST_NEW (cfg, ins, OP_OBJC_GET_SELECTOR); ins->dreg = mono_alloc_ireg (cfg); @@ -1695,6 +1843,18 @@ mini_emit_inst_for_method (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSign } } +#ifdef ENABLE_NETCORE + // Return false for IsSupported for all types in System.Runtime.Intrinsics.X86 + // as we don't support them now + if (in_corlib && + !strcmp ("System.Runtime.Intrinsics.X86", cmethod_klass_name_space) && + !strcmp (cmethod->name, "get_IsSupported")) { + EMIT_NEW_ICONST (cfg, ins, 0); + ins->type = STACK_I4; + return ins; + } +#endif + ins = mono_emit_native_types_intrinsics (cfg, cmethod, fsig, args); if (ins) return ins; @@ -1859,7 +2019,13 @@ mini_emit_inst_for_field_load (MonoCompile *cfg, MonoClassField *field) is_le = (TARGET_BYTE_ORDER == G_LITTLE_ENDIAN); EMIT_NEW_ICONST (cfg, ins, is_le); return ins; + } +#ifdef ENABLE_NETCORE + else if ((klass == mono_defaults.int_class || klass == mono_defaults.uint_class) && strcmp (field->name, "Zero") == 0) { + EMIT_NEW_PCONST (cfg, ins, 0); + return ins; } +#endif return NULL; } #else diff --git a/mono/mini/ir-emit.h b/mono/mini/ir-emit.h index 7d2510caae..0fd3accb01 100644 --- a/mono/mini/ir-emit.h +++ b/mono/mini/ir-emit.h @@ -948,41 +948,45 @@ static int ccount = 0; /*Object Model related macros*/ /* Default bounds check implementation for most architectures + llvm */ -#define MONO_EMIT_DEFAULT_BOUNDS_CHECK(cfg, array_reg, offset, index_reg, fault) do { \ +#define MONO_EMIT_DEFAULT_BOUNDS_CHECK(cfg, array_reg, offset, index_reg, fault, ex_name) do { \ int _length_reg = alloc_ireg (cfg); \ if (fault) \ MONO_EMIT_NEW_LOAD_MEMBASE_OP_FAULT (cfg, OP_LOADI4_MEMBASE, _length_reg, array_reg, offset); \ else \ MONO_EMIT_NEW_LOAD_MEMBASE_OP_FLAGS (cfg, OP_LOADI4_MEMBASE, _length_reg, array_reg, offset, MONO_INST_INVARIANT_LOAD); \ MONO_EMIT_NEW_BIALU (cfg, OP_COMPARE, -1, _length_reg, index_reg); \ - MONO_EMIT_NEW_COND_EXC (cfg, LE_UN, "IndexOutOfRangeException"); \ + MONO_EMIT_NEW_COND_EXC (cfg, LE_UN, ex_name); \ } while (0) #ifndef MONO_ARCH_EMIT_BOUNDS_CHECK -#define MONO_ARCH_EMIT_BOUNDS_CHECK(cfg, array_reg, offset, index_reg) MONO_EMIT_DEFAULT_BOUNDS_CHECK ((cfg), (array_reg), (offset), (index_reg), TRUE) +#define MONO_ARCH_EMIT_BOUNDS_CHECK(cfg, array_reg, offset, index_reg, ex_name) MONO_EMIT_DEFAULT_BOUNDS_CHECK ((cfg), (array_reg), (offset), (index_reg), TRUE, ex_name) #endif -#define MONO_EMIT_BOUNDS_CHECK_OFFSET(cfg, array_reg, array_length_offset, index_reg) do { \ - if (!(cfg->opt & MONO_OPT_UNSAFE)) { \ - if (!(cfg->opt & MONO_OPT_ABCREM)) { \ - MONO_EMIT_NULL_CHECK (cfg, array_reg, FALSE); \ - if (COMPILE_LLVM (cfg)) \ - MONO_EMIT_DEFAULT_BOUNDS_CHECK ((cfg), (array_reg), (array_length_offset), (index_reg), TRUE); \ - else \ - MONO_ARCH_EMIT_BOUNDS_CHECK ((cfg), (array_reg), (array_length_offset), (index_reg)); \ - } else { \ - MonoInst *ins; \ - MONO_INST_NEW ((cfg), ins, OP_BOUNDS_CHECK); \ - ins->sreg1 = array_reg; \ - ins->sreg2 = index_reg; \ - ins->inst_imm = (array_length_offset); \ - ins->flags |= MONO_INST_FAULT; \ - MONO_ADD_INS ((cfg)->cbb, ins); \ - (cfg)->flags |= MONO_CFG_NEEDS_DECOMPOSE; \ - (cfg)->cbb->needs_decompose = TRUE; \ - } \ - } \ - } while (0) +static inline void +mini_emit_bounds_check_offset (MonoCompile *cfg, int array_reg, int array_length_offset, int index_reg, const char *ex_name) +{ + if (!(cfg->opt & MONO_OPT_UNSAFE)) { + ex_name = ex_name ? ex_name : "IndexOutOfRangeException"; + if (!(cfg->opt & MONO_OPT_ABCREM)) { + MONO_EMIT_NULL_CHECK (cfg, array_reg, FALSE); + if (COMPILE_LLVM (cfg)) + MONO_EMIT_DEFAULT_BOUNDS_CHECK ((cfg), (array_reg), (array_length_offset), (index_reg), TRUE, ex_name); + else + MONO_ARCH_EMIT_BOUNDS_CHECK ((cfg), (array_reg), (array_length_offset), (index_reg), ex_name); + } else { + MonoInst *ins; + MONO_INST_NEW ((cfg), ins, OP_BOUNDS_CHECK); + ins->sreg1 = array_reg; + ins->sreg2 = index_reg; + ins->inst_p0 = (gpointer)ex_name; + ins->inst_imm = (array_length_offset); + ins->flags |= MONO_INST_FAULT; + MONO_ADD_INS ((cfg)->cbb, ins); + (cfg)->flags |= MONO_CFG_NEEDS_DECOMPOSE; + (cfg)->cbb->needs_decompose = TRUE; + } + } +} /* cfg is the MonoCompile been used * array_reg is the vreg holding the array object @@ -991,7 +995,7 @@ static int ccount = 0; * index_reg is the vreg holding the index */ #define MONO_EMIT_BOUNDS_CHECK(cfg, array_reg, array_type, array_length_field, index_reg) do { \ - MONO_EMIT_BOUNDS_CHECK_OFFSET ((cfg), (array_reg), MONO_STRUCT_OFFSET (array_type, array_length_field), (index_reg)); \ + mini_emit_bounds_check_offset ((cfg), (array_reg), MONO_STRUCT_OFFSET (array_type, array_length_field), (index_reg), NULL); \ } while (0) #endif diff --git a/mono/mini/jit-icalls.c b/mono/mini/jit-icalls.c index 6777fea542..eb22ca795b 100644 --- a/mono/mini/jit-icalls.c +++ b/mono/mini/jit-icalls.c @@ -54,7 +54,7 @@ mono_ldftn (MonoMethod *method) } addr = mono_create_jump_trampoline (mono_domain_get (), method, FALSE, error); - if (!mono_error_ok (error)) { + if (!is_ok (error)) { mono_error_set_pending_exception (error); return NULL; } @@ -85,7 +85,7 @@ ldvirtfn_internal (MonoObject *obj, MonoMethod *method, gboolean gshared) context.method_inst = mono_method_get_context (method)->method_inst; res = mono_class_inflate_generic_method_checked (res, &context, error); - if (!mono_error_ok (error)) { + if (!is_ok (error)) { mono_error_set_pending_exception (error); return NULL; } @@ -823,7 +823,7 @@ mono_ldtoken_wrapper (MonoImage *image, int token, MonoGenericContext *context) gpointer res; res = mono_ldtoken_checked (image, token, &handle_class, context, error); - if (!mono_error_ok (error)) { + if (!is_ok (error)) { mono_error_set_pending_exception (error); return NULL; } @@ -1141,13 +1141,13 @@ mono_helper_newobj_mscorlib (guint32 idx) ERROR_DECL (error); MonoClass *klass = mono_class_get_checked (mono_defaults.corlib, MONO_TOKEN_TYPE_DEF | idx, error); - if (!mono_error_ok (error)) { + if (!is_ok (error)) { mono_error_set_pending_exception (error); return NULL; } MonoObject *obj = mono_object_new_checked (mono_domain_get (), klass, error); - if (!mono_error_ok (error)) + if (!is_ok (error)) mono_error_set_pending_exception (error); return obj; } @@ -1406,7 +1406,7 @@ mono_gsharedvt_constrained_call (gpointer mp, MonoMethod *cmethod, MonoClass *kl gpointer new_args [16]; m = constrained_gsharedvt_call_setup (mp, cmethod, klass, &this_arg, error); - if (!mono_error_ok (error)) { + if (!is_ok (error)) { mono_error_set_pending_exception (error); return NULL; } @@ -1425,7 +1425,7 @@ mono_gsharedvt_constrained_call (gpointer mp, MonoMethod *cmethod, MonoClass *kl } o = mono_runtime_invoke_checked (m, this_arg, args, error); - if (!mono_error_ok (error)) { + if (!is_ok (error)) { mono_error_set_pending_exception (error); return NULL; } @@ -1508,7 +1508,7 @@ mono_fill_class_rgctx (MonoVTable *vtable, int index) gpointer res; res = mono_class_fill_runtime_generic_context (vtable, index, error); - if (!mono_error_ok (error)) { + if (!is_ok (error)) { mono_error_set_pending_exception (error); return NULL; } @@ -1522,7 +1522,7 @@ mono_fill_method_rgctx (MonoMethodRuntimeGenericContext *mrgctx, int index) gpointer res; res = mono_method_fill_runtime_generic_context (mrgctx, index, error); - if (!mono_error_ok (error)) { + if (!is_ok (error)) { mono_error_set_pending_exception (error); return NULL; } diff --git a/mono/mini/jit.h b/mono/mini/jit.h index 2ada49b987..9fc6a183fa 100644 --- a/mono/mini/jit.h +++ b/mono/mini/jit.h @@ -13,12 +13,15 @@ MONO_BEGIN_DECLS -MONO_API MonoDomain * +MONO_API MONO_RT_EXTERNAL_ONLY MonoDomain * mono_jit_init (const char *file); -MONO_API MonoDomain * +MONO_API MONO_RT_EXTERNAL_ONLY MonoDomain * mono_jit_init_version (const char *root_domain_name, const char *runtime_version); +MONO_API MonoDomain * +mono_jit_init_version_for_test_only (const char *root_domain_name, const char *runtime_version); + MONO_API int mono_jit_exec (MonoDomain *domain, MonoAssembly *assembly, int argc, char *argv[]); diff --git a/mono/mini/linear-scan.c b/mono/mini/linear-scan.c index 998c082c28..ce5fda22bb 100644 --- a/mono/mini/linear-scan.c +++ b/mono/mini/linear-scan.c @@ -272,7 +272,7 @@ compare_by_interval_start_pos_func (gconstpointer a, gconstpointer b) #endif /* FIXME: This is x86 only */ -static inline guint32 +static guint32 regalloc_cost (MonoCompile *cfg, MonoMethodVar *vmv) { MonoInst *ins = cfg->varinfo [vmv->idx]; diff --git a/mono/mini/liveness.c b/mono/mini/liveness.c index 0aedb15db2..81416eb311 100644 --- a/mono/mini/liveness.c +++ b/mono/mini/liveness.c @@ -103,14 +103,14 @@ optimize_initlocals (MonoCompile *cfg); * * allocates a MonoBitSet inside a memory pool */ -static inline MonoBitSet* +static MonoBitSet* mono_bitset_mp_new (MonoMemPool *mp, guint32 size, guint32 max_size) { guint8 *mem = (guint8 *)mono_mempool_alloc0 (mp, size); return mono_bitset_mem_new (mem, max_size, MONO_BITSET_DONT_FREE); } -static inline MonoBitSet* +static MonoBitSet* mono_bitset_mp_new_noinit (MonoMemPool *mp, guint32 size, guint32 max_size) { guint8 *mem = (guint8 *)mono_mempool_alloc (mp, size); @@ -266,7 +266,7 @@ mono_liveness_handle_exception_clauses (MonoCompile *cfg) mono_ptrset_destroy (&visited); } -static inline void +static void update_live_range (MonoMethodVar *var, int abs_pos) { if (var->range.first_use.abs_pos > abs_pos) @@ -842,7 +842,7 @@ mono_linterval_split (MonoCompile *cfg, MonoLiveInterval *interval, MonoLiveInte #ifdef ENABLE_LIVENESS2 -static inline void +static void update_liveness2 (MonoCompile *cfg, MonoInst *ins, gboolean set_volatile, int inst_num, gint32 *last_use) { const char *spec = INS_INFO (ins->opcode); @@ -1042,7 +1042,7 @@ mono_analyze_liveness2 (MonoCompile *cfg) #endif -static inline void +static void update_liveness_gc (MonoCompile *cfg, MonoBasicBlock *bb, MonoInst *ins, gint32 *last_use, MonoMethodVar **vreg_to_varinfo, GSList **callsites) { if (ins->opcode == OP_GC_LIVENESS_DEF || ins->opcode == OP_GC_LIVENESS_USE) { @@ -1092,7 +1092,7 @@ update_liveness_gc (MonoCompile *cfg, MonoBasicBlock *bb, MonoInst *ins, gint32 } } -static inline int +static int get_vreg_from_var (MonoCompile *cfg, MonoInst *var) { if (var->opcode == OP_REGVAR) diff --git a/mono/mini/lldb.c b/mono/mini/lldb.c index 4b10681889..b37daf8b41 100644 --- a/mono/mini/lldb.c +++ b/mono/mini/lldb.c @@ -149,7 +149,7 @@ typedef struct { guint8 *buf, *p, *end; } Buffer; -static inline void +static void buffer_init (Buffer *buf, int size) { buf->buf = (guint8 *)g_malloc (size); @@ -157,13 +157,13 @@ buffer_init (Buffer *buf, int size) buf->end = buf->buf + size; } -static inline int +static int buffer_len (Buffer *buf) { return buf->p - buf->buf; } -static inline void +static void buffer_make_room (Buffer *buf, int size) { if (buf->end - buf->p < size) { @@ -176,7 +176,7 @@ buffer_make_room (Buffer *buf, int size) } } -static inline void +static void buffer_add_byte (Buffer *buf, guint8 val) { buffer_make_room (buf, 1); @@ -184,7 +184,7 @@ buffer_add_byte (Buffer *buf, guint8 val) buf->p++; } -static inline void +static void buffer_add_short (Buffer *buf, guint32 val) { buffer_make_room (buf, 2); @@ -193,7 +193,7 @@ buffer_add_short (Buffer *buf, guint32 val) buf->p += 2; } -static inline void +static void buffer_add_int (Buffer *buf, guint32 val) { buffer_make_room (buf, 4); @@ -204,20 +204,20 @@ buffer_add_int (Buffer *buf, guint32 val) buf->p += 4; } -static inline void +static void buffer_add_long (Buffer *buf, guint64 l) { buffer_add_int (buf, (l >> 32) & 0xffffffff); buffer_add_int (buf, (l >> 0) & 0xffffffff); } -static inline void +static void buffer_add_id (Buffer *buf, int id) { buffer_add_int (buf, (guint64)id); } -static inline void +static void buffer_add_data (Buffer *buf, guint8 *data, int len) { buffer_make_room (buf, len); @@ -225,7 +225,7 @@ buffer_add_data (Buffer *buf, guint8 *data, int len) buf->p += len; } -static inline void +static void buffer_add_string (Buffer *buf, const char *str) { int len; @@ -239,13 +239,13 @@ buffer_add_string (Buffer *buf, const char *str) } } -static inline void +static void buffer_add_buffer (Buffer *buf, Buffer *data) { buffer_add_data (buf, data->buf, buffer_len (data)); } -static inline void +static void buffer_free (Buffer *buf) { g_free (buf->buf); diff --git a/mono/mini/llvm-jit.cpp b/mono/mini/llvm-jit.cpp index c35abbfa26..c2109f3380 100644 --- a/mono/mini/llvm-jit.cpp +++ b/mono/mini/llvm-jit.cpp @@ -6,9 +6,6 @@ // // Licensed under the MIT license. See LICENSE file in the project root for full license information. // -// Mono's internal header files are not C++ clean, so avoid including them if -// possible -// #include "config.h" @@ -16,6 +13,7 @@ #include #include "mini-llvm-cpp.h" +#include "mini-runtime.h" #include "llvm-jit.h" #if defined(MONO_ARCH_LLVM_JIT_SUPPORTED) && !defined(MONO_CROSS_COMPILE) && LLVM_API_VERSION > 600 @@ -24,6 +22,7 @@ #include #include #include +#include "llvm/IR/LegacyPassNameParser.h" #include #include "llvm/ExecutionEngine/Orc/CompileUtils.h" #include "llvm/ExecutionEngine/Orc/IRCompileLayer.h" @@ -31,6 +30,7 @@ #include "llvm/ExecutionEngine/RTDyldMemoryManager.h" #include "llvm/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.h" #include "llvm/ExecutionEngine/JITSymbol.h" +#include "llvm/Transforms/Scalar.h" #include @@ -92,9 +92,20 @@ MonoJitMemoryManager::allocateDataSection(uintptr_t Size, unsigned Alignment, unsigned SectionID, StringRef SectionName, - bool IsReadOnly) { - uint8_t *res = (uint8_t*)malloc (Size); + bool IsReadOnly) +{ + uint8_t *res; + + // FIXME: Use a mempool + if (Alignment == 32) { + /* Used for SIMD */ + res = (uint8_t*)malloc (Size + 32); + res += (GPOINTER_TO_UINT (res) % 32); + } else { + res = (uint8_t*)malloc (Size); + } assert (res); + g_assert (GPOINTER_TO_UINT (res) % Alignment == 0); memset (res, 0, Size); return res; } @@ -176,7 +187,11 @@ struct MonoLLVMJIT { auto resolver = createLegacyLookupResolver (execution_session, lookup_name, on_error); resolvers[k] = std::move (resolver); - compile_layer.addModule (k, std::move(m)); + auto err = compile_layer.addModule (k, std::move(m)); + if (err) { + outs () << "addModule error: " << err << "\n"; + assert (0); + } return k; } @@ -240,6 +255,12 @@ make_mono_llvm_jit (TargetMachine *target_machine) #elif LLVM_API_VERSION > 600 +// The OptimizationList is automatically populated with registered Passes by the +// PassNameParser. +// +static cl::list +PassList(cl::desc("Optimizations available:")); + class MonoLLVMJIT { public: /* We use our own trampoline infrastructure instead of the Orc one */ @@ -250,7 +271,39 @@ public: MonoLLVMJIT (TargetMachine *TM, MonoJitMemoryManager *mm) : TM(TM), ObjectLayer([=] { return std::shared_ptr (mm); }), CompileLayer (ObjectLayer, SimpleCompiler (*TM)), - modules() { + modules(), + fpm (NULL) { + initPassManager (); + } + + void initPassManager () { + PassRegistry ®istry = *PassRegistry::getPassRegistry(); + initializeCore(registry); + initializeScalarOpts(registry); + initializeInstCombine(registry); + initializeTarget(registry); + + const char *opts = g_getenv ("MONO_LLVM_OPT"); + if (opts == NULL) { + // FIXME: find optimal mono specific order of passes + // see https://llvm.org/docs/Frontend/PerformanceTips.html#pass-ordering + // the following order is based on a stripped version of "OPT -O2" + opts = " -simplifycfg -sroa -lower-expect -instcombine -licm -simplifycfg -lcssa -indvars -loop-deletion -gvn -memcpyopt -sccp -bdce -instcombine -dse -simplifycfg"; + } + + char **args = g_strsplit (opts, " ", -1); + llvm::cl::ParseCommandLineOptions (g_strv_length (args), args, ""); + + for (int i = 0; i < PassList.size(); i++) { + Pass *pass = PassList[i]->getNormalCtor()(); + if (pass->getPassKind () == llvm::PT_Function || pass->getPassKind () == llvm::PT_Loop) { + fpm.add (pass); + } else { + printf("Opt pass is ignored: %s\n", args[i + 1]); + } + } + g_strfreev (args); + fpm.doInitialization(); } ModuleHandleT addModule(Function *F, std::shared_ptr M) { @@ -310,6 +363,7 @@ public: gpointer compile (Function *F, int nvars, LLVMValueRef *callee_vars, gpointer *callee_addrs, gpointer *eh_frame) { F->getParent ()->setDataLayout (TM->createDataLayout ()); + fpm.run(*F); // Orc uses a shared_ptr to refer to modules so we have to save them ourselves to keep a ref std::shared_ptr m (F->getParent ()); modules.push_back (m); @@ -339,6 +393,7 @@ private: ObjLayerT ObjectLayer; CompileLayerT CompileLayer; std::vector> modules; + legacy::FunctionPassManager fpm; }; static MonoJitMemoryManager *mono_mm; @@ -360,7 +415,7 @@ make_mono_llvm_jit (TargetMachine *target_machine) static MonoLLVMJIT *jit; MonoEERef -mono_llvm_create_ee (LLVMModuleProviderRef MP, AllocCodeMemoryCb *alloc_cb, FunctionEmittedCb *emitted_cb, ExceptionTableCb *exception_cb, LLVMExecutionEngineRef *ee) +mono_llvm_create_ee (AllocCodeMemoryCb *alloc_cb, FunctionEmittedCb *emitted_cb, ExceptionTableCb *exception_cb, LLVMExecutionEngineRef *ee) { alloc_code_mem_cb = alloc_cb; @@ -369,15 +424,21 @@ mono_llvm_create_ee (LLVMModuleProviderRef MP, AllocCodeMemoryCb *alloc_cb, Func EnableMonoEH = true; MonoEHFrameSymbol = "mono_eh_frame"; - EngineBuilder EB; -#if defined(TARGET_AMD64) || defined(TARGET_X86) - std::vector attrs; - // FIXME: Autodetect this - attrs.push_back("sse3"); - attrs.push_back("sse4.1"); - EB.setMAttrs (attrs); -#endif + + if (mono_use_fast_math) { + TargetOptions opts; + opts.NoInfsFPMath = true; + opts.NoNaNsFPMath = true; + opts.NoSignedZerosFPMath = true; + opts.NoTrappingFPMath = true; + opts.UnsafeFPMath = true; + opts.AllowFPOpFusion = FPOpFusion::Fast; + EB.setTargetOptions (opts); + } + + EB.setOptLevel(CodeGenOpt::Aggressive); + EB.setMCPU(sys::getHostCPUName()); auto TM = EB.selectTarget (); assert (TM); @@ -412,7 +473,7 @@ mono_llvm_set_unhandled_exception_handler (void) } MonoEERef -mono_llvm_create_ee (LLVMModuleProviderRef MP, AllocCodeMemoryCb *alloc_cb, FunctionEmittedCb *emitted_cb, ExceptionTableCb *exception_cb, LLVMExecutionEngineRef *ee) +mono_llvm_create_ee (AllocCodeMemoryCb *alloc_cb, FunctionEmittedCb *emitted_cb, ExceptionTableCb *exception_cb, LLVMExecutionEngineRef *ee) { g_error ("LLVM JIT not supported on this platform."); return NULL; diff --git a/mono/mini/llvm-jit.h b/mono/mini/llvm-jit.h index ed7ddca919..90ae35c772 100644 --- a/mono/mini/llvm-jit.h +++ b/mono/mini/llvm-jit.h @@ -16,6 +16,8 @@ #include "llvm-c/Core.h" #include "llvm-c/ExecutionEngine.h" +#include "mini.h" + #ifdef HAVE_UNWIND_H #include #endif @@ -36,7 +38,7 @@ typedef void (ExceptionTableCb) (void *data); typedef void* MonoEERef; MonoEERef -mono_llvm_create_ee (LLVMModuleProviderRef MP, AllocCodeMemoryCb *alloc_cb, FunctionEmittedCb *emitted_cb, ExceptionTableCb *exception_cb, LLVMExecutionEngineRef *ee); +mono_llvm_create_ee (AllocCodeMemoryCb *alloc_cb, FunctionEmittedCb *emitted_cb, ExceptionTableCb *exception_cb, LLVMExecutionEngineRef *ee); void mono_llvm_dispose_ee (MonoEERef *mono_ee); diff --git a/mono/mini/llvmonly-runtime.c b/mono/mini/llvmonly-runtime.c index f588a2b847..c9fbb25358 100644 --- a/mono/mini/llvmonly-runtime.c +++ b/mono/mini/llvmonly-runtime.c @@ -550,7 +550,7 @@ mini_llvmonly_resolve_generic_virtual_call (MonoVTable *vt, int slot, MonoMethod context.method_inst = ((MonoMethodInflated*)generic_virtual)->context.method_inst; m = mono_class_inflate_generic_method_checked (declaring, &context, error); - g_assert (mono_error_ok (error)); + g_assert (is_ok (error)); if (m_class_is_valuetype (vt->klass)) need_unbox_tramp = TRUE; diff --git a/mono/mini/local-propagation.c b/mono/mini/local-propagation.c index bfb5556124..03120af6e0 100644 --- a/mono/mini/local-propagation.c +++ b/mono/mini/local-propagation.c @@ -36,7 +36,7 @@ #define MONO_ARCH_IS_OP_MEMBASE(opcode) FALSE #endif -static inline MonoBitSet* +static MonoBitSet* mono_bitset_mp_new_noinit (MonoMemPool *mp, guint32 max_size) { int size = mono_bitset_alloc_size (max_size, 0); @@ -815,7 +815,7 @@ mono_local_cprop (MonoCompile *cfg) } } -static inline gboolean +static gboolean reg_is_softreg_no_fpstack (int reg, const char spec) { return (spec == 'i' && reg >= MONO_MAX_IREGS) @@ -826,7 +826,7 @@ reg_is_softreg_no_fpstack (int reg, const char spec) || (spec == 'v'); } -static inline gboolean +static gboolean reg_is_softreg (int reg, const char spec) { return (spec == 'i' && reg >= MONO_MAX_IREGS) @@ -837,7 +837,7 @@ reg_is_softreg (int reg, const char spec) || (spec == 'v'); } -static inline gboolean +static gboolean mono_is_simd_accessor (MonoInst *ins) { switch (ins->opcode) { diff --git a/mono/mini/main-core.c b/mono/mini/main-core.c index a45a4e7579..16803d5e11 100644 --- a/mono/mini/main-core.c +++ b/mono/mini/main-core.c @@ -6,6 +6,7 @@ #include "mini-runtime.h" #include #include +#include #include #include @@ -121,25 +122,25 @@ parse_native_dll_search_directories (const char *native_dlls_dirs) } static MonoAssembly* -mono_core_preload_hook (MonoAssemblyName *aname, char **unused_apaths, void *user_data) +mono_core_preload_hook (MonoAssemblyLoadContext *alc, MonoAssemblyName *aname, char **assemblies_path, gboolean refonly, gpointer user_data, MonoError *error) { MonoAssembly *result = NULL; MonoCoreTrustedPlatformAssemblies *a = (MonoCoreTrustedPlatformAssemblies *)user_data; - const gboolean refonly = FALSE; /* TODO: make a refonly preload hook, too */ /* TODO: check that CoreCLR wants the strong name semantics here */ MonoAssemblyCandidatePredicate predicate = &mono_assembly_candidate_predicate_sn_same_name; void* predicate_ud = aname; g_assert (aname); g_assert (aname->name); + /* alc might be a user ALC - we get here from alc.LoadFromAssemblyName(), but we should load TPA assemblies into the default alc */ + MonoAssemblyLoadContext *default_alc = mono_domain_default_alc (mono_alc_domain (alc)); - char *basename = g_strconcat (aname->name, ".dll", NULL); /* TODO: make sure CoreCLR never needs to load .exe files */ + char *basename = g_strconcat (aname->name, ".dll", (const char*)NULL); /* TODO: make sure CoreCLR never needs to load .exe files */ for (int i = 0; i < a->assembly_count; ++i) { if (!strcmp (basename, a->basenames[i])) { MonoAssemblyOpenRequest req; - mono_assembly_request_prepare (&req.request, sizeof (req), refonly ? MONO_ASMCTX_REFONLY : MONO_ASMCTX_DEFAULT); - req.request.alc = mono_domain_default_alc (mono_get_root_domain ()); + mono_assembly_request_prepare_open (&req, refonly ? MONO_ASMCTX_REFONLY : MONO_ASMCTX_DEFAULT, default_alc); req.request.predicate = predicate; req.request.predicate_ud = predicate_ud; @@ -170,7 +171,7 @@ mono_core_preload_hook (MonoAssemblyName *aname, char **unused_apaths, void *use static void install_assembly_loader_hooks (void) { - mono_install_assembly_preload_hook (mono_core_preload_hook, (void*)trusted_platform_assemblies); + mono_install_assembly_preload_hook_v2 (mono_core_preload_hook, (void*)trusted_platform_assemblies, FALSE); } static gboolean @@ -281,6 +282,8 @@ int STDAPICALLTYPE coreclr_execute_assembly (void* hostHandle, unsigned int doma *ptr = NULL; mono_parse_env_options (&mono_argc, &mono_argv); + + // TODO: Should be return code of Main only (mono_jit_exec result) *exitCode = mono_main (mono_argc, mono_argv); return 0; @@ -292,6 +295,7 @@ int STDAPICALLTYPE coreclr_execute_assembly (void* hostHandle, unsigned int doma // Parameters: // hostHandle - Handle of the host // domainId - Id of the domain +// latchedExitCode - Latched exit code after domain unloaded // // Returns: // HRESULT indicating status of the operation. S_OK if the assembly was successfully executed @@ -307,6 +311,8 @@ int STDAPICALLTYPE coreclr_shutdown_2 (void* hostHandle, unsigned int domainId, trusted_platform_assemblies = NULL; mono_core_trusted_platform_assemblies_free (a); + *latchedExitCode = mono_environment_exitcode_get (); + return 0; } diff --git a/mono/mini/main.c b/mono/mini/main.c index 5cf31ee0fe..2ecc41da1b 100644 --- a/mono/mini/main.c +++ b/mono/mini/main.c @@ -158,7 +158,7 @@ static void bundle_save_library_initialize (void) { bundle_save_library_initialized = 1; - char *path = g_build_filename (g_get_tmp_dir (), "mono-bundle-XXXXXX", NULL); + char *path = g_build_filename (g_get_tmp_dir (), "mono-bundle-XXXXXX", (const char*)NULL); bundled_dylibrary_directory = g_mkdtemp (path); g_free (path); if (bundled_dylibrary_directory == NULL) @@ -176,7 +176,7 @@ save_library (int fd, uint64_t offset, uint64_t size, const char *destfname) if (!bundle_save_library_initialized) bundle_save_library_initialize (); - file = g_build_filename (bundled_dylibrary_directory, destfname, NULL); + file = g_build_filename (bundled_dylibrary_directory, destfname, (const char*)NULL); buffer = load_from_region (fd, offset, size); g_file_set_contents (file, buffer, size, NULL); @@ -186,7 +186,7 @@ save_library (int fd, uint64_t offset, uint64_t size, const char *destfname) exit (1); } // Register the name with "." as this is how it will be found when embedded - internal_path = g_build_filename (".", destfname, NULL); + internal_path = g_build_filename (".", destfname, (const char*)NULL); mono_loader_register_module (internal_path, lib); g_free (internal_path); bundle_library_paths = g_slist_append (bundle_library_paths, file); @@ -384,17 +384,22 @@ ICALL_EXPORT int ves_icall_Interop_Sys_DoubleToString (double, char*, char*, int #include +#ifdef _WINDOWS +int APIENTRY +wWinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLine, int nCmdShow) +#else int -main (void) +main (int _argc, char* _argv[]) +#endif { - TCHAR szFileName[MAX_PATH]; + gunichar2 *module_file_name; + guint32 length; int argc; gunichar2** argvw; gchar** argv; int i; - DWORD count; - - argvw = CommandLineToArgvW (GetCommandLine (), &argc); + + argvw = CommandLineToArgvW (GetCommandLineW (), &argc); argv = g_new0 (gchar*, argc + 1); for (i = 0; i < argc; i++) argv [i] = g_utf16_to_utf8 (argvw [i], -1, NULL, NULL, NULL); @@ -402,8 +407,9 @@ main (void) LocalFree (argvw); - if ((count = GetModuleFileName (NULL, szFileName, MAX_PATH)) != 0){ - char *entry = g_utf16_to_utf8 (szFileName, count, NULL, NULL, NULL); + if (mono_get_module_filename (NULL, &module_file_name, &length)) { + char *entry = g_utf16_to_utf8 (module_file_name, length, NULL, NULL, NULL); + g_free (module_file_name); probe_embedded (entry, &argc, &argv); } diff --git a/mono/mini/memory-access.c b/mono/mini/memory-access.c index e7454db584..da695ada36 100644 --- a/mono/mini/memory-access.c +++ b/mono/mini/memory-access.c @@ -13,10 +13,15 @@ #include #include "mini.h" +#include "mini-runtime.h" #include "ir-emit.h" #include "jit-icalls.h" +#ifdef ENABLE_NETCORE +#define MAX_INLINE_COPIES 16 +#else #define MAX_INLINE_COPIES 10 +#endif #define MAX_INLINE_COPY_SIZE 10000 void @@ -289,6 +294,9 @@ mini_emit_wb_aware_memcpy (MonoCompile *cfg, MonoClass *klass, MonoInst *iargs[4 /*tmp = dreg*/ EMIT_NEW_UNALU (cfg, iargs [0], OP_MOVE, dest_ptr_reg, destreg); + if ((need_wb & 0x1) && !mini_debug_options.weak_memory_model) + mini_emit_memory_barrier (cfg, MONO_MEMORY_BARRIER_REL); + while (size >= TARGET_SIZEOF_VOID_P) { MonoInst *load_inst; MONO_INST_NEW (cfg, load_inst, OP_LOAD_MEMBASE); @@ -386,6 +394,9 @@ mini_emit_memory_copy_internal (MonoCompile *cfg, MonoInst *dest, MonoInst *src, NEW_LOAD_MEMBASE (cfg, load, OP_LOAD_MEMBASE, dreg, src->dreg, 0); MONO_ADD_INS (cfg->cbb, load); + if (!mini_debug_options.weak_memory_model) + mini_emit_memory_barrier (cfg, MONO_MEMORY_BARRIER_REL); + NEW_STORE_MEMBASE (cfg, store, OP_STORE_MEMBASE_REG, dest->dreg, 0, dreg); MONO_ADD_INS (cfg->cbb, store); @@ -482,7 +493,8 @@ mini_emit_memory_store (MonoCompile *cfg, MonoType *type, MonoInst *dest, MonoIn if (ins_flag & MONO_INST_VOLATILE) { /* Volatile stores have release semantics, see 12.6.7 in Ecma 335 */ mini_emit_memory_barrier (cfg, MONO_MEMORY_BARRIER_REL); - } + } else if (!mini_debug_options.weak_memory_model && mini_type_is_reference (type)) + mini_emit_memory_barrier (cfg, MONO_MEMORY_BARRIER_REL); if (ins_flag & MONO_INST_UNALIGNED) { MonoInst *addr, *mov, *tmp_var; diff --git a/mono/mini/method-to-ir.c.REMOVED.git-id b/mono/mini/method-to-ir.c.REMOVED.git-id index e6ae79b373..b309d47e3a 100644 --- a/mono/mini/method-to-ir.c.REMOVED.git-id +++ b/mono/mini/method-to-ir.c.REMOVED.git-id @@ -1 +1 @@ -ff00d7db2046fdfc02f500d8f74b08fbbf5b2bbb \ No newline at end of file +4005bf0c358a7796e4c9896c35433c7c5788561c \ No newline at end of file diff --git a/mono/mini/mini-amd64-gsharedvt.c b/mono/mini/mini-amd64-gsharedvt.c index ded85ac06d..03c79149db 100644 --- a/mono/mini/mini-amd64-gsharedvt.c +++ b/mono/mini/mini-amd64-gsharedvt.c @@ -73,7 +73,7 @@ arg_info_desc (ArgInfo *info) } #endif -static inline void +static void add_to_map (GPtrArray *map, int src, int dst) { g_ptr_array_add (map, GUINT_TO_POINTER (src)); @@ -94,7 +94,7 @@ add_to_map (GPtrArray *map, int src, int dst) * 8.. - stack slots * */ -static inline int +static int map_reg (int reg) { int i = 0; @@ -106,13 +106,13 @@ map_reg (int reg) return -1; } -static inline int +static int map_freg (int reg) { return reg + PARAM_REGS; } -static inline int +static int map_stack_slot (int slot) { return slot + PARAM_REGS + FLOAT_PARAM_REGS; diff --git a/mono/mini/mini-amd64.c.REMOVED.git-id b/mono/mini/mini-amd64.c.REMOVED.git-id index 62005d2156..bbefd09021 100644 --- a/mono/mini/mini-amd64.c.REMOVED.git-id +++ b/mono/mini/mini-amd64.c.REMOVED.git-id @@ -1 +1 @@ -c069cc61f91bce3d5228d57d9c029f9b85859e26 \ No newline at end of file +28cac2a9f54e2997b69317ab73ad9f143387c8fc \ No newline at end of file diff --git a/mono/mini/mini-amd64.h b/mono/mini/mini-amd64.h index d000c15da4..7caef0663b 100644 --- a/mono/mini/mini-amd64.h +++ b/mono/mini/mini-amd64.h @@ -485,14 +485,14 @@ typedef struct { /* Used for optimization, not complete */ #define MONO_ARCH_IS_OP_MEMBASE(opcode) ((opcode) == OP_X86_PUSH_MEMBASE) -#define MONO_ARCH_EMIT_BOUNDS_CHECK(cfg, array_reg, offset, index_reg) do { \ +#define MONO_ARCH_EMIT_BOUNDS_CHECK(cfg, array_reg, offset, index_reg, ex_name) do { \ MonoInst *inst; \ MONO_INST_NEW ((cfg), inst, OP_AMD64_ICOMPARE_MEMBASE_REG); \ inst->inst_basereg = array_reg; \ inst->inst_offset = offset; \ inst->sreg2 = index_reg; \ MONO_ADD_INS ((cfg)->cbb, inst); \ - MONO_EMIT_NEW_COND_EXC (cfg, LE_UN, "IndexOutOfRangeException"); \ + MONO_EMIT_NEW_COND_EXC (cfg, LE_UN, ex_name); \ } while (0) // Does the ABI have a volatile non-parameter register, so tailcall diff --git a/mono/mini/mini-arm-gsharedvt.c b/mono/mini/mini-arm-gsharedvt.c index 04bfa88995..7b19419f8a 100644 --- a/mono/mini/mini-arm-gsharedvt.c +++ b/mono/mini/mini-arm-gsharedvt.c @@ -38,20 +38,20 @@ mono_arch_gsharedvt_sig_supported (MonoMethodSignature *sig) return TRUE; } -static inline void +static void add_to_map (GPtrArray *map, int src, int dst) { g_ptr_array_add (map, GUINT_TO_POINTER (src)); g_ptr_array_add (map, GUINT_TO_POINTER (dst)); } -static inline int +static int map_reg (int reg) { return reg; } -static inline int +static int map_stack_slot (int slot) { return slot + 4; diff --git a/mono/mini/mini-arm.c.REMOVED.git-id b/mono/mini/mini-arm.c.REMOVED.git-id index 1593da8464..1229b40d49 100644 --- a/mono/mini/mini-arm.c.REMOVED.git-id +++ b/mono/mini/mini-arm.c.REMOVED.git-id @@ -1 +1 @@ -62153919df03f9a074912cfeb1d3cb2347253101 \ No newline at end of file +c384c46125f4d499fdaa0bb8142c4015a658a0ab \ No newline at end of file diff --git a/mono/mini/mini-arm64-gsharedvt.c b/mono/mini/mini-arm64-gsharedvt.c index 8c0a60d901..6768902446 100644 --- a/mono/mini/mini-arm64-gsharedvt.c +++ b/mono/mini/mini-arm64-gsharedvt.c @@ -33,7 +33,7 @@ mono_arch_gsharedvt_sig_supported (MonoMethodSignature *sig) return TRUE; } -static inline void +static void add_to_map (GPtrArray *map, int src, int dst) { g_ptr_array_add (map, GUINT_TO_POINTER (src)); @@ -47,19 +47,19 @@ add_to_map (GPtrArray *map, int src, int dst) * 17.. - stack slots */ -static inline int +static int map_reg (int reg) { return reg; } -static inline int +static int map_freg (int reg) { return reg + NUM_GSHAREDVT_ARG_GREGS; } -static inline int +static int map_stack_slot (int slot) { return slot + NUM_GSHAREDVT_ARG_GREGS + NUM_GSHAREDVT_ARG_FREGS; diff --git a/mono/mini/mini-arm64.c.REMOVED.git-id b/mono/mini/mini-arm64.c.REMOVED.git-id index d2eb8dafaf..05035f5006 100644 --- a/mono/mini/mini-arm64.c.REMOVED.git-id +++ b/mono/mini/mini-arm64.c.REMOVED.git-id @@ -1 +1 @@ -91bb906df7925b4b3c99006b44867322260a874f \ No newline at end of file +2ca8a2139d202db055c61768ec89bd173cfa58c1 \ No newline at end of file diff --git a/mono/mini/mini-arm64.h b/mono/mini/mini-arm64.h index dcbe05fc94..381160ebdc 100644 --- a/mono/mini/mini-arm64.h +++ b/mono/mini/mini-arm64.h @@ -79,8 +79,6 @@ struct MonoLMF { /* Structure used by the sequence points in AOTed code */ struct SeqPointInfo { - gpointer ss_trigger_page; - gpointer bp_trigger_page; gpointer ss_tramp_addr; guint8* bp_addrs [MONO_ZERO_LEN_ARRAY]; }; diff --git a/mono/mini/mini-codegen.c b/mono/mini/mini-codegen.c index 86c6ffe391..b5dc536d46 100644 --- a/mono/mini/mini-codegen.c +++ b/mono/mini/mini-codegen.c @@ -61,7 +61,7 @@ /* If the bank is mirrored return the true logical bank that the register in the * physical register bank is allocated to. */ -static inline int translate_bank (MonoRegState *rs, int bank, int hreg) { +static int translate_bank (MonoRegState *rs, int bank, int hreg) { return is_hreg_mirrored (rs, bank, hreg) ? get_mirrored_bank (bank) : bank; } @@ -134,7 +134,7 @@ static const int regbank_spill_var_size[] = { #define DEBUG(a) MINI_DEBUG(cfg->verbose_level, 3, a;) -static inline void +static void mono_regstate_assign (MonoRegState *rs) { #ifdef MONO_ARCH_USE_SHARED_FP_SIMD_BANK @@ -164,7 +164,7 @@ mono_regstate_assign (MonoRegState *rs) #endif } -static inline int +static int mono_regstate_alloc_int (MonoRegState *rs, regmask_t allow) { regmask_t mask = allow & rs->ifree_mask; @@ -195,7 +195,7 @@ mono_regstate_alloc_int (MonoRegState *rs, regmask_t allow) #endif } -static inline void +static void mono_regstate_free_int (MonoRegState *rs, int reg) { if (reg >= 0) { @@ -204,7 +204,7 @@ mono_regstate_free_int (MonoRegState *rs, int reg) } } -static inline int +static int mono_regstate_alloc_general (MonoRegState *rs, regmask_t allow, int bank) { int i; @@ -225,7 +225,7 @@ mono_regstate_alloc_general (MonoRegState *rs, regmask_t allow, int bank) return -1; } -static inline void +static void mono_regstate_free_general (MonoRegState *rs, int reg, int bank) { int mirrored_bank; @@ -314,7 +314,7 @@ resize_spill_info (MonoCompile *cfg, int bank) * returns the offset used by spillvar. It allocates a new * spill variable if necessary. */ -static inline int +static int mono_spillvar_offset (MonoCompile *cfg, int spillvar, int bank) { MonoSpillInfo *info; @@ -767,7 +767,7 @@ mono_print_ins (MonoInst *ins) mono_print_ins_index (-1, ins); } -static inline void +static void insert_before_ins (MonoBasicBlock *bb, MonoInst *ins, MonoInst* to_insert) { /* @@ -777,7 +777,7 @@ insert_before_ins (MonoBasicBlock *bb, MonoInst *ins, MonoInst* to_insert) mono_bblock_insert_before_ins (bb, ins, to_insert); } -static inline void +static void insert_after_ins (MonoBasicBlock *bb, MonoInst *ins, MonoInst **last, MonoInst* to_insert) { /* @@ -789,7 +789,7 @@ insert_after_ins (MonoBasicBlock *bb, MonoInst *ins, MonoInst **last, MonoInst* *last = to_insert; } -static inline int +static int get_vreg_bank (MonoCompile *cfg, int reg, int bank) { if (vreg_is_ref (cfg, reg)) @@ -965,7 +965,7 @@ create_copy_ins (MonoCompile *cfg, MonoBasicBlock *bb, MonoInst **last, int dest return copy; } -static inline const char* +static const char* regbank_to_string (int bank) { if (bank == MONO_REG_INT_REF) @@ -1013,7 +1013,7 @@ enum { MONO_FP_NEEDS_LOAD = regmask (2) }; -static inline int +static int alloc_int_reg (MonoCompile *cfg, MonoBasicBlock *bb, MonoInst **last, MonoInst *ins, regmask_t dest_mask, int sym_reg, RegTrack *info) { int val; @@ -1033,7 +1033,7 @@ alloc_int_reg (MonoCompile *cfg, MonoBasicBlock *bb, MonoInst **last, MonoInst * return val; } -static inline int +static int alloc_general_reg (MonoCompile *cfg, MonoBasicBlock *bb, MonoInst **last, MonoInst *ins, regmask_t dest_mask, int sym_reg, int bank) { int val; @@ -1049,7 +1049,7 @@ alloc_general_reg (MonoCompile *cfg, MonoBasicBlock *bb, MonoInst **last, MonoIn return val; } -static inline int +static int alloc_reg (MonoCompile *cfg, MonoBasicBlock *bb, MonoInst **last, MonoInst *ins, regmask_t dest_mask, int sym_reg, RegTrack *info, int bank) { if (G_UNLIKELY (bank)) @@ -1058,7 +1058,7 @@ alloc_reg (MonoCompile *cfg, MonoBasicBlock *bb, MonoInst **last, MonoInst *ins, return alloc_int_reg (cfg, bb, last, ins, dest_mask, sym_reg, info); } -static inline void +static void assign_reg (MonoCompile *cfg, MonoRegState *rs, int reg, int hreg, int bank) { if (G_UNLIKELY (bank)) { @@ -1102,7 +1102,7 @@ assign_reg (MonoCompile *cfg, MonoRegState *rs, int reg, int hreg, int bank) } } -static inline regmask_t +static regmask_t get_callee_mask (const char spec) { if (G_UNLIKELY (reg_bank (spec))) @@ -2415,6 +2415,7 @@ mono_opcode_to_cond (int opcode) case OP_IBGE_UN: case OP_LBGE_UN: case OP_FBGE_UN: + case OP_COND_EXC_GE_UN: case OP_CMOV_IGE_UN: case OP_CMOV_LGE_UN: return CMP_GE_UN; @@ -2707,6 +2708,8 @@ mini_exception_id_by_name (const char *name) return MONO_EXC_ARRAY_TYPE_MISMATCH; if (strcmp (name, "ArgumentException") == 0) return MONO_EXC_ARGUMENT; + if (strcmp (name, "ArgumentOutOfRangeException") == 0) + return MONO_EXC_ARGUMENT_OUT_OF_RANGE; g_error ("Unknown intrinsic exception %s\n", name); return -1; } diff --git a/mono/mini/mini-exceptions.c.REMOVED.git-id b/mono/mini/mini-exceptions.c.REMOVED.git-id index 3d2a01a169..b2a2ad73ac 100644 --- a/mono/mini/mini-exceptions.c.REMOVED.git-id +++ b/mono/mini/mini-exceptions.c.REMOVED.git-id @@ -1 +1 @@ -d469bd0ed0c08360c44abf371cbb52f390777974 \ No newline at end of file +0b0eda0a4e8a6f1924f0af72f3c2f21231bb01f6 \ No newline at end of file diff --git a/mono/mini/mini-gc.c b/mono/mini/mini-gc.c index de6626a336..4c9ee81d9e 100644 --- a/mono/mini/mini-gc.c +++ b/mono/mini/mini-gc.c @@ -292,7 +292,7 @@ mini_gc_enable_gc_maps_for_aot (void) // FIXME: Move these to a shared place -static inline void +static void encode_uleb128 (guint32 value, guint8 *buf, guint8 **endbuf) { guint8 *p = buf; @@ -339,7 +339,7 @@ encode_sleb128 (gint32 value, guint8 *buf, guint8 **endbuf) *endbuf = p; } -static inline guint32 +static guint32 decode_uleb128 (guint8 *buf, guint8 **endbuf) { guint8 *p = buf; @@ -361,7 +361,7 @@ decode_uleb128 (guint8 *buf, guint8 **endbuf) return res; } -static inline gint32 +static gint32 decode_sleb128 (guint8 *buf, guint8 **endbuf) { guint8 *p = buf; @@ -676,19 +676,19 @@ thread_suspend_func (gpointer user_data, void *sigctx, MonoContext *ctx) #define DEAD_REF ((gpointer)(gssize)0x2a2a2a2a2a2a2a2aULL) -static inline void +static void set_bit (guint8 *bitmap, int width, int y, int x) { bitmap [(width * y) + (x / 8)] |= (1 << (x % 8)); } -static inline void +static void clear_bit (guint8 *bitmap, int width, int y, int x) { bitmap [(width * y) + (x / 8)] &= ~(1 << (x % 8)); } -static inline int +static int get_bit (guint8 *bitmap, int width, int y, int x) { return bitmap [(width * y) + (x / 8)] & (1 << (x % 8)); @@ -710,7 +710,7 @@ slot_type_to_string (GCSlotType type) } } -static inline host_mgreg_t +static host_mgreg_t get_frame_pointer (MonoContext *ctx, int frame_reg) { #if defined(TARGET_AMD64) @@ -1362,7 +1362,7 @@ mini_gc_set_slot_type_from_cfa (MonoCompile *cfg, int slot_offset, GCSlotType ty gcfg->stack_slots_from_cfa = g_slist_prepend_mempool (cfg->mempool, gcfg->stack_slots_from_cfa, GUINT_TO_POINTER (((slot) << 16) | type)); } -static inline int +static int fp_offset_to_slot (MonoCompile *cfg, int offset) { MonoCompileGC *gcfg = cfg->gc_info; @@ -1370,7 +1370,7 @@ fp_offset_to_slot (MonoCompile *cfg, int offset) return (offset - gcfg->min_offset) / SIZEOF_SLOT; } -static inline int +static int slot_to_fp_offset (MonoCompile *cfg, int slot) { MonoCompileGC *gcfg = cfg->gc_info; @@ -1378,7 +1378,7 @@ slot_to_fp_offset (MonoCompile *cfg, int slot) return (slot * SIZEOF_SLOT) + gcfg->min_offset; } -static inline MONO_ALWAYS_INLINE void +static MONO_ALWAYS_INLINE void set_slot (MonoCompileGC *gcfg, int slot, int callsite_index, GCSlotType type) { g_assert (slot >= 0 && slot < gcfg->nslots); @@ -1395,7 +1395,7 @@ set_slot (MonoCompileGC *gcfg, int slot, int callsite_index, GCSlotType type) } } -static inline void +static void set_slot_everywhere (MonoCompileGC *gcfg, int slot, GCSlotType type) { int width, pos; @@ -1424,7 +1424,7 @@ set_slot_everywhere (MonoCompileGC *gcfg, int slot, GCSlotType type) } } -static inline void +static void set_slot_in_range (MonoCompileGC *gcfg, int slot, int from, int to, GCSlotType type) { int cindex; @@ -1436,7 +1436,7 @@ set_slot_in_range (MonoCompileGC *gcfg, int slot, int from, int to, GCSlotType t } } -static inline void +static void set_reg_slot (MonoCompileGC *gcfg, int slot, int callsite_index, GCSlotType type) { g_assert (slot >= 0 && slot < gcfg->nregs); @@ -1453,7 +1453,7 @@ set_reg_slot (MonoCompileGC *gcfg, int slot, int callsite_index, GCSlotType type } } -static inline void +static void set_reg_slot_everywhere (MonoCompileGC *gcfg, int slot, GCSlotType type) { int cindex; @@ -1462,7 +1462,7 @@ set_reg_slot_everywhere (MonoCompileGC *gcfg, int slot, GCSlotType type) set_reg_slot (gcfg, slot, cindex, type); } -static inline void +static void set_reg_slot_in_range (MonoCompileGC *gcfg, int slot, int from, int to, GCSlotType type) { int cindex; @@ -1626,13 +1626,13 @@ get_vtype_bitmap (MonoType *t, int *numbits) } } -static inline const char* +static const char* get_offset_sign (int offset) { return offset < 0 ? "-" : "+"; } -static inline int +static int get_offset_val (int offset) { return offset < 0 ? (- offset) : offset; @@ -2203,7 +2203,7 @@ init_gcfg (MonoCompile *cfg) } } -static inline gboolean +static gboolean has_bit_set (guint8 *bitmap, int width, int slot) { int i; diff --git a/mono/mini/mini-generic-sharing.c.REMOVED.git-id b/mono/mini/mini-generic-sharing.c.REMOVED.git-id index ca296f543d..ca531de39d 100644 --- a/mono/mini/mini-generic-sharing.c.REMOVED.git-id +++ b/mono/mini/mini-generic-sharing.c.REMOVED.git-id @@ -1 +1 @@ -9ed90dbf97a847c891d63d063113c00c557e1176 \ No newline at end of file +e97d1062d2c06bcc69b24064e36a70c50d3b3f69 \ No newline at end of file diff --git a/mono/mini/mini-llvm-cpp.cpp b/mono/mini/mini-llvm-cpp.cpp index e3dee6adb6..df69ae3564 100644 --- a/mono/mini/mini-llvm-cpp.cpp +++ b/mono/mini/mini-llvm-cpp.cpp @@ -37,6 +37,7 @@ #include #include #include +#include #include "mini-llvm-cpp.h" @@ -50,8 +51,16 @@ void mono_llvm_dump_value (LLVMValueRef value) { /* Same as LLVMDumpValue (), but print to stdout */ + outs () << (*unwrap (value)) << "\n"; + fflush (stdout); +} + +void +mono_llvm_dump_module (LLVMModuleRef module) +{ + /* Same as LLVMDumpModule (), but print to stdout */ + outs () << (*unwrap (module)); fflush (stdout); - outs () << (*unwrap (value)); } /* Missing overload for building an alloca with an alignment */ @@ -201,6 +210,34 @@ mono_llvm_build_fence (LLVMBuilderRef builder, BarrierKind kind) return wrap (ins); } +LLVMValueRef +mono_llvm_build_weighted_branch (LLVMBuilderRef builder, LLVMValueRef cond, LLVMBasicBlockRef t, LLVMBasicBlockRef f, uint32_t t_weight, uint32_t f_weight) +{ + auto b = unwrap (builder); + auto &ctx = b->getContext (); + MDBuilder mdb{ctx}; + auto weights = mdb.createBranchWeights (t_weight, f_weight); + auto ins = b->CreateCondBr (unwrap (cond), unwrap (t), unwrap (f), weights); + return wrap (ins); +} + +void +mono_llvm_add_string_metadata (LLVMValueRef insref, const char* label, const char* text) +{ + auto ins = unwrap (insref); + auto &ctx = ins->getContext (); + ins->setMetadata (label, MDNode::get (ctx, MDString::get (ctx, text))); +} + +void +mono_llvm_set_implicit_branch (LLVMBuilderRef builder, LLVMValueRef branch) +{ + auto b = unwrap (builder); + auto &ctx = b->getContext (); + auto ins = unwrap (branch); + ins->setMetadata (LLVMContext::MD_make_implicit, MDNode::get (ctx, {})); +} + void mono_llvm_set_must_tailcall (LLVMValueRef call_ins) { @@ -228,27 +265,10 @@ mono_llvm_set_is_constant (LLVMValueRef global_var) unwrap(global_var)->setConstant (true); } -void -mono_llvm_set_preserveall_cc (LLVMValueRef func) -{ - unwrap(func)->setCallingConv (CallingConv::PreserveAll); -} - // Note that in future versions of LLVM, CallInst and InvokeInst // share a CallBase parent class that would make the below methods // look much better -void -mono_llvm_set_call_preserveall_cc (LLVMValueRef wrapped_calli) -{ - Instruction *calli = unwrap (wrapped_calli); - - if (isa (calli)) - dyn_cast(calli)->setCallingConv (CallingConv::PreserveAll); - else - dyn_cast(calli)->setCallingConv (CallingConv::PreserveAll); -} - void mono_llvm_set_call_nonnull_arg (LLVMValueRef wrapped_calli, int argNo) { @@ -466,6 +486,14 @@ mono_llvm_di_create_location (void *di_builder, void *scope, int row, int column return DILocation::get (*unwrap(LLVMGetGlobalContext ()), row, column, (Metadata*)scope); } +void +mono_llvm_set_fast_math (LLVMBuilderRef builder) +{ + FastMathFlags flags; + flags.setFast (); + unwrap(builder)->setFastMathFlags (flags); +} + void mono_llvm_di_set_location (LLVMBuilderRef builder, void *loc_md) { @@ -501,3 +529,23 @@ mono_llvm_get_or_insert_gc_safepoint_poll (LLVMModuleRef module) return wrap(SafepointPoll); #endif } + +int +mono_llvm_check_cpu_features (const CpuFeatureAliasFlag *features, int length) +{ + int flags = 0; + llvm::StringMap HostFeatures; + if (llvm::sys::getHostCPUFeatures (HostFeatures)) { + for (int i=0; itype == MONO_TYPE_I4 || type->type == MONO_TYPE_U4) + return 4; + else if (type->type == MONO_TYPE_I8 || type->type == MONO_TYPE_U8) + return 8; + else if (type->type == MONO_TYPE_R4 && !type->byref && (!cfg || cfg->r4fp)) + return 4; + else if (type->type == MONO_TYPE_R8 && !type->byref) + return 8; + return TARGET_SIZEOF_VOID_P; +} + +#ifndef DISABLE_JIT + static const IntIntrisic int_binop[] = { { "op_Addition", { OP_PT_ADD, OP_PT_ADD, OP_FADD, OP_RADD } }, { "op_Subtraction", { OP_PT_SUB, OP_PT_SUB, OP_FSUB, OP_RSUB } }, @@ -132,23 +148,6 @@ static const MagicTypeInfo type_info[] = { { 2, STACK_R8, STACK_R8, STACK_R8, OP_FCONV_TO_R8, OP_FCONV_TO_R4, OP_FMOVE, 0, 0, OP_PT_STORE_FP_MEMBASE_REG, 0 }, }; - -gsize -mini_magic_type_size (MonoCompile *cfg, MonoType *type) -{ - if (type->type == MONO_TYPE_I4 || type->type == MONO_TYPE_U4) - return 4; - else if (type->type == MONO_TYPE_I8 || type->type == MONO_TYPE_U8) - return 8; - else if (type->type == MONO_TYPE_R4 && !type->byref && (!cfg || cfg->r4fp)) - return 4; - else if (type->type == MONO_TYPE_R8 && !type->byref) - return 8; - return TARGET_SIZEOF_VOID_P; -} - -#ifndef DISABLE_JIT - static MonoInst* emit_narrow (MonoCompile *cfg, const MagicTypeInfo *info, int sreg) { @@ -368,7 +367,7 @@ mono_emit_native_types_intrinsics (MonoCompile *cfg, MonoMethod *cmethod, MonoMe #endif /* !DISABLE_JIT */ -static inline gboolean +static gboolean mono_class_is_magic_assembly (MonoClass *klass) { const char *aname = m_class_get_image (klass)->assembly_name; diff --git a/mono/mini/mini-ops.h b/mono/mini/mini-ops.h index 339f72f048..9208b480af 100644 --- a/mono/mini/mini-ops.h +++ b/mono/mini/mini-ops.h @@ -672,7 +672,13 @@ MINI_OP(OP_IMAX, "int_max", IREG, IREG, IREG) MINI_OP(OP_LMIN, "long_min", LREG, LREG, LREG) MINI_OP(OP_LMAX, "long_max", LREG, LREG, LREG) MINI_OP(OP_RMAX, "rmax", FREG, FREG, FREG) +MINI_OP(OP_RMIN, "rmin", FREG, FREG, FREG) MINI_OP(OP_RPOW, "rpow", FREG, FREG, FREG) +MINI_OP(OP_FMAX, "fmax", FREG, FREG, FREG) +MINI_OP(OP_FMIN, "fmin", FREG, FREG, FREG) +MINI_OP(OP_FPOW, "fpow", FREG, FREG, FREG) +MINI_OP(OP_RCOPYSIGN,"rcopysign", FREG, FREG, FREG) +MINI_OP(OP_FCOPYSIGN,"fcopysign", FREG, FREG, FREG) /* opcodes most architecture have */ MINI_OP(OP_ADC, "adc", IREG, IREG, IREG) @@ -711,10 +717,25 @@ MINI_OP(OP_TAN, "tan", FREG, FREG, NONE) MINI_OP(OP_ATAN, "atan", FREG, FREG, NONE) MINI_OP(OP_SQRT, "sqrt", FREG, FREG, NONE) MINI_OP(OP_ROUND, "round", FREG, FREG, NONE) +MINI_OP(OP_CEIL, "ceil", FREG, FREG, NONE) +MINI_OP(OP_FLOOR, "floor", FREG, FREG, NONE) +MINI_OP3(OP_FMA, "fma", FREG, FREG, FREG, FREG) MINI_OP(OP_SINF, "sinf", FREG, FREG, NONE) MINI_OP(OP_COSF, "cosf", FREG, FREG, NONE) +MINI_OP(OP_EXPF, "expf", FREG, FREG, NONE) +MINI_OP(OP_EXP, "exp", FREG, FREG, NONE) +MINI_OP(OP_LOG, "log", FREG, FREG, NONE) +MINI_OP(OP_LOG2, "log2", FREG, FREG, NONE) +MINI_OP(OP_LOG2F, "log2f", FREG, FREG, NONE) +MINI_OP(OP_LOG10, "log10", FREG, FREG, NONE) +MINI_OP(OP_LOG10F, "log10f", FREG, FREG, NONE) +MINI_OP(OP_TRUNC, "trunc", FREG, FREG, NONE) +MINI_OP(OP_TRUNCF, "truncf", FREG, FREG, NONE) MINI_OP(OP_ABSF, "absf", FREG, FREG, NONE) MINI_OP(OP_SQRTF, "sqrtf", FREG, FREG, NONE) +MINI_OP(OP_CEILF, "ceilf", FREG, FREG, NONE) +MINI_OP(OP_FLOORF, "floorf", FREG, FREG, NONE) +MINI_OP3(OP_FMAF, "fmaf", FREG, FREG, FREG, FREG) /* Operations that can be computed at constants at JIT time */ MINI_OP(OP_ACOS, "acos", FREG, FREG, NONE) @@ -732,6 +753,7 @@ MINI_OP(OP_STRLEN, "strlen", IREG, IREG, NONE) MINI_OP(OP_NEWARR, "newarr", IREG, IREG, NONE) /* Load a readonly length field from [sreg1+inst_imm] */ MINI_OP(OP_LDLEN, "ldlen", IREG, IREG, NONE) +/* inst_p0 is the exception name to throw or NULL */ MINI_OP(OP_BOUNDS_CHECK, "bounds_check", NONE, IREG, IREG) /* type checks */ MINI_OP(OP_ISINST, "isinst", IREG, IREG, NONE) @@ -745,6 +767,8 @@ MINI_OP(OP_MEMSET, "memset", NONE, NONE, NONE) MINI_OP(OP_SAVE_LMF, "save_lmf", NONE, NONE, NONE) MINI_OP(OP_RESTORE_LMF, "restore_lmf", NONE, NONE, NONE) +MINI_OP3(OP_MEMMOVE, "memmove", NONE, IREG, IREG, IREG) + /* write barrier */ MINI_OP(OP_CARD_TABLE_WBARRIER, "card_table_wbarrier", NONE, IREG, IREG) @@ -928,6 +952,7 @@ MINI_OP(OP_EXTRACT_I2, "extract_i2", IREG, XREG, NONE) MINI_OP(OP_EXTRACT_U2, "extract_u2", IREG, XREG, NONE) MINI_OP(OP_EXTRACT_I1, "extract_i1", IREG, XREG, NONE) MINI_OP(OP_EXTRACT_U1, "extract_u1", IREG, XREG, NONE) +MINI_OP(OP_EXTRACT_R4, "extract_r4", FREG, XREG, NONE) MINI_OP(OP_EXTRACT_R8, "extract_r8", FREG, XREG, NONE) MINI_OP(OP_EXTRACT_I8, "extract_i8", LREG, XREG, NONE) @@ -952,6 +977,7 @@ MINI_OP(OP_INSERTX_R4_SLOW, "insertx_r4_slow", XREG, XREG, FREG) MINI_OP(OP_INSERTX_R8_SLOW, "insertx_r8_slow", XREG, XREG, FREG) MINI_OP(OP_INSERTX_I8_SLOW, "insertx_i8_slow", XREG, XREG, LREG) +MINI_OP(OP_FCONV_TO_R4_X, "fconv_to_r4_x", XREG, FREG, NONE) MINI_OP(OP_FCONV_TO_R8_X, "fconv_to_r8_x", XREG, FREG, NONE) MINI_OP(OP_XCONV_R8_TO_I4, "xconv_r8_to_i4", IREG, XREG, NONE) MINI_OP(OP_ICONV_TO_X, "iconv_to_x", XREG, IREG, NONE) @@ -982,6 +1008,26 @@ MINI_OP(OP_DPPS, "dpps", XREG, XREG, XREG) /* inst_c0 is the rounding mode: 0 = round, 1 = floor, 2 = ceiling */ MINI_OP(OP_SSE41_ROUNDPD, "roundpd", XREG, XREG, NONE) +MINI_OP(OP_SSE41_ROUNDSS, "roundss", XREG, XREG, NONE) + +/* Intel BMI1 */ +/* Count trailing zeroes, return 32/64 if the input is 0 */ +MINI_OP(OP_CTTZ32, "cttz32", IREG, IREG, NONE) +MINI_OP(OP_CTTZ64, "cttz64", LREG, LREG, NONE) +MINI_OP(OP_BEXTR32, "bextr32", IREG, IREG, IREG) +MINI_OP(OP_BEXTR64, "bextr64", LREG, LREG, LREG) + +/* Intel BMI2 */ +MINI_OP(OP_BZHI32, "bzhi32", IREG, IREG, IREG) +MINI_OP(OP_BZHI64, "bzhi64", LREG, LREG, LREG) +MINI_OP(OP_PEXT32, "pext32", IREG, IREG, IREG) +MINI_OP(OP_PEXT64, "pext64", LREG, LREG, LREG) +MINI_OP(OP_PDEP32, "pdep32", IREG, IREG, IREG) +MINI_OP(OP_PDEP64, "pdep64", LREG, LREG, LREG) +MINI_OP(OP_MULX_H32, "mulxh32", IREG, IREG, IREG) +MINI_OP(OP_MULX_H64, "mulxh64", LREG, LREG, LREG) +MINI_OP3(OP_MULX_HL32, "mulxhl32", IREG, IREG, IREG, IREG) +MINI_OP3(OP_MULX_HL64, "mulxhl64", LREG, LREG, LREG, LREG) #endif @@ -1354,3 +1400,27 @@ MINI_OP(OP_GET_LAST_ERROR, "get_last_error", IREG, NONE, NONE) * should be enough to locate arguments and variables. */ MINI_OP(OP_FILL_PROF_CALL_CTX, "fill_prof_call_ctx", NONE, IREG, NONE) + +/* LLVM only, compare 2 vectors for equality, set dreg to 1/0 */ +MINI_OP(OP_XEQUAL, "xequal", IREG, XREG, XREG) +/* Per element compate, inst_c0 contains a CompRelation */ +MINI_OP(OP_XCOMPARE, "xcompare", XREG, XREG, XREG) +MINI_OP(OP_XCOMPARE_FP, "xcompare_fp", XREG, XREG, XREG) +/* Binary op, inst_c0 contains the operation */ +MINI_OP(OP_XBINOP, "xbinop", XREG, XREG, XREG) +MINI_OP(OP_XCAST, "xcast", XREG, XREG, NONE) +/* Extract element of vector */ +/* The index is assumed to be in range */ +/* inst_i0 is the element type */ +MINI_OP(OP_XEXTRACT_I32, "xextract_i32", IREG, XREG, IREG) +MINI_OP(OP_XEXTRACT_I64, "xextract_i64", LREG, XREG, IREG) +MINI_OP(OP_XEXTRACT_R8, "xextract_r8", FREG, XREG, IREG) +/* Return an R4 */ +MINI_OP(OP_XEXTRACT_R4, "xextract_r4", FREG, XREG, IREG) + +MINI_OP(OP_LZCNT32, "lzcnt32", IREG, IREG, NONE) +MINI_OP(OP_LZCNT64, "lzcnt64", LREG, LREG, NONE) +MINI_OP(OP_POPCNT32, "popcnt32", IREG, IREG, NONE) +MINI_OP(OP_POPCNT64, "popcnt64", LREG, LREG, NONE) + + diff --git a/mono/mini/mini-posix.c b/mono/mini/mini-posix.c index 74bc6a5d71..6a8a385988 100644 --- a/mono/mini/mini-posix.c +++ b/mono/mini/mini-posix.c @@ -698,12 +698,7 @@ sampling_thread_func (gpointer unused) thread->flags |= MONO_THREAD_FLAG_DONT_MANAGE; - ERROR_DECL (error); - - MonoString *name = mono_string_new_checked (mono_get_root_domain (), "Profiler Sampler", error); - mono_error_assert_ok (error); - mono_thread_set_name_internal (thread, name, MonoSetThreadNameFlag_None, error); - mono_error_assert_ok (error); + mono_thread_set_name_constant_ignore_error (thread, "Profiler Sampler", MonoSetThreadNameFlag_None); mono_thread_info_set_flags (MONO_THREAD_INFO_FLAGS_NO_GC | MONO_THREAD_INFO_FLAGS_NO_SAMPLE); @@ -871,9 +866,9 @@ mono_runtime_setup_stat_profiler (void) mono_atomic_store_i32 (&sampling_thread_running, 1); - MonoError error; - MonoInternalThread *thread = mono_thread_create_internal (mono_get_root_domain (), (gpointer)sampling_thread_func, NULL, MONO_THREAD_CREATE_FLAGS_NONE, &error); - mono_error_assert_ok (&error); + ERROR_DECL (error); + MonoInternalThread *thread = mono_thread_create_internal (mono_get_root_domain (), (gpointer)sampling_thread_func, NULL, MONO_THREAD_CREATE_FLAGS_NONE, error); + mono_error_assert_ok (error); sampling_thread = MONO_UINT_TO_NATIVE_THREAD_ID (thread->tid); } @@ -1158,6 +1153,7 @@ mono_init_native_crash_info (void) { gdb_path = g_find_program_in_path ("gdb"); lldb_path = g_find_program_in_path ("lldb"); + mono_threads_summarize_init (); } void diff --git a/mono/mini/mini-ppc.c.REMOVED.git-id b/mono/mini/mini-ppc.c.REMOVED.git-id index 5aa2acb99a..184d23ce36 100644 --- a/mono/mini/mini-ppc.c.REMOVED.git-id +++ b/mono/mini/mini-ppc.c.REMOVED.git-id @@ -1 +1 @@ -a2808c3bbcee47ec44e38fa0f9cba51397511aff \ No newline at end of file +fc8851e539265a899f8fa49fde8088ffbadb59df \ No newline at end of file diff --git a/mono/mini/mini-runtime.c.REMOVED.git-id b/mono/mini/mini-runtime.c.REMOVED.git-id index 32fc9560f7..f1868c56c2 100644 --- a/mono/mini/mini-runtime.c.REMOVED.git-id +++ b/mono/mini/mini-runtime.c.REMOVED.git-id @@ -1 +1 @@ -809faee3c07be13dc6c935d61e76203f91f014ab \ No newline at end of file +bb1d105fb7182a173f75194a550906df03739d7c \ No newline at end of file diff --git a/mono/mini/mini-runtime.h b/mono/mini/mini-runtime.h index 13268e59f6..3981e77b82 100644 --- a/mono/mini/mini-runtime.h +++ b/mono/mini/mini-runtime.h @@ -245,9 +245,9 @@ typedef struct MonoDebugOptions { gboolean test_tailcall_require; /* - * Use the the stricter clr memory model. + * Don't enforce any memory model. We will assume the architecture's memory model. */ - gboolean clr_memory_model; + gboolean weak_memory_model; /* * Internal testing feature @@ -369,7 +369,10 @@ MONO_API_DATA const char *mono_build_date; extern gboolean mono_do_signal_chaining; extern gboolean mono_do_crash_chaining; MONO_API_DATA gboolean mono_use_llvm; +MONO_API_DATA gboolean mono_use_fast_math; MONO_API_DATA gboolean mono_use_interpreter; +MONO_API_DATA MonoCPUFeatures mono_cpu_features_enabled; +MONO_API_DATA MonoCPUFeatures mono_cpu_features_disabled; extern const char* mono_interp_opts_string; extern gboolean mono_do_single_method_regression; extern guint32 mono_single_method_regression_opt; @@ -481,7 +484,7 @@ void mini_patch_llvm_jit_callees (MonoDomain *domain, MonoMethod *met gpointer mono_jit_search_all_backends_for_jit_info (MonoDomain *domain, MonoMethod *method, MonoJitInfo **ji); gpointer mono_jit_find_compiled_method_with_jit_info (MonoDomain *domain, MonoMethod *method, MonoJitInfo **ji); gpointer mono_jit_find_compiled_method (MonoDomain *domain, MonoMethod *method); -gpointer mono_jit_compile_method (MonoMethod *method, MonoError *error); +gpointer mono_jit_compile_method (MonoMethod *method, MonoError *error) MONO_LLVM_INTERNAL; gpointer mono_jit_compile_method_jit_only (MonoMethod *method, MonoError *error); void mono_set_bisect_methods (guint32 opt, const char *method_list_filename); diff --git a/mono/mini/mini-s390x.c.REMOVED.git-id b/mono/mini/mini-s390x.c.REMOVED.git-id index d7256f21ea..a92e9ca259 100644 --- a/mono/mini/mini-s390x.c.REMOVED.git-id +++ b/mono/mini/mini-s390x.c.REMOVED.git-id @@ -1 +1 @@ -126f6d6aad0bb61518c5546fe9da4cebbebe49a2 \ No newline at end of file +bef1e4587aede9283e7b68c3ae097378aa0e36a0 \ No newline at end of file diff --git a/mono/mini/mini-sparc.c.REMOVED.git-id b/mono/mini/mini-sparc.c.REMOVED.git-id index 1221cac321..3fa5f7a78e 100644 --- a/mono/mini/mini-sparc.c.REMOVED.git-id +++ b/mono/mini/mini-sparc.c.REMOVED.git-id @@ -1 +1 @@ -fa33869af42424df55b0ca347f4ac16c31f9be64 \ No newline at end of file +c57d2131f9487d999aa48c34107ac7687ca1eba1 \ No newline at end of file diff --git a/mono/mini/mini-trampolines.c b/mono/mini/mini-trampolines.c index 781e91bff8..b4f7321464 100644 --- a/mono/mini/mini-trampolines.c +++ b/mono/mini/mini-trampolines.c @@ -855,7 +855,7 @@ mono_vcall_trampoline (host_mgreg_t *regs, guint8 *code, int slot, guint8 *tramp res = common_call_trampoline (regs, code, m, vt, vtable_slot, error); leave: - if (!mono_error_ok (error)) { + if (!is_ok (error)) { mono_error_set_pending_exception (error); res = NULL; } @@ -892,7 +892,7 @@ mono_generic_virtual_remoting_trampoline (host_mgreg_t *regs, guint8 *code, Mono if (imt_method->is_inflated) context.method_inst = ((MonoMethodInflated*)imt_method)->context.method_inst; m = mono_class_inflate_generic_method_checked (declaring, &context, error); - g_assert (mono_error_ok (error)); /* FIXME don't swallow the error */; + g_assert (is_ok (error)); /* FIXME don't swallow the error */; m = mono_marshal_get_remoting_invoke_with_check (m, error); if (!is_ok (error)) { mono_error_set_pending_exception (error); @@ -900,7 +900,7 @@ mono_generic_virtual_remoting_trampoline (host_mgreg_t *regs, guint8 *code, Mono } addr = mono_jit_compile_method (m, error); - if (!mono_error_ok (error)) { + if (!is_ok (error)) { mono_error_set_pending_exception (error); return NULL; } @@ -978,7 +978,7 @@ mono_aot_plt_trampoline (host_mgreg_t *regs, guint8 *code, guint8 *aot_module, res = mono_aot_plt_resolve (aot_module, plt_info_offset, code, error); if (!res) { - if (!mono_error_ok (error)) { + if (!is_ok (error)) { mono_error_set_pending_exception (error); return NULL; } @@ -1009,7 +1009,7 @@ mono_rgctx_lazy_fetch_trampoline (host_mgreg_t *regs, guint8 *code, gpointer dat res = mono_method_fill_runtime_generic_context ((MonoMethodRuntimeGenericContext *)arg, index, error); else res = mono_class_fill_runtime_generic_context ((MonoVTable *)arg, index, error); - if (!mono_error_ok (error)) { + if (!is_ok (error)) { mono_error_set_pending_exception (error); return NULL; } @@ -1169,7 +1169,7 @@ mono_delegate_trampoline (host_mgreg_t *regs, guint8 *code, gpointer *arg, guint delegate->method_ptr = *delegate->method_code; } else { compiled_method = addr = mono_jit_compile_method (method, error); - if (!mono_error_ok (error)) { + if (!is_ok (error)) { mono_error_set_pending_exception (error); return NULL; } @@ -1199,7 +1199,7 @@ mono_delegate_trampoline (host_mgreg_t *regs, guint8 *code, gpointer *arg, guint /* The general, unoptimized case */ m = mono_marshal_get_delegate_invoke (invoke, delegate); code = (guint8 *)mono_jit_compile_method (m, error); - if (!mono_error_ok (error)) { + if (!is_ok (error)) { mono_error_set_pending_exception (error); return NULL; } @@ -1338,7 +1338,7 @@ mono_create_jump_trampoline (MonoDomain *domain, MonoMethod *method, gboolean ad if (mono_use_interpreter && !mono_aot_only) { gpointer ret = mini_get_interp_callbacks ()->create_method_pointer (method, FALSE, error); - if (!mono_error_ok (error)) + if (!is_ok (error)) return NULL; return ret; } @@ -1355,7 +1355,7 @@ mono_create_jump_trampoline (MonoDomain *domain, MonoMethod *method, gboolean ad if (mono_llvm_only) { code = mono_jit_compile_method (method, error); - if (!mono_error_ok (error)) + if (!is_ok (error)) return NULL; return code; } @@ -1416,7 +1416,7 @@ mono_create_jit_trampoline (MonoDomain *domain, MonoMethod *method, MonoError *e return (gpointer)method_not_found; /* Methods are lazily initialized on first call, so this can't lead recursion */ code = mono_jit_compile_method (method, error); - if (!mono_error_ok (error)) + if (!is_ok (error)) return NULL; return code; } diff --git a/mono/mini/mini-wasm-debugger.c b/mono/mini/mini-wasm-debugger.c index cc8e147f00..fd34e21936 100644 --- a/mono/mini/mini-wasm-debugger.c +++ b/mono/mini/mini-wasm-debugger.c @@ -717,7 +717,7 @@ describe_object_properties (guint64 objectId, gboolean isAsyncLocalThis) mono_wasm_add_properties_var(p->name); sig = mono_method_signature_internal (p->get); res = mono_runtime_try_invoke (p->get, obj, NULL, &exc, error); - if (!mono_error_ok (error) && exc == NULL) + if (!is_ok (error) && exc == NULL) exc = (MonoObject*) mono_error_convert_to_exception (error); if (exc) describe_value (mono_get_object_type (), &exc); diff --git a/mono/mini/mini-x86.c.REMOVED.git-id b/mono/mini/mini-x86.c.REMOVED.git-id index 7ff2b202c4..c8fad99e21 100644 --- a/mono/mini/mini-x86.c.REMOVED.git-id +++ b/mono/mini/mini-x86.c.REMOVED.git-id @@ -1 +1 @@ -79e85833b53cb2f982c0683a90a021e2ab72a00e \ No newline at end of file +41f2ab3499892ca862dbf03b3ac0fb998327cda3 \ No newline at end of file diff --git a/mono/mini/mini-x86.h b/mono/mini/mini-x86.h index af976b0d9d..d64c37fe10 100644 --- a/mono/mini/mini-x86.h +++ b/mono/mini/mini-x86.h @@ -68,9 +68,11 @@ LONG CALLBACK seh_handler(EXCEPTION_POINTERS* ep); #define MONO_ARCH_SUPPORT_TASKLETS 1 #ifndef DISABLE_SIMD +#ifndef ENABLE_NETCORE #define MONO_ARCH_SIMD_INTRINSICS 1 #define MONO_ARCH_NEED_SIMD_BANK 1 #endif +#endif /* we should lower this size and make sure we don't call heavy stack users in the segv handler */ #if defined(__APPLE__) @@ -242,14 +244,14 @@ typedef struct { /* Used for optimization, not complete */ #define MONO_ARCH_IS_OP_MEMBASE(opcode) ((opcode) == OP_X86_PUSH_MEMBASE) -#define MONO_ARCH_EMIT_BOUNDS_CHECK(cfg, array_reg, offset, index_reg) do { \ +#define MONO_ARCH_EMIT_BOUNDS_CHECK(cfg, array_reg, offset, index_reg, ex_name) do { \ MonoInst *inst; \ MONO_INST_NEW ((cfg), inst, OP_X86_COMPARE_MEMBASE_REG); \ inst->inst_basereg = array_reg; \ inst->inst_offset = offset; \ inst->sreg2 = index_reg; \ MONO_ADD_INS ((cfg)->cbb, inst); \ - MONO_EMIT_NEW_COND_EXC (cfg, LE_UN, "IndexOutOfRangeException"); \ + MONO_EMIT_NEW_COND_EXC (cfg, LE_UN, ex_name); \ } while (0) // Does the ABI have a volatile non-parameter register, so tailcall @@ -344,7 +346,7 @@ void mono_x86_throw_corlib_exception (host_mgreg_t *regs, guint32 ex_token_index, host_mgreg_t eip, gint32 pc_offset); -void +void mono_x86_patch (unsigned char* code, gpointer target); gpointer diff --git a/mono/mini/mini.c.REMOVED.git-id b/mono/mini/mini.c.REMOVED.git-id index 9fddf2244b..06e32aae76 100644 --- a/mono/mini/mini.c.REMOVED.git-id +++ b/mono/mini/mini.c.REMOVED.git-id @@ -1 +1 @@ -a909558b023e1d70a7d9973e722ee83ad3199079 \ No newline at end of file +4d6cef6c7bfefa09027722835440f27859ee101b \ No newline at end of file diff --git a/mono/mini/mini.h.REMOVED.git-id b/mono/mini/mini.h.REMOVED.git-id index 15bb73c2ff..f270177ac5 100644 --- a/mono/mini/mini.h.REMOVED.git-id +++ b/mono/mini/mini.h.REMOVED.git-id @@ -1 +1 @@ -2ed98d4102b16a9c0981eaa9559a62151da31e41 \ No newline at end of file +cbf295656e1b3a5505652e4c0a4fe5b65cbf239c \ No newline at end of file diff --git a/mono/mini/seq-points.c b/mono/mini/seq-points.c index 849297cc38..50d7dbfc06 100644 --- a/mono/mini/seq-points.c +++ b/mono/mini/seq-points.c @@ -254,6 +254,7 @@ mono_save_seq_point_info (MonoCompile *cfg, MonoJitInfo *jinfo) cfg->seq_points = NULL; } +/* LOCKING: Acquires the domain lock */ MonoSeqPointInfo* mono_get_seq_points (MonoDomain *domain, MonoMethod *method) { @@ -267,7 +268,7 @@ mono_get_seq_points (MonoDomain *domain, MonoMethod *method) mono_error_assert_ok (error); } - mono_loader_lock (); + mono_domain_lock (domain); seq_points = (MonoSeqPointInfo *)g_hash_table_lookup (domain_jit_info (domain)->seq_points, method); if (!seq_points && method->is_inflated) { /* generic sharing + aot */ @@ -275,7 +276,7 @@ mono_get_seq_points (MonoDomain *domain, MonoMethod *method) if (!seq_points) seq_points = (MonoSeqPointInfo *)g_hash_table_lookup (domain_jit_info (domain)->seq_points, shared_method); } - mono_loader_unlock (); + mono_domain_unlock (domain); return seq_points; } diff --git a/mono/mini/simd-intrinsics-netcore.c b/mono/mini/simd-intrinsics-netcore.c new file mode 100644 index 0000000000..b474e772d8 --- /dev/null +++ b/mono/mini/simd-intrinsics-netcore.c @@ -0,0 +1,940 @@ +/** + * SIMD Intrinsics support for netcore + */ + +#include +#include + +#if defined(DISABLE_JIT) + +void +mono_simd_intrinsics_init (void) +{ +} + +#else + +/* + * Only LLVM is supported as a backend. + */ + +#include "mini.h" +#include "mini-runtime.h" +#include "ir-emit.h" +#ifdef ENABLE_LLVM +#include "mini-llvm.h" +#endif +#include "mono/utils/bsearch.h" +#include +#include + +#if defined (MONO_ARCH_SIMD_INTRINSICS) && defined(ENABLE_NETCORE) + +#define MSGSTRFIELD(line) MSGSTRFIELD1(line) +#define MSGSTRFIELD1(line) str##line +static const struct msgstr_t { +#define METHOD(name) char MSGSTRFIELD(__LINE__) [sizeof (#name)]; +#define METHOD2(str,name) char MSGSTRFIELD(__LINE__) [sizeof (str)]; +#include "simd-methods-netcore.h" +#undef METHOD +#undef METHOD2 +} method_names = { +#define METHOD(name) #name, +#define METHOD2(str,name) str, +#include "simd-methods-netcore.h" +#undef METHOD +#undef METHOD2 +}; + +enum { +#define METHOD(name) SN_ ## name = offsetof (struct msgstr_t, MSGSTRFIELD(__LINE__)), +#define METHOD2(str,name) SN_ ## name = offsetof (struct msgstr_t, MSGSTRFIELD(__LINE__)), +#include "simd-methods-netcore.h" +}; +#define method_name(idx) ((const char*)&method_names + (idx)) + +static int register_size; + +static MonoCPUFeatures +get_cpu_features (MonoCompile* cfg) +{ + MonoCPUFeatures features = (MonoCPUFeatures)0; +#if !defined(MONO_CROSS_COMPILE) + if (!cfg->compile_aot || cfg->use_current_cpu) { + // detect current CPU features if we are in JIT mode or AOT with use_current_cpu flag. +#if defined(ENABLE_LLVM) + features = mono_llvm_get_cpu_features (); // llvm has a nice built-in API to detect features +#elif defined(TARGET_AMD64) + features = mono_arch_get_cpu_features (); +#endif + } +#endif + + // apply parameters passed via -mattr + features = (MonoCPUFeatures) (features | mono_cpu_features_enabled); + features = (MonoCPUFeatures) (features & ~mono_cpu_features_disabled); + return features; +} + +void +mono_simd_intrinsics_init (void) +{ + register_size = 16; +#if FALSE + if ((get_cpu_features () & MONO_CPU_X86_AVX) != 0) + register_size = 32; +#endif + /* Tell the class init code the size of the System.Numerics.Register type */ + mono_simd_register_size = register_size; +} + +MonoInst* +mono_emit_simd_field_load (MonoCompile *cfg, MonoClassField *field, MonoInst *addr) +{ + return NULL; +} + +static int +simd_intrinsic_compare_by_name (const void *key, const void *value) +{ + return strcmp ((const char*)key, method_name (*(guint16*)value)); +} + +static int +lookup_intrins (guint16 *intrinsics, int size, MonoMethod *cmethod) +{ + const guint16 *result = (const guint16 *)mono_binary_search (cmethod->name, intrinsics, size / sizeof (guint16), sizeof (guint16), &simd_intrinsic_compare_by_name); + + for (int i = 0; i < (size / sizeof (guint16)) - 1; ++i) { + if (method_name (intrinsics [i])[0] > method_name (intrinsics [i + 1])[0]) { + printf ("%s %s\n",method_name (intrinsics [i]), method_name (intrinsics [i + 1])); + g_assert_not_reached (); + } + } + + if (result == NULL) + return -1; + else + return (int)*result; +} + +static guint16 vector_methods [] = { + SN_get_IsHardwareAccelerated +}; + +static MonoInst* +emit_sys_numerics_vector (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSignature *fsig, MonoInst **args) +{ + MonoInst *ins; + gboolean supported = FALSE; + int id; + + id = lookup_intrins (vector_methods, sizeof (vector_methods), cmethod); + if (id == -1) + return NULL; + + //printf ("%s\n", mono_method_full_name (cmethod, 1)); + +#ifdef MONO_ARCH_SIMD_INTRINSICS + supported = TRUE; +#endif + + switch (id) { + case SN_get_IsHardwareAccelerated: + EMIT_NEW_ICONST (cfg, ins, supported ? 1 : 0); + ins->type = STACK_I4; + return ins; + default: + break; + } + + return NULL; +} + +static int +type_to_expand_op (MonoType *type) +{ + switch (type->type) { + case MONO_TYPE_I1: + case MONO_TYPE_U1: + return OP_EXPAND_I1; + case MONO_TYPE_I2: + case MONO_TYPE_U2: + return OP_EXPAND_I2; + case MONO_TYPE_I4: + case MONO_TYPE_U4: + return OP_EXPAND_I4; + case MONO_TYPE_I8: + case MONO_TYPE_U8: + return OP_EXPAND_I8; + case MONO_TYPE_R4: + return OP_EXPAND_R4; + case MONO_TYPE_R8: + return OP_EXPAND_R8; + default: + g_assert_not_reached (); + } +} + +/* + * Return a simd vreg for the simd value represented by SRC. + * SRC is the 'this' argument to methods. + * Set INDIRECT to TRUE if the value was loaded from memory. + */ +static int +load_simd_vreg_class (MonoCompile *cfg, MonoClass *klass, MonoInst *src, gboolean *indirect) +{ + const char *spec = INS_INFO (src->opcode); + + if (indirect) + *indirect = FALSE; + if (src->opcode == OP_XMOVE) { + return src->sreg1; + } else if (src->opcode == OP_LDADDR) { + int res = ((MonoInst*)src->inst_p0)->dreg; + return res; + } else if (spec [MONO_INST_DEST] == 'x') { + return src->dreg; + } else if (src->type == STACK_PTR || src->type == STACK_MP) { + MonoInst *ins; + if (indirect) + *indirect = TRUE; + + MONO_INST_NEW (cfg, ins, OP_LOADX_MEMBASE); + ins->klass = klass; + ins->sreg1 = src->dreg; + ins->type = STACK_VTYPE; + ins->dreg = alloc_ireg (cfg); + MONO_ADD_INS (cfg->cbb, ins); + return ins->dreg; + } + g_warning ("load_simd_vreg:: could not infer source simd (%d) vreg for op", src->type); + mono_print_ins (src); + g_assert_not_reached (); +} + +static int +load_simd_vreg (MonoCompile *cfg, MonoMethod *cmethod, MonoInst *src, gboolean *indirect) +{ + return load_simd_vreg_class (cfg, cmethod->klass, src, indirect); +} + +/* Create and emit a SIMD instruction, dreg is auto-allocated */ +static MonoInst* +emit_simd_ins (MonoCompile *cfg, MonoClass *klass, int opcode, int sreg1, int sreg2) +{ + const char *spec = INS_INFO (opcode); + MonoInst *ins; + + MONO_INST_NEW (cfg, ins, opcode); + if (spec [MONO_INST_DEST] == 'x') { + ins->dreg = alloc_xreg (cfg); + ins->type = STACK_VTYPE; + } else if (spec [MONO_INST_DEST] == 'i') { + ins->dreg = alloc_ireg (cfg); + ins->type = STACK_I4; + } else { + g_assert_not_reached (); + } + ins->sreg1 = sreg1; + ins->sreg2 = sreg2; + ins->klass = klass; + MONO_ADD_INS (cfg->cbb, ins); + return ins; +} + +static MonoInst* +emit_xcompare (MonoCompile *cfg, MonoClass *klass, MonoType *etype, MonoInst *arg1, MonoInst *arg2) +{ + MonoInst *ins; + gboolean is_fp = etype->type == MONO_TYPE_R4 || etype->type == MONO_TYPE_R8; + + ins = emit_simd_ins (cfg, klass, is_fp ? OP_XCOMPARE_FP : OP_XCOMPARE, arg1->dreg, arg2->dreg); + ins->inst_c0 = CMP_EQ; + ins->inst_c1 = etype->type; + return ins; +} + +static guint16 vector_t_methods [] = { + SN_ctor, + SN_CopyTo, + SN_Equals, + SN_GreaterThan, + SN_GreaterThanOrEqual, + SN_LessThan, + SN_LessThanOrEqual, + SN_get_AllOnes, + SN_get_Count, + SN_get_Item, + SN_get_Zero, + SN_op_Addition, + SN_op_BitwiseAnd, + SN_op_BitwiseOr, + SN_op_Division, + SN_op_Equality, + SN_op_ExclusiveOr, + SN_op_Explicit, + SN_op_Inequality, + SN_op_Multiply, + SN_op_Subtraction +}; + +static MonoInst* +emit_sys_numerics_vector_t (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSignature *fsig, MonoInst **args) +{ + MonoInst *ins; + MonoType *type, *etype; + MonoClass *klass; + int size, len, id; + gboolean is_unsigned; + + id = lookup_intrins (vector_t_methods, sizeof (vector_t_methods), cmethod); + if (id == -1) + return NULL; + + klass = cmethod->klass; + type = m_class_get_byval_arg (klass); + etype = mono_class_get_context (klass)->class_inst->type_argv [0]; + size = mono_class_value_size (mono_class_from_mono_type_internal (etype), NULL); + g_assert (size); + len = register_size / size; + + if (!MONO_TYPE_IS_PRIMITIVE (etype) || etype->type == MONO_TYPE_CHAR || etype->type == MONO_TYPE_BOOLEAN) + return NULL; + + if (cfg->verbose_level > 1) { + char *name = mono_method_full_name (cmethod, TRUE); + printf (" SIMD intrinsic %s\n", name); + g_free (name); + } + + switch (id) { + case SN_get_Count: + if (!(fsig->param_count == 0 && fsig->ret->type == MONO_TYPE_I4)) + break; + EMIT_NEW_ICONST (cfg, ins, len); + return ins; + case SN_get_Zero: + g_assert (fsig->param_count == 0 && mono_metadata_type_equal (fsig->ret, type)); + return emit_simd_ins (cfg, klass, OP_XZERO, -1, -1); + case SN_get_AllOnes: { + /* Compare a zero vector with itself */ + ins = emit_simd_ins (cfg, klass, OP_XZERO, -1, -1); + return emit_xcompare (cfg, klass, etype, ins, ins); + } + case SN_get_Item: + if (!COMPILE_LLVM (cfg)) + return NULL; + MONO_EMIT_NEW_BIALU_IMM (cfg, OP_COMPARE_IMM, -1, args [1]->dreg, len); + MONO_EMIT_NEW_COND_EXC (cfg, GE_UN, "IndexOutOfRangeException"); + int opcode = -1; + int dreg; + gboolean is64 = FALSE; + switch (etype->type) { + case MONO_TYPE_I8: + case MONO_TYPE_U8: + opcode = OP_XEXTRACT_I64; + is64 = TRUE; + dreg = alloc_lreg (cfg); + break; + case MONO_TYPE_R8: + opcode = OP_XEXTRACT_R8; + dreg = alloc_freg (cfg); + break; + case MONO_TYPE_R4: + g_assert (cfg->r4fp); + opcode = OP_XEXTRACT_R4; + dreg = alloc_freg (cfg); + break; + default: + opcode = OP_XEXTRACT_I32; + dreg = alloc_ireg (cfg); + break; + } + MONO_INST_NEW (cfg, ins, opcode); + ins->dreg = dreg; + ins->sreg1 = load_simd_vreg (cfg, cmethod, args [0], NULL); + ins->sreg2 = args [1]->dreg; + ins->inst_c0 = etype->type; + mini_type_to_eval_stack_type (cfg, etype, ins); + MONO_ADD_INS (cfg->cbb, ins); + return ins; + case SN_ctor: + if (fsig->param_count == 1 && mono_metadata_type_equal (fsig->params [0], etype)) { + int dreg = load_simd_vreg (cfg, cmethod, args [0], NULL); + + int opcode = type_to_expand_op (etype); + ins = emit_simd_ins (cfg, klass, opcode, args [1]->dreg, -1); + ins->dreg = dreg; + return ins; + } + if ((fsig->param_count == 1 || fsig->param_count == 2) && (fsig->params [0]->type == MONO_TYPE_SZARRAY)) { + MonoInst *array_ins = args [1]; + MonoInst *index_ins; + MonoInst *ldelema_ins; + MonoInst *var; + int end_index_reg; + + if (args [0]->opcode != OP_LDADDR) + return NULL; + + /* .ctor (T[]) or .ctor (T[], index) */ + + if (fsig->param_count == 2) { + index_ins = args [2]; + } else { + EMIT_NEW_ICONST (cfg, index_ins, 0); + } + + /* Emit index check for the end (index + len - 1 < array length) */ + end_index_reg = alloc_ireg (cfg); + EMIT_NEW_BIALU_IMM (cfg, ins, OP_IADD_IMM, end_index_reg, index_ins->dreg, len - 1); + MONO_EMIT_BOUNDS_CHECK (cfg, array_ins->dreg, MonoArray, max_length, end_index_reg); + + /* Load the array slice into the simd reg */ + ldelema_ins = mini_emit_ldelema_1_ins (cfg, mono_class_from_mono_type_internal (etype), array_ins, index_ins, TRUE); + g_assert (args [0]->opcode == OP_LDADDR); + var = (MonoInst*)args [0]->inst_p0; + EMIT_NEW_LOAD_MEMBASE (cfg, ins, OP_LOADX_MEMBASE, var->dreg, ldelema_ins->dreg, 0); + ins->klass = cmethod->klass; + return args [0]; + } + break; + case SN_CopyTo: + if ((fsig->param_count == 1 || fsig->param_count == 2) && (fsig->params [0]->type == MONO_TYPE_SZARRAY)) { + MonoInst *array_ins = args [1]; + MonoInst *index_ins; + MonoInst *ldelema_ins; + int val_vreg, end_index_reg; + + val_vreg = load_simd_vreg (cfg, cmethod, args [0], NULL); + + /* CopyTo (T[]) or CopyTo (T[], index) */ + + if (fsig->param_count == 2) { + index_ins = args [2]; + } else { + EMIT_NEW_ICONST (cfg, index_ins, 0); + } + + /* CopyTo () does complicated argument checks */ + mini_emit_bounds_check_offset (cfg, array_ins->dreg, MONO_STRUCT_OFFSET (MonoArray, max_length), index_ins->dreg, "ArgumentOutOfRangeException"); + end_index_reg = alloc_ireg (cfg); + int len_reg = alloc_ireg (cfg); + MONO_EMIT_NEW_LOAD_MEMBASE_OP_FLAGS (cfg, OP_LOADI4_MEMBASE, len_reg, array_ins->dreg, MONO_STRUCT_OFFSET (MonoArray, max_length), MONO_INST_INVARIANT_LOAD); + EMIT_NEW_BIALU (cfg, ins, OP_ISUB, end_index_reg, len_reg, index_ins->dreg); + MONO_EMIT_NEW_BIALU_IMM (cfg, OP_COMPARE_IMM, -1, end_index_reg, len); + MONO_EMIT_NEW_COND_EXC (cfg, LT, "ArgumentException"); + + /* Load the array slice into the simd reg */ + ldelema_ins = mini_emit_ldelema_1_ins (cfg, mono_class_from_mono_type_internal (etype), array_ins, index_ins, FALSE); + EMIT_NEW_STORE_MEMBASE (cfg, ins, OP_STOREX_MEMBASE, ldelema_ins->dreg, 0, val_vreg); + ins->klass = cmethod->klass; + return ins; + } + break; + case SN_Equals: + if (fsig->param_count == 1 && fsig->ret->type == MONO_TYPE_BOOLEAN && mono_metadata_type_equal (fsig->params [0], type)) { + int sreg1 = load_simd_vreg (cfg, cmethod, args [0], NULL); + + return emit_simd_ins (cfg, klass, OP_XEQUAL, sreg1, args [1]->dreg); + } else if (fsig->param_count == 2 && mono_metadata_type_equal (fsig->ret, type) && mono_metadata_type_equal (fsig->params [0], type) && mono_metadata_type_equal (fsig->params [1], type)) { + /* Per element equality */ + return emit_xcompare (cfg, klass, etype, args [0], args [1]); + } + break; + case SN_op_Equality: + case SN_op_Inequality: + g_assert (fsig->param_count == 2 && fsig->ret->type == MONO_TYPE_BOOLEAN && + mono_metadata_type_equal (fsig->params [0], type) && + mono_metadata_type_equal (fsig->params [1], type)); + ins = emit_simd_ins (cfg, klass, OP_XEQUAL, args [0]->dreg, args [1]->dreg); + if (id == SN_op_Inequality) { + int sreg = ins->dreg; + int dreg = alloc_ireg (cfg); + MONO_EMIT_NEW_BIALU_IMM (cfg, OP_COMPARE_IMM, -1, sreg, 0); + EMIT_NEW_UNALU (cfg, ins, OP_CEQ, dreg, -1); + } + return ins; + case SN_GreaterThan: + case SN_GreaterThanOrEqual: + case SN_LessThan: + case SN_LessThanOrEqual: + g_assert (fsig->param_count == 2 && mono_metadata_type_equal (fsig->ret, type) && mono_metadata_type_equal (fsig->params [0], type) && mono_metadata_type_equal (fsig->params [1], type)); + is_unsigned = etype->type == MONO_TYPE_U1 || etype->type == MONO_TYPE_U2 || etype->type == MONO_TYPE_U4 || etype->type == MONO_TYPE_U8; + ins = emit_xcompare (cfg, klass, etype, args [0], args [1]); + switch (id) { + case SN_GreaterThan: + ins->inst_c0 = is_unsigned ? CMP_GT_UN : CMP_GT; + break; + case SN_GreaterThanOrEqual: + ins->inst_c0 = is_unsigned ? CMP_GE_UN : CMP_GE; + break; + case SN_LessThan: + ins->inst_c0 = is_unsigned ? CMP_LT_UN : CMP_LT; + break; + case SN_LessThanOrEqual: + ins->inst_c0 = is_unsigned ? CMP_LE_UN : CMP_LE; + break; + default: + g_assert_not_reached (); + } + return ins; + case SN_op_Explicit: + return emit_simd_ins (cfg, klass, OP_XCAST, args [0]->dreg, -1); + case SN_op_Addition: + case SN_op_Subtraction: + case SN_op_Division: + case SN_op_Multiply: + case SN_op_BitwiseAnd: + case SN_op_BitwiseOr: + case SN_op_ExclusiveOr: + if (!(fsig->param_count == 2 && mono_metadata_type_equal (fsig->ret, type) && mono_metadata_type_equal (fsig->params [0], type) && mono_metadata_type_equal (fsig->params [1], type))) + return NULL; + ins = emit_simd_ins (cfg, klass, OP_XBINOP, args [0]->dreg, args [1]->dreg); + ins->inst_c1 = etype->type; + if (etype->type == MONO_TYPE_R4 || etype->type == MONO_TYPE_R8) { + switch (id) { + case SN_op_Addition: + ins->inst_c0 = OP_FADD; + break; + case SN_op_Subtraction: + ins->inst_c0 = OP_FSUB; + break; + case SN_op_Multiply: + ins->inst_c0 = OP_FMUL; + break; + case SN_op_Division: + ins->inst_c0 = OP_FDIV; + break; + default: + NULLIFY_INS (ins); + return NULL; + } + } else { + switch (id) { + case SN_op_Addition: + ins->inst_c0 = OP_IADD; + break; + case SN_op_Subtraction: + ins->inst_c0 = OP_ISUB; + break; + /* + case SN_op_Division: + ins->inst_c0 = OP_IDIV; + break; + case SN_op_Multiply: + ins->inst_c0 = OP_IMUL; + break; + */ + case SN_op_BitwiseAnd: + ins->inst_c0 = OP_IAND; + break; + case SN_op_BitwiseOr: + ins->inst_c0 = OP_IOR; + break; + case SN_op_ExclusiveOr: + ins->inst_c0 = OP_IXOR; + break; + default: + NULLIFY_INS (ins); + return NULL; + } + } + return ins; + default: + break; + } + + return NULL; +} + +#ifdef TARGET_AMD64 + +static guint16 popcnt_methods [] = { + SN_PopCount, + SN_get_IsSupported +}; + +static guint16 lzcnt_methods [] = { + SN_LeadingZeroCount, + SN_get_IsSupported +}; + +static guint16 bmi1_methods [] = { + SN_AndNot, + SN_BitFieldExtract, + SN_ExtractLowestSetBit, + SN_GetMaskUpToLowestSetBit, + SN_ResetLowestSetBit, + SN_TrailingZeroCount, + SN_get_IsSupported, +}; + +static guint16 bmi2_methods [] = { + SN_MultiplyNoFlags, + SN_ParallelBitDeposit, + SN_ParallelBitExtract, + SN_ZeroHighBits, + SN_get_IsSupported, +}; + +static MonoInst* +emit_x86_intrinsics (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSignature *fsig, MonoInst **args) +{ + const char *class_name; + const char *class_ns; + MonoInst *ins; + int id; + gboolean supported, is_64bit; + MonoClass *klass = cmethod->klass; + + class_ns = m_class_get_name_space (klass); + class_name = m_class_get_name (klass); + if (!strcmp (class_name, "Popcnt") || (!strcmp (class_name, "X64") && cmethod->klass->nested_in && !strcmp (m_class_get_name (cmethod->klass->nested_in), "Popcnt"))) { + id = lookup_intrins (popcnt_methods, sizeof (popcnt_methods), cmethod); + if (id == -1) + return NULL; + + supported = (get_cpu_features (cfg) & MONO_CPU_X86_POPCNT) != 0; + is_64bit = !strcmp (class_name, "X64"); + + switch (id) { + case SN_get_IsSupported: + EMIT_NEW_ICONST (cfg, ins, supported ? 1 : 0); + ins->type = STACK_I4; + return ins; + case SN_PopCount: + if (!supported) + return NULL; + MONO_INST_NEW (cfg, ins, is_64bit ? OP_POPCNT64 : OP_POPCNT32); + ins->dreg = is_64bit ? alloc_lreg (cfg) : alloc_ireg (cfg); + ins->sreg1 = args [0]->dreg; + ins->type = is_64bit ? STACK_I8 : STACK_I4; + MONO_ADD_INS (cfg->cbb, ins); + return ins; + default: + return NULL; + } + } + if (!strcmp (class_name, "Lzcnt") || (!strcmp (class_name, "X64") && cmethod->klass->nested_in && !strcmp (m_class_get_name (cmethod->klass->nested_in), "Lzcnt"))) { + id = lookup_intrins (lzcnt_methods, sizeof (lzcnt_methods), cmethod); + if (id == -1) + return NULL; + + supported = (get_cpu_features (cfg) & MONO_CPU_X86_LZCNT) != 0; + is_64bit = !strcmp (class_name, "X64"); + + switch (id) { + case SN_get_IsSupported: + EMIT_NEW_ICONST (cfg, ins, supported ? 1 : 0); + ins->type = STACK_I4; + return ins; + case SN_LeadingZeroCount: + if (!supported) + return NULL; + MONO_INST_NEW (cfg, ins, is_64bit ? OP_LZCNT64 : OP_LZCNT32); + ins->dreg = is_64bit ? alloc_lreg (cfg) : alloc_ireg (cfg); + ins->sreg1 = args [0]->dreg; + ins->type = is_64bit ? STACK_I8 : STACK_I4; + MONO_ADD_INS (cfg->cbb, ins); + return ins; + default: + return NULL; + } + } + if (!strcmp (class_name, "Bmi1") || (!strcmp (class_name, "X64") && cmethod->klass->nested_in && !strcmp (m_class_get_name (cmethod->klass->nested_in), "Bmi1"))) { + if (!COMPILE_LLVM (cfg)) + return NULL; + id = lookup_intrins (bmi1_methods, sizeof (bmi1_methods), cmethod); + + g_assert (id != -1); + supported = (get_cpu_features (cfg) & MONO_CPU_X86_BMI1) != 0; + is_64bit = !strcmp (class_name, "X64"); + + switch (id) { + case SN_get_IsSupported: + EMIT_NEW_ICONST (cfg, ins, supported ? 1 : 0); + ins->type = STACK_I4; + return ins; + case SN_AndNot: { + // (a ^ -1) & b + // LLVM replaces it with `andn` + int tmp_reg = is_64bit ? alloc_lreg (cfg) : alloc_ireg (cfg); + int result_reg = is_64bit ? alloc_lreg (cfg) : alloc_ireg (cfg); + EMIT_NEW_BIALU_IMM (cfg, ins, is_64bit ? OP_LXOR_IMM : OP_IXOR_IMM, tmp_reg, args [0]->dreg, -1); + EMIT_NEW_BIALU (cfg, ins, is_64bit ? OP_LAND : OP_IAND, result_reg, tmp_reg, args [1]->dreg); + return ins; + } + case SN_BitFieldExtract: { + if (fsig->param_count == 2) { + MONO_INST_NEW (cfg, ins, is_64bit ? OP_BEXTR64 : OP_BEXTR32); + ins->dreg = is_64bit ? alloc_lreg (cfg) : alloc_ireg (cfg); + ins->sreg1 = args [0]->dreg; + ins->sreg2 = args [1]->dreg; + ins->type = is_64bit ? STACK_I8 : STACK_I4; + MONO_ADD_INS (cfg->cbb, ins); + return ins; + } + } + case SN_GetMaskUpToLowestSetBit: { + // x ^ (x - 1) + // LLVM replaces it with `blsmsk` + int tmp_reg = is_64bit ? alloc_lreg (cfg) : alloc_ireg (cfg); + int result_reg = is_64bit ? alloc_lreg (cfg) : alloc_ireg (cfg); + EMIT_NEW_BIALU_IMM (cfg, ins, is_64bit ? OP_LSUB_IMM : OP_ISUB_IMM, tmp_reg, args [0]->dreg, 1); + EMIT_NEW_BIALU (cfg, ins, is_64bit ? OP_LXOR : OP_IXOR, result_reg, args [0]->dreg, tmp_reg); + return ins; + } + case SN_ResetLowestSetBit: { + // x & (x - 1) + // LLVM replaces it with `blsr` + int tmp_reg = is_64bit ? alloc_lreg (cfg) : alloc_ireg (cfg); + int result_reg = is_64bit ? alloc_lreg (cfg) : alloc_ireg (cfg); + EMIT_NEW_BIALU_IMM (cfg, ins, is_64bit ? OP_LSUB_IMM : OP_ISUB_IMM, tmp_reg, args [0]->dreg, 1); + EMIT_NEW_BIALU (cfg, ins, is_64bit ? OP_LAND : OP_IAND, result_reg, args [0]->dreg, tmp_reg); + return ins; + } + case SN_ExtractLowestSetBit: { + // x & (0 - x) + // LLVM replaces it with `blsi` + int tmp_reg = is_64bit ? alloc_lreg (cfg) : alloc_ireg (cfg); + int result_reg = is_64bit ? alloc_lreg (cfg) : alloc_ireg (cfg); + int zero_reg = is_64bit ? alloc_lreg (cfg) : alloc_ireg (cfg); + MONO_EMIT_NEW_ICONST (cfg, zero_reg, 0); + EMIT_NEW_BIALU (cfg, ins, is_64bit ? OP_LSUB : OP_ISUB, tmp_reg, zero_reg, args [0]->dreg); + EMIT_NEW_BIALU (cfg, ins, is_64bit ? OP_LAND : OP_IAND, result_reg, args [0]->dreg, tmp_reg); + return ins; + } + case SN_TrailingZeroCount: + MONO_INST_NEW (cfg, ins, is_64bit ? OP_CTTZ64 : OP_CTTZ32); + ins->dreg = is_64bit ? alloc_lreg (cfg) : alloc_ireg (cfg); + ins->sreg1 = args [0]->dreg; + ins->type = is_64bit ? STACK_I8 : STACK_I4; + MONO_ADD_INS (cfg->cbb, ins); + return ins; + default: + g_assert_not_reached (); + } + } + if (!strcmp (class_name, "Bmi2") || (!strcmp (class_name, "X64") && cmethod->klass->nested_in && !strcmp (m_class_get_name (cmethod->klass->nested_in), "Bmi2"))) { + if (!COMPILE_LLVM (cfg)) + return NULL; + id = lookup_intrins (bmi2_methods, sizeof (bmi2_methods), cmethod); + g_assert (id != -1); + supported = (get_cpu_features (cfg) & MONO_CPU_X86_BMI2) != 0; + is_64bit = !strcmp (class_name, "X64"); + + switch (id) { + case SN_get_IsSupported: + EMIT_NEW_ICONST (cfg, ins, supported ? 1 : 0); + ins->type = STACK_I4; + return ins; + case SN_MultiplyNoFlags: + if (fsig->param_count == 2) { + MONO_INST_NEW (cfg, ins, is_64bit ? OP_MULX_H64 : OP_MULX_H32); + ins->dreg = is_64bit ? alloc_lreg (cfg) : alloc_ireg (cfg); + ins->sreg1 = args [0]->dreg; + ins->sreg2 = args [1]->dreg; + ins->type = is_64bit ? STACK_I8 : STACK_I4; + MONO_ADD_INS (cfg->cbb, ins); + } else if (fsig->param_count == 3) { + MONO_INST_NEW (cfg, ins, is_64bit ? OP_MULX_HL64 : OP_MULX_HL32); + ins->dreg = is_64bit ? alloc_lreg (cfg) : alloc_ireg (cfg); + ins->sreg1 = args [0]->dreg; + ins->sreg2 = args [1]->dreg; + ins->sreg3 = args [2]->dreg; + ins->type = is_64bit ? STACK_I8 : STACK_I4; + MONO_ADD_INS (cfg->cbb, ins); + } else { + g_assert_not_reached (); + } + return ins; + case SN_ZeroHighBits: + MONO_INST_NEW (cfg, ins, is_64bit ? OP_BZHI64 : OP_BZHI32); + ins->dreg = is_64bit ? alloc_lreg (cfg) : alloc_ireg (cfg); + ins->sreg1 = args [0]->dreg; + ins->sreg2 = args [1]->dreg; + ins->type = is_64bit ? STACK_I8 : STACK_I4; + MONO_ADD_INS (cfg->cbb, ins); + return ins; + case SN_ParallelBitExtract: + MONO_INST_NEW (cfg, ins, is_64bit ? OP_PEXT64 : OP_PEXT32); + ins->dreg = is_64bit ? alloc_lreg (cfg) : alloc_ireg (cfg); + ins->sreg1 = args [0]->dreg; + ins->sreg2 = args [1]->dreg; + ins->type = is_64bit ? STACK_I8 : STACK_I4; + MONO_ADD_INS (cfg->cbb, ins); + return ins; + case SN_ParallelBitDeposit: + MONO_INST_NEW (cfg, ins, is_64bit ? OP_PDEP64 : OP_PDEP32); + ins->dreg = is_64bit ? alloc_lreg (cfg) : alloc_ireg (cfg); + ins->sreg1 = args [0]->dreg; + ins->sreg2 = args [1]->dreg; + ins->type = is_64bit ? STACK_I8 : STACK_I4; + MONO_ADD_INS (cfg->cbb, ins); + return ins; + default: + g_assert_not_reached (); + } + } + + return NULL; +} +#endif + +static guint16 vector_128_t_methods [] = { + SN_get_Count, +}; + +static MonoInst* +emit_vector128_t (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSignature *fsig, MonoInst **args) +{ + MonoInst *ins; + MonoType *type, *etype; + MonoClass *klass; + int size, len, id; + + id = lookup_intrins (vector_128_t_methods, sizeof (vector_128_t_methods), cmethod); + if (id == -1) + return NULL; + + klass = cmethod->klass; + type = m_class_get_byval_arg (klass); + etype = mono_class_get_context (klass)->class_inst->type_argv [0]; + size = mono_class_value_size (mono_class_from_mono_type_internal (etype), NULL); + g_assert (size); + len = 16 / size; + + if (!MONO_TYPE_IS_PRIMITIVE (etype) || etype->type == MONO_TYPE_CHAR || etype->type == MONO_TYPE_BOOLEAN) + return NULL; + + if (cfg->verbose_level > 1) { + char *name = mono_method_full_name (cmethod, TRUE); + printf (" SIMD intrinsic %s\n", name); + g_free (name); + } + + switch (id) { + case SN_get_Count: + if (!(fsig->param_count == 0 && fsig->ret->type == MONO_TYPE_I4)) + break; + EMIT_NEW_ICONST (cfg, ins, len); + return ins; + default: + break; + } + + return NULL; +} + +static guint16 vector_256_t_methods [] = { + SN_get_Count, +}; + +static MonoInst* +emit_vector256_t (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSignature *fsig, MonoInst **args) +{ + MonoInst *ins; + MonoType *type, *etype; + MonoClass *klass; + int size, len, id; + + id = lookup_intrins (vector_256_t_methods, sizeof (vector_256_t_methods), cmethod); + if (id == -1) + return NULL; + + klass = cmethod->klass; + type = m_class_get_byval_arg (klass); + etype = mono_class_get_context (klass)->class_inst->type_argv [0]; + size = mono_class_value_size (mono_class_from_mono_type_internal (etype), NULL); + g_assert (size); + len = 32 / size; + + if (!MONO_TYPE_IS_PRIMITIVE (etype) || etype->type == MONO_TYPE_CHAR || etype->type == MONO_TYPE_BOOLEAN) + return NULL; + + if (cfg->verbose_level > 1) { + char *name = mono_method_full_name (cmethod, TRUE); + printf (" SIMD intrinsic %s\n", name); + g_free (name); + } + + switch (id) { + case SN_get_Count: + if (!(fsig->param_count == 0 && fsig->ret->type == MONO_TYPE_I4)) + break; + EMIT_NEW_ICONST (cfg, ins, len); + return ins; + default: + break; + } + + return NULL; +} + +MonoInst* +mono_emit_simd_intrinsics (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSignature *fsig, MonoInst **args) +{ + const char *class_name; + const char *class_ns; + MonoImage *image = m_class_get_image (cmethod->klass); + + if (image != mono_get_corlib ()) + return NULL; + + class_ns = m_class_get_name_space (cmethod->klass); + class_name = m_class_get_name (cmethod->klass); + +#ifdef TARGET_AMD64 // TODO: test and enable for x86 too + if (cmethod->klass->nested_in) + class_ns = m_class_get_name_space (cmethod->klass->nested_in), class_name, cmethod->klass->nested_in; + if (!strcmp (class_ns, "System.Runtime.Intrinsics.X86")) + return emit_x86_intrinsics (cfg ,cmethod, fsig, args); +#endif + + if (!strcmp (class_ns, "System.Runtime.Intrinsics")) { + if (!strcmp (class_name, "Vector128`1")) + return emit_vector128_t (cfg ,cmethod, fsig, args); + if (!strcmp (class_name, "Vector256`1")) + return emit_vector256_t (cfg ,cmethod, fsig, args); + } + + // FIXME: Make sure get_cpu_features is used where needed + if (cfg->compile_aot) + return NULL; + if (!strcmp (class_ns, "System.Numerics") && !strcmp (class_name, "Vector")) { + MonoInst *ins = emit_sys_numerics_vector (cfg, cmethod, fsig, args); + if (!ins) { + //printf ("M: %s %s\n", mono_method_get_full_name (cfg->method), mono_method_get_full_name (cmethod)); + } + return ins; + } + if (!strcmp (class_ns, "System.Numerics") && !strcmp (class_name, "Vector`1")) { + MonoInst *ins = emit_sys_numerics_vector_t (cfg, cmethod, fsig, args); + if (!ins) { + //printf ("M: %s %s\n", mono_method_get_full_name (cfg->method), mono_method_get_full_name (cmethod)); + } + return ins; + } + + return NULL; +} + +void +mono_simd_decompose_intrinsic (MonoCompile *cfg, MonoBasicBlock *bb, MonoInst *ins) +{ +} + +void +mono_simd_simplify_indirection (MonoCompile *cfg) +{ +} + +#else + +MONO_EMPTY_SOURCE_FILE (simd_intrinsics_netcore); + +#endif + +#endif /* DISABLE_JIT */ diff --git a/mono/mini/simd-intrinsics.c b/mono/mini/simd-intrinsics.c index dbfb5a9ea0..b8e03b25bb 100644 --- a/mono/mini/simd-intrinsics.c +++ b/mono/mini/simd-intrinsics.c @@ -13,9 +13,10 @@ #include "mini.h" #include "ir-emit.h" -#include "mono/utils/bsearch.h" #include #include +#include +#include /* General notes on SIMD intrinsics @@ -63,7 +64,7 @@ The advantage of this change is that it could have a _membase version and promot without a OP_LDADDR. */ -#if defined (MONO_ARCH_SIMD_INTRINSICS) +#if defined (MONO_ARCH_SIMD_INTRINSICS) && !defined(ENABLE_NETCORE) #if defined (DISABLE_JIT) @@ -606,7 +607,7 @@ mono_simd_intrinsics_init (void) /*TODO log the supported flags*/ } -static inline gboolean +static gboolean apply_vreg_first_block_interference (MonoCompile *cfg, MonoInst *ins, int reg, int max_vreg, char *vreg_flags) { if (reg != -1 && reg <= max_vreg && vreg_flags [reg]) { @@ -618,7 +619,7 @@ apply_vreg_first_block_interference (MonoCompile *cfg, MonoInst *ins, int reg, i return FALSE; } -static inline gboolean +static gboolean apply_vreg_following_block_interference (MonoCompile *cfg, MonoInst *ins, int reg, MonoBasicBlock *bb, int max_vreg, char *vreg_flags, MonoBasicBlock **target_bb) { if (reg == -1 || reg > max_vreg || !(vreg_flags [reg] & VREG_HAS_XZERO_BB0) || target_bb [reg] == bb) @@ -1705,7 +1706,7 @@ simd_intrinsic_emit_shift (const SimdIntrinsic *intrinsic, MonoCompile *cfg, Mon return ins; } -static inline gboolean +static gboolean mono_op_is_packed_compare (int op) { return op >= OP_PCMPEQB && op <= OP_PCMPEQQ; diff --git a/mono/mini/simd-methods-netcore.h b/mono/mini/simd-methods-netcore.h new file mode 100644 index 0000000000..41e61b0de1 --- /dev/null +++ b/mono/mini/simd-methods-netcore.h @@ -0,0 +1,40 @@ +METHOD2(".ctor", ctor) +METHOD(CopyTo) +METHOD(Equals) +METHOD(GreaterThan) +METHOD(GreaterThanOrEqual) +METHOD(LessThan) +METHOD(LessThanOrEqual) +METHOD(Min) +METHOD(Max) +METHOD(PopCount) +METHOD(LeadingZeroCount) +METHOD(get_Count) +METHOD(get_IsHardwareAccelerated) +METHOD(get_IsSupported) +METHOD(get_AllOnes) +METHOD(get_Item) +METHOD(get_One) +METHOD(get_Zero) +METHOD(op_Addition) +METHOD(op_BitwiseAnd) +METHOD(op_BitwiseOr) +METHOD(op_Division) +METHOD(op_Equality) +METHOD(op_ExclusiveOr) +METHOD(op_Explicit) +METHOD(op_Inequality) +METHOD(op_Multiply) +METHOD(op_Subtraction) +// BMI1 +METHOD(AndNot) +METHOD(BitFieldExtract) +METHOD(ExtractLowestSetBit) +METHOD(GetMaskUpToLowestSetBit) +METHOD(ResetLowestSetBit) +METHOD(TrailingZeroCount) +// BMI2 +METHOD(ZeroHighBits) +METHOD(MultiplyNoFlags) +METHOD(ParallelBitDeposit) +METHOD(ParallelBitExtract) diff --git a/mono/mini/ssa.c b/mono/mini/ssa.c index b54be56d02..fa6ec5bb53 100644 --- a/mono/mini/ssa.c +++ b/mono/mini/ssa.c @@ -122,7 +122,7 @@ remove_bb_from_phis (MonoCompile *cfg, MonoBasicBlock *bb, MonoBasicBlock *targe } } -static inline int +static int op_phi_to_move (int opcode) { switch (opcode) { @@ -141,7 +141,7 @@ op_phi_to_move (int opcode) return -1; } -static inline void +static void record_use (MonoCompile *cfg, MonoInst *var, MonoBasicBlock *bb, MonoInst *ins) { MonoMethodVar *info; @@ -877,7 +877,7 @@ evaluate_ins (MonoCompile *cfg, MonoInst *ins, MonoInst **res, MonoInst **carray return 0; } -static inline void +static void change_varstate (MonoCompile *cfg, GList **cvars, MonoMethodVar *info, int state, MonoInst *c0, MonoInst **carray) { if (info->cpstate >= state) @@ -898,7 +898,7 @@ change_varstate (MonoCompile *cfg, GList **cvars, MonoMethodVar *info, int state } } -static inline void +static void add_cprop_bb (MonoCompile *cfg, MonoBasicBlock *bb, GList **bblist) { if (G_UNLIKELY (cfg->verbose_level > 1)) @@ -1308,7 +1308,7 @@ mono_ssa_cprop (MonoCompile *cfg) } } -static inline void +static void add_to_dce_worklist (MonoCompile *cfg, MonoMethodVar *var, MonoMethodVar *use, GList **wl) { GList *tmp; diff --git a/mono/mini/trace.c b/mono/mini/trace.c index 60fa58657f..38326208cf 100644 --- a/mono/mini/trace.c +++ b/mono/mini/trace.c @@ -105,20 +105,11 @@ string_to_utf8 (MonoString *s) } /* - * cpos (ebp + arg_info[n].offset) points to the beginning of the - * stack slot for this argument. On little-endian systems, we can - * simply dereference it. On big-endian systems, we need to adjust - * cpos upward first if the datatype we're referencing is smaller than - * a stack slot. Also - one can't assume that gpointer is also the - * size of a stack slot - use SIZEOF_REGISTER instead. The following - * helper macro tries to keep down the mess of all the pointer - * calculations. + * This used to be endianness sensitive due to the stack, but since the change + * to using the profiler to get an argument, it can be dereferenced as a + * pointer of the specified type, regardless of endian. */ -#if (G_BYTE_ORDER == G_LITTLE_ENDIAN) #define arg_in_stack_slot(cpos, type) ((type *)(cpos)) -#else -#define arg_in_stack_slot(cpos, type) ((type *)((sizeof(type) < SIZEOF_REGISTER) ? (((gssize)(cpos)) + SIZEOF_REGISTER - sizeof(type)) : (gssize)(cpos))) -#endif void mono_trace_enter_method (MonoMethod *method, MonoProfilerCallContext *ctx) @@ -161,7 +152,7 @@ mono_trace_enter_method (MonoMethod *method, MonoProfilerCallContext *ctx) if (sig->hasthis) { void *this_buf = mini_profiler_context_get_this (ctx); if (m_class_is_valuetype (method->klass)) { - printf ("value:%p, ", this_buf); + printf ("value:%p", this_buf); } else { MonoObject *o = *(MonoObject**)this_buf; @@ -172,17 +163,19 @@ mono_trace_enter_method (MonoMethod *method, MonoProfilerCallContext *ctx) MonoString *s = (MonoString*)o; char *as = string_to_utf8 (s); - printf ("this:[STRING:%p:%s], ", o, as); + printf ("this:[STRING:%p:%s]", o, as); g_free (as); } else if (klass == mono_defaults.runtimetype_class) { - printf ("[this:[TYPE:%p:%s]], ", o, mono_type_full_name (((MonoReflectionType*)o)->type)); + printf ("[this:[TYPE:%p:%s]]", o, mono_type_full_name (((MonoReflectionType*)o)->type)); } else { - printf ("this:%p[%s.%s %s], ", o, m_class_get_name_space (klass), m_class_get_name (klass), o->vtable->domain->friendly_name); + printf ("this:%p[%s.%s %s]", o, m_class_get_name_space (klass), m_class_get_name (klass), o->vtable->domain->friendly_name); } } else { - printf ("this:NULL, "); + printf ("this:NULL"); } } + if (sig->param_count) + printf (", "); mini_profiler_context_free_buffer (this_buf); } @@ -192,7 +185,7 @@ mono_trace_enter_method (MonoMethod *method, MonoProfilerCallContext *ctx) MonoType *type = sig->params [i]; if (type->byref) { - printf ("[BYREF:%p], ", *(gpointer*)buf); + printf ("[BYREF:%p]", *(gpointer*)buf); mini_profiler_context_free_buffer (buf); break; } @@ -200,21 +193,21 @@ mono_trace_enter_method (MonoMethod *method, MonoProfilerCallContext *ctx) switch (mini_get_underlying_type (type)->type) { case MONO_TYPE_I: case MONO_TYPE_U: - printf ("%p, ", *arg_in_stack_slot(buf, gpointer *)); + printf ("%p", *arg_in_stack_slot(buf, gpointer *)); break; case MONO_TYPE_BOOLEAN: case MONO_TYPE_CHAR: case MONO_TYPE_I1: case MONO_TYPE_U1: - printf ("%d, ", *arg_in_stack_slot(buf, gint8)); + printf ("%d", *arg_in_stack_slot(buf, gint8)); break; case MONO_TYPE_I2: case MONO_TYPE_U2: - printf ("%d, ", *arg_in_stack_slot(buf, gint16)); + printf ("%d", *arg_in_stack_slot(buf, gint16)); break; case MONO_TYPE_I4: case MONO_TYPE_U4: - printf ("%d, ", *arg_in_stack_slot(buf, int)); + printf ("%d", *arg_in_stack_slot(buf, int)); break; case MONO_TYPE_STRING: { MonoString *s = *arg_in_stack_slot(buf, MonoString *); @@ -224,10 +217,10 @@ mono_trace_enter_method (MonoMethod *method, MonoProfilerCallContext *ctx) g_assert (((MonoObject *)s)->vtable->klass == mono_defaults.string_class); as = string_to_utf8 (s); - printf ("[STRING:%p:%s], ", s, as); + printf ("[STRING:%p:%s]", s, as); g_free (as); } else - printf ("[STRING:null], "); + printf ("[STRING:null]"); break; } case MONO_TYPE_CLASS: @@ -240,19 +233,19 @@ mono_trace_enter_method (MonoMethod *method, MonoProfilerCallContext *ctx) if (klass == mono_defaults.string_class) { char *as = string_to_utf8 ((MonoString*)o); - printf ("[STRING:%p:%s], ", o, as); + printf ("[STRING:%p:%s]", o, as); g_free (as); } else if (klass == mono_defaults.int32_class) { - printf ("[INT32:%p:%d], ", o, *(gint32 *)data); + printf ("[INT32:%p:%d]", o, *(gint32 *)data); } else if (klass == mono_defaults.runtimetype_class) { - printf ("[TYPE:%s], ", mono_type_full_name (((MonoReflectionType*)o)->type)); + printf ("[TYPE:%s]", mono_type_full_name (((MonoReflectionType*)o)->type)); } else if (m_class_get_rank (klass)) { MonoArray *arr = (MonoArray*)o; - printf ("[%s.%s:[%d]%p], ", m_class_get_name_space (klass), m_class_get_name (klass), mono_array_length_internal (arr), o); + printf ("[%s.%s:[%d]%p]", m_class_get_name_space (klass), m_class_get_name (klass), mono_array_length_internal (arr), o); } else - printf ("[%s.%s:%p], ", m_class_get_name_space (klass), m_class_get_name (klass), o); + printf ("[%s.%s:%p]", m_class_get_name_space (klass), m_class_get_name (klass), o); } else { - printf ("%p, ", *arg_in_stack_slot(buf, gpointer)); + printf ("%p", *arg_in_stack_slot(buf, gpointer)); } break; } @@ -260,17 +253,17 @@ mono_trace_enter_method (MonoMethod *method, MonoProfilerCallContext *ctx) case MONO_TYPE_FNPTR: case MONO_TYPE_ARRAY: case MONO_TYPE_SZARRAY: - printf ("%p, ", *arg_in_stack_slot(buf, gpointer)); + printf ("%p", *arg_in_stack_slot(buf, gpointer)); break; case MONO_TYPE_I8: case MONO_TYPE_U8: - printf ("0x%016llx, ", (long long)*arg_in_stack_slot(buf, gint64)); + printf ("0x%016llx", (long long)*arg_in_stack_slot(buf, gint64)); break; case MONO_TYPE_R4: - printf ("%f, ", *arg_in_stack_slot(buf, float)); + printf ("%f", *arg_in_stack_slot(buf, float)); break; case MONO_TYPE_R8: - printf ("%f, ", *arg_in_stack_slot(buf, double)); + printf ("%f", *arg_in_stack_slot(buf, double)); break; case MONO_TYPE_VALUETYPE: { int j, size, align; @@ -278,12 +271,14 @@ mono_trace_enter_method (MonoMethod *method, MonoProfilerCallContext *ctx) printf ("["); for (j = 0; j < size; j++) printf ("%02x,", *((guint8*)buf +j)); - printf ("], "); + printf ("]"); break; } default: - printf ("XX, "); + printf ("XX"); } + if (i + 1 < sig->param_count) + printf (", "); mini_profiler_context_free_buffer (buf); } @@ -333,9 +328,17 @@ mono_trace_leave_method (MonoMethod *method, MonoProfilerCallContext *ctx) case MONO_TYPE_VOID: break; case MONO_TYPE_I1: - case MONO_TYPE_U1: + case MONO_TYPE_U1: { + gint8 res = *arg_in_stack_slot (buf, gint8); + printf ("result=%d", res); + break; + } case MONO_TYPE_I2: - case MONO_TYPE_U2: + case MONO_TYPE_U2: { + gint16 res = *arg_in_stack_slot (buf, gint16); + printf ("result=%d", res); + break; + } case MONO_TYPE_I4: case MONO_TYPE_U4: { int res = *arg_in_stack_slot (buf, int); diff --git a/mono/mini/tramp-amd64-gsharedvt.c b/mono/mini/tramp-amd64-gsharedvt.c index 9d2d5a5baa..c426c06495 100644 --- a/mono/mini/tramp-amd64-gsharedvt.c +++ b/mono/mini/tramp-amd64-gsharedvt.c @@ -170,15 +170,15 @@ gpointer mono_arch_get_gsharedvt_arg_trampoline (MonoDomain *domain, gpointer arg, gpointer addr) { guint8 *code, *start; - int buf_len; - buf_len = 32; + const int buf_len = 32; start = code = mono_domain_code_reserve (domain, buf_len); amd64_mov_reg_imm (code, AMD64_RAX, arg); amd64_jump_code (code, addr); - g_assert ((code - start) < buf_len); + + g_assertf ((code - start) <= buf_len, "%d %d", (int)(code - start), buf_len); mono_arch_flush_icache (start, code - start); MONO_PROFILER_RAISE (jit_code_buffer, (start, code - start, MONO_PROFILER_CODE_BUFFER_GENERICS_TRAMPOLINE, NULL)); @@ -494,7 +494,7 @@ mono_arch_get_gsharedvt_trampoline (MonoTrampInfo **info, gboolean aot) #endif amd64_ret (code); - g_assert ((code - buf) < buf_len); + g_assertf ((code - buf) <= buf_len, "%d %d", (int)(code - buf), buf_len); g_assert_checked (mono_arch_unwindinfo_validate_size (unwind_ops, MONO_MAX_TRAMPOLINE_UNWINDINFO_SIZE)); if (info) diff --git a/mono/mini/tramp-amd64.c b/mono/mini/tramp-amd64.c index f757c55664..b5c23964e9 100644 --- a/mono/mini/tramp-amd64.c +++ b/mono/mini/tramp-amd64.c @@ -52,11 +52,11 @@ mono_arch_get_unbox_trampoline (MonoMethod *m, gpointer addr) { guint8 *code, *start; GSList *unwind_ops; - int this_reg, size = 20; + const int size = 20; MonoDomain *domain = mono_domain_get (); - this_reg = mono_arch_get_this_arg_reg (NULL); + const int this_reg = mono_arch_get_this_arg_reg (NULL); start = code = (guint8 *)mono_domain_code_reserve (domain, size + MONO_TRAMPOLINE_UNWINDINFO_SIZE(0)); @@ -66,7 +66,7 @@ mono_arch_get_unbox_trampoline (MonoMethod *m, gpointer addr) /* FIXME: Optimize this */ amd64_mov_reg_imm (code, AMD64_RAX, addr); amd64_jump_reg (code, AMD64_RAX); - g_assert ((code - start) < size); + g_assertf ((code - start) <= size, "%d %d", (int)(code - start), size); g_assert_checked (mono_arch_unwindinfo_validate_size (unwind_ops, MONO_TRAMPOLINE_UNWINDINFO_SIZE(0))); mono_arch_flush_icache (start, code - start); @@ -107,7 +107,7 @@ mono_arch_get_static_rgctx_trampoline (gpointer arg, gpointer addr) amd64_mov_reg_imm (code, MONO_ARCH_RGCTX_REG, arg); amd64_jump_code (code, addr); - g_assert ((code - start) < buf_len); + g_assertf ((code - start) <= buf_len, "%d %d", (int)(code - start), buf_len); g_assert_checked (mono_arch_unwindinfo_validate_size (unwind_ops, MONO_TRAMPOLINE_UNWINDINFO_SIZE(0))); mono_arch_flush_icache (start, code - start); @@ -136,7 +136,12 @@ mono_arch_patch_callsite (guint8 *method_start, guint8 *orig_code, guint8 *addr) { guint8 *code; guint8 buf [16]; - gboolean can_write = mono_breakpoint_clean_code (method_start, orig_code, 14, buf, sizeof (buf)); + + // Since method_start is retrieved from function return address (below current call/jmp to patch) there is a case when + // last instruction of a function is the call (due to OP_NOT_REACHED) instruction and then directly followed by a + // different method. In that case current orig_code points into next method and method_start will also point into + // next method, not the method including the call to patch. For this specific case, fallback to using a method_start of NULL. + gboolean can_write = mono_breakpoint_clean_code (method_start != orig_code ? method_start : NULL, orig_code, 14, buf, sizeof (buf)); code = buf + 14; @@ -238,7 +243,7 @@ mono_arch_create_generic_trampoline (MonoTrampolineType tramp_type, MonoTrampInf gboolean has_caller; GSList *unwind_ops = NULL; MonoJumpInfo *ji = NULL; - const guint kMaxCodeSize = 630; + const int kMaxCodeSize = 630; if (tramp_type == MONO_TRAMPOLINE_JUMP) has_caller = FALSE; @@ -568,7 +573,7 @@ mono_arch_create_generic_trampoline (MonoTrampolineType tramp_type, MonoTrampInf amd64_jump_membase (code, AMD64_RSP, rax_offset - sizeof (target_mgreg_t)); } - g_assert ((code - buf) <= kMaxCodeSize); + g_assertf ((code - buf) <= kMaxCodeSize, "%d %d", code, buf, (int)(code - buf), kMaxCodeSize); g_assert_checked (mono_arch_unwindinfo_validate_size (unwind_ops, MONO_MAX_TRAMPOLINE_UNWINDINFO_SIZE)); mono_arch_flush_icache (buf, code - buf); @@ -639,7 +644,6 @@ mono_arch_create_rgctx_lazy_fetch_trampoline (guint32 slot, MonoTrampInfo **info guint8 *tramp; guint8 *code, *buf; guint8 **rgctx_null_jumps; - int tramp_size; int depth, index; int i; gboolean mrgctx; @@ -658,7 +662,7 @@ mono_arch_create_rgctx_lazy_fetch_trampoline (guint32 slot, MonoTrampInfo **info index -= size - 1; } - tramp_size = 64 + 8 * depth; + const int tramp_size = 64 + 8 * depth; code = buf = (guint8 *)mono_global_codeman_reserve (tramp_size + MONO_TRAMPOLINE_UNWINDINFO_SIZE(0)); @@ -725,7 +729,8 @@ mono_arch_create_rgctx_lazy_fetch_trampoline (guint32 slot, MonoTrampInfo **info mono_arch_flush_icache (buf, code - buf); MONO_PROFILER_RAISE (jit_code_buffer, (buf, code - buf, MONO_PROFILER_CODE_BUFFER_GENERICS_TRAMPOLINE, NULL)); - g_assert (code - buf <= tramp_size); + g_assertf ((code - buf) <= tramp_size, "%d %d", (int)(code - buf), tramp_size); + g_assert_checked (mono_arch_unwindinfo_validate_size (unwind_ops, MONO_TRAMPOLINE_UNWINDINFO_SIZE(0))); char *name = mono_get_rgctx_fetch_trampoline_name (slot); @@ -762,7 +767,8 @@ mono_arch_create_general_rgctx_lazy_fetch_trampoline (MonoTrampInfo **info, gboo mono_arch_flush_icache (buf, code - buf); MONO_PROFILER_RAISE (jit_code_buffer, (buf, code - buf, MONO_PROFILER_CODE_BUFFER_GENERICS_TRAMPOLINE, NULL)); - g_assert (code - buf <= tramp_size); + g_assertf ((code - buf) <= tramp_size, "%d %d", (int)(code - buf), tramp_size); + g_assert_checked (mono_arch_unwindinfo_validate_size (unwind_ops, MONO_TRAMPOLINE_UNWINDINFO_SIZE(0))); if (info) @@ -911,6 +917,8 @@ mono_arch_create_sdb_trampoline (gboolean single_step, MonoTrampInfo **info, gbo mono_add_unwind_op_def_cfa (unwind_ops, code, buf, AMD64_RSP, cfa_offset); amd64_ret (code); + g_assertf ((code - buf) <= tramp_size, "%d %d", (int)(code - buf), tramp_size); + mono_arch_flush_icache (code, code - buf); MONO_PROFILER_RAISE (jit_code_buffer, (buf, code - buf, MONO_PROFILER_CODE_BUFFER_HELPER, NULL)); g_assert (code - buf <= tramp_size); @@ -1026,7 +1034,8 @@ mono_arch_get_interp_to_native_trampoline (MonoTrampInfo **info) mono_add_unwind_op_def_cfa (unwind_ops, code, start, AMD64_RSP, cfa_offset); amd64_ret (code); - g_assert (code - start < buf_len); + g_assertf ((code - start) <= buf_len, "%d %d", (int)(code - start), buf_len); + g_assert_checked (mono_arch_unwindinfo_validate_size (unwind_ops, MONO_MAX_TRAMPOLINE_UNWINDINFO_SIZE)); mono_arch_flush_icache (start, code - start); @@ -1122,7 +1131,8 @@ mono_arch_get_native_to_interp_trampoline (MonoTrampInfo **info) mono_add_unwind_op_def_cfa (unwind_ops, code, start, AMD64_RSP, cfa_offset); amd64_ret (code); - g_assert (code - start < buf_len); + g_assertf ((code - start) <= buf_len, "%d %d", (int)(code - start), buf_len); + g_assert_checked (mono_arch_unwindinfo_validate_size (unwind_ops, MONO_MAX_TRAMPOLINE_UNWINDINFO_SIZE)); mono_arch_flush_icache (start, code - start); diff --git a/mono/mini/tramp-arm-gsharedvt.c b/mono/mini/tramp-arm-gsharedvt.c index f3465c2e9a..bf7ccdbdca 100644 --- a/mono/mini/tramp-arm-gsharedvt.c +++ b/mono/mini/tramp-arm-gsharedvt.c @@ -25,7 +25,7 @@ #ifdef MONO_ARCH_GSHAREDVT_SUPPORTED -static inline guint8* +static guint8* emit_bx (guint8* code, int reg) { if (mono_arm_thumb_supported ()) diff --git a/mono/mini/tramp-arm.c b/mono/mini/tramp-arm.c index a00dff6a3d..8ee4e4a673 100644 --- a/mono/mini/tramp-arm.c +++ b/mono/mini/tramp-arm.c @@ -112,7 +112,7 @@ branch_for_target_reachable (guint8 *branch, guint8 *target) return 0; } -static inline guint8* +static guint8* emit_bx (guint8* code, int reg) { if (mono_arm_thumb_supported ()) diff --git a/mono/mini/tramp-s390x.c b/mono/mini/tramp-s390x.c index 56f586a878..12d8aadf90 100644 --- a/mono/mini/tramp-s390x.c +++ b/mono/mini/tramp-s390x.c @@ -42,6 +42,7 @@ #include #include #include +#include #include #include "mini.h" diff --git a/mono/mini/tramp-x86-gsharedvt.c b/mono/mini/tramp-x86-gsharedvt.c index 5291b2ecaf..83f55eb115 100644 --- a/mono/mini/tramp-x86-gsharedvt.c +++ b/mono/mini/tramp-x86-gsharedvt.c @@ -349,7 +349,7 @@ mono_arch_get_gsharedvt_trampoline (MonoTrampInfo **info, gboolean aot) x86_leave (code); x86_ret_imm (code, 4); - g_assert ((code - buf) < buf_len); + g_assertf (code - buf <= buf_len, "%d %d", (int)(code - buf), buf_len); if (info) *info = mono_tramp_info_create ("gsharedvt_trampoline", buf, code - buf, ji, unwind_ops); diff --git a/mono/mini/tramp-x86.c b/mono/mini/tramp-x86.c index 76808b8f13..82a36d0cd6 100644 --- a/mono/mini/tramp-x86.c +++ b/mono/mini/tramp-x86.c @@ -51,7 +51,7 @@ mono_arch_get_unbox_trampoline (MonoMethod *m, gpointer addr) x86_alu_membase_imm (code, X86_ADD, X86_ESP, this_pos, MONO_ABI_SIZEOF (MonoObject)); x86_jump_code (code, addr); - g_assert ((code - start) < size); + g_assertf ((code - start) <= size, "%d %d", (int)(code - start), size); MONO_PROFILER_RAISE (jit_code_buffer, (start, code - start, MONO_PROFILER_CODE_BUFFER_UNBOX_TRAMPOLINE, m)); @@ -64,12 +64,11 @@ gpointer mono_arch_get_static_rgctx_trampoline (gpointer arg, gpointer addr) { guint8 *code, *start; - int buf_len; GSList *unwind_ops; MonoDomain *domain = mono_domain_get (); - buf_len = 10; + const int buf_len = 10; start = code = mono_domain_code_reserve (domain, buf_len); @@ -77,7 +76,7 @@ mono_arch_get_static_rgctx_trampoline (gpointer arg, gpointer addr) x86_mov_reg_imm (code, MONO_ARCH_RGCTX_REG, arg); x86_jump_code (code, addr); - g_assert ((code - start) <= buf_len); + g_assertf ((code - start) <= buf_len, "%d %d", (int)(code - start), buf_len); mono_arch_flush_icache (start, code - start); MONO_PROFILER_RAISE (jit_code_buffer, (start, code - start, MONO_PROFILER_CODE_BUFFER_GENERICS_TRAMPOLINE, NULL)); @@ -92,7 +91,12 @@ mono_arch_patch_callsite (guint8 *method_start, guint8 *orig_code, guint8 *addr) { guint8 *code; guint8 buf [8]; - gboolean can_write = mono_breakpoint_clean_code (method_start, orig_code, 8, buf, sizeof (buf)); + + // Since method_start is retrieved from function return address (below current call/jmp to patch) there is a case when + // last instruction of a function is the call (due to OP_NOT_REACHED) instruction and then directly followed by a + // different method. In that case current orig_code points into next method and method_start will also point into + // next method, not the method including the call to patch. For this specific case, fallback to using a method_start of NULL. + gboolean can_write = mono_breakpoint_clean_code (method_start != orig_code ? method_start : NULL, orig_code, 8, buf, sizeof (buf)); code = buf + 8; @@ -117,8 +121,9 @@ mono_arch_patch_callsite (guint8 *method_start, guint8 *orig_code, guint8 *addr) if (can_write) mono_atomic_xchg_i32 ((gint32*)(orig_code + 2), (guint)addr - ((guint)orig_code + 1) - 5); } else { - printf ("Invalid trampoline sequence: %x %x %x %x %x %x %x\n", code [0], code [1], code [2], code [3], - code [4], code [5], code [6]); + printf ("Invalid trampoline sequence: %x %x %x %x %x %x n", code [0], code [1], code [2], code [3], + code [4], code [5]); + g_assert_not_reached (); } } @@ -150,7 +155,9 @@ mono_arch_create_generic_trampoline (MonoTrampolineType tramp_type, MonoTrampInf int i, offset, frame_size, regarray_offset, lmf_offset, caller_ip_offset, arg_offset; int cfa_offset; /* cfa = cfa_reg + cfa_offset */ - code = buf = mono_global_codeman_reserve (256); + const int buf_len = 256; + + code = buf = mono_global_codeman_reserve (buf_len); /* Note that there is a single argument to the trampoline * and it is stored at: esp + pushed_args * sizeof (target_mgreg_t) @@ -379,7 +386,7 @@ mono_arch_create_generic_trampoline (MonoTrampolineType tramp_type, MonoTrampInf x86_ret (code); } - g_assert ((code - buf) <= 256); + g_assertf ((code - buf) <= buf_len, "%d %d", (int)(code - buf), buf_len); MONO_PROFILER_RAISE (jit_code_buffer, (buf, code - buf, MONO_PROFILER_CODE_BUFFER_HELPER, NULL)); tramp_name = mono_get_generic_trampoline_name (tramp_type); @@ -397,11 +404,13 @@ mono_arch_create_specific_trampoline (gpointer arg1, MonoTrampolineType tramp_ty tramp = mono_get_trampoline_code (tramp_type); - code = buf = mono_domain_code_reserve_align (domain, TRAMPOLINE_SIZE, 4); + const int size = TRAMPOLINE_SIZE; + + code = buf = mono_domain_code_reserve_align (domain, size, 4); x86_push_imm (buf, arg1); x86_jump_code (buf, tramp); - g_assert ((buf - code) <= TRAMPOLINE_SIZE); + g_assertf ((code - buf) <= size, "%d %d", (int)(code - buf), size); mono_arch_flush_icache (code, buf - code); MONO_PROFILER_RAISE (jit_code_buffer, (code, buf - code, MONO_PROFILER_CODE_BUFFER_SPECIFIC_TRAMPOLINE, mono_get_generic_trampoline_simple_name (tramp_type))); @@ -500,7 +509,7 @@ mono_arch_create_rgctx_lazy_fetch_trampoline (guint32 slot, MonoTrampInfo **info mono_arch_flush_icache (buf, code - buf); MONO_PROFILER_RAISE (jit_code_buffer, (buf, code - buf, MONO_PROFILER_CODE_BUFFER_GENERICS_TRAMPOLINE, NULL)); - g_assert (code - buf <= tramp_size); + g_assertf (code - buf <= tramp_size, "%d %d", (int)(code - buf), tramp_size); char *name = mono_get_rgctx_fetch_trampoline_name (slot); *info = mono_tramp_info_create (name, buf, code - buf, ji, unwind_ops); @@ -543,7 +552,7 @@ mono_arch_create_general_rgctx_lazy_fetch_trampoline (MonoTrampInfo **info, gboo mono_arch_flush_icache (buf, code - buf); MONO_PROFILER_RAISE (jit_code_buffer, (buf, code - buf, MONO_PROFILER_CODE_BUFFER_GENERICS_TRAMPOLINE, NULL)); - g_assert (code - buf <= tramp_size); + g_assertf (code - buf <= tramp_size, "%d %d", (int)(code - buf), tramp_size); *info = mono_tramp_info_create ("rgctx_fetch_trampoline_general", buf, code - buf, ji, unwind_ops); @@ -588,10 +597,9 @@ gpointer mono_arch_get_gsharedvt_arg_trampoline (MonoDomain *domain, gpointer arg, gpointer addr) { guint8 *code, *start; - int buf_len; GSList *unwind_ops; - buf_len = 10; + const int buf_len = 10; start = code = mono_domain_code_reserve (domain, buf_len); @@ -599,7 +607,7 @@ mono_arch_get_gsharedvt_arg_trampoline (MonoDomain *domain, gpointer arg, gpoint x86_mov_reg_imm (code, X86_EAX, arg); x86_jump_code (code, addr); - g_assert ((code - start) <= buf_len); + g_assertf ((code - start) <= buf_len, "%d %d", (int)(code - start), buf_len); mono_arch_flush_icache (start, code - start); MONO_PROFILER_RAISE (jit_code_buffer, (start, code - start, MONO_PROFILER_CODE_BUFFER_GENERICS_TRAMPOLINE, NULL)); @@ -703,7 +711,7 @@ mono_arch_create_sdb_trampoline (gboolean single_step, MonoTrampInfo **info, gbo mono_arch_flush_icache (code, code - buf); MONO_PROFILER_RAISE (jit_code_buffer, (buf, code - buf, MONO_PROFILER_CODE_BUFFER_HELPER, NULL)); - g_assert (code - buf <= tramp_size); + g_assertf (code - buf <= tramp_size, "%d %d", (int)(code - buf), tramp_size); const char *tramp_name = single_step ? "sdb_single_step_trampoline" : "sdb_breakpoint_trampoline"; *info = mono_tramp_info_create (tramp_name, buf, code - buf, ji, unwind_ops); diff --git a/mono/mini/type-checking.c b/mono/mini/type-checking.c index d00e0b2aae..8e3211f139 100644 --- a/mono/mini/type-checking.c +++ b/mono/mini/type-checking.c @@ -87,7 +87,7 @@ emit_castclass_with_cache (MonoCompile *cfg, MonoInst *obj, MonoClass *klass, in return res; } -static inline void +static void mini_emit_class_check_inst (MonoCompile *cfg, int klass_reg, MonoClass *klass, MonoInst *klass_inst) { if (klass_inst) { @@ -232,7 +232,7 @@ mini_emit_max_iid_check_class (MonoCompile *cfg, int klass_reg, MonoClass *klass mini_emit_max_iid_check (cfg, max_iid_reg, klass, false_target); } -static inline void +static void mini_emit_class_check_branch (MonoCompile *cfg, int klass_reg, MonoClass *klass, int branch_op, MonoBasicBlock *target) { if (cfg->compile_aot) { @@ -509,8 +509,8 @@ handle_castclass (MonoCompile *cfg, MonoClass *klass, MonoInst *src, int context if (!m_class_get_rank (klass) && !cfg->compile_aot && !(cfg->opt & MONO_OPT_SHARED) && mono_class_is_sealed (klass)) { /* the remoting code is broken, access the class for now */ if (0) { /*FIXME what exactly is broken? This change refers to r39380 from 2005 and mention some remoting fixes were due.*/ - MonoVTable *vt = mono_class_vtable_checked (cfg->domain, klass, &cfg->error); - if (!is_ok (&cfg->error)) { + MonoVTable *vt = mono_class_vtable_checked (cfg->domain, klass, cfg->error); + if (!is_ok (cfg->error)) { mono_cfg_set_exception (cfg, MONO_EXCEPTION_MONO_ERROR); return NULL; } @@ -730,8 +730,8 @@ handle_isinst (MonoCompile *cfg, MonoClass *klass, MonoInst *src, int context_us g_assert (!context_used); /* the remoting code is broken, access the class for now */ if (0) {/*FIXME what exactly is broken? This change refers to r39380 from 2005 and mention some remoting fixes were due.*/ - MonoVTable *vt = mono_class_vtable_checked (cfg->domain, klass, &cfg->error); - if (!is_ok (&cfg->error)) { + MonoVTable *vt = mono_class_vtable_checked (cfg->domain, klass, cfg->error); + if (!is_ok (cfg->error)) { mono_cfg_set_exception (cfg, MONO_EXCEPTION_MONO_ERROR); return NULL; } diff --git a/mono/mini/unwind.c b/mono/mini/unwind.c index c9b5c0a349..34f35daea8 100644 --- a/mono/mini/unwind.c +++ b/mono/mini/unwind.c @@ -251,7 +251,7 @@ encode_sleb128 (gint32 value, guint8 *buf, guint8 **endbuf) *endbuf = p; } -static inline guint32 +static guint32 decode_uleb128 (guint8 *buf, guint8 **endbuf) { guint8 *p = buf; @@ -273,7 +273,7 @@ decode_uleb128 (guint8 *buf, guint8 **endbuf) return res; } -static inline gint32 +static gint32 decode_sleb128 (guint8 *buf, guint8 **endbuf) { guint8 *p = buf; @@ -584,8 +584,14 @@ mono_unwind_frame (guint8 *unwind_info, guint32 unwind_info_len, p ++; break; case DW_CFA_offset: - hwreg = mono_dwarf_reg_to_hw_reg (*p & 0x3f); + reg = *p & 0x3f; p ++; + if (reg >= NUM_DWARF_REGS) { + /* Register we don't care about, like a caller save reg in a cold cconv */ + decode_uleb128 (p, &p); + break; + } + hwreg = mono_dwarf_reg_to_hw_reg (reg); reg_saved [hwreg] = TRUE; locations [hwreg].loc_type = LOC_OFFSET; locations [hwreg].offset = decode_uleb128 (p, &p) * DWARF_DATA_ALIGN; @@ -606,30 +612,29 @@ mono_unwind_frame (guint8 *unwind_info, guint32 unwind_info_len, break; case DW_CFA_offset_extended_sf: reg = decode_uleb128 (p, &p); - hwreg = mono_dwarf_reg_to_hw_reg (reg); offset = decode_sleb128 (p, &p); - if (reg >= NUM_DWARF_REGS) { - mono_runtime_printf_err ("Unwind failure. Assertion at %s %d\n.", __FILE__, __LINE__); - return FALSE; - } + if (reg >= NUM_DWARF_REGS) + break; + hwreg = mono_dwarf_reg_to_hw_reg (reg); reg_saved [hwreg] = TRUE; locations [hwreg].loc_type = LOC_OFFSET; locations [hwreg].offset = offset * DWARF_DATA_ALIGN; break; case DW_CFA_offset_extended: reg = decode_uleb128 (p, &p); - hwreg = mono_dwarf_reg_to_hw_reg (reg); offset = decode_uleb128 (p, &p); - if (reg >= NUM_DWARF_REGS) { - mono_runtime_printf_err ("Unwind failure. Assertion at %s %d\n.", __FILE__, __LINE__); - return FALSE; - } + if (reg >= NUM_DWARF_REGS) + break; + hwreg = mono_dwarf_reg_to_hw_reg (reg); reg_saved [hwreg] = TRUE; locations [hwreg].loc_type = LOC_OFFSET; locations [hwreg].offset = offset * DWARF_DATA_ALIGN; break; case DW_CFA_same_value: - hwreg = mono_dwarf_reg_to_hw_reg (decode_uleb128 (p, &p)); + reg = decode_uleb128 (p, &p); + if (reg >= NUM_DWARF_REGS) + break; + hwreg = mono_dwarf_reg_to_hw_reg (reg); locations [hwreg].loc_type = LOC_SAME; break; case DW_CFA_advance_loc1: diff --git a/mono/mini/version.h b/mono/mini/version.h index 005d9990b6..6862b58b61 100644 --- a/mono/mini/version.h +++ b/mono/mini/version.h @@ -1 +1 @@ -#define FULL_VERSION "explicit/bef1e63" +#define FULL_VERSION "explicit/77147e7" diff --git a/mono/native/Makefile.am b/mono/native/Makefile.am index 0861ed94ab..2237b25e5c 100644 --- a/mono/native/Makefile.am +++ b/mono/native/Makefile.am @@ -1,8 +1,10 @@ +if !ENABLE_MSVC_ONLY if MONO_NATIVE_COMPAT lib_LTLIBRARIES = libmono-native-compat.la libmono-native-unified.la else lib_LTLIBRARIES = libmono-native.la endif +endif # !ENABLE_MSVC_ONLY CC = $(MONO_NATIVE_CC) CCLD = $(MONO_NATIVE_CC) @@ -12,6 +14,8 @@ CXX = $(MONO_NATIVE_CXX) CXXCPP = $(MONO_NATIVE_CXX) -E CC_FOR_BUILD = $(MONO_NATIVE_CC) +if !ENABLE_MSVC_ONLY + common_sources = \ pal_config.h \ mono-native-platform.h \ @@ -73,6 +77,8 @@ aix_sources = $(unix_sources) freebsd_sources = $(unix_sources) +netbsd_sources = $(unix_sources) + haiku_sources = $(unix_sources) android_sources = \ @@ -110,9 +116,10 @@ if ENABLE_GSS macos_sources += $(gss_sources) linux_sources += $(gss_sources) ios_sources += $(gss_sources) +android_sources += $(gss_sources) endif -EXTRA_libmono_native_la_SOURCES = $(common_sources) $(macos_sources) $(ios_sources) $(linux_sources) $(aix_sources) $(freebsd_sources) $(haiku_sources) $(unix_sources) $(gss_sources) +EXTRA_libmono_native_la_SOURCES = $(common_sources) $(macos_sources) $(ios_sources) $(linux_sources) $(aix_sources) $(freebsd_sources) $(netbsd_sources) $(haiku_sources) $(unix_sources) $(gss_sources) if MONO_NATIVE_PLATFORM_MACOS platform_sources = $(macos_sources) @@ -132,6 +139,9 @@ else if MONO_NATIVE_PLATFORM_FREEBSD platform_sources = $(freebsd_sources) else +if MONO_NATIVE_PLATFORM_NETBSD +platform_sources = $(netbsd_sources) +else if MONO_NATIVE_PLATFORM_HAIKU platform_sources = $(haiku_sources) endif @@ -141,6 +151,7 @@ endif endif endif endif +endif common_cppflags = -I$(top_srcdir) -I$(top_srcdir)/mono @@ -153,6 +164,8 @@ common_cflags = \ -DBROTLI_BUILD_NO_RBIT \ -Wno-typedef-redefinition +endif # !ENABLE_MSVC_ONLY + # clear these flags as we set values for each target separately and automake always appends CFLAGS CFLAGS= CPPFLAGS= @@ -160,6 +173,8 @@ CXXFLAGS= LDFLAGS= CCASFLAGS= +if !ENABLE_MSVC_ONLY + libmono_native_la_SOURCES = $(common_sources) $(platform_sources) platform-type.c libmono_native_la_CFLAGS = $(MONO_NATIVE_CFLAGS) $(common_cflags) @@ -205,3 +220,5 @@ libmono_native_unified_la_LIBADD = $(MONO_NATIVE_LIBADD) test-bundle-local: mkdir -p $(TEST_BUNDLE_PATH) cp -L .libs/libmono-native$(libsuffix) $(TEST_BUNDLE_PATH)/ + +endif # !ENABLE_MSVC_ONLY diff --git a/mono/native/Makefile.in.REMOVED.git-id b/mono/native/Makefile.in.REMOVED.git-id index d63ec567d9..0fa42d6770 100644 --- a/mono/native/Makefile.in.REMOVED.git-id +++ b/mono/native/Makefile.in.REMOVED.git-id @@ -1 +1 @@ -0b394286f326b2b950382465c8f0c9321d6e55ef \ No newline at end of file +4b24fc6bdea298582a965b2ade2a00d155a3686a \ No newline at end of file diff --git a/mono/native/mono-native-platform.h b/mono/native/mono-native-platform.h index 88fca70da7..c9575da293 100644 --- a/mono/native/mono-native-platform.h +++ b/mono/native/mono-native-platform.h @@ -13,6 +13,7 @@ typedef enum { MONO_NATIVE_PLATFORM_TYPE_ANDROID = 5, MONO_NATIVE_PLATFORM_TYPE_FREEBSD = 6, MONO_NATIVE_PLATFORM_TYPE_HAIKU = 7, + MONO_NATIVE_PLATFORM_TYPE_NETBSD = 8, MONO_NATIVE_PLATFORM_TYPE_IPHONE = 0x100, MONO_NATIVE_PLATFORM_TYPE_TV = 0x200, diff --git a/mono/profiler/Makefile.am b/mono/profiler/Makefile.am index 22458c3dc8..bf7e879468 100644 --- a/mono/profiler/Makefile.am +++ b/mono/profiler/Makefile.am @@ -147,12 +147,26 @@ mprof_report_SOURCES = mprof-report.c mprof_report_LDADD = $(glib_libs) $(zlib_dep) mprof_report_LDFLAGS = -no-undefined +noinst_LTLIBRARIES = libproftest_pinvokes.la + +libproftest_pinvokes_la_SOURCES = proftest-pinvokes.c +if HOST_WIN32 +# (borrowed from mono/tests/Makefile.am libtest_la_LDFLAGS) +# the exported names created by gcc for stdcall functions are missing the leading _, so MS.NET +# can't find them. So we use --kill-at to remove the @ suffix as well. +libproftest_pinvokes_la_LDFLAGS = -no-undefined -rpath `pwd` -Wl,--kill-at +else +libproftest_pinvokes_la_LDFLAGS = -no-undefined -rpath `pwd` +endif + + PLOG_TESTS_SRC = \ test-alloc.cs \ test-busy.cs \ test-monitor.cs \ test-excleave.cs \ test-heapshot.cs \ + test-pinvokes.cs \ test-traces.cs PLOG_TESTS = $(PLOG_TESTS_SRC:.cs=.exe) @@ -164,12 +178,15 @@ MCS = $(TOOLS_RUNTIME) $(CSC) -lib:$(CLASS) -unsafe -nologo -noconfig -nowarn:01 %.exe: %.cs $(MCS) -out:$@ $< +test-pinvokes.exe: libproftest_pinvokes.la + test-local: $(PLOG_TESTS) test-bundle-local: mkdir -p $(TEST_BUNDLE_PATH)/tests/profiler/ cp -L .libs/libmono-profiler-log$(libsuffix) $(TEST_BUNDLE_PATH)/ cp -L $(PLOG_TESTS) $(TEST_BUNDLE_PATH)/tests/profiler/ + cp -L .libs/libproftest_pinvokes$(libsuffix) $(TEST_BUNDLE_PATH)/tests/profiler/ cp -L ptestrunner.pl $(TEST_BUNDLE_PATH)/tests/profiler/ cp -L mprof-report $(TEST_BUNDLE_PATH)/ chmod +x $(TEST_BUNDLE_PATH)/mprof-report diff --git a/mono/profiler/Makefile.in b/mono/profiler/Makefile.in index ff4f920cdc..ad3de6745c 100644 --- a/mono/profiler/Makefile.in +++ b/mono/profiler/Makefile.in @@ -141,7 +141,7 @@ am__uninstall_files_from_dir = { \ } am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" \ "$(DESTDIR)$(suppressiondir)" -LTLIBRARIES = $(lib_LTLIBRARIES) +LTLIBRARIES = $(lib_LTLIBRARIES) $(noinst_LTLIBRARIES) libmono_profiler_aot_static_la_LIBADD = am_libmono_profiler_aot_static_la_OBJECTS = aot.lo helper.lo libmono_profiler_aot_static_la_OBJECTS = \ @@ -245,6 +245,14 @@ libmono_profiler_vtune_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(libmono_profiler_vtune_la_LDFLAGS) $(LDFLAGS) -o $@ @DISABLE_LIBRARIES_FALSE@@DISABLE_PROFILER_FALSE@@HAVE_VTUNE_TRUE@@HOST_WIN32_FALSE@am_libmono_profiler_vtune_la_rpath = -rpath \ @DISABLE_LIBRARIES_FALSE@@DISABLE_PROFILER_FALSE@@HAVE_VTUNE_TRUE@@HOST_WIN32_FALSE@ $(libdir) +libproftest_pinvokes_la_LIBADD = +am_libproftest_pinvokes_la_OBJECTS = proftest-pinvokes.lo +libproftest_pinvokes_la_OBJECTS = \ + $(am_libproftest_pinvokes_la_OBJECTS) +libproftest_pinvokes_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(AM_CFLAGS) $(CFLAGS) $(libproftest_pinvokes_la_LDFLAGS) \ + $(LDFLAGS) -o $@ PROGRAMS = $(bin_PROGRAMS) am_mprof_report_OBJECTS = mprof-report.$(OBJEXT) mprof_report_OBJECTS = $(am_mprof_report_OBJECTS) @@ -289,7 +297,8 @@ SOURCES = $(libmono_profiler_aot_static_la_SOURCES) \ $(libmono_profiler_log_static_la_SOURCES) \ $(libmono_profiler_log_la_SOURCES) \ $(libmono_profiler_vtune_static_la_SOURCES) \ - $(libmono_profiler_vtune_la_SOURCES) $(mprof_report_SOURCES) + $(libmono_profiler_vtune_la_SOURCES) \ + $(libproftest_pinvokes_la_SOURCES) $(mprof_report_SOURCES) DIST_SOURCES = $(libmono_profiler_aot_static_la_SOURCES) \ $(libmono_profiler_aot_la_SOURCES) \ $(libmono_profiler_coverage_static_la_SOURCES) \ @@ -298,7 +307,7 @@ DIST_SOURCES = $(libmono_profiler_aot_static_la_SOURCES) \ $(libmono_profiler_log_la_SOURCES) \ $(am__libmono_profiler_vtune_static_la_SOURCES_DIST) \ $(am__libmono_profiler_vtune_la_SOURCES_DIST) \ - $(mprof_report_SOURCES) + $(libproftest_pinvokes_la_SOURCES) $(mprof_report_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ @@ -411,6 +420,7 @@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTERP_CFLAGS = @INTERP_CFLAGS@ INTL = @INTL@ INVARIANT_AOT_OPTIONS = @INVARIANT_AOT_OPTIONS@ JEMALLOC_AUTOCONF_FLAGS = @JEMALLOC_AUTOCONF_FLAGS@ @@ -695,12 +705,20 @@ libmono_profiler_coverage_static_la_LDFLAGS = -static mprof_report_SOURCES = mprof-report.c mprof_report_LDADD = $(glib_libs) $(zlib_dep) mprof_report_LDFLAGS = -no-undefined +noinst_LTLIBRARIES = libproftest_pinvokes.la +libproftest_pinvokes_la_SOURCES = proftest-pinvokes.c +@HOST_WIN32_FALSE@libproftest_pinvokes_la_LDFLAGS = -no-undefined -rpath `pwd` +# (borrowed from mono/tests/Makefile.am libtest_la_LDFLAGS) +# the exported names created by gcc for stdcall functions are missing the leading _, so MS.NET +# can't find them. So we use --kill-at to remove the @ suffix as well. +@HOST_WIN32_TRUE@libproftest_pinvokes_la_LDFLAGS = -no-undefined -rpath `pwd` -Wl,--kill-at PLOG_TESTS_SRC = \ test-alloc.cs \ test-busy.cs \ test-monitor.cs \ test-excleave.cs \ test-heapshot.cs \ + test-pinvokes.cs \ test-traces.cs PLOG_TESTS = $(PLOG_TESTS_SRC:.cs=.exe) @@ -785,6 +803,17 @@ clean-libLTLIBRARIES: rm -f $${locs}; \ } +clean-noinstLTLIBRARIES: + -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) + @list='$(noinst_LTLIBRARIES)'; \ + locs=`for p in $$list; do echo $$p; done | \ + sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ + sort -u`; \ + test -z "$$locs" || { \ + echo rm -f $${locs}; \ + rm -f $${locs}; \ + } + libmono-profiler-aot-static.la: $(libmono_profiler_aot_static_la_OBJECTS) $(libmono_profiler_aot_static_la_DEPENDENCIES) $(EXTRA_libmono_profiler_aot_static_la_DEPENDENCIES) $(AM_V_CCLD)$(libmono_profiler_aot_static_la_LINK) $(am_libmono_profiler_aot_static_la_rpath) $(libmono_profiler_aot_static_la_OBJECTS) $(libmono_profiler_aot_static_la_LIBADD) $(LIBS) @@ -808,6 +837,9 @@ libmono-profiler-vtune-static.la: $(libmono_profiler_vtune_static_la_OBJECTS) $( libmono-profiler-vtune.la: $(libmono_profiler_vtune_la_OBJECTS) $(libmono_profiler_vtune_la_DEPENDENCIES) $(EXTRA_libmono_profiler_vtune_la_DEPENDENCIES) $(AM_V_CCLD)$(libmono_profiler_vtune_la_LINK) $(am_libmono_profiler_vtune_la_rpath) $(libmono_profiler_vtune_la_OBJECTS) $(libmono_profiler_vtune_la_LIBADD) $(LIBS) + +libproftest_pinvokes.la: $(libproftest_pinvokes_la_OBJECTS) $(libproftest_pinvokes_la_DEPENDENCIES) $(EXTRA_libproftest_pinvokes_la_DEPENDENCIES) + $(AM_V_CCLD)$(libproftest_pinvokes_la_LINK) $(libproftest_pinvokes_la_OBJECTS) $(libproftest_pinvokes_la_LIBADD) $(LIBS) install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ @@ -876,27 +908,25 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/log-args.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/log.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mprof-report.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/proftest-pinvokes.Plo@am__quote@ .c.o: -@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ -@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: -@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ -@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: -@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ -@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ -@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< @@ -1069,7 +1099,7 @@ maintainer-clean-generic: clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libLTLIBRARIES \ - clean-libtool mostlyclean-am + clean-libtool clean-noinstLTLIBRARIES mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) @@ -1150,21 +1180,21 @@ uninstall-am: uninstall-binPROGRAMS uninstall-libLTLIBRARIES \ .PHONY: CTAGS GTAGS TAGS all all-am check check-am check-local clean \ clean-binPROGRAMS clean-generic clean-libLTLIBRARIES \ - clean-libtool cscopelist-am ctags ctags-am distclean \ - distclean-compile distclean-generic distclean-libtool \ - distclean-tags distdir dvi dvi-am html html-am info info-am \ - install install-am install-binPROGRAMS install-data \ - install-data-am install-dvi install-dvi-am install-exec \ - install-exec-am install-html install-html-am install-info \ - install-info-am install-libLTLIBRARIES install-man install-pdf \ - install-pdf-am install-ps install-ps-am install-strip \ - install-suppressionDATA installcheck installcheck-am \ - installdirs maintainer-clean maintainer-clean-generic \ - mostlyclean mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am test-am \ - test-bundle-am test-bundle-local test-local uninstall \ - uninstall-am uninstall-binPROGRAMS uninstall-libLTLIBRARIES \ - uninstall-suppressionDATA + clean-libtool clean-noinstLTLIBRARIES cscopelist-am ctags \ + ctags-am distclean distclean-compile distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-binPROGRAMS \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-libLTLIBRARIES \ + install-man install-pdf install-pdf-am install-ps \ + install-ps-am install-strip install-suppressionDATA \ + installcheck installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags tags-am test-am test-bundle-am test-bundle-local \ + test-local uninstall uninstall-am uninstall-binPROGRAMS \ + uninstall-libLTLIBRARIES uninstall-suppressionDATA .PRECIOUS: Makefile @@ -1172,12 +1202,15 @@ uninstall-am: uninstall-binPROGRAMS uninstall-libLTLIBRARIES \ %.exe: %.cs $(MCS) -out:$@ $< +test-pinvokes.exe: libproftest_pinvokes.la + test-local: $(PLOG_TESTS) test-bundle-local: mkdir -p $(TEST_BUNDLE_PATH)/tests/profiler/ cp -L .libs/libmono-profiler-log$(libsuffix) $(TEST_BUNDLE_PATH)/ cp -L $(PLOG_TESTS) $(TEST_BUNDLE_PATH)/tests/profiler/ + cp -L .libs/libproftest_pinvokes$(libsuffix) $(TEST_BUNDLE_PATH)/tests/profiler/ cp -L ptestrunner.pl $(TEST_BUNDLE_PATH)/tests/profiler/ cp -L mprof-report $(TEST_BUNDLE_PATH)/ chmod +x $(TEST_BUNDLE_PATH)/mprof-report diff --git a/mono/profiler/aot.c b/mono/profiler/aot.c index 7340cd40e1..d919dda273 100644 --- a/mono/profiler/aot.c +++ b/mono/profiler/aot.c @@ -215,14 +215,7 @@ helper_thread (void *arg) { mono_thread_attach (mono_get_root_domain ()); - MonoInternalThread *internal = mono_thread_internal_current (); - - ERROR_DECL (error); - - MonoString *name_str = mono_string_new_checked (mono_get_root_domain (), "AOT Profiler Helper", error); - mono_error_assert_ok (error); - mono_thread_set_name_internal (internal, name_str, MonoSetThreadNameFlag_None, error); - mono_error_assert_ok (error); + mono_thread_set_name_constant_ignore_error (mono_thread_internal_current (), "AOT Profiler Helper", MonoSetThreadNameFlag_None); mono_thread_info_set_flags (MONO_THREAD_INFO_FLAGS_NO_GC | MONO_THREAD_INFO_FLAGS_NO_SAMPLE); @@ -593,7 +586,7 @@ add_method (MonoProfiler *prof, MonoMethod *m) char *s; sig = mono_method_signature_checked (m, error); - g_assert (mono_error_ok (error)); + g_assert (is_ok (error)); int class_id = add_class (prof, m->klass); if (class_id == -1) diff --git a/mono/profiler/log.c.REMOVED.git-id b/mono/profiler/log.c.REMOVED.git-id index d41ba7cdce..b3d069b0eb 100644 --- a/mono/profiler/log.c.REMOVED.git-id +++ b/mono/profiler/log.c.REMOVED.git-id @@ -1 +1 @@ -db43a87070043122a13d94501e2d1469cf0e63a3 \ No newline at end of file +19c1ec6d1accda1d91966fe36c2d93a06a02901e \ No newline at end of file diff --git a/mono/profiler/mprof-report.c.REMOVED.git-id b/mono/profiler/mprof-report.c.REMOVED.git-id index 98703befd2..5b9ce35d8e 100644 --- a/mono/profiler/mprof-report.c.REMOVED.git-id +++ b/mono/profiler/mprof-report.c.REMOVED.git-id @@ -1 +1 @@ -8e689f171d17222547a469d02aae677ab47bf5d4 \ No newline at end of file +48f89ca59555527d21d782cb4a475055ed041a88 \ No newline at end of file diff --git a/mono/profiler/proftest-pinvokes.c b/mono/profiler/proftest-pinvokes.c new file mode 100644 index 0000000000..85e2a8719b --- /dev/null +++ b/mono/profiler/proftest-pinvokes.c @@ -0,0 +1,40 @@ +#include + +#include + +#ifdef __cplusplus +extern "C" { +#endif + + +#ifdef WIN32 +#define STDCALL __stdcall +#else +#define STDCALL +#endif + +#if defined(WIN32) && defined (_MSC_VER) +#define LIBTEST_API __declspec(dllexport) +#elif defined(__GNUC__) +#define LIBTEST_API __attribute__ ((__visibility__ ("default"))) +#else +#define LIBTEST_API +#endif + +typedef void (STDCALL *fn_ptr) (void); + +LIBTEST_API void STDCALL +test_reverse_pinvoke (fn_ptr p); + +#ifdef __cplusplus +} +#endif + + + +void STDCALL +test_reverse_pinvoke (fn_ptr p) +{ + printf ("testfunc called\n"); + p (); +} diff --git a/mono/profiler/ptestrunner.pl b/mono/profiler/ptestrunner.pl index 01f0e7e10a..632aead4a0 100755 --- a/mono/profiler/ptestrunner.pl +++ b/mono/profiler/ptestrunner.pl @@ -31,7 +31,7 @@ if ($builddir eq "out-of-tree") { $mprofreportdir = dirname ($monosgen); } else { $monosgen = "$builddir/mono/mini/mono-sgen"; - $profmoduledir = "$builddir/mono/mini/.libs"; + $profmoduledir = "$builddir/mono/profiler/.libs"; $mprofreportdir = "$builddir/mono/profiler"; } @@ -80,6 +80,12 @@ check_report_calls ($report, "T:Main (string[])" => 1, "T:throw_ex ()" => 1000); check_report_exceptions ($report, 1000, 1000, 1000); report_errors (); add_xml_testcase_result (); +# test native-to-managed and managed-to-native wrappers +$report = run_test ("test-pinvokes.exe", "report,calls"); +check_report_basics ($report); +check_report_calls ($report, "(wrapper managed-to-native) T:test_reverse_pinvoke (System.Action)" => 1, "(wrapper native-to-managed) T:CallBack ()" => 1, "T:CallBack ()" => 1); +report_errors (); +add_xml_testcase_result (); # test heapshot $report = run_test ("test-heapshot.exe", "report,heapshot,legacy"); if ($report ne "missing binary") { diff --git a/mono/profiler/test-pinvokes.cs b/mono/profiler/test-pinvokes.cs new file mode 100644 index 0000000000..c476d55db9 --- /dev/null +++ b/mono/profiler/test-pinvokes.cs @@ -0,0 +1,38 @@ +using System; +using System.Runtime.InteropServices; +using System.Runtime.CompilerServices; + +public class MonoPInvokeCallbackAttribute : Attribute { + public MonoPInvokeCallbackAttribute (Type delegateType) { } +} + +public class T { + private static bool fired; + + [MonoPInvokeCallback (typeof (Action))] + private static void CallBack () + { + Console.WriteLine ("Called back"); + fired = true; + } + + [DllImport ("proftest_pinvokes", EntryPoint="test_reverse_pinvoke")] + private static extern void test_reverse_pinvoke (Action cb); + + + public static int Main () + { + Helper (); + if (fired) + return 0; + else + return 1; + } + + + [MethodImpl (MethodImplOptions.NoInlining)] + private static void Helper () + { + test_reverse_pinvoke (new Action (CallBack)); + } +} diff --git a/mono/sgen/Makefile.am b/mono/sgen/Makefile.am index e52897a9ed..ab65207c09 100644 --- a/mono/sgen/Makefile.am +++ b/mono/sgen/Makefile.am @@ -1,5 +1,7 @@ include $(top_srcdir)/mk/common.mk +if !ENABLE_MSVC_ONLY + AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/mono $(LIBGC_CPPFLAGS) $(GLIB_CFLAGS) $(SHARED_CFLAGS) if SUPPORT_SGEN @@ -64,4 +66,18 @@ monosgen_sources = \ libmonosgen_la_SOURCES = $(monosgen_sources) libmonosgen_la_CFLAGS = $(SGEN_DEFINES) +endif # !ENABLE_MSVC_ONLY + CFLAGS := $(filter-out @CXX_REMOVE_CFLAGS@, @CFLAGS@) @CXX_ADD_CFLAGS@ + +if ENABLE_MSVC_ONLY + +all-local: + + make -C $(top_srcdir)/msvc libgcmonosgen + +clean-local: + + make -C $(top_srcdir)/msvc clean-libgcmonosgen + +endif # ENABLE_MSVC_ONLY diff --git a/mono/sgen/Makefile.in b/mono/sgen/Makefile.in index 7a2914313b..10e4d520ad 100644 --- a/mono/sgen/Makefile.in +++ b/mono/sgen/Makefile.in @@ -111,27 +111,49 @@ CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libmonosgen_la_LIBADD = -am__objects_1 = libmonosgen_la-sgen-alloc.lo \ - libmonosgen_la-sgen-cardtable.lo libmonosgen_la-sgen-debug.lo \ - libmonosgen_la-sgen-descriptor.lo \ - libmonosgen_la-sgen-fin-weak-hash.lo libmonosgen_la-sgen-gc.lo \ - libmonosgen_la-sgen-gchandles.lo libmonosgen_la-sgen-gray.lo \ - libmonosgen_la-sgen-hash-table.lo \ - libmonosgen_la-sgen-internal.lo \ - libmonosgen_la-sgen-layout-stats.lo libmonosgen_la-sgen-los.lo \ - libmonosgen_la-sgen-marksweep.lo \ - libmonosgen_la-sgen-memory-governor.lo \ - libmonosgen_la-sgen-nursery-allocator.lo \ - libmonosgen_la-sgen-pinning-stats.lo \ - libmonosgen_la-sgen-pinning.lo \ - libmonosgen_la-sgen-pointer-queue.lo \ - libmonosgen_la-sgen-array-list.lo \ - libmonosgen_la-sgen-protocol.lo libmonosgen_la-sgen-qsort.lo \ - libmonosgen_la-sgen-simple-nursery.lo \ - libmonosgen_la-sgen-split-nursery.lo \ - libmonosgen_la-sgen-thread-pool.lo \ - libmonosgen_la-sgen-workers.lo -am_libmonosgen_la_OBJECTS = $(am__objects_1) +am__libmonosgen_la_SOURCES_DIST = gc-internal-agnostic.h sgen-alloc.c \ + sgen-archdep.h sgen-cardtable.c sgen-cardtable.h sgen-client.h \ + sgen-conf.h sgen-copy-object.h sgen-debug.c sgen-descriptor.c \ + sgen-descriptor.h sgen-fin-weak-hash.c sgen-gc.c sgen-gc.h \ + sgen-gchandles.c sgen-gray.c sgen-gray.h sgen-hash-table.c \ + sgen-hash-table.h sgen-internal.c sgen-layout-stats.c \ + sgen-layout-stats.h sgen-los.c sgen-major-copy-object.h \ + sgen-marksweep-drain-gray-stack.h sgen-marksweep.c \ + sgen-memory-governor.c sgen-memory-governor.h \ + sgen-minor-copy-object.h sgen-minor-scan-object.h \ + sgen-nursery-allocator.c sgen-pinning-stats.c sgen-pinning.c \ + sgen-pinning.h sgen-pointer-queue.c sgen-pointer-queue.h \ + sgen-array-list.h sgen-array-list.c sgen-protocol-def.h \ + sgen-protocol.c sgen-protocol.h sgen-qsort.c sgen-qsort.h \ + sgen-scan-object.h sgen-simple-nursery.c sgen-split-nursery.c \ + sgen-tagged-pointer.h sgen-thread-pool.c sgen-thread-pool.h \ + sgen-workers.c sgen-workers.h +@ENABLE_MSVC_ONLY_FALSE@am__objects_1 = libmonosgen_la-sgen-alloc.lo \ +@ENABLE_MSVC_ONLY_FALSE@ libmonosgen_la-sgen-cardtable.lo \ +@ENABLE_MSVC_ONLY_FALSE@ libmonosgen_la-sgen-debug.lo \ +@ENABLE_MSVC_ONLY_FALSE@ libmonosgen_la-sgen-descriptor.lo \ +@ENABLE_MSVC_ONLY_FALSE@ libmonosgen_la-sgen-fin-weak-hash.lo \ +@ENABLE_MSVC_ONLY_FALSE@ libmonosgen_la-sgen-gc.lo \ +@ENABLE_MSVC_ONLY_FALSE@ libmonosgen_la-sgen-gchandles.lo \ +@ENABLE_MSVC_ONLY_FALSE@ libmonosgen_la-sgen-gray.lo \ +@ENABLE_MSVC_ONLY_FALSE@ libmonosgen_la-sgen-hash-table.lo \ +@ENABLE_MSVC_ONLY_FALSE@ libmonosgen_la-sgen-internal.lo \ +@ENABLE_MSVC_ONLY_FALSE@ libmonosgen_la-sgen-layout-stats.lo \ +@ENABLE_MSVC_ONLY_FALSE@ libmonosgen_la-sgen-los.lo \ +@ENABLE_MSVC_ONLY_FALSE@ libmonosgen_la-sgen-marksweep.lo \ +@ENABLE_MSVC_ONLY_FALSE@ libmonosgen_la-sgen-memory-governor.lo \ +@ENABLE_MSVC_ONLY_FALSE@ libmonosgen_la-sgen-nursery-allocator.lo \ +@ENABLE_MSVC_ONLY_FALSE@ libmonosgen_la-sgen-pinning-stats.lo \ +@ENABLE_MSVC_ONLY_FALSE@ libmonosgen_la-sgen-pinning.lo \ +@ENABLE_MSVC_ONLY_FALSE@ libmonosgen_la-sgen-pointer-queue.lo \ +@ENABLE_MSVC_ONLY_FALSE@ libmonosgen_la-sgen-array-list.lo \ +@ENABLE_MSVC_ONLY_FALSE@ libmonosgen_la-sgen-protocol.lo \ +@ENABLE_MSVC_ONLY_FALSE@ libmonosgen_la-sgen-qsort.lo \ +@ENABLE_MSVC_ONLY_FALSE@ libmonosgen_la-sgen-simple-nursery.lo \ +@ENABLE_MSVC_ONLY_FALSE@ libmonosgen_la-sgen-split-nursery.lo \ +@ENABLE_MSVC_ONLY_FALSE@ libmonosgen_la-sgen-thread-pool.lo \ +@ENABLE_MSVC_ONLY_FALSE@ libmonosgen_la-sgen-workers.lo +@ENABLE_MSVC_ONLY_FALSE@am_libmonosgen_la_OBJECTS = $(am__objects_1) libmonosgen_la_OBJECTS = $(am_libmonosgen_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) @@ -141,7 +163,7 @@ libmonosgen_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(libmonosgen_la_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o \ $@ -@SUPPORT_SGEN_TRUE@am_libmonosgen_la_rpath = +@ENABLE_MSVC_ONLY_FALSE@@SUPPORT_SGEN_TRUE@am_libmonosgen_la_rpath = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false @@ -173,7 +195,7 @@ am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libmonosgen_la_SOURCES) -DIST_SOURCES = $(libmonosgen_la_SOURCES) +DIST_SOURCES = $(am__libmonosgen_la_SOURCES_DIST) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ @@ -285,6 +307,7 @@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTERP_CFLAGS = @INTERP_CFLAGS@ INTL = @INTL@ INVARIANT_AOT_OPTIONS = @INVARIANT_AOT_OPTIONS@ JEMALLOC_AUTOCONF_FLAGS = @JEMALLOC_AUTOCONF_FLAGS@ @@ -474,64 +497,64 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MAKEFLAGS := $(MAKEFLAGS) --no-builtin-rules -AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/mono $(LIBGC_CPPFLAGS) $(GLIB_CFLAGS) $(SHARED_CFLAGS) -@SUPPORT_SGEN_TRUE@shared_libraries = libmonosgen.la -noinst_LTLIBRARIES = $(shared_libraries) -monosgen_sources = \ - gc-internal-agnostic.h \ - sgen-alloc.c \ - sgen-archdep.h \ - sgen-cardtable.c \ - sgen-cardtable.h \ - sgen-client.h \ - sgen-conf.h \ - sgen-copy-object.h \ - sgen-debug.c \ - sgen-descriptor.c \ - sgen-descriptor.h \ - sgen-fin-weak-hash.c \ - sgen-gc.c \ - sgen-gc.h \ - sgen-gchandles.c \ - sgen-gray.c \ - sgen-gray.h \ - sgen-hash-table.c \ - sgen-hash-table.h \ - sgen-internal.c \ - sgen-layout-stats.c \ - sgen-layout-stats.h \ - sgen-los.c \ - sgen-major-copy-object.h \ - sgen-marksweep-drain-gray-stack.h \ - sgen-marksweep.c \ - sgen-memory-governor.c \ - sgen-memory-governor.h \ - sgen-minor-copy-object.h \ - sgen-minor-scan-object.h \ - sgen-nursery-allocator.c \ - sgen-pinning-stats.c \ - sgen-pinning.c \ - sgen-pinning.h \ - sgen-pointer-queue.c \ - sgen-pointer-queue.h \ - sgen-array-list.h \ - sgen-array-list.c \ - sgen-protocol-def.h \ - sgen-protocol.c \ - sgen-protocol.h \ - sgen-qsort.c \ - sgen-qsort.h \ - sgen-scan-object.h \ - sgen-simple-nursery.c \ - sgen-split-nursery.c \ - sgen-tagged-pointer.h \ - sgen-thread-pool.c \ - sgen-thread-pool.h \ - sgen-workers.c \ - sgen-workers.h +@ENABLE_MSVC_ONLY_FALSE@AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/mono $(LIBGC_CPPFLAGS) $(GLIB_CFLAGS) $(SHARED_CFLAGS) +@ENABLE_MSVC_ONLY_FALSE@@SUPPORT_SGEN_TRUE@shared_libraries = libmonosgen.la +@ENABLE_MSVC_ONLY_FALSE@noinst_LTLIBRARIES = $(shared_libraries) +@ENABLE_MSVC_ONLY_FALSE@monosgen_sources = \ +@ENABLE_MSVC_ONLY_FALSE@ gc-internal-agnostic.h \ +@ENABLE_MSVC_ONLY_FALSE@ sgen-alloc.c \ +@ENABLE_MSVC_ONLY_FALSE@ sgen-archdep.h \ +@ENABLE_MSVC_ONLY_FALSE@ sgen-cardtable.c \ +@ENABLE_MSVC_ONLY_FALSE@ sgen-cardtable.h \ +@ENABLE_MSVC_ONLY_FALSE@ sgen-client.h \ +@ENABLE_MSVC_ONLY_FALSE@ sgen-conf.h \ +@ENABLE_MSVC_ONLY_FALSE@ sgen-copy-object.h \ +@ENABLE_MSVC_ONLY_FALSE@ sgen-debug.c \ +@ENABLE_MSVC_ONLY_FALSE@ sgen-descriptor.c \ +@ENABLE_MSVC_ONLY_FALSE@ sgen-descriptor.h \ +@ENABLE_MSVC_ONLY_FALSE@ sgen-fin-weak-hash.c \ +@ENABLE_MSVC_ONLY_FALSE@ sgen-gc.c \ +@ENABLE_MSVC_ONLY_FALSE@ sgen-gc.h \ +@ENABLE_MSVC_ONLY_FALSE@ sgen-gchandles.c \ +@ENABLE_MSVC_ONLY_FALSE@ sgen-gray.c \ +@ENABLE_MSVC_ONLY_FALSE@ sgen-gray.h \ +@ENABLE_MSVC_ONLY_FALSE@ sgen-hash-table.c \ +@ENABLE_MSVC_ONLY_FALSE@ sgen-hash-table.h \ +@ENABLE_MSVC_ONLY_FALSE@ sgen-internal.c \ +@ENABLE_MSVC_ONLY_FALSE@ sgen-layout-stats.c \ +@ENABLE_MSVC_ONLY_FALSE@ sgen-layout-stats.h \ +@ENABLE_MSVC_ONLY_FALSE@ sgen-los.c \ +@ENABLE_MSVC_ONLY_FALSE@ sgen-major-copy-object.h \ +@ENABLE_MSVC_ONLY_FALSE@ sgen-marksweep-drain-gray-stack.h \ +@ENABLE_MSVC_ONLY_FALSE@ sgen-marksweep.c \ +@ENABLE_MSVC_ONLY_FALSE@ sgen-memory-governor.c \ +@ENABLE_MSVC_ONLY_FALSE@ sgen-memory-governor.h \ +@ENABLE_MSVC_ONLY_FALSE@ sgen-minor-copy-object.h \ +@ENABLE_MSVC_ONLY_FALSE@ sgen-minor-scan-object.h \ +@ENABLE_MSVC_ONLY_FALSE@ sgen-nursery-allocator.c \ +@ENABLE_MSVC_ONLY_FALSE@ sgen-pinning-stats.c \ +@ENABLE_MSVC_ONLY_FALSE@ sgen-pinning.c \ +@ENABLE_MSVC_ONLY_FALSE@ sgen-pinning.h \ +@ENABLE_MSVC_ONLY_FALSE@ sgen-pointer-queue.c \ +@ENABLE_MSVC_ONLY_FALSE@ sgen-pointer-queue.h \ +@ENABLE_MSVC_ONLY_FALSE@ sgen-array-list.h \ +@ENABLE_MSVC_ONLY_FALSE@ sgen-array-list.c \ +@ENABLE_MSVC_ONLY_FALSE@ sgen-protocol-def.h \ +@ENABLE_MSVC_ONLY_FALSE@ sgen-protocol.c \ +@ENABLE_MSVC_ONLY_FALSE@ sgen-protocol.h \ +@ENABLE_MSVC_ONLY_FALSE@ sgen-qsort.c \ +@ENABLE_MSVC_ONLY_FALSE@ sgen-qsort.h \ +@ENABLE_MSVC_ONLY_FALSE@ sgen-scan-object.h \ +@ENABLE_MSVC_ONLY_FALSE@ sgen-simple-nursery.c \ +@ENABLE_MSVC_ONLY_FALSE@ sgen-split-nursery.c \ +@ENABLE_MSVC_ONLY_FALSE@ sgen-tagged-pointer.h \ +@ENABLE_MSVC_ONLY_FALSE@ sgen-thread-pool.c \ +@ENABLE_MSVC_ONLY_FALSE@ sgen-thread-pool.h \ +@ENABLE_MSVC_ONLY_FALSE@ sgen-workers.c \ +@ENABLE_MSVC_ONLY_FALSE@ sgen-workers.h -libmonosgen_la_SOURCES = $(monosgen_sources) -libmonosgen_la_CFLAGS = $(SGEN_DEFINES) +@ENABLE_MSVC_ONLY_FALSE@libmonosgen_la_SOURCES = $(monosgen_sources) +@ENABLE_MSVC_ONLY_FALSE@libmonosgen_la_CFLAGS = $(SGEN_DEFINES) all: all-am .SUFFIXES: @@ -614,25 +637,22 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmonosgen_la-sgen-workers.Plo@am__quote@ .c.o: -@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ -@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: -@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ -@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: -@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ -@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ -@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< @@ -904,7 +924,8 @@ distdir: $(DISTFILES) done check-am: all-am check: check-am -all-am: Makefile $(LTLIBRARIES) +@ENABLE_MSVC_ONLY_FALSE@all-local: +all-am: Makefile $(LTLIBRARIES) all-local installdirs: install: install-am install-exec: install-exec-am @@ -936,10 +957,11 @@ distclean-generic: maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." +@ENABLE_MSVC_ONLY_FALSE@clean-local: clean: clean-am -clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ - mostlyclean-am +clean-am: clean-generic clean-libtool clean-local \ + clean-noinstLTLIBRARIES mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) @@ -1017,24 +1039,32 @@ uninstall-am: .MAKE: install-am install-strip -.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ - clean-libtool clean-noinstLTLIBRARIES cscopelist-am ctags \ - ctags-am distclean distclean-compile distclean-generic \ - distclean-libtool distclean-tags distdir dvi dvi-am html \ - html-am info info-am install install-am install-data \ - install-data-am install-dvi install-dvi-am install-exec \ - install-exec-am install-html install-html-am install-info \ - install-info-am install-man install-pdf install-pdf-am \ - install-ps install-ps-am install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-compile \ - mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags tags-am test-am test-bundle-am test-bundle-local \ - test-local uninstall uninstall-am +.PHONY: CTAGS GTAGS TAGS all all-am all-local check check-am clean \ + clean-generic clean-libtool clean-local \ + clean-noinstLTLIBRARIES cscopelist-am ctags ctags-am distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ + pdf pdf-am ps ps-am tags tags-am test-am test-bundle-am \ + test-bundle-local test-local uninstall uninstall-am .PRECIOUS: Makefile +@ENABLE_MSVC_ONLY_TRUE@all-local: + +@ENABLE_MSVC_ONLY_TRUE@ make -C $(top_srcdir)/msvc libgcmonosgen + +@ENABLE_MSVC_ONLY_TRUE@clean-local: + +@ENABLE_MSVC_ONLY_TRUE@ make -C $(top_srcdir)/msvc clean-libgcmonosgen + # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: diff --git a/mono/sgen/sgen-alloc.c b/mono/sgen/sgen-alloc.c index 1806a13614..3279f80007 100644 --- a/mono/sgen/sgen-alloc.c +++ b/mono/sgen/sgen-alloc.c @@ -45,9 +45,15 @@ static guint64 stat_objects_alloced = 0; static guint64 stat_bytes_alloced = 0; static guint64 stat_bytes_alloced_los = 0; - #endif +/* The total number of bytes allocated so far in program execution by all attached threads. + * This is not constantly syncrhonized, but only updated on each GC. */ +static guint64 bytes_allocated_attached = 0; + +/* Total bytes allocated so far in program execution by detached threads */ +static guint64 bytes_allocated_detached = 0; + /* * Allocation is done from a Thread Local Allocation Buffer (TLAB). TLABs are allocated * from nursery fragments. @@ -446,6 +452,7 @@ sgen_alloc_obj (GCVTable vtable, size_t size) LOCK_GC; res = sgen_alloc_obj_nolock (vtable, size); UNLOCK_GC; + return res; } @@ -481,6 +488,10 @@ sgen_alloc_obj_pinned (GCVTable vtable, size_t size) return p; } +/* + * Used to allocate thread objects during attach. Doesn't trigger collections since + * the thread is not yet attached. + */ GCObject* sgen_alloc_obj_mature (GCVTable vtable, size_t size) { @@ -491,7 +502,7 @@ sgen_alloc_obj_mature (GCVTable vtable, size_t size) size = ALIGN_UP (size); LOCK_GC; - res = alloc_degraded (vtable, size, TRUE); + res = sgen_major_collector.alloc_degraded (vtable, size); UNLOCK_GC; if (res) { @@ -507,16 +518,62 @@ sgen_alloc_obj_mature (GCVTable vtable, size_t size) void sgen_clear_tlabs (void) { + guint64 total_bytes_allocated_globally = 0; + FOREACH_THREAD_ALL (info) { /* A new TLAB will be allocated when the thread does its first allocation */ info->total_bytes_allocated += info->tlab_next - info->tlab_start; + total_bytes_allocated_globally += info->total_bytes_allocated; info->tlab_start = NULL; info->tlab_next = NULL; info->tlab_temp_end = NULL; info->tlab_real_end = NULL; } FOREACH_THREAD_END + + sgen_set_bytes_allocated_attached (total_bytes_allocated_globally); +} + +void sgen_update_allocation_count (void) +{ + guint64 total_bytes_allocated_globally = 0; + + FOREACH_THREAD_ALL (info) { + total_bytes_allocated_globally += info->tlab_next - info->tlab_start; + total_bytes_allocated_globally += info->total_bytes_allocated; + } FOREACH_THREAD_END + + sgen_set_bytes_allocated_attached (total_bytes_allocated_globally); } +void +sgen_set_bytes_allocated_attached (guint64 bytes) +{ + bytes_allocated_attached = bytes; +} + +void +sgen_increment_bytes_allocated_detached (guint64 bytes) +{ + bytes_allocated_detached += bytes; +} + +guint64 +sgen_get_total_allocated_bytes (MonoBoolean precise) +{ + if (precise) { + LOCK_GC; + sgen_stop_world (0, FALSE); + + sgen_update_allocation_count (); + + sgen_restart_world (0, FALSE); + UNLOCK_GC; + } + + return bytes_allocated_attached + bytes_allocated_detached; +} + + void sgen_init_allocator (void) { diff --git a/mono/sgen/sgen-cardtable.c b/mono/sgen/sgen-cardtable.c index f03da24ab0..c51877097b 100644 --- a/mono/sgen/sgen-cardtable.c +++ b/mono/sgen/sgen-cardtable.c @@ -67,10 +67,10 @@ sgen_card_table_wbarrier_set_field (GCObject *obj, gpointer field_ptr, GCObject* } static void -sgen_card_table_wbarrier_arrayref_copy (gpointer dest_ptr, gpointer src_ptr, int count) +sgen_card_table_wbarrier_arrayref_copy (gpointer dest_ptr, gconstpointer src_ptr, int count) { gpointer *dest = (gpointer *)dest_ptr; - gpointer *src = (gpointer *)src_ptr; + const gpointer *src = (const gpointer *)src_ptr; /*overlapping that required backward copying*/ if (src < dest && (src + count) > dest) { @@ -98,7 +98,7 @@ sgen_card_table_wbarrier_arrayref_copy (gpointer dest_ptr, gpointer src_ptr, int } static void -sgen_card_table_wbarrier_value_copy (gpointer dest, gpointer src, int count, size_t element_size) +sgen_card_table_wbarrier_value_copy (gpointer dest, gconstpointer src, int count, size_t element_size) { size_t size = count * element_size; @@ -520,7 +520,7 @@ sgen_card_table_dump_obj_card (GCObject *object, size_t size, void *dummy) #define MWORD_MASK (sizeof (mword) - 1) -static inline int +static int find_card_offset (mword card) { /*XXX Use assembly as this generates some pretty bad code */ diff --git a/mono/sgen/sgen-client.h b/mono/sgen/sgen-client.h index 512e312c5b..53a1a43f45 100644 --- a/mono/sgen/sgen-client.h +++ b/mono/sgen/sgen-client.h @@ -212,6 +212,7 @@ void sgen_client_bridge_register_finalized_object (GCObject *object); */ void sgen_client_mark_togglerefs (char *start, char *end, ScanCopyContext ctx); void sgen_client_clear_togglerefs (char *start, char *end, ScanCopyContext ctx); +void sgen_foreach_toggleref_root (void (*callback)(MonoObject*, gpointer), gpointer data); /* * Called to handle `MONO_GC_PARAMS` and `MONO_GC_DEBUG` options. The `handle` functions diff --git a/mono/sgen/sgen-debug.c b/mono/sgen/sgen-debug.c index 39a5ba94cd..230cbee128 100644 --- a/mono/sgen/sgen-debug.c +++ b/mono/sgen/sgen-debug.c @@ -944,21 +944,20 @@ sgen_scan_for_registered_roots_in_domain (MonoDomain *domain, int root_type) static gboolean is_xdomain_ref_allowed (GCObject **ptr, GCObject *obj, MonoDomain *domain) { +#ifndef ENABLE_NETCORE MonoObject *o = (MonoObject*)(obj); - MonoObject *ref = *ptr; size_t offset = (char*)(ptr) - (char*)o; -#ifndef ENABLE_NETCORE if (o->vtable->klass == mono_defaults.thread_class && offset == G_STRUCT_OFFSET (MonoThread, internal_thread)) return TRUE; if (o->vtable->klass == mono_defaults.internal_thread_class && offset == G_STRUCT_OFFSET (MonoInternalThread, current_appcontext)) return TRUE; -#endif #ifndef DISABLE_REMOTING if (m_class_get_supertypes (mono_defaults.real_proxy_class) && mono_class_has_parent_fast (o->vtable->klass, mono_defaults.real_proxy_class) && offset == G_STRUCT_OFFSET (MonoRealProxy, unwrapped_server)) return TRUE; +#endif #endif return FALSE; } diff --git a/mono/sgen/sgen-fin-weak-hash.c b/mono/sgen/sgen-fin-weak-hash.c index 29a1d3b504..055963affe 100644 --- a/mono/sgen/sgen-fin-weak-hash.c +++ b/mono/sgen/sgen-fin-weak-hash.c @@ -42,19 +42,19 @@ static int no_finalize = 0; #define TAG_MASK ((mword)0x1) -static inline GCObject* +static GCObject* tagged_object_get_object (GCObject *object) { return (GCObject*)(((mword)object) & ~TAG_MASK); } -static inline int +static int tagged_object_get_tag (GCObject *object) { return ((mword)object) & TAG_MASK; } -static inline GCObject* +static GCObject* tagged_object_apply (void *object, int tag_bits) { return (GCObject*)((mword)object | (mword)tag_bits); diff --git a/mono/sgen/sgen-gc.c.REMOVED.git-id b/mono/sgen/sgen-gc.c.REMOVED.git-id index 770162f366..0530b610f9 100644 --- a/mono/sgen/sgen-gc.c.REMOVED.git-id +++ b/mono/sgen/sgen-gc.c.REMOVED.git-id @@ -1 +1 @@ -157280038e9f85ceb36c65f1ef7b7f3b24588a26 \ No newline at end of file +4dcfbee116d7b509962e3831d55f3f751cb68cb3 \ No newline at end of file diff --git a/mono/sgen/sgen-gc.h b/mono/sgen/sgen-gc.h index f9fbb92d2a..313c28e953 100644 --- a/mono/sgen/sgen-gc.h +++ b/mono/sgen/sgen-gc.h @@ -322,6 +322,7 @@ enum { INTERNAL_MEM_STATISTICS, INTERNAL_MEM_STAT_PINNED_CLASS, INTERNAL_MEM_STAT_REMSET_CLASS, + INTERNAL_MEM_STAT_GCHANDLE_CLASS, INTERNAL_MEM_GRAY_QUEUE, INTERNAL_MEM_MS_TABLES, INTERNAL_MEM_MS_BLOCK_INFO, @@ -470,6 +471,9 @@ void sgen_pin_stats_register_object (GCObject *obj, int generation); void sgen_pin_stats_register_global_remset (GCObject *obj); void sgen_pin_stats_report (void); +void sgen_gchandle_stats_enable (void); +void sgen_gchandle_stats_report (void); + void sgen_sort_addresses (void **array, size_t size); void sgen_add_to_global_remset (gpointer ptr, GCObject *obj); @@ -477,6 +481,9 @@ int sgen_get_current_collection_generation (void); gboolean sgen_collection_is_concurrent (void); gboolean sgen_get_concurrent_collection_in_progress (void); +void sgen_set_bytes_allocated_attached (guint64 bytes); +void sgen_increment_bytes_allocated_detached (guint64 bytes); + typedef struct _SgenFragment SgenFragment; struct _SgenFragment { @@ -707,8 +714,8 @@ SgenMinorCollector* sgen_get_minor_collector (void); typedef struct _SgenRememberedSet { void (*wbarrier_set_field) (GCObject *obj, gpointer field_ptr, GCObject* value); - void (*wbarrier_arrayref_copy) (gpointer dest_ptr, gpointer src_ptr, int count); - void (*wbarrier_value_copy) (gpointer dest, gpointer src, int count, size_t element_size); + void (*wbarrier_arrayref_copy) (gpointer dest_ptr, gconstpointer src_ptr, int count); + void (*wbarrier_value_copy) (gpointer dest, gconstpointer src, int count, size_t element_size); void (*wbarrier_object_copy) (GCObject* obj, GCObject *src); void (*wbarrier_generic_nostore) (gpointer ptr); void (*record_pointer) (gpointer ptr); @@ -728,7 +735,7 @@ SgenRememberedSet *sgen_get_remset (void); * These must be kept in sync with object.h. They're here for using SGen independently of * Mono. */ -void mono_gc_wbarrier_arrayref_copy (gpointer dest_ptr, gpointer src_ptr, int count); +void mono_gc_wbarrier_arrayref_copy (gpointer dest_ptr, /*const*/ void* src_ptr, int count); void mono_gc_wbarrier_generic_nostore (gpointer ptr); void mono_gc_wbarrier_generic_store (gpointer ptr, GCObject* value); void mono_gc_wbarrier_generic_store_atomic (gpointer ptr, GCObject *value); @@ -1075,6 +1082,8 @@ typedef enum { } SgenAllocatorType; void sgen_clear_tlabs (void); +void sgen_update_allocation_count (void); +guint64 sgen_get_total_allocated_bytes (MonoBoolean precise); GCObject* sgen_alloc_obj (GCVTable vtable, size_t size) MONO_PERMIT (need (sgen_lock_gc, sgen_stop_world)); @@ -1142,6 +1151,8 @@ gboolean sgen_nursery_canaries_enabled (void); void sgen_check_canary_for_object (gpointer addr); +guint64 sgen_get_precise_allocation_count (void); + #define CHECK_CANARY_FOR_OBJECT(addr, ignored) \ (sgen_nursery_canaries_enabled () ? sgen_check_canary_for_object (addr) : (void)0) diff --git a/mono/sgen/sgen-gchandles.c b/mono/sgen/sgen-gchandles.c index 0725d8681a..1ca10685a8 100644 --- a/mono/sgen/sgen-gchandles.c +++ b/mono/sgen/sgen-gchandles.c @@ -20,6 +20,15 @@ static volatile guint32 stat_gc_handles_allocated = 0; static volatile guint32 stat_gc_handles_max_allocated = 0; #endif + +typedef struct { + size_t num_handles [HANDLE_TYPE_MAX]; +} GCHandleClassEntry; + +static gboolean do_gchandle_stats = FALSE; + +static SgenHashTable gchandle_class_hash_table = SGEN_HASH_TABLE_INIT (INTERNAL_MEM_STATISTICS, INTERNAL_MEM_STAT_GCHANDLE_CLASS, sizeof (GCHandleClassEntry), g_str_hash, g_str_equal); + /* * A table of GC handle data, implementing a simple lock-free bitmap allocator. * @@ -56,7 +65,7 @@ protocol_gchandle_update (int handle_type, gpointer link, gpointer old_value, gp } /* Returns the new value in the slot, or NULL if the CAS failed. */ -static inline gpointer +static gpointer try_set_slot (volatile gpointer *slot, GCObject *obj, gpointer old, GCHandleType type) { gpointer new_; @@ -72,7 +81,7 @@ try_set_slot (volatile gpointer *slot, GCObject *obj, gpointer old, GCHandleType return NULL; } -static inline gboolean +static gboolean is_slot_set (volatile gpointer *slot) { gpointer entry = *slot; @@ -82,7 +91,7 @@ is_slot_set (volatile gpointer *slot) } /* Try to claim a slot by setting its occupied bit. */ -static inline gboolean +static gboolean try_occupy_slot (volatile gpointer *slot, gpointer obj, int data) { if (is_slot_set (slot)) @@ -514,6 +523,80 @@ sgen_register_obj_with_weak_fields (GCObject *obj) alloc_handle (gc_handles_for_type (HANDLE_WEAK_FIELDS), obj, FALSE); } +void +sgen_gchandle_stats_enable (void) +{ + do_gchandle_stats = TRUE; +} + +static void +sgen_gchandle_stats_register_vtable (GCVTable vtable, int handle_type) +{ + GCHandleClassEntry *entry; + + char *name = g_strdup_printf ("%s.%s", sgen_client_vtable_get_namespace (vtable), sgen_client_vtable_get_name (vtable)); + entry = (GCHandleClassEntry*) sgen_hash_table_lookup (&gchandle_class_hash_table, name); + + if (entry) { + g_free (name); + } else { + // Create the entry for this class and get the address of it + GCHandleClassEntry empty_entry; + memset (&empty_entry, 0, sizeof (GCHandleClassEntry)); + sgen_hash_table_replace (&gchandle_class_hash_table, name, &empty_entry, NULL); + entry = (GCHandleClassEntry*) sgen_hash_table_lookup (&gchandle_class_hash_table, name); + } + + entry->num_handles [handle_type]++; +} + +static void +sgen_gchandle_stats_count (void) +{ + int i; + + sgen_hash_table_clean (&gchandle_class_hash_table); + + for (i = HANDLE_TYPE_MIN; i < HANDLE_TYPE_MAX; i++) { + HandleData *handles = gc_handles_for_type ((GCHandleType)i); + SgenArrayList *array = &handles->entries_array; + volatile gpointer *slot; + gpointer hidden, revealed; + + SGEN_ARRAY_LIST_FOREACH_SLOT (array, slot) { + hidden = *slot; + revealed = MONO_GC_REVEAL_POINTER (hidden, MONO_GC_HANDLE_TYPE_IS_WEAK (i)); + + if (MONO_GC_HANDLE_IS_OBJECT_POINTER (hidden)) + sgen_gchandle_stats_register_vtable (SGEN_LOAD_VTABLE (revealed), i); + } SGEN_ARRAY_LIST_END_FOREACH_SLOT; + } +} + +void +sgen_gchandle_stats_report (void) +{ + char *name; + GCHandleClassEntry *gchandle_entry; + + if (!do_gchandle_stats) + return; + + sgen_gchandle_stats_count (); + + mono_gc_printf (sgen_gc_debug_file, "\n%-60s %10s %10s %10s\n", "Class", "Normal", "Weak", "Pinned"); + SGEN_HASH_TABLE_FOREACH (&gchandle_class_hash_table, char *, name, GCHandleClassEntry *, gchandle_entry) { + mono_gc_printf (sgen_gc_debug_file, "%-60s", name); + mono_gc_printf (sgen_gc_debug_file, " %10ld", (long)gchandle_entry->num_handles [HANDLE_NORMAL]); + size_t weak_handles = gchandle_entry->num_handles [HANDLE_WEAK] + + gchandle_entry->num_handles [HANDLE_WEAK_TRACK] + + gchandle_entry->num_handles [HANDLE_WEAK_FIELDS]; + mono_gc_printf (sgen_gc_debug_file, " %10ld", (long)weak_handles); + mono_gc_printf (sgen_gc_debug_file, " %10ld", (long)gchandle_entry->num_handles [HANDLE_PINNED]); + mono_gc_printf (sgen_gc_debug_file, "\n"); + } SGEN_HASH_TABLE_FOREACH_END; +} + void sgen_init_gchandles (void) { diff --git a/mono/sgen/sgen-internal.c b/mono/sgen/sgen-internal.c index 49ab78651c..8676f85366 100644 --- a/mono/sgen/sgen-internal.c +++ b/mono/sgen/sgen-internal.c @@ -138,6 +138,7 @@ description_for_type (int type) case INTERNAL_MEM_STATISTICS: return "statistics"; case INTERNAL_MEM_STAT_PINNED_CLASS: return "pinned-class"; case INTERNAL_MEM_STAT_REMSET_CLASS: return "remset-class"; + case INTERNAL_MEM_STAT_GCHANDLE_CLASS: return "gchandle-class"; case INTERNAL_MEM_GRAY_QUEUE: return "gray-queue"; case INTERNAL_MEM_MS_TABLES: return "marksweep-tables"; case INTERNAL_MEM_MS_BLOCK_INFO: return "marksweep-block-info"; diff --git a/mono/sgen/sgen-marksweep.c b/mono/sgen/sgen-marksweep.c index 4ff3d2bd2a..eb107d9f68 100644 --- a/mono/sgen/sgen-marksweep.c +++ b/mono/sgen/sgen-marksweep.c @@ -446,7 +446,7 @@ sweep_in_progress (void) state == SWEEP_STATE_COMPACTING; } -static inline gboolean +static gboolean block_is_swept_or_marking (MSBlockInfo *block) { gint32 state = block->state; @@ -1126,7 +1126,7 @@ get_cardtable_mod_union_for_block (MSBlockInfo *block, gboolean allocate) return other; } -static inline guint8* +static guint8* major_get_cardtable_mod_union_for_reference (char *ptr) { MSBlockInfo *block = MS_BLOCK_FOR_OBJ (ptr); @@ -1153,7 +1153,7 @@ mark_mod_union_card (GCObject *obj, void **ptr, GCObject *value_obj) sgen_binary_protocol_mod_union_remset (obj, ptr, value_obj, SGEN_LOAD_VTABLE (value_obj)); } -static inline gboolean +static gboolean major_block_is_evacuating (MSBlockInfo *block) { if (evacuate_block_obj_sizes [block->obj_size_index] && @@ -1308,7 +1308,7 @@ static guint64 stat_drain_loops; #define DRAIN_GRAY_STACK_FUNCTION_NAME drain_gray_stack_concurrent_par_with_evacuation #include "sgen-marksweep-drain-gray-stack.h" -static inline gboolean +static gboolean major_is_evacuating (void) { int i; @@ -1422,7 +1422,7 @@ mark_pinned_objects_in_block (MSBlockInfo *block, size_t first_entry, size_t las block->has_pinned = TRUE; } -static inline void +static void sweep_block_for_size (MSBlockInfo *block, int count, int obj_size) { int obj_index; @@ -1452,7 +1452,7 @@ sweep_block_for_size (MSBlockInfo *block, int count, int obj_size) } } -static inline gboolean +static gboolean try_set_block_state (MSBlockInfo *block, gint32 new_state, gint32 expected_state) { gint32 old_state = SGEN_CAS (&block->state, new_state, expected_state); @@ -1462,7 +1462,7 @@ try_set_block_state (MSBlockInfo *block, gint32 new_state, gint32 expected_state return success; } -static inline void +static void set_block_state (MSBlockInfo *block, gint32 new_state, gint32 expected_state) { SGEN_ASSERT (6, block->state == expected_state, "Block state incorrect before set"); @@ -1539,7 +1539,7 @@ sweep_block (MSBlockInfo *block) return TRUE; } -static inline int +static int bitcount (mword d) { int count = 0; diff --git a/mono/sgen/sgen-memory-governor.c b/mono/sgen/sgen-memory-governor.c index eb6dde9774..501696aaef 100644 --- a/mono/sgen/sgen-memory-governor.c +++ b/mono/sgen/sgen-memory-governor.c @@ -130,7 +130,7 @@ sgen_memgov_calculate_minor_collection_allowance (void) } } -static inline size_t +static size_t get_heap_size (void) { return sgen_major_collector.get_num_major_sections () * sgen_major_collector.section_size + sgen_los_memory_usage; diff --git a/mono/sgen/sgen-nursery-allocator.c b/mono/sgen/sgen-nursery-allocator.c index da817e42af..f45e061aa1 100644 --- a/mono/sgen/sgen-nursery-allocator.c +++ b/mono/sgen/sgen-nursery-allocator.c @@ -219,20 +219,19 @@ verify_alloc_records (void) /*********************************************************************************/ - -static inline gpointer +static gpointer mask (gpointer n, uintptr_t bit) { return (gpointer)(((uintptr_t)n) | bit); } -static inline gpointer +static gpointer unmask (gpointer p) { return (gpointer)((uintptr_t)p & ~(uintptr_t)0x3); } -static inline uintptr_t +static uintptr_t get_mark (gpointer n) { return (uintptr_t)n & 0x1; diff --git a/mono/sgen/sgen-simple-nursery.c b/mono/sgen/sgen-simple-nursery.c index a61560a269..1db3b081f1 100644 --- a/mono/sgen/sgen-simple-nursery.c +++ b/mono/sgen/sgen-simple-nursery.c @@ -23,14 +23,14 @@ #include "mono/utils/mono-memory-model.h" #include "mono/utils/mono-proclib.h" -static inline GCObject* +static GCObject* alloc_for_promotion (GCVTable vtable, GCObject *obj, size_t objsize, gboolean has_references) { sgen_total_promoted_size += objsize; return sgen_major_collector.alloc_object (vtable, objsize, has_references); } -static inline GCObject* +static GCObject* alloc_for_promotion_par (GCVTable vtable, GCObject *obj, size_t objsize, gboolean has_references) { /* diff --git a/mono/sgen/sgen-split-nursery.c b/mono/sgen/sgen-split-nursery.c index 28c7e58981..d67b00708c 100644 --- a/mono/sgen/sgen-split-nursery.c +++ b/mono/sgen/sgen-split-nursery.c @@ -139,7 +139,7 @@ static AgeAllocationBuffer age_alloc_buffers [MAX_AGE]; /* The collector allocs from here. */ static SgenFragmentAllocator collector_allocator; -static inline int +static int get_object_age (GCObject *object) { size_t idx = ((char*)object - sgen_nursery_start) >> SGEN_TO_SPACE_GRANULE_BITS; @@ -157,7 +157,7 @@ set_age_in_range (char *start, char *end, int age) memset (region_start, age, length); } -static inline void +static void mark_bit (char *space_bitmap, char *pos) { size_t idx = (pos - sgen_nursery_start) >> SGEN_TO_SPACE_GRANULE_BITS; @@ -250,7 +250,7 @@ alloc_for_promotion_slow_path (int age, size_t objsize) return p; } -static inline GCObject* +static GCObject* alloc_for_promotion (GCVTable vtable, GCObject *obj, size_t objsize, gboolean has_references) { char *p = NULL; diff --git a/mono/tests/Makefile.am.REMOVED.git-id b/mono/tests/Makefile.am.REMOVED.git-id index 779210db04..657acd1f71 100644 --- a/mono/tests/Makefile.am.REMOVED.git-id +++ b/mono/tests/Makefile.am.REMOVED.git-id @@ -1 +1 @@ -b90ba3c73268f1d86790235cffbc765467a23a47 \ No newline at end of file +bd41a1d045604694100460b314536e7b6b2e1796 \ No newline at end of file diff --git a/mono/tests/Makefile.in.REMOVED.git-id b/mono/tests/Makefile.in.REMOVED.git-id index 7f079aab37..9f2bbe91ae 100644 --- a/mono/tests/Makefile.in.REMOVED.git-id +++ b/mono/tests/Makefile.in.REMOVED.git-id @@ -1 +1 @@ -96fd4e52754d69d5360c414bf5d2c8cd67327585 \ No newline at end of file +118f2591fc1db3ee021791b8b400f8c300bf21f2 \ No newline at end of file diff --git a/mono/tests/assembly-load-reference/Makefile.in b/mono/tests/assembly-load-reference/Makefile.in index cd0bee7d8f..cef4cf36fa 100644 --- a/mono/tests/assembly-load-reference/Makefile.in +++ b/mono/tests/assembly-load-reference/Makefile.in @@ -226,6 +226,7 @@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTERP_CFLAGS = @INTERP_CFLAGS@ INTL = @INTL@ INVARIANT_AOT_OPTIONS = @INVARIANT_AOT_OPTIONS@ JEMALLOC_AUTOCONF_FLAGS = @JEMALLOC_AUTOCONF_FLAGS@ diff --git a/mono/tests/cominterop.cs b/mono/tests/cominterop.cs index 2afac903cf..604fe4fb3b 100644 --- a/mono/tests/cominterop.cs +++ b/mono/tests/cominterop.cs @@ -321,6 +321,12 @@ public class Tests [In, MarshalAs (UnmanagedType.SafeArray, SafeArraySubType = VarEnum.VT_VARIANT)] Array array3, [In, Out, MarshalAs (UnmanagedType.SafeArray, SafeArraySubType = VarEnum.VT_VARIANT)] ref Array array4); + [DllImport("libtest")] + public static extern int mono_test_marshal_safearray_in_ccw([MarshalAs (UnmanagedType.Interface)] ITest itest); + + [DllImport("libtest")] + public static extern int mono_test_default_interface_ccw([MarshalAs (UnmanagedType.Interface)] ITest itest); + [DllImport("libtest")] public static extern bool mono_cominterop_is_supported (); @@ -599,6 +605,9 @@ public class Tests if (mono_test_marshal_retval_ccw_itest(test_pres_sig, false) != 0) return 204; + if (mono_test_default_interface_ccw(test) != 0) + return 205; + #endregion // COM Callable Wrapper Tests #region SAFEARRAY tests @@ -606,7 +615,6 @@ public class Tests if (isWindows) { /* out */ - Array array; if ((mono_test_marshal_safearray_out_1dim_vt_bstr_empty (out array) != 0) || (array.Rank != 1) || (array.Length != 0)) return 62; @@ -762,6 +770,8 @@ public class Tests if (i != Convert.ToInt32 (array4.GetValue (i))) return 96; } + if (mono_test_marshal_safearray_in_ccw(test) != 0) + return 97; } #endregion // SafeArray Tests @@ -776,6 +786,56 @@ public class Tests return 0; } + [ComImport ()] + [Guid ("10000000-0000-0000-0000-000000000002")] + [InterfaceType (ComInterfaceType.InterfaceIsIUnknown)] + public interface IDefTest1 + { + [MethodImplAttribute (MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)] + int Method1(); + } + + [ComImport ()] + [Guid ("10000000-0000-0000-0000-000000000003")] + [InterfaceType (ComInterfaceType.InterfaceIsIUnknown)] + public interface IDefTest2 + { + [MethodImplAttribute (MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)] + int Method2(); + } + + public class TestDefaultInterfaceClass : IDefTest1, IDefTest2 + { + public int Method3() + { + return 3; + } + + public int Method1() + { + return 1; + } + + public int Method4() + { + return 4; + } + + public int Method2() + { + return 2; + } + } + + [ComDefaultInterfaceAttribute (typeof (IDefTest1))] + public class TestDefaultInterfaceClass1 : TestDefaultInterfaceClass + { + } + + [ComDefaultInterfaceAttribute (typeof (IDefTest2))] + public class TestDefaultInterfaceClass2 : TestDefaultInterfaceClass + { + } [ComImport ()] [Guid ("00000000-0000-0000-0000-000000000001")] @@ -817,6 +877,18 @@ public class Tests int Return22NoICall(); [MethodImplAttribute (MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)] int IntOut(); + [MethodImplAttribute (MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)] + void ArrayIn ([In, MarshalAs (UnmanagedType.SafeArray, SafeArraySubType = VarEnum.VT_VARIANT)] object[] array); + [MethodImplAttribute (MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)] + void ArrayIn2 ([In] object[] array); + [MethodImplAttribute (MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)] + void ArrayIn3 (object[] array); + [MethodImplAttribute (MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)] + [return: MarshalAs (UnmanagedType.Interface)] + TestDefaultInterfaceClass1 GetDefInterface1(); + [MethodImplAttribute (MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)] + [return: MarshalAs (UnmanagedType.Interface)] + TestDefaultInterfaceClass2 GetDefInterface2(); } [ComImport ()] @@ -873,6 +945,12 @@ public class Tests [MethodImplAttribute (MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)] [PreserveSig ()] int IntOut (out int val); + [MethodImplAttribute (MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)] + int ArrayIn ([In, MarshalAs (UnmanagedType.SafeArray, SafeArraySubType = VarEnum.VT_VARIANT)] object[] array); + [MethodImplAttribute (MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)] + int ArrayIn2 ([In] object[] array); + [MethodImplAttribute (MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)] + int ArrayIn3 (object[] array); } [System.Runtime.InteropServices.GuidAttribute ("00000000-0000-0000-0000-000000000002")] @@ -916,6 +994,16 @@ public class Tests public virtual extern int Return22NoICall(); [MethodImplAttribute (MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)] public virtual extern int IntOut(); + [MethodImplAttribute (MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)] + public virtual extern void ArrayIn ([In, MarshalAs (UnmanagedType.SafeArray, SafeArraySubType = VarEnum.VT_VARIANT)] object[] array); + [MethodImplAttribute (MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)] + public virtual extern void ArrayIn2 ([In] object[] array); + [MethodImplAttribute (MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)] + public virtual extern void ArrayIn3 (object[] array); + [MethodImplAttribute (MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)] + public virtual extern TestDefaultInterfaceClass1 GetDefInterface1(); + [MethodImplAttribute (MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)] + public virtual extern TestDefaultInterfaceClass2 GetDefInterface2(); } [System.Runtime.InteropServices.GuidAttribute ("00000000-0000-0000-0000-000000000002")] @@ -1066,6 +1154,44 @@ public class Tests val = 33; return 0; } + + public int ArrayIn(object[] array) + { + if (array.Length != 2) + return 40; + if (array.Rank != 1) + return 41; + if (array.GetLowerBound(0) != 0) + return 42; + if (array.GetUpperBound(0) != 1) + return 43; + if (array[0] is string) + { + if ((array[0] as string) != "Test") + return 44; + } + else + return 45; + if (array[1] is int) + { + if ((int)array[1] != 2345) + return 46; + } + else + return 47; + + return 444; + } + + public int ArrayIn2(object[] array) + { + return ArrayIn(array); + } + + public int ArrayIn3(object[] array) + { + return ArrayIn(array); + } } public class ManagedTest : ITest @@ -1165,6 +1291,50 @@ public class Tests { return 33; } + + public void ArrayIn(object[] array) + { + if (array.Length != 2) + status = 40; + else if (array.Rank != 1) + status = 41; + else if (array.GetLowerBound(0) != 0) + status = 42; + else if (array.GetUpperBound(0) != 1) + status = 43; + else if (array[0] is string) + { + if ((array[0] as string) != "Test") + status = 44; + } + else if (array[1] is int) + { + if ((int)array[1] != 2345) + status = 45; + } + + status = 444; + } + + public void ArrayIn2(object[] array) + { + ArrayIn(array); + } + + public void ArrayIn3(object[] array) + { + ArrayIn(array); + } + + public TestDefaultInterfaceClass1 GetDefInterface1() + { + return new TestDefaultInterfaceClass1(); + } + + public TestDefaultInterfaceClass2 GetDefInterface2() + { + return new TestDefaultInterfaceClass2(); + } } [ComVisible (true)] diff --git a/mono/tests/dim-generic.cs b/mono/tests/dim-generic.cs new file mode 100644 index 0000000000..c6254f0a13 --- /dev/null +++ b/mono/tests/dim-generic.cs @@ -0,0 +1,34 @@ +using System; + + +interface IBaseThingy +{ + int Foo (); +} + +interface INativeThingy : IBaseThingy +{ + int IBaseThingy.Foo () { + return 0; + } +} + +class NativeThingy : INativeThingy +{ +} + +public class Test +{ + public static int test_0_dim_override() + { + var thingy = new NativeThingy (); + var ithingy = (IBaseThingy)thingy; + int i = ithingy.Foo (); + return i; + } + + public static int Main (string[] args) { + return TestDriver.RunTests (typeof (Test), args); + } + +} diff --git a/mono/tests/fullaot-mixed/Makefile.am b/mono/tests/fullaot-mixed/Makefile.am index 6656e4681e..1beb1f58b2 100644 --- a/mono/tests/fullaot-mixed/Makefile.am +++ b/mono/tests/fullaot-mixed/Makefile.am @@ -6,6 +6,12 @@ lambda.exe: $(srcdir)/lambda.cs AOTDIR=linker-output AOT_TMPDIR=aot-tmp +if HOST_WIN32 +PLATFORM_PATH_SEPARATOR=; +else +PLATFORM_PATH_SEPARATOR=: +endif + $(AOTDIR)/lambda.exe$(PLATFORM_AOT_SUFFIX): $(AOTDIR)/lambda.exe $(LINKED_ASSEMBLIES) mkdir -p $(AOT_TMPDIR)/lambda.exe MONO_PATH=$(AOTDIR) $(MONO_EXE) --aot=full,interp,temp-path=$(AOT_TMPDIR)/lambda.exe $(AOTDIR)/lambda.exe @@ -47,7 +53,7 @@ if !X86 if !DISABLE_INTERPRETER if !ENABLE_COOP_SUSPEND check: $(AOT_IMAGES) $(TEST_IMAGES) - MONO_PATH=$(AOTDIR):$(CLASS) $(MONO_EXE) --aot-path=$(AOTDIR) --full-aot-interp $(AOTDIR)/lambda.exe + MONO_PATH="$(AOTDIR)$(PLATFORM_PATH_SEPARATOR)$(CLASS)" $(MONO_EXE) --aot-path=$(AOTDIR) --full-aot-interp $(AOTDIR)/lambda.exe endif endif endif diff --git a/mono/tests/fullaot-mixed/Makefile.in b/mono/tests/fullaot-mixed/Makefile.in index 34d4d2dfca..029d6dbfb7 100644 --- a/mono/tests/fullaot-mixed/Makefile.in +++ b/mono/tests/fullaot-mixed/Makefile.in @@ -232,6 +232,7 @@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTERP_CFLAGS = @INTERP_CFLAGS@ INTL = @INTL@ INVARIANT_AOT_OPTIONS = @INVARIANT_AOT_OPTIONS@ JEMALLOC_AUTOCONF_FLAGS = @JEMALLOC_AUTOCONF_FLAGS@ @@ -437,6 +438,8 @@ ILASM = $(TOOLS_RUNTIME) $(mcs_topdir)/class/lib/build/ilasm.exe CLEANFILES = *.dll *.exe *.pdb AOTDIR = linker-output AOT_TMPDIR = aot-tmp +@HOST_WIN32_FALSE@PLATFORM_PATH_SEPARATOR = : +@HOST_WIN32_TRUE@PLATFORM_PATH_SEPARATOR = ; SOURCES = \ lambda.cs @@ -731,7 +734,7 @@ $(AOTDIR)/%.exe: %.exe cp $< $@ @DISABLE_INTERPRETER_FALSE@@ENABLE_COOP_SUSPEND_FALSE@@X86_FALSE@check: $(AOT_IMAGES) $(TEST_IMAGES) -@DISABLE_INTERPRETER_FALSE@@ENABLE_COOP_SUSPEND_FALSE@@X86_FALSE@ MONO_PATH=$(AOTDIR):$(CLASS) $(MONO_EXE) --aot-path=$(AOTDIR) --full-aot-interp $(AOTDIR)/lambda.exe +@DISABLE_INTERPRETER_FALSE@@ENABLE_COOP_SUSPEND_FALSE@@X86_FALSE@ MONO_PATH="$(AOTDIR)$(PLATFORM_PATH_SEPARATOR)$(CLASS)" $(MONO_EXE) --aot-path=$(AOTDIR) --full-aot-interp $(AOTDIR)/lambda.exe # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff --git a/mono/tests/gc-descriptors/Makefile.in b/mono/tests/gc-descriptors/Makefile.in index 75a88cc9e4..7ca139848f 100644 --- a/mono/tests/gc-descriptors/Makefile.in +++ b/mono/tests/gc-descriptors/Makefile.in @@ -215,6 +215,7 @@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTERP_CFLAGS = @INTERP_CFLAGS@ INTL = @INTL@ INVARIANT_AOT_OPTIONS = @INVARIANT_AOT_OPTIONS@ JEMALLOC_AUTOCONF_FLAGS = @JEMALLOC_AUTOCONF_FLAGS@ diff --git a/mono/tests/libtest.c.REMOVED.git-id b/mono/tests/libtest.c.REMOVED.git-id index efb7ef11b0..066909afb7 100644 --- a/mono/tests/libtest.c.REMOVED.git-id +++ b/mono/tests/libtest.c.REMOVED.git-id @@ -1 +1 @@ -97c19db3f16ae75ca00ace17486cf403b7ae5bcc \ No newline at end of file +2b80cd95a39b1b425bc936099f61e712280076cd \ No newline at end of file diff --git a/mono/tests/llvmonly-mixed/Makefile.in b/mono/tests/llvmonly-mixed/Makefile.in index 2c5598c2a3..8bef4db97d 100644 --- a/mono/tests/llvmonly-mixed/Makefile.in +++ b/mono/tests/llvmonly-mixed/Makefile.in @@ -232,6 +232,7 @@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTERP_CFLAGS = @INTERP_CFLAGS@ INTL = @INTL@ INVARIANT_AOT_OPTIONS = @INVARIANT_AOT_OPTIONS@ JEMALLOC_AUTOCONF_FLAGS = @JEMALLOC_AUTOCONF_FLAGS@ diff --git a/mono/tests/testing_gac/Makefile.am b/mono/tests/testing_gac/Makefile.am index 588ab6d1a2..24c493ca22 100644 --- a/mono/tests/testing_gac/Makefile.am +++ b/mono/tests/testing_gac/Makefile.am @@ -25,15 +25,15 @@ TEST_RUNTIME = MONO_PATH=$(CLASS) $(RUNTIME) TOOLS_RUNTIME= MONO_PATH=$(mcs_topdir)/class/lib/build $(RUNTIME) # These tests are testing strict assembly strong-name resolution -TEST_RUNNER = ../test-runner.exe --runtime $(RUNTIME) --runtime-args "--assembly-loader=strict" +TEST_RUNNER = ../test-runner.exe --runtime-args "--assembly-loader=strict" if HOST_WIN32 if ENABLE_MSVC - DEFAULT_WIN32_RUNTIME=$(shell cygpath -w -a $(top_builddir)/@mono_runtime@ | sed 's/\\/\\\\/g') +DEFAULT_WIN32_RUNTIME=$(shell cygpath -w -a $(top_builddir)/@mono_runtime@ | sed 's/\\/\\\\/g') else - DEFAULT_WIN32_RUNTIME=$(top_builddir)/runtime/mono-wrapper) +DEFAULT_WIN32_RUNTIME=$(top_builddir)/runtime/mono-wrapper) endif -TEST_RUNNER_ARGS=--runtime $(if $(MONO_EXECUTABLE),$(shell cygpath -w -a $(MONO_EXECUTABLE) | sed 's/\\/\\\\/g'),$(DEFAULT_WIN32_RUNTIME)) +TEST_RUNNER_ARGS=--runtime "$(if $(MONO_EXECUTABLE),$(shell cygpath -w -a $(MONO_EXECUTABLE) | sed 's/\\/\\\\/g'),$(DEFAULT_WIN32_RUNTIME))" else TEST_RUNNER_ARGS=--runtime $(if $(MONO_EXECUTABLE),$(MONO_EXECUTABLE),mono) endif diff --git a/mono/tests/testing_gac/Makefile.in b/mono/tests/testing_gac/Makefile.in index fbe0e3fa06..66b0632333 100644 --- a/mono/tests/testing_gac/Makefile.in +++ b/mono/tests/testing_gac/Makefile.in @@ -217,6 +217,7 @@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTERP_CFLAGS = @INTERP_CFLAGS@ INTL = @INTL@ INVARIANT_AOT_OPTIONS = @INVARIANT_AOT_OPTIONS@ JEMALLOC_AUTOCONF_FLAGS = @JEMALLOC_AUTOCONF_FLAGS@ @@ -420,16 +421,18 @@ TEST_RUNTIME = MONO_PATH=$(CLASS) $(RUNTIME) TOOLS_RUNTIME = MONO_PATH=$(mcs_topdir)/class/lib/build $(RUNTIME) # These tests are testing strict assembly strong-name resolution -TEST_RUNNER = ../test-runner.exe --runtime $(RUNTIME) --runtime-args \ +TEST_RUNNER = ../test-runner.exe --runtime-args \ "--assembly-loader=strict" $(am__append_1) $(am__append_2) +@ENABLE_MSVC_FALSE@@HOST_WIN32_TRUE@DEFAULT_WIN32_RUNTIME = $(top_builddir)/runtime/mono-wrapper) +@ENABLE_MSVC_TRUE@@HOST_WIN32_TRUE@DEFAULT_WIN32_RUNTIME = $(shell cygpath -w -a $(top_builddir)/@mono_runtime@ | sed 's/\\/\\\\/g') @HOST_WIN32_FALSE@TEST_RUNNER_ARGS = --runtime $(if \ @HOST_WIN32_FALSE@ $(MONO_EXECUTABLE),$(MONO_EXECUTABLE),mono) \ @HOST_WIN32_FALSE@ $(if $(V), --verbose,) -@HOST_WIN32_TRUE@TEST_RUNNER_ARGS = --runtime $(if \ +@HOST_WIN32_TRUE@TEST_RUNNER_ARGS = --runtime "$(if \ @HOST_WIN32_TRUE@ $(MONO_EXECUTABLE),$(shell cygpath -w -a \ @HOST_WIN32_TRUE@ $(MONO_EXECUTABLE) | sed \ -@HOST_WIN32_TRUE@ 's/\\/\\\\/g'),$(DEFAULT_WIN32_RUNTIME)) $(if \ -@HOST_WIN32_TRUE@ $(V), --verbose,) +@HOST_WIN32_TRUE@ 's/\\/\\\\/g'),$(DEFAULT_WIN32_RUNTIME))" \ +@HOST_WIN32_TRUE@ $(if $(V), --verbose,) ### tools GACUTIL = $(mcs_topdir)/class/lib/build/gacutil.exe @@ -672,9 +675,6 @@ uninstall-am: .PRECIOUS: Makefile -@ENABLE_MSVC_TRUE@@HOST_WIN32_TRUE@ DEFAULT_WIN32_RUNTIME=$(shell cygpath -w -a $(top_builddir)/@mono_runtime@ | sed 's/\\/\\\\/g') -@ENABLE_MSVC_FALSE@@HOST_WIN32_TRUE@ DEFAULT_WIN32_RUNTIME=$(top_builddir)/runtime/mono-wrapper) - ### Test cases .PHONY: run-test test-local prereqs diff --git a/mono/tests/winx64structs.cs b/mono/tests/winx64structs.cs index 0148fb4a4d..12abb7ec53 100644 --- a/mono/tests/winx64structs.cs +++ b/mono/tests/winx64structs.cs @@ -115,6 +115,40 @@ struct winx64_doubleStruct public double a; } +[StructLayout (LayoutKind.Sequential)] +public struct winx64_vector3Struct +{ + public winx64_vector3Struct (float ix, float iy, float iz) + { + x=ix; + y=iy; + z=iz; + } + + public static winx64_vector3Struct Add (winx64_vector3Struct a, winx64_vector3Struct b) + { + Add(ref a, ref b, out a); + return a; + } + + static void Add (ref winx64_vector3Struct a, ref winx64_vector3Struct b, out winx64_vector3Struct result) + { + result.x = a.x + b.x; + result.y = a.y + b.y; + result.z = a.z + b.z; + } + + public float x; + public float y; + public float z; +} + +public struct winx64_vector3PairStruct +{ + public winx64_vector3Struct first; + public winx64_vector3Struct second; +} + class winx64structs { [DllImport ("libtest")] @@ -455,6 +489,22 @@ class winx64structs return 0; } + public static int test_0_Value_On_Stack_Local_Copy_Managed () + { + var vector3Pair = new winx64_vector3PairStruct + { + first = new winx64_vector3Struct (1, 2, 3) + }; + + var local2 = new winx64_vector3Struct (1, 1, 1); + var local1 = vector3Pair.first; + + vector3Pair.first = winx64_vector3Struct.Add (local1, local2); + vector3Pair.second = winx64_vector3Struct.Add (local1, local2); + + return (vector3Pair.second.x == 2 && vector3Pair.second.y == 3 && vector3Pair.second.z == 4) ? 0 : 1; + } + [MonoPInvokeCallback (typeof (managed_struct1_delegate))] public static int managed_struct1_test (winx64_struct1 var) { diff --git a/mono/unit-tests/Makefile.am b/mono/unit-tests/Makefile.am index a142dbf006..f306e29501 100644 --- a/mono/unit-tests/Makefile.am +++ b/mono/unit-tests/Makefile.am @@ -1,6 +1,6 @@ include $(top_srcdir)/mk/common.mk -AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/mono $(LIBGC_CPPFLAGS) $(GLIB_CFLAGS) -DMONO_BINDIR=\"$(bindir)/\" -DMONO_ASSEMBLIES=\"$(assembliesdir)\" -DMONO_CFG_DIR=\"$(confdir)\" +AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/mono -I$(top_srcdir)/samples $(LIBGC_CPPFLAGS) $(GLIB_CFLAGS) -DMONO_BINDIR=\"$(bindir)/\" -DMONO_ASSEMBLIES=\"$(assembliesdir)\" -DMONO_CFG_DIR=\"$(confdir)\" CLASS=$(mcs_topdir)/class/lib/$(DEFAULT_PROFILE) @@ -26,6 +26,7 @@ glib_libs = $(top_builddir)/mono/eglib/libeglib.la test_cflags = $(AM_CFLAGS) $(SGEN_DEFINES) test_ldadd = libtestlib.la \ $(LIBGC_LIBS) $(glib_libs) $(LLVMMONOF) + if HOST_DARWIN test_ldflags = -framework CoreFoundation -framework Foundation endif @@ -62,7 +63,9 @@ libtestlib_la_SOURCES = \ test-conc-hashtable.c \ test-mono-handle.c \ test-mono-callspec.c \ - test-mono-string.c + test-mono-string.c \ + test-mono-embed.c \ + test-embed-invoke.c libtestlib_la_LIBADD = ../metadata/libmonoruntimesgen.la ../sgen/libmonosgen.la ../utils/libmonoutils.la test_sgen_qsort_SOURCES = main.c @@ -97,22 +100,35 @@ test_mono_callspec_LDFLAGS = $(test_ldflags) test_mono_callspec_DEPENDENCIES = callspec.exe test_mono_string_SOURCES = main.c -test_mono_string_CFLAGS = $(test-cflags) -DMAIN=test_mono_string_main +test_mono_string_CFLAGS = $(test_cflags) -DMAIN=test_mono_string_main test_mono_string_LDADD = $(test_ldadd) $(mini_libs) $(sgen_libs) libtestlib_la-test-mono-string.lo test_mono_string_LDFLAGS = $(test_ldflags) +test_mono_embed_SOURCES = main.c +test_mono_embed_CFLAGS = $(test_cflags) -DMAIN=test_mono_embed_main +test_mono_embed_LDADD = $(test_ldadd) $(mini_libs) $(sgen_libs) libtestlib_la-test-mono-embed.lo +test_mono_embed_LDFLAGS = $(test_ldflags) +test_mono_embed_DEPENDENCIES = test-embed.exe + test_path_SOURCES = test-path.c test_path_CFLAGS = $(test-cflags) test_path_LDADD = $(test_ldadd) $(mini_libs) $(sgen_libs) test_path_LDFLAGS = $(test_ldflags) +test_embed_invoke_SOURCES = main.c +test_embed_invoke_CFLAGS = $(test_cflags) -DMAIN=test_mono_embed_invoke_main +test_embed_invoke_LDADD = $(test_ldadd) $(mini_libs) $(sgen_libs) libtestlib_la-test-embed-invoke.lo +test_embed_invoke_LDFLAGS = $(test_ldflags) +test_embed_invoke_DEPENDENCIES = test-embed-invoke-cs.exe + + check_PROGRAMS = test-sgen-qsort test-memfuncs test-mono-linked-list-set test-conc-hashtable test-mono-handle \ test-path \ - test-mono-callspec test-mono-string + test-mono-callspec test-mono-string test-mono-embed test-embed-invoke TESTS = test-sgen-qsort test-memfuncs test-mono-linked-list-set test-conc-hashtable test-mono-handle \ test-path \ - test-mono-callspec test-mono-string + test-mono-callspec test-mono-string test-mono-embed test-embed-invoke AM_TESTS_ENVIRONMENT = export MONO_PATH=$(mcs_topdir)/class/lib/build; @@ -129,10 +145,18 @@ check-local: fi; clean-local: - rm -f callspec.exe callspec.pdb + rm -f callspec.exe callspec.pdb + rm -f test-embed.exe test-embed.pdb + rm -f test-embed-invoke-cs.exe test-embed-invoke-cs.pdb %.exe: %.cs $(MCS) -r:$(CLASS)/System.dll -r:$(CLASS)/System.Xml.dll -r:$(CLASS)/System.Core.dll -out:$@ $< +test-embed.exe: $(top_srcdir)/samples/embed/test.cs + $(MCS) -r:$(CLASS)/System.dll -r:$(CLASS)/System.Xml.dll -r:$(CLASS)/System.Core.dll -out:$@ $< + +test-embed-invoke-cs.exe: $(top_srcdir)/samples/embed/invoke.cs + $(MCS) -r:$(CLASS)/System.dll -r:$(CLASS)/System.Xml.dll -r:$(CLASS)/System.Core.dll -out:$@ $< + endif !HOST_WIN32 endif !CROSS_COMPILE diff --git a/mono/unit-tests/Makefile.in b/mono/unit-tests/Makefile.in index 7b45dbc879..3a1340eb62 100644 --- a/mono/unit-tests/Makefile.in +++ b/mono/unit-tests/Makefile.in @@ -98,7 +98,9 @@ target_triplet = @target@ @CROSS_COMPILE_FALSE@@HOST_WIN32_FALSE@ test-mono-handle$(EXEEXT) \ @CROSS_COMPILE_FALSE@@HOST_WIN32_FALSE@ test-path$(EXEEXT) \ @CROSS_COMPILE_FALSE@@HOST_WIN32_FALSE@ test-mono-callspec$(EXEEXT) \ -@CROSS_COMPILE_FALSE@@HOST_WIN32_FALSE@ test-mono-string$(EXEEXT) +@CROSS_COMPILE_FALSE@@HOST_WIN32_FALSE@ test-mono-string$(EXEEXT) \ +@CROSS_COMPILE_FALSE@@HOST_WIN32_FALSE@ test-mono-embed$(EXEEXT) \ +@CROSS_COMPILE_FALSE@@HOST_WIN32_FALSE@ test-embed-invoke$(EXEEXT) @CROSS_COMPILE_FALSE@@HOST_WIN32_FALSE@TESTS = test-sgen-qsort$(EXEEXT) \ @CROSS_COMPILE_FALSE@@HOST_WIN32_FALSE@ test-memfuncs$(EXEEXT) \ @CROSS_COMPILE_FALSE@@HOST_WIN32_FALSE@ test-mono-linked-list-set$(EXEEXT) \ @@ -106,7 +108,9 @@ target_triplet = @target@ @CROSS_COMPILE_FALSE@@HOST_WIN32_FALSE@ test-mono-handle$(EXEEXT) \ @CROSS_COMPILE_FALSE@@HOST_WIN32_FALSE@ test-path$(EXEEXT) \ @CROSS_COMPILE_FALSE@@HOST_WIN32_FALSE@ test-mono-callspec$(EXEEXT) \ -@CROSS_COMPILE_FALSE@@HOST_WIN32_FALSE@ test-mono-string$(EXEEXT) +@CROSS_COMPILE_FALSE@@HOST_WIN32_FALSE@ test-mono-string$(EXEEXT) \ +@CROSS_COMPILE_FALSE@@HOST_WIN32_FALSE@ test-mono-embed$(EXEEXT) \ +@CROSS_COMPILE_FALSE@@HOST_WIN32_FALSE@ test-embed-invoke$(EXEEXT) subdir = mono/unit-tests ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/apple-target.m4 \ @@ -133,14 +137,17 @@ LTLIBRARIES = $(noinst_LTLIBRARIES) @CROSS_COMPILE_FALSE@@HOST_WIN32_FALSE@ ../utils/libmonoutils.la am__libtestlib_la_SOURCES_DIST = test-sgen-qsort.c test-memfuncs.c \ test-mono-linked-list-set.c test-conc-hashtable.c \ - test-mono-handle.c test-mono-callspec.c test-mono-string.c + test-mono-handle.c test-mono-callspec.c test-mono-string.c \ + test-mono-embed.c test-embed-invoke.c @CROSS_COMPILE_FALSE@@HOST_WIN32_FALSE@am_libtestlib_la_OBJECTS = libtestlib_la-test-sgen-qsort.lo \ @CROSS_COMPILE_FALSE@@HOST_WIN32_FALSE@ libtestlib_la-test-memfuncs.lo \ @CROSS_COMPILE_FALSE@@HOST_WIN32_FALSE@ libtestlib_la-test-mono-linked-list-set.lo \ @CROSS_COMPILE_FALSE@@HOST_WIN32_FALSE@ libtestlib_la-test-conc-hashtable.lo \ @CROSS_COMPILE_FALSE@@HOST_WIN32_FALSE@ libtestlib_la-test-mono-handle.lo \ @CROSS_COMPILE_FALSE@@HOST_WIN32_FALSE@ libtestlib_la-test-mono-callspec.lo \ -@CROSS_COMPILE_FALSE@@HOST_WIN32_FALSE@ libtestlib_la-test-mono-string.lo +@CROSS_COMPILE_FALSE@@HOST_WIN32_FALSE@ libtestlib_la-test-mono-string.lo \ +@CROSS_COMPILE_FALSE@@HOST_WIN32_FALSE@ libtestlib_la-test-mono-embed.lo \ +@CROSS_COMPILE_FALSE@@HOST_WIN32_FALSE@ libtestlib_la-test-embed-invoke.lo libtestlib_la_OBJECTS = $(am_libtestlib_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) @@ -163,6 +170,13 @@ test_conc_hashtable_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(test_conc_hashtable_CFLAGS) $(CFLAGS) \ $(test_conc_hashtable_LDFLAGS) $(LDFLAGS) -o $@ +am__test_embed_invoke_SOURCES_DIST = main.c +@CROSS_COMPILE_FALSE@@HOST_WIN32_FALSE@am_test_embed_invoke_OBJECTS = test_embed_invoke-main.$(OBJEXT) +test_embed_invoke_OBJECTS = $(am_test_embed_invoke_OBJECTS) +test_embed_invoke_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(test_embed_invoke_CFLAGS) $(CFLAGS) \ + $(test_embed_invoke_LDFLAGS) $(LDFLAGS) -o $@ am__test_memfuncs_SOURCES_DIST = main.c @CROSS_COMPILE_FALSE@@HOST_WIN32_FALSE@am_test_memfuncs_OBJECTS = test_memfuncs-main.$(OBJEXT) test_memfuncs_OBJECTS = $(am_test_memfuncs_OBJECTS) @@ -179,6 +193,13 @@ test_mono_callspec_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(test_mono_callspec_CFLAGS) $(CFLAGS) \ $(test_mono_callspec_LDFLAGS) $(LDFLAGS) -o $@ +am__test_mono_embed_SOURCES_DIST = main.c +@CROSS_COMPILE_FALSE@@HOST_WIN32_FALSE@am_test_mono_embed_OBJECTS = test_mono_embed-main.$(OBJEXT) +test_mono_embed_OBJECTS = $(am_test_mono_embed_OBJECTS) +test_mono_embed_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(test_mono_embed_CFLAGS) $(CFLAGS) $(test_mono_embed_LDFLAGS) \ + $(LDFLAGS) -o $@ am__test_mono_handle_SOURCES_DIST = main.c @CROSS_COMPILE_FALSE@@HOST_WIN32_FALSE@am_test_mono_handle_OBJECTS = test_mono_handle-main.$(OBJEXT) test_mono_handle_OBJECTS = $(am_test_mono_handle_OBJECTS) @@ -263,15 +284,18 @@ am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libtestlib_la_SOURCES) $(test_conc_hashtable_SOURCES) \ - $(test_memfuncs_SOURCES) $(test_mono_callspec_SOURCES) \ + $(test_embed_invoke_SOURCES) $(test_memfuncs_SOURCES) \ + $(test_mono_callspec_SOURCES) $(test_mono_embed_SOURCES) \ $(test_mono_handle_SOURCES) \ $(test_mono_linked_list_set_SOURCES) \ $(test_mono_string_SOURCES) $(test_path_SOURCES) \ $(test_sgen_qsort_SOURCES) DIST_SOURCES = $(am__libtestlib_la_SOURCES_DIST) \ $(am__test_conc_hashtable_SOURCES_DIST) \ + $(am__test_embed_invoke_SOURCES_DIST) \ $(am__test_memfuncs_SOURCES_DIST) \ $(am__test_mono_callspec_SOURCES_DIST) \ + $(am__test_mono_embed_SOURCES_DIST) \ $(am__test_mono_handle_SOURCES_DIST) \ $(am__test_mono_linked_list_set_SOURCES_DIST) \ $(am__test_mono_string_SOURCES_DIST) \ @@ -593,6 +617,7 @@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTERP_CFLAGS = @INTERP_CFLAGS@ INTL = @INTL@ INVARIANT_AOT_OPTIONS = @INVARIANT_AOT_OPTIONS@ JEMALLOC_AUTOCONF_FLAGS = @JEMALLOC_AUTOCONF_FLAGS@ @@ -782,7 +807,7 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MAKEFLAGS := $(MAKEFLAGS) --no-builtin-rules -AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/mono $(LIBGC_CPPFLAGS) $(GLIB_CFLAGS) -DMONO_BINDIR=\"$(bindir)/\" -DMONO_ASSEMBLIES=\"$(assembliesdir)\" -DMONO_CFG_DIR=\"$(confdir)\" +AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/mono -I$(top_srcdir)/samples $(LIBGC_CPPFLAGS) $(GLIB_CFLAGS) -DMONO_BINDIR=\"$(bindir)/\" -DMONO_ASSEMBLIES=\"$(assembliesdir)\" -DMONO_CFG_DIR=\"$(confdir)\" CLASS = $(mcs_topdir)/class/lib/$(DEFAULT_PROFILE) TOOLS_RUNTIME = MONO_PATH=$(mcs_topdir)/class/lib/build $(top_builddir)/runtime/mono-wrapper --aot-path=$(mcs_topdir)/class/lib/build MCS_NO_UNSAFE = $(TOOLS_RUNTIME) $(CSC) -debug:portable \ @@ -819,7 +844,9 @@ mini_libs = $(monodir)/mono/mini/libmini.la $(am__append_1) \ @CROSS_COMPILE_FALSE@@HOST_WIN32_FALSE@ test-conc-hashtable.c \ @CROSS_COMPILE_FALSE@@HOST_WIN32_FALSE@ test-mono-handle.c \ @CROSS_COMPILE_FALSE@@HOST_WIN32_FALSE@ test-mono-callspec.c \ -@CROSS_COMPILE_FALSE@@HOST_WIN32_FALSE@ test-mono-string.c +@CROSS_COMPILE_FALSE@@HOST_WIN32_FALSE@ test-mono-string.c \ +@CROSS_COMPILE_FALSE@@HOST_WIN32_FALSE@ test-mono-embed.c \ +@CROSS_COMPILE_FALSE@@HOST_WIN32_FALSE@ test-embed-invoke.c @CROSS_COMPILE_FALSE@@HOST_WIN32_FALSE@libtestlib_la_LIBADD = ../metadata/libmonoruntimesgen.la ../sgen/libmonosgen.la ../utils/libmonoutils.la @CROSS_COMPILE_FALSE@@HOST_WIN32_FALSE@test_sgen_qsort_SOURCES = main.c @@ -848,13 +875,23 @@ mini_libs = $(monodir)/mono/mini/libmini.la $(am__append_1) \ @CROSS_COMPILE_FALSE@@HOST_WIN32_FALSE@test_mono_callspec_LDFLAGS = $(test_ldflags) @CROSS_COMPILE_FALSE@@HOST_WIN32_FALSE@test_mono_callspec_DEPENDENCIES = callspec.exe @CROSS_COMPILE_FALSE@@HOST_WIN32_FALSE@test_mono_string_SOURCES = main.c -@CROSS_COMPILE_FALSE@@HOST_WIN32_FALSE@test_mono_string_CFLAGS = $(test-cflags) -DMAIN=test_mono_string_main +@CROSS_COMPILE_FALSE@@HOST_WIN32_FALSE@test_mono_string_CFLAGS = $(test_cflags) -DMAIN=test_mono_string_main @CROSS_COMPILE_FALSE@@HOST_WIN32_FALSE@test_mono_string_LDADD = $(test_ldadd) $(mini_libs) $(sgen_libs) libtestlib_la-test-mono-string.lo @CROSS_COMPILE_FALSE@@HOST_WIN32_FALSE@test_mono_string_LDFLAGS = $(test_ldflags) +@CROSS_COMPILE_FALSE@@HOST_WIN32_FALSE@test_mono_embed_SOURCES = main.c +@CROSS_COMPILE_FALSE@@HOST_WIN32_FALSE@test_mono_embed_CFLAGS = $(test_cflags) -DMAIN=test_mono_embed_main +@CROSS_COMPILE_FALSE@@HOST_WIN32_FALSE@test_mono_embed_LDADD = $(test_ldadd) $(mini_libs) $(sgen_libs) libtestlib_la-test-mono-embed.lo +@CROSS_COMPILE_FALSE@@HOST_WIN32_FALSE@test_mono_embed_LDFLAGS = $(test_ldflags) +@CROSS_COMPILE_FALSE@@HOST_WIN32_FALSE@test_mono_embed_DEPENDENCIES = test-embed.exe @CROSS_COMPILE_FALSE@@HOST_WIN32_FALSE@test_path_SOURCES = test-path.c @CROSS_COMPILE_FALSE@@HOST_WIN32_FALSE@test_path_CFLAGS = $(test-cflags) @CROSS_COMPILE_FALSE@@HOST_WIN32_FALSE@test_path_LDADD = $(test_ldadd) $(mini_libs) $(sgen_libs) @CROSS_COMPILE_FALSE@@HOST_WIN32_FALSE@test_path_LDFLAGS = $(test_ldflags) +@CROSS_COMPILE_FALSE@@HOST_WIN32_FALSE@test_embed_invoke_SOURCES = main.c +@CROSS_COMPILE_FALSE@@HOST_WIN32_FALSE@test_embed_invoke_CFLAGS = $(test_cflags) -DMAIN=test_mono_embed_invoke_main +@CROSS_COMPILE_FALSE@@HOST_WIN32_FALSE@test_embed_invoke_LDADD = $(test_ldadd) $(mini_libs) $(sgen_libs) libtestlib_la-test-embed-invoke.lo +@CROSS_COMPILE_FALSE@@HOST_WIN32_FALSE@test_embed_invoke_LDFLAGS = $(test_ldflags) +@CROSS_COMPILE_FALSE@@HOST_WIN32_FALSE@test_embed_invoke_DEPENDENCIES = test-embed-invoke-cs.exe @CROSS_COMPILE_FALSE@@HOST_WIN32_FALSE@AM_TESTS_ENVIRONMENT = export MONO_PATH=$(mcs_topdir)/class/lib/build; all: all-am @@ -918,6 +955,10 @@ test-conc-hashtable$(EXEEXT): $(test_conc_hashtable_OBJECTS) $(test_conc_hashtab @rm -f test-conc-hashtable$(EXEEXT) $(AM_V_CCLD)$(test_conc_hashtable_LINK) $(test_conc_hashtable_OBJECTS) $(test_conc_hashtable_LDADD) $(LIBS) +test-embed-invoke$(EXEEXT): $(test_embed_invoke_OBJECTS) $(test_embed_invoke_DEPENDENCIES) $(EXTRA_test_embed_invoke_DEPENDENCIES) + @rm -f test-embed-invoke$(EXEEXT) + $(AM_V_CCLD)$(test_embed_invoke_LINK) $(test_embed_invoke_OBJECTS) $(test_embed_invoke_LDADD) $(LIBS) + test-memfuncs$(EXEEXT): $(test_memfuncs_OBJECTS) $(test_memfuncs_DEPENDENCIES) $(EXTRA_test_memfuncs_DEPENDENCIES) @rm -f test-memfuncs$(EXEEXT) $(AM_V_CCLD)$(test_memfuncs_LINK) $(test_memfuncs_OBJECTS) $(test_memfuncs_LDADD) $(LIBS) @@ -926,6 +967,10 @@ test-mono-callspec$(EXEEXT): $(test_mono_callspec_OBJECTS) $(test_mono_callspec_ @rm -f test-mono-callspec$(EXEEXT) $(AM_V_CCLD)$(test_mono_callspec_LINK) $(test_mono_callspec_OBJECTS) $(test_mono_callspec_LDADD) $(LIBS) +test-mono-embed$(EXEEXT): $(test_mono_embed_OBJECTS) $(test_mono_embed_DEPENDENCIES) $(EXTRA_test_mono_embed_DEPENDENCIES) + @rm -f test-mono-embed$(EXEEXT) + $(AM_V_CCLD)$(test_mono_embed_LINK) $(test_mono_embed_OBJECTS) $(test_mono_embed_LDADD) $(LIBS) + test-mono-handle$(EXEEXT): $(test_mono_handle_OBJECTS) $(test_mono_handle_DEPENDENCIES) $(EXTRA_test_mono_handle_DEPENDENCIES) @rm -f test-mono-handle$(EXEEXT) $(AM_V_CCLD)$(test_mono_handle_LINK) $(test_mono_handle_OBJECTS) $(test_mono_handle_LDADD) $(LIBS) @@ -953,15 +998,19 @@ distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtestlib_la-test-conc-hashtable.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtestlib_la-test-embed-invoke.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtestlib_la-test-memfuncs.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtestlib_la-test-mono-callspec.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtestlib_la-test-mono-embed.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtestlib_la-test-mono-handle.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtestlib_la-test-mono-linked-list-set.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtestlib_la-test-mono-string.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtestlib_la-test-sgen-qsort.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_conc_hashtable-main.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_embed_invoke-main.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_memfuncs-main.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_mono_callspec-main.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_mono_embed-main.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_mono_handle-main.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_mono_linked_list_set-main.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_mono_string-main.Po@am__quote@ @@ -969,25 +1018,22 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_sgen_qsort-main.Po@am__quote@ .c.o: -@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ -@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: -@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ -@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: -@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ -@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ -@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< @@ -1041,6 +1087,20 @@ libtestlib_la-test-mono-string.lo: test-mono-string.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libtestlib_la_CFLAGS) $(CFLAGS) -c -o libtestlib_la-test-mono-string.lo `test -f 'test-mono-string.c' || echo '$(srcdir)/'`test-mono-string.c +libtestlib_la-test-mono-embed.lo: test-mono-embed.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libtestlib_la_CFLAGS) $(CFLAGS) -MT libtestlib_la-test-mono-embed.lo -MD -MP -MF $(DEPDIR)/libtestlib_la-test-mono-embed.Tpo -c -o libtestlib_la-test-mono-embed.lo `test -f 'test-mono-embed.c' || echo '$(srcdir)/'`test-mono-embed.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtestlib_la-test-mono-embed.Tpo $(DEPDIR)/libtestlib_la-test-mono-embed.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test-mono-embed.c' object='libtestlib_la-test-mono-embed.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libtestlib_la_CFLAGS) $(CFLAGS) -c -o libtestlib_la-test-mono-embed.lo `test -f 'test-mono-embed.c' || echo '$(srcdir)/'`test-mono-embed.c + +libtestlib_la-test-embed-invoke.lo: test-embed-invoke.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libtestlib_la_CFLAGS) $(CFLAGS) -MT libtestlib_la-test-embed-invoke.lo -MD -MP -MF $(DEPDIR)/libtestlib_la-test-embed-invoke.Tpo -c -o libtestlib_la-test-embed-invoke.lo `test -f 'test-embed-invoke.c' || echo '$(srcdir)/'`test-embed-invoke.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtestlib_la-test-embed-invoke.Tpo $(DEPDIR)/libtestlib_la-test-embed-invoke.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test-embed-invoke.c' object='libtestlib_la-test-embed-invoke.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libtestlib_la_CFLAGS) $(CFLAGS) -c -o libtestlib_la-test-embed-invoke.lo `test -f 'test-embed-invoke.c' || echo '$(srcdir)/'`test-embed-invoke.c + test_conc_hashtable-main.o: main.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_conc_hashtable_CFLAGS) $(CFLAGS) -MT test_conc_hashtable-main.o -MD -MP -MF $(DEPDIR)/test_conc_hashtable-main.Tpo -c -o test_conc_hashtable-main.o `test -f 'main.c' || echo '$(srcdir)/'`main.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_conc_hashtable-main.Tpo $(DEPDIR)/test_conc_hashtable-main.Po @@ -1055,6 +1115,20 @@ test_conc_hashtable-main.obj: main.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_conc_hashtable_CFLAGS) $(CFLAGS) -c -o test_conc_hashtable-main.obj `if test -f 'main.c'; then $(CYGPATH_W) 'main.c'; else $(CYGPATH_W) '$(srcdir)/main.c'; fi` +test_embed_invoke-main.o: main.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_embed_invoke_CFLAGS) $(CFLAGS) -MT test_embed_invoke-main.o -MD -MP -MF $(DEPDIR)/test_embed_invoke-main.Tpo -c -o test_embed_invoke-main.o `test -f 'main.c' || echo '$(srcdir)/'`main.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_embed_invoke-main.Tpo $(DEPDIR)/test_embed_invoke-main.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='main.c' object='test_embed_invoke-main.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_embed_invoke_CFLAGS) $(CFLAGS) -c -o test_embed_invoke-main.o `test -f 'main.c' || echo '$(srcdir)/'`main.c + +test_embed_invoke-main.obj: main.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_embed_invoke_CFLAGS) $(CFLAGS) -MT test_embed_invoke-main.obj -MD -MP -MF $(DEPDIR)/test_embed_invoke-main.Tpo -c -o test_embed_invoke-main.obj `if test -f 'main.c'; then $(CYGPATH_W) 'main.c'; else $(CYGPATH_W) '$(srcdir)/main.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_embed_invoke-main.Tpo $(DEPDIR)/test_embed_invoke-main.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='main.c' object='test_embed_invoke-main.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_embed_invoke_CFLAGS) $(CFLAGS) -c -o test_embed_invoke-main.obj `if test -f 'main.c'; then $(CYGPATH_W) 'main.c'; else $(CYGPATH_W) '$(srcdir)/main.c'; fi` + test_memfuncs-main.o: main.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_memfuncs_CFLAGS) $(CFLAGS) -MT test_memfuncs-main.o -MD -MP -MF $(DEPDIR)/test_memfuncs-main.Tpo -c -o test_memfuncs-main.o `test -f 'main.c' || echo '$(srcdir)/'`main.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_memfuncs-main.Tpo $(DEPDIR)/test_memfuncs-main.Po @@ -1083,6 +1157,20 @@ test_mono_callspec-main.obj: main.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_mono_callspec_CFLAGS) $(CFLAGS) -c -o test_mono_callspec-main.obj `if test -f 'main.c'; then $(CYGPATH_W) 'main.c'; else $(CYGPATH_W) '$(srcdir)/main.c'; fi` +test_mono_embed-main.o: main.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_mono_embed_CFLAGS) $(CFLAGS) -MT test_mono_embed-main.o -MD -MP -MF $(DEPDIR)/test_mono_embed-main.Tpo -c -o test_mono_embed-main.o `test -f 'main.c' || echo '$(srcdir)/'`main.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_mono_embed-main.Tpo $(DEPDIR)/test_mono_embed-main.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='main.c' object='test_mono_embed-main.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_mono_embed_CFLAGS) $(CFLAGS) -c -o test_mono_embed-main.o `test -f 'main.c' || echo '$(srcdir)/'`main.c + +test_mono_embed-main.obj: main.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_mono_embed_CFLAGS) $(CFLAGS) -MT test_mono_embed-main.obj -MD -MP -MF $(DEPDIR)/test_mono_embed-main.Tpo -c -o test_mono_embed-main.obj `if test -f 'main.c'; then $(CYGPATH_W) 'main.c'; else $(CYGPATH_W) '$(srcdir)/main.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_mono_embed-main.Tpo $(DEPDIR)/test_mono_embed-main.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='main.c' object='test_mono_embed-main.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_mono_embed_CFLAGS) $(CFLAGS) -c -o test_mono_embed-main.obj `if test -f 'main.c'; then $(CYGPATH_W) 'main.c'; else $(CYGPATH_W) '$(srcdir)/main.c'; fi` + test_mono_handle-main.o: main.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_mono_handle_CFLAGS) $(CFLAGS) -MT test_mono_handle-main.o -MD -MP -MF $(DEPDIR)/test_mono_handle-main.Tpo -c -o test_mono_handle-main.o `test -f 'main.c' || echo '$(srcdir)/'`main.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_mono_handle-main.Tpo $(DEPDIR)/test_mono_handle-main.Po @@ -1410,6 +1498,20 @@ test-mono-string.log: test-mono-string$(EXEEXT) --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) +test-mono-embed.log: test-mono-embed$(EXEEXT) + @p='test-mono-embed$(EXEEXT)'; \ + b='test-mono-embed'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-embed-invoke.log: test-embed-invoke$(EXEEXT) + @p='test-embed-invoke$(EXEEXT)'; \ + b='test-embed-invoke'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) .test.log: @p='$<'; \ $(am__set_b); \ @@ -1613,11 +1715,19 @@ uninstall-am: @CROSS_COMPILE_FALSE@@HOST_WIN32_FALSE@ fi; @CROSS_COMPILE_FALSE@@HOST_WIN32_FALSE@clean-local: -@CROSS_COMPILE_FALSE@@HOST_WIN32_FALSE@ rm -f callspec.exe callspec.pdb +@CROSS_COMPILE_FALSE@@HOST_WIN32_FALSE@ rm -f callspec.exe callspec.pdb +@CROSS_COMPILE_FALSE@@HOST_WIN32_FALSE@ rm -f test-embed.exe test-embed.pdb +@CROSS_COMPILE_FALSE@@HOST_WIN32_FALSE@ rm -f test-embed-invoke-cs.exe test-embed-invoke-cs.pdb @CROSS_COMPILE_FALSE@@HOST_WIN32_FALSE@%.exe: %.cs @CROSS_COMPILE_FALSE@@HOST_WIN32_FALSE@ $(MCS) -r:$(CLASS)/System.dll -r:$(CLASS)/System.Xml.dll -r:$(CLASS)/System.Core.dll -out:$@ $< +@CROSS_COMPILE_FALSE@@HOST_WIN32_FALSE@test-embed.exe: $(top_srcdir)/samples/embed/test.cs +@CROSS_COMPILE_FALSE@@HOST_WIN32_FALSE@ $(MCS) -r:$(CLASS)/System.dll -r:$(CLASS)/System.Xml.dll -r:$(CLASS)/System.Core.dll -out:$@ $< + +@CROSS_COMPILE_FALSE@@HOST_WIN32_FALSE@test-embed-invoke-cs.exe: $(top_srcdir)/samples/embed/invoke.cs +@CROSS_COMPILE_FALSE@@HOST_WIN32_FALSE@ $(MCS) -r:$(CLASS)/System.dll -r:$(CLASS)/System.Xml.dll -r:$(CLASS)/System.Core.dll -out:$@ $< + # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: diff --git a/mono/unit-tests/test-conc-hashtable.c b/mono/unit-tests/test-conc-hashtable.c index 407d1a5208..a1e843e237 100644 --- a/mono/unit-tests/test-conc-hashtable.c +++ b/mono/unit-tests/test-conc-hashtable.c @@ -319,7 +319,7 @@ benchmark_glib (void) } static void -thread_state_init (MonoThreadUnwindState *ctx) +monotest_thread_state_init (MonoThreadUnwindState *ctx) { } @@ -329,16 +329,22 @@ extern "C" int test_conc_hashtable_main (void); + +#define monotest_setup_async_callback NULL +#define monotest_thread_state_init_from_sigctx NULL +#define monotest_thread_state_init_from_handle NULL + int test_conc_hashtable_main (void) { - MonoThreadInfoRuntimeCallbacks ticallbacks; + static const MonoThreadInfoRuntimeCallbacks ticallbacks = { + MONO_THREAD_INFO_RUNTIME_CALLBACKS (MONO_INIT_CALLBACK, monotest) + }; + int res = 0; CHECKED_MONO_INIT (); mono_thread_info_init (sizeof (MonoThreadInfo)); - memset (&ticallbacks, 0, sizeof (ticallbacks)); - ticallbacks.thread_state_init = thread_state_init; mono_thread_info_runtime_init (&ticallbacks); #ifndef HOST_WIN32 mono_w32handle_init (); diff --git a/mono/unit-tests/test-embed-invoke.c b/mono/unit-tests/test-embed-invoke.c new file mode 100644 index 0000000000..f5c14c7e70 --- /dev/null +++ b/mono/unit-tests/test-embed-invoke.c @@ -0,0 +1,7 @@ +/* + * test-embed-invoke.c: Unit test for embed mono. + */ + +#define _TESTCASE_ +#include +#include diff --git a/mono/unit-tests/test-mono-callspec.c b/mono/unit-tests/test-mono-callspec.c index 15df8417c7..186286c22c 100644 --- a/mono/unit-tests/test-mono-callspec.c +++ b/mono/unit-tests/test-mono-callspec.c @@ -5,6 +5,19 @@ * */ +// Embedders do not have the luxury of our config.h, so skip it here. +//#include "config.h" + +// But we need MONO_INSIDE_RUNTIME to get MonoError mangled correctly +// because we also test unexported functions (mono_class_from_name_checked). +#define MONO_INSIDE_RUNTIME 1 + +#include "mono/utils/mono-publib.h" + +// Allow to test external_only w/o deprecation error. +#undef MONO_RT_EXTERNAL_ONLY +#define MONO_RT_EXTERNAL_ONLY /* nothing */ + #include #include #include @@ -179,7 +192,7 @@ test_mono_callspec_main (void) goto out; } - domain = mono_jit_init_version ("TEST RUNNER", "mobile"); + domain = mono_jit_init_version_for_test_only ("TEST RUNNER", "mobile"); assembly = mono_assembly_open (TESTPROG, &status); if (!domain || !assembly) { res = 1; diff --git a/mono/unit-tests/test-mono-embed.c b/mono/unit-tests/test-mono-embed.c new file mode 100644 index 0000000000..cadeb302b3 --- /dev/null +++ b/mono/unit-tests/test-mono-embed.c @@ -0,0 +1,7 @@ +/* + * test-mono-embed.c: Unit test for embed mono. + */ + +#define _TESTCASE_ +#include +#include diff --git a/mono/unit-tests/test-mono-linked-list-set.c b/mono/unit-tests/test-mono-linked-list-set.c index f49c99e9cd..6a2f80cbbf 100644 --- a/mono/unit-tests/test-mono-linked-list-set.c +++ b/mono/unit-tests/test-mono-linked-list-set.c @@ -34,7 +34,7 @@ typedef struct { static node_t nodes [N]; -static inline void +static void mono_hazard_pointer_clear_all (MonoThreadHazardPointers *hp, int retain) { if (retain != 0) diff --git a/mono/unit-tests/test-mono-string.c b/mono/unit-tests/test-mono-string.c index 438263fb80..b5454861fc 100644 --- a/mono/unit-tests/test-mono-string.c +++ b/mono/unit-tests/test-mono-string.c @@ -41,7 +41,7 @@ new_string_conv_err (void) ERROR_DECL (error); static const unsigned char bytes[] = { 'a', 0xFC, 'b', 'c', 0 }; MonoString G_GNUC_UNUSED *s = mono_string_new_checked (mono_domain_get (), (const char*)bytes, error); - g_assert (!mono_error_ok (error)); + g_assert (!is_ok (error)); const char *msg = mono_error_get_message (error); g_assert (msg != NULL); fprintf (stderr, "(expected) error message was: \"%s\"", msg); @@ -59,7 +59,7 @@ int test_mono_string_main (void) { - mono_jit_init_version ("test-mono-string", "v4.0.30319"); + mono_jit_init_version_for_test_only ("test-mono-string", "v4.0.30319"); int res = 0; diff --git a/mono/unit-tests/test-sgen-qsort.c b/mono/unit-tests/test-sgen-qsort.c index 93c339fbdc..0633c6e14d 100644 --- a/mono/unit-tests/test-sgen-qsort.c +++ b/mono/unit-tests/test-sgen-qsort.c @@ -71,7 +71,7 @@ compare_sorts (void *base, size_t nel, size_t width, int (*compar) (const void*, memcpy (b1, base, len); memcpy (b2, base, len); - qsort (b1, nel, width, compar); + mono_qsort (b1, nel, width, compar); sgen_qsort (b2, nel, width, compar); /* We can't assert that qsort and sgen_qsort produce the same results diff --git a/mono/utils/Makefile.am b/mono/utils/Makefile.am index c870daca68..843804fd2e 100644 --- a/mono/utils/Makefile.am +++ b/mono/utils/Makefile.am @@ -1,5 +1,7 @@ include $(top_srcdir)/mk/common.mk +if !ENABLE_MSVC_ONLY + noinst_LTLIBRARIES = \ libmonomath.la \ libmonoutils.la @@ -49,6 +51,8 @@ win32_sources = \ platform_sources = $(win32_sources) else unix_sources = \ + dlmalloc.h \ + dlmalloc.c \ os-event-unix.c platform_sources = $(unix_sources) @@ -61,8 +65,6 @@ monoutils_sources = \ mono-logger.c \ mono-logger-internals.h \ mono-codeman.c \ - dlmalloc.h \ - dlmalloc.c \ mono-counters.c \ mono-compiler.h \ mono-complex.h \ @@ -313,12 +315,20 @@ endif libmonoutils_la_SOURCES = $(monoutils_sources) $(arch_sources) libmonoutils_la_CFLAGS = $(JEMALLOC_CFLAGS) @CXX_ADD_CFLAGS@ libmonoutils_la_LDFLAGS = $(JEMALLOC_LDFLAGS) + +endif # !ENABLE_MSVC_ONLY + libmonoutilsincludedir = $(includedir)/mono-$(API_VER)/mono/utils + +if !ENABLE_MSVC_ONLY + libmonoutils_la_LIBADD = mono-math-c.lo libmonomath_la_SOURCES = mono-math-c.c libmonomath_la_CFLAGS = @CXX_REMOVE_CFLAGS@ +endif # !ENABLE_MSVC_ONLY + # These are public headers. # They should not use glib.h, G_BEGIN_DECLS, guint, etc. # They should be wrapped in MONO_BEGIN_DECLS / MONO_END_DECLS. @@ -340,3 +350,15 @@ SUBDIRS = jemalloc endif CFLAGS := $(filter-out @CXX_REMOVE_CFLAGS@, @CFLAGS@) + +if ENABLE_MSVC_ONLY + +all-local: + + make -C $(top_srcdir)/msvc libmonoutils + +clean-local: + + make -C $(top_srcdir)/msvc clean-libmonoutils + +endif # ENABLE_MSVC_ONLY diff --git a/mono/utils/Makefile.in.REMOVED.git-id b/mono/utils/Makefile.in.REMOVED.git-id index 330c079d60..79d5dccec4 100644 --- a/mono/utils/Makefile.in.REMOVED.git-id +++ b/mono/utils/Makefile.in.REMOVED.git-id @@ -1 +1 @@ -d988559fe80e818d89c700e81cc5d20cef1fea93 \ No newline at end of file +5cd54f1e7b44d4dfab33324c635dd91b08534e3d \ No newline at end of file diff --git a/mono/utils/checked-build.c b/mono/utils/checked-build.c index e4417c13c6..8cd87353ff 100644 --- a/mono/utils/checked-build.c +++ b/mono/utils/checked-build.c @@ -144,14 +144,14 @@ get_state (void) return state; } -static inline void +static void ringbuf_unpack (gint32 ringbuf, guint16 *buf_start, guint16 *buf_end) { *buf_start = (guint16) (ringbuf >> 16); *buf_end = (guint16) (ringbuf & 0x00FF); } -static inline gint32 +static gint32 ringbuf_pack (guint16 buf_start, guint16 buf_end) { return ((((gint32)buf_start) << 16) | ((gint32)buf_end)); @@ -369,6 +369,7 @@ assert_gc_safe_mode (const char *file, int lineno) switch (state = mono_thread_info_current_state (cur)) { case STATE_BLOCKING: case STATE_BLOCKING_SELF_SUSPENDED: + case STATE_BLOCKING_SUSPEND_REQUESTED: break; default: mono_fatal_with_history ("%s:%d: Expected GC Safe mode but was in %s state", file, lineno, mono_thread_state_name (state)); @@ -413,6 +414,7 @@ assert_gc_neutral_mode (const char *file, int lineno) case STATE_ASYNC_SUSPEND_REQUESTED: case STATE_BLOCKING: case STATE_BLOCKING_SELF_SUSPENDED: + case STATE_BLOCKING_SUSPEND_REQUESTED: break; default: mono_fatal_with_history ("%s:%d: Expected GC Neutral mode but was in %s state", file, lineno, mono_thread_state_name (state)); diff --git a/mono/utils/hazard-pointer.c b/mono/utils/hazard-pointer.c index 86f8d211c0..8fe373e64f 100644 --- a/mono/utils/hazard-pointer.c +++ b/mono/utils/hazard-pointer.c @@ -401,7 +401,7 @@ mono_thread_smr_init (void) { int i; - mono_os_mutex_init_recursive(&small_id_mutex); + mono_os_mutex_init (&small_id_mutex); mono_counters_register ("Hazardous pointers", MONO_COUNTER_JIT | MONO_COUNTER_INT, &hazardous_pointer_count); for (i = 0; i < HAZARD_TABLE_OVERFLOW; ++i) { diff --git a/mono/utils/jemalloc/Makefile.in b/mono/utils/jemalloc/Makefile.in index 9f70f672d4..3249ce833d 100644 --- a/mono/utils/jemalloc/Makefile.in +++ b/mono/utils/jemalloc/Makefile.in @@ -221,6 +221,7 @@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTERP_CFLAGS = @INTERP_CFLAGS@ INTL = @INTL@ INVARIANT_AOT_OPTIONS = @INVARIANT_AOT_OPTIONS@ JEMALLOC_AUTOCONF_FLAGS = @JEMALLOC_AUTOCONF_FLAGS@ diff --git a/mono/utils/mono-codeman.c b/mono/utils/mono-codeman.c index 0f1c88d0b8..a69f25bb43 100644 --- a/mono/utils/mono-codeman.c +++ b/mono/utils/mono-codeman.c @@ -12,13 +12,15 @@ #include #include -/* For dlmalloc.h */ -#define USE_DL_PREFIX 1 - #include "mono-codeman.h" #include "mono-mmap.h" #include "mono-counters.h" +#if _WIN32 +static void* mono_code_manager_heap; +#else +#define USE_DL_PREFIX 1 #include "dlmalloc.h" +#endif #include #ifdef HAVE_VALGRIND_MEMCHECK_H #include @@ -39,11 +41,15 @@ static const MonoCodeManagerCallbacks *code_manager_callbacks; * malloc when using dynamic code managers. The system malloc can't do this so we use a * slighly modified version of Doug Lea's Malloc package for this purpose: * http://g.oswego.edu/dl/html/malloc.html + * + * Or on Windows, HeapCreate (HEAP_CREATE_ENABLE_EXECUTE). */ #define MIN_PAGES 16 -#if defined(__x86_64__) || defined (_WIN64) +#if _WIN32 // These are the same. +#define MIN_ALIGN MEMORY_ALLOCATION_ALIGNMENT +#elif defined(__x86_64__) /* * We require 16 byte alignment on amd64 so the fp literals embedded in the code are * properly aligned for SSE2. @@ -65,29 +71,29 @@ static const MonoCodeManagerCallbacks *code_manager_callbacks; #define MONO_PROT_RWX (MONO_MMAP_READ|MONO_MMAP_WRITE|MONO_MMAP_EXEC|MONO_MMAP_JIT) -typedef struct _CodeChunck CodeChunk; +typedef struct _CodeChunk CodeChunk; enum { CODE_FLAG_MMAP, CODE_FLAG_MALLOC }; -struct _CodeChunck { +struct _CodeChunk { char *data; + CodeChunk *next; int pos; int size; - CodeChunk *next; - unsigned int flags: 8; + unsigned int reserved: 8; /* this number of bytes is available to resolve addresses far in memory */ unsigned int bsize: 24; }; struct _MonoCodeManager { - int dynamic; - int read_only; CodeChunk *current; CodeChunk *full; CodeChunk *last; + int dynamic : 1; + int read_only : 1; }; #define ALIGN_INT(val,alignment) (((val) + (alignment - 1)) & ~(alignment - 1)) @@ -184,6 +190,47 @@ mono_code_manager_install_callbacks (const MonoCodeManagerCallbacks* callbacks) code_manager_callbacks = callbacks; } +static +int +mono_codeman_allocation_type (MonoCodeManager const *cman) +{ +#ifdef FORCE_MALLOC + return CODE_FLAG_MALLOC; +#else + return cman->dynamic ? CODE_FLAG_MALLOC : CODE_FLAG_MMAP; +#endif +} + +/** + * mono_code_manager_new_internal + * + * Returns: the new code manager + */ +static +MonoCodeManager* +mono_code_manager_new_internal (gboolean dynamic) +{ + MonoCodeManager* cman = g_new0 (MonoCodeManager, 1); + if (cman) { + cman->dynamic = dynamic; +#if _WIN32 + // It would seem the heap should live and die with the codemanager, + // but that was failing, so try a global. + if (mono_codeman_allocation_type (cman) == CODE_FLAG_MALLOC && !mono_code_manager_heap) { + // This heap is leaked, similar to dlmalloc state. + void* const heap = HeapCreate (HEAP_CREATE_ENABLE_EXECUTE, 0, 0); + if (heap && mono_atomic_cas_ptr (&mono_code_manager_heap, heap, NULL)) + HeapDestroy (heap); + if (!mono_code_manager_heap) { + mono_code_manager_destroy (cman); + cman = 0; + } + } +#endif + } + return cman; +} + /** * mono_code_manager_new: * @@ -198,7 +245,7 @@ mono_code_manager_install_callbacks (const MonoCodeManagerCallbacks* callbacks) MonoCodeManager* mono_code_manager_new (void) { - return (MonoCodeManager *) g_malloc0 (sizeof (MonoCodeManager)); + return mono_code_manager_new_internal (FALSE); } /** @@ -213,14 +260,37 @@ mono_code_manager_new (void) MonoCodeManager* mono_code_manager_new_dynamic (void) { - MonoCodeManager *cman = mono_code_manager_new (); - cman->dynamic = 1; - return cman; + return mono_code_manager_new_internal (TRUE); } +static gpointer +mono_codeman_malloc (gsize n) +{ +#if _WIN32 + void* const heap = mono_code_manager_heap; + g_assert (heap); + return HeapAlloc (heap, 0, n); +#else + return dlmemalign (MIN_ALIGN, n); +#endif +} static void -free_chunklist (CodeChunk *chunk) +mono_codeman_free (gpointer p) +{ + if (!p) + return; +#if _WIN32 + void* const heap = mono_code_manager_heap; + g_assert (heap); + HeapFree (heap, 0, p); +#else + dlfree (p); +#endif +} + +static void +free_chunklist (MonoCodeManager *cman, CodeChunk *chunk) { CodeChunk *dead; @@ -233,17 +303,22 @@ free_chunklist (CodeChunk *chunk) #define valgrind_unregister(x) #endif + if (!chunk) + return; + + const int flags = mono_codeman_allocation_type (cman); + for (; chunk; ) { dead = chunk; MONO_PROFILER_RAISE (jit_chunk_destroyed, ((mono_byte *) dead->data)); if (code_manager_callbacks) code_manager_callbacks->chunk_destroy (dead->data); chunk = chunk->next; - if (dead->flags == CODE_FLAG_MMAP) { + if (flags == CODE_FLAG_MMAP) { codechunk_vfree (dead->data, dead->size); /* valgrind_unregister(dead->data); */ - } else if (dead->flags == CODE_FLAG_MALLOC) { - dlfree (dead->data); + } else if (flags == CODE_FLAG_MALLOC) { + mono_codeman_free (dead->data); } code_memory_used -= dead->size; g_free (dead); @@ -258,8 +333,10 @@ free_chunklist (CodeChunk *chunk) void mono_code_manager_destroy (MonoCodeManager *cman) { - free_chunklist (cman->full); - free_chunklist (cman->current); + if (!cman) + return; + free_chunklist (cman, cman->full); + free_chunklist (cman, cman->current); g_free (cman); } @@ -270,7 +347,7 @@ mono_code_manager_destroy (MonoCodeManager *cman) * so that any attempt to execute code allocated in the code * manager \p cman will fail. This is used for debugging purposes. */ -void +void mono_code_manager_invalidate (MonoCodeManager *cman) { CodeChunk *chunk; @@ -292,7 +369,7 @@ mono_code_manager_invalidate (MonoCodeManager *cman) * \param cman a code manager * Make the code manager read only, so further allocation requests cause an assert. */ -void +void mono_code_manager_set_read_only (MonoCodeManager *cman) { cman->read_only = TRUE; @@ -320,7 +397,7 @@ mono_code_manager_foreach (MonoCodeManager *cman, MonoCodeManagerFunc func, void } } -/* BIND_ROOM is the divisor for the chunck of code size dedicated +/* BIND_ROOM is the divisor for the chunk of code size dedicated * to binding branches (branches not reachable with the immediate displacement) * bind_size = size/BIND_ROOM; * we should reduce it and make MIN_PAGES bigger for such systems @@ -333,26 +410,22 @@ mono_code_manager_foreach (MonoCodeManager *cman, MonoCodeManagerFunc func, void #endif static CodeChunk* -new_codechunk (CodeChunk *last, int dynamic, int size) +new_codechunk (MonoCodeManager *cman, int size) { - int minsize, flags = CODE_FLAG_MMAP; + CodeChunk * const last = cman->last; + int const dynamic = cman->dynamic; int chunk_size, bsize = 0; - int pagesize, valloc_granule; CodeChunk *chunk; void *ptr; -#ifdef FORCE_MALLOC - flags = CODE_FLAG_MALLOC; -#endif - - pagesize = mono_pagesize (); - valloc_granule = mono_valloc_granule (); + const int flags = mono_codeman_allocation_type (cman); + const int pagesize = mono_pagesize (); + const int valloc_granule = mono_valloc_granule (); if (dynamic) { chunk_size = size; - flags = CODE_FLAG_MALLOC; } else { - minsize = MAX (pagesize * MIN_PAGES, valloc_granule); + const int minsize = MAX (pagesize * MIN_PAGES, valloc_granule); if (size < minsize) chunk_size = minsize; else { @@ -386,7 +459,7 @@ new_codechunk (CodeChunk *last, int dynamic, int size) #endif if (flags == CODE_FLAG_MALLOC) { - ptr = dlmemalign (MIN_ALIGN, chunk_size + MIN_ALIGN - 1); + ptr = mono_codeman_malloc (chunk_size + MIN_ALIGN - 1); if (!ptr) return NULL; } else { @@ -400,17 +473,17 @@ new_codechunk (CodeChunk *last, int dynamic, int size) return NULL; } - if (flags == CODE_FLAG_MALLOC) { #ifdef BIND_ROOM + if (flags == CODE_FLAG_MALLOC) { /* Make sure the thunks area is zeroed */ memset (ptr, 0, bsize); -#endif } +#endif chunk = (CodeChunk *) g_malloc (sizeof (CodeChunk)); if (!chunk) { if (flags == CODE_FLAG_MALLOC) - dlfree (ptr); + mono_codeman_free (ptr); else mono_vfree (ptr, chunk_size, MONO_MEM_ACCOUNT_CODE); return NULL; @@ -418,7 +491,7 @@ new_codechunk (CodeChunk *last, int dynamic, int size) chunk->next = NULL; chunk->size = chunk_size; chunk->data = (char *) ptr; - chunk->flags = flags; + chunk->reserved = 0; chunk->pos = bsize; chunk->bsize = bsize; if (code_manager_callbacks) @@ -459,7 +532,7 @@ mono_code_manager_reserve_align (MonoCodeManager *cman, int size, int alignment) } if (!cman->current) { - cman->current = new_codechunk (cman->last, cman->dynamic, size); + cman->current = new_codechunk (cman, size); if (!cman->current) return NULL; cman->last = cman->current; @@ -492,7 +565,7 @@ mono_code_manager_reserve_align (MonoCodeManager *cman, int size, int alignment) cman->full = chunk; break; } - chunk = new_codechunk (cman->last, cman->dynamic, size); + chunk = new_codechunk (cman, size); if (!chunk) return NULL; chunk->next = cman->current; diff --git a/mono/utils/mono-compiler.h b/mono/utils/mono-compiler.h index 970b85ed07..323c7cc201 100644 --- a/mono/utils/mono-compiler.h +++ b/mono/utils/mono-compiler.h @@ -50,12 +50,11 @@ typedef ptrdiff_t ssize_t; #endif /* _MSC_VER */ -#ifdef _MSC_VER -// Quiet Visual Studio linker warning, LNK4221, in cases when this source file intentional ends up empty. -#define MONO_EMPTY_SOURCE_FILE(x) void __mono_win32_ ## x ## _quiet_lnk4221 (void) {} -#else -#define MONO_EMPTY_SOURCE_FILE(x) -#endif +// Quiet Visual Studio linker warning, LNK4221: This object file does not define any previously +// undefined public symbols, so it will not be used by any link operation that consumes this library. +// And other linkers, e.g. older Apple. +#define MONO_EMPTY_SOURCE_FILE(x) extern const char mono_quash_linker_empty_file_warning_ ## x; \ + const char mono_quash_linker_empty_file_warning_ ## x = 0; #ifdef _MSC_VER #define MONO_PRAGMA_WARNING_PUSH() __pragma(warning (push)) diff --git a/mono/utils/mono-context.h b/mono/utils/mono-context.h index 77be2785bf..dda6b868d0 100644 --- a/mono/utils/mono-context.h +++ b/mono/utils/mono-context.h @@ -905,7 +905,24 @@ typedef struct ucontext MonoContext; #define MONO_CONTEXT_GET_CURRENT(ctx) \ __asm__ __volatile__( \ "stmg %%r0,%%r15,0(%0)\n" \ - : : "r" (&(ctx).uc_mcontext.gregs[0]) \ + "std %%f0,0(%1)\n" \ + "std %%f1,8(%1)\n" \ + "std %%f2,16(%1)\n" \ + "std %%f3,24(%1)\n" \ + "std %%f4,32(%1)\n" \ + "std %%f5,40(%1)\n" \ + "std %%f6,48(%1)\n" \ + "std %%f7,56(%1)\n" \ + "std %%f8,64(%1)\n" \ + "std %%f9,72(%1)\n" \ + "std %%f10,80(%1)\n" \ + "std %%f11,88(%1)\n" \ + "std %%f12,96(%1)\n" \ + "std %%f13,104(%1)\n" \ + "std %%f14,112(%1)\n" \ + "std %%f15,120(%1)\n" \ + : : "r" (&(ctx).uc_mcontext.gregs[0]), \ + "r" (&(ctx).uc_mcontext.fpregs.fprs[0]) \ : "memory" \ ) diff --git a/mono/utils/mono-dl.c b/mono/utils/mono-dl.c index 0f03daa307..8023730f69 100644 --- a/mono/utils/mono-dl.c +++ b/mono/utils/mono-dl.c @@ -131,11 +131,11 @@ get_dl_name_from_libtool (const char *libtool_file) if (installed && strcmp (installed, "no") == 0) { char *dir = g_path_get_dirname (libtool_file); if (dlname) - line = g_strconcat (dir, G_DIR_SEPARATOR_S ".libs" G_DIR_SEPARATOR_S, dlname, NULL); + line = g_strconcat (dir, G_DIR_SEPARATOR_S ".libs" G_DIR_SEPARATOR_S, dlname, (const char*)NULL); g_free (dir); } else { if (libdir && dlname) - line = g_strconcat (libdir, G_DIR_SEPARATOR_S, dlname, NULL); + line = g_strconcat (libdir, G_DIR_SEPARATOR_S, dlname, (const char*)NULL); } g_free (dlname); g_free (libdir); @@ -213,7 +213,7 @@ mono_dl_open (const char *name, int flags, char **error_msg) ext = strrchr (name, '.'); if (ext && strcmp (ext, ".la") == 0) suff = ""; - lname = g_strconcat (name, suff, NULL); + lname = g_strconcat (name, suff, (const char*)NULL); llname = get_dl_name_from_libtool (lname); g_free (lname); if (llname) { @@ -229,7 +229,7 @@ mono_dl_open (const char *name, int flags, char **error_msg) if (!lib && is_library_ar_archive (llname)) { /* try common suffix */ char *llaixname; - llaixname = g_strconcat (llname, "(shr_64.o)", NULL); + llaixname = g_strconcat (llname, "(shr_64.o)", (const char*)NULL); lib = mono_dl_open_file (llaixname, lflags); /* XXX: try another suffix like (shr.o)? */ g_free (llaixname); @@ -391,9 +391,9 @@ mono_dl_build_path (const char *directory, const char *name, void **iter) suffix = ""; if (directory && *directory) - res = g_strconcat (directory, G_DIR_SEPARATOR_S, prefix, name, suffix, NULL); + res = g_strconcat (directory, G_DIR_SEPARATOR_S, prefix, name, suffix, (const char*)NULL); else - res = g_strconcat (prefix, name, suffix, NULL); + res = g_strconcat (prefix, name, suffix, (const char*)NULL); ++iteration; *iter = GUINT_TO_POINTER (iteration); return res; diff --git a/mono/utils/mono-error-internals.h b/mono/utils/mono-error-internals.h index 3088d01aad..cf80c03db4 100644 --- a/mono/utils/mono-error-internals.h +++ b/mono/utils/mono-error-internals.h @@ -9,33 +9,38 @@ #include "mono/utils/mono-compiler.h" /*Keep in sync with MonoError*/ -typedef struct { - // Written by JITted code - guint16 error_code; - guint16 flags; +typedef union _MonoErrorInternal { + // Merge two uint16 into one uint32 so it can be initialized + // with one instruction instead of two. + guint32 init; // Written by JITted code + struct { + guint16 error_code; + guint16 flags; - /*These name are suggestions of their content. MonoError internals might use them for something else.*/ - // type_name must be right after error_code and flags, see mono_error_init_deferred. - const char *type_name; - const char *assembly_name; - const char *member_name; - const char *exception_name_space; - const char *exception_name; - union { - /* Valid if error_code != MONO_ERROR_EXCEPTION_INSTANCE. - * Used by type or field load errors and generic error specified by class. - */ - MonoClass *klass; - /* Valid if error_code == MONO_ERROR_EXCEPTION_INSTANCE. - * Generic error specified by a managed instance. - */ - uint32_t instance_handle; - } exn; - const char *full_message; - const char *full_message_with_fields; - const char *first_argument; + /*These name are suggestions of their content. MonoError internals might use them for something else.*/ + // type_name must be right after error_code and flags, see mono_error_init_deferred. + const char *type_name; + const char *assembly_name; + const char *member_name; + const char *exception_name_space; + const char *exception_name; + union { + /* Valid if error_code != MONO_ERROR_EXCEPTION_INSTANCE. + * Used by type or field load errors and generic error specified by class. + */ + MonoClass *klass; + /* Valid if error_code == MONO_ERROR_EXCEPTION_INSTANCE. + * Generic error specified by a managed instance. + */ + uint32_t instance_handle; + } exn; + const char *full_message; + const char *full_message_with_fields; + const char *first_argument; - void *padding [3]; + // MonoErrorExternal: + //void *padding [3]; + }; } MonoErrorInternal; /* Invariant: the error strings are allocated in the mempool of the given image */ diff --git a/mono/utils/mono-error.c b/mono/utils/mono-error.c index 16dbe1ecfe..3365dd4cfe 100644 --- a/mono/utils/mono-error.c +++ b/mono/utils/mono-error.c @@ -120,7 +120,7 @@ void mono_error_init_flags (MonoError *oerror, guint16 flags) { MonoErrorInternal *error = (MonoErrorInternal*)oerror; - g_assert (sizeof (MonoError) == sizeof (MonoErrorInternal)); + g_static_assert (sizeof (MonoErrorExternal) >= sizeof (MonoErrorInternal)); error->error_code = MONO_ERROR_NONE; error->flags = flags; @@ -189,7 +189,7 @@ mono_error_cleanup (MonoError *oerror) gboolean mono_error_ok (MonoError *error) { - return error->error_code == MONO_ERROR_NONE; + return is_ok (error); } guint16 @@ -672,7 +672,7 @@ mono_error_prepare_exception (MonoError *oerror, MonoError *error_out) if ((error->type_name && error->assembly_name) || error->exn.klass) { type_name = get_type_name_as_mono_string (error, domain, error_out); - if (!mono_error_ok (error_out)) + if (!is_ok (error_out)) break; if (error->assembly_name) { @@ -757,7 +757,7 @@ mono_error_prepare_exception (MonoError *oerror, MonoError *error_out) mono_error_set_execution_engine (error_out, "Invalid error-code %d", error->error_code); } - if (!mono_error_ok (error_out)) + if (!is_ok (error_out)) goto return_null; if (MONO_HANDLE_IS_NULL (exception)) @@ -787,17 +787,17 @@ mono_error_convert_to_exception (MonoError *target_error) /* Mempool stored error shouldn't be cleaned up */ g_assert (!is_boxed ((MonoErrorInternal*)target_error)); - if (mono_error_ok (target_error)) + if (is_ok (target_error)) return NULL; ex = mono_error_prepare_exception (target_error, error); - if (!mono_error_ok (error)) { + if (!is_ok (error)) { ERROR_DECL (second_chance); /*Try to produce the exception for the second error. FIXME maybe we should log about the original one*/ ex = mono_error_prepare_exception (error, second_chance); // We cannot reasonably handle double faults, maybe later. - g_assert (mono_error_ok (second_chance)); + g_assert (is_ok (second_chance)); mono_error_cleanup (error); } mono_error_cleanup (target_error); diff --git a/mono/utils/mono-error.h b/mono/utils/mono-error.h index c1000e30da..69bfb8a473 100644 --- a/mono/utils/mono-error.h +++ b/mono/utils/mono-error.h @@ -65,12 +65,18 @@ typedef union _MonoError { uint16_t private_flags; /*DON'T TOUCH */ void *hidden_1 [12]; /*DON'T TOUCH */ }; -} MonoError; +} MonoErrorExternal; #ifdef _MSC_VER __pragma(warning (pop)) #endif +#ifdef MONO_INSIDE_RUNTIME +typedef union _MonoErrorInternal MonoError; +#else +typedef MonoErrorExternal MonoError; +#endif + /* Mempool-allocated MonoError.*/ typedef struct _MonoErrorBoxed MonoErrorBoxed; @@ -85,7 +91,7 @@ mono_error_init_flags (MonoError *error, unsigned short flags); MONO_API void mono_error_cleanup (MonoError *error); -MONO_API mono_bool +MONO_API MONO_RT_EXTERNAL_ONLY mono_bool mono_error_ok (MonoError *error); MONO_API unsigned short diff --git a/mono/utils/mono-hwcap-vars.h b/mono/utils/mono-hwcap-vars.h index 1596ca48d7..a7846dbbec 100644 --- a/mono/utils/mono-hwcap-vars.h +++ b/mono/utils/mono-hwcap-vars.h @@ -74,5 +74,8 @@ MONO_HWCAP_VAR(x86_has_ssse3) MONO_HWCAP_VAR(x86_has_sse41) MONO_HWCAP_VAR(x86_has_sse42) MONO_HWCAP_VAR(x86_has_sse4a) +MONO_HWCAP_VAR(x86_has_lzcnt) +MONO_HWCAP_VAR(x86_has_popcnt) +MONO_HWCAP_VAR(x86_has_avx) #endif diff --git a/mono/utils/mono-hwcap-x86.c b/mono/utils/mono-hwcap-x86.c index 4e103e0c1d..7bbaa2a88a 100644 --- a/mono/utils/mono-hwcap-x86.c +++ b/mono/utils/mono-hwcap-x86.c @@ -136,6 +136,12 @@ mono_hwcap_arch_init (void) if (ecx & (1 << 20)) mono_hwcap_x86_has_sse42 = TRUE; + + if (ecx & (1 << 23)) + mono_hwcap_x86_has_popcnt = TRUE; + + if (ecx & (1 << 28)) + mono_hwcap_x86_has_avx = TRUE; } if (cpuid (0x80000000, &eax, &ebx, &ecx, &edx)) { @@ -147,6 +153,11 @@ mono_hwcap_arch_init (void) } } + if (cpuid (0x80000001, &eax, &ebx, &ecx, &edx)) { + if (ecx & (1 << 5)) + mono_hwcap_x86_has_lzcnt = TRUE; + } + #if defined(HAVE_UNISTD_H) && defined(HAVE_ACCESS) mono_hwcap_x86_is_xen = !access ("/proc/xen", F_OK); #endif diff --git a/mono/utils/mono-io-portability.c b/mono/utils/mono-io-portability.c index 9231320780..616c73b49a 100644 --- a/mono/utils/mono-io-portability.c +++ b/mono/utils/mono-io-portability.c @@ -19,7 +19,7 @@ int mono_io_portability_helpers = PORTABILITY_UNKNOWN; -static inline gchar *mono_portability_find_file_internal (const gchar *pathname, gboolean last_exists); +static gchar *mono_portability_find_file_internal (const gchar *pathname, gboolean last_exists); void mono_portability_helpers_init (void) { @@ -109,7 +109,7 @@ gchar *mono_portability_find_file (const gchar *pathname, gboolean last_exists) } /* Returns newly-allocated string or NULL on failure */ -static inline gchar *mono_portability_find_file_internal (const gchar *pathname, gboolean last_exists) +static gchar *mono_portability_find_file_internal (const gchar *pathname, gboolean last_exists) { gchar *new_pathname, **components, **new_components; int num_components = 0, component = 0; diff --git a/mono/utils/mono-linked-list-set.c b/mono/utils/mono-linked-list-set.c index 86a775b783..ee43dfdf7a 100644 --- a/mono/utils/mono-linked-list-set.c +++ b/mono/utils/mono-linked-list-set.c @@ -19,7 +19,7 @@ #include -static inline gpointer +static gpointer mask (gpointer n, uintptr_t bit) { return (gpointer)(((uintptr_t)n) | bit); diff --git a/mono/utils/mono-log-common.c b/mono/utils/mono-log-common.c index 467b3a6665..74cfd6adba 100644 --- a/mono/utils/mono-log-common.c +++ b/mono/utils/mono-log-common.c @@ -39,8 +39,8 @@ static void *logUserData = NULL; * @level - GLogLevelFlags value * @returns The equivalent character identifier */ -static inline char -mapLogFileLevel(GLogLevelFlags level) +static char +mapLogFileLevel (GLogLevelFlags level) { if (level & G_LOG_LEVEL_ERROR) return ('E'); diff --git a/mono/utils/mono-log-windows.c b/mono/utils/mono-log-windows.c index 5d0f0c12f2..be2bd3c509 100644 --- a/mono/utils/mono-log-windows.c +++ b/mono/utils/mono-log-windows.c @@ -38,8 +38,8 @@ static const wchar_t *logFileName = L".//mono.log"; // FIXME double slash * @level - GLogLevelFlags value * @returns The equivalent character identifier */ -static inline char -mapLogFileLevel(GLogLevelFlags level) +static char +mapLogFileLevel (GLogLevelFlags level) { if (level & G_LOG_LEVEL_ERROR) return ('E'); diff --git a/mono/utils/mono-merp.c b/mono/utils/mono-merp.c index 36f6b0faab..a3736abaa6 100644 --- a/mono/utils/mono-merp.c +++ b/mono/utils/mono-merp.c @@ -49,7 +49,9 @@ kernel_version_string (void) static const char *version_string; if (!version_string) { - memset (&name, 0, sizeof (name)); // WSL does not always nul terminate. + // WSL does not always nul terminate. WSL was fixed February 2018. + // Restore memset if variable made non-static. + //memset (&name, 0, sizeof (name)); if (uname (&name) >= 0) version_string = name.release; diff --git a/mono/utils/mono-os-wait-win32.c b/mono/utils/mono-os-wait-win32.c index a855cd8c47..4bd9035a34 100644 --- a/mono/utils/mono-os-wait-win32.c +++ b/mono/utils/mono-os-wait-win32.c @@ -193,7 +193,7 @@ win32_wait_for_multiple_objects_ex (DWORD count, CONST HANDLE *handles, BOOL wai && GetLastError () == ERROR_INVALID_PARAMETER) { gpointer handles_sorted [MAXIMUM_WAIT_OBJECTS]; // 64 memcpy (handles_sorted, handles, count * sizeof (handles [0])); - qsort (handles_sorted, count, sizeof (handles_sorted [0]), g_direct_equal); + mono_qsort (handles_sorted, count, sizeof (handles_sorted [0]), g_direct_equal); for (DWORD i = 1; i < count; ++i) { if (handles_sorted [i - 1] == handles_sorted [i]) { mono_error_set_duplicate_wait_object (error); diff --git a/mono/utils/mono-path.c b/mono/utils/mono-path.c index d21d6d5626..2f4790666a 100644 --- a/mono/utils/mono-path.c +++ b/mono/utils/mono-path.c @@ -46,7 +46,7 @@ mono_path_canonicalize (const char *path) abspath = g_strdup (path); } else { gchar *tmpdir = g_get_current_dir (); - abspath = g_build_filename (tmpdir, path, NULL); + abspath = g_build_filename (tmpdir, path, (const char*)NULL); g_free (tmpdir); } @@ -130,7 +130,7 @@ resolve_symlink (const char *path) buffer [n] = 0; if (!g_path_is_absolute (buffer)) { dir = g_path_get_dirname (p); - concat = g_build_filename (dir, buffer, NULL); + concat = g_build_filename (dir, buffer, (const char*)NULL); g_free (dir); } else { concat = g_strdup (buffer); diff --git a/mono/utils/mono-sigcontext.h b/mono/utils/mono-sigcontext.h index ac22688de8..a46f413b05 100644 --- a/mono/utils/mono-sigcontext.h +++ b/mono/utils/mono-sigcontext.h @@ -538,6 +538,7 @@ typedef struct ucontext # endif # define UCONTEXT_GREGS(ctx) (((ucontext_t *)(ctx))->uc_mcontext.gregs) +# define UCONTEXT_FREGS(ctx) (((ucontext_t *)(ctx))->uc_mcontext.fpregs->fprs) #endif #elif defined (TARGET_RISCV) diff --git a/mono/utils/mono-state.c b/mono/utils/mono-state.c index 9862a0704b..f56239b5e0 100644 --- a/mono/utils/mono-state.c +++ b/mono/utils/mono-state.c @@ -46,6 +46,18 @@ extern GCStats mono_gc_stats; #include #endif +#ifdef TARGET_OSX +// OSX 10.9 does not have MAP_ANONYMOUS +#if !defined(MAP_ANONYMOUS) + #define NO_MAP_ANONYMOUS + #if defined(MAP_ANON) + #define MAP_ANONYMOUS MAP_ANON + #else + #define MAP_ANONYMOUS 0 + #endif +#endif +#endif + #ifdef HAVE_EXECINFO_H #include #endif diff --git a/mono/utils/mono-threads-api.h b/mono/utils/mono-threads-api.h index d0533203c7..41dabddd6d 100644 --- a/mono/utils/mono-threads-api.h +++ b/mono/utils/mono-threads-api.h @@ -50,7 +50,7 @@ mono_threads_enter_gc_unsafe_region_internal (MonoStackData *stackdata); MONO_API MONO_RT_EXTERNAL_ONLY void mono_threads_exit_gc_unsafe_region (gpointer cookie, gpointer* stackdata); -void +MONO_PROFILER_API void mono_threads_exit_gc_unsafe_region_internal (gpointer cookie, MonoStackData *stackdata); MONO_API gpointer @@ -130,13 +130,8 @@ http://www.mono-project.com/docs/advanced/runtime/docs/coop-suspend/#gc-unsafe-m } while (0) #define MONO_ENTER_GC_SAFE_UNBALANCED \ - do { \ MONO_STACKDATA (__gc_safe_unbalanced_dummy); \ - gpointer __gc_safe_unbalanced_cookie = mono_threads_enter_gc_safe_region_unbalanced_internal (&__gc_safe_unbalanced_dummy) - -#define MONO_EXIT_GC_SAFE_UNBALANCED \ - mono_threads_exit_gc_safe_region_unbalanced_internal (__gc_safe_unbalanced_cookie, &__gc_safe_unbalanced_dummy); \ - } while (0) + mono_threads_enter_gc_safe_region_unbalanced_internal (&__gc_safe_unbalanced_dummy) void mono_threads_enter_no_safepoints_region (const char *func); @@ -144,6 +139,7 @@ mono_threads_enter_no_safepoints_region (const char *func); void mono_threads_exit_no_safepoints_region (const char *func); +#if 0 #define MONO_ENTER_NO_SAFEPOINTS \ do { \ do { \ @@ -155,6 +151,14 @@ mono_threads_exit_no_safepoints_region (const char *func); if (mono_threads_are_safepoints_enabled ()) \ mono_threads_exit_no_safepoints_region (__func__); \ } while (0) +#else + +// With pinned handles, safepoints become not needed, as long as pinned handles are used. + +#define MONO_ENTER_NO_SAFEPOINTS /* nothing */ +#define MONO_EXIT_NO_SAFEPOINTS /* nothing */ + +#endif MONO_API MONO_RT_EXTERNAL_ONLY void mono_thread_set_coop_aware (void); diff --git a/mono/utils/mono-threads-coop.c b/mono/utils/mono-threads-coop.c index 477a3893bc..4114aafa8b 100644 --- a/mono/utils/mono-threads-coop.c +++ b/mono/utils/mono-threads-coop.c @@ -641,13 +641,13 @@ threads_suspend_policy_getenv (void) return policy; } -static char threads_suspend_policy; +char mono_threads_suspend_policy_hidden_dont_modify; -MonoThreadsSuspendPolicy -mono_threads_suspend_policy (void) +void +mono_threads_suspend_policy_init (void) { - int policy = threads_suspend_policy; - if (G_UNLIKELY (policy == 0)) { + int policy = 0; + { // thread suspend policy: // if the MONO_THREADS_SUSPEND env is set, use it. // otherwise if there's a compiled-in default, use it. @@ -664,9 +664,8 @@ mono_threads_suspend_policy (void) W32_RESTORE_LAST_ERROR_FROM_RESTORE_POINT; g_assert (policy); - threads_suspend_policy = (char)policy; + mono_threads_suspend_policy_hidden_dont_modify = (char)policy; } - return (MonoThreadsSuspendPolicy)policy; } static MonoThreadsSuspendPolicy @@ -692,7 +691,7 @@ mono_threads_suspend_validate_policy (MonoThreadsSuspendPolicy policy) void mono_threads_suspend_override_policy (MonoThreadsSuspendPolicy new_policy) { - threads_suspend_policy = (char)mono_threads_suspend_validate_policy (new_policy); + mono_threads_suspend_policy_hidden_dont_modify = (char)mono_threads_suspend_validate_policy (new_policy); g_warning ("Overriding suspend policy. Using %s suspend.", mono_threads_suspend_policy_name (mono_threads_suspend_policy ())); } diff --git a/mono/utils/mono-threads-coop.h b/mono/utils/mono-threads-coop.h index c4fbde79b9..f3edb1d09c 100644 --- a/mono/utils/mono-threads-coop.h +++ b/mono/utils/mono-threads-coop.h @@ -69,8 +69,15 @@ mono_threads_suspend_policy_is_multiphase_stw_enabled (MonoThreadsSuspendPolicy gboolean mono_threads_suspend_policy_is_blocking_transition_enabled (MonoThreadsSuspendPolicy p); -MonoThreadsSuspendPolicy -mono_threads_suspend_policy (void) MONO_LLVM_INTERNAL; +extern char mono_threads_suspend_policy_hidden_dont_modify MONO_LLVM_INTERNAL; + +static inline MonoThreadsSuspendPolicy +mono_threads_suspend_policy (void) { + return (MonoThreadsSuspendPolicy)mono_threads_suspend_policy_hidden_dont_modify; +} + +void +mono_threads_suspend_policy_init (void); const char* mono_threads_suspend_policy_name (MonoThreadsSuspendPolicy p); @@ -127,11 +134,7 @@ mono_threads_enter_gc_safe_region_with_info (THREAD_INFO_TYPE *info, MonoStackDa #define MONO_EXIT_GC_SAFE_WITH_INFO MONO_EXIT_GC_SAFE -G_EXTERN_C // due to THREAD_INFO_TYPE varying -gpointer -mono_threads_enter_gc_unsafe_region_with_info (THREAD_INFO_TYPE *, MonoStackData *stackdata); - -G_EXTERN_C // due to THREAD_INFO_TYPE varying +MONO_PROFILER_API gpointer mono_threads_enter_gc_unsafe_region_with_info (THREAD_INFO_TYPE *, MonoStackData *stackdata); diff --git a/mono/utils/mono-threads-state-machine.c b/mono/utils/mono-threads-state-machine.c index f8f043ed27..681aad1277 100644 --- a/mono/utils/mono-threads-state-machine.c +++ b/mono/utils/mono-threads-state-machine.c @@ -103,7 +103,7 @@ check_thread_state (MonoThreadInfo* info) } } -static inline void +static void trace_state_change_with_func (const char *transition, MonoThreadInfo *info, int cur_raw_state, int next_state, gboolean next_no_safepoints, int suspend_count_delta, const char *func) { check_thread_state (info); @@ -121,7 +121,7 @@ trace_state_change_with_func (const char *transition, MonoThreadInfo *info, int CHECKED_BUILD_THREAD_TRANSITION (transition, info, get_thread_state (cur_raw_state), get_thread_suspend_count (cur_raw_state), next_state, suspend_count_delta); } -static inline void +static void trace_state_change_sigsafe (const char *transition, MonoThreadInfo *info, int cur_raw_state, int next_state, gboolean next_no_safepoints, int suspend_count_delta, const char *func) { check_thread_state (info); @@ -139,7 +139,7 @@ trace_state_change_sigsafe (const char *transition, MonoThreadInfo *info, int cu CHECKED_BUILD_THREAD_TRANSITION_NOBT (transition, info, get_thread_state (cur_raw_state), get_thread_suspend_count (cur_raw_state), next_state, suspend_count_delta); } -static inline void +static void trace_state_change (const char *transition, MonoThreadInfo *info, int cur_raw_state, int next_state, gboolean next_no_safepoints, int suspend_count_delta) // FIXME migrate all uses { diff --git a/mono/utils/mono-threads-wasm.c b/mono/utils/mono-threads-wasm.c index 212d7413a9..c61d800f4b 100644 --- a/mono/utils/mono-threads-wasm.c +++ b/mono/utils/mono-threads-wasm.c @@ -145,10 +145,10 @@ mono_threads_platform_yield (void) void mono_threads_platform_get_stack_bounds (guint8 **staddr, size_t *stsize) { + int tmp; #ifdef __EMSCRIPTEN_PTHREADS__ pthread_attr_t attr; gint res; - int tmp; *staddr = NULL; *stsize = (size_t)-1; @@ -173,13 +173,13 @@ mono_threads_platform_get_stack_bounds (guint8 **staddr, size_t *stsize) *staddr = (guint8*)wasm_get_stack_base (); *stsize = wasm_get_stack_size (); } - - g_assert (&tmp > *staddr); - g_assert (&tmp < (char*)*staddr + *stsize); #else *staddr = (guint8*)wasm_get_stack_base (); *stsize = wasm_get_stack_size (); #endif + + g_assert ((guint8*)&tmp > *staddr); + g_assert ((guint8*)&tmp < (guint8*)*staddr + *stsize); } gboolean @@ -290,6 +290,10 @@ mono_threads_schedule_background_job (background_job_cb cb) jobs = g_slist_prepend (jobs, (gpointer)cb); } +G_EXTERN_C +EMSCRIPTEN_KEEPALIVE void +mono_background_exec (void); + G_EXTERN_C EMSCRIPTEN_KEEPALIVE void mono_background_exec (void) diff --git a/mono/utils/mono-threads-windows.c b/mono/utils/mono-threads-windows.c index 5614f23bc1..9d7f1690b2 100644 --- a/mono/utils/mono-threads-windows.c +++ b/mono/utils/mono-threads-windows.c @@ -28,7 +28,7 @@ enum Win32APCInfo { WIN32_APC_INFO_PENDING_ABORT_SLOT = 1 << 3 }; -static inline void +static void request_interrupt (gpointer thread_info, HANDLE native_thread_handle, gint32 pending_apc_slot, PAPCFUNC apc_callback, DWORD tid) { /* @@ -113,7 +113,7 @@ suspend_abort_syscall (PVOID thread_info, HANDLE native_thread_handle, DWORD tid request_interrupt (thread_info, native_thread_handle, WIN32_APC_INFO_PENDING_ABORT_SLOT, abort_apc, tid); } -static inline void +static void enter_alertable_wait_ex (MonoThreadInfo *info, HANDLE io_handle) { // Only loaded/stored by current thread, here or in APC (also running on current thread). @@ -124,7 +124,7 @@ enter_alertable_wait_ex (MonoThreadInfo *info, HANDLE io_handle) mono_atomic_xchg_i32 (&info->win32_apc_info, (io_handle == INVALID_HANDLE_VALUE) ? WIN32_APC_INFO_ALERTABLE_WAIT_SLOT : WIN32_APC_INFO_BLOCKING_IO_SLOT); } -static inline void +static void leave_alertable_wait_ex (MonoThreadInfo *info, HANDLE io_handle) { // Clear any previous flags. Thread is exiting alertable wait region, and info around pending interrupt/abort APC's @@ -455,13 +455,13 @@ mono_native_thread_join (MonoNativeThreadId tid) void mono_threads_platform_get_stack_bounds (guint8 **staddr, size_t *stsize) { -#if _WIN32_WINNT >= 0x0602 // Windows 8 or newer. +#if _WIN32_WINNT >= 0x0602 // Windows 8 or newer and very fast, just a few instructions, no syscall. ULONG_PTR low; ULONG_PTR high; GetCurrentThreadStackLimits (&low, &high); *staddr = (guint8*)low; *stsize = high - low; -#else // Win7 and older. +#else // Win7 and older (or newer, still works, but much slower). MEMORY_BASIC_INFORMATION info; // Windows stacks are commited on demand, one page at time. // teb->StackBase is the top from which it grows down. @@ -470,6 +470,7 @@ mono_threads_platform_get_stack_bounds (guint8 **staddr, size_t *stsize) // VirtualQuery (&info, &info, sizeof (info)); *staddr = (guint8*)info.AllocationBase; + // TEB starts with TIB. TIB is public, TEB is not. *stsize = (size_t)((NT_TIB*)NtCurrentTeb ())->StackBase - (size_t)info.AllocationBase; #endif } diff --git a/mono/utils/mono-threads.c b/mono/utils/mono-threads.c index 2086b619ee..31bda3eb8e 100644 --- a/mono/utils/mono-threads.c +++ b/mono/utils/mono-threads.c @@ -64,7 +64,7 @@ static MonoSemType global_suspend_semaphore; static size_t thread_info_size; static MonoThreadInfoCallbacks threads_callbacks; -static MonoThreadInfoRuntimeCallbacks runtime_callbacks; +const MonoThreadInfoRuntimeCallbacks *mono_runtime_callbacks; static MonoNativeTlsKey thread_info_key, thread_exited_key; #ifdef MONO_KEYWORD_THREAD static MONO_KEYWORD_THREAD gint32 tls_small_id = -1; @@ -337,7 +337,7 @@ mono_threads_wait_pending_operations (void) //Thread initialization code -static inline void +static void mono_hazard_pointer_clear_all (MonoThreadHazardPointers *hp, int retain) { if (retain != 0) @@ -462,7 +462,6 @@ register_thread (MonoThreadInfo *info) g_assert (stsize); info->stack_start_limit = staddr; info->stack_end = staddr + stsize; - info->stackdata = g_byte_array_new (); info->internal_thread_gchandle = G_MAXUINT32; @@ -470,6 +469,7 @@ register_thread (MonoThreadInfo *info) info->profiler_signal_ack = 1; #ifdef USE_WINDOWS_BACKEND + info->windows_tib = (PNT_TIB)NtCurrentTeb (); info->win32_apc_info = 0; info->win32_apc_info_io_handle = INVALID_HANDLE_VALUE; #endif @@ -906,6 +906,9 @@ mono_thread_info_init (size_t info_size) gboolean res; thread_info_size = info_size; char *sleepLimit; + + mono_threads_suspend_policy_init (); + #ifdef HOST_WIN32 res = mono_native_tls_alloc (&thread_info_key, NULL); res = mono_native_tls_alloc (&thread_exited_key, NULL); @@ -960,15 +963,9 @@ mono_thread_info_signals_init (void) } void -mono_thread_info_runtime_init (MonoThreadInfoRuntimeCallbacks *callbacks) +mono_thread_info_runtime_init (const MonoThreadInfoRuntimeCallbacks *callbacks) { - runtime_callbacks = *callbacks; -} - -MonoThreadInfoRuntimeCallbacks * -mono_threads_get_runtime_callbacks (void) -{ - return &runtime_callbacks; + mono_runtime_callbacks = callbacks; } static gboolean @@ -1578,8 +1575,10 @@ mono_thread_info_get_stack_bounds (guint8 **staddr, size_t *stsize) /* Sanity check the result */ g_assert ((current > *staddr) && (current < *staddr + *stsize)); +#ifndef TARGET_WASM /* When running under emacs, sometimes staddr is not aligned to a page size */ *staddr = (guint8*)((gssize)*staddr & ~(mono_pagesize () - 1)); +#endif } gboolean @@ -1607,7 +1606,7 @@ sleep_interrupt (gpointer data) mono_coop_mutex_unlock (&sleep_mutex); } -static inline guint32 +static guint32 sleep_interruptable (guint32 ms, gboolean *alerted) { gint64 now, end; diff --git a/mono/utils/mono-threads.h b/mono/utils/mono-threads.h index 198f5aa45b..126c58c080 100644 --- a/mono/utils/mono-threads.h +++ b/mono/utils/mono-threads.h @@ -200,7 +200,7 @@ typedef struct _MonoThreadInfo { /*Tells if this thread was created by the runtime or not.*/ gboolean runtime_thread; - /* Max stack bounds, all valid addresses must be between [stack_start_limit, stack_end[ */ + /* Max stack bounds, all valid addresses must be between [stack_start_limit, stack_end) */ void *stack_start_limit, *stack_end; /* suspend machinery, fields protected by suspend_semaphore */ @@ -273,6 +273,7 @@ typedef struct _MonoThreadInfo { #ifdef USE_WINDOWS_BACKEND gint32 win32_apc_info; + PNT_TIB windows_tib; gpointer win32_apc_info_io_handle; #endif @@ -317,11 +318,14 @@ typedef struct { void (*thread_flags_changed) (MonoThreadInfoFlags old, MonoThreadInfoFlags new_); } MonoThreadInfoCallbacks; +#define MONO_THREAD_INFO_RUNTIME_CALLBACKS(macro, prefix) \ + macro (prefix, void, setup_async_callback, (MonoContext *ctx, void (*async_cb)(void *fun), gpointer user_data)) \ + macro (prefix, gboolean, thread_state_init_from_sigctx, (MonoThreadUnwindState *state, void *sigctx)) \ + macro (prefix, gboolean, thread_state_init_from_handle, (MonoThreadUnwindState *tctx, MonoThreadInfo *info, /*optional*/ void *sigctx)) \ + macro (prefix, void, thread_state_init, (MonoThreadUnwindState *tctx)) \ + typedef struct { - void (*setup_async_callback) (MonoContext *ctx, void (*async_cb)(void *fun), gpointer user_data); - gboolean (*thread_state_init_from_sigctx) (MonoThreadUnwindState *state, void *sigctx); - gboolean (*thread_state_init_from_handle) (MonoThreadUnwindState *tctx, MonoThreadInfo *info, /*optional*/ void *sigctx); - void (*thread_state_init) (MonoThreadUnwindState *tctx); + MONO_THREAD_INFO_RUNTIME_CALLBACKS (MONO_DECL_CALLBACK, unused) } MonoThreadInfoRuntimeCallbacks; //Not using 0 and 1 to ensure callbacks are not returning bad data @@ -406,10 +410,11 @@ void mono_thread_info_signals_init (void); void -mono_thread_info_runtime_init (MonoThreadInfoRuntimeCallbacks *callbacks); +mono_thread_info_runtime_init (const MonoThreadInfoRuntimeCallbacks *callbacks); -MonoThreadInfoRuntimeCallbacks * -mono_threads_get_runtime_callbacks (void); +extern const MonoThreadInfoRuntimeCallbacks *mono_runtime_callbacks; + +#define mono_threads_get_runtime_callbacks() (mono_runtime_callbacks) MONO_API int mono_thread_info_register_small_id (void); diff --git a/mono/utils/mono-windows-thread-name.c b/mono/utils/mono-windows-thread-name.c index efd42eb67d..ce9675d71c 100644 --- a/mono/utils/mono-windows-thread-name.c +++ b/mono/utils/mono-windows-thread-name.c @@ -21,9 +21,6 @@ // This is not called SetThreadName to avoid breaking compilation of C (but not C++) // copied from http://msdn.microsoft.com/en-us/library/xcb2z8hs.aspx. // -// UWP: Also SetThreadDescription, but running prior to 1607 (or Creators Update per above). -// would require LoadLibrary / GetProcAddress, but LoadLibrary is not allowed. -// // Author: // Jay Krell (jaykrell@microsoft.com) // @@ -35,6 +32,10 @@ #if HOST_WIN32 +// For UWP, LoadLibrary requires a newer SDK. Or copy the header content. +WINBASEAPI HMODULE WINAPI LoadLibraryExW (PCWSTR, HANDLE, DWORD); +#define LOAD_LIBRARY_SEARCH_SYSTEM32 0x00000800 + #include "mono/metadata/w32subset.h" // This is compiler specific because of the use of __try / __except. @@ -90,7 +91,7 @@ mono_thread_set_name_windows (HANDLE thread_handle, PCWSTR thread_name) SetThreadDescription (thread_handle, thread_name); } -#elif HAVE_LOADLIBRARY +#else // LoadLibrary / GetProcAddress typedef HRESULT @@ -137,13 +138,6 @@ mono_thread_set_name_windows (HANDLE thread_handle, PCWSTR thread_name) (void)set_thread_description (thread_handle, thread_name); } -#else // nothing - -void -mono_thread_set_name_windows (HANDLE thread_handle, PCWSTR thread_name) -{ -} - #endif #endif // Win32 diff --git a/mono/utils/monobitset.c b/mono/utils/monobitset.c index 9d76038160..ecbe76cd54 100644 --- a/mono/utils/monobitset.c +++ b/mono/utils/monobitset.c @@ -269,7 +269,7 @@ bitstart_mask [] = { #else -static inline gint +static gint my_g_bit_nth_lsf (gsize mask, gint nth_bit) { nth_bit ++; @@ -304,7 +304,7 @@ my_g_bit_nth_lsf (gsize mask, gint nth_bit) #endif } -static inline gint +static gint my_g_bit_nth_lsf_nomask (gsize mask) { /* Mask is expected to be != 0 */ @@ -334,7 +334,7 @@ my_g_bit_nth_lsf_nomask (gsize mask) #endif -static inline int +static int my_g_bit_nth_msf (gsize mask, gint nth_bit) { diff --git a/mono/utils/networking-posix.c b/mono/utils/networking-posix.c index 5988932837..e307a728fa 100644 --- a/mono/utils/networking-posix.c +++ b/mono/utils/networking-posix.c @@ -84,6 +84,8 @@ mono_get_address_info (const char *hostname, int port, int flags, MonoAddressInf if (flags & MONO_HINT_CANONICAL_NAME) hints.ai_flags = AI_CANONNAME; + if (flags & MONO_HINT_NUMERIC_HOST) + hints.ai_flags |= AI_NUMERICHOST; /* Some ancient libc don't define AI_ADDRCONFIG */ #ifdef AI_ADDRCONFIG diff --git a/mono/utils/networking.h b/mono/utils/networking.h index 357c299339..4f6a0f5d73 100644 --- a/mono/utils/networking.h +++ b/mono/utils/networking.h @@ -43,6 +43,7 @@ typedef enum { MONO_HINT_IPV6 = 2, MONO_HINT_CANONICAL_NAME = 4, MONO_HINT_CONFIGURED_ONLY = 8, + MONO_HINT_NUMERIC_HOST = 16, } MonoGetAddressHints; typedef struct _MonoAddressEntry MonoAddressEntry; diff --git a/mono/utils/strenc.c b/mono/utils/strenc.c index 7be37a8de1..bb383e10ec 100644 --- a/mono/utils/strenc.c +++ b/mono/utils/strenc.c @@ -268,8 +268,11 @@ mono_utf8_validate_and_len (const gchar *source, glong* oLength, const gchar** o /* no fall-through in this inner switch */ case 0xE0: if (a < (guchar) 0xA0) retVal = FALSE; break; case 0xED: if (a > (guchar) 0x9F) retVal = FALSE; break; - case 0xEF: if (a == (guchar)0xB7 && (*(srcPtr+1) > (guchar) 0x8F && *(srcPtr+1) < 0xB0)) retVal = FALSE; - if (a == (guchar)0xBF && (*(srcPtr+1) == (guchar) 0xBE || *(srcPtr+1) == 0xBF)) retVal = FALSE; break; + case 0xEF: { + if (a == (guchar)0xB7 && (*(srcPtr+1) > (guchar) 0x8F && *(srcPtr+1) < 0xB0)) retVal = FALSE; + else if (a == (guchar)0xBF && (*(srcPtr+1) == (guchar) 0xBE || *(srcPtr+1) == 0xBF)) retVal = FALSE; + break; + } case 0xF0: if (a < (guchar) 0x90) retVal = FALSE; break; case 0xF4: if (a > (guchar) 0x8F) retVal = FALSE; break; default: if (a < (guchar) 0x80) retVal = FALSE; @@ -353,8 +356,11 @@ mono_utf8_validate_and_len_with_bounds (const gchar *source, glong max_bytes, gl /* no fall-through in this inner switch */ case 0xE0: if (a < (guchar) 0xA0) retVal = FALSE; break; case 0xED: if (a > (guchar) 0x9F) retVal = FALSE; break; - case 0xEF: if (a == (guchar)0xB7 && (*(srcPtr+1) > (guchar) 0x8F && *(srcPtr+1) < 0xB0)) retVal = FALSE; - if (a == (guchar)0xBF && (*(srcPtr+1) == (guchar) 0xBE || *(srcPtr+1) == 0xBF)) retVal = FALSE; break; + case 0xEF: { + if (a == (guchar)0xB7 && (*(srcPtr+1) > (guchar) 0x8F && *(srcPtr+1) < 0xB0)) retVal = FALSE; + else if (a == (guchar)0xBF && (*(srcPtr+1) == (guchar) 0xBE || *(srcPtr+1) == 0xBF)) retVal = FALSE; + break; + } case 0xF0: if (a < (guchar) 0x90) retVal = FALSE; break; case 0xF4: if (a > (guchar) 0x8F) retVal = FALSE; break; default: if (a < (guchar) 0x80) retVal = FALSE; diff --git a/msvc/Makefile.am b/msvc/Makefile.am index 025227e28c..2da65e2b8d 100644 --- a/msvc/Makefile.am +++ b/msvc/Makefile.am @@ -28,4 +28,71 @@ install-exec-local: $(install_sh) $(mono_msvc_build_bin_dir)/*.dll "$(DESTDIR)$(bindir)" $(install_sh) $(mono_msvc_build_bin_dir)/*.exe "$(DESTDIR)$(bindir)" $(install_sh) $(mono_msvc_build_bin_dir)/*.pdb "$(DESTDIR)$(bindir)" + +eglib: + $(top_srcdir)/msvc/run-msbuild.sh "build" "$(host_cpu)" "release" "" "eglib.vcxproj" + +clean-eglib: + $(top_srcdir)/msvc/run-msbuild.sh "clean" "$(host_cpu)" "release" "" "eglib.vcxproj" + +libgcmonosgen: + $(top_srcdir)/msvc/run-msbuild.sh "build" "$(host_cpu)" "release" "" "libgcmonosgen.vcxproj" + +clean-libgcmonosgen: + $(top_srcdir)/msvc/run-msbuild.sh "clean" "$(host_cpu)" "release" "" "libgcmonosgen.vcxproj" + +libmonoposixhelper: + $(top_srcdir)/msvc/run-msbuild.sh "build" "$(host_cpu)" "release" "" "monoposixhelper.vcxproj" + +clean-libmonoposixhelper: + $(top_srcdir)/msvc/run-msbuild.sh "clean" "$(host_cpu)" "release" "" "monoposixhelper.vcxproj" + +libmonoutils: + $(top_srcdir)/msvc/run-msbuild.sh "build" "$(host_cpu)" "release" "" "libmonoutils.vcxproj" + +clean-libmonoutils: + $(top_srcdir)/msvc/run-msbuild.sh "clean" "$(host_cpu)" "release" "" "libmonoutils.vcxproj" + +libmonoruntime: + $(top_srcdir)/msvc/run-msbuild.sh "build" "$(host_cpu)" "release" "" "libmonoruntime.vcxproj" + +clean-libmonoruntime: + $(top_srcdir)/msvc/run-msbuild.sh "clean" "$(host_cpu)" "release" "" "libmonoruntime.vcxproj" + +mono: + $(top_srcdir)/msvc/run-msbuild.sh "build" "$(host_cpu)" "release" "" "mono.vcxproj" + +clean-mono: + $(top_srcdir)/msvc/run-msbuild.sh "clean" "$(host_cpu)" "release" "" "mono.vcxproj" + +monow: + $(top_srcdir)/msvc/run-msbuild.sh "build" "$(host_cpu)" "release" "" "monow.vcxproj" + +clean-monow: + $(top_srcdir)/msvc/run-msbuild.sh "clean" "$(host_cpu)" "release" "" "monow.vcxproj" + +pedump: + $(top_srcdir)/msvc/run-msbuild.sh "build" "$(host_cpu)" "release" "" "pedump.vcxproj" + +clean-pedump: + $(top_srcdir)/msvc/run-msbuild.sh "clean" "$(host_cpu)" "release" "" "pedump.vcxproj" + +monodis: + $(top_srcdir)/msvc/run-msbuild.sh "build" "$(host_cpu)" "release" "" "monodis.vcxproj" + +clean-monodis: + $(top_srcdir)/msvc/run-msbuild.sh "clean" "$(host_cpu)" "release" "" "monodis.vcxproj" + +genmdesc: + $(top_srcdir)/msvc/run-msbuild.sh "build" "$(host_cpu)" "release" "" "genmdesc.vcxproj" + +clean-genmdesc: + $(top_srcdir)/msvc/run-msbuild.sh "clean" "$(host_cpu)" "release" "" "genmdesc.vcxproj" + +jay: + $(top_srcdir)/msvc/run-msbuild.sh "build" "$(host_cpu)" "release" "" "jay.vcxproj" + +clean-jay: + $(top_srcdir)/msvc/run-msbuild.sh "clean" "$(host_cpu)" "release" "" "jay.vcxproj" + endif diff --git a/msvc/Makefile.in b/msvc/Makefile.in index a35c268f47..3f7935e25c 100644 --- a/msvc/Makefile.in +++ b/msvc/Makefile.in @@ -215,6 +215,7 @@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTERP_CFLAGS = @INTERP_CFLAGS@ INTL = @INTL@ INVARIANT_AOT_OPTIONS = @INVARIANT_AOT_OPTIONS@ JEMALLOC_AUTOCONF_FLAGS = @JEMALLOC_AUTOCONF_FLAGS@ @@ -638,6 +639,72 @@ uninstall-am: @ENABLE_MSVC_TRUE@ $(install_sh) $(mono_msvc_build_bin_dir)/*.exe "$(DESTDIR)$(bindir)" @ENABLE_MSVC_TRUE@ $(install_sh) $(mono_msvc_build_bin_dir)/*.pdb "$(DESTDIR)$(bindir)" +@ENABLE_MSVC_TRUE@eglib: +@ENABLE_MSVC_TRUE@ $(top_srcdir)/msvc/run-msbuild.sh "build" "$(host_cpu)" "release" "" "eglib.vcxproj" + +@ENABLE_MSVC_TRUE@clean-eglib: +@ENABLE_MSVC_TRUE@ $(top_srcdir)/msvc/run-msbuild.sh "clean" "$(host_cpu)" "release" "" "eglib.vcxproj" + +@ENABLE_MSVC_TRUE@libgcmonosgen: +@ENABLE_MSVC_TRUE@ $(top_srcdir)/msvc/run-msbuild.sh "build" "$(host_cpu)" "release" "" "libgcmonosgen.vcxproj" + +@ENABLE_MSVC_TRUE@clean-libgcmonosgen: +@ENABLE_MSVC_TRUE@ $(top_srcdir)/msvc/run-msbuild.sh "clean" "$(host_cpu)" "release" "" "libgcmonosgen.vcxproj" + +@ENABLE_MSVC_TRUE@libmonoposixhelper: +@ENABLE_MSVC_TRUE@ $(top_srcdir)/msvc/run-msbuild.sh "build" "$(host_cpu)" "release" "" "monoposixhelper.vcxproj" + +@ENABLE_MSVC_TRUE@clean-libmonoposixhelper: +@ENABLE_MSVC_TRUE@ $(top_srcdir)/msvc/run-msbuild.sh "clean" "$(host_cpu)" "release" "" "monoposixhelper.vcxproj" + +@ENABLE_MSVC_TRUE@libmonoutils: +@ENABLE_MSVC_TRUE@ $(top_srcdir)/msvc/run-msbuild.sh "build" "$(host_cpu)" "release" "" "libmonoutils.vcxproj" + +@ENABLE_MSVC_TRUE@clean-libmonoutils: +@ENABLE_MSVC_TRUE@ $(top_srcdir)/msvc/run-msbuild.sh "clean" "$(host_cpu)" "release" "" "libmonoutils.vcxproj" + +@ENABLE_MSVC_TRUE@libmonoruntime: +@ENABLE_MSVC_TRUE@ $(top_srcdir)/msvc/run-msbuild.sh "build" "$(host_cpu)" "release" "" "libmonoruntime.vcxproj" + +@ENABLE_MSVC_TRUE@clean-libmonoruntime: +@ENABLE_MSVC_TRUE@ $(top_srcdir)/msvc/run-msbuild.sh "clean" "$(host_cpu)" "release" "" "libmonoruntime.vcxproj" + +@ENABLE_MSVC_TRUE@mono: +@ENABLE_MSVC_TRUE@ $(top_srcdir)/msvc/run-msbuild.sh "build" "$(host_cpu)" "release" "" "mono.vcxproj" + +@ENABLE_MSVC_TRUE@clean-mono: +@ENABLE_MSVC_TRUE@ $(top_srcdir)/msvc/run-msbuild.sh "clean" "$(host_cpu)" "release" "" "mono.vcxproj" + +@ENABLE_MSVC_TRUE@monow: +@ENABLE_MSVC_TRUE@ $(top_srcdir)/msvc/run-msbuild.sh "build" "$(host_cpu)" "release" "" "monow.vcxproj" + +@ENABLE_MSVC_TRUE@clean-monow: +@ENABLE_MSVC_TRUE@ $(top_srcdir)/msvc/run-msbuild.sh "clean" "$(host_cpu)" "release" "" "monow.vcxproj" + +@ENABLE_MSVC_TRUE@pedump: +@ENABLE_MSVC_TRUE@ $(top_srcdir)/msvc/run-msbuild.sh "build" "$(host_cpu)" "release" "" "pedump.vcxproj" + +@ENABLE_MSVC_TRUE@clean-pedump: +@ENABLE_MSVC_TRUE@ $(top_srcdir)/msvc/run-msbuild.sh "clean" "$(host_cpu)" "release" "" "pedump.vcxproj" + +@ENABLE_MSVC_TRUE@monodis: +@ENABLE_MSVC_TRUE@ $(top_srcdir)/msvc/run-msbuild.sh "build" "$(host_cpu)" "release" "" "monodis.vcxproj" + +@ENABLE_MSVC_TRUE@clean-monodis: +@ENABLE_MSVC_TRUE@ $(top_srcdir)/msvc/run-msbuild.sh "clean" "$(host_cpu)" "release" "" "monodis.vcxproj" + +@ENABLE_MSVC_TRUE@genmdesc: +@ENABLE_MSVC_TRUE@ $(top_srcdir)/msvc/run-msbuild.sh "build" "$(host_cpu)" "release" "" "genmdesc.vcxproj" + +@ENABLE_MSVC_TRUE@clean-genmdesc: +@ENABLE_MSVC_TRUE@ $(top_srcdir)/msvc/run-msbuild.sh "clean" "$(host_cpu)" "release" "" "genmdesc.vcxproj" + +@ENABLE_MSVC_TRUE@jay: +@ENABLE_MSVC_TRUE@ $(top_srcdir)/msvc/run-msbuild.sh "build" "$(host_cpu)" "release" "" "jay.vcxproj" + +@ENABLE_MSVC_TRUE@clean-jay: +@ENABLE_MSVC_TRUE@ $(top_srcdir)/msvc/run-msbuild.sh "clean" "$(host_cpu)" "release" "" "jay.vcxproj" + # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: diff --git a/msvc/libmono-dynamic.vcxproj b/msvc/libmono-dynamic.vcxproj index 76d231aef5..374a92196b 100644 --- a/msvc/libmono-dynamic.vcxproj +++ b/msvc/libmono-dynamic.vcxproj @@ -237,6 +237,12 @@ + + {e41ddf41-0916-454b-a7c2-6e410e45cafd} + + + {c3d4c623-55f8-4653-980d-61aa629b4e1d} + {b7098dfa-31e6-4006-8a15-1c9a4e925149} diff --git a/msvc/libmono-static.vcxproj b/msvc/libmono-static.vcxproj index a9d6f6377f..4c37b24141 100644 --- a/msvc/libmono-static.vcxproj +++ b/msvc/libmono-static.vcxproj @@ -200,6 +200,12 @@ + + {e41ddf41-0916-454b-a7c2-6e410e45cafd} + + + {c3d4c623-55f8-4653-980d-61aa629b4e1d} + {158073ed-99ae-4196-9edc-ddb2344f8466} diff --git a/msvc/mono.sln b/msvc/mono.sln index 0cb250b921..c566c0ebf9 100644 --- a/msvc/mono.sln +++ b/msvc/mono.sln @@ -32,6 +32,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mono", "mono.vcxproj", "{A0 ProjectSection(ProjectDependencies) = postProject {92AE7622-5F58-4234-9A26-9EC71876B3F4} = {92AE7622-5F58-4234-9A26-9EC71876B3F4} {158073ED-99AE-4196-9EDC-DDB2344F8466} = {158073ED-99AE-4196-9EDC-DDB2344F8466} + {D89D58F1-DA7A-4157-AFEE-F43D3BA20C9D} = {D89D58F1-DA7A-4157-AFEE-F43D3BA20C9D} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libgc", "libgc.vcxproj", "{EB56000B-C80B-4E8B-908D-D84D31B517D3}" @@ -210,6 +211,11 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "build-external-llvm", "buil EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mono-profiler-log", "mono-profiler-log.vcxproj", "{8C02A728-7A50-43CE-B507-BDFC05B7EA94}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "monow", "monow.vcxproj", "{D89D58F1-DA7A-4157-AFEE-F43D3BA20C9D}" + ProjectSection(ProjectDependencies) = postProject + {92AE7622-5F58-4234-9A26-9EC71876B3F4} = {92AE7622-5F58-4234-9A26-9EC71876B3F4} + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 @@ -442,6 +448,14 @@ Global {8C02A728-7A50-43CE-B507-BDFC05B7EA94}.Release|Win32.Build.0 = Release|Win32 {8C02A728-7A50-43CE-B507-BDFC05B7EA94}.Release|x64.ActiveCfg = Release|x64 {8C02A728-7A50-43CE-B507-BDFC05B7EA94}.Release|x64.Build.0 = Release|x64 + {D89D58F1-DA7A-4157-AFEE-F43D3BA20C9D}.Debug|Win32.ActiveCfg = Debug|Win32 + {D89D58F1-DA7A-4157-AFEE-F43D3BA20C9D}.Debug|Win32.Build.0 = Debug|Win32 + {D89D58F1-DA7A-4157-AFEE-F43D3BA20C9D}.Debug|x64.ActiveCfg = Debug|x64 + {D89D58F1-DA7A-4157-AFEE-F43D3BA20C9D}.Debug|x64.Build.0 = Debug|x64 + {D89D58F1-DA7A-4157-AFEE-F43D3BA20C9D}.Release|Win32.ActiveCfg = Release|Win32 + {D89D58F1-DA7A-4157-AFEE-F43D3BA20C9D}.Release|Win32.Build.0 = Release|Win32 + {D89D58F1-DA7A-4157-AFEE-F43D3BA20C9D}.Release|x64.ActiveCfg = Release|x64 + {D89D58F1-DA7A-4157-AFEE-F43D3BA20C9D}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -482,11 +496,12 @@ Global {E41DDF41-0916-454B-A7C2-6E410E45CAFD} = {7AF3635B-001C-42BF-94B9-C036CFDCA71D} {C3D4C623-55F8-4653-980D-61AA629B4E1D} = {7AF3635B-001C-42BF-94B9-C036CFDCA71D} {8C02A728-7A50-43CE-B507-BDFC05B7EA94} = {4CFD7702-60B2-4E82-BFAD-FCBB53EB4DA2} + {D89D58F1-DA7A-4157-AFEE-F43D3BA20C9D} = {DE3617B4-17A8-4E5F-A00F-BA43D956881F} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution - AMDCaProjectFile = C:\Users\Owner\Development\monogit\mono\msvc\CodeAnalyst\mono.caw - AMDCaPersistentStartup = mono AMDCaPersistentConfig = Debug|Win32 + AMDCaPersistentStartup = mono + AMDCaProjectFile = C:\Users\Owner\Development\monogit\mono\msvc\CodeAnalyst\mono.caw EndGlobalSection GlobalSection(DPCodeReviewSolutionGUID) = preSolution DPCodeReviewSolutionGUID = {00000000-0000-0000-0000-000000000000} diff --git a/msvc/monow.vcxproj b/msvc/monow.vcxproj new file mode 100644 index 0000000000..2093c94f51 --- /dev/null +++ b/msvc/monow.vcxproj @@ -0,0 +1,223 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {D89D58F1-DA7A-4157-AFEE-F43D3BA20C9D} + monow + Win32Proj + 8.1 + + + + Application + Unicode + v140 + + + Application + Unicode + v140 + + + Application + Unicode + v140 + + + Application + Unicode + v140 + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(MONO_BUILD_DIR_PREFIX)$(Platform)\bin\$(Configuration)\ + $(MONO_BUILD_DIR_PREFIX)$(Platform)\obj\$(ProjectName)$(MONO_TARGET_SUFFIX)\$(Configuration)\ + $(MONO_BUILD_DIR_PREFIX)$(Platform)\bin\$(Configuration)\ + $(MONO_BUILD_DIR_PREFIX)$(Platform)\obj\$(ProjectName)$(MONO_TARGET_SUFFIX)\$(Configuration)\ + $(MONO_BUILD_DIR_PREFIX)$(Platform)\bin\$(Configuration)\ + $(MONO_BUILD_DIR_PREFIX)$(Platform)\obj\$(ProjectName)$(MONO_TARGET_SUFFIX)\$(Configuration)\ + $(MONO_BUILD_DIR_PREFIX)$(Platform)\bin\$(Configuration)\ + $(MONO_BUILD_DIR_PREFIX)$(Platform)\obj\$(ProjectName)$(MONO_TARGET_SUFFIX)\$(Configuration)\ + + + $(ProjectName)$(MONO_TARGET_SUFFIX) + + + $(ProjectName)$(MONO_TARGET_SUFFIX) + + + true + $(ProjectName)$(MONO_TARGET_SUFFIX) + + + true + $(ProjectName)$(MONO_TARGET_SUFFIX) + + + + Disabled + $(MONO_DIR);$(MONO_INCLUDE_DIR);$(MONO_JIT_INCLUDE_DIR);$(MONO_LIBGC_SOURCE_DIR);$(MONO_EGLIB_SOURCE_DIR);%(AdditionalIncludeDirectories) + WIN32;WIN32_LEAN_AND_MEAN;_WINDOWS;_DEBUG;%(PreprocessorDefinitions) + true + + + 4996;%(DisableSpecificWarnings) + Level3 + + + + $(MONO_LIBMONO_LIB);%(AdditionalDependencies) + Windows + + + 0x800000 + + + false + + + + + + X64 + + + Disabled + $(MONO_DIR);$(MONO_INCLUDE_DIR);$(MONO_JIT_INCLUDE_DIR);$(MONO_LIBGC_SOURCE_DIR);$(MONO_EGLIB_SOURCE_DIR);%(AdditionalIncludeDirectories) + WIN32;WIN32_LEAN_AND_MEAN;_WINDOWS;WIN64;_DEBUG;%(PreprocessorDefinitions) + true + + + 4996;%(DisableSpecificWarnings) + Level3 + + + false + + + $(MONO_LIBMONO_LIB);%(AdditionalDependencies) + Windows + + + 0x800000 + + + + + + $(MONO_DIR);$(MONO_INCLUDE_DIR);$(MONO_JIT_INCLUDE_DIR);$(MONO_LIBGC_SOURCE_DIR);$(MONO_EGLIB_SOURCE_DIR);%(AdditionalIncludeDirectories) + + + WIN32;WIN32_LEAN_AND_MEAN;_WINDOWS;NDEBUG;%(PreprocessorDefinitions) + Level3 + true + true + + + false + + + $(MONO_LIBMONO_LIB);%(AdditionalDependencies) + Windows + + + 0x180000 + + + + + + X64 + + + $(MONO_DIR);$(MONO_INCLUDE_DIR);$(MONO_JIT_INCLUDE_DIR);$(MONO_LIBGC_SOURCE_DIR);$(MONO_EGLIB_SOURCE_DIR);%(AdditionalIncludeDirectories) + WIN32;WIN32_LEAN_AND_MEAN;_WINDOWS;WIN64;NDEBUG;%(PreprocessorDefinitions) + + + Level3 + true + true + + + false + + + $(MONO_LIBMONO_LIB);%(AdditionalDependencies) + Windows + 0x180000 + + + + + + CompileAsCpp + + + + + + + + {158073ed-99ae-4196-9edc-ddb2344f8466} + + + {675f4175-ffb1-480d-ad36-f397578844d4} + + + + + + + + + + $(MONO_LLVM_LIB_DIR);%(Lib.AdditionalLibraryDirectories) + $(MONO_LLVM_LIBS);%(Lib.AdditionalDependencies) + + + + + + + $(ComputeLibInputsTargets); + _ConfigureExternalLinkDependency; + + + \ No newline at end of file diff --git a/netcore/Makefile b/netcore/Makefile new file mode 100644 index 0000000000..72eb883a99 --- /dev/null +++ b/netcore/Makefile @@ -0,0 +1,275 @@ +ifneq ($(wildcard config.make),) + +include config.make + +NETCORETESTS_VERSION := $(shell cat ../eng/Versions.props | sed -n 's/.*MicrosoftPrivateCoreFxNETCoreAppVersion>\(.*\)<\/MicrosoftPrivateCoreFxNETCoreAppVersion.*/\1/p' ) +NETCOREAPP_VERSION := $(shell cat ../eng/Versions.props | sed -n 's/.*MicrosoftNETCoreAppVersion>\(.*\)<\/MicrosoftNETCoreAppVersion.*/\1/p' ) +ROSLYN_VERSION:= $(shell cat ../eng/Versions.props | sed -n 's/.*MicrosoftNetCompilersVersion>\(.*\)<\/MicrosoftNetCompilersVersion.*/\1/p' ) + +# Should be automated but not sure how for now +# the name is misleading osx version is used for any unix like systems +# the url is manually extracted from coreclr-outerloop (https://dev.azure.com/dnceng/public/_build?definitionId=98&_a=summary) Build artifacts published page +CORECLR_TESTS:=https://dev.azure.com/dnceng/9ee6d478-d288-47f7-aacc-f6e6d082ae6d/_apis/build/builds/368250/artifacts?artifactName=Tests_OSX_x64_checked_outerloop&api-version=5.2-preview.5&%24format=zip + +# runtime version used by $(DOTNET) - local .net core sdk to bootstrap stuff +# it doesn't match NETCOREAPP_VERSION +BOOTSTRAP_RUNTIME = $(shell ls ../.dotnet/shared/Microsoft.NETCore.App | tail -1) + +ifeq ($(HOST_PLATFORM),win32) +PLATFORM_AOT_SUFFIX := .dll +PLATFORM_AOT_PREFIX := +NETCORESDK_EXT = zip +UNZIPCMD = python -c "import zipfile,sys; zipfile.ZipFile(sys.argv[1], 'r').extractall()" +XUNIT_FLAGS = -notrait category=nonwindowstests @../../../../CoreFX.issues_windows.rsp +TESTS_PLATFORM = Windows_NT.x64 +ON_RUNTIME_EXTRACT = chmod -R 755 {host,shared,./dotnet} +DOTNET := $(shell powershell -ExecutionPolicy Bypass -Command "./init-tools.ps1")/dotnet.exe +DOTNET := "$(subst \,/,$(DOTNET))" +endif + +ifeq ($(HOST_PLATFORM),macos) +PLATFORM_AOT_SUFFIX := .dylib +PLATFORM_AOT_PREFIX := lib +NETCORESDK_EXT = tar.gz +UNZIPCMD = tar -xvf +XUNIT_FLAGS = -notrait category=nonosxtests +TESTS_PLATFORM = OSX.x64 +DOTNET := $(shell ./init-tools.sh | tail -1) +endif + +ifeq ($(HOST_PLATFORM),linux) +PLATFORM_AOT_SUFFIX := .so +PLATFORM_AOT_PREFIX := lib +NETCORESDK_EXT = tar.gz +UNZIPCMD = tar -xvf +XUNIT_FLAGS = -notrait category=nonlinuxtests @../../../../CoreFX.issues_linux.rsp +ifeq ($(COREARCH), arm64) +XUNIT_FLAGS += @../../../../CoreFX.issues_linux_arm64.rsp +endif +TESTS_PLATFORM = Linux.x64 +DOTNET := $(shell ./init-tools.sh | tail -1) +endif + +NETCORESDK_FILE := dotnet-runtime-$(NETCOREAPP_VERSION)-$(RID).$(NETCORESDK_EXT) +NETCORE_URL := https://dotnetcli.blob.core.windows.net/dotnet/Runtime/$(NETCOREAPP_VERSION)/$(NETCORESDK_FILE) +FEED_BASE_URL := https://dotnetfeed.blob.core.windows.net/dotnet-core +TEST_ASSETS_PATH := corefx-tests/$(NETCORETESTS_VERSION)/$(TESTS_PLATFORM)/netcoreapp/corefx-test-assets.xml + +# used to calculate exact version number for generating nupkg +BLAME = $(shell git blame ../configure.ac | grep AC_INIT | cut -f1 -d' ') +VERSTUB = .$(shell git rev-list --count $(BLAME)..HEAD)-preview + +all: bcl + +$(NETCORESDK_FILE): + curl $(NETCORE_URL) --output $(NETCORESDK_FILE) + rm -rf shared/Microsoft.NETCore.App + $(UNZIPCMD) $(NETCORESDK_FILE) + $(ON_RUNTIME_EXTRACT) + +update-corefx: corefx/.stamp-dl-corefx-$(NETCORETESTS_VERSION) + +corefx/.stamp-dl-corefx-$(NETCORETESTS_VERSION): corefx-restore.csproj + $(DOTNET) build corefx-restore.csproj --runtime $(RID) --packages corefx/packages -p:MicrosoftPrivateCoreFxNETCoreAppVersion=$(NETCORETESTS_VERSION) -p:OutputPath=corefx/restore/ + touch $@ + +update-roslyn: roslyn/packages/microsoft.net.compilers.toolset/$(ROSLYN_VERSION)/microsoft.net.compilers.toolset.nuspec + +roslyn/packages/microsoft.net.compilers.toolset/$(ROSLYN_VERSION)/microsoft.net.compilers.toolset.nuspec: + $(DOTNET) restore roslyn-restore.csproj -p:RoslynVersion=$(ROSLYN_VERSION) --packages roslyn/packages -p:OutputPath=roslyn/restore/ + +run-sample: prepare + $(DOTNET) build sample/HelloWorld + MONO_ENV_OPTIONS="--debug" COMPlus_DebugWriteToStdErr=1 ./dotnet --fx-version "$(NETCOREAPP_VERSION)" sample/HelloWorld/bin/netcoreapp3.0/HelloWorld.dll + +run-sample-dbg: prepare + $(DOTNET) build sample/HelloWorld + MONO_ENV_OPTIONS="--debug --debugger-agent=transport=dt_socket,address=127.0.0.1:1235,server=y,suspend=y" COMPlus_DebugWriteToStdErr=1 ./dotnet --fx-version "$(NETCOREAPP_VERSION)" sample/HelloWorld/bin/netcoreapp3.0/HelloWorld.dll + +run-sample-coreclr: + cd sample/HelloWorld && $(DOTNET) run + +# build any app in "self contained" mode and patch coreclr.dll and corelib with mono bits +# e.g. `make patch-app APP_PATH=/my/aspnetapp` +patch-app: prepare + @if test -z "$(APP_PATH)"; then echo "APP_PATH is not set"; exit 1; fi + cp NuGet.config $(APP_PATH) + cd $(APP_PATH) && $(DOTNET) publish -c Release -r $(RID) -f netcoreapp3.0 + cp ../mono/mini/.libs/libmonosgen-2.0$(PLATFORM_AOT_SUFFIX) $(APP_PATH)/bin/Release/netcoreapp3.0/$(RID)/publish/$(PLATFORM_AOT_PREFIX)coreclr$(PLATFORM_AOT_SUFFIX) + cp System.Private.CoreLib/bin/$(COREARCH)/System.Private.CoreLib.dll $(APP_PATH)/bin/Release/netcoreapp3.0/$(RID)/publish + cp System.Private.CoreLib/bin/$(COREARCH)/System.Private.CoreLib.pdb $(APP_PATH)/bin/Release/netcoreapp3.0/$(RID)/publish + +# makes $(DOTNET) to use mono runtime (to run real-world apps using '$(DOTNET) run') +patch-local-dotnet: prepare + cp ../mono/mini/.libs/libmonosgen-2.0$(PLATFORM_AOT_SUFFIX) ../.dotnet/shared/Microsoft.NETCore.App/$(BOOTSTRAP_RUNTIME)/$(PLATFORM_AOT_PREFIX)coreclr$(PLATFORM_AOT_SUFFIX) + cp System.Private.CoreLib/bin/$(COREARCH)/System.Private.CoreLib.dll ../.dotnet/shared/Microsoft.NETCore.App/$(BOOTSTRAP_RUNTIME) + cp System.Private.CoreLib/bin/$(COREARCH)/System.Private.CoreLib.pdb ../.dotnet/shared/Microsoft.NETCore.App/$(BOOTSTRAP_RUNTIME) + +# Precompile BCL libs in $(DOTNET) using LLVM (requires `--enable-llvm` build) +patch-local-dotnet-aot-llvm: patch-local-dotnet + for assembly in ../.dotnet/shared/Microsoft.NETCore.App/$(BOOTSTRAP_RUNTIME)/*.dll; do \ + echo "[AOT] $$assembly"; \ + PATH="../llvm/usr/bin/:$(PATH)" \ + MONO_ENV_OPTIONS="--aot=llvm,llvmllc=\"-mcpu=native\"" \ + $(DOTNET) $$assembly ; \ + done; \ + +# run 'dotnet/performance' benchmarks +# e.g. 'make run-benchmarks DOTNET_PERF_REPO=/prj/performance' +# you can append BDN parameters at the end, e.g. ` -- --filter Burgers --keepFiles` +# NOTE: we have to delete a couple of System.Drawing files to make it work +run-benchmarks: patch-local-dotnet + @if test -z "$(DOTNET_PERF_REPO)"; then echo "DOTNET_PERF_REPO is not set"; exit 1; fi + cd $(DOTNET_PERF_REPO)/src/benchmarks/micro/ && \ + > corefx/System.Drawing/Perf_Color.cs && \ + > corefx/System.Drawing/Perf_Graphics_DrawBeziers.cs && \ + > corefx/System.Drawing/Perf_Graphics_Transforms.cs && \ + > corefx/System.Drawing/Perf_Image_Load.cs && \ + $(DOTNET) run -c Release -f netcoreapp5.0 --cli $(CURDIR)/../.dotnet/dotnet + +# run HelloWorld using --aot=llvm (requires `--enable-llvm` build) +run-sample-local-dotnet-llvm: patch-local-dotnet + $(DOTNET) build -c Release sample/HelloWorld + PATH="../llvm/usr/bin/:$(PATH)" \ + MONO_ENV_OPTIONS="--aot=llvm,mcpu=native" \ + $(DOTNET) sample/HelloWorld/bin/netcoreapp3.0/HelloWorld.dll + $(DOTNET) sample/HelloWorld/bin/netcoreapp3.0/HelloWorld.dll + +# COREHOST_TRACE=1 +SHAREDRUNTIME := shared/Microsoft.NETCore.App/$(NETCOREAPP_VERSION) + +System.Private.CoreLib/src/System/Environment.Mono.cs: System.Private.CoreLib/src/System/Environment.Mono.in config.make + test -n '$(MONO_CORLIB_VERSION)' + sed -e 's,@''MONO_CORLIB_VERSION@,$(MONO_CORLIB_VERSION),' $< > $@ + +CORLIB_BUILD_FLAGS?=-c Release + +bcl: update-roslyn System.Private.CoreLib/src/System/Environment.Mono.cs + $(DOTNET) build $(CORETARGETS) $(CORLIB_BUILD_FLAGS) -p:BuildArch=$(COREARCH) \ + -p:OutputPath=bin/$(COREARCH) \ + -p:RoslynPropsFile="../roslyn/packages/microsoft.net.compilers.toolset/$(ROSLYN_VERSION)/build/Microsoft.Net.Compilers.Toolset.props" \ + System.Private.CoreLib/System.Private.CoreLib.csproj + +debug-bcl: + $(MAKE) bcl CORLIB_BUILD_FLAGS="-c Debug" + +runtime: + $(MAKE) -C ../mono + +link-mono: $(SHAREDRUNTIME)/.stamp-link-mono + +$(SHAREDRUNTIME)/.stamp-link-mono: ../mono/mini/.libs/libmonosgen-2.0$(PLATFORM_AOT_SUFFIX) System.Private.CoreLib/bin/$(COREARCH)/System.Private.CoreLib.dll System.Private.CoreLib/bin/$(COREARCH)/System.Private.CoreLib.pdb + cp ../mono/mini/.libs/libmonosgen-2.0$(PLATFORM_AOT_SUFFIX) $(SHAREDRUNTIME)/$(PLATFORM_AOT_PREFIX)coreclr$(PLATFORM_AOT_SUFFIX) + cp System.Private.CoreLib/bin/$(COREARCH)/System.Private.CoreLib.dll $(SHAREDRUNTIME) + cp System.Private.CoreLib/bin/$(COREARCH)/System.Private.CoreLib.pdb $(SHAREDRUNTIME) + touch $@ + +prepare: $(NETCORESDK_FILE) update-corefx update-roslyn link-mono + +pack-%: + $(DOTNET) pack roslyn-restore.csproj -p:IsPackable=true -p:NuspecFile=$*.nuspec -p:NuspecProperties=\"RID=$(RID)\;VERSION=$(VERSION)$(VERSTUB)\;PLATFORM_AOT_SUFFIX=$(PLATFORM_AOT_SUFFIX)\;COREARCH=$(COREARCH)\;PLATFORM_AOT_PREFIX=$(PLATFORM_AOT_PREFIX)\" --output ../artifacts/ --no-build + +nupkg: pack-metapackage pack-runtime +nupkg-llvm: pack-metapackage-llvm pack-runtime-llvm + +clean: + rm -rf .configured ../.dotnet sdk shared host dotnet tests obj corefx roslyn LICENSE.txt ThirdPartyNotices.txt $(NETCORESDK_FILE) + + +update-tests-corefx: corefx/.stamp-dl-corefx-tests-$(NETCORETESTS_VERSION) + +corefx/.stamp-dl-corefx-tests-$(NETCORETESTS_VERSION): + rm -rf corefx/tests + $(DOTNET) msbuild corefx-tests-restore.proj -m -t:DownloadAllTests -p:TEST_ASSETS_PATH="$(TEST_ASSETS_PATH)" -p:FEED_BASE_URL="$(FEED_BASE_URL)" + rm -rf corefx/tests/extracted/System.Utf8String.Experimental.Tests + touch $@ + +# +# Running CoreFX tests +# +# You can run either individual test assembly or run all CoreFX tests. The tests are automatically downloaded +# from the shared location and built locally. +# +# Running all test: `make run-tests-corefx` +# +# Running individual test: MONO_ENV_OPTIONS="--debug" make run-tests-corefx-System.Collections.Tests +# + +run-tests-corefx: prepare update-tests-corefx + @rm -f .failures; \ + counter=0; \ + tests_count=$(words $(dir $(wildcard corefx/tests/extracted/*/))); \ + for testdir in corefx/tests/extracted/*; do \ + counter=$$((counter+1)); \ + testname=$$(basename $$testdir); \ + if [ -n "$$USE_TIMEOUT" ]; then timeoutcmd="../scripts/ci/run-step.sh --label=$$testname --timeout=10m --fatal"; fi; \ + $$timeoutcmd $(MAKE) run-tests-corefx-$$testname TEST_COUNTER="($$counter / $$tests_count) " || echo $$testname >> .failures; \ + done; \ + $(MAKE) xunit-summary; \ + if [ -e ".failures" ]; then \ + echo ""; \ + echo "Failures in test suites:"; \ + cat .failures; \ + echo ""; \ + exit 1; \ + fi + +run-tests-corefx-%: prepare update-tests-corefx + @echo "" + @echo "***************** $* $${TEST_COUNTER}*********************" + @cp corefx/restore/corefx-restore.deps.json corefx/tests/extracted/$*/$*.deps.json + @cp corefx/restore/corefx-restore.runtimeconfig.dev.json corefx/tests/extracted/$*/$*.runtimeconfig.dev.json + @cp corefx/restore/corefx-restore.dll corefx/tests/extracted/$*/corefx-restore.dll + @sed -i -e 's/5.0.0\"/$(NETCOREAPP_VERSION)\"/g' corefx/tests/extracted/$*/*.runtimeconfig.json + cd corefx/tests/extracted/$* && \ + MONO_ENV_OPTIONS="--debug" COMPlus_DebugWriteToStdErr=1 $(CURDIR)/./dotnet exec \ + --runtimeconfig $*.runtimeconfig.json --additional-deps $*.deps.json \ + --fx-version "$(NETCOREAPP_VERSION)" xunit.console.dll $*.dll \ + -html ../../TestResult-$*.html -xml ../../TestResult-$*-netcore-xunit.xml \ + $(XUNIT_FLAGS) @../../../../CoreFX.issues.rsp \ + $(FIXTURE) + +# build a test assembly in COREFX_ROOT (path to a fully built corefx repo) and copy it to corefx/tests/extracted +# e.g. `make build-test-corefx-System.Runtime COREFX_ROOT=/prj/corefx-master` +build-test-corefx-%: + cd $(COREFX_ROOT)/src/$*/tests && $(DOTNET) msbuild /p:OutputPath=tmp + cp $(COREFX_ROOT)/src/$*/tests/tmp/$*.Tests.{dll,pdb} $(CURDIR)/corefx/tests/extracted/$*.Tests/ + rm -rf $(COREFX_ROOT)/src/$*/tests/tmp + +xunit-summary: + ./xunit-summary.py "corefx/tests" + + +update-tests-coreclr: coreclr/.stamp-tests + +coreclr/.stamp-tests: + rm -rf coreclr/tests + curl -L "$(CORECLR_TESTS)" --output coreclr/tests.zip + tar -xvf coreclr/tests.zip -C coreclr/ + mkdir coreclr/tests + tar -xvf coreclr/Tests_OSX_x64_checked_outerloop/Tests_OSX_x64_checked_outerloop.tar.gz -C coreclr/tests + touch $@ + +.PHONY: corerun +corerun: + cp corerun/corerun $(SHAREDRUNTIME) + +run-tests-coreclr: prepare update-tests-coreclr corerun + rm -rf coreclr/output.log + @counter=0; \ + failures=0; \ + test_files=$$(find coreclr/tests -type f -name "*.sh"); \ + for testdir in $$test_files; do \ + counter=$$((counter+1)); \ + echo "Running $$testdir"; \ + if sh $$testdir -coreroot=$(realpath $(SHAREDRUNTIME)) >>coreclr/output.log 2>&1 ; then \ + echo "FAILED"; \ + failures=$$((failures+1)); \ + fi; \ + done; \ + echo "Tests Count: $$counter"; \ + echo "Failed: $$failures" +endif + +distdir: +distclean: diff --git a/netcore/corerun/Makefile.am b/netcore/corerun/Makefile.am new file mode 100644 index 0000000000..d66185430c --- /dev/null +++ b/netcore/corerun/Makefile.am @@ -0,0 +1,7 @@ +# Files copied from coreclr/src/coreclr/hosts/unixcorerun repo + +AM_CPPFLAGS = $(SHARED_CFLAGS) + +bin_PROGRAMS = corerun + +corerun_SOURCES = corerun.cpp coreruncommon.cpp coreruncommon.h coreclrhost.h diff --git a/netcore/corerun/Makefile.in b/netcore/corerun/Makefile.in new file mode 100644 index 0000000000..23e1b0daa2 --- /dev/null +++ b/netcore/corerun/Makefile.in @@ -0,0 +1,816 @@ +# Makefile.in generated by automake 1.15 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2014 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# Files copied from coreclr/src/coreclr/hosts/unixcorerun repo + +VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +target_triplet = @target@ +bin_PROGRAMS = corerun$(EXEEXT) +subdir = netcore/corerun +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/apple-target.m4 \ + $(top_srcdir)/m4/ax_append_flag.m4 \ + $(top_srcdir)/m4/ax_append_link_flags.m4 \ + $(top_srcdir)/m4/ax_check_compile_flag.m4 \ + $(top_srcdir)/m4/ax_check_link_flag.m4 \ + $(top_srcdir)/m4/ax_require_defined.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ + $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ + $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +am__installdirs = "$(DESTDIR)$(bindir)" +PROGRAMS = $(bin_PROGRAMS) +am_corerun_OBJECTS = corerun.$(OBJEXT) coreruncommon.$(OBJEXT) +corerun_OBJECTS = $(am_corerun_OBJECTS) +corerun_LDADD = $(LDADD) +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +am__v_lt_1 = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +AM_V_CXX = $(am__v_CXX_@AM_V@) +am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) +am__v_CXX_0 = @echo " CXX " $@; +am__v_CXX_1 = +CXXLD = $(CXX) +CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ + $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) +am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) +am__v_CXXLD_0 = @echo " CXXLD " $@; +am__v_CXXLD_1 = +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = +CCLD = $(CC) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = +SOURCES = $(corerun_SOURCES) +DIST_SOURCES = $(corerun_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__extra_recursive_targets = test-recursive test-bundle-recursive +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +ETAGS = etags +CTAGS = ctags +am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp \ + $(top_srcdir)/mkinstalldirs +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AOT_BUILD_FLAGS = @AOT_BUILD_FLAGS@ +AOT_RUN_FLAGS = @AOT_RUN_FLAGS@ +API_VER = @API_VER@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BOEHM_DEFINES = @BOEHM_DEFINES@ +BREAKPOINT = @BREAKPOINT@ +BTLS_ARCH = @BTLS_ARCH@ +BTLS_CFLAGS = @BTLS_CFLAGS@ +BTLS_CMAKE_ARGS = @BTLS_CMAKE_ARGS@ +BTLS_PLATFORM = @BTLS_PLATFORM@ +BTLS_ROOT = @BTLS_ROOT@ +BUILD_EXEEXT = @BUILD_EXEEXT@ +CC = @CC@ +CCAS = @CCAS@ +CCASDEPMODE = @CCASDEPMODE@ +CCASFLAGS = @CCASFLAGS@ +CCDEPMODE = @CCDEPMODE@ +CC_FOR_BUILD = @CC_FOR_BUILD@ +CFLAGS = @CFLAGS@ +CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@ +CMAKE = @CMAKE@ +COREARCH = @COREARCH@ +CORETARGETS = @CORETARGETS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CSC = @CSC@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CXXFLAGS_COMMON = @CXXFLAGS_COMMON@ +CXX_ADD_CFLAGS = @CXX_ADD_CFLAGS@ +CXX_REMOVE_CFLAGS = @CXX_REMOVE_CFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFAULT_PROFILE = @DEFAULT_PROFILE@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DOLT_BASH = @DOLT_BASH@ +DSYMUTIL = @DSYMUTIL@ +DTRACE = @DTRACE@ +DTRACEFLAGS = @DTRACEFLAGS@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +EXTERNAL_LLVM_CONFIG = @EXTERNAL_LLVM_CONFIG@ +EXTERNAL_LLVM_CONFIG_WIN32 = @EXTERNAL_LLVM_CONFIG_WIN32@ +FGREP = @FGREP@ +GDKX11 = @GDKX11@ +GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GMSGFMT = @GMSGFMT@ +GMSGFMT_015 = @GMSGFMT_015@ +GNUC_NORETURN = @GNUC_NORETURN@ +GNUC_PRETTY = @GNUC_PRETTY@ +GNUC_UNUSED = @GNUC_UNUSED@ +GREP = @GREP@ +GSIZE = @GSIZE@ +GSIZE_FORMAT = @GSIZE_FORMAT@ +GSSIZE = @GSSIZE@ +GTKX11 = @GTKX11@ +HAVE_ALLOCA_H = @HAVE_ALLOCA_H@ +HAVE_MSGFMT = @HAVE_MSGFMT@ +HAVE_NINJA = @HAVE_NINJA@ +HAVE_UNISTD_H = @HAVE_UNISTD_H@ +HAVE_YASM = @HAVE_YASM@ +HOST_CC = @HOST_CC@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTERP_CFLAGS = @INTERP_CFLAGS@ +INTL = @INTL@ +INVARIANT_AOT_OPTIONS = @INVARIANT_AOT_OPTIONS@ +JEMALLOC_AUTOCONF_FLAGS = @JEMALLOC_AUTOCONF_FLAGS@ +JEMALLOC_CFLAGS = @JEMALLOC_CFLAGS@ +JEMALLOC_CPPFLAGS = @JEMALLOC_CPPFLAGS@ +JEMALLOC_LDFLAGS = @JEMALLOC_LDFLAGS@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBC = @LIBC@ +LIBGC_CPPFLAGS = @LIBGC_CPPFLAGS@ +LIBGC_LIBS = @LIBGC_LIBS@ +LIBGC_STATIC_LIBS = @LIBGC_STATIC_LIBS@ +LIBMONO_LA = @LIBMONO_LA@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LLVM_CODEGEN_LIBS = @LLVM_CODEGEN_LIBS@ +LN_S = @LN_S@ +LTCOMPILE = @LTCOMPILE@ +LTCXXCOMPILE = @LTCXXCOMPILE@ +LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +MONO_CORLIB_VERSION = @MONO_CORLIB_VERSION@ +MONO_CXXLD = @MONO_CXXLD@ +MONO_JEMALLOC_ASSERT = @MONO_JEMALLOC_ASSERT@ +MONO_JEMALLOC_DEFAULT = @MONO_JEMALLOC_DEFAULT@ +MONO_JEMALLOC_ENABLED = @MONO_JEMALLOC_ENABLED@ +MONO_NATIVE_CC = @MONO_NATIVE_CC@ +MONO_NATIVE_CCASFLAGS = @MONO_NATIVE_CCASFLAGS@ +MONO_NATIVE_CFLAGS = @MONO_NATIVE_CFLAGS@ +MONO_NATIVE_COMPAT_CCASFLAGS = @MONO_NATIVE_COMPAT_CCASFLAGS@ +MONO_NATIVE_COMPAT_CFLAGS = @MONO_NATIVE_COMPAT_CFLAGS@ +MONO_NATIVE_COMPAT_CPPFLAGS = @MONO_NATIVE_COMPAT_CPPFLAGS@ +MONO_NATIVE_COMPAT_CXXFLAGS = @MONO_NATIVE_COMPAT_CXXFLAGS@ +MONO_NATIVE_COMPAT_LDFLAGS = @MONO_NATIVE_COMPAT_LDFLAGS@ +MONO_NATIVE_CPPFLAGS = @MONO_NATIVE_CPPFLAGS@ +MONO_NATIVE_CXX = @MONO_NATIVE_CXX@ +MONO_NATIVE_CXXFLAGS = @MONO_NATIVE_CXXFLAGS@ +MONO_NATIVE_LDFLAGS = @MONO_NATIVE_LDFLAGS@ +MONO_NATIVE_LIBADD = @MONO_NATIVE_LIBADD@ +MONO_NATIVE_LIBRARY_NAME = @MONO_NATIVE_LIBRARY_NAME@ +MONO_NATIVE_PLATFORM = @MONO_NATIVE_PLATFORM@ +MONO_NATIVE_PLATFORM_TYPE = @MONO_NATIVE_PLATFORM_TYPE@ +MONO_NATIVE_PLATFORM_TYPE_COMPAT = @MONO_NATIVE_PLATFORM_TYPE_COMPAT@ +MONO_NATIVE_PLATFORM_TYPE_UNIFIED = @MONO_NATIVE_PLATFORM_TYPE_UNIFIED@ +MONO_NATIVE_UNIFIED_CCASFLAGS = @MONO_NATIVE_UNIFIED_CCASFLAGS@ +MONO_NATIVE_UNIFIED_CFLAGS = @MONO_NATIVE_UNIFIED_CFLAGS@ +MONO_NATIVE_UNIFIED_CPPFLAGS = @MONO_NATIVE_UNIFIED_CPPFLAGS@ +MONO_NATIVE_UNIFIED_CXXFLAGS = @MONO_NATIVE_UNIFIED_CXXFLAGS@ +MONO_NATIVE_UNIFIED_LDFLAGS = @MONO_NATIVE_UNIFIED_LDFLAGS@ +MSGFMT = @MSGFMT@ +MSGFMT_015 = @MSGFMT_015@ +MSGMERGE = @MSGMERGE@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +ODBC = @ODBC@ +ORDER = @ORDER@ +OS = @OS@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATHSEP = @PATHSEP@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PIDTYPE = @PIDTYPE@ +PKG_CONFIG = @PKG_CONFIG@ +PLATFORM_AOT_PREFIX = @PLATFORM_AOT_PREFIX@ +PLATFORM_AOT_SUFFIX = @PLATFORM_AOT_SUFFIX@ +RANLIB = @RANLIB@ +RID = @RID@ +SEARCHSEP = @SEARCHSEP@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SGEN_DEFINES = @SGEN_DEFINES@ +SHARED_CFLAGS = @SHARED_CFLAGS@ +SHELL = @SHELL@ +SIZEOF_VOID_P = @SIZEOF_VOID_P@ +SQLITE = @SQLITE@ +SQLITE3 = @SQLITE3@ +STATIC_GCC_LIBS = @STATIC_GCC_LIBS@ +STATIC_ZLIB_PATH = @STATIC_ZLIB_PATH@ +STRIP = @STRIP@ +TEST_PROFILE = @TEST_PROFILE@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +VTUNE_CFLAGS = @VTUNE_CFLAGS@ +VTUNE_LIBS = @VTUNE_LIBS@ +WERROR_CFLAGS = @WERROR_CFLAGS@ +X11 = @X11@ +XATTR_LIB = @XATTR_LIB@ +XGETTEXT = @XGETTEXT@ +XGETTEXT_015 = @XGETTEXT_015@ +XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ +XINERAMA = @XINERAMA@ +XMKMF = @XMKMF@ +ZLIB_CFLAGS = @ZLIB_CFLAGS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +arch_target = @arch_target@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +docs_dir = @docs_dir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +export_ldflags = @export_ldflags@ +extra_runtime_ldflags = @extra_runtime_ldflags@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +ikvm_native_dir = @ikvm_native_dir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +libgc_dir = @libgc_dir@ +libgdiplus_install_loc = @libgdiplus_install_loc@ +libgdiplus_loc = @libgdiplus_loc@ +libmono_cflags = @libmono_cflags@ +libmono_ldflags = @libmono_ldflags@ +libsuffix = @libsuffix@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mcs_topdir = @mcs_topdir@ +mcs_topdir_from_srcdir = @mcs_topdir_from_srcdir@ +mkdir_p = @mkdir_p@ +mono_build_root = @mono_build_root@ +mono_cfg_dir = @mono_cfg_dir@ +mono_msvc_build_bin_dir = @mono_msvc_build_bin_dir@ +mono_msvc_build_dir = @mono_msvc_build_dir@ +mono_msvc_build_lib_dir = @mono_msvc_build_lib_dir@ +mono_runtime = @mono_runtime@ +mono_runtime_wrapper = @mono_runtime_wrapper@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +reloc_libdir = @reloc_libdir@ +runstatedir = @runstatedir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +subdirs = @subdirs@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +AM_CPPFLAGS = $(SHARED_CFLAGS) +corerun_SOURCES = corerun.cpp coreruncommon.cpp coreruncommon.h coreclrhost.h +all: all-am + +.SUFFIXES: +.SUFFIXES: .cpp .lo .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign netcore/corerun/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign netcore/corerun/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +install-binPROGRAMS: $(bin_PROGRAMS) + @$(NORMAL_INSTALL) + @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ + fi; \ + for p in $$list; do echo "$$p $$p"; done | \ + sed 's/$(EXEEXT)$$//' | \ + while read p p1; do if test -f $$p \ + || test -f $$p1 \ + ; then echo "$$p"; echo "$$p"; else :; fi; \ + done | \ + sed -e 'p;s,.*/,,;n;h' \ + -e 's|.*|.|' \ + -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ + sed 'N;N;N;s,\n, ,g' | \ + $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ + { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ + if ($$2 == $$4) files[d] = files[d] " " $$1; \ + else { print "f", $$3 "/" $$4, $$1; } } \ + END { for (d in files) print "f", d, files[d] }' | \ + while read type dir files; do \ + if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ + test -z "$$files" || { \ + echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ + $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ + } \ + ; done + +uninstall-binPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + files=`for p in $$list; do echo "$$p"; done | \ + sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ + -e 's/$$/$(EXEEXT)/' \ + `; \ + test -n "$$list" || exit 0; \ + echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(bindir)" && rm -f $$files + +clean-binPROGRAMS: + @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ + echo " rm -f" $$list; \ + rm -f $$list || exit $$?; \ + test -n "$(EXEEXT)" || exit 0; \ + list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f" $$list; \ + rm -f $$list + +corerun$(EXEEXT): $(corerun_OBJECTS) $(corerun_DEPENDENCIES) $(EXTRA_corerun_DEPENDENCIES) + @rm -f corerun$(EXEEXT) + $(AM_V_CXXLD)$(CXXLINK) $(corerun_OBJECTS) $(corerun_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/corerun.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/coreruncommon.Po@am__quote@ + +.cpp.o: +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< + +.cpp.obj: +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.cpp.lo: +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +test-local: +test-bundle-local: + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-am +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-am + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-am + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(PROGRAMS) +installdirs: + for dir in "$(DESTDIR)$(bindir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: install-binPROGRAMS + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +test: test-am + +test-am: test-local + +test-bundle: test-bundle-am + +test-bundle-am: test-bundle-local + +uninstall-am: uninstall-binPROGRAMS + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \ + clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \ + ctags ctags-am distclean distclean-compile distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-binPROGRAMS \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags tags-am test-am test-bundle-am test-bundle-local \ + test-local uninstall uninstall-am uninstall-binPROGRAMS + +.PRECIOUS: Makefile + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/netcore/corerun/coreclrhost.h b/netcore/corerun/coreclrhost.h new file mode 100644 index 0000000000..d1ec724974 --- /dev/null +++ b/netcore/corerun/coreclrhost.h @@ -0,0 +1,125 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +// +// APIs for hosting CoreCLR +// + +#ifndef __CORECLR_HOST_H__ +#define __CORECLR_HOST_H__ + +#if defined(_WIN32) && defined(_M_IX86) +#define CORECLR_CALLING_CONVENTION __stdcall +#else +#define CORECLR_CALLING_CONVENTION +#endif + +// For each hosting API, we define a function prototype and a function pointer +// The prototype is useful for implicit linking against the dynamic coreclr +// library and the pointer for explicit dynamic loading (dlopen, LoadLibrary) +#define CORECLR_HOSTING_API(function, ...) \ + extern "C" int CORECLR_CALLING_CONVENTION function(__VA_ARGS__); \ + typedef int (CORECLR_CALLING_CONVENTION *function##_ptr)(__VA_ARGS__) + +// +// Initialize the CoreCLR. Creates and starts CoreCLR host and creates an app domain +// +// Parameters: +// exePath - Absolute path of the executable that invoked the ExecuteAssembly (the native host application) +// appDomainFriendlyName - Friendly name of the app domain that will be created to execute the assembly +// propertyCount - Number of properties (elements of the following two arguments) +// propertyKeys - Keys of properties of the app domain +// propertyValues - Values of properties of the app domain +// hostHandle - Output parameter, handle of the created host +// domainId - Output parameter, id of the created app domain +// +// Returns: +// HRESULT indicating status of the operation. S_OK if the assembly was successfully executed +// +CORECLR_HOSTING_API(coreclr_initialize, + const char* exePath, + const char* appDomainFriendlyName, + int propertyCount, + const char** propertyKeys, + const char** propertyValues, + void** hostHandle, + unsigned int* domainId); + +// +// Shutdown CoreCLR. It unloads the app domain and stops the CoreCLR host. +// +// Parameters: +// hostHandle - Handle of the host +// domainId - Id of the domain +// +// Returns: +// HRESULT indicating status of the operation. S_OK if the assembly was successfully executed +// +CORECLR_HOSTING_API(coreclr_shutdown, + void* hostHandle, + unsigned int domainId); + +// +// Shutdown CoreCLR. It unloads the app domain and stops the CoreCLR host. +// +// Parameters: +// hostHandle - Handle of the host +// domainId - Id of the domain +// latchedExitCode - Latched exit code after domain unloaded +// +// Returns: +// HRESULT indicating status of the operation. S_OK if the assembly was successfully executed +// +CORECLR_HOSTING_API(coreclr_shutdown_2, + void* hostHandle, + unsigned int domainId, + int* latchedExitCode); + +// +// Create a native callable function pointer for a managed method. +// +// Parameters: +// hostHandle - Handle of the host +// domainId - Id of the domain +// entryPointAssemblyName - Name of the assembly which holds the custom entry point +// entryPointTypeName - Name of the type which holds the custom entry point +// entryPointMethodName - Name of the method which is the custom entry point +// delegate - Output parameter, the function stores a native callable function pointer to the delegate at the specified address +// +// Returns: +// HRESULT indicating status of the operation. S_OK if the assembly was successfully executed +// +CORECLR_HOSTING_API(coreclr_create_delegate, + void* hostHandle, + unsigned int domainId, + const char* entryPointAssemblyName, + const char* entryPointTypeName, + const char* entryPointMethodName, + void** delegate); + +// +// Execute a managed assembly with given arguments +// +// Parameters: +// hostHandle - Handle of the host +// domainId - Id of the domain +// argc - Number of arguments passed to the executed assembly +// argv - Array of arguments passed to the executed assembly +// managedAssemblyPath - Path of the managed assembly to execute (or NULL if using a custom entrypoint). +// exitCode - Exit code returned by the executed assembly +// +// Returns: +// HRESULT indicating status of the operation. S_OK if the assembly was successfully executed +// +CORECLR_HOSTING_API(coreclr_execute_assembly, + void* hostHandle, + unsigned int domainId, + int argc, + const char** argv, + const char* managedAssemblyPath, + unsigned int* exitCode); + +#undef CORECLR_HOSTING_API + +#endif // __CORECLR_HOST_H__ diff --git a/netcore/corerun/corerun.cpp b/netcore/corerun/corerun.cpp new file mode 100644 index 0000000000..4e5c9d9839 --- /dev/null +++ b/netcore/corerun/corerun.cpp @@ -0,0 +1,162 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +#include +#include +#include +#include + +// Display the command line options +void DisplayUsage() +{ + fprintf( + stderr, + "Usage: corerun [OPTIONS] assembly [ARGUMENTS]\n" + "Execute the specified managed assembly with the passed in arguments\n\n" + "Options:\n" + "-c, --clr-path path to the libcoreclr.so and the managed CLR assemblies\n"); +} + +// Parse the command line arguments +bool ParseArguments( + const int argc, + const char* argv[], + const char** clrFilesPath, + const char** managedAssemblyPath, + int* managedAssemblyArgc, + const char*** managedAssemblyArgv) +{ + bool success = false; + + *clrFilesPath = nullptr; + *managedAssemblyPath = nullptr; + *managedAssemblyArgv = nullptr; + *managedAssemblyArgc = 0; + + // The command line must contain at least the current exe name and the managed assembly path + if (argc >= 2) + { + for (int i = 1; i < argc; i++) + { + // Check for an option + if (argv[i][0] == '-') + { + // Path to the libcoreclr.so and the managed CLR assemblies + if (strcmp(argv[i], "-c") == 0 || strcmp(argv[i], "--clr-path") == 0) + { + i++; + if (i < argc) + { + *clrFilesPath = argv[i]; + } + else + { + fprintf(stderr, "Option %s: missing path\n", argv[i - 1]); + break; + } + } + else if (strcmp(argv[i], "-?") == 0 || strcmp(argv[i], "-h") == 0 || strcmp(argv[i], "--help") == 0) + { + DisplayUsage(); + break; + } + else + { + fprintf(stderr, "Unknown option %s\n", argv[i]); + break; + } + } + else + { + // First argument that is not an option is the managed assembly to execute + *managedAssemblyPath = argv[i]; + + int managedArgvOffset = (i + 1); + *managedAssemblyArgc = argc - managedArgvOffset; + if (*managedAssemblyArgc != 0) + { + *managedAssemblyArgv = &argv[managedArgvOffset]; + } + success = true; + break; + } + } + } + else + { + DisplayUsage(); + } + + return success; +} + +int corerun(const int argc, const char* argv[]) +{ + const char* clrFilesPath; + const char* managedAssemblyPath; + const char** managedAssemblyArgv; + int managedAssemblyArgc; + + if (!ParseArguments( + argc, + argv, + &clrFilesPath, + &managedAssemblyPath, + &managedAssemblyArgc, + &managedAssemblyArgv)) + { + // Invalid command line + return -1; + } + + // Check if the specified managed assembly file exists + struct stat sb; + if (stat(managedAssemblyPath, &sb) == -1) + { + perror("Managed assembly not found"); + return -1; + } + + // Verify that the managed assembly path points to a file + if (!S_ISREG(sb.st_mode)) + { + fprintf(stderr, "The specified managed assembly is not a file\n"); + return -1; + } + + // Make sure we have a full path for argv[0]. + std::string argv0AbsolutePath; + if (!GetEntrypointExecutableAbsolutePath(argv0AbsolutePath)) + { + perror("Could not get full path"); + return -1; + } + + std::string clrFilesAbsolutePath; + if(!GetClrFilesAbsolutePath(argv0AbsolutePath.c_str(), clrFilesPath, clrFilesAbsolutePath)) + { + return -1; + } + + std::string managedAssemblyAbsolutePath; + if (!GetAbsolutePath(managedAssemblyPath, managedAssemblyAbsolutePath)) + { + perror("Failed to convert managed assembly path to absolute path"); + return -1; + } + + int exitCode = ExecuteManagedAssembly( + argv0AbsolutePath.c_str(), + clrFilesAbsolutePath.c_str(), + managedAssemblyAbsolutePath.c_str(), + managedAssemblyArgc, + managedAssemblyArgv); + + return exitCode; +} + +int main(const int argc, const char* argv[]) +{ + return corerun(argc, argv); +} diff --git a/netcore/corerun/coreruncommon.cpp b/netcore/corerun/coreruncommon.cpp new file mode 100644 index 0000000000..25007bb3fd --- /dev/null +++ b/netcore/corerun/coreruncommon.cpp @@ -0,0 +1,520 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +// +// Code that is used by both the Unix corerun and coreconsole. +// + +#include "config.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#if defined(__FreeBSD__) +#include +#include +#endif +#if HAVE_GETAUXVAL +#include +#endif +#if defined(HAVE_SYS_SYSCTL_H) || defined(__FreeBSD__) +#include +#endif +#include "coreruncommon.h" +#include "coreclrhost.h" +#include +#ifndef SUCCEEDED +#define SUCCEEDED(Status) ((Status) >= 0) +#endif // !SUCCEEDED + +// Name of the environment variable controlling server GC. +// If set to 1, server GC is enabled on startup. If 0, server GC is +// disabled. Server GC is off by default. +static const char* serverGcVar = "COMPlus_gcServer"; + +// Name of environment variable to control "System.Globalization.Invariant" +// Set to 1 for Globalization Invariant mode to be true. Default is false. +static const char* globalizationInvariantVar = "CORECLR_GLOBAL_INVARIANT"; + +#if defined(__linux__) +#define symlinkEntrypointExecutable "/proc/self/exe" +#elif !defined(__APPLE__) +#define symlinkEntrypointExecutable "/proc/curproc/exe" +#endif + +bool GetEntrypointExecutableAbsolutePath(std::string& entrypointExecutable) +{ + bool result = false; + + entrypointExecutable.clear(); + + // Get path to the executable for the current process using + // platform specific means. +#if defined(__APPLE__) + + // On Mac, we ask the OS for the absolute path to the entrypoint executable + uint32_t lenActualPath = 0; + if (_NSGetExecutablePath(nullptr, &lenActualPath) == -1) + { + // OSX has placed the actual path length in lenActualPath, + // so re-attempt the operation + std::string resizedPath(lenActualPath, '\0'); + char *pResizedPath = const_cast(resizedPath.c_str()); + if (_NSGetExecutablePath(pResizedPath, &lenActualPath) == 0) + { + entrypointExecutable.assign(pResizedPath); + result = true; + } + } +#elif defined (__FreeBSD__) + static const int name[] = { + CTL_KERN, KERN_PROC, KERN_PROC_PATHNAME, -1 + }; + char path[PATH_MAX]; + size_t len; + + len = sizeof(path); + if (sysctl(name, 4, path, &len, nullptr, 0) == 0) + { + entrypointExecutable.assign(path); + result = true; + } + else + { + // ENOMEM + result = false; + } +#elif defined(__NetBSD__) && defined(KERN_PROC_PATHNAME) + static const int name[] = { + CTL_KERN, KERN_PROC_ARGS, -1, KERN_PROC_PATHNAME, + }; + char path[MAXPATHLEN]; + size_t len; + + len = sizeof(path); + if (sysctl(name, __arraycount(name), path, &len, NULL, 0) != -1) + { + entrypointExecutable.assign(path); + result = true; + } + else + { + result = false; + } +#else + +#if HAVE_GETAUXVAL && defined(AT_EXECFN) + const char *execfn = (const char *)getauxval(AT_EXECFN); + + if (execfn) + { + entrypointExecutable.assign(execfn); + result = true; + } + else +#endif + // On other OSs, return the symlink that will be resolved by GetAbsolutePath + // to fetch the entrypoint EXE absolute path, inclusive of filename. + result = GetAbsolutePath(symlinkEntrypointExecutable, entrypointExecutable); +#endif + + return result; +} + +bool GetAbsolutePath(const char* path, std::string& absolutePath) +{ + bool result = false; + + char realPath[PATH_MAX]; + if (realpath(path, realPath) != nullptr && realPath[0] != '\0') + { + absolutePath.assign(realPath); + // realpath should return canonicalized path without the trailing slash + assert(absolutePath.back() != '/'); + + result = true; + } + + return result; +} + +bool GetDirectory(const char* absolutePath, std::string& directory) +{ + directory.assign(absolutePath); + size_t lastSlash = directory.rfind('/'); + if (lastSlash != std::string::npos) + { + directory.erase(lastSlash); + return true; + } + + return false; +} + +bool GetClrFilesAbsolutePath(const char* currentExePath, const char* clrFilesPath, std::string& clrFilesAbsolutePath) +{ + std::string clrFilesRelativePath; + const char* clrFilesPathLocal = clrFilesPath; + if (clrFilesPathLocal == nullptr) + { + // There was no CLR files path specified, use the folder of the corerun/coreconsole + if (!GetDirectory(currentExePath, clrFilesRelativePath)) + { + perror("Failed to get directory from argv[0]"); + return false; + } + + clrFilesPathLocal = clrFilesRelativePath.c_str(); + + // TODO: consider using an env variable (if defined) as a fall-back. + // The windows version of the corerun uses core_root env variable + } + + if (!GetAbsolutePath(clrFilesPathLocal, clrFilesAbsolutePath)) + { + perror("Failed to convert CLR files path to absolute path"); + return false; + } + + return true; +} + +void AddFilesFromDirectoryToTpaList(const char* directory, std::string& tpaList) +{ + const char * const tpaExtensions[] = { + ".ni.dll", // Probe for .ni.dll first so that it's preferred if ni and il coexist in the same dir + ".dll", + ".ni.exe", + ".exe", + }; + + DIR* dir = opendir(directory); + if (dir == nullptr) + { + return; + } + + std::set addedAssemblies; + + // Walk the directory for each extension separately so that we first get files with .ni.dll extension, + // then files with .dll extension, etc. + for (size_t extIndex = 0; extIndex < sizeof(tpaExtensions) / sizeof(tpaExtensions[0]); extIndex++) + { + const char* ext = tpaExtensions[extIndex]; + int extLength = strlen(ext); + + struct dirent* entry; + + // For all entries in the directory + while ((entry = readdir(dir)) != nullptr) + { + // We are interested in files only + switch (entry->d_type) + { + case DT_REG: + break; + + // Handle symlinks and file systems that do not support d_type + case DT_LNK: + case DT_UNKNOWN: + { + std::string fullFilename; + + fullFilename.append(directory); + fullFilename.append("/"); + fullFilename.append(entry->d_name); + + struct stat sb; + if (stat(fullFilename.c_str(), &sb) == -1) + { + continue; + } + + if (!S_ISREG(sb.st_mode)) + { + continue; + } + } + break; + + default: + continue; + } + + std::string filename(entry->d_name); + + // Check if the extension matches the one we are looking for + int extPos = filename.length() - extLength; + if ((extPos <= 0) || (filename.compare(extPos, extLength, ext) != 0)) + { + continue; + } + + std::string filenameWithoutExt(filename.substr(0, extPos)); + + // Make sure if we have an assembly with multiple extensions present, + // we insert only one version of it. + if (addedAssemblies.find(filenameWithoutExt) == addedAssemblies.end()) + { + addedAssemblies.insert(filenameWithoutExt); + + tpaList.append(directory); + tpaList.append("/"); + tpaList.append(filename); + tpaList.append(":"); + } + } + + // Rewind the directory stream to be able to iterate over it for the next extension + rewinddir(dir); + } + + closedir(dir); +} + +const char* GetEnvValueBoolean(const char* envVariable) +{ + const char* envValue = std::getenv(envVariable); + if (envValue == nullptr) + { + envValue = "0"; + } + // CoreCLR expects strings "true" and "false" instead of "1" and "0". + return (std::strcmp(envValue, "1") == 0 || strcasecmp(envValue, "true") == 0) ? "true" : "false"; +} + +static void *TryLoadHostPolicy(const char *hostPolicyPath) +{ +#if defined(__APPLE__) + static const char LibrarySuffix[] = ".dylib"; +#else // Various Linux-related OS-es + static const char LibrarySuffix[] = ".so"; +#endif + + std::string hostPolicyCompletePath(hostPolicyPath); + hostPolicyCompletePath.append(LibrarySuffix); + + void *libraryPtr = dlopen(hostPolicyCompletePath.c_str(), RTLD_LAZY); + if (libraryPtr == nullptr) + { + fprintf(stderr, "Failed to load mock hostpolicy at path '%s'. Error: %s", hostPolicyCompletePath.c_str(), dlerror()); + } + + return libraryPtr; +} + +int ExecuteManagedAssembly( + const char* currentExeAbsolutePath, + const char* clrFilesAbsolutePath, + const char* managedAssemblyAbsolutePath, + int managedAssemblyArgc, + const char** managedAssemblyArgv) +{ + // Indicates failure + int exitCode = -1; + +#ifdef _ARM_ + // libunwind library is used to unwind stack frame, but libunwind for ARM + // does not support ARM vfpv3/NEON registers in DWARF format correctly. + // Therefore let's disable stack unwinding using DWARF information + // See https://github.com/dotnet/coreclr/issues/6698 + // + // libunwind use following methods to unwind stack frame. + // UNW_ARM_METHOD_ALL 0xFF + // UNW_ARM_METHOD_DWARF 0x01 + // UNW_ARM_METHOD_FRAME 0x02 + // UNW_ARM_METHOD_EXIDX 0x04 + putenv(const_cast("UNW_ARM_UNWIND_METHOD=6")); +#endif // _ARM_ + + std::string coreClrDllPath(clrFilesAbsolutePath); + coreClrDllPath.append("/"); + coreClrDllPath.append(coreClrDll); + + if (coreClrDllPath.length() >= PATH_MAX) + { + fprintf(stderr, "Absolute path to libcoreclr.so too long\n"); + return -1; + } + + // Get just the path component of the managed assembly path + std::string appPath; + GetDirectory(managedAssemblyAbsolutePath, appPath); + + std::string tpaList; + if (strlen(managedAssemblyAbsolutePath) > 0) + { + // Target assembly should be added to the tpa list. Otherwise corerun.exe + // may find wrong assembly to execute. + // Details can be found at https://github.com/dotnet/coreclr/issues/5631 + tpaList = managedAssemblyAbsolutePath; + tpaList.append(":"); + } + + // Construct native search directory paths + std::string nativeDllSearchDirs(appPath); + char *coreLibraries = getenv("CORE_LIBRARIES"); + if (coreLibraries) + { + nativeDllSearchDirs.append(":"); + nativeDllSearchDirs.append(coreLibraries); + if (std::strcmp(coreLibraries, clrFilesAbsolutePath) != 0) + { + AddFilesFromDirectoryToTpaList(coreLibraries, tpaList); + } + } + + nativeDllSearchDirs.append(":"); + nativeDllSearchDirs.append(clrFilesAbsolutePath); + + void* hostpolicyLib = nullptr; + char* mockHostpolicyPath = getenv("MOCK_HOSTPOLICY"); + if (mockHostpolicyPath) + { + hostpolicyLib = TryLoadHostPolicy(mockHostpolicyPath); + if (hostpolicyLib == nullptr) + { + return -1; + } + } + + AddFilesFromDirectoryToTpaList(clrFilesAbsolutePath, tpaList); + + void* coreclrLib = dlopen(coreClrDllPath.c_str(), RTLD_NOW | RTLD_LOCAL); + if (coreclrLib != nullptr) + { + coreclr_initialize_ptr initializeCoreCLR = (coreclr_initialize_ptr)dlsym(coreclrLib, "coreclr_initialize"); + coreclr_execute_assembly_ptr executeAssembly = (coreclr_execute_assembly_ptr)dlsym(coreclrLib, "coreclr_execute_assembly"); + coreclr_shutdown_2_ptr shutdownCoreCLR = (coreclr_shutdown_2_ptr)dlsym(coreclrLib, "coreclr_shutdown_2"); + + if (initializeCoreCLR == nullptr) + { + fprintf(stderr, "Function coreclr_initialize not found in the libcoreclr.so\n"); + } + else if (executeAssembly == nullptr) + { + fprintf(stderr, "Function coreclr_execute_assembly not found in the libcoreclr.so\n"); + } + else if (shutdownCoreCLR == nullptr) + { + fprintf(stderr, "Function coreclr_shutdown_2 not found in the libcoreclr.so\n"); + } + else + { + // Check whether we are enabling server GC (off by default) + const char* useServerGc = GetEnvValueBoolean(serverGcVar); + + // Check Globalization Invariant mode (false by default) + const char* globalizationInvariant = GetEnvValueBoolean(globalizationInvariantVar); + + // Allowed property names: + // APPBASE + // - The base path of the application from which the exe and other assemblies will be loaded + // + // TRUSTED_PLATFORM_ASSEMBLIES + // - The list of complete paths to each of the fully trusted assemblies + // + // APP_PATHS + // - The list of paths which will be probed by the assembly loader + // + // APP_NI_PATHS + // - The list of additional paths that the assembly loader will probe for ngen images + // + // NATIVE_DLL_SEARCH_DIRECTORIES + // - The list of paths that will be probed for native DLLs called by PInvoke + // + const char *propertyKeys[] = { + "TRUSTED_PLATFORM_ASSEMBLIES", + "APP_PATHS", + "APP_NI_PATHS", + "NATIVE_DLL_SEARCH_DIRECTORIES", + "System.GC.Server", + "System.Globalization.Invariant", + }; + const char *propertyValues[] = { + // TRUSTED_PLATFORM_ASSEMBLIES + tpaList.c_str(), + // APP_PATHS + appPath.c_str(), + // APP_NI_PATHS + appPath.c_str(), + // NATIVE_DLL_SEARCH_DIRECTORIES + nativeDllSearchDirs.c_str(), + // System.GC.Server + useServerGc, + // System.Globalization.Invariant + globalizationInvariant, + }; + + void* hostHandle; + unsigned int domainId; + + int st = initializeCoreCLR( + currentExeAbsolutePath, + "unixcorerun", + sizeof(propertyKeys) / sizeof(propertyKeys[0]), + propertyKeys, + propertyValues, + &hostHandle, + &domainId); + + if (!SUCCEEDED(st)) + { + fprintf(stderr, "coreclr_initialize failed - status: 0x%08x\n", st); + exitCode = -1; + } + else + { + st = executeAssembly( + hostHandle, + domainId, + managedAssemblyArgc, + managedAssemblyArgv, + managedAssemblyAbsolutePath, + (unsigned int*)&exitCode); + + if (!SUCCEEDED(st)) + { + fprintf(stderr, "coreclr_execute_assembly failed - status: 0x%08x\n", st); + exitCode = -1; + } + + int latchedExitCode = 0; + st = shutdownCoreCLR(hostHandle, domainId, &latchedExitCode); + if (!SUCCEEDED(st)) + { + fprintf(stderr, "coreclr_shutdown failed - status: 0x%08x\n", st); + exitCode = -1; + } + + if (exitCode != -1) + { + exitCode = latchedExitCode; + } + } + } + } + else + { + const char* error = dlerror(); + fprintf(stderr, "dlopen failed to open the libcoreclr.so with error %s\n", error); + } + + if (hostpolicyLib) + { + if(dlclose(hostpolicyLib) != 0) + { + fprintf(stderr, "Warning - dlclose of mock hostpolicy failed.\n"); + } + } + + return exitCode; +} diff --git a/netcore/corerun/coreruncommon.h b/netcore/corerun/coreruncommon.h new file mode 100644 index 0000000000..fb7f6730b9 --- /dev/null +++ b/netcore/corerun/coreruncommon.h @@ -0,0 +1,56 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +#include + +// Get the path to entrypoint executable +bool GetEntrypointExecutableAbsolutePath(std::string& entrypointExecutable); + +// Get absolute path from the specified path. +// Return true in case of a success, false otherwise. +bool GetAbsolutePath(const char* path, std::string& absolutePath); + +// Get directory of the specified path. +// Return true in case of a success, false otherwise. +bool GetDirectory(const char* absolutePath, std::string& directory); + +// +// Get the absolute path to use to locate libcoreclr.so and the CLR assemblies are stored. If clrFilesPath is provided, +// this function will return the absolute path to it. Otherwise, the directory of the current executable is used. +// +// Return true in case of a success, false otherwise. +// +bool GetClrFilesAbsolutePath(const char* currentExePath, const char* clrFilesPath, std::string& clrFilesAbsolutePath); + +// Add all *.dll, *.ni.dll, *.exe, and *.ni.exe files from the specified directory to the tpaList string. +void AddFilesFromDirectoryToTpaList(const char* directory, std::string& tpaList); + +// +// Execute the specified managed assembly. +// +// Parameters: +// currentExePath - Path to the current executable +// clrFilesAbsolutePath - Absolute path to the folder where the libcoreclr.so and CLR managed assemblies are stored +// managedAssemblyPath - Path to the managed assembly to execute +// managedAssemblyArgc - Number of arguments passed to the executed assembly +// managedAssemblyArgv - Array of arguments passed to the executed assembly +// +// Returns: +// ExitCode of the assembly +// +int ExecuteManagedAssembly( + const char* currentExeAbsolutePath, + const char* clrFilesAbsolutePath, + const char* managedAssemblyAbsolutePath, + int managedAssemblyArgc, + const char** managedAssemblyArgv); + + +#if defined(__APPLE__) +#include +static const char * const coreClrDll = "libcoreclr.dylib"; +#else +static const char * const coreClrDll = "libcoreclr.so"; +#endif + diff --git a/po/Makefile.in b/po/Makefile.in index bb61805b8d..c8cb2c7e4c 100644 --- a/po/Makefile.in +++ b/po/Makefile.in @@ -274,6 +274,7 @@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTERP_CFLAGS = @INTERP_CFLAGS@ INTL = @INTL@ INVARIANT_AOT_OPTIONS = @INVARIANT_AOT_OPTIONS@ JEMALLOC_AUTOCONF_FLAGS = @JEMALLOC_AUTOCONF_FLAGS@ diff --git a/po/mcs/de.gmo b/po/mcs/de.gmo index 1129b4baf9fd6bdef6664370a2bc589aa075d49d..9543e2b1a4d84d2bc465ecc069ef3bd2ab71eff2 100644 GIT binary patch delta 21 ccmbQIHBW296D|%z0|i5KD\n" "Language-Team: LANGUAGE \n" diff --git a/po/mcs/pt_BR.gmo b/po/mcs/pt_BR.gmo index 04e617900d9dbf3e9ae89f02b6174a2aa2f0c7d3..3917ce2da8cc4a2c23658dbb6b964b5e948fc917 100644 GIT binary patch delta 23 fcmaF1gXP%{mJP8}ISdUH49%^K3^%7vWo!okbsY$* delta 23 fcmaF1gXP%{mJP8}ISfn`3@ogSEjOo5Wo!okb#@50 diff --git a/po/mcs/pt_BR.po.REMOVED.git-id b/po/mcs/pt_BR.po.REMOVED.git-id index 72138ebe71..ccd71c1c1f 100644 --- a/po/mcs/pt_BR.po.REMOVED.git-id +++ b/po/mcs/pt_BR.po.REMOVED.git-id @@ -1 +1 @@ -f8de2fe29b9b116c3539ed7c1d8abf6d633a9780 \ No newline at end of file +5acf09868278169e994b9b43ce5a1ea8c35a17f7 \ No newline at end of file diff --git a/runtime/Makefile.in b/runtime/Makefile.in index c61cd45345..27987ff49a 100644 --- a/runtime/Makefile.in +++ b/runtime/Makefile.in @@ -241,6 +241,7 @@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTERP_CFLAGS = @INTERP_CFLAGS@ INTL = @INTL@ INVARIANT_AOT_OPTIONS = @INVARIANT_AOT_OPTIONS@ JEMALLOC_AUTOCONF_FLAGS = @JEMALLOC_AUTOCONF_FLAGS@ diff --git a/samples/Makefile.in b/samples/Makefile.in index 8b9480f84e..0a69189038 100644 --- a/samples/Makefile.in +++ b/samples/Makefile.in @@ -214,6 +214,7 @@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTERP_CFLAGS = @INTERP_CFLAGS@ INTL = @INTL@ INVARIANT_AOT_OPTIONS = @INVARIANT_AOT_OPTIONS@ JEMALLOC_AUTOCONF_FLAGS = @JEMALLOC_AUTOCONF_FLAGS@ diff --git a/samples/embed/test-invoke.c b/samples/embed/test-invoke.c index 9d53716957..42df4003cf 100644 --- a/samples/embed/test-invoke.c +++ b/samples/embed/test-invoke.c @@ -1,8 +1,12 @@ +#ifndef _TESTCASE_ #include +#endif + #include #include #include #include +#include #include #include @@ -15,9 +19,9 @@ * We show how to create objects and invoke methods and set fields in them. * Compile with: * gcc -Wall -o test-invoke test-invoke.c `pkg-config --cflags --libs mono-2` -lm - * mcs invoke.cs + * mcs -out:test-embed-invoke-cs.exe invoke.cs * Run with: - * ./test-invoke invoke.exe + * ./test-invoke */ static void @@ -316,18 +320,40 @@ static void main_function (MonoDomain *domain, const char *file, int argc, char create_object (domain, mono_assembly_get_image (assembly)); } +#ifdef _TESTCASE_ +#ifdef __cplusplus +extern "C" +#endif +int +test_mono_embed_invoke_main (void); + int -main (int argc, char* argv[]) { +test_mono_embed_invoke_main (void) +{ +#else +int +main (void) +{ +#endif + MonoDomain *domain; + int argc = 2; + char *argv[] = { + (char*)"test-embed-invoke.exe", + (char*)"test-embed-invoke-cs.exe", + NULL + }; const char *file; int retval; - - if (argc < 2){ - fprintf (stderr, "Please provide an assembly to load\n"); - return 1; - } file = argv [1]; - /* + + /* + * Load the default Mono configuration file, this is needed + * if you are planning on using the dllmaps defined on the + * system configuration + */ + mono_config_parse (NULL); + /* * mono_jit_init() creates a domain: each assembly is * loaded and run in a MonoDomain. */ diff --git a/samples/embed/test.cs b/samples/embed/test.cs index 3283006d8b..fcca03b54a 100644 --- a/samples/embed/test.cs +++ b/samples/embed/test.cs @@ -5,7 +5,11 @@ class MonoEmbed { [MethodImplAttribute(MethodImplOptions.InternalCall)] extern static string gimme(); - static void Main() { - Console.WriteLine (gimme ()); + static int Main () + { + System.Console.WriteLine(gimme ()); + if (gimme ().Equals("All your monos are belong to us!")) + return 0; + return 100; } } diff --git a/samples/embed/teste.c b/samples/embed/teste.c index 6f727a00e1..bc2135bff9 100644 --- a/samples/embed/teste.c +++ b/samples/embed/teste.c @@ -1,15 +1,19 @@ +#ifndef _TESTCASE_ #include +#endif + #include #include +#include #include /* * Very simple mono embedding example. * Compile with: * gcc -o teste teste.c `pkg-config --cflags --libs mono-2` -lm - * mcs test.cs + * mcs -out:test-embed.exe test.cs * Run with: - * ./teste test.exe + * ./teste */ static MonoString* @@ -40,19 +44,33 @@ static void* custom_malloc(size_t bytes) return malloc(bytes); } +#ifdef _TESTCASE_ +#ifdef __cplusplus +extern "C" +#endif +int +test_mono_embed_main (void); + int -main(int argc, char* argv[]) { +test_mono_embed_main (void) { +#else +int +main (void) { +#endif + MonoDomain *domain; + int argc = 2; + char *argv[] = { + (char*)"test-mono-embed.exe", + (char*)"test-embed.exe", + NULL + }; const char *file; int retval; - - if (argc < 2){ - fprintf (stderr, "Please provide an assembly to load\n"); - return 1; - } + file = argv [1]; - MonoAllocatorVTable mem_vtable = {custom_malloc}; + MonoAllocatorVTable mem_vtable = {MONO_ALLOCATOR_VTABLE_VERSION, custom_malloc}; mono_set_allocator_vtable (&mem_vtable); /* @@ -70,7 +88,7 @@ main(int argc, char* argv[]) { * We add our special internal call, so that C# code * can call us back. */ - mono_add_internal_call ("MonoEmbed::gimme", gimme); + mono_add_internal_call ("MonoEmbed::gimme", (const void *)gimme); main_function (domain, file, argc - 1, argv + 1); diff --git a/scripts/Makefile.in b/scripts/Makefile.in index 8539d57112..23a8f790d5 100644 --- a/scripts/Makefile.in +++ b/scripts/Makefile.in @@ -247,6 +247,7 @@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTERP_CFLAGS = @INTERP_CFLAGS@ INTL = @INTL@ INVARIANT_AOT_OPTIONS = @INVARIANT_AOT_OPTIONS@ JEMALLOC_AUTOCONF_FLAGS = @JEMALLOC_AUTOCONF_FLAGS@ diff --git a/scripts/csc.in b/scripts/csc.in index 63de0a9449..f5643c814a 100644 --- a/scripts/csc.in +++ b/scripts/csc.in @@ -1,2 +1,2 @@ #!/bin/sh -exec @bindir@/mono --gc-params=nursery-size=64m --clr-memory-model $MONO_OPTIONS @mono_instdir@/4.5/csc.exe "$@" +exec @bindir@/mono --gc-params=nursery-size=64m $MONO_OPTIONS @mono_instdir@/4.5/csc.exe "$@" diff --git a/scripts/csi.in b/scripts/csi.in index a1f6a86b1c..4d5026fcc5 100644 --- a/scripts/csi.in +++ b/scripts/csi.in @@ -1,2 +1,2 @@ #!/bin/sh -exec @bindir@/mono --gc-params=nursery-size=64m --clr-memory-model $MONO_OPTIONS @mono_instdir@/4.5/csi.exe "$@" +exec @bindir@/mono --gc-params=nursery-size=64m $MONO_OPTIONS @mono_instdir@/4.5/csi.exe "$@" diff --git a/scripts/mono-package-runtime b/scripts/mono-package-runtime index e46266d074..5e862335dc 100755 --- a/scripts/mono-package-runtime +++ b/scripts/mono-package-runtime @@ -35,6 +35,6 @@ fi o=`pwd`/$output cd $prefix -(zip -u $o.zip bin/mono lib/mono/4.5/mscorlib.dll lib/mono/4.5/System*dll lib/mono/4.5/Mono.CSharp.dll lib/mono/4.5/Microsoft*dll lib/mono/4.5/FSharp*.dll lib/mono/4.5/I18N*dll lib/mono/4.5/Accessibility.dll lib/mono/4.5/RabbitMQ.Client.dll lib/mono/4.5/ICSharpCode.SharpZipLib.dll lib/mono/4.5/CustomMarshalers.dll etc/mono/config etc/mono/4.5/machine.config etc/mono/4.5/web.config lib/mono/4.5/Mono.Cairo.dll lib/mono/4.5/Mono.Data.Sqlite.dll lib/mono/4.5/Mono.Posix.dll lib/mono/4.5/Mono.Security.*dll lib/mono/4.5/Mono.Simd.dll lib/libMonoSupportW$extension lib/libMonoPosixHelper$extension lib/libmono-btls-shared$extension) +(zip -u $o.zip bin/mono lib/mono/4.5/mscorlib.dll lib/mono/4.5/System*dll lib/mono/4.5/Mono.CSharp.dll lib/mono/4.5/Microsoft*dll lib/mono/4.5/FSharp*.dll lib/mono/4.5/I18N*dll lib/mono/4.5/Accessibility.dll lib/mono/4.5/RabbitMQ.Client.dll lib/mono/4.5/ICSharpCode.SharpZipLib.dll lib/mono/4.5/CustomMarshalers.dll etc/mono/config etc/mono/4.5/machine.config etc/mono/4.5/web.config lib/mono/4.5/Mono.Cairo.dll lib/mono/4.5/Mono.Data.Sqlite.dll lib/mono/4.5/Mono.Posix.dll lib/mono/4.5/Mono.Security.*dll lib/mono/4.5/Mono.Simd.dll lib/mono/4.5/Mono.WebBrowser.dll lib/mono/4.5/Novell.Directory.Ldap.dll lib/libMonoSupportW$extension lib/libMonoPosixHelper$extension lib/libmono-btls-shared$extension) echo Created file $o.zip diff --git a/scripts/vbc.in b/scripts/vbc.in index c884d8554d..7bdd70ecb4 100644 --- a/scripts/vbc.in +++ b/scripts/vbc.in @@ -1,2 +1,2 @@ #!/bin/sh -exec @bindir@/mono --gc-params=nursery-size=64m --clr-memory-model $MONO_OPTIONS @mono_instdir@/4.5/vbc.exe "$@" +exec @bindir@/mono --gc-params=nursery-size=64m $MONO_OPTIONS @mono_instdir@/4.5/vbc.exe "$@" diff --git a/support/Makefile.am b/support/Makefile.am index 351e47d93f..cd5b849709 100644 --- a/support/Makefile.am +++ b/support/Makefile.am @@ -1,3 +1,4 @@ +if !ENABLE_MSVC_ONLY if HOST_WIN32 SUPPORT= else @@ -190,3 +191,17 @@ patch-libtool: sed -e 's,LTCOMPILE =,LTCOMPILE2 =,g' 2 > 3 cat 1 3 > Makefile touch *.c + +endif # !ENABLE_MSVC_ONLY + +if ENABLE_MSVC_ONLY + +all-local: + + make -C $(top_srcdir)/msvc libmonoposixhelper + +clean-local: + + make -C $(top_srcdir)/msvc clean-libmonoposixhelper + +endif # ENABLE_MSVC_ONLY diff --git a/support/Makefile.in b/support/Makefile.in index 957c525618..883365daa4 100644 --- a/support/Makefile.in +++ b/support/Makefile.in @@ -139,9 +139,10 @@ am__uninstall_files_from_dir = { \ am__installdirs = "$(DESTDIR)$(libdir)" LTLIBRARIES = $(lib_LTLIBRARIES) am__DEPENDENCIES_1 = -@HAVE_STATIC_ZLIB_TRUE@am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) -libMonoPosixHelper_la_DEPENDENCIES = $(MPH_LIBS) $(am__DEPENDENCIES_2) \ - $(am__DEPENDENCIES_1) +@ENABLE_MSVC_ONLY_FALSE@@HAVE_STATIC_ZLIB_TRUE@am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) +@ENABLE_MSVC_ONLY_FALSE@libMonoPosixHelper_la_DEPENDENCIES = \ +@ENABLE_MSVC_ONLY_FALSE@ $(MPH_LIBS) $(am__DEPENDENCIES_2) \ +@ENABLE_MSVC_ONLY_FALSE@ $(am__DEPENDENCIES_1) am__libMonoPosixHelper_la_SOURCES_DIST = errno.c map.c map.h mph.h \ signal.c stdio.c string.c stdlib.c dirent.c fcntl.c fstab.c \ grp.c macros.c nl.c nl.h old-map.c old-map.h pwd.c serial.c \ @@ -154,26 +155,34 @@ am__libMonoPosixHelper_la_SOURCES_DIST = errno.c map.c map.h mph.h \ inffixed.h inflate.h inftrees.h trees.h zconf.h zlib.h zutil.h \ minizip/crypt.h minizip/ioapi.c minizip/ioapi.h \ minizip/unzip.c minizip/unzip.h minizip/zip.c minizip/zip.h -am__objects_1 = errno.lo map.lo signal.lo stdio.lo string.lo stdlib.lo -am__objects_2 = dirent.lo fcntl.lo fstab.lo grp.lo macros.lo nl.lo \ - old-map.lo pwd.lo serial.lo sys-mman.lo sys-sendfile.lo \ - sys-socket.lo sys-stat.lo sys-statvfs.lo sys-time.lo \ - sys-uio.lo sys-utsname.lo sys-wait.lo sys-xattr.lo syslog.lo \ - time.lo unistd.lo utime.lo x-struct-str.lo -@HOST_WIN32_FALSE@am__objects_3 = $(am__objects_1) $(am__objects_2) -@HOST_WIN32_TRUE@am__objects_3 = $(am__objects_1) -am__objects_4 = adler32.lo compress.lo crc32.lo uncompr.lo deflate.lo \ - trees.lo zutil.lo inflate.lo infback.lo inftrees.lo inffast.lo -@HAVE_STATIC_ZLIB_FALSE@@HAVE_SYS_ZLIB_FALSE@am__objects_5 = \ -@HAVE_STATIC_ZLIB_FALSE@@HAVE_SYS_ZLIB_FALSE@ zlib-helper.lo \ -@HAVE_STATIC_ZLIB_FALSE@@HAVE_SYS_ZLIB_FALSE@ $(am__objects_4) -@HAVE_STATIC_ZLIB_FALSE@@HAVE_SYS_ZLIB_TRUE@am__objects_5 = \ -@HAVE_STATIC_ZLIB_FALSE@@HAVE_SYS_ZLIB_TRUE@ zlib-helper.lo -@HAVE_STATIC_ZLIB_TRUE@am__objects_5 = zlib-helper.lo -am__dirstamp = $(am__leading_dot)dirstamp -am__objects_6 = minizip/ioapi.lo minizip/unzip.lo minizip/zip.lo -am_libMonoPosixHelper_la_OBJECTS = $(am__objects_3) $(am__objects_5) \ - $(am__objects_6) +@ENABLE_MSVC_ONLY_FALSE@am__objects_1 = errno.lo map.lo signal.lo \ +@ENABLE_MSVC_ONLY_FALSE@ stdio.lo string.lo stdlib.lo +@ENABLE_MSVC_ONLY_FALSE@am__objects_2 = dirent.lo fcntl.lo fstab.lo \ +@ENABLE_MSVC_ONLY_FALSE@ grp.lo macros.lo nl.lo old-map.lo \ +@ENABLE_MSVC_ONLY_FALSE@ pwd.lo serial.lo sys-mman.lo \ +@ENABLE_MSVC_ONLY_FALSE@ sys-sendfile.lo sys-socket.lo \ +@ENABLE_MSVC_ONLY_FALSE@ sys-stat.lo sys-statvfs.lo sys-time.lo \ +@ENABLE_MSVC_ONLY_FALSE@ sys-uio.lo sys-utsname.lo sys-wait.lo \ +@ENABLE_MSVC_ONLY_FALSE@ sys-xattr.lo syslog.lo time.lo \ +@ENABLE_MSVC_ONLY_FALSE@ unistd.lo utime.lo x-struct-str.lo +@ENABLE_MSVC_ONLY_FALSE@@HOST_WIN32_FALSE@am__objects_3 = \ +@ENABLE_MSVC_ONLY_FALSE@@HOST_WIN32_FALSE@ $(am__objects_1) \ +@ENABLE_MSVC_ONLY_FALSE@@HOST_WIN32_FALSE@ $(am__objects_2) +@ENABLE_MSVC_ONLY_FALSE@@HOST_WIN32_TRUE@am__objects_3 = \ +@ENABLE_MSVC_ONLY_FALSE@@HOST_WIN32_TRUE@ $(am__objects_1) +@ENABLE_MSVC_ONLY_FALSE@am__objects_4 = adler32.lo compress.lo \ +@ENABLE_MSVC_ONLY_FALSE@ crc32.lo uncompr.lo deflate.lo \ +@ENABLE_MSVC_ONLY_FALSE@ trees.lo zutil.lo inflate.lo \ +@ENABLE_MSVC_ONLY_FALSE@ infback.lo inftrees.lo inffast.lo +@ENABLE_MSVC_ONLY_FALSE@@HAVE_STATIC_ZLIB_FALSE@@HAVE_SYS_ZLIB_FALSE@am__objects_5 = zlib-helper.lo \ +@ENABLE_MSVC_ONLY_FALSE@@HAVE_STATIC_ZLIB_FALSE@@HAVE_SYS_ZLIB_FALSE@ $(am__objects_4) +@ENABLE_MSVC_ONLY_FALSE@@HAVE_STATIC_ZLIB_FALSE@@HAVE_SYS_ZLIB_TRUE@am__objects_5 = zlib-helper.lo +@ENABLE_MSVC_ONLY_FALSE@@HAVE_STATIC_ZLIB_TRUE@am__objects_5 = \ +@ENABLE_MSVC_ONLY_FALSE@@HAVE_STATIC_ZLIB_TRUE@ zlib-helper.lo +@ENABLE_MSVC_ONLY_FALSE@am__objects_6 = ioapi.lo unzip.lo zip.lo +@ENABLE_MSVC_ONLY_FALSE@am_libMonoPosixHelper_la_OBJECTS = \ +@ENABLE_MSVC_ONLY_FALSE@ $(am__objects_3) $(am__objects_5) \ +@ENABLE_MSVC_ONLY_FALSE@ $(am__objects_6) libMonoPosixHelper_la_OBJECTS = $(am_libMonoPosixHelper_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) @@ -183,16 +192,21 @@ libMonoPosixHelper_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) $(libMonoPosixHelper_la_LDFLAGS) \ $(LDFLAGS) -o $@ -@BUILD_SUPPORT_TRUE@am_libMonoPosixHelper_la_rpath = -rpath $(libdir) -libMonoSupportW_la_DEPENDENCIES = $(glib_libs) -am_libMonoSupportW_la_OBJECTS = supportw.lo support-heap.lo +@BUILD_SUPPORT_TRUE@@ENABLE_MSVC_ONLY_FALSE@am_libMonoPosixHelper_la_rpath = \ +@BUILD_SUPPORT_TRUE@@ENABLE_MSVC_ONLY_FALSE@ -rpath $(libdir) +@ENABLE_MSVC_ONLY_FALSE@libMonoSupportW_la_DEPENDENCIES = \ +@ENABLE_MSVC_ONLY_FALSE@ $(glib_libs) +am__libMonoSupportW_la_SOURCES_DIST = supportw.c support-heap.c \ + supportw.h +@ENABLE_MSVC_ONLY_FALSE@am_libMonoSupportW_la_OBJECTS = supportw.lo \ +@ENABLE_MSVC_ONLY_FALSE@ support-heap.lo libMonoSupportW_la_OBJECTS = $(am_libMonoSupportW_la_OBJECTS) libMonoSupportW_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) $(libMonoSupportW_la_LDFLAGS) \ $(LDFLAGS) -o $@ -@BUILD_SUPPORT_TRUE@@HOST_WIN32_FALSE@am_libMonoSupportW_la_rpath = \ -@BUILD_SUPPORT_TRUE@@HOST_WIN32_FALSE@ -rpath $(libdir) +@BUILD_SUPPORT_TRUE@@ENABLE_MSVC_ONLY_FALSE@@HOST_WIN32_FALSE@am_libMonoSupportW_la_rpath = -rpath \ +@BUILD_SUPPORT_TRUE@@ENABLE_MSVC_ONLY_FALSE@@HOST_WIN32_FALSE@ $(libdir) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false @@ -226,7 +240,7 @@ am__v_CCLD_1 = SOURCES = $(libMonoPosixHelper_la_SOURCES) \ $(libMonoSupportW_la_SOURCES) DIST_SOURCES = $(am__libMonoPosixHelper_la_SOURCES_DIST) \ - $(libMonoSupportW_la_SOURCES) + $(am__libMonoSupportW_la_SOURCES_DIST) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ @@ -338,6 +352,7 @@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTERP_CFLAGS = @INTERP_CFLAGS@ INTL = @INTL@ INVARIANT_AOT_OPTIONS = @INVARIANT_AOT_OPTIONS@ JEMALLOC_AUTOCONF_FLAGS = @JEMALLOC_AUTOCONF_FLAGS@ @@ -526,127 +541,127 @@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -@HOST_WIN32_FALSE@SUPPORT = libMonoSupportW.la -@HOST_WIN32_TRUE@SUPPORT = -@BUILD_SUPPORT_TRUE@lib_LTLIBRARIES = \ -@BUILD_SUPPORT_TRUE@ libMonoPosixHelper.la \ -@BUILD_SUPPORT_TRUE@ $(SUPPORT) +@ENABLE_MSVC_ONLY_FALSE@@HOST_WIN32_FALSE@SUPPORT = libMonoSupportW.la +@ENABLE_MSVC_ONLY_FALSE@@HOST_WIN32_TRUE@SUPPORT = +@BUILD_SUPPORT_TRUE@@ENABLE_MSVC_ONLY_FALSE@lib_LTLIBRARIES = \ +@BUILD_SUPPORT_TRUE@@ENABLE_MSVC_ONLY_FALSE@ libMonoPosixHelper.la \ +@BUILD_SUPPORT_TRUE@@ENABLE_MSVC_ONLY_FALSE@ $(SUPPORT) -AM_CPPFLAGS = \ - @ZLIB_CFLAGS@ \ - $(GLIB_CFLAGS) \ - -I$(top_srcdir) +@ENABLE_MSVC_ONLY_FALSE@AM_CPPFLAGS = \ +@ENABLE_MSVC_ONLY_FALSE@ @ZLIB_CFLAGS@ \ +@ENABLE_MSVC_ONLY_FALSE@ $(GLIB_CFLAGS) \ +@ENABLE_MSVC_ONLY_FALSE@ -I$(top_srcdir) -glib_libs = $(top_builddir)/mono/eglib/libeglib.la +@ENABLE_MSVC_ONLY_FALSE@glib_libs = $(top_builddir)/mono/eglib/libeglib.la # Source code which helps implement the ANSI C standards, and thus *should* be # portable to any platform having a C compiler. -MPH_C_SOURCE = \ - errno.c \ - map.c \ - map.h \ - mph.h \ - signal.c \ - stdio.c \ - string.c \ - stdlib.c +@ENABLE_MSVC_ONLY_FALSE@MPH_C_SOURCE = \ +@ENABLE_MSVC_ONLY_FALSE@ errno.c \ +@ENABLE_MSVC_ONLY_FALSE@ map.c \ +@ENABLE_MSVC_ONLY_FALSE@ map.h \ +@ENABLE_MSVC_ONLY_FALSE@ mph.h \ +@ENABLE_MSVC_ONLY_FALSE@ signal.c \ +@ENABLE_MSVC_ONLY_FALSE@ stdio.c \ +@ENABLE_MSVC_ONLY_FALSE@ string.c \ +@ENABLE_MSVC_ONLY_FALSE@ stdlib.c # Source code which helps implement POSIX and other related Unix standards, # and *may* be portable between Unix platforms. -MPH_UNIX_SOURCE = \ - dirent.c \ - fcntl.c \ - fstab.c \ - grp.c \ - macros.c \ - nl.c \ - nl.h \ - old-map.c \ - old-map.h \ - pwd.c \ - serial.c \ - sys-mman.c \ - sys-sendfile.c \ - sys-socket.c \ - sys-stat.c \ - sys-statvfs.c \ - sys-time.c \ - sys-uio.c \ - sys-uio.h \ - sys-utsname.c \ - sys-wait.c \ - sys-xattr.c \ - syslog.c \ - time.c \ - unistd.c \ - utime.c \ - x-struct-str.c +@ENABLE_MSVC_ONLY_FALSE@MPH_UNIX_SOURCE = \ +@ENABLE_MSVC_ONLY_FALSE@ dirent.c \ +@ENABLE_MSVC_ONLY_FALSE@ fcntl.c \ +@ENABLE_MSVC_ONLY_FALSE@ fstab.c \ +@ENABLE_MSVC_ONLY_FALSE@ grp.c \ +@ENABLE_MSVC_ONLY_FALSE@ macros.c \ +@ENABLE_MSVC_ONLY_FALSE@ nl.c \ +@ENABLE_MSVC_ONLY_FALSE@ nl.h \ +@ENABLE_MSVC_ONLY_FALSE@ old-map.c \ +@ENABLE_MSVC_ONLY_FALSE@ old-map.h \ +@ENABLE_MSVC_ONLY_FALSE@ pwd.c \ +@ENABLE_MSVC_ONLY_FALSE@ serial.c \ +@ENABLE_MSVC_ONLY_FALSE@ sys-mman.c \ +@ENABLE_MSVC_ONLY_FALSE@ sys-sendfile.c \ +@ENABLE_MSVC_ONLY_FALSE@ sys-socket.c \ +@ENABLE_MSVC_ONLY_FALSE@ sys-stat.c \ +@ENABLE_MSVC_ONLY_FALSE@ sys-statvfs.c \ +@ENABLE_MSVC_ONLY_FALSE@ sys-time.c \ +@ENABLE_MSVC_ONLY_FALSE@ sys-uio.c \ +@ENABLE_MSVC_ONLY_FALSE@ sys-uio.h \ +@ENABLE_MSVC_ONLY_FALSE@ sys-utsname.c \ +@ENABLE_MSVC_ONLY_FALSE@ sys-wait.c \ +@ENABLE_MSVC_ONLY_FALSE@ sys-xattr.c \ +@ENABLE_MSVC_ONLY_FALSE@ syslog.c \ +@ENABLE_MSVC_ONLY_FALSE@ time.c \ +@ENABLE_MSVC_ONLY_FALSE@ unistd.c \ +@ENABLE_MSVC_ONLY_FALSE@ utime.c \ +@ENABLE_MSVC_ONLY_FALSE@ x-struct-str.c -@HOST_WIN32_FALSE@MPH_SOURCE = $(MPH_C_SOURCE) $(MPH_UNIX_SOURCE) -@HOST_WIN32_TRUE@MPH_SOURCE = $(MPH_C_SOURCE) -@HOST_WIN32_FALSE@MPH_LIBS = $(glib_libs) -@HOST_WIN32_TRUE@MPH_LIBS = $(glib_libs) -MINIZIP_SOURCE = \ - minizip/crypt.h \ - minizip/ioapi.c \ - minizip/ioapi.h \ - minizip/unzip.c \ - minizip/unzip.h \ - minizip/zip.c \ - minizip/zip.h +@ENABLE_MSVC_ONLY_FALSE@@HOST_WIN32_FALSE@MPH_SOURCE = $(MPH_C_SOURCE) $(MPH_UNIX_SOURCE) +@ENABLE_MSVC_ONLY_FALSE@@HOST_WIN32_TRUE@MPH_SOURCE = $(MPH_C_SOURCE) +@ENABLE_MSVC_ONLY_FALSE@@HOST_WIN32_FALSE@MPH_LIBS = $(glib_libs) +@ENABLE_MSVC_ONLY_FALSE@@HOST_WIN32_TRUE@MPH_LIBS = $(glib_libs) +@ENABLE_MSVC_ONLY_FALSE@MINIZIP_SOURCE = \ +@ENABLE_MSVC_ONLY_FALSE@ minizip/crypt.h \ +@ENABLE_MSVC_ONLY_FALSE@ minizip/ioapi.c \ +@ENABLE_MSVC_ONLY_FALSE@ minizip/ioapi.h \ +@ENABLE_MSVC_ONLY_FALSE@ minizip/unzip.c \ +@ENABLE_MSVC_ONLY_FALSE@ minizip/unzip.h \ +@ENABLE_MSVC_ONLY_FALSE@ minizip/zip.c \ +@ENABLE_MSVC_ONLY_FALSE@ minizip/zip.h -ZLIB_SOURCES = \ - adler32.c \ - compress.c \ - crc32.c \ - uncompr.c \ - deflate.c \ - gzguts.h \ - trees.c \ - zutil.c \ - inflate.c \ - infback.c \ - inftrees.c \ - inffast.c \ - crc32.h \ - deflate.h \ - inffast.h \ - inffixed.h \ - inflate.h \ - inftrees.h \ - trees.h \ - zconf.h \ - zlib.h \ - zutil.h +@ENABLE_MSVC_ONLY_FALSE@ZLIB_SOURCES = \ +@ENABLE_MSVC_ONLY_FALSE@ adler32.c \ +@ENABLE_MSVC_ONLY_FALSE@ compress.c \ +@ENABLE_MSVC_ONLY_FALSE@ crc32.c \ +@ENABLE_MSVC_ONLY_FALSE@ uncompr.c \ +@ENABLE_MSVC_ONLY_FALSE@ deflate.c \ +@ENABLE_MSVC_ONLY_FALSE@ gzguts.h \ +@ENABLE_MSVC_ONLY_FALSE@ trees.c \ +@ENABLE_MSVC_ONLY_FALSE@ zutil.c \ +@ENABLE_MSVC_ONLY_FALSE@ inflate.c \ +@ENABLE_MSVC_ONLY_FALSE@ infback.c \ +@ENABLE_MSVC_ONLY_FALSE@ inftrees.c \ +@ENABLE_MSVC_ONLY_FALSE@ inffast.c \ +@ENABLE_MSVC_ONLY_FALSE@ crc32.h \ +@ENABLE_MSVC_ONLY_FALSE@ deflate.h \ +@ENABLE_MSVC_ONLY_FALSE@ inffast.h \ +@ENABLE_MSVC_ONLY_FALSE@ inffixed.h \ +@ENABLE_MSVC_ONLY_FALSE@ inflate.h \ +@ENABLE_MSVC_ONLY_FALSE@ inftrees.h \ +@ENABLE_MSVC_ONLY_FALSE@ trees.h \ +@ENABLE_MSVC_ONLY_FALSE@ zconf.h \ +@ENABLE_MSVC_ONLY_FALSE@ zlib.h \ +@ENABLE_MSVC_ONLY_FALSE@ zutil.h -@HAVE_STATIC_ZLIB_FALSE@@HAVE_SYS_ZLIB_FALSE@Z_SOURCE = zlib-helper.c $(ZLIB_SOURCES) -@HAVE_STATIC_ZLIB_FALSE@@HAVE_SYS_ZLIB_TRUE@Z_SOURCE = zlib-helper.c -@HAVE_STATIC_ZLIB_TRUE@Z_SOURCE = zlib-helper.c -@HAVE_STATIC_ZLIB_FALSE@@HAVE_SYS_ZLIB_FALSE@Z_LIBS = -@HAVE_STATIC_ZLIB_FALSE@@HAVE_SYS_ZLIB_TRUE@Z_LIBS = -lz -@HAVE_STATIC_ZLIB_TRUE@Z_LIBS = $(STATIC_ZLIB_PATH) -libMonoPosixHelper_la_SOURCES = \ - $(MPH_SOURCE) \ - $(Z_SOURCE) \ - $(MINIZIP_SOURCE) +@ENABLE_MSVC_ONLY_FALSE@@HAVE_STATIC_ZLIB_FALSE@@HAVE_SYS_ZLIB_FALSE@Z_SOURCE = zlib-helper.c $(ZLIB_SOURCES) +@ENABLE_MSVC_ONLY_FALSE@@HAVE_STATIC_ZLIB_FALSE@@HAVE_SYS_ZLIB_TRUE@Z_SOURCE = zlib-helper.c +@ENABLE_MSVC_ONLY_FALSE@@HAVE_STATIC_ZLIB_TRUE@Z_SOURCE = zlib-helper.c +@ENABLE_MSVC_ONLY_FALSE@@HAVE_STATIC_ZLIB_FALSE@@HAVE_SYS_ZLIB_FALSE@Z_LIBS = +@ENABLE_MSVC_ONLY_FALSE@@HAVE_STATIC_ZLIB_FALSE@@HAVE_SYS_ZLIB_TRUE@Z_LIBS = -lz +@ENABLE_MSVC_ONLY_FALSE@@HAVE_STATIC_ZLIB_TRUE@Z_LIBS = $(STATIC_ZLIB_PATH) +@ENABLE_MSVC_ONLY_FALSE@libMonoPosixHelper_la_SOURCES = \ +@ENABLE_MSVC_ONLY_FALSE@ $(MPH_SOURCE) \ +@ENABLE_MSVC_ONLY_FALSE@ $(Z_SOURCE) \ +@ENABLE_MSVC_ONLY_FALSE@ $(MINIZIP_SOURCE) -libMonoPosixHelper_la_LIBADD = \ - $(MPH_LIBS) \ - $(Z_LIBS) \ - $(XATTR_LIB) +@ENABLE_MSVC_ONLY_FALSE@libMonoPosixHelper_la_LIBADD = \ +@ENABLE_MSVC_ONLY_FALSE@ $(MPH_LIBS) \ +@ENABLE_MSVC_ONLY_FALSE@ $(Z_LIBS) \ +@ENABLE_MSVC_ONLY_FALSE@ $(XATTR_LIB) # libMonoPosixHelper_la_LDFLAGS = -no-undefined -version-info 1:0:1 -libMonoPosixHelper_la_LDFLAGS = -no-undefined -avoid-version -libMonoSupportW_la_LDFLAGS = -no-undefined -avoid-version -libMonoSupportW_la_SOURCES = \ - supportw.c \ - support-heap.c \ - supportw.h +@ENABLE_MSVC_ONLY_FALSE@libMonoPosixHelper_la_LDFLAGS = -no-undefined -avoid-version +@ENABLE_MSVC_ONLY_FALSE@libMonoSupportW_la_LDFLAGS = -no-undefined -avoid-version +@ENABLE_MSVC_ONLY_FALSE@libMonoSupportW_la_SOURCES = \ +@ENABLE_MSVC_ONLY_FALSE@ supportw.c \ +@ENABLE_MSVC_ONLY_FALSE@ support-heap.c \ +@ENABLE_MSVC_ONLY_FALSE@ supportw.h -libMonoSupportW_la_LIBADD = \ - $(glib_libs) +@ENABLE_MSVC_ONLY_FALSE@libMonoSupportW_la_LIBADD = \ +@ENABLE_MSVC_ONLY_FALSE@ $(glib_libs) all: all-am @@ -716,18 +731,6 @@ clean-libLTLIBRARIES: echo rm -f $${locs}; \ rm -f $${locs}; \ } -minizip/$(am__dirstamp): - @$(MKDIR_P) minizip - @: > minizip/$(am__dirstamp) -minizip/$(DEPDIR)/$(am__dirstamp): - @$(MKDIR_P) minizip/$(DEPDIR) - @: > minizip/$(DEPDIR)/$(am__dirstamp) -minizip/ioapi.lo: minizip/$(am__dirstamp) \ - minizip/$(DEPDIR)/$(am__dirstamp) -minizip/unzip.lo: minizip/$(am__dirstamp) \ - minizip/$(DEPDIR)/$(am__dirstamp) -minizip/zip.lo: minizip/$(am__dirstamp) \ - minizip/$(DEPDIR)/$(am__dirstamp) libMonoPosixHelper.la: $(libMonoPosixHelper_la_OBJECTS) $(libMonoPosixHelper_la_DEPENDENCIES) $(EXTRA_libMonoPosixHelper_la_DEPENDENCIES) $(AM_V_CCLD)$(libMonoPosixHelper_la_LINK) $(am_libMonoPosixHelper_la_rpath) $(libMonoPosixHelper_la_OBJECTS) $(libMonoPosixHelper_la_LIBADD) $(LIBS) @@ -737,8 +740,6 @@ libMonoSupportW.la: $(libMonoSupportW_la_OBJECTS) $(libMonoSupportW_la_DEPENDENC mostlyclean-compile: -rm -f *.$(OBJEXT) - -rm -f minizip/*.$(OBJEXT) - -rm -f minizip/*.lo distclean-compile: -rm -f *.tab.c @@ -756,6 +757,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/inffast.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/inflate.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/inftrees.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioapi.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/macros.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/map.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nl.Plo@am__quote@ @@ -783,44 +785,60 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/trees.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uncompr.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unistd.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unzip.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utime.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/x-struct-str.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/zip.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/zlib-helper.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/zutil.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@minizip/$(DEPDIR)/ioapi.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@minizip/$(DEPDIR)/unzip.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@minizip/$(DEPDIR)/zip.Plo@am__quote@ .c.o: -@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ -@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: -@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ -@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: -@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ -@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ -@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< +ioapi.lo: minizip/ioapi.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ioapi.lo -MD -MP -MF $(DEPDIR)/ioapi.Tpo -c -o ioapi.lo `test -f 'minizip/ioapi.c' || echo '$(srcdir)/'`minizip/ioapi.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ioapi.Tpo $(DEPDIR)/ioapi.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='minizip/ioapi.c' object='ioapi.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ioapi.lo `test -f 'minizip/ioapi.c' || echo '$(srcdir)/'`minizip/ioapi.c + +unzip.lo: minizip/unzip.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT unzip.lo -MD -MP -MF $(DEPDIR)/unzip.Tpo -c -o unzip.lo `test -f 'minizip/unzip.c' || echo '$(srcdir)/'`minizip/unzip.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/unzip.Tpo $(DEPDIR)/unzip.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='minizip/unzip.c' object='unzip.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o unzip.lo `test -f 'minizip/unzip.c' || echo '$(srcdir)/'`minizip/unzip.c + +zip.lo: minizip/zip.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT zip.lo -MD -MP -MF $(DEPDIR)/zip.Tpo -c -o zip.lo `test -f 'minizip/zip.c' || echo '$(srcdir)/'`minizip/zip.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/zip.Tpo $(DEPDIR)/zip.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='minizip/zip.c' object='zip.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o zip.lo `test -f 'minizip/zip.c' || echo '$(srcdir)/'`minizip/zip.c + mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs - -rm -rf minizip/.libs minizip/_libs test-local: test-bundle-local: @@ -908,7 +926,8 @@ distdir: $(DISTFILES) done check-am: all-am check: check-am -all-am: Makefile $(LTLIBRARIES) +@ENABLE_MSVC_ONLY_FALSE@all-local: +all-am: Makefile $(LTLIBRARIES) all-local installdirs: for dir in "$(DESTDIR)$(libdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ @@ -939,19 +958,19 @@ clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -rm -f minizip/$(DEPDIR)/$(am__dirstamp) - -rm -f minizip/$(am__dirstamp) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." +@ENABLE_MSVC_ONLY_FALSE@clean-local: +@ENABLE_MSVC_ONLY_TRUE@test-bundle-local: clean: clean-am -clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ +clean-am: clean-generic clean-libLTLIBRARIES clean-libtool clean-local \ mostlyclean-am distclean: distclean-am - -rm -rf ./$(DEPDIR) minizip/$(DEPDIR) + -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags @@ -997,7 +1016,7 @@ install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) minizip/$(DEPDIR) + -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic @@ -1026,78 +1045,87 @@ uninstall-am: uninstall-libLTLIBRARIES .MAKE: install-am install-strip -.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ - clean-libLTLIBRARIES clean-libtool cscopelist-am ctags \ - ctags-am distclean distclean-compile distclean-generic \ - distclean-libtool distclean-tags distdir dvi dvi-am html \ - html-am info info-am install install-am install-data \ - install-data-am install-dvi install-dvi-am install-exec \ - install-exec-am install-html install-html-am install-info \ - install-info-am install-libLTLIBRARIES install-man install-pdf \ - install-pdf-am install-ps install-ps-am install-strip \ - installcheck installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-compile \ - mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags tags-am test-am test-bundle-am test-bundle-local \ - test-local uninstall uninstall-am uninstall-libLTLIBRARIES +.PHONY: CTAGS GTAGS TAGS all all-am all-local check check-am clean \ + clean-generic clean-libLTLIBRARIES clean-libtool clean-local \ + cscopelist-am ctags ctags-am distclean distclean-compile \ + distclean-generic distclean-libtool distclean-tags distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-libLTLIBRARIES \ + install-man install-pdf install-pdf-am install-ps \ + install-ps-am install-strip installcheck installcheck-am \ + installdirs maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am test-am \ + test-bundle-am test-bundle-local test-local uninstall \ + uninstall-am uninstall-libLTLIBRARIES .PRECIOUS: Makefile -test-bundle-local: - mkdir -p $(TEST_BUNDLE_PATH) - cp -L .libs/libMonoPosixHelper$(libsuffix) $(TEST_BUNDLE_PATH)/ +@ENABLE_MSVC_ONLY_FALSE@test-bundle-local: +@ENABLE_MSVC_ONLY_FALSE@ mkdir -p $(TEST_BUNDLE_PATH) +@ENABLE_MSVC_ONLY_FALSE@ cp -L .libs/libMonoPosixHelper$(libsuffix) $(TEST_BUNDLE_PATH)/ # # Use this target to refresh the values in map.[ch] # -refresh: - cp `pkg-config --variable=Programs create-native-map` . && \ - $(top_builddir)/runtime/mono-wrapper create-native-map.exe \ - --autoconf-member=d_off \ - --autoconf-member=d_reclen \ - --autoconf-member=d_type \ - --exclude-native-symbol=Mono_Posix_Stdlib_snprintf \ - --impl-macro=_GNU_SOURCE --impl-macro=_XOPEN_SOURCE \ - --impl-header="" \ - --impl-header="" \ - --autoconf-header="" \ - --autoconf-header="" \ - --autoconf-header="" \ - --autoconf-header="" \ - --autoconf-header="" \ - --autoconf-header="" \ - --autoconf-header="" \ - --autoconf-header="" \ - --autoconf-header="" \ - --autoconf-header="" \ - --impl-header="" \ - --impl-header="" \ - --autoconf-header="" \ - --autoconf-header="" \ - --impl-header="" \ - --autoconf-header="" \ - --autoconf-header="" \ - --autoconf-header="" \ - --impl-header="" \ - --impl-header="\"mph.h\"" \ - --rename-member=st_atime=st_atime_ \ - --rename-member=st_ctime=st_ctime_ \ - --rename-member=st_mtime=st_mtime_ \ - --rename-namespace=Mono.Unix.Native=Mono.Posix \ - --library=MonoPosixHelper \ - $(mcs_topdir_from_srcdir)/class/lib/net_4_x/Mono.Posix.dll map +@ENABLE_MSVC_ONLY_FALSE@refresh: +@ENABLE_MSVC_ONLY_FALSE@ cp `pkg-config --variable=Programs create-native-map` . && \ +@ENABLE_MSVC_ONLY_FALSE@ $(top_builddir)/runtime/mono-wrapper create-native-map.exe \ +@ENABLE_MSVC_ONLY_FALSE@ --autoconf-member=d_off \ +@ENABLE_MSVC_ONLY_FALSE@ --autoconf-member=d_reclen \ +@ENABLE_MSVC_ONLY_FALSE@ --autoconf-member=d_type \ +@ENABLE_MSVC_ONLY_FALSE@ --exclude-native-symbol=Mono_Posix_Stdlib_snprintf \ +@ENABLE_MSVC_ONLY_FALSE@ --impl-macro=_GNU_SOURCE --impl-macro=_XOPEN_SOURCE \ +@ENABLE_MSVC_ONLY_FALSE@ --impl-header="" \ +@ENABLE_MSVC_ONLY_FALSE@ --impl-header="" \ +@ENABLE_MSVC_ONLY_FALSE@ --autoconf-header="" \ +@ENABLE_MSVC_ONLY_FALSE@ --autoconf-header="" \ +@ENABLE_MSVC_ONLY_FALSE@ --autoconf-header="" \ +@ENABLE_MSVC_ONLY_FALSE@ --autoconf-header="" \ +@ENABLE_MSVC_ONLY_FALSE@ --autoconf-header="" \ +@ENABLE_MSVC_ONLY_FALSE@ --autoconf-header="" \ +@ENABLE_MSVC_ONLY_FALSE@ --autoconf-header="" \ +@ENABLE_MSVC_ONLY_FALSE@ --autoconf-header="" \ +@ENABLE_MSVC_ONLY_FALSE@ --autoconf-header="" \ +@ENABLE_MSVC_ONLY_FALSE@ --autoconf-header="" \ +@ENABLE_MSVC_ONLY_FALSE@ --impl-header="" \ +@ENABLE_MSVC_ONLY_FALSE@ --impl-header="" \ +@ENABLE_MSVC_ONLY_FALSE@ --autoconf-header="" \ +@ENABLE_MSVC_ONLY_FALSE@ --autoconf-header="" \ +@ENABLE_MSVC_ONLY_FALSE@ --impl-header="" \ +@ENABLE_MSVC_ONLY_FALSE@ --autoconf-header="" \ +@ENABLE_MSVC_ONLY_FALSE@ --autoconf-header="" \ +@ENABLE_MSVC_ONLY_FALSE@ --autoconf-header="" \ +@ENABLE_MSVC_ONLY_FALSE@ --impl-header="" \ +@ENABLE_MSVC_ONLY_FALSE@ --impl-header="\"mph.h\"" \ +@ENABLE_MSVC_ONLY_FALSE@ --rename-member=st_atime=st_atime_ \ +@ENABLE_MSVC_ONLY_FALSE@ --rename-member=st_ctime=st_ctime_ \ +@ENABLE_MSVC_ONLY_FALSE@ --rename-member=st_mtime=st_mtime_ \ +@ENABLE_MSVC_ONLY_FALSE@ --rename-namespace=Mono.Unix.Native=Mono.Posix \ +@ENABLE_MSVC_ONLY_FALSE@ --library=MonoPosixHelper \ +@ENABLE_MSVC_ONLY_FALSE@ $(mcs_topdir_from_srcdir)/class/lib/net_4_x/Mono.Posix.dll map # Useful if mono is compiled with --enable-shared=no -patch-libtool: - cp "../libtool" . - sed -e 's,build_libtool_libs=no,build_libtool_libs=yes,g' libtool > 2; mv 2 libtool - echo "LIBTOOL = bash ./libtool" > 1 - echo "LTCOMPILE = bash ./libtool --mode=compile $(COMPILE)" >> 1 - sed -e 's,LIBTOOL =,LIBTOOL2 =,g' Makefile > 2 - sed -e 's,LTCOMPILE =,LTCOMPILE2 =,g' 2 > 3 - cat 1 3 > Makefile - touch *.c +@ENABLE_MSVC_ONLY_FALSE@patch-libtool: +@ENABLE_MSVC_ONLY_FALSE@ cp "../libtool" . +@ENABLE_MSVC_ONLY_FALSE@ sed -e 's,build_libtool_libs=no,build_libtool_libs=yes,g' libtool > 2; mv 2 libtool +@ENABLE_MSVC_ONLY_FALSE@ echo "LIBTOOL = bash ./libtool" > 1 +@ENABLE_MSVC_ONLY_FALSE@ echo "LTCOMPILE = bash ./libtool --mode=compile $(COMPILE)" >> 1 +@ENABLE_MSVC_ONLY_FALSE@ sed -e 's,LIBTOOL =,LIBTOOL2 =,g' Makefile > 2 +@ENABLE_MSVC_ONLY_FALSE@ sed -e 's,LTCOMPILE =,LTCOMPILE2 =,g' 2 > 3 +@ENABLE_MSVC_ONLY_FALSE@ cat 1 3 > Makefile +@ENABLE_MSVC_ONLY_FALSE@ touch *.c + +@ENABLE_MSVC_ONLY_TRUE@all-local: + +@ENABLE_MSVC_ONLY_TRUE@ make -C $(top_srcdir)/msvc libmonoposixhelper + +@ENABLE_MSVC_ONLY_TRUE@clean-local: + +@ENABLE_MSVC_ONLY_TRUE@ make -C $(top_srcdir)/msvc clean-libmonoposixhelper # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff --git a/support/map.c.REMOVED.git-id b/support/map.c.REMOVED.git-id index bb142e65dd..a66d1792d8 100644 --- a/support/map.c.REMOVED.git-id +++ b/support/map.c.REMOVED.git-id @@ -1 +1 @@ -38e9d4425dae3c2c15acb2debcf4bb0aff68325d \ No newline at end of file +d073160c91661c4a314db316445dbf62812758c4 \ No newline at end of file diff --git a/support/map.h.REMOVED.git-id b/support/map.h.REMOVED.git-id index 46d559d8ec..fa4cada203 100644 --- a/support/map.h.REMOVED.git-id +++ b/support/map.h.REMOVED.git-id @@ -1 +1 @@ -ccaf488efcd170fab0a8b00b5a9d08cfad677def \ No newline at end of file +0b4d5ea7d2c026efc75affdf11976ce05a20c7a6 \ No newline at end of file diff --git a/support/minizip/ioapi.c b/support/minizip/ioapi.c index 7f5c191b2a..649255c52e 100644 --- a/support/minizip/ioapi.c +++ b/support/minizip/ioapi.c @@ -14,7 +14,7 @@ #define _CRT_SECURE_NO_WARNINGS #endif -#if defined(__APPLE__) || defined(IOAPI_NO_64) +#if defined(__APPLE__) || defined(IOAPI_NO_64) || defined(__HAIKU__) // In darwin and perhaps other BSD variants off_t is a 64 bit value, hence no need for specific 64 bit functions #define FOPEN_FUNC(filename, mode) fopen(filename, mode) #define FTELLO_FUNC(stream) ftello(stream) diff --git a/support/signal.c b/support/signal.c index 503c9c270a..eb94a99241 100644 --- a/support/signal.c +++ b/support/signal.c @@ -177,7 +177,7 @@ static void release_mutex (pthread_mutex_t *mutex) } } -static inline int +static int keep_trying (int r) { return r == -1 && errno == EINTR; @@ -199,7 +199,7 @@ keep_trying (int r) #define PIPELOCK_GET_COUNT(x) ((x) & PIPELOCK_COUNT_MASK) #define PIPELOCK_INCR_COUNT(x, by) (((x) & PIPELOCK_TEARDOWN_BIT) | (PIPELOCK_GET_COUNT (PIPELOCK_GET_COUNT (x) + (by)))) -static inline void +static void acquire_pipelock_teardown (int *lock) { int lockvalue_draining; @@ -220,7 +220,7 @@ acquire_pipelock_teardown (int *lock) } } -static inline void +static void release_pipelock_teardown (int *lock) { while (1) { @@ -233,7 +233,7 @@ release_pipelock_teardown (int *lock) } // Return 1 for success -static inline int +static int acquire_pipelock_handler (int *lock) { while (1) { @@ -246,7 +246,7 @@ acquire_pipelock_handler (int *lock) } } -static inline void +static void release_pipelock_handler (int *lock) { while (1) { diff --git a/support/sys-socket.c b/support/sys-socket.c index 9d43087ecd..a1ab78794f 100644 --- a/support/sys-socket.c +++ b/support/sys-socket.c @@ -582,19 +582,19 @@ Mono_Posix_Syscall_sendmsg (int socket, struct Mono_Posix_Syscall__Msghdr* messa return r; } -static inline void make_msghdr (struct msghdr* hdr, unsigned char* msg_control, gint64 msg_controllen) +static void make_msghdr (struct msghdr* hdr, unsigned char* msg_control, gint64 msg_controllen) { memset (hdr, 0, sizeof (struct msghdr)); hdr->msg_control = msg_control; hdr->msg_controllen = msg_controllen; } -static inline struct cmsghdr* from_offset (unsigned char* msg_control, gint64 offset) +static struct cmsghdr* from_offset (unsigned char* msg_control, gint64 offset) { if (offset == -1) return NULL; return (struct cmsghdr*) (msg_control + offset); } -static inline gint64 to_offset (unsigned char* msg_control, void* hdr) +static gint64 to_offset (unsigned char* msg_control, void* hdr) { if (!hdr) return -1; diff --git a/support/sys-stat.c b/support/sys-stat.c index af2731cccb..4a978fd46c 100644 --- a/support/sys-stat.c +++ b/support/sys-stat.c @@ -227,7 +227,7 @@ Mono_Posix_Syscall_get_utime_omit () } #if defined(HAVE_FUTIMENS) || defined(HAVE_UTIMENSAT) -static inline struct timespec* +static struct timespec* copy_utimens (struct timespec* to, struct Mono_Posix_Timespec *from) { if (from) { diff --git a/support/sys-time.c b/support/sys-time.c index 4f5db9c8b2..e2d371ee4b 100644 --- a/support/sys-time.c +++ b/support/sys-time.c @@ -77,7 +77,7 @@ Mono_Posix_Syscall_settimeofday ( return r; } -static inline struct timeval* +static struct timeval* copy_utimes (struct timeval* to, struct Mono_Posix_Timeval *from) { if (from) { diff --git a/tools/Makefile.in b/tools/Makefile.in index 506277c640..5cf876b0af 100644 --- a/tools/Makefile.in +++ b/tools/Makefile.in @@ -274,6 +274,7 @@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTERP_CFLAGS = @INTERP_CFLAGS@ INTL = @INTL@ INVARIANT_AOT_OPTIONS = @INVARIANT_AOT_OPTIONS@ JEMALLOC_AUTOCONF_FLAGS = @JEMALLOC_AUTOCONF_FLAGS@ diff --git a/tools/locale-builder/Makefile.in b/tools/locale-builder/Makefile.in index de649c6094..b775685ea6 100644 --- a/tools/locale-builder/Makefile.in +++ b/tools/locale-builder/Makefile.in @@ -215,6 +215,7 @@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTERP_CFLAGS = @INTERP_CFLAGS@ INTL = @INTL@ INVARIANT_AOT_OPTIONS = @INVARIANT_AOT_OPTIONS@ JEMALLOC_AUTOCONF_FLAGS = @JEMALLOC_AUTOCONF_FLAGS@ diff --git a/tools/mono-hang-watchdog/Makefile.am b/tools/mono-hang-watchdog/Makefile.am index 596c7cd63e..63a96c5f42 100644 --- a/tools/mono-hang-watchdog/Makefile.am +++ b/tools/mono-hang-watchdog/Makefile.am @@ -1,3 +1,4 @@ +if !ENABLE_MSVC_ONLY AM_CPPFLAGS = $(SHARED_CFLAGS) @@ -7,6 +8,12 @@ else bin_PROGRAMS = mono-hang-watchdog endif +endif # !ENABLE_MSVC_ONLY + CFLAGS = $(filter-out @CXX_REMOVE_CFLAGS@, @CFLAGS@) +if !ENABLE_MSVC_ONLY + mono_hang_watchdog_SOURCES = mono-hang-watchdog.c + +endif # !ENABLE_MSVC_ONLY diff --git a/tools/mono-hang-watchdog/Makefile.in b/tools/mono-hang-watchdog/Makefile.in index 7b184a6e06..111e551824 100644 --- a/tools/mono-hang-watchdog/Makefile.in +++ b/tools/mono-hang-watchdog/Makefile.in @@ -89,7 +89,7 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ -@DISABLE_EXECUTABLES_FALSE@bin_PROGRAMS = mono-hang-watchdog$(EXEEXT) +@DISABLE_EXECUTABLES_FALSE@@ENABLE_MSVC_ONLY_FALSE@bin_PROGRAMS = mono-hang-watchdog$(EXEEXT) subdir = tools/mono-hang-watchdog ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/apple-target.m4 \ @@ -112,7 +112,9 @@ CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" PROGRAMS = $(bin_PROGRAMS) -am_mono_hang_watchdog_OBJECTS = mono-hang-watchdog.$(OBJEXT) +am__mono_hang_watchdog_SOURCES_DIST = mono-hang-watchdog.c +@ENABLE_MSVC_ONLY_FALSE@am_mono_hang_watchdog_OBJECTS = \ +@ENABLE_MSVC_ONLY_FALSE@ mono-hang-watchdog.$(OBJEXT) mono_hang_watchdog_OBJECTS = $(am_mono_hang_watchdog_OBJECTS) mono_hang_watchdog_LDADD = $(LDADD) AM_V_lt = $(am__v_lt_@AM_V@) @@ -150,7 +152,7 @@ am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(mono_hang_watchdog_SOURCES) -DIST_SOURCES = $(mono_hang_watchdog_SOURCES) +DIST_SOURCES = $(am__mono_hang_watchdog_SOURCES_DIST) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ @@ -262,6 +264,7 @@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTERP_CFLAGS = @INTERP_CFLAGS@ INTL = @INTL@ INVARIANT_AOT_OPTIONS = @INVARIANT_AOT_OPTIONS@ JEMALLOC_AUTOCONF_FLAGS = @JEMALLOC_AUTOCONF_FLAGS@ @@ -450,8 +453,8 @@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -AM_CPPFLAGS = $(SHARED_CFLAGS) -mono_hang_watchdog_SOURCES = mono-hang-watchdog.c +@ENABLE_MSVC_ONLY_FALSE@AM_CPPFLAGS = $(SHARED_CFLAGS) +@ENABLE_MSVC_ONLY_FALSE@mono_hang_watchdog_SOURCES = mono-hang-watchdog.c all: all-am .SUFFIXES: @@ -548,25 +551,22 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mono-hang-watchdog.Po@am__quote@ .c.o: -@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ -@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: -@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ -@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: -@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ -@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ -@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< diff --git a/tools/pedump/Makefile.am b/tools/pedump/Makefile.am index f45fce5b1e..d05b053f84 100644 --- a/tools/pedump/Makefile.am +++ b/tools/pedump/Makefile.am @@ -1,3 +1,4 @@ +if !ENABLE_MSVC_ONLY AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/mono $(LIBGC_CPPFLAGS) $(GLIB_CFLAGS) $(SHARED_CFLAGS) @@ -16,7 +17,12 @@ endif endif endif +endif # !ENABLE_MSVC_ONLY + CFLAGS = $(filter-out @CXX_REMOVE_CFLAGS@, @CFLAGS@) + +if !ENABLE_MSVC_ONLY + libpedump_a_CFLAGS = @CXX_ADD_CFLAGS@ pedump_SOURCES = @@ -34,6 +40,28 @@ if HOST_DARWIN pedump_LDFLAGS=-framework CoreFoundation -framework Foundation endif +endif # !ENABLE_MSVC_ONLY + +if ENABLE_MSVC_ONLY + +if SUPPORT_SGEN +mono_bin_suffix = sgen +else +mono_bin_suffix = +endif + +all-local: + + make -C $(top_srcdir)/msvc pedump + cp -f $(mono_msvc_build_bin_dir)/pedump-$(mono_bin_suffix)$(EXEEXT) ./pedump$(EXEEXT) + +clean-local: + + make -C $(top_srcdir)/msvc clean-pedump + rm ./pedump$(EXEEXT) + +endif # ENABLE_MSVC_ONLY + #Helper target to rebuild metadata as well, it's useful when working on the verifier as its source still on metadata md: make -C ../../mono/metadata all diff --git a/tools/pedump/Makefile.in b/tools/pedump/Makefile.in index 27d41c508d..ac6b431f52 100644 --- a/tools/pedump/Makefile.in +++ b/tools/pedump/Makefile.in @@ -90,7 +90,7 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ -@DISABLE_EXECUTABLES_FALSE@@DISABLE_LIBRARIES_FALSE@@SUPPORT_SGEN_TRUE@bin_PROGRAMS = pedump$(EXEEXT) +@DISABLE_EXECUTABLES_FALSE@@DISABLE_LIBRARIES_FALSE@@ENABLE_MSVC_ONLY_FALSE@@SUPPORT_SGEN_TRUE@bin_PROGRAMS = pedump$(EXEEXT) subdir = tools/pedump ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/apple-target.m4 \ @@ -119,16 +119,20 @@ am__v_AR_0 = @echo " AR " $@; am__v_AR_1 = libpedump_a_AR = $(AR) $(ARFLAGS) libpedump_a_LIBADD = -am_libpedump_a_OBJECTS = libpedump_a-pedump.$(OBJEXT) +am__libpedump_a_SOURCES_DIST = pedump.c +@ENABLE_MSVC_ONLY_FALSE@am_libpedump_a_OBJECTS = \ +@ENABLE_MSVC_ONLY_FALSE@ libpedump_a-pedump.$(OBJEXT) libpedump_a_OBJECTS = $(am_libpedump_a_OBJECTS) am__installdirs = "$(DESTDIR)$(bindir)" PROGRAMS = $(bin_PROGRAMS) am_pedump_OBJECTS = pedump_OBJECTS = $(am_pedump_OBJECTS) -pedump_DEPENDENCIES = libpedump_a-pedump.$(OBJEXT) \ - $(top_builddir)/mono/metadata/libmonoruntimesgen.la \ - $(top_builddir)/mono/sgen/libmonosgen.la \ - $(top_builddir)/mono/utils/libmonoutils.la $(glib_libs) +@ENABLE_MSVC_ONLY_FALSE@pedump_DEPENDENCIES = \ +@ENABLE_MSVC_ONLY_FALSE@ libpedump_a-pedump.$(OBJEXT) \ +@ENABLE_MSVC_ONLY_FALSE@ $(top_builddir)/mono/metadata/libmonoruntimesgen.la \ +@ENABLE_MSVC_ONLY_FALSE@ $(top_builddir)/mono/sgen/libmonosgen.la \ +@ENABLE_MSVC_ONLY_FALSE@ $(top_builddir)/mono/utils/libmonoutils.la \ +@ENABLE_MSVC_ONLY_FALSE@ $(glib_libs) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent @@ -167,7 +171,7 @@ am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libpedump_a_SOURCES) $(pedump_SOURCES) -DIST_SOURCES = $(libpedump_a_SOURCES) $(pedump_SOURCES) +DIST_SOURCES = $(am__libpedump_a_SOURCES_DIST) $(pedump_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ @@ -279,6 +283,7 @@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTERP_CFLAGS = @INTERP_CFLAGS@ INTL = @INTL@ INVARIANT_AOT_OPTIONS = @INVARIANT_AOT_OPTIONS@ JEMALLOC_AUTOCONF_FLAGS = @JEMALLOC_AUTOCONF_FLAGS@ @@ -467,22 +472,24 @@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/mono $(LIBGC_CPPFLAGS) $(GLIB_CFLAGS) $(SHARED_CFLAGS) -glib_libs = $(top_builddir)/mono/eglib/libeglib.la -@DISABLE_EXECUTABLES_FALSE@@DISABLE_LIBRARIES_FALSE@@SUPPORT_SGEN_TRUE@noinst_LIBRARIES = libpedump.a -libpedump_a_CFLAGS = @CXX_ADD_CFLAGS@ -pedump_SOURCES = -libpedump_a_SOURCES = pedump.c -pedump_LDADD = \ - libpedump_a-pedump.$(OBJEXT) \ - $(top_builddir)/mono/metadata/libmonoruntimesgen.la \ - $(top_builddir)/mono/sgen/libmonosgen.la \ - $(top_builddir)/mono/utils/libmonoutils.la \ - $(LLVM_LIBS) \ - $(LLVM_LDFLAGS) \ - $(glib_libs) +@ENABLE_MSVC_ONLY_FALSE@AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/mono $(LIBGC_CPPFLAGS) $(GLIB_CFLAGS) $(SHARED_CFLAGS) +@ENABLE_MSVC_ONLY_FALSE@glib_libs = $(top_builddir)/mono/eglib/libeglib.la +@DISABLE_EXECUTABLES_FALSE@@DISABLE_LIBRARIES_FALSE@@ENABLE_MSVC_ONLY_FALSE@@SUPPORT_SGEN_TRUE@noinst_LIBRARIES = libpedump.a +@ENABLE_MSVC_ONLY_FALSE@libpedump_a_CFLAGS = @CXX_ADD_CFLAGS@ +@ENABLE_MSVC_ONLY_FALSE@pedump_SOURCES = +@ENABLE_MSVC_ONLY_FALSE@libpedump_a_SOURCES = pedump.c +@ENABLE_MSVC_ONLY_FALSE@pedump_LDADD = \ +@ENABLE_MSVC_ONLY_FALSE@ libpedump_a-pedump.$(OBJEXT) \ +@ENABLE_MSVC_ONLY_FALSE@ $(top_builddir)/mono/metadata/libmonoruntimesgen.la \ +@ENABLE_MSVC_ONLY_FALSE@ $(top_builddir)/mono/sgen/libmonosgen.la \ +@ENABLE_MSVC_ONLY_FALSE@ $(top_builddir)/mono/utils/libmonoutils.la \ +@ENABLE_MSVC_ONLY_FALSE@ $(LLVM_LIBS) \ +@ENABLE_MSVC_ONLY_FALSE@ $(LLVM_LDFLAGS) \ +@ENABLE_MSVC_ONLY_FALSE@ $(glib_libs) -@HOST_DARWIN_TRUE@pedump_LDFLAGS = -framework CoreFoundation -framework Foundation +@ENABLE_MSVC_ONLY_FALSE@@HOST_DARWIN_TRUE@pedump_LDFLAGS = -framework CoreFoundation -framework Foundation +@ENABLE_MSVC_ONLY_TRUE@@SUPPORT_SGEN_FALSE@mono_bin_suffix = +@ENABLE_MSVC_ONLY_TRUE@@SUPPORT_SGEN_TRUE@mono_bin_suffix = sgen all: all-am .SUFFIXES: @@ -587,25 +594,22 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpedump_a-pedump.Po@am__quote@ .c.o: -@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ -@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: -@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ -@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: -@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ -@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ -@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< @@ -716,7 +720,8 @@ distdir: $(DISTFILES) done check-am: all-am check: check-am -all-am: Makefile $(LIBRARIES) $(PROGRAMS) +@ENABLE_MSVC_ONLY_FALSE@all-local: +all-am: Makefile $(LIBRARIES) $(PROGRAMS) all-local installdirs: for dir in "$(DESTDIR)$(bindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ @@ -751,9 +756,10 @@ distclean-generic: maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." +@ENABLE_MSVC_ONLY_FALSE@clean-local: clean: clean-am -clean-am: clean-binPROGRAMS clean-generic clean-libtool \ +clean-am: clean-binPROGRAMS clean-generic clean-libtool clean-local \ clean-noinstLIBRARIES mostlyclean-am distclean: distclean-am @@ -832,8 +838,8 @@ uninstall-am: uninstall-binPROGRAMS .MAKE: install-am install-strip -.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \ - clean-binPROGRAMS clean-generic clean-libtool \ +.PHONY: CTAGS GTAGS TAGS all all-am all-local check check-am clean \ + clean-binPROGRAMS clean-generic clean-libtool clean-local \ clean-noinstLIBRARIES cscopelist-am ctags ctags-am distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ @@ -851,6 +857,16 @@ uninstall-am: uninstall-binPROGRAMS .PRECIOUS: Makefile +@ENABLE_MSVC_ONLY_TRUE@all-local: + +@ENABLE_MSVC_ONLY_TRUE@ make -C $(top_srcdir)/msvc pedump +@ENABLE_MSVC_ONLY_TRUE@ cp -f $(mono_msvc_build_bin_dir)/pedump-$(mono_bin_suffix)$(EXEEXT) ./pedump$(EXEEXT) + +@ENABLE_MSVC_ONLY_TRUE@clean-local: + +@ENABLE_MSVC_ONLY_TRUE@ make -C $(top_srcdir)/msvc clean-pedump +@ENABLE_MSVC_ONLY_TRUE@ rm ./pedump$(EXEEXT) + #Helper target to rebuild metadata as well, it's useful when working on the verifier as its source still on metadata md: make -C ../../mono/metadata all diff --git a/tools/pedump/pedump.c b/tools/pedump/pedump.c index 5540a40841..1c090caf18 100644 --- a/tools/pedump/pedump.c +++ b/tools/pedump/pedump.c @@ -46,8 +46,8 @@ gboolean verify_partial_md = FALSE; static char *assembly_directory[2]; -static MonoAssembly *pedump_preload (MonoAssemblyName *aname, gchar **assemblies_path, gpointer user_data); -static void pedump_assembly_load_hook (MonoAssembly *assembly, gpointer user_data); +static MonoAssembly *pedump_preload (MonoAssemblyLoadContext *alc, MonoAssemblyName *aname, char **assemblies_path, gboolean refonly, gpointer user_data, MonoError *error); +static void pedump_assembly_load_hook (MonoAssemblyLoadContext *alc, MonoAssembly *assembly, gpointer user_data, MonoError *error); static MonoAssembly *pedump_assembly_search_hook (MonoAssemblyLoadContext *alc, MonoAssembly *requesting, MonoAssemblyName *aname, gboolean refonly, gboolean postload, gpointer user_data, MonoError *error); /* unused @@ -467,23 +467,23 @@ verify_image_file (const char *fname) mono_assembly_fill_assembly_name (image, &assembly->aname); /*Finish initializing the runtime*/ - mono_install_assembly_load_hook (pedump_assembly_load_hook, NULL); + mono_install_assembly_load_hook_v2 (pedump_assembly_load_hook, NULL); mono_install_assembly_search_hook_v2 (pedump_assembly_search_hook, NULL, FALSE, FALSE); mono_init_version ("pedump", image->version); - mono_install_assembly_preload_hook (pedump_preload, GUINT_TO_POINTER (FALSE)); + mono_install_assembly_preload_hook_v2 (pedump_preload, GUINT_TO_POINTER (FALSE), FALSE); mono_icall_init (); mono_marshal_init (); } else { /*Finish initializing the runtime*/ - mono_install_assembly_load_hook (pedump_assembly_load_hook, NULL); + mono_install_assembly_load_hook_v2 (pedump_assembly_load_hook, NULL); mono_install_assembly_search_hook_v2 (pedump_assembly_search_hook, NULL, FALSE, FALSE); mono_init_version ("pedump", NULL); - mono_install_assembly_preload_hook (pedump_preload, GUINT_TO_POINTER (FALSE)); + mono_install_assembly_preload_hook_v2 (pedump_preload, GUINT_TO_POINTER (FALSE), FALSE); mono_icall_init (); mono_marshal_init (); @@ -624,15 +624,16 @@ real_load (gchar **search_path, const gchar *culture, const gchar *name, const M * Try to load referenced assemblies from assemblies_path. */ static MonoAssembly * -pedump_preload (MonoAssemblyName *aname, - gchar **assemblies_path, - gpointer user_data) +pedump_preload (MonoAssemblyLoadContext *alc, + MonoAssemblyName *aname, + gchar **assemblies_path, + gboolean refonly, + gpointer user_data, + MonoError *error) { MonoAssembly *result = NULL; - gboolean refonly = GPOINTER_TO_UINT (user_data); MonoAssemblyOpenRequest req; - mono_assembly_request_prepare (&req.request, sizeof (req), refonly ? MONO_ASMCTX_REFONLY : MONO_ASMCTX_DEFAULT); - + mono_assembly_request_prepare_open (&req, refonly ? MONO_ASMCTX_REFONLY : MONO_ASMCTX_DEFAULT, alc); if (assemblies_path && assemblies_path [0] != NULL) { result = real_load (assemblies_path, aname->culture, aname->name, &req); @@ -646,7 +647,7 @@ pedump_preload (MonoAssemblyName *aname, static GList *loaded_assemblies = NULL; static void -pedump_assembly_load_hook (MonoAssembly *assembly, gpointer user_data) +pedump_assembly_load_hook (MonoAssemblyLoadContext *alc, MonoAssembly *assembly, gpointer user_data, MonoError *error) { loaded_assemblies = g_list_prepend (loaded_assemblies, assembly); } @@ -797,7 +798,7 @@ main (int argc, char *argv []) mono_verifier_set_mode (verifier_mode); - mono_assembly_request_prepare (&req.request, sizeof (req), MONO_ASMCTX_DEFAULT); + mono_assembly_request_prepare_open (&req, MONO_ASMCTX_DEFAULT, mono_domain_default_alc (mono_get_root_domain ())); assembly = mono_assembly_request_open (file, &req, NULL); /*fake an assembly for netmodules so the verifier works*/ if (!assembly && (image = mono_image_open (file, &status)) && image->tables [MONO_TABLE_ASSEMBLY].rows == 0) { diff --git a/tools/sgen/Makefile.am b/tools/sgen/Makefile.am index bcc2105051..594ba33478 100644 --- a/tools/sgen/Makefile.am +++ b/tools/sgen/Makefile.am @@ -1,3 +1,5 @@ +if !ENABLE_MSVC_ONLY + bin_PROGRAMS = sgen-grep-binprot AM_CPPFLAGS = $(GLIB_CFLAGS) -I$(top_srcdir) @@ -9,10 +11,14 @@ noinst_LIBRARIES = libsgen-grep-binprot.a libsgen-grep-binprot32p.a libsgen-grep # Main is in a library so it can be C++. noinst_LIBRARIES += libmain.a +endif # !ENABLE_MSVC_ONLY + # Default to C so the executable is linked as C and does not use libstdc++. # Also the -xc++ flag mishandles .o and .a files. CFLAGS = $(filter-out @CXX_REMOVE_CFLAGS@, @CFLAGS@) +if !ENABLE_MSVC_ONLY + # Libraries are C++ if enabled. libmain_a_CFLAGS = @CXX_ADD_CFLAGS@ libsgen_grep_binprot_a_CFLAGS = @CXX_ADD_CFLAGS@ @@ -39,3 +45,5 @@ sgen_grep_binprot_LDADD = \ libmain_a-sgen-grep-binprot-main.$(OBJEXT) \ libmain_a-sgen-entry-stream.$(OBJEXT) \ $(glib_libs) libsgen-grep-binprot.a libsgen-grep-binprot32p.a libsgen-grep-binprot64p.a + +endif # !ENABLE_MSVC_ONLY diff --git a/tools/sgen/Makefile.in b/tools/sgen/Makefile.in index b832b77906..ca9fcfb3c9 100644 --- a/tools/sgen/Makefile.in +++ b/tools/sgen/Makefile.in @@ -90,7 +90,7 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ -bin_PROGRAMS = sgen-grep-binprot$(EXEEXT) +@ENABLE_MSVC_ONLY_FALSE@bin_PROGRAMS = sgen-grep-binprot$(EXEEXT) subdir = tools/sgen ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/apple-target.m4 \ @@ -119,35 +119,40 @@ am__v_AR_0 = @echo " AR " $@; am__v_AR_1 = libmain_a_AR = $(AR) $(ARFLAGS) libmain_a_LIBADD = -am_libmain_a_OBJECTS = libmain_a-sgen-grep-binprot-main.$(OBJEXT) \ - libmain_a-sgen-entry-stream.$(OBJEXT) +am__libmain_a_SOURCES_DIST = sgen-grep-binprot-main.c \ + sgen-entry-stream.c sgen-entry-stream.h +@ENABLE_MSVC_ONLY_FALSE@am_libmain_a_OBJECTS = libmain_a-sgen-grep-binprot-main.$(OBJEXT) \ +@ENABLE_MSVC_ONLY_FALSE@ libmain_a-sgen-entry-stream.$(OBJEXT) libmain_a_OBJECTS = $(am_libmain_a_OBJECTS) libsgen_grep_binprot_a_AR = $(AR) $(ARFLAGS) libsgen_grep_binprot_a_LIBADD = -am_libsgen_grep_binprot_a_OBJECTS = \ - libsgen_grep_binprot_a-sgen-grep-binprot.$(OBJEXT) +am__libsgen_grep_binprot_a_SOURCES_DIST = sgen-grep-binprot.c \ + sgen-grep-binprot.h +@ENABLE_MSVC_ONLY_FALSE@am_libsgen_grep_binprot_a_OBJECTS = libsgen_grep_binprot_a-sgen-grep-binprot.$(OBJEXT) libsgen_grep_binprot_a_OBJECTS = $(am_libsgen_grep_binprot_a_OBJECTS) libsgen_grep_binprot32p_a_AR = $(AR) $(ARFLAGS) libsgen_grep_binprot32p_a_LIBADD = -am_libsgen_grep_binprot32p_a_OBJECTS = \ - libsgen_grep_binprot32p_a-sgen-grep-binprot.$(OBJEXT) +am__libsgen_grep_binprot32p_a_SOURCES_DIST = sgen-grep-binprot.c \ + sgen-grep-binprot.h +@ENABLE_MSVC_ONLY_FALSE@am_libsgen_grep_binprot32p_a_OBJECTS = libsgen_grep_binprot32p_a-sgen-grep-binprot.$(OBJEXT) libsgen_grep_binprot32p_a_OBJECTS = \ $(am_libsgen_grep_binprot32p_a_OBJECTS) libsgen_grep_binprot64p_a_AR = $(AR) $(ARFLAGS) libsgen_grep_binprot64p_a_LIBADD = -am_libsgen_grep_binprot64p_a_OBJECTS = \ - libsgen_grep_binprot64p_a-sgen-grep-binprot.$(OBJEXT) +am__libsgen_grep_binprot64p_a_SOURCES_DIST = sgen-grep-binprot.c \ + sgen-grep-binprot.h +@ENABLE_MSVC_ONLY_FALSE@am_libsgen_grep_binprot64p_a_OBJECTS = libsgen_grep_binprot64p_a-sgen-grep-binprot.$(OBJEXT) libsgen_grep_binprot64p_a_OBJECTS = \ $(am_libsgen_grep_binprot64p_a_OBJECTS) am__installdirs = "$(DESTDIR)$(bindir)" PROGRAMS = $(bin_PROGRAMS) am_sgen_grep_binprot_OBJECTS = sgen_grep_binprot_OBJECTS = $(am_sgen_grep_binprot_OBJECTS) -sgen_grep_binprot_DEPENDENCIES = \ - libmain_a-sgen-grep-binprot-main.$(OBJEXT) \ - libmain_a-sgen-entry-stream.$(OBJEXT) $(glib_libs) \ - libsgen-grep-binprot.a libsgen-grep-binprot32p.a \ - libsgen-grep-binprot64p.a +@ENABLE_MSVC_ONLY_FALSE@sgen_grep_binprot_DEPENDENCIES = libmain_a-sgen-grep-binprot-main.$(OBJEXT) \ +@ENABLE_MSVC_ONLY_FALSE@ libmain_a-sgen-entry-stream.$(OBJEXT) \ +@ENABLE_MSVC_ONLY_FALSE@ $(glib_libs) libsgen-grep-binprot.a \ +@ENABLE_MSVC_ONLY_FALSE@ libsgen-grep-binprot32p.a \ +@ENABLE_MSVC_ONLY_FALSE@ libsgen-grep-binprot64p.a AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent @@ -186,9 +191,10 @@ SOURCES = $(libmain_a_SOURCES) $(libsgen_grep_binprot_a_SOURCES) \ $(libsgen_grep_binprot32p_a_SOURCES) \ $(libsgen_grep_binprot64p_a_SOURCES) \ $(sgen_grep_binprot_SOURCES) -DIST_SOURCES = $(libmain_a_SOURCES) $(libsgen_grep_binprot_a_SOURCES) \ - $(libsgen_grep_binprot32p_a_SOURCES) \ - $(libsgen_grep_binprot64p_a_SOURCES) \ +DIST_SOURCES = $(am__libmain_a_SOURCES_DIST) \ + $(am__libsgen_grep_binprot_a_SOURCES_DIST) \ + $(am__libsgen_grep_binprot32p_a_SOURCES_DIST) \ + $(am__libsgen_grep_binprot64p_a_SOURCES_DIST) \ $(sgen_grep_binprot_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ @@ -304,6 +310,7 @@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTERP_CFLAGS = @INTERP_CFLAGS@ INTL = @INTL@ INVARIANT_AOT_OPTIONS = @INVARIANT_AOT_OPTIONS@ JEMALLOC_AUTOCONF_FLAGS = @JEMALLOC_AUTOCONF_FLAGS@ @@ -492,38 +499,39 @@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -AM_CPPFLAGS = $(GLIB_CFLAGS) -I$(top_srcdir) -glib_libs = $(top_builddir)/mono/eglib/libeglib.la +@ENABLE_MSVC_ONLY_FALSE@AM_CPPFLAGS = $(GLIB_CFLAGS) -I$(top_srcdir) +@ENABLE_MSVC_ONLY_FALSE@glib_libs = $(top_builddir)/mono/eglib/libeglib.la # Main is in a library so it can be C++. -noinst_LIBRARIES = libsgen-grep-binprot.a libsgen-grep-binprot32p.a \ - libsgen-grep-binprot64p.a libmain.a +@ENABLE_MSVC_ONLY_FALSE@noinst_LIBRARIES = libsgen-grep-binprot.a \ +@ENABLE_MSVC_ONLY_FALSE@ libsgen-grep-binprot32p.a \ +@ENABLE_MSVC_ONLY_FALSE@ libsgen-grep-binprot64p.a libmain.a # Libraries are C++ if enabled. -libmain_a_CFLAGS = @CXX_ADD_CFLAGS@ -libsgen_grep_binprot_a_CFLAGS = @CXX_ADD_CFLAGS@ -libsgen_grep_binprot32p_a_CFLAGS = @CXX_ADD_CFLAGS@ -libsgen_grep_binprot64p_a_CFLAGS = @CXX_ADD_CFLAGS@ -libsgen_grep_binprot_a_SOURCES = sgen-grep-binprot.c sgen-grep-binprot.h -libsgen_grep_binprot_a_CPPFLAGS = $(GLIB_CFLAGS) -I$(top_srcdir) -libsgen_grep_binprot32p_a_SOURCES = sgen-grep-binprot.c sgen-grep-binprot.h -libsgen_grep_binprot32p_a_CPPFLAGS = $(GLIB_CFLAGS) -I$(top_srcdir) -DBINPROT_SIZEOF_VOID_P=4 -DBINPROT_HAS_HEADER -libsgen_grep_binprot64p_a_SOURCES = sgen-grep-binprot.c sgen-grep-binprot.h -libsgen_grep_binprot64p_a_CPPFLAGS = $(GLIB_CFLAGS) -I$(top_srcdir) -DBINPROT_SIZEOF_VOID_P=8 -DBINPROT_HAS_HEADER +@ENABLE_MSVC_ONLY_FALSE@libmain_a_CFLAGS = @CXX_ADD_CFLAGS@ +@ENABLE_MSVC_ONLY_FALSE@libsgen_grep_binprot_a_CFLAGS = @CXX_ADD_CFLAGS@ +@ENABLE_MSVC_ONLY_FALSE@libsgen_grep_binprot32p_a_CFLAGS = @CXX_ADD_CFLAGS@ +@ENABLE_MSVC_ONLY_FALSE@libsgen_grep_binprot64p_a_CFLAGS = @CXX_ADD_CFLAGS@ +@ENABLE_MSVC_ONLY_FALSE@libsgen_grep_binprot_a_SOURCES = sgen-grep-binprot.c sgen-grep-binprot.h +@ENABLE_MSVC_ONLY_FALSE@libsgen_grep_binprot_a_CPPFLAGS = $(GLIB_CFLAGS) -I$(top_srcdir) +@ENABLE_MSVC_ONLY_FALSE@libsgen_grep_binprot32p_a_SOURCES = sgen-grep-binprot.c sgen-grep-binprot.h +@ENABLE_MSVC_ONLY_FALSE@libsgen_grep_binprot32p_a_CPPFLAGS = $(GLIB_CFLAGS) -I$(top_srcdir) -DBINPROT_SIZEOF_VOID_P=4 -DBINPROT_HAS_HEADER +@ENABLE_MSVC_ONLY_FALSE@libsgen_grep_binprot64p_a_SOURCES = sgen-grep-binprot.c sgen-grep-binprot.h +@ENABLE_MSVC_ONLY_FALSE@libsgen_grep_binprot64p_a_CPPFLAGS = $(GLIB_CFLAGS) -I$(top_srcdir) -DBINPROT_SIZEOF_VOID_P=8 -DBINPROT_HAS_HEADER # Executable has no source files, just links to object files and libraries. -sgen_grep_binprot_SOURCES = -libmain_a_SOURCES = \ - sgen-grep-binprot-main.c \ - sgen-entry-stream.c \ - sgen-entry-stream.h +@ENABLE_MSVC_ONLY_FALSE@sgen_grep_binprot_SOURCES = +@ENABLE_MSVC_ONLY_FALSE@libmain_a_SOURCES = \ +@ENABLE_MSVC_ONLY_FALSE@ sgen-grep-binprot-main.c \ +@ENABLE_MSVC_ONLY_FALSE@ sgen-entry-stream.c \ +@ENABLE_MSVC_ONLY_FALSE@ sgen-entry-stream.h # Link to the libmain object files instead of library for higher fidelity with old behavior. -sgen_grep_binprot_LDADD = \ - libmain_a-sgen-grep-binprot-main.$(OBJEXT) \ - libmain_a-sgen-entry-stream.$(OBJEXT) \ - $(glib_libs) libsgen-grep-binprot.a libsgen-grep-binprot32p.a libsgen-grep-binprot64p.a +@ENABLE_MSVC_ONLY_FALSE@sgen_grep_binprot_LDADD = \ +@ENABLE_MSVC_ONLY_FALSE@ libmain_a-sgen-grep-binprot-main.$(OBJEXT) \ +@ENABLE_MSVC_ONLY_FALSE@ libmain_a-sgen-entry-stream.$(OBJEXT) \ +@ENABLE_MSVC_ONLY_FALSE@ $(glib_libs) libsgen-grep-binprot.a libsgen-grep-binprot32p.a libsgen-grep-binprot64p.a all: all-am @@ -648,25 +656,22 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libsgen_grep_binprot_a-sgen-grep-binprot.Po@am__quote@ .c.o: -@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ -@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: -@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ -@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: -@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ -@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ -@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< diff --git a/tools/sgen/sgen-grep-binprot.c b/tools/sgen/sgen-grep-binprot.c index b8fd1cb239..a3b4fb29d4 100644 --- a/tools/sgen/sgen-grep-binprot.c +++ b/tools/sgen/sgen-grep-binprot.c @@ -264,7 +264,7 @@ print_entry (int type, void *data, int num_nums, int *match_indices, gboolean co case PROTOCOL_ID(method): { \ const int pes_size G_GNUC_UNUSED = 0; \ PrintEntry pes [1] G_GNUC_UNUSED; \ - printf ("%s", #method + strlen ("binary_protocol_")); + printf ("%s", &#method [sizeof ("binary_protocol_") - 1]); #define BEGIN_PROTOCOL_ENTRY1(method,t1,f1) \ case PROTOCOL_ID(method): { \ PROTOCOL_STRUCT (method) *entry = (PROTOCOL_STRUCT (method)*)data; \