Merge pull request #4840 from kumpera/unaligned-access
authorRodrigo Kumpera <kumpera@users.noreply.github.com>
Fri, 26 May 2017 19:17:02 +0000 (12:17 -0700)
committerGitHub <noreply@github.com>
Fri, 26 May 2017 19:17:02 +0000 (12:17 -0700)
Another round of cleanups plus fix how the JIT emit unaligned access.

137 files changed:
Makefile.am
configure.ac
eglib/src/eglib-remap.h
external/api-snapshot
external/bockbuild
external/boringssl
external/ikvm
external/linker
external/roslyn-binaries
mcs/AUTHORS
mcs/COPYING
mcs/CodingStyle
mcs/INSTALL.txt
mcs/Makefile
mcs/README
mcs/build/build.proj [deleted file]
mcs/build/msbuild/.gitattributes [deleted file]
mcs/build/msbuild/Mono.Common.targets [deleted file]
mcs/build/msbuild/Mono.Default.targets [deleted file]
mcs/build/profiles/basic.make
mcs/build/profiles/build.make
mcs/build/profiles/xbuild_12.make
mcs/class/LICENSE
mcs/class/Makefile
mcs/class/Mono.CodeContracts/Mono.CodeContracts.Rewrite/Rewriter.cs
mcs/class/Mono.CodeContracts/Mono.CodeContracts.Static.AST/AssemblyNode.cs
mcs/class/README
mcs/class/System.Numerics/Makefile
mcs/class/System/System.Net.Sockets/SocketAsyncEventArgs.cs
mcs/class/Xunit.NetCore.Extensions/Makefile
mcs/class/build-rx-dll-sources.sh [deleted file]
mcs/class/corlib/LinkerDescriptor/mscorlib.xml [new file with mode: 0644]
mcs/class/corlib/Makefile
mcs/class/corlib/Mono/RuntimeStructs.cs
mcs/class/corlib/System.IO/FileStream.cs
mcs/class/corlib/System.Reflection.Emit/ModuleBuilder.cs
mcs/class/corlib/System/TimeZoneInfo.cs
mcs/class/corlib/Test/System.IO/FileTest.cs
mcs/class/corlib/Test/System.Threading.Tasks/TaskTest.cs
mcs/class/corlib/Test/System/DecimalTest-Microsoft.cs
mcs/class/corlib/corert/Debug.cs
mcs/class/project_template_android.txt [deleted file]
mcs/class/project_template_ios.txt [deleted file]
mcs/class/referencesource/mscorlib/system/io/filesystemenumerable.cs
mcs/errors/cs0208-19.cs [new file with mode: 0644]
mcs/errors/cs1031-3.cs [new file with mode: 0644]
mcs/errors/cs1043.cs
mcs/errors/cs1629-3.cs [new file with mode: 0644]
mcs/mcs/class.cs
mcs/mcs/cs-parser.jay
mcs/mcs/cs-tokenizer.cs
mcs/mcs/decl.cs
mcs/mcs/driver.cs
mcs/mcs/ecore.cs
mcs/mcs/eval.cs
mcs/mcs/expression.cs
mcs/mcs/import.cs
mcs/mcs/iterators.cs
mcs/mcs/location.cs
mcs/mcs/property.cs
mcs/mcs/statement.cs
mcs/mcs/support.cs
mcs/tests/gtest-646-lib.cs [new file with mode: 0644]
mcs/tests/gtest-646.cs [new file with mode: 0644]
mcs/tests/test-943.cs [new file with mode: 0644]
mcs/tests/test-async-92.cs [new file with mode: 0644]
mcs/tests/test-expression-bodied-03.cs [new file with mode: 0644]
mcs/tests/ver-il-net_4_x.xml
mcs/tools/Makefile
mcs/tools/assemblies.xml [deleted file]
mcs/tools/corcompare/AssemblyResolver.cs
mcs/tools/linker/Descriptors/Mono.Posix.xml [deleted file]
mcs/tools/linker/Descriptors/System.Core.xml [deleted file]
mcs/tools/linker/Descriptors/System.Drawing.xml [deleted file]
mcs/tools/linker/Descriptors/System.Web.xml [deleted file]
mcs/tools/linker/Descriptors/System.xml [deleted file]
mcs/tools/linker/Descriptors/mscorlib.xml [deleted file]
mcs/tools/linker/Makefile
mcs/tools/linker/Tests/mscorlib/test-array.cs [new file with mode: 0644]
mcs/tools/linker/Tests/mscorlib/test-reflection.cs [new file with mode: 0644]
mcs/tools/linker/monolinker.exe.sources
mcs/tools/mdbdump/mdbdump.cs
mcs/tools/mkbundle/mkbundle.cs
mcs/tools/mono-symbolicate/LocationProvider.cs
mcs/tools/mono-symbolicate/SymbolManager.cs
mcs/tools/mono-win32-setup-dark.bmp [deleted file]
mcs/tools/mono-win32-setup-light.bmp [deleted file]
mcs/tools/mono-win32-setup.nsi [deleted file]
mcs/tools/pdb2mdb/Driver.cs
mcs/tools/scan-tests.pl [deleted file]
mcs/tools/security/permview.cs
mcs/tools/security/security.proj [deleted file]
mcs/tools/tinderbox/smtp.c [deleted file]
mcs/tools/tinderbox/tinderbox.sh [deleted file]
mcs/winexe.in [deleted file]
mono/dis/Makefile.am
mono/metadata/appdomain.c
mono/metadata/class.c
mono/metadata/handle.c
mono/metadata/handle.h
mono/metadata/icall-def.h
mono/metadata/icall.c
mono/metadata/image.c
mono/metadata/marshal.c
mono/metadata/marshal.h
mono/metadata/object-internals.h
mono/metadata/object.c
mono/metadata/sgen-mono.c
mono/metadata/w32error-unix.c
mono/metadata/w32error.h
mono/metadata/w32file-unix.c
mono/metadata/w32socket-unix.c
mono/mini/aot-runtime.c
mono/mini/exceptions.cs
mono/mini/interp/interp.c
mono/mini/jit-icalls.c
mono/mini/method-to-ir.c
mono/mini/mini-amd64.c
mono/mini/mini-amd64.h
mono/mini/mini-arm.c
mono/mini/mini-arm.h
mono/mini/mini-generic-sharing.c
mono/mini/mini-posix.c
mono/mini/tramp-arm.c
mono/tests/Makefile.am [changed mode: 0644->0755]
mono/tests/appdomain-unload-asmload.cs [new file with mode: 0644]
mono/tests/internalsvisibleto-compilertest.cs [new file with mode: 0755]
mono/tests/internalsvisibleto-library.cs [new file with mode: 0644]
mono/tests/internalsvisibleto-runtimetest.cs [new file with mode: 0755]
mono/tests/testing_gac/Makefile.am
mono/unit-tests/Makefile.am
mono/utils/mono-proclib.c
packaging/MacSDK/nuget.py
scripts/ci/run-jenkins.sh
scripts/ci/run-test-default.sh
scripts/ci/run-test-testing_aot_full.sh
tools/nuget-hash-extractor/download.sh

index ede769564985d5b87cdf226a5ee99e9783381c44..031ef3a11684161955ad17c3367c1e7e7b676989 100644 (file)
@@ -50,14 +50,9 @@ noinst_DATA = mono-uninstalled.pc
 DISTCLEANFILES= mono-uninstalled.pc
 
 # building with monolite
-mcslib = $(mcs_topdir)/class/lib
-monolite_url = https://download.mono-project.com/monolite/monolite-$(MONO_CORLIB_VERSION)-latest.tar.gz
 .PHONY: get-monolite-latest 
 get-monolite-latest:
-       -rm -fr $(mcslib)/monolite/$(MONO_CORLIB_VERSION)
-       -mkdir -p $(mcslib)/monolite
-       cd $(mcslib) && { (wget -O- $(monolite_url) || curl -L $(monolite_url)) | gzip -d | tar xf - ; }
-       cd $(mcslib) && mv -f monolite-* monolite/$(MONO_CORLIB_VERSION)
+       $(MAKE) -C $(mcs_topdir)/class get-monolite-latest
 
 if BITCODE
 BITCODE_CHECK=yes
index 061bc0df75cdf274d913c01a4e55f57c269aa512..c5c7ba58b9e3cfbd99ec0da64a13c1f3872cee0f 100644 (file)
@@ -40,7 +40,7 @@ MONO_VERSION_BUILD=`echo $VERSION | cut -d . -f 3`
 # This can be reset to 0 when Mono's version number is bumped
 # since it's part of the corlib version (the prefix '1' in the full
 # version number is to ensure the number isn't treated as octal in C)
-MONO_CORLIB_COUNTER=1
+MONO_CORLIB_COUNTER=2
 MONO_CORLIB_VERSION=`printf "1%02d%02d%02d%03d" $MONO_VERSION_MAJOR $MONO_VERSION_MINOR $MONO_VERSION_BUILD $MONO_CORLIB_COUNTER`
 
 AC_DEFINE_UNQUOTED(MONO_CORLIB_VERSION,$MONO_CORLIB_VERSION,[Version of the corlib-runtime interface])
@@ -3228,6 +3228,7 @@ case "$host" in
                CPPFLAGS="$CPPFLAGS -D__ARM_EABI__"
                BTLS_SUPPORTED=yes
                BTLS_PLATFORM=arm
+               AC_CHECK_HEADER(stdalign.h,[],[BTLS_SUPPORTED=no])
                case "$target" in
                arm*-linux*-gnueabi)
                        BTLS_PLATFORM=armsoft
@@ -3255,6 +3256,7 @@ case "$host" in
                AOT_SUPPORTED="yes"
                BTLS_SUPPORTED=yes
                BTLS_PLATFORM=aarch64
+               AC_CHECK_HEADER(stdalign.h,[],[BTLS_SUPPORTED=no])
                ;;
        s390x-*-linux*)
                TARGET=S390X;
@@ -4089,8 +4091,6 @@ dnl **************
 AC_ARG_ENABLE(btls, [  --disable-btls             Disable the BoringTls provider], enable_btls=$enableval, enable_btls=$BTLS_SUPPORTED)
 AC_ARG_WITH(btls_android_ndk, [  --with-btls-android-ndk        Android NDK for BoringTls])
 
-AC_ARG_ENABLE(dynamic-btls, [ --enable-dynamic-btls Place the BTLS provider into a separate shared library/archive.], enable_dynamic_btls=$enableval, enable_dynamic_btls=no)
-
 AM_CONDITIONAL(BTLS, test x$enable_btls = xyes)
 
 btls_android=no
@@ -4231,7 +4231,7 @@ AC_SUBST(mono_build_root)
 mono_runtime=mono/mini/mono
 AC_SUBST(mono_runtime)
 
-CSC_LOCATION=`cd $srcdir && pwd`/external/roslyn-binaries/Microsoft.Net.Compilers/Microsoft.Net.Compilers.2.1.0/tools/csc.exe
+CSC_LOCATION=`cd $srcdir && pwd`/external/roslyn-binaries/Microsoft.Net.Compilers/Microsoft.Net.Compilers.2.3.0/tools/csc.exe
 
 if test $csc_compiler = mcs; then
   CSC=$mcs_topdir/class/lib/build/mcs.exe
@@ -4611,9 +4611,6 @@ fi
 
     if test "x$enable_btls" = "xyes"; then
       echo "HAVE_BTLS=1" >> $srcdir/$mcsdir/build/config.make
-      if test "x$enable_dynamic_btls" = "xyes"; then
-        echo "HAVE_DYNAMIC_BTLS=1" >> $srcdir/$mcsdir/build/config.make
-      fi
     fi
 
   fi
index 5c918d25dabb9ce532653fed4dd3403170b9a1c5..311c06a2109d3e4081d3340c649b80ddd81e2c60 100644 (file)
@@ -15,6 +15,8 @@
 #define g_byte_array_append monoeg_g_byte_array_append
 #define g_byte_array_free monoeg_g_byte_array_free
 #define g_byte_array_new monoeg_g_byte_array_new
+#define g_byte_array_set_size monoeg_g_byte_array_set_size
+#define g_calloc monoeg_g_calloc
 #define g_clear_error monoeg_g_clear_error
 #define g_convert monoeg_g_convert
 #define g_convert_error_quark monoeg_g_convert_error_quark
@@ -25,6 +27,7 @@
 #define g_mkdir_with_parents monoeg_g_mkdir_with_parents
 #define g_direct_equal monoeg_g_direct_equal
 #define g_direct_hash monoeg_g_direct_hash
+#define g_ensure_directory_exists monoeg_g_ensure_directory_exists
 #define g_error_free monoeg_g_error_free
 #define g_error_new monoeg_g_error_new
 #define g_error_vnew monoeg_g_error_vnew
@@ -48,6 +51,7 @@
 #define g_get_tmp_dir monoeg_g_get_tmp_dir
 #define g_get_user_name monoeg_g_get_user_name
 #define g_getenv monoeg_g_getenv
+#define g_hasenv monoeg_g_hasenv
 #define g_hash_table_destroy monoeg_g_hash_table_destroy
 #define g_hash_table_find monoeg_g_hash_table_find
 #define g_hash_table_foreach monoeg_g_hash_table_foreach
 #define g_markup_parse_context_new monoeg_g_markup_parse_context_new
 #define g_markup_parse_context_parse monoeg_g_markup_parse_context_parse
 #define g_memdup monoeg_g_memdup
+#define g_mem_set_vtable monoeg_g_mem_set_vtable
+#define g_mkdtemp monoeg_g_mkdtemp
 #define g_module_build_path monoeg_g_module_build_path
 #define g_module_close monoeg_g_module_close
 #define g_module_error monoeg_g_module_error
 #define g_utf8_offset_to_pointer monoeg_g_utf8_offset_to_pointer
 #define g_utf8_pointer_to_offset monoeg_g_utf8_pointer_to_offset
 #define g_utf8_to_ucs4_fast monoeg_g_utf8_to_ucs4_fast
+#define g_vasprintf monoeg_g_vasprintf
 #define g_win32_getlocale monoeg_g_win32_getlocale
 #define g_assertion_message monoeg_assertion_message
 #define g_malloc monoeg_malloc
index ba90b3440d775ace30ceaebb0ceec3c5b021bb4e..366b5e92d77e4e6e62a6965073097b48a59c1bdc 160000 (submodule)
@@ -1 +1 @@
-Subproject commit ba90b3440d775ace30ceaebb0ceec3c5b021bb4e
+Subproject commit 366b5e92d77e4e6e62a6965073097b48a59c1bdc
index 31c98f3cabb0eeb10053c79a05bb51b659edc677..45aa142fa322f5b41051e7f40008f03346a1e119 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 31c98f3cabb0eeb10053c79a05bb51b659edc677
+Subproject commit 45aa142fa322f5b41051e7f40008f03346a1e119
index c06ac6b33d3e7442ad878488b9d1100127eff998..3e0770e18835714708860ba9fe1af04a932971ff 160000 (submodule)
@@ -1 +1 @@
-Subproject commit c06ac6b33d3e7442ad878488b9d1100127eff998
+Subproject commit 3e0770e18835714708860ba9fe1af04a932971ff
index 7c1e61bec8c069b2cc9e214c3094b147d76bbf82..847e05fced5c9a41ff0f24f1f9d40d5a8a5772c1 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 7c1e61bec8c069b2cc9e214c3094b147d76bbf82
+Subproject commit 847e05fced5c9a41ff0f24f1f9d40d5a8a5772c1
index c7450ca2669becddffdea7dcdcc06692e57989e1..21e445c26c69ac3a2e1441befa02d0bd105ff849 160000 (submodule)
@@ -1 +1 @@
-Subproject commit c7450ca2669becddffdea7dcdcc06692e57989e1
+Subproject commit 21e445c26c69ac3a2e1441befa02d0bd105ff849
index 1e3dfe1003050e8887691e87474e938b6beef16e..98069dbb17eab8af9499f1ae0a891e1eb94658c4 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 1e3dfe1003050e8887691e87474e938b6beef16e
+Subproject commit 98069dbb17eab8af9499f1ae0a891e1eb94658c4
index bfc855692e4d319ea04f3236a3f583e5fa50e781..416c39e3a0b877bbc10b6a45e17f8b9886ee56db 100644 (file)
@@ -1,7 +1,5 @@
 This list of authors is outdated.   For a full list of contributors
-see:
-
-       http://www.go-mono.com/archive/mono-1.0.html
+check out the git history.
 
 C# Compiler:
        Miguel de Icaza (miguel@ximian.com)
index d60c31a97a544b53039088d14fe9114583c0efc3..fd336eb81764406f72cc0092b8a94895d14927d3 100644 (file)
@@ -1,340 +1 @@
-                   GNU GENERAL PUBLIC LICENSE
-                      Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.
-     59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-                           Preamble
-
-  The licenses for most software are designed to take away your
-freedom to share and change it.  By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users.  This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it.  (Some other Free Software Foundation software is covered by
-the GNU Library General Public License instead.)  You can apply it to
-your programs, too.
-
-  When we speak of free software, we are referring to freedom, not
-price.  Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
-  To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
-  For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have.  You must make sure that they, too, receive or can get the
-source code.  And you must show them these terms so they know their
-rights.
-
-  We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
-  Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software.  If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
-  Finally, any free program is threatened constantly by software
-patents.  We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary.  To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
-  The precise terms and conditions for copying, distribution and
-modification follow.
-\f
-                   GNU GENERAL PUBLIC LICENSE
-   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
-  0. This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License.  The "Program", below,
-refers to any such program or work, and a "work based on the Program"
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language.  (Hereinafter, translation is included without limitation in
-the term "modification".)  Each licensee is addressed as "you".
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope.  The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
-  1. You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
-  2. You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
-    a) You must cause the modified files to carry prominent notices
-    stating that you changed the files and the date of any change.
-
-    b) You must cause any work that you distribute or publish, that in
-    whole or in part contains or is derived from the Program or any
-    part thereof, to be licensed as a whole at no charge to all third
-    parties under the terms of this License.
-
-    c) If the modified program normally reads commands interactively
-    when run, you must cause it, when started running for such
-    interactive use in the most ordinary way, to print or display an
-    announcement including an appropriate copyright notice and a
-    notice that there is no warranty (or else, saying that you provide
-    a warranty) and that users may redistribute the program under
-    these conditions, and telling the user how to view a copy of this
-    License.  (Exception: if the Program itself is interactive but
-    does not normally print such an announcement, your work based on
-    the Program is not required to print an announcement.)
-\f
-These requirements apply to the modified work as a whole.  If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works.  But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
-  3. You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
-    a) Accompany it with the complete corresponding machine-readable
-    source code, which must be distributed under the terms of Sections
-    1 and 2 above on a medium customarily used for software interchange; or,
-
-    b) Accompany it with a written offer, valid for at least three
-    years, to give any third party, for a charge no more than your
-    cost of physically performing source distribution, a complete
-    machine-readable copy of the corresponding source code, to be
-    distributed under the terms of Sections 1 and 2 above on a medium
-    customarily used for software interchange; or,
-
-    c) Accompany it with the information you received as to the offer
-    to distribute corresponding source code.  (This alternative is
-    allowed only for noncommercial distribution and only if you
-    received the program in object code or executable form with such
-    an offer, in accord with Subsection b above.)
-
-The source code for a work means the preferred form of the work for
-making modifications to it.  For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable.  However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-\f
-  4. You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License.  Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
-  5. You are not required to accept this License, since you have not
-signed it.  However, nothing else grants you permission to modify or
-distribute the Program or its derivative works.  These actions are
-prohibited by law if you do not accept this License.  Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
-  6. Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions.  You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
-  7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License.  If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all.  For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices.  Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-\f
-  8. If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded.  In such case, this License incorporates
-the limitation as if written in the body of this License.
-
-  9. The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time.  Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number.  If the Program
-specifies a version number of this License which applies to it and "any
-later version", you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation.  If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
-  10. If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission.  For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this.  Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
-                           NO WARRANTY
-
-  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
-  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGES.
-
-                    END OF TERMS AND CONDITIONS
-\f
-           How to Apply These Terms to Your New Programs
-
-  If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
-  To do so, attach the following notices to the program.  It is safest
-to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
-    <one line to give the program's name and a brief idea of what it does.>
-    Copyright (C) <year>  <name of author>
-
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
-
-    Gnomovision version 69, Copyright (C) year  name of author
-    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
-    This is free software, and you are welcome to redistribute it
-    under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License.  Of course, the commands you use may
-be called something other than `show w' and `show c'; they could even be
-mouse-clicks or menu items--whatever suits your program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the program, if
-necessary.  Here is a sample; alter the names:
-
-  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
-  `Gnomovision' (which makes passes at compilers) written by James Hacker.
-
-  <signature of Ty Coon>, 1 April 1989
-  Ty Coon, President of Vice
-
-This General Public License does not permit incorporating your program into
-proprietary programs.  If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library.  If this is what you want to do, use the GNU Library General
-Public License instead of this License.
+See LICENSE file in the project root for full license information.
index 54aa55d1545c99752cfe3e7e1de9bc181fafd8fc..8c0ac1e65e1b989757c9545c6710c31cab93fee5 100644 (file)
@@ -1,477 +1 @@
-* Coding Style for the Mono C# source code.
-
-* Class Libraries and Assembly Layout
-
-       The class libraries are grouped together in the assemblies
-       they belong.
-       
-       Each directory here represents an assembly, and inside each
-       directory we divide the code based on the namespace they
-       implement.
-       
-       In addition, each assembly directory contains a Test directory
-       that holds the NUnit tests for that assembly.
-       
-       We use a new build system which is described by various README
-       files in mcs/build
-       
-       The build process typically builds an assembly, but in some
-       cases it also builds special versions of the assemblies
-       intended to be used for testing.
-
-* Missing implementation bits
-
-       If you implement a class and you are missing implementation bits,
-       please use the attribute [MonoTODO].  This attribute can be used
-       to programatically generate our status web pages:
-
-       [MonoTODO("My Function is not available on Mono")]
-       int MyFunction ()
-       {
-               throw new NotImplementedException ();
-       }
-
-       Ideally, write a human description of the reason why there is
-       a MonoTODO, this will be useful in the future for our
-       automated tools that can assist in developers porting their code.
-
-* Tagging buggy code
-
-       If there is a bug in your implementation tag the problem by using
-       the word "FIXME" in the code, together with a description of the 
-       problem.
-
-       Do not use XXX or obscure descriptions, because otherwise people
-       will not be able to understand what you mean.
-
-* Tagging Problematic specs.
-
-       If the documentation and the Microsoft implementation do
-       differ (you wrote a test case to prove this), I suggest that you edit
-       the file `mcs/class/doc/API-notes' so we can keep track of these problems
-       and submit our comments to ECMA or Microsoft and seek clarification.
-
-       Sometimes the documentation might be buggy, and sometimes the implementation
-       might be buggy.  Lets try to identify and pinpoint which one
-       is the correct one.
-
-       Sometimes the specification will be lame (consider Version.ToString (fieldCount)
-       where there is no way of knowing how many fields are available, making the API
-       not only stupid, but leading to unreliable code).
-
-       In those cases, use the keyword "LAMESPEC".
-       
-
-* Coding considerations and style.
-
-       In order to keep the code consistent, please use the following
-       conventions.  From here on `good' and `bad' are used to attribute
-       things that would make the coding style match, or not match.  It is not
-       a judgement call on your coding abilities, but more of a style and 
-       look call.  Please try to follow these guidelines to ensure prettiness.
-
-       Use 8 space tabs for writing your code (hopefully we can keep
-       this consistent).  If you are modifying someone else's code, try
-       to keep the coding style similar.
-
-       Since we are using 8-space tabs, you might want to consider the Linus
-       Torvals trick to reduce code nesting.  Many times in a loop, you will
-       find yourself doing a test, and if the test is true, you will nest.
-       Many times this can be changed.  Example:
-
-
-               for (i = 0; i < 10; i++) {
-                       if (something (i)) {
-                               do_more ();
-                       }
-               }
-
-       This take precious space, instead write it like this:
-
-               for (i = 0; i < 10; i++) {
-                       if (!something (i))
-                               continue;
-                       do_more ();
-               }
-
-* Performance and readability
-
-       It is more important to be correct than to be fast.
-
-       It is more important to be maintainable than to be fast.
-
-       Fast code that is difficult to maintain is likely going to
-       be looked down upon.
-
-* Style Guidelines
-
-               * Use a space before an opening parenthesis when calling
-                 functions, or indexing, like this:
-
-                       method (a);
-                       b [10];
-
-               * Do not put a space after the opening parenthesis and the 
-                 closing one, ie:
-
-                       good: method (a);       array [10];
-
-                       bad:  method ( a );     array[ 10 ];
-
-               * Inside a code block, put the opening brace on the same line
-                 as the statement:
-
-                       good:
-                               if (a) {
-                                       code ();
-                                       code ();
-                               }
-
-                       bad:
-                               if (a) 
-                               {
-                                       code ();
-                                       code ();
-                               }
-
-               * Avoid using unnecessary open/close braces, vertical space
-                 is usually limited:
-
-                       good:
-                               if (a)
-                                       code ();
-
-                       bad:
-                               if (a) {
-                                       code ();
-                               }
-
-               * When defining a method, use the C style for brace placement, 
-                 that means, use a new line for the brace, like this:
-
-                       good:
-                               void Method ()
-                               {
-                               }
-
-                       bad:
-                               void Method () {
-                               }
-
-               * Properties and indexers are an exception, keep the
-                 brace on the same line as the property declaration.
-                 Rationale: this makes it visually
-                 simple to distinguish them.
-
-                       good:
-                               int Property {
-                                       get {
-                                               return value;
-                                       }
-                               }
-
-                       bad:
-                               int Property 
-                               {
-                                       get {
-                                               return value;
-                                       }
-                               }
-
-                 Notice how the accessor "get" also keeps its brace on the same
-                 line.
-
-                 For very small properties, you can compress things:
-
-                       ok:
-                               int Property {
-                                       get { return value; }
-                                       set { x = value; }
-                               }
-
-               * Use white space in expressions liberally, except in the presence
-                 of parenthesis:
-
-                       good:
-
-                               if (a + 5 > method (blah () + 4))
-
-                       bad:
-                               if (a+5>method(blah()+4))
-
-               * For any new files, please use a descriptive introduction, like
-                 this:
-
-                       //
-                       // System.Comment.cs: Handles comments in System files.
-                       //
-                       // Author:
-                       //   Juan Perez (juan@address.com)
-                       //
-                       // (C) 2002 Address, Inc (http://www.address.com)
-                       //
-
-               * If you are modyfing someone else's code, and your contribution
-                 is significant, please add yourself to the Authors list.
-
-               * Switch statements have the case at the same indentation as the
-                 switch:
-
-                       switch (x) {
-                       case 'a':
-                               ...
-                       case 'b':
-                               ...
-                       }
-
-               * Argument names should use the camel casing for
-                 identifiers, like this:
-
-                       good:
-                               void Method (string myArgument)
-
-                       bad:
-                               void Method (string lpstrArgument)
-                               void Method (string my_string)
-
-               * Empty methods: They should have the body of code using two    
-                 lines, in consistency with the rest:
-
-                       good:
-                               void EmptyMethod ()
-                               {
-                               }
-
-                       bad:
-                               void EmptyMethod () {}
-
-                               void EmptyMethod () 
-                               {}
-               
-               * Line length: The line length for C# source code is 134 columns.
-
-
-                 If your function declaration arguments go beyond
-                 this point, please align your arguments to match the
-                 opening brace, like this:
-
-                       void Function (int arg, string argb,
-                                      int argc)
-                       {
-                       }
-        
-                 When invoking functions, the rule is different, the
-                 arguments are not aligned with the previous
-                 argument, instead they begin at the tabbed position,
-                 like this:
-         
-                       void M ()
-                       {
-                               MethodCall ("Very long string that will force",
-                                       "Next argument on the 8-tab pos",
-                                       "Just like this one")
-               
-                       }
-
-               * Variable declaration indentation.
-
-                 Sometimes it is convenient to indent the variables to make the code
-                 look pretier, but do not add gratuitous space, try to use the minimally
-                 necessary space, for example:
-
-                 Good:
-
-                       void Method ()
-                       {
-                               string b;
-                               int    a;
-                               byte   c;
-                       }
-
-                 Bad:
-
-                       void Method ()
-                       {
-                               string          b;
-                               int             a;
-                               byte            c;
-                       }
-
-               * Braces and the `else' clause
-
-                 If there are braces closing or opening next to the else clause,
-                 they go on the same line as the word `else', for example:
-
-                 Good:
-
-                       if (..) {
-
-                       } else {
-               
-                       }
-       
-                 Bad:
-
-                       if (..) {
-
-                       } 
-                       else {
-               
-                       }
-
-                 Bad:
-
-                       if (..) {
-
-                       } else 
-                       {               
-                       }
-
-                 Bad:
-
-                       if (..) {
-
-                       } 
-                       else 
-                       {
-               
-                       }
-
-* RCS and CVS tags
-
-       Some users like to use the special RCS/CVS tags in their
-       source code: $id$, $log$ and so on.  
-
-       The use of these is not permitted on the Mono source code
-       repository.   This metadata belongs on a ChangeLog or in the
-       SVN metadata. 
-
-* File formats
-
-       Historically our repository has used a mix of line-endings,
-       this is a mistake that we are trying hard to fix.
-
-       For existing files, please make sure that you do not convert 
-       the file, as that causes us to loose precious history (the
-       full file is commited).
-
-       For new files that you create, please make sure that you use
-       Subversion's support for mapping the line endings
-       automatically, after adding your file:
-
-               $ svn add file.cs
-
-       Execute this command:
-
-               $ svn propset svn:eol-style native file.cs
-
-       Which will make the file automatically receive the proper
-       treatment from that point on.
-
-       Please verify before commiting that your changes wont loose
-       history, you can do this by running:
-
-               $ svn diff
-
-       And examining the output.
-
-* Warnings
-
-       Avoid commiting code with warnings to the repository, the use
-       of #pragmas to disable warnings is strongly discouraged, but
-       can be used on unique cases.  Please justify the use of the
-       warning ignore clause on a comment.
-
-       Do not commit changes to the Makefiles that removes warnings,
-       if anything warnings should be eliminated one at a time, and
-       if not possible, they must be flagged.
-
-
-* Examples:
-
-class X : Y {
-
-       bool Method (int argument_1, int argument_2)
-       {
-               if (argument_1 == argument_2)
-                       throw new Exception (Locale.GetText ("They are equal!");
-
-               if (argument_1 < argument_2) {
-                       if (argument_1 * 3 > 4)
-                               return true;
-                       else
-                               return false;
-               }
-
-               //
-               // This sample helps keep your sanity while using 8-spaces for tabs
-               // 
-               VeryLongIdentifierWhichTakesManyArguments (
-                       Argument1, Argument2, Argument3,
-                       NestedCallHere (
-                               MoreNested));
-       }
-
-       bool MyProperty {
-               get {
-                       return x;
-               }
-
-               set {
-                       x = value;
-               }
-       }
-
-       void AnotherMethod () 
-       {
-               if ((a + 5) != 4) {
-               }
-
-               while (blah) {
-                       if (a)
-                               continue;
-                       b++;
-               }
-       }
-}
-
-* Conditional compilation
-
-       Ideally we would not need conditional compilation, and the use
-       of #ifdef is strongly discouraged.  But due to our support for
-       old C# 1.0 compilers we have to use it in a few places.
-
-       Try to avoid negative tests that have an else clause, for
-       example:
-
-           #if !NET_2_0
-               CODE_FOR_1_0
-            #else
-               CODE_FOR_2_0
-           #endif
-
-        Instead use:
-
-           #if NET_2_0
-               CODE_FOR_2_0
-           #else
-               CODE_FOR_1_0
-            #endif
-
-       When a major feature differs across compilation targets, try
-       to factor out the code into a separate class, a helper class
-       or a separate file, and include that in your profile while
-       surrounding that helper file/class with the ifdefs to reduce
-       the amount of ifdefs in the code.
-
-       For instance, this is used for some parts of Grasshopper where
-       the code is ifdefed out, when large parts of a file would have
-       been ifdefed out, we moved the code into a MyOtherFile.jvm.cs
-
-       For 2.0 classes, this is even simpler as code can be trivially
-       factored out into 
-
-                MyHelperClass.cli.cs
-                MyHelperClass.jvm.cs
-
-       By using partial classes.
+Please see http://www.mono-project.com/community/contributing/coding-guidelines/ for latest guidelines.
index 2b59d588ba3b029982d950d69de74cd90d231faa..3e7c06fad829f5a3c75d83e43d66dcf320ff87ca 100644 (file)
@@ -23,7 +23,7 @@ compilers and tools.
 *                                                                   *
 *********************************************************************
 
-If you only want to build a snapshot or a fresh CVS checkout of the
+If you only want to build a snapshot or a fresh checkout of the
 sources, you should go into the `mono' sibling directory and issue the
 make command, like this:
 
@@ -35,72 +35,6 @@ make command, like this:
 The compilation is bundled with the build due to dependencies on the
 class libraries on the runtime.
 
-Build Features for Developers of Mono.
-======================================
-
-These instructions apply to both Linux and Windows. To build this
-package, you must already have a C# compiler installed.  This means
-that to build on Linux, you need to get a distribution of the MCS
-binaries; these are called monocharges. They can be found at
-www.go-mono.com/daily. On Windows, you can just use the
-Microsoft compiler. You also need GNU make to build the software (on
-Windows, you will need for example the Cygwin environment setup).
-
-You can customize your MCS configuration by using:
-
-    ./configure [--prefix=PREFIX] [--profile=PROFILE] 
-
-If you do not run the above, the defaults are /usr/local for the
-prefix, and `default' for the profile.
-
-To build the compiler and class libraries, run:
-
-    make
-
-The libraries will be placed in the directory class/lib/ and the mcs
-compiler executable in mcs/.
-
-To install them, run the following:
-
-    make install
-
-If you get "corlib out of sync" errors, try
-
-    make PROFILE="atomic"
-
-A better alternative would be to fire off a 'make' from a sibling or
-parent 'mono/' tree.
-
-Troubleshooting
-===============
-
-We try to maintain the CVS tree such that it is bootstrapable from the
-latest released version of mono and mcs.  Occasionally, something in the
-compiler or runtime changes enough that an existing installation cannot
-complete a bootstrap from cvs.  In this case, go to
-http://go-mono.com/daily and download a monocharge or monolite tarball.
-Unpack and copy the .dlls to $prefix/lib and .exes to $prefix/bin/.
-Then you should be able to complete the build normally (i.e. using make
-bootstrap).
-
-       wget http://go-mono.com/daily/monolite-20040505.tar.gz
-       tar -zxvf monolite-20040505.tar.gz
-       cd monolite-20040505
-       env prefix=/usr/local sh recharge.sh
-
-Monocharges
-===========
-
-If you are tracking Mono's development, you may sometimes need to share
-the compiled libraries with others, you can do:
-
-    make monocharge
-
-Or a light version, which contains only the essential libraries and
-results in a much smaller file:
-
-    make monocharge-lite
-
 Configuration
 =============
 
@@ -110,48 +44,15 @@ place your configuration options in build/config.make
 A list of variables that control the build are listed in the file
 build/config-default.make.
 
-Build profiles? What?
-======================
-
-Don't worry about them too much. If you're wondering which to use:
-use the default if you can (that's why it's the default!) and use
-the atomic if you have to.
-
-The default profile uses the C# compiler and class libaries as they
-are built. This lets you build MCS without needing to have already 
-installed it, but can fail if the libraries change significantly.
-(This is the source of the dreaded "corlib out of sync" warning, most
-of the time.)
-
-The atomic profile tries to use the system compiler and preexisting
-MCS libraries. New libaries are built against this constant reference 
-point, so if a newly built library has a binary incompatibility, the
-rest of your build can proceed.
-
-If you want to always use the atomic profile, run this command:
-
-       ./configure --profile=atomic
-
 More About the Build System
 ===========================
 
 More information is found in build/README.*. Here's a quick rundown
 of the features:
 
-        * Unified build system for Windows and Linux. Windows is still
-         fairly untested, but "should work." Unfortunately I don't
-         have a Windows machine to test on, but Gonzalo can get
-         corlib to build I think and that's about as complicated as
-         it gets.
-
         * Profile support. 'make PROFILE=profilename' or 'export
          PROFILE=profilename ; make' will work. Profiles are defined
-         in build/profiles/profilename.make ; right now there isn't
-         too much going on. The 'bootstrap' profile will build the
-         way makefile.gnu did on Linux, by setting MONO_PATH and
-         using mcs/mcs.exe; the default profile will build against
-         the existing system libraries and compile with 'mcs', which
-         should reduce a lot of 'corlib out of sync' warnings.
+         in build/profiles/profilename.make ;
 
         * Important variables are shared among makefiles now; you can
          edit build/config.make (see build/config-default.make for a
@@ -164,16 +65,11 @@ of the features:
 
         * Test libraries now live in class/Library/Library_test.dll,
          not class/Library/Test. 'make test' will build the test DLL,
-         'make run-test' will actually run the nunit tests. Set the
-         variable TEST_HARNESS to run with a program other than
-         nunit-console (for example, nunit-gtk).
+         'make run-test' will actually run the nunit tests.
 
         * Standardized recursive targets: all, clean, install, test,
          run-test.  Read build/README.makefiles for definitions of
          what they should do
 
         * (Relatively) sane 'make dist' target; 'make distcheck'
-         support; cute 'make monocharge' and 'make monocharge-lite'
-         targets. They're made possible because 'make install' now
-         supports DESTDIR a la automake, which I'm sure someone cares
-         about.
+         support;
index 72382ce0d0b23a11aea60ef6ca331bbc92bd4bbc..d04525bd34fc2a4b5a4425082b6f53cf7258cfc2 100644 (file)
@@ -95,8 +95,7 @@ DISTFILES = \
        mkinstalldirs           \
        MonoIcon.png            \
        README                  \
-       ScalableMonoIcon.svg    \
-       winexe.in
+       ScalableMonoIcon.svg
 
 dist-local: dist-default
 
@@ -138,34 +137,12 @@ distcheck: dist-tarball
        rm -f before.list after.list distdist.list ; \
        rm -rf $(package) InstallTest
 
-monocharge:
-       chargedir=monocharge-`date -u +%Y%m%d` ; \
-       mkdir "$$chargedir" ; \
-       DESTDIR=`cd "$$chargedir" && pwd` ; \
-       $(MAKE) install DESTDIR="$$DESTDIR" || exit 1 ; \
-       tar cvjf "$$chargedir".tar.bz2 "$$chargedir" ; \
-       rm -rf "$$chargedir"
-
-# A bare-bones monocharge.
-
-monocharge-lite:
-       chargedir=monocharge-lite-`date -u +%Y%m%d` ; \
-       mkdir "$$chargedir" ; \
-       DESTDIR=`cd "$$chargedir" && pwd` ; \
-       $(MAKE) -C mcs install DESTDIR="$$DESTDIR" || exit 1; \
-       $(MAKE) -C class/corlib install DESTDIR="$$DESTDIR" || exit 1; \
-       $(MAKE) -C class/System install DESTDIR="$$DESTDIR" || exit 1; \
-       $(MAKE) -C class/System.XML install DESTDIR="$$DESTDIR" || exit 1; \
-       $(MAKE) -C class/Mono.CSharp.Debugger install DESTDIR="$$DESTDIR" || exit 1; \
-       tar cvjf "$$chargedir".tar.bz2 "$$chargedir" ; \
-       rm -rf "$$chargedir"
-
 # Targets for creating API diffs of the framework
 
 MONO_API_SNAPSHOT_PATH := $(topdir)../external/api-snapshot/
 GENAPI := $(MONO_API_SNAPSHOT_PATH)tools/genapi/GenAPI.exe
 MONO_API_SNAPSHOT_PROFILE_PATH := $(MONO_API_SNAPSHOT_PATH)profiles/$(PROFILE)/
-MONO_API_ASSEMBLIES_IGNORED := $(addprefix $(topdir)class/lib/$(PROFILE)/, SystemWebTestShim.dll standalone-runner-support.dll nunit.core.dll nunit.core.extensions.dll nunit.core.interfaces.dll nunit.framework.dll nunit.framework.extensions.dll nunit.mocks.dll nunit.util.dll nunit-console-runner.dll nunitlite.dll)
+MONO_API_ASSEMBLIES_IGNORED := $(addprefix $(topdir)class/lib/$(PROFILE)/, Mono.CSharp.dll SystemWebTestShim.dll standalone-runner-support.dll nunit.core.dll nunit.core.extensions.dll nunit.core.interfaces.dll nunit.framework.dll nunit.framework.extensions.dll nunit.mocks.dll nunit.util.dll nunit-console-runner.dll nunitlite.dll)
 MONO_API_ASSEMBLIES := $(filter-out $(MONO_API_ASSEMBLIES_IGNORED), $(wildcard $(topdir)class/lib/$(PROFILE)/*.dll)) $(wildcard $(topdir)class/lib/$(PROFILE)/Facades/*.dll)
 MONO_API_ASSEMBLIES_CS := $(MONO_API_ASSEMBLIES:$(topdir)class/lib/$(PROFILE)/%.dll=$(MONO_API_SNAPSHOT_PROFILE_PATH)%.cs)
 
index f23a12d69bfe078c688a21ac954522a7a7fe3ece..c670f181f19609fd716a8e484c1db9d46c8c99d2 100644 (file)
@@ -19,31 +19,34 @@ package module which drives the compilation of this directory.
        class/
                The class libraries.
 
+       docs/
+               Some notes on the compiler and the class libraries.
+
        errors/
                Sample programs that should generate errors by the C# compiler.
 
+       ilasm/
+               The IL assembler.
+
        jay/
                Yacc-based parser generator.
 
        mcs/
                The Mono C# compiler
 
-       tests/
-               Regression test suite for the C# compiler
+       nunit24/
+               An old copy of the NUnit 2.4 library that we ship for historical reasons.
 
-       docs/
-               Some notes on the compiler and the class libraries.
+       packages/
+               Integrates some packages from NuGet (like Roslyn) into the build system.
 
-       nant/
-               A copy of nant source code, used during the build process
-               on Windows.
+       tests/
+               Regression test suite for the C# compiler
 
        tools/
                Various small development tools: CorCompare used to compare
-               two assemblies for differences in the API;   TypeReflector is 
-               a tool used to introspect types from assemblies from the 
-               command line;  MonoStyle helps you keep your code indendented
-               with the Mono programming style.
+               two assemblies for differences in the API; csharp is a C# REPL;
+               cil-strip trims IL from assemblies.
 
 * Building Individual Directories
 =================================
@@ -51,14 +54,14 @@ package module which drives the compilation of this directory.
 You can build individual components in the hierarchy by running the command
 "make", and to install it use "make install".
 
-By default, the 2.x profile is built, if you want to build the net 1.1 profile,
+By default, the 4.x profile is built, if you want to build other profiles,
 use the following command:
 
-       make PROFILE=net_1_1
+       make PROFILE=<profilename>
 
 And to install:
 
-       make PROFILE=net_1_1 install
+       make PROFILE=<profilename> install
 
 To turn on verbose mode in the build (for example to diagnose a
 problem), you can use the V=1 flag, like this:
@@ -68,16 +71,14 @@ problem), you can use the V=1 flag, like this:
 * Running Unit tests
 ====================
 
-You can run unit tests in individual components by running the command
-"make run-test".  If you want to run tests for a different profile (say
-'net_1_1')
+You can run unit tests in individual components by running the command:
 
-       make run-test PROFILE=net_1_1
+       make run-test
 
 If you want to only run the tests in a single fixture (say
 'MonoTests.System.TypeTest'), you can use
 
-       make run-test TEST_HARNESS_FLAGS=/fixture:MonoTests.System.TypeTest
+       make run-test TEST_FIXTURE=System.TypeTest
 
 * Acknowledgements
 ==================
diff --git a/mcs/build/build.proj b/mcs/build/build.proj
deleted file mode 100644 (file)
index 725fcd0..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>\r
-<Project ToolsVersion="3.5" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
-  <Import Project="$(MSBuildExtensionsPath)\ExtensionPack\MSBuild.ExtensionPack.tasks"/>\r
-  <Target Name="Build">\r
-   <Copy SourceFiles="common\Consts.cs.in" DestinationFiles="common\Consts.cs"/>\r
-   <MSBuild.ExtensionPack.FileSystem.File TaskAction="Replace" RegexPattern="@MONO_VERSION@" Replacement="2.7.0.0" Files="common\Consts.cs"/>\r
-  </Target>\r
-</Project>
\ No newline at end of file
diff --git a/mcs/build/msbuild/.gitattributes b/mcs/build/msbuild/.gitattributes
deleted file mode 100644 (file)
index 1238039..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-/Mono.Common.targets -crlf
-/Mono.Default.targets -crlf
diff --git a/mcs/build/msbuild/Mono.Common.targets b/mcs/build/msbuild/Mono.Common.targets
deleted file mode 100644 (file)
index e4211cb..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>\r
-<Project ToolsVersion="3.5" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
-  <Import Project="$(MSBuildExtensionsPath)\ExtensionPack\MSBuild.ExtensionPack.tasks"/>\r
-  <PropertyGroup  Condition=" '$(USE_MONO_COMPILER)' == '1' ">\r
-    <CscToolExe>gmcs.bat</CscToolExe>\r
-    <CscToolPath>C:\MonoExperimental2.5.0\bin</CscToolPath>\r
-  </PropertyGroup>\r
-  <PropertyGroup Condition=" ('$(Configuration)' == 'basic' Or '$(Configuration)' == 'basic_XML_DEP') ">\r
-    <OutputPath Condition=" '$(OutputPath)' == '' ">$(MSBuildProjectDirectory)\..\lib\basic\</OutputPath>\r
-  </PropertyGroup>\r
-  <PropertyGroup Condition=" '$(Configuration)' == 'net_2_0_bootstrap' ">\r
-    <OutputPath Condition=" '$(OutputPath)' == '' ">$(MSBuildProjectDirectory)\..\lib\net_2_0_bootstrap\</OutputPath>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
-    <OutputPath Condition=" '$(OutputPath)' == '' ">$(MSBuildProjectDirectory)\..\lib\$(Configuration)\</OutputPath>\r
-  </PropertyGroup>\r
-  <Target Name="SetupProject">\r
-    <Copy SourceFiles="$(ResponseFile)" DestinationFiles="$(ResponseFile).msbuild"/>\r
-         <MSBuild.ExtensionPack.FileSystem.File TaskAction="Replace" RegexPattern="/" Replacement="\" Files="$(ResponseFile).msbuild"/>\r
-         <MakeDir Directories="$(OutputDirectory)"/>\r
-  </Target>\r
-  <PropertyGroup Condition=" '$(ResponseFile)' == '' ">\r
-    <ResponseFile>$(MSBuildProjectName).dll.sources</ResponseFile>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
-    <CompilerResponseFile>$(ResponseFile).msbuild</CompilerResponseFile>\r
-  </PropertyGroup>\r
-</Project>
\ No newline at end of file
diff --git a/mcs/build/msbuild/Mono.Default.targets b/mcs/build/msbuild/Mono.Default.targets
deleted file mode 100644 (file)
index 43eda68..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>\r
-<Project ToolsVersion="3.5" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
-  <PropertyGroup>\r
-    <Configuration Condition="'$(Configuration)' == ''">net_2_0</Configuration>\r
-    <Platform Condition="'$(Platform)' == ''">AnyCPU</Platform>\r
-  </PropertyGroup>\r
-</Project>
\ No newline at end of file
index 1e5edbca35512ba2fd936643af62208350906153..ef393d92d0309bb5ebd7b36944b07d07d804ab76 100644 (file)
@@ -1,6 +1,6 @@
 # -*- makefile -*-
 
-monolite_path := $(topdir)/class/lib/monolite/$(MONO_CORLIB_VERSION)
+monolite_path := $(topdir)/class/lib/monolite-$(BUILD_PLATFORM)/$(MONO_CORLIB_VERSION)
 
 with_mono_path_monolite = MONO_PATH="$(monolite_path)$(PLATFORM_PATH_SEPARATOR)$(monolite_path)/Facades$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH"
 
@@ -90,7 +90,7 @@ ifdef use_monolite
 do-get-monolite:
 
 do-profile-check-monolite:
-       @echo "*** The contents of your 'monolite/$(MONO_CORLIB_VERSION)' directory may be out-of-date" 1>&2
+       @echo "*** The contents of your 'monolite-$(BUILD_PLATFORM)/$(MONO_CORLIB_VERSION)' directory may be out-of-date" 1>&2
        @echo "*** You may want to try 'make get-monolite-latest'" 1>&2
        rm -f $(monolite_flag)
        exit 1
@@ -98,12 +98,12 @@ do-profile-check-monolite:
 else
 
 do-get-monolite:
-       @echo "*** Downloading bootstrap required 'monolite/$(MONO_CORLIB_VERSION)'" 1>&2
-       $(MAKE) $(MAKE_Q) -C $(mono_build_root) get-monolite-latest
+       @echo "*** Downloading bootstrap required 'monolite-$(BUILD_PLATFORM)/$(MONO_CORLIB_VERSION)'" 1>&2
+       $(MAKE) $(MAKE_Q) -C $(topdir)/class get-monolite-latest
 
 do-profile-check-monolite: $(depsdir)/.stamp
        @echo "*** The runtime '$(PROFILE_RUNTIME)' doesn't appear to be usable." 1>&2
-       @echo "*** Trying the 'monolite/$(MONO_CORLIB_VERSION)' directory." 1>&2
+       @echo "*** Trying the 'monolite-$(BUILD_PLATFORM)/$(MONO_CORLIB_VERSION)' directory." 1>&2
        @echo dummy > $(monolite_flag)
        $(MAKE) do-profile-check
 
index 8acb248d669de1674e924290707cc41603d2ba84..17d550e0f22c7d3d8ab9ba4af05476d6b8e8240c 100644 (file)
@@ -6,12 +6,14 @@ BUILD_TOOLS_PROFILE = basic
 BOOTSTRAP_MCS = MONO_PATH="$(topdir)/class/lib/$(BOOTSTRAP_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(INTERNAL_CSC)
 MCS = $(BOOTSTRAP_MCS)
 
+PLATFORMS = darwin linux win32
+
 # nuttzing!
 
 profile-check:
        @:
 
-DEFAULT_REFERENCES = -r:$(topdir)/class/lib/$(PROFILE)/mscorlib.dll
+DEFAULT_REFERENCES = -r:$(topdir)/class/lib/$(PROFILE_DIRECTORY)/mscorlib.dll
 PROFILE_MCS_FLAGS = -d:NET_4_0 -d:NET_4_5 -d:MONO -d:WIN_PLATFORM -nowarn:1699 -nostdlib $(DEFAULT_REFERENCES)
 
 NO_SIGN_ASSEMBLY = yes
index b73af545a679fb4dbb0844eadf48d8cb4bc13118..2e66d59b310a19068767ae82a25a483cd781b4af 100644 (file)
@@ -2,6 +2,8 @@
 
 include $(topdir)/build/profiles/net_4_x.make
 
+PLATFORMS:=
+
 PARENT_PROFILE = ../net_4_x$(if $(PROFILE_PLATFORM),-$(PROFILE_PLATFORM))/
 DEFAULT_REFERENCES = -r:$(topdir)/class/lib/net_4_x$(if $(PROFILE_PLATFORM),-$(PROFILE_PLATFORM))/mscorlib.dll
 PROFILE_MCS_FLAGS += -d:XBUILD_12
index 97d46c50274e317ed2ce44b50d95c96fde32a24b..fd336eb81764406f72cc0092b8a94895d14927d3 100644 (file)
@@ -1,25 +1 @@
-The MIT X11 License covers most of the class libraries in the Mono
-project.  Some third party libraries come from different projects, and
-are licensed under their own terms.
-
-
-Copyright (c) 2001, 2002, 2003 The Mono Project
-
-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.
+See LICENSE file in the project root for full license information.
index a9610f239c370c8fce0ce666b39e40cec19a8c08..eb3b7b09ce2ca22311f0524732326e4cff6deb7a 100644 (file)
@@ -381,8 +381,7 @@ DISTFILES = \
        MicrosoftAjaxLibrary/License.htm        \
        test-helpers/NetworkHelpers.cs  \
        test-helpers/SocketResponder.cs \
-       lib/$(monolite_dir)/mcs.exe   \
-       $(monolite_files)
+       $(foreach HOST_PLATFORM,darwin linux win32,lib/$(monolite_dir)/mcs.exe $(monolite_files))
 
 .PHONY: all-local $(STD_TARGETS:=-local)
 all-local $(STD_TARGETS:=-local):
@@ -390,7 +389,7 @@ all-local $(STD_TARGETS:=-local):
 
 all-local-aot:
 
-monolite_dir := monolite/$(MONO_CORLIB_VERSION)
+monolite_dir = monolite-$(HOST_PLATFORM)/$(MONO_CORLIB_VERSION)
 
 # Files needed to bootstrap C# compiler
 build_files = mscorlib.dll System.dll System.Xml.dll Mono.Security.dll System.Core.dll System.Security.dll System.Configuration.dll \
@@ -413,24 +412,42 @@ lib/$(monolite_dir)/Facades:
 
 $(monolite_files): | lib/$(monolite_dir)
 $(monolite_files): | lib/$(monolite_dir)/Facades
-$(monolite_files): lib/$(monolite_dir)/%: lib/build/%
+$(monolite_files): lib/$(monolite_dir)/%: lib/build-$(HOST_PLATFORM)/%
        cp -p $< $@
 
 lib/$(monolite_dir)/mcs.exe:
        $(MAKE) -C ../mcs PROFILE=build
-       cp -p lib/build/mcs.exe lib/$(monolite_dir)
+       cp -p lib/build-$(HOST_PLATFORM)/mcs.exe lib/$(monolite_dir)
 
-$(build_files:%=lib/build/%):
+$(build_files:%=lib/build-$(HOST_PLATFORM)/%):
        cd $(topdir) && $(MAKE) profile-do--build--all NO_DIR_CHECK=1 SKIP_AOT=1
 
 dist-monolite: $(monolite_files) lib/$(monolite_dir)/mcs.exe
 
+dist-monolite-all-platforms:
+       $(MAKE) dist-monolite HOST_PLATFORM=darwin
+       $(MAKE) dist-monolite HOST_PLATFORM=linux
+       $(MAKE) dist-monolite HOST_PLATFORM=win32
+
 package-monolite-latest:
-       MONOLITE=monolite-$(MONO_CORLIB_VERSION)-latest; \
+       MONOLITE=monolite-$(HOST_PLATFORM)-$(MONO_CORLIB_VERSION)-latest; \
        $(MAKE) dist-monolite monolite_dir=$$MONOLITE; \
        tar zcvpf $$MONOLITE.tar.gz --directory=lib $$MONOLITE/
 
-dist-default: dist-monolite
+package-monolite-latest-all-platforms:
+       $(MAKE) package-monolite-latest HOST_PLATFORM=darwin
+       $(MAKE) package-monolite-latest HOST_PLATFORM=linux
+       $(MAKE) package-monolite-latest HOST_PLATFORM=win32
+
+monolite_url = https://download.mono-project.com/monolite/monolite-$(BUILD_PLATFORM)-$(MONO_CORLIB_VERSION)-latest.tar.gz
+
+get-monolite-latest:
+       -rm -fr lib/monolite-$(BUILD_PLATFORM)/$(MONO_CORLIB_VERSION)
+       -mkdir -p lib/monolite-$(BUILD_PLATFORM)
+       cd lib && { (wget -O- $(monolite_url) || curl -L $(monolite_url)) | gzip -d | tar xf - ; }
+       cd lib && mv -f monolite-$(BUILD_PLATFORM)-$(MONO_CORLIB_VERSION)-latest monolite-$(BUILD_PLATFORM)/$(MONO_CORLIB_VERSION)
+
+dist-default: dist-monolite-all-platforms
 
 dist-local: dist-default
 
index 5654252415d15a297b8a808e5598932798dac170..66fb7f232c06fb637dee60fed3b8008ac3d5e662 100644 (file)
@@ -67,33 +67,34 @@ namespace Mono.CodeContracts.Rewrite {
                        if (options.Debug && options.WritePdbFile)
                                readerParameters.ReadSymbols = true;
 
-                       var assembly = this.options.Assembly.IsFilename ?
+                       using (var assembly = this.options.Assembly.IsFilename ?
                                AssemblyDefinition.ReadAssembly (options.Assembly.Filename, readerParameters) :
-                               AssemblyDefinition.ReadAssembly (options.Assembly.Streams.Assembly, readerParameters);
+                               AssemblyDefinition.ReadAssembly (options.Assembly.Streams.Assembly, readerParameters)) {
                        
-                       if (this.options.ForceAssemblyRename != null) {
-                               assembly.Name.Name = this.options.ForceAssemblyRename;
-                       } else if (this.options.OutputFile.IsSet && this.options.OutputFile.IsFilename) {
-                               assembly.Name.Name = Path.GetFileNameWithoutExtension(this.options.OutputFile.Filename);
-                       }
+                               if (this.options.ForceAssemblyRename != null) {
+                                       assembly.Name.Name = this.options.ForceAssemblyRename;
+                               } else if (this.options.OutputFile.IsSet && this.options.OutputFile.IsFilename) {
+                                       assembly.Name.Name = Path.GetFileNameWithoutExtension(this.options.OutputFile.Filename);
+                               }
 
-                       var output = this.options.OutputFile.IsSet ? this.options.OutputFile : this.options.Assembly;
-                       var writerParameters = new WriterParameters ();
-                       if (options.WritePdbFile) {
-                               if (!options.Debug) {
-                                       return RewriterResults.Error ("Must specify -debug if using -writePDBFile.");
+                               var output = this.options.OutputFile.IsSet ? this.options.OutputFile : this.options.Assembly;
+                               var writerParameters = new WriterParameters ();
+                               if (options.WritePdbFile) {
+                                       if (!options.Debug) {
+                                               return RewriterResults.Error ("Must specify -debug if using -writePDBFile.");
+                                       }
+                                       
+                                       writerParameters.WriteSymbols = true;
                                }
                                
-                               writerParameters.WriteSymbols = true;
-                       }
-                       
-                       PerformRewrite rewriter = new PerformRewrite (this.options);
-                       rewriter.Rewrite (assembly);
+                               PerformRewrite rewriter = new PerformRewrite (this.options);
+                               rewriter.Rewrite (assembly);
 
-                       if (output.IsFilename) {
-                               assembly.Write (output.Filename, writerParameters);
-                       } else {
-                               assembly.Write (output.Streams.Assembly, writerParameters);
+                               if (output.IsFilename) {
+                                       assembly.Write (output.Filename, writerParameters);
+                               } else {
+                                       assembly.Write (output.Streams.Assembly, writerParameters);
+                               }
                        }
                
                        return new RewriterResults (warnings, errors);
index 04c7c6e0bac66e0025ceb32c011f9ac79030eac8..adc51def4e2582f4a128de74795272740659602a 100644 (file)
@@ -72,7 +72,7 @@ namespace Mono.CodeContracts.Static.AST {
 
                public static AssemblyNode ReadAssembly (string filename)
                {
-                       var readerParameters = new ReaderParameters ();
+                       var readerParameters = new ReaderParameters () { InMemory = true };
                        AssemblyDefinition definition = AssemblyDefinition.ReadAssembly (filename, readerParameters);
 
                        return new AssemblyNode (definition);
index 421c04da2bfd3b360a1fd5f2c9b17adfde0b221e..b2692bf692724cbc3ff567cbf467e26cb8424e81 100644 (file)
@@ -35,15 +35,6 @@ testing.
        of comments in the source code for that purpose, and if the
        problem requires to be followed up on, file a bug.
 
-* Supporting .NET 1.2, .NET 1.1 and .NET 1.0 builds
-
-       The defines NET_1_1 and NET_2_0 are used to include
-       features.   When NET_2_0 is defined, it also implies that the
-       NET_1_1 is defined.
-
-       To have code which is only available in an old version, use ONLY_1_0,
-       ONLY_1_1
-
 * Tagging buggy code
 
        If there is a bug in your implementation tag the problem by using
@@ -69,255 +60,8 @@ testing.
        not only stupid, but leading to unreliable code).
 
        In those cases, use the keyword "LAMESPEC".
-       
 
 * Coding considerations and style.
 
        In order to keep the code consistent, please use the following
-       conventions.  From here on `good' and `bad' are used to attribute
-       things that would make the coding style match, or not match.  It is not
-       a judgement call on your coding abilities, but more of a style and 
-       look call.  Please try to follow these guidelines to ensure prettiness.
-
-       Use 8 space tabs for writing your code (hopefully we can keep
-       this consistent).  If you are modifying someone else's code, try
-       to keep the coding style similar.
-
-       Since we are using 8-space tabs, you might want to consider the Linus
-       Torvals trick to reduce code nesting.  Many times in a loop, you will
-       find yourself doing a test, and if the test is true, you will nest.
-       Many times this can be changed.  Example:
-
-
-               for (i = 0; i < 10; i++) {
-                       if (something (i)) {
-                               do_more ();
-                       }
-               }
-
-       This take precious space, instead write it like this:
-
-               for (i = 0; i < 10; i++) {
-                       if (!something (i))
-                               continue;
-                       do_more ();
-               }
-
-       A few guidelines:
-
-               * Use a space before an opening parenthesis when calling
-                 functions, or indexing, like this:
-
-                       method (a);
-                       b [10];
-
-               * Do not put a space after the opening parenthesis and the 
-                 closing one, ie:
-
-                       good: method (a);       array [10];
-
-                       bad:  method ( a );     array[ 10 ];
-
-               * Inside a code block, put the opening brace on the same line
-                 as the statement:
-
-                       good:
-                               if (a) {
-                                       code ();
-                                       code ();
-                               }
-
-                       bad:
-                               if (a) 
-                               {
-                                       code ();
-                                       code ();
-                               }
-
-               * Avoid using unnecessary open/close braces, vertical space
-                 is usually limited:
-
-                       good:
-                               if (a)
-                                       code ();
-
-                       bad:
-                               if (a) {
-                                       code ();
-                               }
-
-               * When defining a method, use the C style for brace placement, 
-                 that means, use a new line for the brace, like this:
-
-                       good:
-                               void Method ()
-                               {
-                               }
-
-                       bad:
-                               void Method () {
-                               }
-
-               * Properties and indexers are an exception, keep the
-                 brace on the same line as the property declaration.
-                 Rationale: this makes it visually
-                 simple to distinguish them.
-
-                       good:
-                               int Property {
-                                       get {
-                                               return value;
-                                       }
-                               }
-
-                       bad:
-                               int Property 
-                               {
-                                       get {
-                                               return value;
-                                       }
-                               }
-
-                 Notice how the accessor "get" also keeps its brace on the same
-                 line.
-
-                 For very small properties, you can compress things:
-
-                       ok:
-                               int Property {
-                                       get { return value; }
-                                       set { x = value; }
-                               }
-
-               * Use white space in expressions liberally, except in the presence
-                 of parenthesis:
-
-                       good:
-
-                               if (a + 5 > method (blah () + 4))
-
-                       bad:
-                               if (a+5>method(blah()+4))
-
-               * For any new files, please use a descriptive introduction, like
-                 this:
-
-                       //
-                       // System.Comment.cs: Handles comments in System files.
-                       //
-                       // Author:
-                       //   Juan Perez (juan@address.com)
-                       //
-                       // (C) 2002 Address, Inc (http://www.address.com)
-                       //
-
-               * If you are modyfing someone else's code, and your contribution
-                 is significant, please add yourself to the Authors list.
-
-               * Switch statements have the case at the same indentation as the
-                 switch:
-
-                       switch (x) {
-                       case 'a':
-                               ...
-                       case 'b':
-                               ...
-                       }
-
-               * Argument names should use the camel casing for
-                 identifiers, like this:
-
-                       good:
-                               void Method (string myArgument)
-
-                       bad:
-                               void Method (string lpstrArgument)
-                               void Method (string my_string)
-
-               * Empty methods: They should have the body of code using two    
-                 lines, in consistency with the rest:
-
-                       good:
-                               void EmptyMethod ()
-                               {
-                               }
-
-                       bad:
-                               void EmptyMethod () {}
-
-                               void EmptyMethod () 
-                               {}
-               
-               * Line length: The line length for C# source code is 134 columns.
-
-
-                 If your function declaration arguments go beyond
-                 this point, please align your arguments to match the
-                 opening brace, like this:
-
-                       void Function (int arg, string argb,
-                                      int argc)
-                       {
-                       }
-        
-                 When invoking functions, the rule is different, the
-                 arguments are not aligned with the previous
-                 argument, instead they begin at the tabbed position,
-                 like this:
-         
-                       void M ()
-                       {
-                               MethodCall ("Very long string that will force",
-                                       "Next argument on the 8-tab pos",
-                                       "Just like this one")
-               
-                       }
-               
-       Here are a couple of examples:
-
-class X : Y {
-
-       bool Method (int argument_1, int argument_2)
-       {
-               if (argument_1 == argument_2)
-                       throw new Exception (Locale.GetText ("They are equal!");
-
-               if (argument_1 < argument_2) {
-                       if (argument_1 * 3 > 4)
-                               return true;
-                       else
-                               return false;
-               }
-
-               //
-               // This sample helps keep your sanity while using 8-spaces for tabs
-               // 
-               VeryLongIdentifierWhichTakesManyArguments (
-                       Argument1, Argument2, Argument3,
-                       NestedCallHere (
-                               MoreNested));
-       }
-
-       bool MyProperty {
-               get {
-                       return x;
-               }
-
-               set {
-                       x = value;
-               }
-       }
-
-       void AnotherMethod () 
-       {
-               if ((a + 5) != 4) {
-               }
-
-               while (blah) {
-                       if (a)
-                               continue;
-                       b++;
-               }
-       }
-}
-       
+       conventions: http://www.mono-project.com/community/contributing/coding-guidelines/
index f13e64122ace5db53316040604935379b3f4c7c7..1e05c08cfebc4e65d6d910e50613ac59a086b5a0 100644 (file)
@@ -6,7 +6,7 @@ LIBRARY = System.Numerics.dll
 LIB_REFS = System
 LIB_MCS_FLAGS = /unsafe
 TEST_MCS_FLAGS = $(LIB_MCS_FLAGS)
-XTEST_LIB_REFS = System Facades/System.Threading.Tasks System.Runtime.InteropServices.RuntimeInformation System.Core System.Numerics.Vectors Microsoft.CSharp
+XTEST_LIB_REFS = System Facades/System.Threading.Tasks Facades/System.Runtime.InteropServices.RuntimeInformation System.Core System.Numerics.Vectors Microsoft.CSharp
 XTEST_LIB_FLAGS = -unsafe
 
 RESX_RESOURCE_STRING = \
index 419035efe15fe3ad31aac61aa2ba427ccc397620..57c549fd2a23ddc44c6fe28c16ed6c84180c9d7e 100644 (file)
@@ -262,7 +262,6 @@ namespace System.Net.Sockets
                        SetResults(SocketError.Success, bytesTransferred, flags);
                        current_socket = connectSocket;
 
-                       Complete ();
                        OnCompleted (this);
                }
 
index 5be627d315adcad7f37fa37397e1d608bca3ade3..7ea0857b3466bb76cd43b6cd25c5806daefb971a 100644 (file)
@@ -5,7 +5,7 @@ include ../../build/rules.make
 XUNIT_LIBS := xunit.core xunit.abstractions xunit.execution.desktop xunit.assert
 
 LIBRARY = Xunit.NetCore.Extensions.dll
-LIB_REFS = System System.Core System.Runtime.InteropServices.RuntimeInformation Facades/System.Runtime Facades/System.Threading.Tasks
+LIB_REFS = System System.Core Facades/System.Runtime.InteropServices.RuntimeInformation Facades/System.Runtime Facades/System.Threading.Tasks
 LIB_MCS_FLAGS = $(patsubst %,-r:$(topdir)/../external/xunit-binaries/%.dll,$(XUNIT_LIBS))
 
 EXTRA_DISTFILES =
diff --git a/mcs/class/build-rx-dll-sources.sh b/mcs/class/build-rx-dll-sources.sh
deleted file mode 100644 (file)
index 0eeb671..0000000
+++ /dev/null
@@ -1,199 +0,0 @@
-
-// useful grep
-// grep -h "#if" /svn/mono/external/rx/Rx/NET/Source/System.Reactive.*/*.cs /svn/mono/external/rx/Rx/NET/Source/System.Reactive.*/*/*.cs /svn/mono/external/rx/Rx/NET/Source/System.Reactive.*/*/*/*.cs | sort | uniq
-
-using System.Diagnostics;
-using System.IO;
-using System.Xml.Linq;
-using System.Xml.XPath;
-
-var template_android = File.ReadAllText ("project_template_android.txt");
-var template_ios = File.ReadAllText ("project_template_ios.txt");
-
-var guids_android = new string [] { 
-// Ix
-"5F7F40B6-19D3-48C7-8E15-AE1F976F60E1", "065F2411-7610-4AD6-9513-A1EFFCE576C0",
-"C4037060-1692-4423-B29E-76F3A74A72A5",
-// Rx
-"4fa878dc-6e88-43c4-b37b-8c1151cec56f", "fef62c23-10cd-4def-a5ae-54a8b309e970", "d263c126-9d3c-4299-a0c1-f25c703d07c9", "ec704077-ea31-4852-ad24-6732244174c0", "9360e845-d79d-4288-9100-63a80fad2bf0", "00dc3654-e373-4e3f-80fe-109f795adf1f", "e662282b-4341-4f86-aaaa-a942335b47fb", "a153a379-670c-42c2-9018-fc0d933a4f7f", "b29d45a6-0b8c-49c5-82a2-457e4d3cbc33", "3a3b5e76-029f-46b0-9ccf-fefe06eb61e7", "328e4291-92f0-49de-a0fd-fbc714a47f53", "cb2ab716-bfcb-43bc-a03b-a3bda427746c", "73c5260f-8972-4e7c-822b-1a3a0358fa0b" };
-var guids_ios = new string [] {
-// Ix
-"AD6FCBE9-0F6A-4F27-8147-17AB1C8799A2", "220AD2F1-FEE9-4514-8F36-6BE37F0AAD7F",
-"4779C7FF-6969-4715-9389-DF6C43655D6F",
-// Rx
-"6f2675f5-fcc7-4a28-9dc3-657b4613dcc5", "a67f34b5-75c1-4319-a93e-93df87e728a4", "79a43ceb-1a18-49ea-aac4-b72b9c90bf5a", "0a977063-0796-4cd4-84b8-aedb2d648b26", "b41cb61a-dca0-4539-8f99-7b3499e18e6d", "24f995bd-7075-489c-b7a5-7fde08c304b6", "894021ec-14fb-430a-8572-bea9569ae435", "92857c8e-0e83-4d02-a831-8af3fed43336", "912e14a2-7bdf-4600-8d55-e8c4f33a2063", "0f6c2933-8d0c-41e6-9f77-e8714ab8c4ab", "1a476d81-f91a-448f-8790-f55498e013d2", "47d85a91-e8e2-4088-bf5a-68a161754d48", "45377009-1425-47fc-985e-05f98022f9e3" };
-
-var asses = new string [] {
-       "System.Interactive",
-       "System.Interactive.Async",
-       "System.Interactive.Providers",
-       "System.Reactive.Interfaces",
-       "System.Reactive.Core",
-       "System.Reactive.PlatformServices",
-       "System.Reactive.Linq",
-       "System.Reactive.Debugger", // maybe needed for testing assembly.
-       "System.Reactive.Experimental", // needed for testing assembly.
-       "System.Reactive.Providers",
-       "System.Reactive.Runtime.Remoting",
-       "System.Reactive.Windows.Forms",
-       "System.Reactive.Windows.Threading",
-       "System.Reactive.Observable.Aliases",
-       "Microsoft.Reactive.Testing",
-       "Tests.System.Reactive",
-       };
-
-var excluded_android_asses = new string [] {
-       "System.Reactive.Windows.Forms",
-       "System.Reactive.Windows.Threading",
-       };
-var excluded_ios_asses = new string [] {
-       "System.Reactive.Providers",
-       "System.Reactive.Windows.Forms",
-       "System.Reactive.Windows.Threading",
-       }
-
-var blacklist = new string [] {
-       // WPF Dispatcher.Invoke() is not implemented.
-       "DispatcherSchedulerTest.cs",
-       // This is not limited to Dispatcher, but many of them are relevant to it, or Winforms (we filter it out by not defining HAS_WINFORMS)
-       "ObservableConcurrencyTest.cs",
-       };
-
-int guid_idx = 0;
-foreach (var ass in asses) {
-
-       var ix = ass.Contains ("Interactive");
-
-       var dstAndroid = ix ? "../../external/rx/Ix/NET/Ix_Xamarin/android" :
-               "../../external/rx/Rx/NET/Source/Rx_Xamarin/android";
-       var dstIOS = ix ? "../../external/rx/Ix/NET/Ix_Xamarin/iOS" :
-               "../../external/rx/Rx/NET/Source/Rx_Xamarin/iOS";
-
-
-       var monoass = ass == "Microsoft.Reactive.Testing" ?
-               "Mono.Reactive.Testing" : ass;
-       var basePath = ix ? "../../external/rx/Ix/NET" :
-               "../../external/rx/Rx/NET/Source";
-       var csproj = Path.Combine (basePath, ass, ass + ".csproj");
-       var pathPrefix = ass == "Tests.System.Reactive" ? "../" : "";
-
-       var category = ix ? "Ix_Xamarin" : "Rx_Xamarin";
-       var category2 = ix ? "ix" : "rx";
-       var android_dir = Path.GetFullPath (Path.Combine (csproj, "..", "..", category, "android", category2, monoass));
-       var ios_dir = Path.GetFullPath (Path.Combine (csproj, "..", "..", category, "iOS", category2, monoass));
-       var android_proj = Path.Combine (android_dir, "android_" + monoass + ".csproj");
-       var ios_proj = Path.Combine (ios_dir, "ios_" + monoass + ".csproj");
-       if (!Directory.Exists (android_dir))
-               Directory.CreateDirectory (android_dir);
-       if (!Directory.Exists (ios_dir))
-               Directory.CreateDirectory (ios_dir);
-
-       // tests are built under Mono.Reactive.Testing directory.
-       
-       var sources =
-               monoass == "Tests.System.Reactive" ?
-               Path.Combine ("Mono.Reactive.Testing", "Mono.Reactive.Testing_test.dll.sources") :
-               Path.Combine (monoass, monoass + ".dll.sources");
-
-       var assdir = Path.Combine (monoass, "Assembly");
-       var assinfo = Path.Combine (monoass, "Assembly", "AssemblyInfo.cs");
-
-       var projectRefs = "";
-
-       if (monoass != "Tests.System.Reactive") {
-               if (!Directory.Exists (assdir))
-                       Directory.CreateDirectory (assdir);
-               using (var tw = File.CreateText (assinfo)) {
-                       //tw.WriteLine ("[assembly:System.Reflection.AssemblyVersion (\"2.1.30214.0\")]");
-                       //tw.WriteLine ("[assembly:System.Reflection.AssemblyFileVersion (\"2.1.30214.0\")]");
-               }
-       }
-
-       var sourcesXml = "";
-       var projectRefsXml = "";
-       var resourcesXml = "";
-
-       var doc = XDocument.Load (csproj);
-       var rootNS = doc.XPathSelectElement ("//*[local-name()='RootNamespace']").Value;
-       var guid = doc.XPathSelectElement ("//*[local-name()='ProjectGuid']").Value;
-
-       foreach (var e in doc.XPathSelectElements ("//*[local-name()='ProjectReference']"))
-               projectRefsXml += e;
-
-       Console.WriteLine ("Writing " + sources + " ...");
-       using (var tw = File.CreateText (sources)) {
-               if (monoass != "Tests.System.Reactive")
-                       tw.WriteLine ("Assembly/AssemblyInfo.cs");
-               foreach (var path in doc.XPathSelectElements ("//*[local-name()='Compile']")
-                       .Select (el => el.Attribute ("Include").Value)
-                       .Select (s => s.Replace ("\\", "/"))) {
-                       if (!blacklist.Any (b => path.Contains (b))) {
-                               var p = Path.Combine (ass, path);
-                               var p2 = Path.Combine ("..", basePath, ass, path);
-                               tw.WriteLine (Path.Combine (pathPrefix, p2));
-                               sourcesXml += "    <Compile Include=\"..\\..\\..\\..\\" + p.Replace ('/', '\\') + "\">\n      <Link>" + path.Replace ('/', '\\') + "</Link>\n    </Compile>\n";
-                       }
-               }
-       }
-
-       Console.WriteLine ("Writing more_build_args...");
-       var argsPath = Path.Combine (Path.GetDirectoryName (sources), "more_build_args");
-       using (var tw = File.CreateText (argsPath)) {
-               if (ass.StartsWith ("System")) {
-                       tw.WriteLine ("-d:SIGNED");
-                       tw.WriteLine ("-delaysign");
-                       tw.WriteLine ("-keyfile:../reactive.pub");
-               }
-
-               foreach (var path in doc.XPathSelectElements ("//*[local-name()='EmbeddedResource']")) {
-                       var res = path.Attribute ("Include").Value;
-                       var resx = Path.Combine (basePath, ass, res);
-                       var resFileName = res.Replace ("resx", "resources");
-                       var resxDest = Path.Combine (monoass, res);
-                       var resPath = Path.Combine (monoass, resFileName);
-                       if (File.Exists (resxDest))
-                               File.Delete (resxDest);
-                       File.Copy (resx, resxDest);
-                       //Process.Start ("resgen", String.Format ("{0} {1}", resx, resPath));
-                       tw.WriteLine ("-resource:{0},{1}.{2}", resFileName, rootNS, resFileName);
-                       var p = Path.Combine ("..", basePath, ass, res);
-                       resourcesXml += "    <EmbeddedResource Include='..\\..\\..\\..\\..\\..\\" + p + "'>\n      <Link>" + res + "</Link>\n    </EmbeddedResource>\n";
-               }
-       }
-       foreach (var f in new string [] { android_proj, ios_proj}) {
-               string prj_guid;
-               string template, prj_prefix, nunitProjRef, nunitRef;
-               var androidNUnit = "<ProjectReference Include=\"..\\..\\Andr.Unit\\Android.NUnitLite\\Android.NUnitLite.csproj\"><Project>{6A005891-A3D6-4398-A729-F645397D573A}</Project><Name>Android.NUnitLite</Name></ProjectReference>";
-               if (f == android_proj) {
-                       prj_guid = guids_android [guid_idx].ToUpper ();
-                       template = template_android;
-                       prj_prefix ="android_";
-                       nunitProjRef = ass.Contains ("Test") ? androidNUnit : "";
-                       nunitRef = "";
-               } else {
-                       prj_guid = guids_ios [guid_idx].ToUpper ();
-                       template = template_ios;
-                       prj_prefix ="ios_";
-                       nunitProjRef = "";
-                       nunitRef = ass.Contains ("Test") ? "<Reference Include='MonoTouch.NUnitLite' />" : "";
-               }
-               using (var tw = File.CreateText (f)) {
-                       tw.Write (template
-                               .Replace ("PROJECT_GUID_GOES_HERE", '{' + prj_guid + '}')
-                               .Replace ("ASSEMBLY_NAME_GOES_HERE", monoass)
-                               .Replace ("OPTIONAL_ANDROID_NUNITLITE", nunitProjRef)
-                               .Replace ("OPTIONAL_MONOTOUCH_NUNITLITE", nunitRef)
-                               .Replace ("PROJECT_REFERENCES_GO_HERE",
-                                       projectRefsXml
-                                               .Replace (" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\"", "")
-                                               .Replace ("Microsoft.Reactive.Testing", "Mono.Reactive.Testing")
-                                               .Replace ("System", prj_prefix + "System")
-                                               .Replace ("Mono", prj_prefix + "Mono")
-                                               .Replace ("Include=\"..\\" + prj_prefix, "Include=\"..\\"))
-                               .Replace ("RESOURCES_GO_HERE", resourcesXml.Replace ('\\', f == ios_proj ? '/' : '\\')) // whoa, BACKSLASH doesn't work only on android on MD/mac...!
-                               .Replace ("SOURCES_GO_HERE", sourcesXml.Replace ('\\', f == ios_proj ? '/' : '\\'))); // whoa, BACKSLASH doesn't work only on android on MD/mac...!
-               }
-       }
-       guid_idx++;
-}
-
diff --git a/mcs/class/corlib/LinkerDescriptor/mscorlib.xml b/mcs/class/corlib/LinkerDescriptor/mscorlib.xml
new file mode 100644 (file)
index 0000000..19c995b
--- /dev/null
@@ -0,0 +1,852 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<linker>
+       <assembly fullname="mscorlib">
+       
+               <!-- domain.c: mono_defaults.appdomain_class -->
+               <type fullname="System.AppDomain" preserve="fields">
+                       <method name="DoDomainUnload" />
+                       <!-- appdomain.c: mono_domain_try_type_resolve -->
+                       <method name="DoTypeResolve" />
+                       <!-- appdomain.c: mono_try_assembly_resolve -->
+                       <method name="DoAssemblyResolve" />
+                       <!-- appdomain.c: mono_domain_fire_assembly_load -->
+                       <method name="DoAssemblyLoad" />
+                       <!-- appdomain.c: mono_domain_try_unload -->
+                       <method name="DoDomainUnload" />
+                       <!-- marshal.c: mono_remoting_marshal_init -->
+                       <method name="InternalSetContext" />
+                       <!-- System.Runtime.Remoting/RemotingServices.cs: GetDomainProxy(AppDomain domain) -->
+                       <method name="GetMarshalledDomainObjRef" feature="remoting" />
+               </type>
+
+               <!-- appdomain.c: mono_runtime_init -->
+               <type fullname="System.AppDomainSetup" preserve="fields" />
+               
+               <!-- exception.c: mono_get_exception_appdomain_unloaded (used in several places), threadpool.c -->
+               <type fullname="System.AppDomainUnloadedException">
+                       <!-- mono_exception_from_name -->
+                       <method signature="System.Void .ctor()" />
+               </type>
+               
+               <!-- marshal.c: emit_marshal_custom (should not be used on devices)
+               <type fullname="System.ApplicationException" />
+               -->
+
+               <!-- exception.c (mono_get_exception_argument) -->
+               <type fullname="System.ArgumentException">
+                       <!-- mono_exception_from_name -->
+                       <method signature="System.Void .ctor()" />
+                       <!-- MONO_OBJECT_SETREF -->
+                       <field name="param_name" />
+               </type>
+        
+               <!-- exception.c (mono_get_exception_argument_null) -->
+               <type fullname="System.ArgumentNullException">
+                       <!-- mono_exception_from_name_msg -->
+                       <method signature="System.Void .ctor(System.String)" />
+               </type>
+
+               <!-- exception.c (mono_get_exception_argument_out_of_range) -->
+               <type fullname="System.ArgumentOutOfRangeException">
+                       <!-- mono_exception_from_name -->
+                       <method signature="System.Void .ctor()" />
+               </type>
+
+               <!-- exception.c (mono_get_exception_arithmetic) -->
+               <type fullname="System.ArithmeticException">
+                       <!-- mono_exception_from_name -->
+                       <method signature="System.Void .ctor()" />
+               </type>
+               
+               <!-- domain.c: mono_defaults.array_class -->
+               <type fullname="System.Array">
+                       <!-- InternalArray__%s_%s is used in aot-compiler.c -->
+                       <method name="InternalArray__ICollection_get_Count" />
+                       <method name="InternalArray__ICollection_get_IsReadOnly" />
+                       <method name="InternalArray__IEnumerable_GetEnumerator" />
+                       <method name="InternalArray__ICollection_Clear" />
+                       <method name="InternalArray__ICollection_Add" />
+                       <method name="InternalArray__ICollection_Remove" />
+                       <method name="InternalArray__ICollection_Contains" />
+                       <method name="InternalArray__ICollection_CopyTo" />
+                       <method name="InternalArray__Insert" />
+                       <method name="InternalArray__RemoveAt" />
+                       <method name="InternalArray__IndexOf" />
+                       <method name="InternalArray__get_Item" />
+                       <method name="InternalArray__set_Item" />
+                       <method name="InternalArray__IReadOnlyList_get_Item" />
+                       <method name="InternalArray__IReadOnlyCollection_get_Count" />
+               </type>
+               
+               <!-- mono/metadata/exception.c mono/metadata/marshal.c ... -->
+               <!-- exception.c (mono_get_exception_array_type_mismatch) -->
+               <type fullname="System.ArrayTypeMismatchException">
+                       <!-- mono_exception_from_name -->
+                       <method signature="System.Void .ctor()" />
+               </type>
+               
+               <!-- domain.c: mono_defaults.attribute_class -->
+               <!-- used in reflection.c to create array of attributes (no need to preserve everything beside the type itself) -->
+               <type fullname="System.Attribute" preserve="fields" />
+               
+               <!-- exception.c / mono-error.c -->
+               <type fullname="System.BadImageFormatException">
+                       <!-- mono_get_exception_bad_image_format / mono_exception_from_name_msg -->
+                       <method signature="System.Void .ctor(System.String)" />
+                       <!-- mono_get_exception_bad_image_format2 / mono_exception_from_name_two_strings -->
+                       <method signature="System.Void .ctor(System.String,System.String)" />
+               </type>
+               
+               <!-- domain.c: mono_defaults.boolean_class -->
+               <type fullname="System.Boolean" preserve="fields" />
+               
+               <!-- domain.c: mono_defaults.byte_class -->
+               <type fullname="System.Byte" preserve="fields" />
+               
+               <!-- exception.c" mono_get_exception_cannot_unload_appdomain (called by appdomain.c) -->
+               <type fullname="System.CannotUnloadAppDomainException">
+                       <!-- mono_exception_from_name_msg -->
+                       <method signature="System.Void .ctor(System.String)" />
+               </type>
+               
+               <!-- domain.c: mono_defaults.char_class -->
+               <type fullname="System.Char" preserve="fields" />
+
+               <!-- marshal.c: emit_marshal_vtype -->
+               <type fullname="System.DateTime" preserve="fields" />
+               
+               <!-- reflection.c: mono_get_dbnull_object / comment: Used as the value for ParameterInfo.DefaultValue -->
+               <type fullname="System.DBNull" preserve="fields" />
+               <type fullname="System.Decimal" preserve="fields" />
+               <!-- domain.c: mono_defaults.delegate_class -->
+               <type fullname="System.Delegate" preserve="fields" />
+               
+               <!-- domain.c: mono_defaults.stack_frame_class -->
+               <!-- used in mini-exceptions.c to create array and MonoStackFrame instance, i.e. only fields are required to be preserved -->
+               <type fullname="System.Diagnostics.StackFrame" preserve="fields" />
+               
+               <!-- domain.c: mono_defaults.stack_trace_class -->
+               <!-- does not seems used outside the g_assert in domain.c (maybe it could be removed) -->
+               <type fullname="System.Diagnostics.StackTrace" preserve="fields" />
+
+               <!-- debugger-agent.c: create_event_list -->
+               <type fullname="System.Diagnostics.DebuggerNonUserCodeAttribute"/>
+               <type fullname="System.Diagnostics.DebuggerHiddenAttribute"/>
+               <type fullname="System.Diagnostics.DebuggerStepThroughAttribute"/>
+
+               <!-- exception.c (mono_get_exception_divide_by_zero) -->
+               <type fullname="System.DivideByZeroException">
+                       <!-- mono_exception_from_name -->
+                       <method signature="System.Void .ctor()" />
+               </type>
+               
+               <!-- loader.c: returned (as a string) from mono_lookup_pinvoke_call and used in
+                               icall.c: prelink_method / mono_exception_from_name_msg
+                               marshal.c: mono_delegate_to_ftnptr and mono_marshal_get_native_wrapper
+               -->
+               <type fullname="System.DllNotFoundException">
+                       <!-- mono_exception_from_name_msg -->
+                       <method signature="System.Void .ctor(System.String)" />
+               </type>
+               
+               <!-- domain.c: mono_defaults.double_class -->
+               <type fullname="System.Double" preserve="fields" />
+               
+               <!-- domain.c: mono_defaults.enum_class -->
+               <type fullname="System.Enum" preserve="fields" />
+               
+               <!-- loader.c: returned (as a string) from mono_lookup_pinvoke_call and used in … -->
+               <type fullname="System.EntryPointNotFoundException">
+                       <!-- mono_exception_from_name_msg -->
+                       <method signature="System.Void .ctor(System.String)" />
+               </type>
+               
+               <type fullname="System.Environment">
+                       <!-- appdomain.c: mono_get_corlib_version -->
+                       <field name="mono_corlib_version" />
+                       <method name="get_StackTrace" />
+               </type>
+               
+               <!-- domain.c: mono_defaults.exception_class and fields are defined in object-internals.h -->
+               <type fullname="System.Exception" preserve="fields">
+                       <!-- used in mini-exceptions.c (if trace is enabled) -->
+                       <method name="get_Message" />
+               </type>
+               
+               <!-- exception.c (mono_get_exception_execution_engine) -->
+               <type fullname="System.ExecutionEngineException">
+                       <!-- mono_exception_from_name_msg -->
+                       <method signature="System.Void .ctor(System.String)" />
+               </type>
+
+               <type fullname="System.FieldAccessException">
+                       <!-- exception.c: mono_get_exception_field_access / mono_exception_from_name -->
+                       <method signature="System.Void .ctor()" />
+                       <!-- exception.c: mono_get_exception_field_access_msg / mono_exception_from_name_msg -->
+                       <!-- mini.c (mono_jit_compiler_method_inner) mono_exception_from_name_msg -->
+                       <method signature="System.Void .ctor(System.String)" />
+               </type>
+
+               <type fullname="System.FormatException">
+                       <!-- icall.c (base64_to_byte_array) mono_exception_from_name_msg -->
+                       <method signature="System.Void .ctor(System.String)" />
+               </type>
+               
+               <!-- exception.c: mono_get_exception_index_out_of_range - used by many in icall.c and in socket-io.c -->
+               <type fullname="System.IndexOutOfRangeException">
+                       <!-- mono_exception_from_name_msg -->
+                       <method signature="System.Void .ctor(System.String)" />
+               </type>
+               
+               <!-- domain.c: mono_defaults.int16_class -->
+               <type fullname="System.Int16" preserve="fields" />
+               
+               <!-- domain.c: mono_defaults.int32_class -->
+               <type fullname="System.Int32" preserve="fields" />
+               
+               <!-- domain.c: mono_defaults.int64_class -->
+               <type fullname="System.Int64" preserve="fields" />
+               
+               <!-- domain.c: mono_defaults.int_class -->
+               <type fullname="System.IntPtr" preserve="fields" />
+               
+               <!-- exception.c (mono_get_exception_invalid_cast) -->
+               <type fullname="System.InvalidCastException">
+                       <!-- mono_exception_from_name -->
+                       <method signature="System.Void .ctor()" />
+               </type>
+               
+               <!-- marshal.c: emit several times using mono_mb_emit_exception_full -->
+               <!-- exception.c (mono_get_exception_invalid_operation) -->
+               <type fullname="System.InvalidOperationException">
+                       <!-- mono_exception_from_name_msg -->
+                       <method signature="System.Void .ctor(System.String)" />
+               </type>
+               
+               <!-- mini.c: mono_jit_compile_method_inner (looks like one case is JITted, AOT too) -->
+               <type fullname="System.InvalidProgramException">
+                       <!-- mono_exception_from_name_msg -->
+                       <method signature="System.Void .ctor(System.String)" />
+               </type>
+
+               <type fullname="System.MarshalByRefObject" preserve="fields" feature="remoting" />
+
+               <type fullname="System.MethodAccessException">
+                       <!-- exception.c: mono_get_exception_method_access / mono_exception_from_name -->
+                       <method signature="System.Void .ctor()" />
+                       <!-- exception.c: mono_get_exception_method_access_msg / mono_exception_from_name_msg -->
+                       <!-- mini.c (mono_jit_compiler_method_inner) mono_exception_from_name_msg -->
+                       <method signature="System.Void .ctor(System.String)" />
+               </type>
+               
+               <!-- mini.c (mono_jit_compiler_method_inner) / mono-error.c -->
+               <type fullname="System.MissingFieldException">
+                       <!-- mono_exception_from_name_msg -->
+                       <method signature="System.Void .ctor(System.String)" />
+               </type>
+        
+               <type fullname="System.MissingMethodException">
+                       <!-- mini.c (mono_jit_compiler_method_inner) mono_exception_from_name_msg -->
+                       <method signature="System.Void .ctor(System.String)" />
+                       <!-- exception.c (mono_get_exception_type_load) mono_exception_from_name_two_strings -->
+                       <method signature="System.Void .ctor(System.String,System.String)" />
+               </type>
+               
+               <!-- threadpool.c: mono_thread_pool_init (assert) -->
+               <type fullname="System.MonoAsyncCall" preserve="fields" />
+               <!-- mono-mlist.c (managed list): used in threadpool.c and gc.c -->
+               <type fullname="System.MonoListItem" preserve="fields" />
+               
+               <!-- domain.c: mono_defaults.type_class -->
+               <type fullname="System.MonoType" preserve="fields" />
+               
+               <!-- domain.c: mono_defaults.multicastdelegate_class -->
+               <type fullname="System.MulticastDelegate" preserve="fields" />
+               
+               <!-- exception.c (mono_get_exception_not_implemented) -->
+               <type fullname="System.NotImplementedException">
+                       <!-- mono_get_exception_not_implemented -->
+                       <method signature="System.Void .ctor(System.String)" />
+               </type>
+
+               <!-- exception.c (mono_get_exception_not_supported) -->
+               <type fullname="System.NotSupportedException">
+                       <!-- mono_get_exception_not_implemented -->
+                       <method signature="System.Void .ctor(System.String)" />
+               </type>
+        
+               <!-- appdomain.c (create_domain_objects) domain->null_reference_ex -->
+               <!-- exception.c (mono_get_exception_null_reference) -->
+               <type fullname="System.NullReferenceException">
+                       <!-- exception.c: mono_exception_from_name -->
+                       <method signature="System.Void .ctor()" />
+                       <!-- appdomain.c: mono_exception_from_name_two_strings (only one string in the signature since NULL is used as the 2nd parameter) -->
+                       <method signature="System.Void .ctor(System.String)" />
+               </type>
+               
+               <!-- domain.c: mono_defaults.nullable_class -->         
+               <type fullname="System.Nullable`1" preserve="fields">
+                       <!-- method-to-ir.c (handle_box) -->
+                       <method name="Box" />
+                       <!-- method-to-ir.c (handle_unbox_nullable) -->
+                       <method name="Unbox" />
+               </type>
+               
+               <!-- domain.c: mono_defaults.object_class -->
+               <type fullname="System.Object">
+                       <!-- class.c: initialize_object_slots -->
+                       <method name="Finalize" />
+                       <method name="GetHashCode" />
+                       <!-- needed for debugging -->
+                       <method name="obj_address" />
+                       <!-- TransparentProxy.cs, RemotingServices.cs -->
+                       <method name="FieldGetter" feature="remoting" />
+                       <method name="FieldSetter" feature="remoting" />
+               </type>
+               
+               <!-- appdomain.c (create_domain_objects) domain->out_of_memory_ex -->
+               <type fullname="System.OutOfMemoryException">
+                       <!-- mono_exception_from_name_two_strings (only one string in the signature since NULL is used as the 2nd parameter) -->
+                       <method signature="System.Void .ctor(System.String)" />
+                       <!-- exception.c: mono_get_exception_out_of_memory / mono_exception_from_name -->
+                       <method signature="System.Void .ctor()" />
+               </type>
+               
+               <!-- exception.c (mono_get_exception_overflow) -->
+               <type fullname="System.OverflowException">
+                       <!-- mono_exception_from_name -->
+                       <method signature="System.Void .ctor()" />
+               </type>
+
+               <!-- reflection.c: mono_get_reflection_missing_object -->
+               <type fullname="System.Reflection.Missing" preserve="field" />
+
+               <!-- domain.c: mono_defaults.argumenthandle_class -->           
+               <type fullname="System.RuntimeArgumentHandle" preserve="fields" />
+               
+               <!-- domain.c: mono_defaults.typefield_class -->
+               <type fullname="System.RuntimeFieldHandle" preserve="fields" />
+               
+               <!-- domain.c: mono_defaults.methodhandle_class -->
+               <type fullname="System.RuntimeMethodHandle" preserve="fields" />
+               
+               <!-- domain.c: mono_defaults.typehandle_class -->
+               <type fullname="System.RuntimeTypeHandle" preserve="fields" />
+               <!-- domain.c: mono_defaults.sbyte_class -->
+               <type fullname="System.SByte" preserve="fields" />
+               
+               <!-- domain.c: mono_defaults.single_class -->
+               <type fullname="System.Single" preserve="fields" />
+               
+               <!-- appdomain.c (create_domain_objects) domain->stack_overflow_ex -->
+               <type fullname="System.StackOverflowException">
+                       <!-- mono_exception_from_name_two_strings (only one string in the signature since NULL is used as the 2nd parameter) -->
+                       <method signature="System.Void .ctor(System.String)" />
+                       <!-- exception.c: mono_get_exception_stack_overflow / mono_exception_from_name -->
+                       <method signature="System.Void .ctor()" />
+               </type>
+               
+               <!-- object.c: mono_runtime_exec_main -->
+               <type fullname="System.STAThreadAttribute" />
+               
+               <!-- domain.c: mono_defaults.string_class -->
+               <type fullname="System.String" preserve="fields">
+                       <!-- marshal.c mono_marshal_get_native_wrapper -->
+                       <method name="CreateString" />
+                       <!-- method-to-ir.c: mini_redirect_call -->
+                       <method name="InternalAllocateStr" />
+                       <!-- method-to-it.c: mini_emit_initobj -->
+                       <method name="memset" />
+                       <!-- mini-generic-sharing.c: class_type_info 
+                               All patterns bellow
+                       -->
+                       <method name="bzero" />
+                       <method name="bzero_aligned_1" />
+                       <method name="bzero_aligned_2" />
+                       <method name="bzero_aligned_4" />
+                       <method name="bzero_aligned_8" />
+                       <method name="memcpy" />
+                       <method name="memcpy_aligned_1" />
+                       <method name="memcpy_aligned_2" />
+                       <method name="memcpy_aligned_4" />
+                       <method name="memcpy_aligned_8" />
+               </type>
+
+               <!-- socket-io.c: created/raised several time -->
+               <type fullname="System.SystemException">
+                       <!-- mono_exception_from_nameg -->
+                       <method signature="System.Void .ctor()" />
+               </type>
+               
+               <!-- domain.c: mono_defaults.systemtype_class -->
+               <type fullname="System.Type" preserve="fields">
+                       <!-- marshal.c (mono_marshal_get_synchronized_wrapper) -->
+                       <method name="GetTypeFromHandle" />
+               </type>
+               
+               <!-- exception.c (mono_get_exception_type_initialization) -->
+               <type fullname="System.TypeInitializationException">
+                       <!-- iterates to find the (only) 2 paramaters .ctor -->
+                       <method signature="System.Void .ctor(System.String,System.Exception)" />
+               </type>
+
+               <!-- exception.c (mono_get_exception_type_load) -->
+               <type fullname="System.TypeLoadException">
+                       <!-- mini.c (mono_jit_compiler_method_inner) mono_exception_from_name_msg -->
+                       <method signature="System.Void .ctor(System.String)" />
+                       <!-- mono_exception_from_name_two_strings -->
+                       <method signature="System.Void .ctor(System.String,System.String)" />
+               </type>
+               
+               <!-- domain.c: mono_defaults.typed_reference_class -->          
+               <type fullname="System.TypedReference" preserve="fields" />
+               
+               <!-- domain.c: mono_defaults.uint16_class -->
+               <type fullname="System.UInt16" preserve="fields" />
+               
+               <!-- domain.c: mono_defaults.uint32_class -->
+               <type fullname="System.UInt32" preserve="fields" />
+               
+               <!-- domain.c: mono_defaults.uint64_class -->
+               <type fullname="System.UInt64" preserve="fields" />
+               
+               <!-- domain.c: mono_defaults.uint_class -->
+               <type fullname="System.UIntPtr" preserve="fields" />
+               
+               <!-- object.c: create_unhandled_exception_eventargs (assert) -->
+               <type fullname="System.UnhandledExceptionEventArgs">
+                       <method signature="System.Void .ctor(System.Object,System.Boolean)" />
+               </type>
+               
+               <!-- class.c: make_generic_param_class -->
+               <type fullname="System.ValueType" preserve="fields" />
+
+               <!-- comiterop.c -->
+               <type fullname="System.Variant" preserve="fields" feature="com">
+                       <method name="Clear" />
+               </type>
+
+               <!-- icall.c: create_version is used by
+                       * ves_icall_System_Reflection_Assembly_GetReferencedAssemblies
+                       * fill_reflection_assembly_name
+                               * ves_icall_System_Reflection_Assembly_FillName
+                               * ves_icall_System_Reflection_Assembly_InternalGetAssemblyName
+                               * ves_icall_System_Reflection_AssemblyName_ParseName
+                       -->
+               <type fullname="System.Version">
+                       <method signature="System.Void .ctor(System.Int32,System.Int32,System.Int32,System.Int32)" />
+               </type>
+               
+               <!-- domain.c: mono_defaults.void_class -->
+               <type fullname="System.Void" preserve="fields" />
+
+               <!-- comiterop.c -->
+               <type fullname="System.__ComObject" feature="com" />
+
+               <!-- class.c: generic_array_methods -->
+               <type fullname="System.Collections.Generic.ICollection`1" />
+               <type fullname="System.Collections.Generic.IEnumerable`1" />
+               <type fullname="System.Collections.Generic.IReadOnlyList`1" />
+               <type fullname="System.Collections.Generic.IReadOnlyCollection`1" />
+               
+               <!-- domain.c: mono_defaults.generic_ilist_class -->
+               <type fullname="System.Collections.Generic.IList`1" />
+               
+               <!-- aot-compiler.c: add_generic_instances and add_generic_class_with_depth -->
+               <type fullname="System.Collections.Generic.GenericEqualityComparer`1">
+                       <method name=".ctor" />
+               </type>
+               
+               <!-- aot-compiler.c: add_generic_instances and add_generic_class_with_depth -->
+               <type fullname="System.Collections.Generic.GenericComparer`1">
+                       <method name=".ctor" />
+               </type>
+
+               <!-- icalls - but (at least parts of them) are used thru interfaces at runtime and cannot be linked out -->
+               <type fullname="System.Globalization.DateTimeFormatInfo" preserve="fields" />
+               <type fullname="System.Globalization.CompareInfo" preserve="fields" />
+               <type fullname="System.Globalization.CultureInfo" preserve="fields">
+                       <!-- icall.c: fill_reflection_assembly_name (assert) and ves_icall_System_Reflection_Assembly_GetReferencedAssemblies (assert) -->
+                       <method name="CreateCulture" />
+               </type>
+               <type fullname="System.Globalization.NumberFormatInfo" preserve="fields" />
+               <type fullname="System.Globalization.RegionInfo" preserve="fields" />
+               <type fullname="System.Globalization.SortKey" preserve="fields" />
+
+               <type fullname="System.IO.FileNotFoundException">
+                       <!-- mini.c (mono_jit_compiler_method_inner) mono_exception_from_name_msg -->
+                       <method signature="System.Void .ctor(System.String)" />
+                       <!-- exception.c (mono_get_exception_file_not_found and mono_get_exception_file_not_found) -->
+                       <!-- mono_exception_from_name_two_strings -->
+                       <method signature="System.Void .ctor(System.String,System.String)" />
+               </type>
+
+               <!-- exception.c (mono_get_exception_io) -->
+               <type fullname="System.IO.IOException">
+                       <!-- mono_exception_from_name_msg -->
+                       <method signature="System.Void .ctor(System.String)" />
+               </type>
+
+               <!-- fileio.h: shared structure between the managed and unmanaged worlds -->
+               <type fullname="System.IO.MonoIOStat" preserve="fields" />
+               
+               <!-- domain.c: mono_defaults.math_class
+                       method-to-ir.c: empty branch (wrt Min/Max optimization)
+                       mini-[x86|amd64].c needs the type but then only check for names
+                       note: there's no fields (static type) but that will mark the type itself -->
+               <type fullname="System.Math" preserve="fields" />
+
+               <type fullname="System.Reflection.MonoAssembly">
+                       <method name=".ctor" />
+               </type>
+               <type fullname="System.Reflection.MonoModule">
+                       <method name=".ctor" />
+               </type>
+
+               <!-- appdomain.c: ves_icall_System_AppDomain_GetAssemblies -->
+               <type fullname="System.Reflection.Assembly" preserve="fields">
+                       <method name="MonoDebugger_GetMethodToken" feature="sre" />
+                       <method name="GetNamespaces" feature="sre" />
+               </type>
+               <type fullname="System.Reflection.AssemblyName" preserve="fields" />
+               <type fullname="System.Reflection.ConstructorInfo" preserve="fields" />
+
+               <!-- domain.c: mono_defaults.customattribute_data_class -->
+               <type fullname="System.Reflection.CustomAttributeData" preserve="fields">
+                       <!-- custom-attrs.c: create_custom_attr_data - create an instance with the ctor using 4 arguments -->
+                       <method signature="System.Void .ctor(System.Reflection.ConstructorInfo,System.Reflection.Assembly,System.IntPtr,System.UInt32)" />
+               </type>
+
+               <!-- reflection.c: create_cattr_named_arg - create an instance with the ctor using 2 parameters -->
+               <type fullname="System.Reflection.CustomAttributeNamedArgument">
+                       <method signature="System.Void .ctor(System.Reflection.MemberInfo,System.Object)" />
+               </type>
+               
+               <!-- reflection.c: create_cattr_typed_arg - create an instance with the ctor using 2 parameters -->
+               <type fullname="System.Reflection.CustomAttributeTypedArgument">
+                       <method signature="System.Void .ctor(System.Type,System.Object)" />
+               </type>
+               <type fullname="System.Reflection.EventInfo" preserve="fields">
+                       <method name="AddEventFrame" />
+                       <method name="StaticAddEventAdapterFrame" />
+               </type>
+               
+               <!-- reflection.c: mono_method_body_get_object -->
+               <type fullname="System.Reflection.ExceptionHandlingClause" preserve="fields" />
+               
+               <!-- domain.c: mono_defaults.field_info_class -->
+               <type fullname="System.Reflection.FieldInfo" preserve="fields" />
+               
+               <!-- reflection.c: mono_method_body_get_object -->
+               <type fullname="System.Reflection.LocalVariableInfo" preserve="fields" />
+
+               <!-- reflection.c: mono_method_body_get_object -->
+               <type fullname="System.Reflection.MethodBody" preserve="fields" />
+               <!-- domain.c: mono_defaults.method_info_class -->
+               <type fullname="System.Reflection.MethodInfo" preserve="fields" />
+
+               <type fullname="System.Reflection.Module" preserve="fields" />
+               <type fullname="System.Reflection.MonoAssembly" preserve="fields" />
+               <type fullname="System.Reflection.MonoModule" preserve="fields" />
+               <type fullname="System.Reflection.MonoCMethod" preserve="fields" />
+               <type fullname="System.Reflection.MonoEvent" preserve="fields" />
+               <type fullname="System.Reflection.MonoEventInfo" preserve="fields" />
+               <type fullname="System.Reflection.MonoField" preserve="fields" />
+               
+               <!-- reflection.c: mono_method_get_object uses both MonoGeneric[C]Method / will crash for ves_icall_Type_GetConstructors_internal -->
+               <type fullname="System.Reflection.MonoGenericMethod" preserve="fields" />
+               <type fullname="System.Reflection.MonoGenericCMethod" preserve="fields" />
+               
+               <type fullname="System.Reflection.MonoMethod" preserve="fields" />
+               <type fullname="System.Reflection.MonoMethodInfo" preserve="fields" />
+               <type fullname="System.Reflection.MonoPropertyInfo" preserve="fields" />
+               
+               <type fullname="System.Reflection.MonoProperty" preserve="fields">
+                       <method name="GetterAdapterFrame" />
+                       <method name="StaticGetterAdapterFrame" />
+               </type>
+               <type fullname="System.Reflection.ParameterInfo" preserve="fields" />
+               <!-- reflection.c: ves_icall_get_parameter_info -->
+               <type fullname="System.Reflection.MonoParameterInfo" preserve="fields" />
+
+               <!-- object.c: mono_field_get_value_object and mono_runtime_invoke_array -->
+               <type fullname="System.Reflection.Pointer" >
+                       <method name="Box" />
+               </type>
+
+               <type fullname="System.Reflection.PropertyInfo" preserve="fields" />
+               
+               <!-- exception.c (mono_get_exception_reflection_type_load) -->
+               <type fullname="System.Reflection.ReflectionTypeLoadException">
+                       <method signature="System.Void .ctor(System.Type[],System.Exception[])" />
+               </type>
+
+               <!-- icall.c: ves_icall_InternalInvoke -->
+               <type fullname="System.Reflection.TargetException">
+                       <!-- mono_exception_from_name_msg -->
+                       <method signature="System.Void .ctor(System.String)" />
+               </type>
+        
+               <!-- icall.c: ves_icall_InternalInvoke -->
+               <type fullname="System.Reflection.TargetParameterCountException">
+                       <!-- mono_exception_from_name_msg -->
+                       <method signature="System.Void .ctor(System.String)" />
+               </type>
+
+               <type fullname="System.Reflection.Emit.AssemblyBuilder" preserve="fields" feature="sre">
+                       <method name="AddPermissionRequests" />
+                       <method name="AddModule" />
+                       <method name="DefineIconResource" />
+                       <method name="AddTypeForwarder" />
+                       <method name="EmbedResourceFile" />
+               </type>
+               <type fullname="System.Reflection.Emit.ConstructorBuilder" preserve="fields" feature="sre">
+                       <method name="RuntimeResolve" />
+               </type>
+               <type fullname="System.Reflection.Emit.CustomAttributeBuilder" preserve="fields" feature="sre" />
+               <type fullname="System.Reflection.Emit.DynamicMethod" preserve="fields" />
+               <type fullname="System.Reflection.Emit.EnumBuilder" preserve="fields" />
+               <type fullname="System.Reflection.Emit.EventBuilder" preserve="fields" />
+               <type fullname="System.Reflection.Emit.FieldBuilder" preserve="fields" >
+                       <method name="RuntimeResolve" />
+               </type>
+               <type fullname="System.Reflection.Emit.GenericTypeParameterBuilder" preserve="fields" feature="sre" >
+                       <method name="RuntimeResolve" />
+               </type>
+               <type fullname="System.Reflection.Emit.ILExceptionBlock" preserve="fields" feature="sre" />
+               <type fullname="System.Reflection.Emit.ILExceptionInfo" preserve="fields" />
+               <type fullname="System.Reflection.Emit.ILGenerator" preserve="fields">
+                       <method name="Mono_GetCurrentOffset" />
+               </type>
+               <type fullname="System.Reflection.Emit.LocalBuilder" preserve="fields" feature="sre" >
+                       <method name="Mono_GetLocalIndex" />
+               </type>
+               <type fullname="System.Reflection.Emit.MethodBuilder" preserve="fields" feature="sre" >
+                       <method name="RuntimeResolve" />
+               </type>
+               <type fullname="System.Reflection.Emit.ModuleBuilder" preserve="fields" feature="sre">
+                       <method name="Mono_GetGuid" />
+                       <method name="RuntimeResolve" />
+               </type>
+               <type fullname="System.Reflection.Emit.MonoResource" preserve="fields" feature="sre" />
+               <type fullname="System.Reflection.Emit.MonoWin32Resource" preserve="fields" feature="sre" />
+               <type fullname="System.Reflection.Emit.ParameterBuilder" preserve="fields" feature="sre" />
+               <type fullname="System.Reflection.Emit.PropertyBuilder" preserve="fields" feature="sre" />
+               <type fullname="System.Reflection.Emit.SignatureHelper" preserve="fields" feature="sre" />
+               <type fullname="System.Reflection.Emit.TypeBuilder" preserve="fields" feature="sre">
+                       <method name="SetCharSet" />
+                       <!-- reflection.c mono_reflection_call_is_assignable_to () -->
+                       <method name="IsAssignableTo" />
+               </type>
+               <type fullname="System.Reflection.Emit.UnmanagedMarshal" preserve="fields" feature="sre" >
+                       <method name="DefineCustom" />
+                       <method name="DefineLPArrayInternal" />
+               </type>
+               <type fullname="System.Reflection.Emit.TypeBuilderInstantiation" preserve="fields" feature="sre" >
+                       <method name="RuntimeResolve" />
+               </type>
+               <type fullname="System.Reflection.Emit.ArrayType" preserve="fields" feature="sre" >
+                       <method name="RuntimeResolve" />
+               </type>
+               <type fullname="System.Reflection.Emit.ByRefType" preserve="fields" feature="sre" >
+                       <method name="RuntimeResolve" />
+               </type>
+               <type fullname="System.Reflection.Emit.PointerType" preserve="fields" feature="sre" >
+                       <method name="RuntimeResolve" />
+               </type>
+               <type fullname="System.Reflection.Emit.FieldOnTypeBuilderInst" preserve="fields" feature="sre" >
+                       <method name="RuntimeResolve" />
+               </type>
+               <type fullname="System.Reflection.Emit.MethodOnTypeBuilderInst" preserve="fields" feature="sre" >
+                       <method name="RuntimeResolve" />
+               </type>
+               <type fullname="System.Reflection.Emit.ConstructorOnTypeBuilderInst" preserve="fields" feature="sre" >
+                       <method name="RuntimeResolve" />
+               </type>
+
+               <!-- domain.c: mono_defaults.internals_visible_class -->
+               <type fullname="System.Runtime.CompilerServices.InternalsVisibleToAttribute" />
+
+               <!-- exception.c: mono_get_exception_runtime_wrapped () -->
+               <type fullname="System.Runtime.CompilerServices.RuntimeWrappedException">
+                       <method signature="System.Void .ctor(System.Object)" />
+               </type>
+
+               <!-- icall.c | object-internal.h: MonoReflectionDllImportAttribute structure -->
+               <type fullname="System.Runtime.InteropServices.DllImportAttribute" preserve="fields"/> 
+               <!-- marshal.c: emit_marshal_custom (DISABLE_JIT is not defined for the AOT compiler, only the ARM runtimes) -->
+               <type fullname="System.Runtime.InteropServices.ICustomMarshaler" />
+
+               <!-- domain.c: mono_defaults.marshal_class -->
+               <type fullname="System.Runtime.InteropServices.Marshal" preserve="fields" >
+                       <!-- marshal.c (mono_marshal_get_struct_to_ptr) -->
+                       <method name="StructureToPtr" />
+               </type>
+               
+               <!-- domain.c: mono_defaults.safehandle_class -->
+               <type fullname="System.Runtime.InteropServices.SafeHandle" preserve="fields">
+                       <!-- marshal.c (init_safe_handle) -->
+                       <method name="DangerousAddRef" />
+                       <method name="DangerousRelease" />
+               </type>
+               
+               <!-- object-internals.h: defines MonoReflectionUnmanagedFunctionPointerAttribute, marshal.c: use it -->
+               <type fullname="System.Runtime.InteropServices.UnmanagedFunctionPointerAttribute" preserve="fields"/>
+
+               <!-- marshal.c: mono_mb_emit_exception_marshal_directive -->
+               <type fullname="System.Runtime.InteropServices.MarshalDirectiveException">
+                       <method signature="System.Void .ctor(System.String)" />
+               </type>
+
+               <!-- appdomain.c: mono_context_init -->
+               <!-- marshal.c: mono_remoting_marshal_init / removed with DISABLE_REMOTING -->
+               <type fullname="System.Runtime.Remoting.Contexts.Context" preserve="fields" feature="remoting" >
+                       <method name="get_NeedsContextSink" />
+               </type>
+
+               <!-- domain.c: mono_defaults.iremotingtypeinfo_class / removed with DISABLE_REMOTING -->
+               <type fullname="System.Runtime.Remoting.IRemotingTypeInfo" feature="remoting">
+                       <method name="CanCastTo" />
+               </type>
+
+               <!-- domain.c: mono_defaults.asyncresult_class (Stubify can't be applied on this type) -->
+               <!-- object.c MONO_OBJECT_SETREF in mono_async_result_new -->
+               <!-- threadpool.c: MONO_OBJECT_SETREF in create_simple_asyncresult -->
+               <type fullname="System.Runtime.Remoting.Messaging.AsyncResult" preserve="fields" />
+
+               <!-- marshal.c: mono_remoting_marshal_init / removed with DISABLE_REMOTING -->
+               <type fullname="System.Runtime.Remoting.Messaging.CallContext" feature="remoting" >
+                       <method name="SetCurrentCallContext" />
+               </type>
+               <type fullname="System.Runtime.Remoting.Messaging.MonoMethodMessage" preserve="fields" feature="remoting" >
+                       <method name="InitMessage" />
+               </type>
+               <type fullname="System.Runtime.Remoting.Proxies.RealProxy" preserve="fields" feature="remoting" >
+                       <method name="PrivateInvoke" />
+                       <method name="GetAppDomainTarget" />
+               </type>
+               <type fullname="System.Runtime.Remoting.Proxies.TransparentProxy" preserve="fields" feature="remoting" >
+                       <method name="LoadRemoteFieldNew" />
+                       <method name="StoreRemoteField" />
+               </type>
+               <type fullname="System.Runtime.Remoting.RemotingServices" feature="remoting" >
+                       <method name="SerializeCallData" />
+                       <method name="DeserializeCallData" />
+                       <method name="SerializeExceptionData" />
+               </type>
+
+               <!-- domain.c: mono_defaults.mono_method_message_class -->
+               <type fullname="System.Runtime.Remoting.Messaging.MonoMethodMessage" preserve="fields">
+                       <!-- object.c: mono_message_init -->
+                       <method name="InitMessage" />
+               </type>         
+
+               <!-- domain.c: mono_defaults.real_proxy_class / removed with DISABLE_REMOTING -->
+               <type fullname="System.Runtime.Remoting.Proxies.RealProxy" feature="remoting" />
+
+               <!-- domain.c: mono_defaults.transparent_proxy_class / removed with DISABLE_REMOTING -->
+               <type fullname="System.Runtime.Remoting.Proxies.TransparentProxy" feature="remoting" />
+
+               <!-- exception.c (mono_get_exception_serialization) -->
+               <type fullname="System.Runtime.Serialization.SerializationException">
+                       <!-- mono_exception_from_name_msg -->
+                       <method signature="System.Void .ctor(System.String)" />
+               </type>
+
+               <!-- domain.c: mono_defaults.runtimesecurityframe_class -->             
+               <type fullname="System.Security.RuntimeSecurityFrame" preserve="fields" />
+               
+               <!-- domain.c: mono_defaults.executioncontext_class -->
+               <type fullname="System.Threading.ExecutionContext">
+                       <!-- security-manager.c: mono_get_context_capture_method (can likely be removed) -->
+                       <method name="Capture" />
+               </type>
+
+               <!-- aot-runtime.c: mono_aot_get_method -->
+               <type fullname="System.Threading.Interlocked">
+                       <method name="CompareExchange" />
+                       <method name="Exchange" />
+               </type>
+               
+               <!-- domain.c: mono_defaults.monitor_class -->
+               <!-- monitor.c / method-to-ir.c: Enter and Exit are only string comparison (safe to link) -->
+               <type fullname="System.Threading.Monitor">
+                       <!-- marshal.c: mono_marshal_get_synchronized_wrapper-->
+                       <method name="Enter" />
+                       <method name="Exit" />
+               </type>
+
+               <!-- domain.c: mono_defaults.manualresetevent_class -->
+               <type fullname="System.Threading.ManualResetEvent" >
+                       <!-- runtime access fields and setter from inherited WaitHandle -->
+                       <method signature="System.Void .ctor(System.Boolean)" />
+               </type>
+
+               <!-- exception.c (mono_get_exception_synchronization_lock) -->
+               <type fullname="System.Threading.SynchronizationLockException">
+                       <!-- mono_exception_from_name_msg -->
+                       <method signature="System.Void .ctor(System.String)" />
+               </type>
+
+               <!-- domain.c: mono_defaults.thread_class -->
+               <type fullname="System.Threading.Thread" preserve="fields">
+                       <method name="get_CurrentContext" />
+               </type>
+               
+               <!-- domain.c: mono_defaults.internal_thread_class -->
+               <type fullname="System.Threading.InternalThread" preserve="fields" />
+               
+               <!-- domain.c: mono_defaults.threadabortexception_class -->
+               <!-- exception.c (mono_get_exception_thread_abort) -->
+               <type fullname="System.Threading.ThreadAbortException">
+                       <!-- mono_exception_from_name -->
+                       <method signature="System.Void .ctor()" />
+               </type>
+               
+               <!-- exception.c (ThreadInterruptedException) -->
+               <type fullname="System.Threading.ThreadInterruptedException">
+                       <!-- mono_exception_from_name -->
+                       <method signature="System.Void .ctor()" />
+               </type>
+
+               <!-- exception.c (mono_get_exception_thread_abort) -->
+               <type fullname="System.Threading.ThreadStateException">
+                       <!-- mono_exception_from_name_msg -->
+                       <method signature="System.Void .ctor(System.String)" />
+               </type>
+               
+               <!-- object-internals.h: defines MonoWaitHandle, threadpool.c: gets the handle from the structure -->
+               <type fullname="System.Threading.WaitHandle" preserve="fields">
+                       <!-- object.c: mono_wait_handle_new -->
+                       <method name="set_Handle" />
+                       <!-- object.c: mono_wait_handle_get_handle -->
+                       <field name="safe_wait_handle" />
+               </type>
+
+               <!-- threadpool-ms.c (worker_thread) -->
+               <type fullname="System.Threading._ThreadPoolWaitCallback">
+                 <method name="PerformWaitCallback"/>
+               </type>
+
+               <!-- domain.c: mono_defaults.stringbuilder_class -->
+               <type fullname="System.Text.StringBuilder" preserve="fields" />
+
+               <!-- cominterop.c -->
+               <type fullname="Mono.Interop.ComInteropProxy" feature="com" />
+               <type fullname="Mono.Interop.IDispatch" feature="com" />
+               <type fullname="Mono.Interop.IUnknown" feature="com"/>
+
+               <!--
+               Many applications rely on Mono.Runtime to exist in order to detect
+               whether they are running on Mono or .NET. Thus we always preserve it
+               to allow such detection logic to work, even if the class is not used
+               directly.
+               -->
+               <type fullname="Mono.Runtime" />
+
+               <!-- marshal.c (mono_marshal_get_native_wrapper) -->
+               <type fullname="Mono.RuntimeStructs/HandleStackMark" />
+               <!-- marshal.c (mono_marshal_get_native_wrapper) -->
+               <type fullname="Mono.RuntimeStructs/MonoError" />
+       </assembly>
+</linker>
index ba8f3e4015ec7ea8b546a4e9e4c9a07616ef8f15..cdaa7c43828437071fa5fcfcca69ee591c8042d2 100644 (file)
@@ -41,7 +41,8 @@ RESOURCE_FILES = \
        resources/collation.cjkCHT.bin \
        resources/collation.cjkJA.bin \
        resources/collation.cjkKO.bin \
-       resources/collation.cjkKOlv2.bin
+       resources/collation.cjkKOlv2.bin \
+       LinkerDescriptor/mscorlib.xml
 
 REFERENCE_SOURCES_FLAGS = -d:FEATURE_PAL,GENERICS_WORK,FEATURE_LIST_PREDICATES,FEATURE_SERIALIZATION,FEATURE_ASCII,FEATURE_LATIN1,FEATURE_UTF7,FEATURE_UTF32,MONO_HYBRID_ENCODING_SUPPORT,FEATURE_ASYNC_IO,NEW_EXPERIMENTAL_ASYNC_IO,FEATURE_UTF32,FEATURE_EXCEPTIONDISPATCHINFO,FEATURE_CORRUPTING_EXCEPTIONS,FEATURE_EXCEPTION_NOTIFICATIONS,FEATURE_STRONGNAME_MIGRATION,FEATURE_USE_LCID,FEATURE_FUSION,FEATURE_CRYPTO,FEATURE_X509_SECURESTRINGS,FEATURE_SYNCHRONIZATIONCONTEXT,FEATURE_SYNCHRONIZATIONCONTEXT_WAIT,HAS_CORLIB_CONTRACTS
 
index f70ee556ac6adb177de9fa5cc15cc469928fefca..92884a2591d87096214b2498460e1c9499351f3a 100644 (file)
@@ -51,7 +51,7 @@ namespace Mono {
 
                // handle.h HandleStackMark
                struct HandleStackMark {
-                       int size;
+                       int size, interior_size;
                        IntPtr chunk;
                }
 
index 664d9305745369610b87f6ce3d9a44050db45507..f6b752d1784fdb631a7f8439de3426608c39c963 100644 (file)
@@ -224,14 +224,6 @@ namespace System.IO
                                }
                        }
 
-                       if (access == FileAccess.Read && mode != FileMode.Create && mode != FileMode.OpenOrCreate &&
-                                       mode != FileMode.CreateNew && !File.Exists (path)) {
-                               // don't leak the path information for isolated storage
-                               string msg = Locale.GetText ("Could not find file \"{0}\".");
-                               string fname = GetSecureFileName (path);
-                               throw new FileNotFoundException (String.Format (msg, fname), fname);
-                       }
-
                        // IsolatedStorage needs to keep the Name property to the default "[Unknown]"
                        if (!anonymous)
                                this.name = path;
index c000b1eadc153211c13b0d4227b6a0a8a264054e..60d78ded37c689b1f56a2b59d01e9d9e0bd84021 100644 (file)
@@ -77,6 +77,8 @@ namespace System.Reflection.Emit {
                Hashtable resource_writers;
                ISymbolWriter symbolWriter;
 
+               static bool has_warned_about_symbolWriter;
+
                [MethodImplAttribute(MethodImplOptions.InternalCall)]
                private static extern void basic_init (ModuleBuilder ab);
 
@@ -107,11 +109,22 @@ namespace System.Reflection.Emit {
 
                        if (emitSymbolInfo) {
                                Assembly asm = Assembly.LoadWithPartialName ("Mono.CompilerServices.SymbolWriter");
-                               if (asm == null)
-                                       throw new TypeLoadException ("The assembly for default symbol writer cannot be loaded");
 
-                               Type t = asm.GetType ("Mono.CompilerServices.SymbolWriter.SymbolWriterImpl", true);
-                               symbolWriter = (ISymbolWriter) Activator.CreateInstance (t, new object[] { this });
+                               Type t = null;
+                               if (asm != null)
+                                       t = asm.GetType ("Mono.CompilerServices.SymbolWriter.SymbolWriterImpl");
+
+                               if (t == null) {
+                                       WarnAboutSymbolWriter ("Failed to load the default Mono.CompilerServices.SymbolWriter assembly");
+                               } else {
+                                       try {
+                                               symbolWriter = (ISymbolWriter) Activator.CreateInstance (t, new object[] { this });
+                                       } catch (System.MissingMethodException) {
+                                               WarnAboutSymbolWriter ("The default Mono.CompilerServices.SymbolWriter is not available on this platform");                                     
+                                               return;
+                                       }
+                               }
+                               
                                string fileName = fqname;
                                if (assemblyb.AssemblyDir != null)
                                        fileName = Path.Combine (assemblyb.AssemblyDir, fileName);
@@ -119,6 +132,15 @@ namespace System.Reflection.Emit {
                        }
                }
 
+               static void WarnAboutSymbolWriter (string message) 
+               {
+                       if (has_warned_about_symbolWriter)
+                               return;
+
+                       has_warned_about_symbolWriter = true;
+                       Console.Error.WriteLine ("WARNING: {0}", message);
+               }
+
                public override string FullyQualifiedName {get { return fqname;}}
 
                public bool IsTransient () {
index 5c812b6f592288d5ac486919837ee6170de6ddde..1c5cdd3ae820dc363687a19efbfe553ca31b6b20 100644 (file)
@@ -574,11 +574,17 @@ namespace System
 #if LIBC
                private static TimeZoneInfo FindSystemTimeZoneByFileName (string id, string filepath)
                {
-                       if (!File.Exists (filepath))
-                               throw new TimeZoneNotFoundException ();
-
-                       using (FileStream stream = File.OpenRead (filepath)) {
+                       FileStream stream = null;
+                       try {
+                               stream = File.OpenRead (filepath);      
+                       } catch (Exception ex) {
+                               throw new TimeZoneNotFoundException ("Couldn't read time zone file " + filepath, ex);
+                       }
+                       try {
                                return BuildFromStream (id, stream);
+                       } finally {
+                               if (stream != null)
+                                       stream.Dispose();
                        }
                }
 #endif
index cf95e49fa3a8774831a9cefea2ab49ea12d3ff9d..4fc95243fe0b899020c9f96256de8d9387082442 100644 (file)
@@ -14,6 +14,8 @@ using System;
 using System.IO;
 using System.Globalization;
 using System.Threading;
+using System.Runtime.InteropServices;
+
 
 using NUnit.Framework;
 
@@ -2680,5 +2682,53 @@ namespace MonoTests.System.IO
                        MoveTest (FileAccess.ReadWrite, FileShare.Write | FileShare.Delete, true);
                        MoveTest (FileAccess.ReadWrite, FileShare.ReadWrite | FileShare.Delete, true);
                }
+
+
+               [DllImport ("libc", SetLastError=true)]
+               public static extern int symlink (string oldpath, string newpath);
+
+               [Test]
+               public void SymLinkLoop ()
+               {
+                       if (!RunningOnUnix)
+                               Assert.Ignore ("Symlink are hard on windows");
+
+                       var name1 = Path.GetRandomFileName ();
+                       var name2 = Path.GetRandomFileName ();
+
+                       var path1 = Path.Combine (Path.GetTempPath (), name1);
+                       var path2 = Path.Combine (Path.GetTempPath (), name2);
+
+                       File.Delete (path1);
+                       File.Delete (path2);
+
+                       try {
+                               symlink (path1, path2);
+                               symlink (path2, path1);
+
+                               Assert.IsTrue (File.Exists (path1), "File.Exists must return true for path1 symlink loop");
+                               Assert.IsTrue (File.Exists (path2), "File.Exists must return true for path2 symlink loop");
+
+                               try {
+                                       using (var f = File.Open (path1, FileMode.Open, FileAccess.Read)) {
+                                               Assert.Fail ("File.Open must throw for symlink loops");
+                                       }
+                               } catch (IOException ex) {
+                                       Assert.AreEqual (0x80070781u, (uint)ex.HResult, "Ensure HRESULT is correct");
+                               }
+
+                               File.Delete (path1); //Delete must not throw and must work
+                               Assert.IsFalse (File.Exists (path1), "File.Delete must delete symlink loops");
+
+                       } finally {
+                               try {
+                                       File.Delete (path1);
+                                       File.Delete (path2);
+                               } catch (IOException) {
+                                       //Don't double fault any exception from the tests.
+                               }
+
+                       }
+               }
        }
 }
index 07bd1fe0b56adeee0f7b15ad2b3221e9b307954d..1cf78170bce5425cb632778321ca355ab3e3937b 100644 (file)
@@ -847,7 +847,7 @@ namespace MonoTests.System.Threading.Tasks
                                int r1 = 0, r2 = 0;
                                ThreadPool.QueueUserWorkItem (delegate {
                                                cntd.Signal ();
-                                               if (!t.Wait (1000))
+                                               if (!t.Wait (2000))
                                                        r1 = 20; // 20 -> task wait failed
                                                else if (t.Result != 1)
                                                        r1 = 30 + t.Result; // 30 -> task result is bad
@@ -861,7 +861,7 @@ namespace MonoTests.System.Threading.Tasks
                                        });
                                ThreadPool.QueueUserWorkItem (delegate {
                                                cntd.Signal ();
-                                               if (!t.Wait (1000))
+                                               if (!t.Wait (2000))
                                                        r2 = 40; // 40 -> task wait failed
                                                else if (t.Result != 1)
                                                        r2 = 50 + t.Result; // 50 -> task result is bad
@@ -874,9 +874,9 @@ namespace MonoTests.System.Threading.Tasks
                                                        Monitor.Pulse (monitor);
                                                }
                                        });
-                               Assert.IsTrue (cntd.Wait (2000), "#1");
+                               Assert.IsTrue (cntd.Wait (4000), "#1");
                                evt.Set ();
-                               Assert.IsTrue (cntd2.Wait (2000), "#2");
+                               Assert.IsTrue (cntd2.Wait (4000), "#2");
                                Assert.AreEqual (2, r1, "r1");
                                Assert.AreEqual (3, r2, "r2");
 
index 261e9b5692537a0593711614e27b619b917e3637..c168a31e4267f0059f18815f65a7b5043ff16872 100644 (file)
@@ -14,6 +14,8 @@ using System.Runtime.CompilerServices;
 using System.Threading;
 using System.Collections.Generic;
 
+#pragma warning disable CS1718
+
 namespace MonoTests.System
 {
        [TestFixture]
index eda79f7927d24d7faec8bcac20d1d8fff7bc2976..31959c173984ea0d2d5a32ab360e8b6bfccd340b 100644 (file)
@@ -2,8 +2,6 @@ namespace System.Diagnostics.Private
 {
        static partial class Debug
        {
-               static readonly string NewLine = Environment.NewLine;
-
                static void ShowAssertDialog (string stackTrace, string message, string detailMessage)
                {
                        // FIXME should we g_error in this case?
diff --git a/mcs/class/project_template_android.txt b/mcs/class/project_template_android.txt
deleted file mode 100644 (file)
index 5444595..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <PropertyGroup>
-    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
-    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
-    <ProductVersion>10.0.0</ProductVersion>
-    <SchemaVersion>2.0</SchemaVersion>
-    <ProjectGuid>PROJECT_GUID_GOES_HERE</ProjectGuid>
-    <ProjectTypeGuids>{EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
-    <OutputType>Library</OutputType>
-    <RootNamespace>System.Reactive</RootNamespace>
-    <AssemblyName>ASSEMBLY_NAME_GOES_HERE</AssemblyName>
-    <DefineConstants>NO_TASK_DELAY;NO_WINDOWS_THREADING;NO_REMOTING;HAS_AWAIT;NUNIT;MONODROID;$(SignAssemblySpec)</DefineConstants>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
-    <DebugSymbols>True</DebugSymbols>
-    <DebugType>full</DebugType>
-    <Optimize>False</Optimize>
-    <OutputPath>bin\Debug</OutputPath>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
-    <AndroidLinkMode>None</AndroidLinkMode>
-    <ConsolePause>False</ConsolePause>
-    <DefineConstants>DEBUG;NO_TASK_DELAY;NO_WINDOWS_THREADING;NO_REMOTING;HAS_AWAIT;NUNIT;MONODROID;$(SignAssemblySpec)</DefineConstants>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
-    <DebugType>none</DebugType>
-    <Optimize>True</Optimize>
-    <OutputPath>bin\Release</OutputPath>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
-    <ConsolePause>False</ConsolePause>
-    <AndroidLinkMode>SdkOnly</AndroidLinkMode>
-    <AndroidUseSharedRuntime>False</AndroidUseSharedRuntime>
-  </PropertyGroup>
-  <ItemGroup>
-    <Reference Include="System" />
-    <Reference Include="System.Xml" />
-    <Reference Include="System.Core" />
-  </ItemGroup>
-  <ItemGroup>
-OPTIONAL_ANDROID_NUNITLITE
-PROJECT_REFERENCES_GO_HERE
-    <!--
-    <ProjectReference Include="..\Andr.Unit\Android.NUnitLite\Android.NUnitLite.csproj">
-      <Project>{6A005891-A3D6-4398-A729-F645397D573A}</Project>
-      <Name>Android.NUnitLite</Name>
-    </ProjectReference>
-    -->
-  </ItemGroup>
-  <ItemGroup>
-SOURCES_GO_HERE
-    <!--
-    <Compile Include="..\..\..\Microsoft.Reactive.Testing\ColdObservable.cs">
-      <Link>ColdObservable.cs</Link>
-    </Compile>
-    -->
-RESOURCES_GO_HERE
-  </ItemGroup>
-  <Import Project="$(MSBuildExtensionsPath)\Novell\Novell.MonoDroid.CSharp.targets" />
-</Project>
diff --git a/mcs/class/project_template_ios.txt b/mcs/class/project_template_ios.txt
deleted file mode 100644 (file)
index 6a6d996..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <PropertyGroup>
-    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
-    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
-    <ProductVersion>10.0.0</ProductVersion>
-    <SchemaVersion>2.0</SchemaVersion>
-    <ProjectGuid>PROJECT_GUID_GOES_HERE</ProjectGuid>
-    <ProjectTypeGuids>{6BC8ED88-2882-458C-8E55-DFD12B67127B};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
-    <OutputType>Library</OutputType>
-    <AppDesignerFolder>Properties</AppDesignerFolder>
-    <RootNamespace>System.Reactive</RootNamespace>
-    <IPhoneResourcePrefix>Resources</IPhoneResourcePrefix>
-    <AssemblyName>ASSEMBLY_NAME_GOES_HERE</AssemblyName>
-    <ProductSignAssembly>true</ProductSignAssembly>
-    <DefineConstants>NO_TASK_DELAY;NO_WINDOWS_THREADING;NO_REMOTING;NO_REFLECTION_EMIT;NO_EXPRESSIONS;HAS_AWAIT;NUNIT;$(SignAssemblySpec)</DefineConstants>
-    <additionalargs>-delaySign</additionalargs>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
-    <DebugSymbols>True</DebugSymbols>
-    <DebugType>full</DebugType>
-    <Optimize>False</Optimize>
-    <OutputPath>bin\Debug</OutputPath>
-    <ConsolePause>False</ConsolePause>
-    <WarningLevel>4</WarningLevel>
-    <DefineConstants>DEBUG;NO_TASK_DELAY;NO_WINDOWS_THREADING;NO_REMOTING;NO_REFLECTION_EMIT;NO_EXPRESSIONS;HAS_AWAIT;NUNIT;$(SignAssemblySpec)</DefineConstants>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
-    <DebugType>none</DebugType>
-    <Optimize>True</Optimize>
-    <OutputPath>bin\Release</OutputPath>
-    <ConsolePause>False</ConsolePause>
-    <WarningLevel>4</WarningLevel>
-  </PropertyGroup>
-  <PropertyGroup>
-    <!--
-    <TargetFrameworkIdentifier>iOS</TargetFrameworkIdentifier>
-    <TargetFrameworkVersion>v2.0.5</TargetFrameworkVersion>
-    -->
-    <!-- NoStdLib>true</NoStdLib -->
-    <BuildPlatform>MOBILE</BuildPlatform>
-    <BuildFlavor>MONOTOUCH</BuildFlavor>
-  </PropertyGroup>
-  <Import Project="..\..\..\Common.targets" />
-  <ItemGroup>
-    <Reference Include="System" />
-    <Reference Include="System.Core" />
-    <Reference Include="MonoTouch.NUnitLite" />
-    OPTIONAL_MONOTOUCH_NUNITLITE
-  </ItemGroup>
-  <ItemGroup>
-    PROJECT_REFERENCES_GO_HERE
-    <!--
-    <ProjectReference Include="..\Andr.Unit\Android.NUnitLite\Android.NUnitLite.csproj">
-      <Project>{6A005891-A3D6-4398-A729-F645397D573A}</Project>
-      <Name>Android.NUnitLite</Name>
-    </ProjectReference>
-    -->
-  </ItemGroup>
-  <ItemGroup>
-    SOURCES_GO_HERE
-    <!--
-    <Compile Include="..\..\..\Microsoft.Reactive.Testing\ColdObservable.cs">
-      <Link>ColdObservable.cs</Link>
-    </Compile>
-    -->
-    RESOURCES_GO_HERE
-  </ItemGroup>
-  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
-  <ItemGroup>
-    <Folder Include="Properties\" />
-  </ItemGroup>
-</Project>
index 145bbb5424b7ffae80cfb0d158a3c230a822a941..c9fca00b3e437277f5fc58b1c8e9a9e2af2710f2 100644 (file)
@@ -783,9 +783,10 @@ namespace System.IO
         internal override DirectoryInfo CreateObject(SearchResult result)
         {
             String name = result.FullPath;
-            String permissionName = name + "\\.";
 
 #if MONO_FEATURE_CAS
+            String permissionName = name + "\\.";
+
 #if FEATURE_CORECLR
             FileSecurityState state = new FileSecurityState(FileSecurityStateAccess.Read, String.Empty, permissionName);
             state.EnsureState();
@@ -821,9 +822,10 @@ namespace System.IO
             if (isDir)
             {
                 String name = result.FullPath;
-                String permissionName = name + "\\.";
 
 #if MONO_FEATURE_CAS
+                String permissionName = name + "\\.";
+
 #if FEATURE_CORECLR
                 FileSecurityState state = new FileSecurityState(FileSecurityStateAccess.Read, String.Empty, permissionName);
                 state.EnsureState();
diff --git a/mcs/errors/cs0208-19.cs b/mcs/errors/cs0208-19.cs
new file mode 100644 (file)
index 0000000..82b0f43
--- /dev/null
@@ -0,0 +1,20 @@
+// CS0208: Cannot take the address of, get the size of, or declare a pointer to a managed type `CS208.Foo'
+// Line: 17
+// Compiler options: -unsafe
+
+namespace CS208
+{
+       public struct Foo
+       {
+               public string PP { get; set; }
+       }
+
+       public class Bar
+       {
+               unsafe static void Main ()
+               {                       
+                       Foo f = new Foo ();
+                       void *s = &f;
+               }
+       }
+}
diff --git a/mcs/errors/cs1031-3.cs b/mcs/errors/cs1031-3.cs
new file mode 100644 (file)
index 0000000..3126dfa
--- /dev/null
@@ -0,0 +1,18 @@
+// CS1031: Type expected
+// Line: 16
+
+public class B<Y>  where Y: B<Y>
+{
+}
+
+public class A<X>: B<A<X>>
+{
+}
+
+public class Repro
+{
+       public static void Main (string[] args)
+       {
+               var h = typeof (B<A<>>);
+       }
+}
\ No newline at end of file
index e1fd9567feafa53bfd859ad33aa66627ed94c542..746d04d510dc06bf780bee1e57c2c4f721b4040c 100755 (executable)
@@ -1,4 +1,4 @@
-// CS1043: Invalid accessor body `1', expecting `;' or `{'
+// CS1043: Invalid accessor body `1', expecting `;', `{', or `=>'
 // Line: 6
 
 class C
diff --git a/mcs/errors/cs1629-3.cs b/mcs/errors/cs1629-3.cs
new file mode 100644 (file)
index 0000000..f7ceed6
--- /dev/null
@@ -0,0 +1,19 @@
+// CS1629: Unsafe code may not appear in iterators
+// Line: 17
+// Compiler options: -unsafe
+
+using System.Collections.Generic;
+
+public unsafe class TestClass
+{
+       public struct Foo {
+               public bool C;
+       }
+
+       Foo *current;
+
+       public IEnumerable<Foo> EnumeratorCurrentEvents ()
+       {
+               yield return *current;
+       }
+}
\ No newline at end of file
index 2f2fe4580b400dfc74c80bd59366ceeeada97f71..d1aedad9971215c790a12e6adb52a332cdd52c79 100644 (file)
@@ -639,6 +639,15 @@ namespace Mono.CSharp
                        }
                }
 
+               public bool HasInstanceField {
+                       get {
+                               return (caching_flags & Flags.HasInstanceField) != 0;
+                       }
+                       set {
+                               caching_flags |= Flags.HasInstanceField;
+                       }
+               }
+
                // Indicated whether container has StructLayout attribute set Explicit
                public bool HasExplicitLayout {
                        get { return (caching_flags & Flags.HasExplicitLayout) != 0; }
@@ -848,18 +857,22 @@ namespace Mono.CSharp
                        if ((field.ModFlags & Modifiers.STATIC) != 0)
                                return true;
 
-                       var first_field = PartialContainer.first_nonstatic_field;
-                       if (first_field == null) {
+                       if (!PartialContainer.HasInstanceField) {
+                               PartialContainer.HasInstanceField = true;
                                PartialContainer.first_nonstatic_field = field;
                                return true;
                        }
 
-                       if (Kind == MemberKind.Struct && first_field.Parent != field.Parent) {
-                               Report.SymbolRelatedToPreviousError (first_field.Parent);
-                               Report.Warning (282, 3, field.Location,
-                                       "struct instance field `{0}' found in different declaration from instance field `{1}'",
-                                       field.GetSignatureForError (), first_field.GetSignatureForError ());
+                       if (Kind == MemberKind.Struct) {
+                               var first_field = PartialContainer.first_nonstatic_field;
+                               if (first_field.Parent != field.Parent) {
+                                       Report.SymbolRelatedToPreviousError (first_field.Parent);
+                                       Report.Warning (282, 3, field.Location,
+                                               "struct instance field `{0}' found in different declaration from instance field `{1}'",
+                                               field.GetSignatureForError (), first_field.GetSignatureForError ());
+                               }
                        }
+
                        return true;
                }
 
@@ -1299,7 +1312,7 @@ namespace Mono.CSharp
                        //
                        // Sets .size to 1 for structs with no instance fields
                        //
-                       int type_size = Kind == MemberKind.Struct && first_nonstatic_field == null && !(this is StateMachine) ? 1 : 0;
+                       int type_size = Kind == MemberKind.Struct && !HasInstanceField && !(this is StateMachine) ? 1 : 0;
 
                        var parent_def = Parent as TypeDefinition;
                        if (parent_def == null) {
@@ -2214,6 +2227,10 @@ namespace Mono.CSharp
                                Module.PredefinedAttributes.CompilerGenerated.EmitAttribute (TypeBuilder);
 
 #if STATIC
+                       if (Kind == MemberKind.Struct && HasInstanceField) {
+                               TypeBuilder.__SetLayout (0, 0);
+                       }
+
                        if ((TypeBuilder.Attributes & TypeAttributes.StringFormatMask) == 0 && Module.HasDefaultCharSet)
                                TypeBuilder.__SetAttributes (TypeBuilder.Attributes | Module.DefaultCharSetType);
 #endif
@@ -3146,7 +3163,7 @@ namespace Mono.CSharp
                                return false;
                        }
 
-                       if (first_nonstatic_field != null) {
+                       if (HasInstanceField) {
                                requires_delayed_unmanagedtype_check = true;
 
                                foreach (var member in Members) {
index a9748379086bbde75a62e2c78329576af82f3755..91e6a23b1406f17bcc0ff188c1161ba949f1a98d 100644 (file)
@@ -2073,7 +2073,8 @@ set_accessor_declaration
        ;
 
 accessor_body
-       : block 
+       : block
+       | expression_block
        | SEMICOLON
          {
                // TODO: lbag
@@ -2086,6 +2087,7 @@ accessor_body
          }
        ;
 
+
 interface_declaration
        : opt_attributes
          opt_modifiers
@@ -2742,7 +2744,8 @@ event_accessor_block
                report.Error (73, lexer.Location, "An add or remove accessor must have a body");
                $$ = null;
          }
-       | block;
+       | block
+       | expression_block
        ;
 
 attributes_without_members
index e6a95fe8163a3590acb9f23602cc10d4cdec63dd..d6314ff005a3222079d9eb1eb746b258780da2f8 100644 (file)
@@ -1267,7 +1267,8 @@ namespace Mono.CSharp
                        else if (the_token == Token.INTERR_NULLABLE || the_token == Token.STAR)
                                goto again;
                        else if (the_token == Token.OP_GENERICS_LT) {
-                               if (!parse_less_than (ref genericDimension))
+                               int unused = 0;
+                               if (!parse_less_than (ref unused))
                                        return false;
                                goto again;
                        } else if (the_token == Token.OPEN_BRACKET) {
index 340eb488ab08c6a37f1d52cae579f9e7edb38643..0f0b1d1bb69749696d80b025d5da5bf27faf276b 100644 (file)
@@ -290,7 +290,8 @@ namespace Mono.CSharp {
                        HasInstanceConstructor = 1 << 16,
                        HasUserOperators = 1 << 17,
                        CanBeReused = 1 << 18,
-                       InterfacesExpanded = 1 << 19
+                       InterfacesExpanded = 1 << 19,
+                       HasInstanceField = 1 << 20
                }
 
                /// <summary>
index 0a11914328ae79629b356b78bd879de1942f3b69..4db99f7e5fe7ceff533fc010e89ff078d489f9e0 100644 (file)
@@ -44,31 +44,45 @@ namespace Mono.CSharp
 
                void tokenize_file (SourceFile sourceFile, ModuleContainer module, ParserSession session)
                {
-                       Stream input;
+                       Stream input = null;
+                       SeekableStreamReader reader = null;
 
                        try {
-                               input = File.OpenRead (sourceFile.Name);
+                               if (sourceFile.GetInputStream != null) {
+                                       reader = sourceFile.GetInputStream (sourceFile);
+                                       if (reader == null) {
+                                               throw new FileNotFoundException ("Delegate returned null", sourceFile.Name);
+                                       }
+                               } else {
+                                       input = File.OpenRead (sourceFile.Name);
+                               }
                        } catch {
                                Report.Error (2001, "Source file `" + sourceFile.Name + "' could not be found");
                                return;
                        }
 
-                       using (input){
-                               SeekableStreamReader reader = new SeekableStreamReader (input, ctx.Settings.Encoding);
-                               var file = new CompilationSourceFile (module, sourceFile);
+                       if (reader == null) {
+                               using (input) {
+                                       reader = new SeekableStreamReader (input, ctx.Settings.Encoding);
+                                       DoTokenize (sourceFile, module, session, reader);
+                               }
+                       } else {
+                               DoTokenize (sourceFile, module, session, reader);
+                       }
+               }
+
+               void DoTokenize (SourceFile sourceFile, ModuleContainer module, ParserSession session, SeekableStreamReader reader) {
+                       var file = new CompilationSourceFile (module, sourceFile);
 
-                               Tokenizer lexer = new Tokenizer (reader, file, session, ctx.Report);
-                               int token, tokens = 0, errors = 0;
+                       Tokenizer lexer = new Tokenizer (reader, file, session, ctx.Report);
+                       int token, tokens = 0, errors = 0;
 
-                               while ((token = lexer.token ()) != Token.EOF){
-                                       tokens++;
-                                       if (token == Token.ERROR)
-                                               errors++;
-                               }
-                               Console.WriteLine ("Tokenized: " + tokens + " found " + errors + " errors");
+                       while ((token = lexer.token ()) != Token.EOF) {
+                               tokens++;
+                               if (token == Token.ERROR)
+                                       errors++;
                        }
-                       
-                       return;
+                       Console.WriteLine ("Tokenized: " + tokens + " found " + errors + " errors");
                }
 
                void Parse (ModuleContainer module)
@@ -129,36 +143,50 @@ namespace Mono.CSharp
 
                public void Parse (SourceFile file, ModuleContainer module, ParserSession session, Report report)
                {
-                       Stream input;
+                       Stream input = null;
+                       SeekableStreamReader reader = null;
 
                        try {
-                               input = File.OpenRead (file.Name);
+                               if (file.GetInputStream != null) {
+                                       reader = file.GetInputStream (file);
+                                       if (reader == null) {
+                                               throw new FileNotFoundException ("Delegate returned null", file.Name);
+                                       }
+                               } else {
+                                       input = File.OpenRead (file.Name);
+                               }
                        } catch {
                                report.Error (2001, "Source file `{0}' could not be found", file.Name);
                                return;
                        }
 
-                       // Check 'MZ' header
-                       if (input.ReadByte () == 77 && input.ReadByte () == 90) {
+                       if (reader == null) {
+                               using (input) {
+                                       // Check 'MZ' header
+                                       if (input.ReadByte () == 77 && input.ReadByte () == 90) {
 
-                               report.Error (2015, "Source file `{0}' is a binary file and not a text file", file.Name);
-                               input.Close ();
-                               return;
-                       }
+                                               report.Error (2015, "Source file `{0}' is a binary file and not a text file", file.Name);
+                                               return;
+                                       }
 
-                       input.Position = 0;
-                       SeekableStreamReader reader = new SeekableStreamReader (input, ctx.Settings.Encoding, session.StreamReaderBuffer);
+                                       input.Position = 0;
+                                       reader = new SeekableStreamReader (input, ctx.Settings.Encoding, session.StreamReaderBuffer);
 
+                                       DoParse (file, module, session, report, reader);
+                               }
+                       } else {
+                               DoParse (file, module, session, report, reader);
+                       }
+               }
+
+               void DoParse (SourceFile file, ModuleContainer module, ParserSession session, Report report, SeekableStreamReader reader) {
                        Parse (reader, file, module, session, report);
 
                        if (ctx.Settings.GenerateDebugInfo && report.Errors == 0 && !file.HasChecksum) {
-                               input.Position = 0;
+                               reader.Stream.Position = 0;
                                var checksum = session.GetChecksumAlgorithm ();
-                               file.SetChecksum (checksum.ComputeHash (input));
+                               file.SetChecksum (checksum.ComputeHash (reader.Stream));
                        }
-
-                       reader.Dispose ();
-                       input.Close ();
                }
 
                public static void Parse (SeekableStreamReader reader, SourceFile sourceFile, ModuleContainer module, ParserSession session, Report report)
index d2a1b7e95dad11d133df17ce8bafb86896bc3567..99ba10dcb9dce06e5e15819cc5bbd6345131bc92 100644 (file)
@@ -1130,6 +1130,16 @@ namespace Mono.CSharp {
                        Report.Error (214, loc, "Pointers and fixed size buffers may only be used in an unsafe context");
                }
 
+               public static void UnsafeInsideIteratorError (ResolveContext rc, Location loc)
+               {
+                       UnsafeInsideIteratorError (rc.Report, loc);
+               }
+
+               public static void UnsafeInsideIteratorError (Report report, Location loc)
+               {
+                       report.Error (1629, loc, "Unsafe code may not appear in iterators");
+               }
+
                //
                // Converts `source' to an int, uint, long or ulong.
                //
@@ -3456,8 +3466,12 @@ namespace Mono.CSharp {
                                CheckProtectedMemberAccess (rc, member);
                        }
 
-                       if (member.MemberType.IsPointer && !rc.IsUnsafe) {
-                               UnsafeError (rc, loc);
+                       if (member.MemberType.IsPointer) {
+                               if (rc.CurrentIterator != null) {
+                                       UnsafeInsideIteratorError (rc, loc);
+                               } else if (!rc.IsUnsafe) {
+                                       UnsafeError (rc, loc);
+                               }
                        }
 
                        var dep = member.GetMissingDependencies ();
@@ -5388,10 +5402,8 @@ namespace Mono.CSharp {
 
                static TypeSpec MoreSpecific (TypeSpec p, TypeSpec q)
                {
-                       if (TypeManager.IsGenericParameter (p) && !TypeManager.IsGenericParameter (q))
-                               return q;
-                       if (!TypeManager.IsGenericParameter (p) && TypeManager.IsGenericParameter (q))
-                               return p;
+                       if (p.IsGenericParameter != q.IsGenericParameter)
+                               return p.IsGenericParameter ? q : p;
 
                        var ac_p = p as ArrayContainer;
                        if (ac_p != null) {
@@ -5404,18 +5416,22 @@ namespace Mono.CSharp {
                                        return p;
                                if (specific == ac_q.Element)
                                        return q;
-                       } else if (p.IsGeneric && q.IsGeneric) {
-                               var pargs = TypeManager.GetTypeArguments (p);
-                               var qargs = TypeManager.GetTypeArguments (q);
+
+                               return null;
+                       }
+
+                       if (p.IsGeneric && q.IsGeneric) {
+                               var pargs = p.TypeArguments;
+                               var qargs = q.TypeArguments;
 
                                bool p_specific_at_least_once = false;
                                bool q_specific_at_least_once = false;
 
                                for (int i = 0; i < pargs.Length; i++) {
-                                       TypeSpec specific = MoreSpecific (pargs[i], qargs[i]);
-                                       if (specific == pargs[i])
+                                       TypeSpec specific = MoreSpecific (pargs [i], qargs [i]);
+                                       if (specific == pargs [i])
                                                p_specific_at_least_once = true;
-                                       if (specific == qargs[i])
+                                       if (specific == qargs [i])
                                                q_specific_at_least_once = true;
                                }
 
@@ -6075,8 +6091,12 @@ namespace Mono.CSharp {
                                arg_count++;
                        }
 
-                       if (has_unsafe_arg && !ec.IsUnsafe) {
-                               Expression.UnsafeError (ec, loc);
+                       if (has_unsafe_arg) {
+                               if (ec.CurrentIterator != null) {
+                                       Expression.UnsafeInsideIteratorError (ec, loc);
+                               } else if (!ec.IsUnsafe) {
+                                       Expression.UnsafeError (ec, loc);
+                               }
                        }
 
                        //
index d4e83a506a0fcfbf1d1b00d8522173ca92f15462..60e0c6d64a05de757fecad7d838f71415d8545af 100644 (file)
@@ -958,6 +958,12 @@ namespace Mono.CSharp
                                importer.ImportAssembly (a, module.GlobalRootNamespace);
                        }
                }
+
+               public void ImportTypes (bool importExtensionTypes, params Type[] types) {
+#if !STATIC
+                       importer.ImportTypes (types, module.GlobalRootNamespace, importExtensionTypes);
+#endif
+               }
        }
 
        
index c7747f014fdee5da31e0b772c45dbdaa148c769c..9042dcdabad8e5405cbbbc086953ade32d7dfc81 100644 (file)
@@ -718,8 +718,11 @@ namespace Mono.CSharp
 
                Expression ResolveAddressOf (ResolveContext ec)
                {
-                       if (!ec.IsUnsafe)
+                       if (ec.CurrentIterator != null) {
+                               UnsafeInsideIteratorError (ec, loc);
+                       } else if (!ec.IsUnsafe) {
                                UnsafeError (ec, loc);
+                       }
 
                        Expr = Expr.DoResolveLValue (ec, EmptyExpression.UnaryAddress);
                        if (Expr == null || Expr.eclass != ExprClass.Variable) {
@@ -737,7 +740,7 @@ namespace Mono.CSharp
                                is_fixed = vr.IsFixed;
                                vr.SetHasAddressTaken ();
 
-                               if (vr.IsHoisted) {
+                               if (vr.IsHoisted && ec.CurrentIterator == null) {
                                        AnonymousMethodExpression.Error_AddressOfCapturedVar (ec, vr, loc);
                                }
                        } else {
@@ -984,8 +987,11 @@ namespace Mono.CSharp
                        if (expr == null)
                                return null;
 
-                       if (!ec.IsUnsafe)
+                       if (ec.CurrentIterator != null) {
+                               UnsafeInsideIteratorError (ec, loc);
+                       } else if (!ec.IsUnsafe) {
                                UnsafeError (ec, loc);
+                       }
 
                        var pc = expr.Type as PointerContainer;
 
@@ -2453,8 +2459,12 @@ namespace Mono.CSharp
                                return null;
                        }
 
-                       if (type.IsPointer && !ec.IsUnsafe) {
-                               UnsafeError (ec, loc);
+                       if (type.IsPointer) {
+                               if (ec.CurrentIterator != null) {
+                                       UnsafeInsideIteratorError (ec, loc);
+                               } else if (!ec.IsUnsafe) {
+                                       UnsafeError (ec, loc);
+                               }
                        }
 
                        eclass = ExprClass.Value;
@@ -7560,14 +7570,21 @@ namespace Mono.CSharp
                        bool is_value_type = type.IsStructOrEnum;
                        VariableReference vr = target as VariableReference;
 
+                       bool prepare_await = ec.HasSet (BuilderContext.Options.AsyncBody) && arguments?.ContainsEmitWithAwait () == true;
+
                        if (target != null && is_value_type && (vr != null || method == null)) {
+                               if (prepare_await) {
+                                       arguments = arguments.Emit (ec, false, true);
+                                       prepare_await = false;
+                               }
+                               
                                target.AddressOf (ec, AddressOp.Store);
                        } else if (vr != null && vr.IsRef) {
                                vr.EmitLoad (ec);
                        }
 
                        if (arguments != null) {
-                               if (ec.HasSet (BuilderContext.Options.AsyncBody) && (arguments.Count > (this is NewInitialize ? 0 : 1)) && arguments.ContainsEmitWithAwait ())
+                               if (prepare_await)
                                        arguments = arguments.Emit (ec, false, true);
 
                                arguments.Emit (ec);
@@ -10485,8 +10502,12 @@ namespace Mono.CSharp
                        }
 
                        type = ac.Element;
-                       if (type.IsPointer && !ec.IsUnsafe) {
-                               UnsafeError (ec, ea.Location);
+                       if (type.IsPointer) {
+                               if (ec.CurrentIterator != null) {
+                                       UnsafeInsideIteratorError (ec, ea.Location);
+                               } else if (!ec.IsUnsafe) {
+                                       UnsafeError (ec, ea.Location);
+                               }
                        }
 
                        if (conditional_access_receiver)
@@ -11404,7 +11425,10 @@ namespace Mono.CSharp
                                if (!(ec.CurrentMemberDefinition is Field) && !TypeManager.VerifyUnmanaged (ec.Module, type, loc))
                                        return null;
 
-                               if (!ec.IsUnsafe) {
+                               var rc = ec as ResolveContext;
+                               if (rc?.CurrentIterator != null) {
+                                       UnsafeInsideIteratorError (ec.Module.Compiler.Report, loc);
+                               } else if (!ec.IsUnsafe) {
                                        UnsafeError (ec.Module.Compiler.Report, loc);
                                }
 
index 96f950551e21bd257d4a7114971fbb774d50f9aa..87ebf6aac54fb54c69fc2239f9033f11e67498d2 100644 (file)
@@ -195,7 +195,7 @@ namespace Mono.CSharp
                        TypeSpec field_type;
 
                        try {
-                               field_type = ImportType (fi.FieldType, new DynamicTypeReader (fi));
+                               field_type = ImportType (fi.FieldType, new DynamicTypeReader (fi), declaringType);
 
                                //
                                // Private field has private type which is not fixed buffer
@@ -275,7 +275,7 @@ namespace Mono.CSharp
                        if (add.Modifiers != remove.Modifiers)
                                throw new NotImplementedException ("Different accessor modifiers " + ei.Name);
 
-                       var event_type = ImportType (ei.EventHandlerType, new DynamicTypeReader (ei));
+                       var event_type = ImportType (ei.EventHandlerType, new DynamicTypeReader (ei), declaringType);
                        var definition = new ImportedMemberDefinition (ei, event_type,  this);
                        return new EventSpec (declaringType, definition, event_type, add.Modifiers, add, remove);
                }
@@ -346,7 +346,7 @@ namespace Mono.CSharp
                                if (type.HasElementType) {
                                        var element = type.GetElementType ();
                                        ++dtype.Position;
-                                       spec = ImportType (element, dtype);
+                                       spec = ImportType (element, dtype, null);
 
                                        if (!type.IsArray) {
                                                throw new NotImplementedException ("Unknown element type " + type.ToString ());
@@ -437,7 +437,7 @@ namespace Mono.CSharp
                                }
 
                                var mi = (MethodInfo) mb;
-                               returnType = ImportType (mi.ReturnType, new DynamicTypeReader (mi.ReturnParameter));
+                               returnType = ImportType (mi.ReturnType, new DynamicTypeReader (mi.ReturnParameter), declaringType);
 
                                // Cannot set to OVERRIDE without full hierarchy checks
                                // this flag indicates that the method could be override
@@ -545,13 +545,13 @@ namespace Mono.CSharp
                                        // Strip reference wrapping
                                        //
                                        var el = p.ParameterType.GetElementType ();
-                                       types[i] = ImportType (el, new DynamicTypeReader (p));  // TODO: 1-based positio to be csc compatible
+                                       types[i] = ImportType (el, new DynamicTypeReader (p), parent);  // TODO: 1-based positio to be csc compatible
                                } else if (i == 0 && method.IsStatic && (parent.Modifiers & Modifiers.METHOD_EXTENSION) != 0 &&
                                        HasAttribute (CustomAttributeData.GetCustomAttributes (method), "ExtensionAttribute", CompilerServicesNamespace)) {
                                        mod = Parameter.Modifier.This;
-                                       types[i] = ImportType (p.ParameterType, new DynamicTypeReader (p));
+                                       types[i] = ImportType (p.ParameterType, new DynamicTypeReader (p), parent);
                                } else {
-                                       types[i] = ImportType (p.ParameterType, new DynamicTypeReader (p));
+                                       types[i] = ImportType (p.ParameterType, new DynamicTypeReader (p), parent);
 
                                        if (i >= pi.Length - 2 && types[i] is ArrayContainer) {
                                                if (HasAttribute (CustomAttributeData.GetCustomAttributes (p), "ParamArrayAttribute", "System")) {
@@ -1092,7 +1092,7 @@ namespace Mono.CSharp
                        }
                }
 
-               protected void ImportTypes (MetaType[] types, Namespace targetNamespace, bool importExtensionTypes)
+               public void ImportTypes (MetaType[] types, Namespace targetNamespace, bool importExtensionTypes)
                {
                        Namespace ns = targetNamespace;
                        string prev_namespace = null;
@@ -1199,15 +1199,15 @@ namespace Mono.CSharp
 
                public TypeSpec ImportType (MetaType type)
                {
-                       return ImportType (type, new DynamicTypeReader (type));
+                       return ImportType (type, new DynamicTypeReader (type), null);
                }
 
-               TypeSpec ImportType (MetaType type, DynamicTypeReader dtype)
+               TypeSpec ImportType (MetaType type, DynamicTypeReader dtype, TypeSpec currentType)
                {
                        if (type.HasElementType) {
                                var element = type.GetElementType ();
                                ++dtype.Position;
-                               var spec = ImportType (element, dtype);
+                               var spec = ImportType (element, dtype, currentType);
 
                                if (type.IsArray)
                                        return ArrayContainer.MakeType (module, spec, type.GetArrayRank ());
@@ -1223,11 +1223,19 @@ namespace Mono.CSharp
                        if (compiled_types.TryGetValue (type, out compiled_type)) {
                                if (compiled_type.BuiltinType == BuiltinTypeSpec.Type.Object && dtype.IsDynamicObject ())
                                        return module.Compiler.BuiltinTypes.Dynamic;
+                       } else {
+                               compiled_type = CreateType (type, dtype, true);
+                       }
 
-                               return compiled_type;
+                       if (currentType == compiled_type && currentType?.IsGeneric == true) {
+                               //
+                               // Inflates current type to match behaviour of TypeDefinition::CurrentType used by compiled types
+                               //
+                               var targs = compiled_type.MemberDefinition.TypeParameters;
+                               compiled_type = compiled_type.MakeGenericType (module, targs);
                        }
 
-                       return CreateType (type, dtype, true);
+                       return compiled_type;
                }
 
                static bool IsMissingType (MetaType type)
@@ -1706,7 +1714,7 @@ namespace Mono.CSharp
                                token = null;
 
                        foreach (var internals in internals_visible_to) {
-                               if (internals.Name != assembly.Name)
+                               if (!String.Equals(internals.Name, assembly.Name, StringComparison.OrdinalIgnoreCase))
                                        continue;
 
                                if (token == null && assembly is AssemblyDefinition) {
index 0b6fc1abf7722452569bed9c6c1ae75ac2815296..3afe93ce5ffe1bf89df1833938932a96f7abb294 100644 (file)
@@ -1220,7 +1220,7 @@ namespace Mono.CSharp
                        }
 
                        if ((modifiers & Modifiers.UNSAFE) != 0) {
-                               parent.Compiler.Report.Error (1629, method.Location, "Unsafe code may not appear in iterators");
+                               Expression.UnsafeInsideIteratorError (parent.Compiler.Report, method.Location);
                        }
 
                        method.Block = method.Block.ConvertToIterator (method, parent, iterator_type, is_enumerable);
index 658f3b765fa4f48f4e9e1bce1787cca9a387e215..287aac0797a375b222d27470769e692f0dabefe7 100644 (file)
@@ -59,6 +59,7 @@ namespace Mono.CSharp
                public readonly string OriginalFullPathName;
                public readonly int Index;
                public bool AutoGenerated;
+               public Func<SourceFile, SeekableStreamReader> GetInputStream;
 
                SourceFileEntry file;
                byte[] algGuid, checksum;
@@ -71,6 +72,11 @@ namespace Mono.CSharp
                        this.OriginalFullPathName = path;
                }
 
+               public SourceFile (string name, string path, int index, Func<SourceFile, SeekableStreamReader> inputStreamDelegate) : this (name, path, index)
+               {
+                       this.GetInputStream = inputStreamDelegate;
+               }
+
                public byte[] Checksum {
                        get {
                                return checksum;
index 6b1990e1f0983d87bd8b91d0f60dee7efe51129c..5d831e940b523b144287c7e0d47f0394e3677147 100644 (file)
@@ -820,8 +820,10 @@ namespace Mono.CSharp
                        Parent.PartialContainer.Members.Add (BackingField);
 
                        FieldExpr fe = new FieldExpr (BackingField, Location);
-                       if ((BackingField.ModFlags & Modifiers.STATIC) == 0)
+                       if ((BackingField.ModFlags & Modifiers.STATIC) == 0) {
                                fe.InstanceExpression = new CompilerGeneratedThis (Parent.CurrentType, Location);
+                               Parent.PartialContainer.HasInstanceField = true;
+                       }
 
                        //
                        // Create get block but we careful with location to
index 4f67eb3240f38407e24a36fc3c384b3f60714489..20eb19e6cee8b4fb54b7df5d9ff4e57338f1a680 100644 (file)
@@ -6357,7 +6357,7 @@ namespace Mono.CSharp {
                public override bool Resolve (BlockContext ec)
                {
                        if (ec.CurrentIterator != null)
-                               ec.Report.Error (1629, loc, "Unsafe code may not appear in iterators");
+                               Expression.UnsafeInsideIteratorError (ec, loc);
 
                        using (ec.Set (ResolveContext.Options.UnsafeScope))
                                return Block.Resolve (ec);
index ab3cc5c1492bc3f62be5b9c7e77600a4047d8104..fe6343a814db2f0136d48500c484d376491fbd30 100644 (file)
@@ -73,7 +73,7 @@ namespace Mono.CSharp {
 #endif
 
                StreamReader reader;
-               Stream stream;
+               public readonly Stream Stream;
 
                char[] buffer;
                int read_ahead_length;  // the length of read buffer
@@ -83,7 +83,7 @@ namespace Mono.CSharp {
 
                public SeekableStreamReader (Stream stream, Encoding encoding, char[] sharedBuffer = null)
                {
-                       this.stream = stream;
+                       this.Stream = stream;
                        this.buffer = sharedBuffer;
 
                        InitializeStream (DefaultReadAheadSize);
@@ -105,7 +105,7 @@ namespace Mono.CSharp {
                        if (buffer == null || buffer.Length < required_buffer_size)
                                buffer = new char [required_buffer_size];
 
-                       stream.Position = 0;
+                       Stream.Position = 0;
                        buffer_start = char_count = pos = 0;
                }
 
@@ -134,7 +134,7 @@ namespace Mono.CSharp {
                                        // Cannot use handy reader.DiscardBufferedData () because it for
                                        // some strange reason resets encoding as well
                                        //
-                                       reader = new StreamReader (stream, reader.CurrentEncoding, true);
+                                       reader = new StreamReader (Stream, reader.CurrentEncoding, true);
                                }
 
                                while (value > buffer_start + char_count) {
diff --git a/mcs/tests/gtest-646-lib.cs b/mcs/tests/gtest-646-lib.cs
new file mode 100644 (file)
index 0000000..969dbd7
--- /dev/null
@@ -0,0 +1,14 @@
+// Compiler options: -t:library
+
+public class CompilerBug<T>
+{
+       public int Foo (CompilerBug<T> p1, CompilerBug<T> p2)
+       {
+               return 1;
+       }
+
+       public int Foo (CompilerBug<object> p1, CompilerBug<T> p2)
+       {
+               return 2;
+       }
+}
\ No newline at end of file
diff --git a/mcs/tests/gtest-646.cs b/mcs/tests/gtest-646.cs
new file mode 100644 (file)
index 0000000..bc3d6a8
--- /dev/null
@@ -0,0 +1,31 @@
+// Compiler options: -r:gtest-646-lib.dll
+
+public class LocalBug<T>
+{
+       public int Foo (LocalBug<T> p1, LocalBug<T> p2)
+       {
+               return 1;
+       }
+
+       public int Foo (LocalBug<object> p1, LocalBug<T> p2)
+       {
+               return 2;
+       }
+}
+
+class X
+{
+       public static int Main ()
+       {
+               var o = new CompilerBug<object> ();
+               if (o.Foo (o, o) != 2)
+                       return 1;
+
+               var o2 = new LocalBug<object> ();
+               if (o2.Foo (o2, o2) != 2)
+                       return 2;
+
+               return 0;
+       }
+}
+
diff --git a/mcs/tests/test-943.cs b/mcs/tests/test-943.cs
new file mode 100644 (file)
index 0000000..088e2f7
--- /dev/null
@@ -0,0 +1,19 @@
+using System;
+
+public struct MyStruct
+{
+       public int X { get; set; }
+}
+
+class X
+{
+       public static int Main ()
+       {
+               var s = typeof (MyStruct);
+
+               if (s.StructLayoutAttribute.Size != 0)
+                       return 1;
+
+               return 0;
+       }
+}
\ No newline at end of file
diff --git a/mcs/tests/test-async-92.cs b/mcs/tests/test-async-92.cs
new file mode 100644 (file)
index 0000000..e41ac00
--- /dev/null
@@ -0,0 +1,22 @@
+using System.Threading.Tasks;
+
+public class A
+{
+       public async Task<ValueType> Test1 (int input2)
+       {
+               return new ValueType (await Task.FromResult (12345));
+       }
+
+       public static void Main ()
+       {
+               var a = new A ();
+               a.Test1 (1).Wait ();
+       }
+}
+
+public struct ValueType
+{
+       public ValueType (int field2)
+       {
+       }
+}
diff --git a/mcs/tests/test-expression-bodied-03.cs b/mcs/tests/test-expression-bodied-03.cs
new file mode 100644 (file)
index 0000000..fdde90c
--- /dev/null
@@ -0,0 +1,20 @@
+using System;
+
+class X
+{
+       int v;
+
+       public int Prop {
+               get => 1;
+               set => v = value;
+       }
+
+       public event Action A {
+               add => v = 1;
+               remove => v = 2;
+       }
+
+       public static void Main ()
+       {               
+       }
+}
\ No newline at end of file
index 0ce8465a3f05977abecfd1deb58c560bb9a713cb..b06aba48fd5ead3c9127195304de99dfdf14ce4f 100644 (file)
       </method>
     </type>
   </test>
+  <test name="gtest-646.cs">
+    <type name="LocalBug`1[T]">
+      <method name="Int32 Foo(LocalBug`1[T], LocalBug`1[T])" attrs="134">
+        <size>10</size>
+      </method>
+      <method name="Int32 Foo(LocalBug`1[System.Object], LocalBug`1[T])" attrs="134">
+        <size>10</size>
+      </method>
+      <method name="Void .ctor()" attrs="6278">
+        <size>7</size>
+      </method>
+    </type>
+    <type name="X">
+      <method name="Int32 Main()" attrs="150">
+        <size>64</size>
+      </method>
+      <method name="Void .ctor()" attrs="6278">
+        <size>7</size>
+      </method>
+    </type>
+  </test>
   <test name="gtest-anontype-01.cs">
     <type name="Test">
       <method name="Int32 Main()" attrs="150">
       </method>
     </type>
   </test>
+  <test name="test-943.cs">
+    <type name="MyStruct">
+      <method name="Int32 get_X()" attrs="2182">
+        <size>14</size>
+      </method>
+      <method name="Void set_X(Int32)" attrs="2182">
+        <size>8</size>
+      </method>
+    </type>
+    <type name="X">
+      <method name="Int32 Main()" attrs="150">
+        <size>44</size>
+      </method>
+      <method name="Void .ctor()" attrs="6278">
+        <size>7</size>
+      </method>
+    </type>
+  </test>
   <test name="test-95.cs">
     <type name="X">
       <method name="Int32 Main()" attrs="150">
       </method>
     </type>
   </test>
+  <test name="test-async-92.cs">
+    <type name="A">
+      <method name="System.Threading.Tasks.Task`1[ValueType] Test1(Int32)" attrs="134">
+        <size>33</size>
+      </method>
+      <method name="Void Main()" attrs="150">
+        <size>20</size>
+      </method>
+      <method name="Void .ctor()" attrs="6278">
+        <size>7</size>
+      </method>
+    </type>
+    <type name="ValueType">
+      <method name="Void .ctor(Int32)" attrs="6278">
+        <size>2</size>
+      </method>
+    </type>
+    <type name="A+&lt;Test1&gt;c__async0">
+      <method name="Void MoveNext()" attrs="486">
+        <size>174</size>
+      </method>
+      <method name="Void SetStateMachine(System.Runtime.CompilerServices.IAsyncStateMachine)" attrs="486">
+        <size>13</size>
+      </method>
+    </type>
+  </test>
   <test name="test-cls-00.cs">
     <type name="CLSCLass_6">
       <method name="Void add_Disposed(Delegate)" attrs="2182">
       </method>
     </type>
   </test>
+  <test name="test-expression-bodied-03.cs">
+    <type name="X">
+      <method name="Int32 get_Prop()" attrs="2182">
+        <size>9</size>
+      </method>
+      <method name="Void set_Prop(Int32)" attrs="2182">
+        <size>8</size>
+      </method>
+      <method name="Void add_A(System.Action)" attrs="2182">
+        <size>8</size>
+      </method>
+      <method name="Void remove_A(System.Action)" attrs="2182">
+        <size>8</size>
+      </method>
+      <method name="Void Main()" attrs="150">
+        <size>2</size>
+      </method>
+      <method name="Void .ctor()" attrs="6278">
+        <size>7</size>
+      </method>
+    </type>
+  </test>
   <test name="test-externalias-01.cs">
     <type name="Test">
       <method name="Int32 Main()" attrs="150">
index 2d1d7438b9e0c77fef16851eded6cc7097a940ae..ca9d1dfd03b379fb556aaed8632aac224e35ae95 100644 (file)
@@ -49,7 +49,7 @@ net_4_5_dirs := \
        mono-symbolicate        \
        linker-analyzer
 
-build_SUBDIRS = resgen gacutil security culevel cil-stringreplacer commoncryptogenerator resx2sr
+build_SUBDIRS = resgen gacutil security culevel cil-stringreplacer commoncryptogenerator resx2sr linker
 net_4_5_SUBDIRS = gacutil
 net_4_5_PARALLEL_SUBDIRS = $(net_4_5_dirs)
 
@@ -58,13 +58,6 @@ SUBDIRS = $(build_SUBDIRS) $(net_4_5_dirs)
 include ../build/rules.make
 
 DISTFILES = \
-       assemblies.xml                  \
-       mono-win32-setup-dark.bmp       \
-       mono-win32-setup-light.bmp      \
-       mono-win32-setup.nsi            \
-       scan-tests.pl                   \
-       tinderbox/smtp.c                \
-       tinderbox/tinderbox.sh          \
        removecomments.sh
 
 test-local csproj-local run-test-local run-test-ondotnet-local all-local install-local uninstall-local doc-update-local:
diff --git a/mcs/tools/assemblies.xml b/mcs/tools/assemblies.xml
deleted file mode 100644 (file)
index 9dd9652..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-<assemblies>
-       <path url="C:\WINNT\Microsoft.NET\Framework\v1.0.3705">
-               <assembly file="mscorlib.dll"/>
-               <assembly file="System.Web.dll"/>
-               <assembly file="System.dll"/>
-               <assembly file="System.Drawing.dll"/>
-               <assembly file="System.Security.dll"/>
-               <assembly file="System.Windows.Forms.dll"/>
-               <assembly file="System.Xml.dll"/>
-               <assembly file="System.Data.dll"/>
-               <assembly file="System.Design.dll"/>
-               <assembly file="System.EnterpriseServices.dll"/>
-               <assembly file="System.Management.dll"/>
-               <assembly file="System.Messaging.dll"/>
-               <assembly file="System.Runtime.Remoting.dll"/>
-               <assembly file="System.ServiceProcess.dll"/>
-               <assembly file="System.Web.RegularExpressions.dll"/>
-               <assembly file="System.Web.Services.dll"/>
-               <assembly file="System.Web.Mobile.dll"/>
-       </path>
-</assemblies>
index 56000ca67775dca2b5f4439bc2fd5c3831da2458..063a688d47ab292d6825e1f66270affeefd9268a 100644 (file)
@@ -44,7 +44,7 @@ namespace GuiCompare {
                AssemblyDefinition ProcessFile (string file)
                {
                        AddSearchDirectory (Path.GetDirectoryName (file));
-                       var assembly = AssemblyDefinition.ReadAssembly (file, new ReaderParameters { AssemblyResolver = this });
+                       var assembly = AssemblyDefinition.ReadAssembly (file, new ReaderParameters { AssemblyResolver = this, InMemory = true });
                        RegisterAssembly (assembly);
 
                        return assembly;
diff --git a/mcs/tools/linker/Descriptors/Mono.Posix.xml b/mcs/tools/linker/Descriptors/Mono.Posix.xml
deleted file mode 100644 (file)
index 6f0ce66..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<linker>
-       <assembly fullname="Mono.Posix">
-               <type fullname="Mono.Posix.UnixEndPoint" />
-       </assembly>
-</linker>
diff --git a/mcs/tools/linker/Descriptors/System.Core.xml b/mcs/tools/linker/Descriptors/System.Core.xml
deleted file mode 100644 (file)
index e5a547f..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<linker>
-       <assembly fullname="System.Core">
-               <type fullname="System.Runtime.CompilerServices.CallSiteOps" preserve="methods" feature="dynamic" />
-       </assembly>
-</linker>
diff --git a/mcs/tools/linker/Descriptors/System.Drawing.xml b/mcs/tools/linker/Descriptors/System.Drawing.xml
deleted file mode 100644 (file)
index c1ae001..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<linker>
-       <assembly fullname="System.Drawing">
-               <type fullname="System.Drawing.Imaging.BitmapData" preserve="fields" />
-       </assembly>
-</linker>
diff --git a/mcs/tools/linker/Descriptors/System.Web.xml b/mcs/tools/linker/Descriptors/System.Web.xml
deleted file mode 100644 (file)
index 7e98deb..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<linker>
-       <assembly fullname="System.Web">
-               <type fullname="System.Web.Util.ICalls" />
-       </assembly>
-</linker>
diff --git a/mcs/tools/linker/Descriptors/System.xml b/mcs/tools/linker/Descriptors/System.xml
deleted file mode 100644 (file)
index f70c020..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<linker>
-       <assembly fullname="System">
-               <type fullname="System.Configuration.DefaultConfig" />
-               <type fullname="System.Diagnostics.DefaultTraceListener" />
-               <type fullname="System.Diagnostics.FileVersionInfo" />
-               <type fullname="System.Diagnostics.Process" />
-               <type fullname="System.Diagnostics.ProcessModule" />
-               <type fullname="System.IO.FAMWatcher" />
-               <type fullname="System.IO.FileSystemWatcher" />
-               <type fullname="System.IO.InotifyWatcher" />
-               <type fullname="System.Net.Dns" />
-               <type fullname="System.Net.SocketAddress" />
-               <type fullname="System.Net.Sockets.LingerOption" />
-               <type fullname="System.Net.Sockets.Socket" />
-               <type fullname="System.Net.Sockets.MulticastOption" preserve="fields" />
-               <type fullname="System.Net.Sockets.Socket/SocketAsyncResult" preserve="fields" />
-               <type fullname="System.Net.Sockets.SocketException" />
-       </assembly>
-</linker>
diff --git a/mcs/tools/linker/Descriptors/mscorlib.xml b/mcs/tools/linker/Descriptors/mscorlib.xml
deleted file mode 100644 (file)
index a92e407..0000000
+++ /dev/null
@@ -1,409 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<linker>
-       <assembly fullname="mscorlib">
-
-               <type fullname="System.AppDomain" preserve="fields">
-                       <method name="DoDomainUnload" />
-                       <method name="DoTypeResolve" />
-                       <method name="DoAssemblyResolve" />
-                       <method name="DoAssemblyLoad" />
-                       <method name="DoDomainUnload" />
-                       <method name="InternalSetContext" />
-               </type>
-
-               <type fullname="System.AppDomainSetup" preserve="fields" />
-               <type fullname="System.AppDomainUnloadedException" />
-               <type fullname="System.ApplicationException" />
-               <type fullname="System.ArgIterator" />
-               <type fullname="System.ArgumentException" />
-               <type fullname="System.ArgumentNullException" />
-               <type fullname="System.ArgumentOutOfRangeException" />
-               <type fullname="System.ArithmeticException" />
-               <type fullname="System.Array">
-                       <method name="InternalArray__ICollection_get_Count" />
-                       <method name="InternalArray__ICollection_get_IsReadOnly" />
-                       <method name="InternalArray__IEnumerable_GetEnumerator" />
-                       <method name="InternalArray__ICollection_Clear" />
-                       <method name="InternalArray__ICollection_Add" />
-                       <method name="InternalArray__ICollection_Remove" />
-                       <method name="InternalArray__ICollection_Contains" />
-                       <method name="InternalArray__ICollection_CopyTo" />
-                       <method name="InternalArray__Insert" />
-                       <method name="InternalArray__RemoveAt" />
-                       <method name="InternalArray__IndexOf" />
-                       <method name="InternalArray__get_Item" />
-                       <method name="InternalArray__set_Item" />
-                       <method name="InternalArray__IReadOnlyList_get_Item" />
-                       <method name="InternalArray__IReadOnlyCollection_get_Count" />
-               </type>
-               <type fullname="System.ArrayTypeMismatchException" />
-               <type fullname="System.Attribute" />
-               <type fullname="System.BadImageFormatException" />
-               <type fullname="System.Boolean" preserve="fields" />
-               <type fullname="System.Byte" preserve="fields" />
-               <type fullname="System.CannotUnloadAppDomainException" />
-               <type fullname="System.Char" preserve="fields" />
-               <type fullname="System.Console" preserve="fields" />
-               <type fullname="System.ConsoleDriver" preserve="fields" />
-               <type fullname="System.ContextBoundObject" preserve="fields" />
-               <!-- <type fullname="System.Convert" /> -->
-               <type fullname="System.CurrentSystemTimeZone" />
-               <type fullname="System.DateTime" preserve="fields" />
-               <type fullname="System.DBNull" preserve="fields" />
-               <type fullname="System.Decimal" preserve="fields" />
-               <type fullname="System.Delegate" preserve="fields" />
-               <type fullname="System.Diagnostics.StackFrame" />
-               <type fullname="System.Diagnostics.StackTrace" />
-               <type fullname="System.DivideByZeroException" />
-               <!-- debugger-agent.c: create_event_list -->
-               <type fullname="System.Diagnostics.DebuggerNonUserCodeAttribute"/>
-               <type fullname="System.Diagnostics.DebuggerHiddenAttribute"/>
-               <type fullname="System.Diagnostics.DebuggerStepThroughAttribute"/>
-               
-               <type fullname="System.DllNotFoundException" />
-               <type fullname="System.Double" preserve="fields" />
-               <type fullname="System.Enum" preserve="fields">
-                       <method name="GetValues" />
-               </type>
-               <type fullname="System.EntryPointNotFoundException" />
-               <type fullname="System.Environment">
-                       <field name="mono_corlib_version" />
-                       <method name="get_StackTrace" />
-               </type>
-               <type fullname="System.Exception" />
-               <type fullname="System.ExecutionEngineException" />
-               <type fullname="System.FieldAccessException" />
-               <type fullname="System.FormatException" />
-               <type fullname="System.GC" />
-               <type fullname="System.IndexOutOfRangeException" />
-               <type fullname="System.Int16" preserve="fields" />
-               <type fullname="System.Int32" preserve="fields" />
-               <type fullname="System.Int64" preserve="fields" />
-               <type fullname="System.IntPtr" preserve="fields" />
-               <type fullname="System.InvalidCastException" />
-               <type fullname="System.InvalidOperationException" />
-               <type fullname="System.InvalidProgramException" />
-               <type fullname="System.MarshalByRefObject" preserve="fields" feature="remoting" />
-               <type fullname="System.MethodAccessException" />
-               <type fullname="System.Missing" preserve="fields" />
-               <type fullname="System.MissingFieldException" />
-               <type fullname="System.MissingMethodException" />
-               <type fullname="System.MonoAsyncCall" preserve="fields" />
-               <type fullname="System.MonoCustomAttrs" preserve="fields" />
-               <type fullname="System.MonoCustomAttrs/AttributeInfo" preserve="fields" />
-               <type fullname="System.MonoCQItem" preserve="all" />
-               <type fullname="System.MonoEnumInfo" preserve="fields" />
-               <type fullname="System.MonoListItem" preserve="fields" />
-               <type fullname="System.MonoType" preserve="fields" />
-               <type fullname="System.MulticastDelegate" preserve="fields" />
-               <type fullname="System.NotImplementedException" />
-               <type fullname="System.NotSupportedException" />
-               <type fullname="System.NullReferenceException" />
-               <type fullname="System.Nullable`1" preserve="fields">
-                       <method name="Box" />
-                       <method name="Unbox" />
-               </type>
-               <type fullname="System.Object" />
-               <type fullname="System.OutOfMemoryException" />
-               <type fullname="System.RuntimeArgumentHandle" preserve="fields" />
-               <type fullname="System.RuntimeFieldHandle" preserve="fields" />
-               <type fullname="System.RuntimeMethodHandle" preserve="fields" />
-               <type fullname="System.RuntimeTypeHandle" preserve="fields" />
-               <type fullname="System.SByte" preserve="fields" />
-               <type fullname="System.Single" preserve="fields" />
-               <type fullname="System.StackOverflowException" />
-               <type fullname="System.STAThreadAttribute" />
-               <type fullname="System.String" preserve="fields">
-                       <method name="CreateString" />
-                       <method name="InternalAllocateStr" />
-                       <method name="FastAllocateString" />
-                       <method name="memcpy" />
-                       <method name="memset" />
-                       <method name="bzero" />
-                       <method name="bzero_aligned_1" />
-                       <method name="bzero_aligned_2" />
-                       <method name="bzero_aligned_4" />
-                       <method name="bzero_aligned_8" />
-                       <method name="memcpy_aligned_1" />
-                       <method name="memcpy_aligned_2" />
-                       <method name="memcpy_aligned_4" />
-                       <method name="memcpy_aligned_8" />
-               </type>
-               <type fullname="System.SystemException" />
-               <type fullname="System.Type" preserve="fields">
-                       <method name="GetTypeFromHandle" />
-               </type>
-               <type fullname="System.TypeInitializationException" />
-               <type fullname="System.TypeLoadException" />
-               <type fullname="System.TypedReference" preserve="fields" />
-               <type fullname="System.UInt16" preserve="fields" />
-               <type fullname="System.UInt32" preserve="fields" />
-               <type fullname="System.UInt64" preserve="fields" />
-               <type fullname="System.UIntPtr" preserve="fields" />
-               <type fullname="System.UnhandledExceptionEventArgs" />
-               <type fullname="System.ValueType" preserve="fields" />
-               <type fullname="System.Variant" preserve="fields" feature="com">
-                       <method name="Clear" />
-               </type>
-               <type fullname="System.Version">
-                 <method signature="System.Void .ctor(System.Int32,System.Int32,System.Int32,System.Int32)" />
-               </type>
-               <type fullname="System.Void" />
-               <type fullname="System.__ComObject" feature="com" />
-
-               <type fullname="System.Collections.Generic.ICollection`1" />
-               <type fullname="System.Collections.Generic.IEnumerable`1" />
-               <type fullname="System.Collections.Generic.IEnumerator`1" />
-               <type fullname="System.Collections.Generic.IReadOnlyList`1" />
-               <type fullname="System.Collections.Generic.IReadOnlyCollection`1" />
-
-               <type fullname="System.Collections.Generic.IList`1" />
-               <type fullname="System.Collections.Generic.GenericEqualityComparer`1">
-                       <method name=".ctor" />
-               </type>
-               <type fullname="System.Collections.Generic.GenericComparer`1">
-                       <method name=".ctor" />
-               </type>
-
-               <type fullname="System.Globalization.DateTimeFormatInfo" preserve="fields" />
-               <type fullname="System.Globalization.CompareInfo" preserve="fields" />
-               <type fullname="System.Globalization.CultureInfo" preserve="fields">
-                       <method name="CreateCulture" />
-               </type>
-               <type fullname="System.Globalization.NumberFormatInfo" preserve="fields" />
-               <type fullname="System.Globalization.RegionInfo" preserve="fields" />
-               <type fullname="System.Globalization.SortKey" preserve="fields" />
-
-               <!--
-               <type fullname="System.IO.FileMode" />
-               <type fullname="System.IO.FileNotFoundException" />
-               <type fullname="System.IO.FileLoadException" />
-               <type fullname="System.IO.FileStreamAsyncResult" />
-               <type fullname="System.IO.IOException" />
-               <type fullname="System.IO.MonoIO" preserve="fields" />
-               <type fullname="System.IO.Path" />
-               <type fullname="System.IO.StreamReader" />
-               -->
-
-               <type fullname="System.Reflection.MonoAssembly">
-                       <method name=".ctor" />
-               </type>
-               <type fullname="System.Reflection.MonoModule">
-                       <method name=".ctor" />
-               </type>
-
-               <type fullname="System.Reflection.Assembly" preserve="fields">
-                       <method name="MonoDebugger_GetMethodToken" feature="sre" />
-                       <method name="GetNamespaces" feature="sre" />
-               </type>
-               <type fullname="System.Reflection.AssemblyName" preserve="fields" />
-               <type fullname="System.Reflection.ConstructorInfo" preserve="fields" />
-               <type fullname="System.Reflection.CustomAttributeData" preserve="fields">
-                 <method signature="System.Void .ctor(System.Reflection.ConstructorInfo,System.Reflection.Assembly,System.IntPtr,System.UInt32)" />
-               </type>
-               <type fullname="System.Reflection.CustomAttributeNamedArgument" preserve="fields" />
-               <type fullname="System.Reflection.CustomAttributeTypedArgument" preserve="fields" />
-               <type fullname="System.Reflection.EventInfo" preserve="fields">
-                       <method name="AddEventFrame" />
-                       <method name="StaticAddEventAdapterFrame" />
-               </type>
-               <type fullname="System.Reflection.ExceptionHandlingClause" preserve="fields" />
-               <type fullname="System.Reflection.FieldInfo" preserve="fields" />
-               <type fullname="System.Reflection.LocalVariableInfo" preserve="fields" />
-               <type fullname="System.Reflection.ManifestResourceInfo" preserve="fields" />
-               <type fullname="System.Reflection.MethodBase" preserve="fields" />
-               <type fullname="System.Reflection.MethodBody" preserve="fields" />
-               <type fullname="System.Reflection.MethodInfo" preserve="fields" />
-               <type fullname="System.Reflection.Module" preserve="fields">
-                       <method name="Mono_GetGuid" feature="sre" />
-               </type>
-               <type fullname="System.Reflection.MonoArrayMethod" preserve="fields" />
-               <type fullname="System.Reflection.MonoCMethod" preserve="fields" />
-               <type fullname="System.Reflection.MonoEvent" preserve="fields" />
-               <type fullname="System.Reflection.MonoEventInfo" preserve="fields" />
-               <type fullname="System.Reflection.MonoField" preserve="fields" />
-               <type fullname="System.Reflection.MonoGenericClass" preserve="fields" />
-               <type fullname="System.Reflection.MonoMethod" preserve="fields" />
-               <type fullname="System.Reflection.MonoMethodInfo" preserve="fields" />
-               <type fullname="System.Reflection.MonoPropertyInfo" preserve="fields" />
-               <type fullname="System.Reflection.MonoProperty" preserve="fields">
-                       <method name="GetterAdapterFrame" />
-                       <method name="StaticGetterAdapterFrame" />
-               </type>
-               <type fullname="System.Reflection.ParameterInfo" preserve="fields" />
-               <!-- reflection.c: ves_icall_get_parameter_info -->
-               <type fullname="System.Reflection.MonoParameterInfo" preserve="fields" />
-               
-               <type fullname="System.Reflection.PropertyInfo" preserve="fields" />
-               <type fullname="System.Reflection.ReflectionTypeLoadException" />
-               <type fullname="System.Reflection.TargetException" />
-               <type fullname="System.Reflection.TargetParameterCountException" />
-
-               <type fullname="System.Reflection.Emit.AssemblyBuilder" preserve="fields">
-                       <method name="AddPermissionRequests" />
-                       <method name="AddModule" />
-                       <method name="DefineIconResource" />
-                       <method name="AddTypeForwarder" />
-                       <method name="EmbedResourceFile" />
-               </type>
-               <type fullname="System.Reflection.Emit.ConstructorBuilder" preserve="fields" />
-               <type fullname="System.Reflection.Emit.CustomAttributeBuilder" preserve="fields" />
-               <type fullname="System.Reflection.Emit.DynamicMethod" preserve="fields" />
-               <type fullname="System.Reflection.Emit.EnumBuilder" preserve="fields" />
-               <type fullname="System.Reflection.Emit.EventBuilder" preserve="fields" />
-               <type fullname="System.Reflection.Emit.FieldBuilder" preserve="fields" />
-               <type fullname="System.Reflection.Emit.GenericTypeParameterBuilder" preserve="fields" />
-               <type fullname="System.Reflection.Emit.ILExceptionBlock" preserve="fields" />
-               <type fullname="System.Reflection.Emit.ILExceptionInfo" preserve="fields" />
-               <type fullname="System.Reflection.Emit.ILGenerator" preserve="fields">
-                       <method name="Mono_GetCurrentOffset" />
-               </type>
-               <type fullname="System.Reflection.Emit.LocalBuilder" preserve="fields">
-                       <method name="Mono_GetLocalIndex" />
-               </type>
-               <type fullname="System.Reflection.Emit.MethodBuilder" preserve="fields" />
-               <type fullname="System.Reflection.Emit.ModuleBuilder" preserve="fields">
-                       <method name="Mono_GetGuid" />
-                       <method name="RuntimeResolve" />
-               </type>
-               <type fullname="System.Reflection.Emit.MonoResource" preserve="fields" />
-               <type fullname="System.Reflection.Emit.MonoWin32Resource" preserve="fields" />
-               <type fullname="System.Reflection.Emit.ParameterBuilder" preserve="fields" />
-               <type fullname="System.Reflection.Emit.PropertyBuilder" preserve="fields" />
-               <type fullname="System.Reflection.Emit.SignatureHelper" preserve="fields" />
-               <type fullname="System.Reflection.Emit.TypeBuilder" preserve="fields">
-                       <method name="SetCharSet" />
-               </type>
-               <type fullname="System.Reflection.Emit.UnmanagedMarshal" preserve="fields">
-                       <method name="DefineCustom" />
-                       <method name="DefineLPArrayInternal" />
-               </type>
-
-               <!--
-               <type fullname="System.Runtime.CompilerServices.CallConvCdecl" />
-               <type fullname="System.Runtime.CompilerServices.CallConvStdcall" />
-               <type fullname="System.Runtime.CompilerServices.CallConvFastcall" />
-               <type fullname="System.Runtime.CompilerServices.CallConvThiscall" />
-               -->
-
-               <type fullname="System.Runtime.CompilerServices.InternalsVisibleToAttribute" />
-               <type fullname="System.Runtime.CompilerServices.RuntimeWrappedException">
-                 <method signature="System.Void .ctor(System.Object)" />
-               </type>
-               <!-- <type fullname="System.Runtime.CompilerServices.RequiredAttributeAttribute" />
-               <type fullname="System.Runtime.CompilerServices.RuntimeHelpers" />
-               <type fullname="System.Runtime.CompilerServices.TypeForwardedToAttribute" /> -->
-
-               <!-- <type fullname="System.Runtime.InteropServices.DllImportAttribute" /> -->
-               <type fullname="System.Runtime.InteropServices.GCHandle" />
-               <!-- <type fullname="System.Runtime.InteropServices.GuidAttribute" /> -->
-               <type fullname="System.Runtime.InteropServices.HandleRef" />
-               <type fullname="System.Runtime.InteropServices.ICustomMarshaler" />
-               <!--<type fullname="System.Runtime.InteropServices.InterfaceTypeAttribute" /> -->
-               <type fullname="System.Runtime.InteropServices.Marshal" />
-               <!-- <type fullname="System.Runtime.InteropServices.MarshalDirectiveException" />
-               <type fullname="System.Runtime.InteropServices.SafeHandle" />
-               <type fullname="System.Runtime.InteropServices.StructLayoutAttribute" />
-               <type fullname="System.Runtime.InteropServices.UnmanagedFunctionPointerAttribute" />-->
-
-               <!-- <type fullname="System.Runtime.Remoting.Activation.ActivationServices" /> -->
-               <type fullname="System.Runtime.Remoting.Contexts.Context" preserve="fields">
-                       <method name="get_NeedsContextSink" />
-               </type>
-               <type fullname="System.Runtime.Remoting.Channels.CrossAppDomainSink" />
-               <type fullname="System.Runtime.Remoting.IRemotingTypeInfo">
-                       <method name="CanCastTo" />
-               </type>
-               <type fullname="System.Runtime.Remoting.Messaging.AsyncResult" preserve="fields" />
-               <type fullname="System.Runtime.Remoting.Messaging.CallContext">
-                       <method name="SetCurrentCallContext" />
-               </type>
-               <type fullname="System.Runtime.Remoting.Messaging.MonoMethodMessage" preserve="fields">
-                       <method name="InitMessage" />
-               </type>
-               <type fullname="System.Runtime.Remoting.Proxies.RealProxy" preserve="fields">
-                       <method name="PrivateInvoke" />
-                       <method name="GetAppDomainTarget" />
-               </type>
-               <type fullname="System.Runtime.Remoting.Proxies.TransparentProxy" preserve="fields">
-                       <method name="LoadRemoteFieldNew" />
-                       <method name="StoreRemoteField" />
-               </type>
-               <type fullname="System.Runtime.Remoting.RemotingServices">
-                       <method name="SerializeCallData" />
-                       <method name="DeserializeCallData" />
-                       <method name="SerializeExceptionData" />
-               </type>
-
-               <!--
-               <type fullname="System.Runtime.Serialization.ISerializable" />
-               <type fullname="System.Runtime.Serialization.SerializationException" />
-               <type fullname="System.Runtime.Serialization.SerializationInfo" />
-               <type fullname="System.Runtime.Serialization.StreamingContext" />
-               -->
-
-               <type fullname="System.Threading.ExecutionContext" />
-               <type fullname="System.Threading.Interlocked">
-                       <method name="CompareExchange" />
-                       <method name="Exchange" />
-               </type>
-               <type fullname="System.Threading.Monitor">
-                       <method name="Enter" />
-                       <method name="Exit" />
-                       <method name="enter_with_atomic_var" />
-               </type>
-
-               <!--
-               <type fullname="System.Threading.Mutex" />
-               <type fullname="System.Threading.NativeEventCalls" />
-               <type fullname="System.Threading.Semaphore" />
-               -->
-
-               <type fullname="System.Threading.SynchronisationLockException" />
-               <type fullname="System.Threading.Thread" preserve="fields">
-                       <method name="get_CurrentContext" />
-               </type>
-               <type fullname="System.Threading.InternalThread" preserve="fields" />
-               <type fullname="System.Threading.ThreadAbortException" />
-               <type fullname="System.Threading.ThreadInterruptedException" />
-               <!--<type fullname="System.Threading.ThreadPool" />-->
-               <type fullname="System.Threading.ThreadState" preserve="fields" />
-               <type fullname="System.Threading.ThreadStateException" />
-               <type fullname="System.Threading.WaitHandle" preserve="fields">
-                       <method name="set_Handle" />
-               </type>
-               <type fullname="System.Threading._ThreadPoolWaitCallback">
-                 <method name="PerformWaitCallback"/>
-               </type>
-
-               <type fullname="System.Text.StringBuilder" preserve="fields" />
-
-               <type fullname="System.Security.AllowPartiallyTrustedCallersAttribute" />
-               <type fullname="System.Security.Policy.Evidence" />
-               <!--
-               <type fullname="System.Security.Principal.WindowsIdentity" />
-               <type fullname="System.Security.Principal.WindowsImpersonationContext" />
-               <type fullname="System.Security.Principal.WindowsPrincipal" />
-               <type fullname="System.Security.RuntimeSecurityFrame" />
-               <type fullname="System.Security.SecurityCriticalAttribute" />
-               <type fullname="System.Security.SecurityException" />
-               -->
-               <type fullname="System.Security.SecurityManager" />
-               <!--
-               <type fullname="System.Security.SuppressUnmanagedCodeSecurityAttribute" />
-               <type fullname="System.Security.VerificationException" />
-               -->
-
-               <namespace fullname="System.Security.Cryptography" feature="crypto" />
-
-               <type fullname="Mono.Interop.ComInteropProxy" feature="com" />
-               <type fullname="Mono.Interop.IDispatch" feature="com" />
-               <type fullname="Mono.Interop.IUnknown" feature="com"/>
-
-                <!-- by convention (and see #34671) -->
-                <type fullname="Mono.Runtime" />
-
-               <type fullname="Mono.RuntimeStructs/HandleStackMark" />
-               <type fullname="Mono.RuntimeStructs/MonoError" />
-       </assembly>
-</linker>
index 3dd8398d2bcfad2456c4cf303d6cc2cd34666bf0..6823765ffd3cd3b726897f9a5ff9221b728d0663 100644 (file)
@@ -2,21 +2,43 @@ thisdir = tools/linker
 SUBDIRS =
 include ../../build/rules.make
 
-RESOURCES = \
-       Descriptors/mscorlib.xml        \
-       Descriptors/System.xml          \
-       Descriptors/System.Core.xml             \
-       Descriptors/System.Drawing.xml  \
-       Descriptors/System.Web.xml              \
-       Descriptors/Mono.Posix.xml              \
-
 PROGRAM = monolinker.exe
 
-$(PROGRAM): $(RESOURCES)
-
 LIB_REFS = System System.Core System.Xml Mono.Cecil
-LOCAL_MCS_FLAGS = $(RESOURCES:%=-resource:%)
 
-EXTRA_DISTFILES = $(RESOURCES)
+TEST_CASES = \
+       mscorlib/test-array.cs
+
+ifndef AOT_FRIENDLY_PROFILE
+TEST_CASES += \
+       mscorlib/test-reflection.cs
+endif
+
+TESTS_COMPILER = $(MCS) -nologo -noconfig -debug:portable -r:$(topdir)/class/lib/$(PROFILE_DIRECTORY)/mscorlib.dll
+
+check: compile-tests
+       $(MAKE) run-tests
+
+compile-tests: $(TEST_CASES)
+
+mscorlib/test-%.cs:
+       $(TESTS_COMPILER) Tests/$@ /out:Tests/$(@:.cs=.exe)
+
+run-tests: $(TEST_CASES:.cs=.exe)
+
+LINKER_OUTPUT := illink-output-$(PROFILE_DIRECTORY)
+PROFILE_PATH = $(topdir)/class/lib/$(PROFILE_DIRECTORY)
+LINKER = MONO_PATH=$(topdir)/class/lib/$(BUILD_TOOLS_PROFILE) $(RUNTIME) $(RUNTIME_FLAGS) $(topdir)/class/lib/$(BUILD_TOOLS_PROFILE)/monolinker.exe -c link -out $(LINKER_OUTPUT) -b true -d $(PROFILE_PATH)
+TEST_EXEC = MONO_PATH=$(LINKER_OUTPUT) $(RUNTIME) $(RUNTIME_FLAGS) --debug -O=-aot
+
+.NOTPARALLEL:
+
+mscorlib/test-%.exe:
+       @rm -rf $(LINKER_OUTPUT)
+       @mkdir $(LINKER_OUTPUT)
+       @echo Testing $@
+       $(LINKER) -a Tests/$@
+       $(TEST_EXEC) $(LINKER_OUTPUT)/$(@F)
+       @rm -rf $(LINKER_OUTPUT)
 
 include ../../build/executable.make
diff --git a/mcs/tools/linker/Tests/mscorlib/test-array.cs b/mcs/tools/linker/Tests/mscorlib/test-array.cs
new file mode 100644 (file)
index 0000000..dc192b7
--- /dev/null
@@ -0,0 +1,10 @@
+using System.Collections;
+
+public class C
+{
+       public static int Main ()
+       {
+               IEnumerable ie = new int [3];
+               return 0;
+       }
+}
\ No newline at end of file
diff --git a/mcs/tools/linker/Tests/mscorlib/test-reflection.cs b/mcs/tools/linker/Tests/mscorlib/test-reflection.cs
new file mode 100644 (file)
index 0000000..b36b296
--- /dev/null
@@ -0,0 +1,35 @@
+using System;
+using System.Collections;
+using System.Reflection;
+using System.Reflection.Emit;
+using System.Threading;
+using System.IO;
+
+public class C
+{
+       public static int Main ()
+       {
+               const string ASSEMBLY_NAME = "TypeBuilderTest";
+                       
+               AssemblyName assemblyName = new AssemblyName ();
+               assemblyName.Name = ASSEMBLY_NAME;
+
+               var assembly = Thread.GetDomain ().DefineDynamicAssembly (
+                               assemblyName, AssemblyBuilderAccess.RunAndSave, Path.GetTempPath ());
+
+               var module = assembly.DefineDynamicModule ("module1");
+
+               TypeBuilder tb = module.DefineType ("bla", TypeAttributes.Public);
+               GenericTypeParameterBuilder [] typeParams = tb.DefineGenericParameters ("T");
+
+               ConstructorBuilder cb = tb.DefineDefaultConstructor (MethodAttributes.Public);
+
+               Type t = tb.MakeGenericType (typeof (int));
+               t.MakeArrayType ();
+
+               Type created = tb.CreateType ();
+
+               Type inst = created.MakeGenericType (typeof (object));          
+               return 0;
+       }
+}
index f0e2169f2672872ac599b557d378da842d75270b..d94c70ed951857d43d5e92832f53cfdbff8ed4eb 100644 (file)
@@ -2,6 +2,7 @@
 ../../../external/linker/linker/Mono.Linker/AssemblyInfo.cs
 ../../../external/linker/linker/Mono.Linker/AssemblyResolver.cs
 ../../../external/linker/linker/Mono.Linker/TypePreserve.cs
+../../../external/linker/linker/Mono.Linker/TypeReferenceExtensions.cs
 ../../../external/linker/linker/Mono.Linker/Annotations.cs
 ../../../external/linker/linker/Mono.Linker/LinkContext.cs
 ../../../external/linker/linker/Mono.Linker/AssemblyAction.cs
@@ -12,6 +13,7 @@
 ../../../external/linker/linker/Mono.Linker/IXApiVisitor.cs
 ../../../external/linker/linker/Mono.Linker/LoadException.cs
 ../../../external/linker/linker/Mono.Linker/MarkException.cs
+../../../external/linker/linker/Mono.Linker/MethodReferenceExtensions.cs
 ../../../external/linker/linker/Mono.Linker.Steps/BaseStep.cs
 ../../../external/linker/linker/Mono.Linker.Steps/LoadReferencesStep.cs
 ../../../external/linker/linker/Mono.Linker.Steps/LoadI18nAssemblies.cs
index 559bc2b9b3f5a99eeecc7b0fe384f4b0b82ac3d7..4042f07d6b1f95913b06f4abced3550719699319 100644 (file)
@@ -15,10 +15,11 @@ public class MdbDump
                        return 1;
                }
 
-               var assembly = AssemblyDefinition.ReadAssembly (args[0]);
+               using (var assembly = AssemblyDefinition.ReadAssembly (args[0])) {
 
-               var f = MonoSymbolFile.ReadSymbolFile (args[0] + ".mdb");
-               DumpSymbolFile (assembly, f, Console.Out);
+                       var f = MonoSymbolFile.ReadSymbolFile (args[0] + ".mdb");
+                       DumpSymbolFile (assembly, f, Console.Out);
+               }
 
                return 0;
        }
index a76e9f88c92a1440897c007e92937f4d16b89311..ab13accc034c54695fba45e8b4deecf3854a0f30 100755 (executable)
@@ -1110,6 +1110,14 @@ void          mono_register_config_for_assembly (const char* assembly_name, cons
                }
 
                if (error != null) {
+                       Console.Error.WriteLine ("Failure to load i18n assemblies, the following directories were searched for the assemblies:");
+                       foreach (var path in link_paths){
+                               Console.Error.WriteLine ("   Path: " + path);
+                       }
+                       if (custom_mode){
+                               Console.WriteLine ("In Custom mode, you need to provide the directory to lookup assemblies from using -L");
+                       }
+                       
                        Error ("Couldn't load one or more of the i18n assemblies: " + error);
                        Environment.Exit (1);
                }
@@ -1183,7 +1191,12 @@ void          mono_register_config_for_assembly (const char* assembly_name, cons
                Assembly a = null;
                
                try {
+                       if (!quiet)
+                               Console.WriteLine ("Attempting to load assembly: {0}", assembly);
                        a = universe.LoadFile (assembly);
+                       if (!quiet)
+                               Console.WriteLine ("Assembly {0} loaded successfully.", assembly);
+                       
                } catch (FileNotFoundException){
                        Error ($"Cannot find assembly `{assembly}'");
                } catch (IKVM.Reflection.BadImageFormatException f) {
@@ -1206,6 +1219,8 @@ void          mono_register_config_for_assembly (const char* assembly_name, cons
                string total_log = "";
                foreach (string dir in link_paths){
                        string full_path = Path.Combine (dir, assembly);
+                       if (!quiet)
+                               Console.WriteLine ("Attempting to load assembly from: " + full_path);
                        if (!assembly.EndsWith (".dll") && !assembly.EndsWith (".exe"))
                                full_path += ".dll";
                        
index f03adfdee58e7b86d9292f53eb28e1bcfdf4ee6f..8a0f6ece91bd5873c690abc7a90d069eb0f55e7b 100644 (file)
@@ -11,7 +11,7 @@ namespace Mono
 {
        class AssemblyLocationProvider
        {
-               AssemblyDefinition assembly;
+               string assemblyFullPath;
                Logger logger;
 
                public AssemblyLocationProvider (string assemblyPath, Logger logger)
@@ -22,85 +22,88 @@ namespace Mono
                        if (!File.Exists (assemblyPath))
                                throw new ArgumentException ("assemblyPath does not exist: "+ assemblyPath);
 
-                       var readerParameters = new ReaderParameters { ReadSymbols = true };
-                       assembly = AssemblyDefinition.ReadAssembly (assemblyPath, readerParameters);
+                       assemblyFullPath = assemblyPath;
                }
 
                public bool TryResolveLocation (StackFrameData sfData, SeqPointInfo seqPointInfo)
                {
-                       if (!assembly.MainModule.HasSymbols)
-                               return false;
+                       var readerParameters = new ReaderParameters { ReadSymbols = true };
+                       using (var assembly = AssemblyDefinition.ReadAssembly (assemblyFullPath, readerParameters)) {
 
-                       TypeDefinition type = null;
-                       string[] nested;
-                       if (sfData.TypeFullName.IndexOf ('/') >= 0)
-                                nested = sfData.TypeFullName.Split ('/');
-                       else
-                               nested = sfData.TypeFullName.Split ('+');
-
-                       var types = assembly.MainModule.Types;
-                       foreach (var ntype in nested) {
-                               if (type == null) {
-                                       // Use namespace first time.
-                                       type = types.FirstOrDefault (t => t.FullName == ntype);
-                               } else {
-                                       type = types.FirstOrDefault (t => t.Name == ntype);
+                               if (!assembly.MainModule.HasSymbols)
+                                       return false;
+
+                               TypeDefinition type = null;
+                               string[] nested;
+                               if (sfData.TypeFullName.IndexOf ('/') >= 0)
+                                       nested = sfData.TypeFullName.Split ('/');
+                               else
+                                       nested = sfData.TypeFullName.Split ('+');
+
+                               var types = assembly.MainModule.Types;
+                               foreach (var ntype in nested) {
+                                       if (type == null) {
+                                               // Use namespace first time.
+                                               type = types.FirstOrDefault (t => t.FullName == ntype);
+                                       } else {
+                                               type = types.FirstOrDefault (t => t.Name == ntype);
+                                       }
+
+                                       if (type == null) {
+                                               logger.LogWarning ("Could not find type: {0}", ntype);
+                                               return false;
+                                       }
+
+                                       types = type.NestedTypes;
                                }
 
-                               if (type == null) {
-                                       logger.LogWarning ("Could not find type: {0}", ntype);
+                               var parensStart = sfData.MethodSignature.IndexOf ('(');
+                               var methodName = sfData.MethodSignature.Substring (0, parensStart).TrimEnd ();
+                               var methodParameters = sfData.MethodSignature.Substring (parensStart);
+                               var methods = type.Methods.Where (m => CompareName (m, methodName) && CompareParameters (m.Parameters, methodParameters)).ToArray ();
+                               if (methods.Length == 0) {
+                                       logger.LogWarning ("Could not find method: {0}", methodName);
+                                       return false;
+                               }
+                               if (methods.Length > 1) {
+                                       logger.LogWarning ("Ambiguous match for method: {0}", sfData.MethodSignature);
                                        return false;
                                }
+                               var method = methods [0];
 
-                               types = type.NestedTypes;
-                       }
+                               int ilOffset;
+                               if (sfData.IsILOffset) {
+                                       ilOffset = sfData.Offset;
+                               } else {
+                                       if (seqPointInfo == null)
+                                               return false;
 
-                       var parensStart = sfData.MethodSignature.IndexOf ('(');
-                       var methodName = sfData.MethodSignature.Substring (0, parensStart).TrimEnd ();
-                       var methodParameters = sfData.MethodSignature.Substring (parensStart);
-                       var methods = type.Methods.Where (m => CompareName (m, methodName) && CompareParameters (m.Parameters, methodParameters)).ToArray ();
-                       if (methods.Length == 0) {
-                               logger.LogWarning ("Could not find method: {0}", methodName);
-                               return false;
-                       }
-                       if (methods.Length > 1) {
-                               logger.LogWarning ("Ambiguous match for method: {0}", sfData.MethodSignature);
-                               return false;
-                       }
-                       var method = methods [0];
+                                       ilOffset = seqPointInfo.GetILOffset (method.MetadataToken.ToInt32 (), sfData.MethodIndex, sfData.Offset);
+                               }
 
-                       int ilOffset;
-                       if (sfData.IsILOffset) {
-                               ilOffset = sfData.Offset;
-                       } else {
-                               if (seqPointInfo == null)
+                               if (ilOffset < 0)
                                        return false;
 
-                               ilOffset = seqPointInfo.GetILOffset (method.MetadataToken.ToInt32 (), sfData.MethodIndex, sfData.Offset);
-                       }
+                               if (!method.DebugInformation.HasSequencePoints)
+                                       return false;
 
-                       if (ilOffset < 0)
-                               return false;
+                               SequencePoint prev = null;
+                               foreach (var sp in method.DebugInformation.SequencePoints.OrderBy (l => l.Offset)) {
+                                       if (sp.Offset >= ilOffset) {
+                                               sfData.SetLocation (sp.Document.Url, sp.StartLine);
+                                               return true;
+                                       }
 
-                       if (!method.DebugInformation.HasSequencePoints)
-                               return false;
+                                       prev = sp;
+                               }
 
-                       SequencePoint prev = null;
-                       foreach (var sp in method.DebugInformation.SequencePoints.OrderBy (l => l.Offset)) {
-                               if (sp.Offset >= ilOffset) {
-                                       sfData.SetLocation (sp.Document.Url, sp.StartLine);
+                               if (prev != null) {
+                                       sfData.SetLocation (prev.Document.Url, prev.StartLine);
                                        return true;
                                }
 
-                               prev = sp;
-                       }
-
-                       if (prev != null) {
-                               sfData.SetLocation (prev.Document.Url, prev.StartLine);
-                               return true;
+                               return false;
                        }
-
-                       return false;
                }
 
                static bool CompareName (MethodDefinition candidate, string expected)
index a204788306bb274ca648c24aca209d39d34fac60..eb06043a82396321b3a4419b21510e13bd71f19d 100644 (file)
@@ -107,10 +107,11 @@ namespace Mono
                                                continue;
                                        }
 
-                                       var assembly = AssemblyDefinition.ReadAssembly (assemblyPath);
-
-                                       var mvid = assembly.MainModule.Mvid.ToString ("N");
-                                       var mvidDir = Path.Combine (msymDir, mvid);
+                                       string mvidDir;
+                                       using (var assembly = AssemblyDefinition.ReadAssembly (assemblyPath)) {
+                                               var mvid = assembly.MainModule.Mvid.ToString ("N");
+                                               mvidDir = Path.Combine (msymDir, mvid);
+                                       }
 
                                        if (Directory.Exists (mvidDir)) {
                                                try {
diff --git a/mcs/tools/mono-win32-setup-dark.bmp b/mcs/tools/mono-win32-setup-dark.bmp
deleted file mode 100755 (executable)
index d54f6a3..0000000
Binary files a/mcs/tools/mono-win32-setup-dark.bmp and /dev/null differ
diff --git a/mcs/tools/mono-win32-setup-light.bmp b/mcs/tools/mono-win32-setup-light.bmp
deleted file mode 100755 (executable)
index df4aec1..0000000
Binary files a/mcs/tools/mono-win32-setup-light.bmp and /dev/null differ
diff --git a/mcs/tools/mono-win32-setup.nsi b/mcs/tools/mono-win32-setup.nsi
deleted file mode 100755 (executable)
index d4dc171..0000000
+++ /dev/null
@@ -1,708 +0,0 @@
-; =====================================================\r
-; mono.nsi - Mono Setup wizard for windows\r
-; =====================================================\r
-;\r
-; (C) Copyright 2003 by Johannes Roith\r
-; (C) Copyright 2003 by Daniel Morgan\r
-;\r
-; Authors: \r
-;       Johannes Roith <johannes@jroith.de>\r
-;       Daniel Morgan <danmorg@sc.rr.com>\r
-;\r
-; This .nsi includes code from the NSIS Archives:\r
-; function StrReplace and VersionCheck \r
-; by Hendri Adriaens\r
-; HendriAdriaens@hotmail.com\r
-; \r
-; =====================================================\r
-;\r
-; This script can build a binary setup wizard of mono.\r
-; It is released under the GNU GPL.\r
-;\r
-; =====================================================\r
-; SET MILESTONE & SOURCE DIR\r
-; =====================================================\r
-;\r
-;\r
-  !define MILESTONE "0.24" ;\r
-  !define SOURCE_INSTALL_DIR "c:\mono-0.23-setup\install\\*" ;\r
-\r
-; =====================================================\r
-; SET LOGO\r
-; =====================================================\r
-;\r
-;  Beautification:\r
-;\r
-;  This adds a Mono-specific Image on the left\r
-;  You can choose between the light or dark one.\r
-;  \r
-;  If you wish no mono-specifi logo, please outcomment\r
-;  the lines.\r
-;  \r
-;  "light" is enabled.\r
-;\r
-;  !define MUI_SPECIALBITMAP "mono-win32-setup-dark.bmp"\r
-   !define MUI_SPECIALBITMAP "mono-win32-setup-light.bmp"\r
-\r
-; =====================================================\r
-; BUILDING\r
-; =====================================================\r
-;\r
-; 1. Build mono. The install directory must not contain\r
-;    anything else - everything gets packed in!!!\r
-;\r
-; 2. In your install directory, delete the *.a files.\r
-;     Most people won't need them and it saves ~ 4 MB.\r
-;\r
-; 3. Get latest nsis from cvs or a development snapshot\r
-;    from http://nsis.sf.net\r
-;\r
-; 4. Adapt the MILESTONE\r
-;\r
-; 5. Adapt the SOURCE_INSTALL_DIR above to match your \r
-;     install directory. Do not remove \\* at the end!!\r
-;\r
-; 6. Open this script in makensisw.exe\r
-;\r
-; 7. The output file is mono-[MILESTONE]-win32-1.exe\r
-;\r
-;\r
-;\r
-;\r
-;\r
-; =====================================================\r
-; MONO & REGISTRY / DETECTING MONO\r
-; =====================================================\r
-;\r
-;\r
-; This setup creates several Registry Keys:\r
-;\r
-; HKEY_LOCAL_MACHINE SOFTWARE\Mono DefaultCLR\r
-; HKEY_LOCAL_MACHINE SOFTWARE\Mono\${MILESTONE} SdkInstallRoot\r
-; HKEY_LOCAL_MACHINE SOFTWARE\Mono\${MILESTONE} FrameworkAssemblyDirectory\r
-; HKEY_LOCAL_MACHINE SOFTWARE\Mono\${MILESTONE} MonoConfigDir\r
-;\r
-; =====================================================\r
-;\r
-; To get the current Mono Install Directory:\r
-;\r
-; 1. Get DefaultCLR\r
-; 2. Get HKEY_LOCAL_MACHINE SOFTWARE\Mono\$THE_DEFAULT_CLR_VALUE SdkInstallRoot\r
-;\r
-; =====================================================\r
-;\r
-; To get the current Mono assembly Directory:\r
-;\r
-; 1. Get DefaultCLR\r
-; 2. Get HKEY_LOCAL_MACHINE SOFTWARE\Mono\$THE_DEFAULT_CLR_VALUE FrameworkAssemblyDirectory\r
-; \r
-; =====================================================\r
-; Do not edit below\r
-; =====================================================\r
-;\r
-;\r
-; =====================================================\r
-; GENERAL SETTING - NEED NOT TO BE CHANGED\r
-; =====================================================\r
-\r
- !define NAME "Mono" ;\r
- !define TARGET_INSTALL_DIR "$PROGRAMFILES\Mono-${MILESTONE}" ;\r
- !define OUTFILE "mono-${MILESTONE}-win32-1.exe" ;\r
-\r
-; =====================================================\r
-; SCRIPT\r
-; =====================================================\r
-\r
- !define MUI_PRODUCT "${NAME}"\r
- !define MUI_VERSION "${MILESTONE}"\r
- !define FULLNAME "${MUI_PRODUCT} ${MUI_VERSION}"\r
- !define MUI_UI "${NSISDIR}\Contrib\UIs\modern2.exe"\r
- !define MUI_ICON "${NSISDIR}\Contrib\Icons\setup.ico"\r
- !define MUI_UNICON "${NSISDIR}\Contrib\Icons\normal-uninstall.ico"\r
- !define MUI_WELCOMEPAGE\r
- !define MUI_DIRECTORYPAGE\r
- !define MUI_DIRECTORYSELECTIONPAGE\r
- !include "${NSISDIR}\Contrib\Modern UI\System.nsh"\r
- !insertmacro MUI_SYSTEM\r
- !insertmacro MUI_LANGUAGE "ENGLISH"\r
-\r
-\r
- OutFile "${OUTFILE}"\r
- InstallDir "${TARGET_INSTALL_DIR}"\r
-\r
-\r
-;========================\r
-; Uninstaller\r
-;========================\r
-\r
-Section "Uninstall"\r
-\r
-  MessageBox MB_YESNO "Are you sure you want to uninstall Mono from your system?" IDNO NoUnInstall\r
-\r
-  Delete $INSTDIR\Uninst.exe ; delete Uninstaller\r
-  DeleteRegKey HKLM SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Mono-${MILESTONE} ; Remove Entry in Software List\r
-\r
-  MessageBox MB_YESNO "Mono was installed into $INSTDIR. Should this directory be removed completly?" IDNO GoNext1\r
-  RMDir /r $INSTDIR\r
-  GoNext1:\r
-\r
-  DeleteRegKey HKLM SOFTWARE\Mono\${MILESTONE}\r
-\r
-  ; If the Default-Key is the current Milestone, we just remove the wrappers\r
-\r
-  ReadRegStr $0 HKEY_LOCAL_MACHINE SOFTWARE\Mono\ DefaultCLR\r
-  StrCmp $0 ${MILESTONE} DeleteWrappers\r
-\r
-  MessageBox MB_YESNO "Mono ${MILESTONE} has been removed, but the default installation of Mono differs form this version. Should the wrappers and the Mono registry key be still be removed? This could disable other Mono installations." IDNO GoNext2\r
-\r
-  DeleteWrappers:\r
-\r
-  ; Complete Uninstall\r
-\r
-  DeleteRegKey HKLM SOFTWARE\Mono\r
-  Delete $WINDIR\monobasepath.bat\r
-  Delete $WINDIR\mcs.bat\r
-  Delete $WINDIR\mbas.bat\r
-  Delete $WINDIR\mint.bat\r
-  Delete $WINDIR\mono.bat\r
-  Delete $WINDIR\monodis.bat\r
-  Delete $WINDIR\monoilasm.bat\r
-  Delete $WINDIR\sqlsharp.bat\r
-  Delete $WINDIR\secutil.bat\r
-  Delete $WINDIR\cert2spc.bat\r
-  Delete $WINDIR\monoresgen.bat\r
-  Delete $WINDIR\monosn.bat\r
-  Delete $WINDIR\cilc.bat\r
-\r
-  GoNext2:\r
-  NoUnInstall:\r
-\r
-SectionEnd\r
-\r
-\r
- Section\r
-\r
- ; Warn people if a newer Mono is already installed\r
-\r
- ReadRegStr $0 HKEY_LOCAL_MACHINE SOFTWARE\Mono\ DefaultCLR\r
- Push $0\r
- Push ${MILESTONE} \r
- Call VersionCheck\r
- Pop $0\r
- StrCmp $0 0 NoAskInstall\r
- StrCmp $0 2 NoAskInstall\r
- MessageBox MB_YESNO "A newer Mono version is already installed. Still continue?" IDNO NoInstall\r
-\r
- NoAskInstall:\r
-\r
- SetOutPath $INSTDIR\r
- File /r "${SOURCE_INSTALL_DIR}"\r
- WriteUninstaller Uninst.exe\r
-\r
- WriteRegStr HKEY_LOCAL_MACHINE SOFTWARE\Mono\${MILESTONE} SdkInstallRoot $INSTDIR\r
- WriteRegStr HKEY_LOCAL_MACHINE SOFTWARE\Mono\${MILESTONE} FrameworkAssemblyDirectory $INSTDIR\lib\r
- WriteRegStr HKEY_LOCAL_MACHINE SOFTWARE\Mono\${MILESTONE} MonoConfigDir $INSTDIR\etc\mono\r
- ;WriteRegStr HKEY_LOCAL_MACHINE SOFTWARE\Mono\${MILESTONE} GtkSharpLibPath $INSTDIR\lib\r
- WriteRegStr HKEY_LOCAL_MACHINE SOFTWARE\Mono DefaultCLR ${MILESTONE}\r
-\r
- ; Mono Uninstall Entry in Windows Software List in the Control panel\r
- WriteRegStr HKEY_LOCAL_MACHINE SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Mono-${MILESTONE} DisplayName "Mono ${MILESTONE}"\r
- WriteRegStr HKEY_LOCAL_MACHINE SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Mono-${MILESTONE} UninstallString $INSTDIR\uninst.exe\r
-\r
- ;original string is like C:\mono-0.20\install\r
- StrCpy $5 $INSTDIR \r
- Push $5\r
- Push "\" ;search for this string\r
- Push "/" ;replace with this string\r
- Call StrReplace\r
- ;resulting string which is like C:/mono-0.20/install\r
- Pop $6\r
-\r
-;========================\r
-; Write the wrapper files\r
-;========================\r
-\r
-; create bin/mono wrapper to be used if the user has cygwin\r
-FileOpen $0 "$INSTDIR\bin\mono.exe.sh" "w"\r
-FileWrite $0 "#!/bin/sh$\r$\n"\r
-FileWrite $0 "export MONO_PATH=$6/lib$\r$\n"\r
-FileWrite $0 "export MONO_CFG_DIR=$6/etc/mono$\r$\n"\r
-FileWrite $0 '$6/bin/mono.exe "$$@"'\r
-FileClose $0\r
-\r
-; create bin/mint wrapper to be used if the user has cygwin\r
-FileOpen $0 "$INSTDIR\bin\mint.exe.sh" "w"\r
-FileWrite $0 "#!/bin/sh$\r$\n"\r
-FileWrite $0 "export MONO_PATH=$6/lib$\r$\n"\r
-FileWrite $0 "export MONO_CFG_DIR=$6/etc/mono$\r$\n"\r
-FileWrite $0 '$6/bin/mint.exe "$$@"'\r
-FileClose $0\r
-\r
-; create bin/mcs wrapper to be used if the user has cygwin\r
-FileOpen $0 "$INSTDIR\bin\mcs.exe.sh" "w"\r
-FileWrite $0 "#!/bin/sh$\r$\n"\r
-FileWrite $0 "export MONO_PATH=$6/lib$\r$\n"\r
-FileWrite $0 "export MONO_CFG_DIR=$6/etc/mono$\r$\n"\r
-FileWrite $0 '$6/bin/mono.exe $6/bin/mcs.exe "$$@"'\r
-FileClose $0\r
-\r
-; create bin/mbas wrapper to be used if the user has cygwin\r
-FileOpen $0 "$INSTDIR\bin\mbas.exe.sh" "w"\r
-FileWrite $0 "#!/bin/sh$\r$\n"\r
-FileWrite $0 "export MONO_PATH=$6/lib$\r$\n"\r
-FileWrite $0 "export MONO_CFG_DIR=$6/etc/mono$\r$\n"\r
-FileWrite $0 '$6/bin/mono.exe $6/bin/mbas.exe "$$@"'\r
-FileClose $0\r
-\r
-; create bin/sqlsharp wrapper to be used if the user has cygwin\r
-FileOpen $0 "$INSTDIR\bin\sqlsharp.exe.sh" "w"\r
-FileWrite $0 "#!/bin/sh$\r$\n"\r
-FileWrite $0 "export MONO_PATH=$6/lib$\r$\n"\r
-FileWrite $0 "export MONO_CFG_DIR=$6/etc/mono$\r$\n"\r
-FileWrite $0 '$6/bin/mono.exe $6/bin/sqlsharp.exe "$$@"'\r
-FileClose $0\r
-\r
-; create bin/monodis wrapper to be used if the user has cygwin\r
-FileOpen $0 "$INSTDIR\bin\monodis.exe.sh" "w"\r
-FileWrite $0 "#!/bin/sh$\r$\n"\r
-FileWrite $0 "export MONO_PATH=$6/lib$\r$\n"\r
-FileWrite $0 "export MONO_CFG_DIR=$6/etc/mono$\r$\n"\r
-FileWrite $0 '$6/bin/mono.exe $6/bin/monodis.exe "$$@"'\r
-FileClose $0\r
-\r
-; create bin/monoresgen wrapper to be used if the user has cygwin\r
-FileOpen $0 "$INSTDIR\bin\monoresgen.exe.sh" "w"\r
-FileWrite $0 "#!/bin/sh$\r$\n"\r
-FileWrite $0 "export MONO_PATH=$6/lib$\r$\n"\r
-FileWrite $0 "export MONO_CFG_DIR=$6/etc/mono$\r$\n"\r
-FileWrite $0 '$6/bin/mono.exe $6/bin/monoresgen.exe "$$@"'\r
-FileClose $0\r
-\r
-; create bin/monoilasm wrapper to be used if the user has cygwin\r
-FileOpen $0 "$INSTDIR\bin\monoilasm.exe.sh" "w"\r
-FileWrite $0 "#!/bin/sh$\r$\n"\r
-FileWrite $0 "export MONO_PATH=$6/lib$\r$\n"\r
-FileWrite $0 "export MONO_CFG_DIR=$6/etc/mono$\r$\n"\r
-FileWrite $0 '$6/bin/mono.exe $6/bin/monoilasm.exe "$$@"'\r
-FileClose $0\r
-\r
-; create bin/monosn wrapper to be used if the user has cygwin\r
-FileOpen $0 "$INSTDIR\bin\monosn.exe.sh" "w"\r
-FileWrite $0 "#!/bin/sh$\r$\n"\r
-FileWrite $0 "export MONO_PATH=$6/lib$\r$\n"\r
-FileWrite $0 "export MONO_CFG_DIR=$6/etc/mono$\r$\n"\r
-FileWrite $0 '$6/bin/mono.exe $6/bin/monosn.exe "$$@"'\r
-FileClose $0\r
-\r
-; create bin/secutil wrapper to be used if the user has cygwin\r
-FileOpen $0 "$INSTDIR\bin\secutil.exe.sh" "w"\r
-FileWrite $0 "#!/bin/sh$\r$\n"\r
-FileWrite $0 "export MONO_PATH=$6/lib$\r$\n"\r
-FileWrite $0 "export MONO_CFG_DIR=$6/etc/mono$\r$\n"\r
-FileWrite $0 '$6/bin/mono.exe $6/bin/secutil.exe "$$@"'\r
-FileClose $0\r
-\r
-; create bin/cert2spc wrapper to be used if the user has cygwin\r
-FileOpen $0 "$INSTDIR\bin\cert2spc.exe.sh" "w"\r
-FileWrite $0 "#!/bin/sh$\r$\n"\r
-FileWrite $0 "export MONO_PATH=$6/lib$\r$\n"\r
-FileWrite $0 "export MONO_CFG_DIR=$6/etc/mono$\r$\n"\r
-FileWrite $0 '$6/bin/mono.exe $6/bin/cert2spc.exe "$$@"'\r
-FileClose $0\r
-\r
-; create bin/cilc wrapper to be used if the user has cygwin\r
-FileOpen $0 "$INSTDIR\bin\cilc.exe.sh" "w"\r
-FileWrite $0 "#!/bin/sh$\r$\n"\r
-FileWrite $0 "export MONO_PATH=$6/lib$\r$\n"\r
-FileWrite $0 "export MONO_CFG_DIR=$6/etc/mono$\r$\n"\r
-FileWrite $0 '$6/bin/mono.exe $6/bin/cilc.exe "$$@"'\r
-FileClose $0\r
-\r
-;\r
-; These wrappers are copied to the windows directory.\r
-;\r
-\r
-;========================\r
-; Write the path file\r
-;========================\r
-\r
-FileOpen $0 "$WINDIR\monobasepath.bat" "w"\r
-FileWrite $0 'set MONO_BASEPATH="$INSTDIR"$\r$\n'\r
-FileWrite $0 'set MONO_PATH=$INSTDIR\lib$\r$\n'\r
-FileWrite $0 'set MONO_CFG_DIR="$INSTDIR\etc\mono"'\r
-FileClose $0\r
-\r
-\r
-;========================\r
-; Write the mcs file\r
-;========================\r
-\r
-FileOpen $0 "$WINDIR\mcs.bat" "w"\r
-\r
-FileWrite $0 "@echo off$\r$\n"\r
-FileWrite $0 "call monobasepath.bat$\r$\n"\r
-FileWrite $0 "set MONOARGS=$\r$\n"\r
-FileWrite $0 ":loop$\r$\n"\r
-FileWrite $0 "if x%1 == x goto :done$\r$\n"\r
-FileWrite $0 "set MONOARGS=%MONOARGS% %1$\r$\n"\r
-FileWrite $0 "shift$\r$\n"\r
-FileWrite $0 "goto loop$\r$\n"\r
-FileWrite $0 ":done$\r$\n"\r
-FileWrite $0 "setlocal$\r$\n"\r
-FileWrite $0 'set path="$INSTDIR\bin\;$INSTDIR\lib\;%path%"$\r$\n'\r
-FileWrite $0 '"$INSTDIR\bin\mono.exe" "$INSTDIR\bin\mcs.exe" %MONOARGS%$\r$\n'\r
-FileWrite $0 "endlocal$\r$\n"\r
-\r
-FileClose $0\r
-\r
-;========================\r
-; Write the mbas file\r
-;========================\r
-\r
-FileOpen $0 "$WINDIR\mbas.bat" "w"\r
-\r
-FileWrite $0 "@echo off$\r$\n"\r
-FileWrite $0 "call monobasepath.bat$\r$\n"\r
-FileWrite $0 "set MONOARGS=$\r$\n"\r
-FileWrite $0 ":loop$\r$\n"\r
-FileWrite $0 "if x%1 == x goto :done$\r$\n"\r
-FileWrite $0 "set MONOARGS=%MONOARGS% %1$\r$\n"\r
-FileWrite $0 "shift$\r$\n"\r
-FileWrite $0 "goto loop$\r$\n"\r
-FileWrite $0 ":done$\r$\n"\r
-FileWrite $0 "setlocal$\r$\n"\r
-FileWrite $0 'set path="$INSTDIR\bin\;$INSTDIR\lib\;%path%"$\r$\n'\r
-FileWrite $0 '"$INSTDIR\bin\mono.exe" "$INSTDIR\bin\mbas.exe" %MONOARGS%$\r$\n'\r
-FileWrite $0 "endlocal$\r$\n"\r
-\r
-FileClose $0\r
-\r
-;========================\r
-; Write the mint file\r
-;========================\r
-\r
-FileOpen $0 "$WINDIR\mint.bat" "w"\r
-\r
-FileWrite $0 "@echo off$\r$\n"\r
-FileWrite $0 "call monobasepath.bat$\r$\n"\r
-FileWrite $0 "set MONOARGS=$\r$\n"\r
-FileWrite $0 ":loop$\r$\n"\r
-FileWrite $0 "if x%1 == x goto :done$\r$\n"\r
-FileWrite $0 "set MONOARGS=%MONOARGS% %1$\r$\n"\r
-FileWrite $0 "shift$\r$\n"\r
-FileWrite $0 "goto loop$\r$\n"\r
-FileWrite $0 ":done$\r$\n"\r
-FileWrite $0 "setlocal$\r$\n"\r
-FileWrite $0 'set path="$INSTDIR\bin\;$INSTDIR\lib\;%path%"$\r$\n'\r
-FileWrite $0 '"$INSTDIR\bin\mint.exe" %MONOARGS%$\r$\n'\r
-FileWrite $0 "endlocal$\r$\n"\r
-\r
-FileClose $0\r
-\r
-;========================\r
-; Write the mono file\r
-;========================\r
-\r
-FileOpen $0 "$WINDIR\mono.bat" "w"\r
-\r
-FileWrite $0 "@echo off$\r$\n"\r
-FileWrite $0 "call monobasepath.bat$\r$\n"\r
-FileWrite $0 "set MONOARGS=$\r$\n"\r
-FileWrite $0 ":loop$\r$\n"\r
-FileWrite $0 "if x%1 == x goto :done$\r$\n"\r
-FileWrite $0 "set MONOARGS=%MONOARGS% %1$\r$\n"\r
-FileWrite $0 "shift$\r$\n"\r
-FileWrite $0 "goto loop$\r$\n"\r
-FileWrite $0 ":done$\r$\n"\r
-FileWrite $0 "setlocal$\r$\n"\r
-FileWrite $0 'set path="$INSTDIR\bin\;$INSTDIR\lib\;%path%"$\r$\n'\r
-FileWrite $0 '"$INSTDIR\bin\mono.exe" %MONOARGS%$\r$\n'\r
-FileWrite $0 "endlocal$\r$\n"\r
-FileClose $0\r
-\r
-;========================\r
-; Write monodis\r
-;========================\r
-\r
-FileOpen $0 "$WINDIR\monodis.bat" "w"\r
-\r
-FileWrite $0 "@echo off$\r$\n"\r
-FileWrite $0 "call monobasepath.bat$\r$\n"\r
-FileWrite $0 "set MONOARGS=$\r$\n"\r
-FileWrite $0 ":loop$\r$\n"\r
-FileWrite $0 "if x%1 == x goto :done$\r$\n"\r
-FileWrite $0 "set MONOARGS=%MONOARGS% %1$\r$\n"\r
-FileWrite $0 "shift$\r$\n"\r
-FileWrite $0 "goto loop$\r$\n"\r
-FileWrite $0 ":done$\r$\n"\r
-FileWrite $0 "setlocal$\r$\n"\r
-FileWrite $0 'set path="$INSTDIR\bin\;$INSTDIR\lib\;%path%"$\r$\n'\r
-FileWrite $0 '"$INSTDIR\bin\monodis.exe" %MONOARGS%$\r$\n'\r
-FileWrite $0 "endlocal$\r$\n"\r
-\r
-FileClose $0\r
-\r
-;========================\r
-; Write monoilasm\r
-;========================\r
-\r
-FileOpen $0 "$WINDIR\monoilasm.bat" "w"\r
-\r
-FileWrite $0 "@echo off$\r$\n"\r
-FileWrite $0 "call monobasepath.bat$\r$\n"\r
-FileWrite $0 "set MONOARGS=$\r$\n"\r
-FileWrite $0 ":loop$\r$\n"\r
-FileWrite $0 "if x%1 == x goto :done$\r$\n"\r
-FileWrite $0 "set MONOARGS=%MONOARGS% %1$\r$\n"\r
-FileWrite $0 "shift$\r$\n"\r
-FileWrite $0 "goto loop$\r$\n"\r
-FileWrite $0 ":done$\r$\n"\r
-FileWrite $0 "setlocal$\r$\n"\r
-FileWrite $0 'set path="$INSTDIR\bin\;$INSTDIR\lib\;%path%"$\r$\n'\r
-FileWrite $0 '"$INSTDIR\bin\mono.exe" "$INSTDIR\bin\monoilasm.exe" %MONOARGS%$\r$\n'\r
-FileWrite $0 "endlocal$\r$\n"\r
-\r
-FileClose $0\r
-\r
-\r
-;========================\r
-; Write the sqlsharp file\r
-;========================\r
-\r
-FileOpen $0 "$WINDIR\sqlsharp.bat" "w"\r
-\r
-FileWrite $0 "@echo off$\r$\n"\r
-FileWrite $0 "call monobasepath.bat$\r$\n"\r
-FileWrite $0 "set MONOARGS=$\r$\n"\r
-FileWrite $0 ":loop$\r$\n"\r
-FileWrite $0 "if x%1 == x goto :done$\r$\n"\r
-FileWrite $0 "set MONOARGS=%MONOARGS% %1$\r$\n"\r
-FileWrite $0 "shift$\r$\n"\r
-FileWrite $0 "goto loop$\r$\n"\r
-FileWrite $0 ":done$\r$\n"\r
-FileWrite $0 "setlocal$\r$\n"\r
-FileWrite $0 'set path="$INSTDIR\bin\;$INSTDIR\lib\;%path%"$\r$\n'\r
-FileWrite $0 '"$INSTDIR\bin\mono.exe" "$INSTDIR\bin\sqlsharp.exe" %MONOARGS%$\r$\n'\r
-FileWrite $0 "endlocal$\r$\n"\r
-\r
-FileClose $0\r
-\r
-;========================\r
-; Write the secutil file\r
-;========================\r
-\r
-FileOpen $0 "$WINDIR\secutil.bat" "w"\r
-\r
-FileWrite $0 "@echo off$\r$\n"\r
-FileWrite $0 "call monobasepath.bat$\r$\n"\r
-FileWrite $0 "set MONOARGS=$\r$\n"\r
-FileWrite $0 ":loop$\r$\n"\r
-FileWrite $0 "if x%1 == x goto :done$\r$\n"\r
-FileWrite $0 "set MONOARGS=%MONOARGS% %1$\r$\n"\r
-FileWrite $0 "shift$\r$\n"\r
-FileWrite $0 "goto loop$\r$\n"\r
-FileWrite $0 ":done$\r$\n"\r
-FileWrite $0 "setlocal$\r$\n"\r
-FileWrite $0 'set path="$INSTDIR\bin\;$INSTDIR\lib\;%path%"$\r$\n'\r
-FileWrite $0 '"$INSTDIR\bin\mono.exe" "$INSTDIR\bin\secutil.exe" %MONOARGS%$\r$\n'\r
-FileWrite $0 "endlocal$\r$\n"\r
-\r
-FileClose $0\r
-\r
-;========================\r
-; Write the cert2spc file\r
-;========================\r
-\r
-FileOpen $0 "$WINDIR\cert2spc.bat" "w"\r
-\r
-FileWrite $0 "@echo off$\r$\n"\r
-FileWrite $0 "call monobasepath.bat$\r$\n"\r
-FileWrite $0 "set MONOARGS=$\r$\n"\r
-FileWrite $0 ":loop$\r$\n"\r
-FileWrite $0 "if x%1 == x goto :done$\r$\n"\r
-FileWrite $0 "set MONOARGS=%MONOARGS% %1$\r$\n"\r
-FileWrite $0 "shift$\r$\n"\r
-FileWrite $0 "goto loop$\r$\n"\r
-FileWrite $0 ":done$\r$\n"\r
-FileWrite $0 "setlocal$\r$\n"\r
-FileWrite $0 'set path="$INSTDIR\bin\;$INSTDIR\lib\;%path%"$\r$\n'\r
-FileWrite $0 '"$INSTDIR\bin\mono.exe" "$INSTDIR\bin\cert2spec.exe" %MONOARGS%$\r$\n'\r
-FileWrite $0 "endlocal$\r$\n"\r
-\r
-FileClose $0\r
-\r
-\r
-;========================\r
-; Write the monoresgen file\r
-;========================\r
-\r
-FileOpen $0 "$WINDIR\monoresgen.bat" "w"\r
-\r
-FileWrite $0 "@echo off$\r$\n"\r
-FileWrite $0 "call monobasepath.bat$\r$\n"\r
-FileWrite $0 "set MONOARGS=$\r$\n"\r
-FileWrite $0 ":loop$\r$\n"\r
-FileWrite $0 "if x%1 == x goto :done$\r$\n"\r
-FileWrite $0 "set MONOARGS=%MONOARGS% %1$\r$\n"\r
-FileWrite $0 "shift$\r$\n"\r
-FileWrite $0 "goto loop$\r$\n"\r
-FileWrite $0 ":done$\r$\n"\r
-FileWrite $0 "setlocal$\r$\n"\r
-FileWrite $0 'set path="$INSTDIR\bin\;$INSTDIR\lib\;%path%"$\r$\n'\r
-FileWrite $0 '"$INSTDIR\bin\mono.exe" "$INSTDIR\bin\monoresgen.exe" %MONOARGS%$\r$\n'\r
-FileWrite $0 "endlocal$\r$\n"\r
-\r
-FileClose $0\r
-\r
-;========================\r
-; Write the monosn file\r
-;========================\r
-\r
-FileOpen $0 "$WINDIR\monosn.bat" "w"\r
-\r
-FileWrite $0 "@echo off$\r$\n"\r
-FileWrite $0 "call monobasepath.bat$\r$\n"\r
-FileWrite $0 "set MONOARGS=$\r$\n"\r
-FileWrite $0 ":loop$\r$\n"\r
-FileWrite $0 "if x%1 == x goto :done$\r$\n"\r
-FileWrite $0 "set MONOARGS=%MONOARGS% %1$\r$\n"\r
-FileWrite $0 "shift$\r$\n"\r
-FileWrite $0 "goto loop$\r$\n"\r
-FileWrite $0 ":done$\r$\n"\r
-FileWrite $0 "setlocal$\r$\n"\r
-FileWrite $0 'set path="$INSTDIR\bin\;$INSTDIR\lib\;%path%"$\r$\n'\r
-FileWrite $0 '"$INSTDIR\bin\monosn.exe" %MONOARGS%$\r$\n'\r
-FileWrite $0 "endlocal$\r$\n"\r
-\r
-FileClose $0\r
-\r
-;========================\r
-; Write the cilc file\r
-;========================\r
-\r
-FileOpen $0 "$WINDIR\cilc.bat" "w"\r
-\r
-\r
-FileWrite $0 "@echo off$\r$\n"\r
-FileWrite $0 "call monobasepath.bat$\r$\n"\r
-FileWrite $0 "set MONOARGS=$\r$\n"\r
-FileWrite $0 ":loop$\r$\n"\r
-FileWrite $0 "if x%1 == x goto :done$\r$\n"\r
-FileWrite $0 "set MONOARGS=%MONOARGS% %1$\r$\n"\r
-FileWrite $0 "shift$\r$\n"\r
-FileWrite $0 "goto loop$\r$\n"\r
-FileWrite $0 ":done$\r$\n"\r
-FileWrite $0 "setlocal$\r$\n"\r
-FileWrite $0 'set path="$INSTDIR\bin\;$INSTDIR\lib\;%path%"$\r$\n'\r
-FileWrite $0 '"$INSTDIR\bin\mono.exe" "$INSTDIR\bin\cilc.exe" %MONOARGS%$\r$\n'\r
-FileWrite $0 "endlocal$\r$\n"\r
-\r
-FileClose $0\r
-\r
-NoInstall:\r
-SectionEnd\r
-\r
-; function StrReplace\r
-; by Hendri Adriaens\r
-; HendriAdriaens@hotmail.com\r
-; found in the NSIS Archives\r
-function StrReplace\r
-  Exch $0 ;this will replace wrong characters\r
-  Exch\r
-  Exch $1 ;needs to be replaced\r
-  Exch\r
-  Exch 2\r
-  Exch $2 ;the orginal string\r
-  Push $3 ;counter\r
-  Push $4 ;temp character\r
-  Push $5 ;temp string\r
-  Push $6 ;length of string that need to be replaced\r
-  Push $7 ;length of string that will replace\r
-  Push $R0 ;tempstring\r
-  Push $R1 ;tempstring\r
-  Push $R2 ;tempstring\r
-  StrCpy $3 "-1"\r
-  StrCpy $5 ""\r
-  StrLen $6 $1\r
-  StrLen $7 $0\r
-  Loop:\r
-  IntOp $3 $3 + 1\r
-  StrCpy $4 $2 $6 $3\r
-  StrCmp $4 "" ExitLoop\r
-  StrCmp $4 $1 Replace\r
-  Goto Loop\r
-  Replace:\r
-  StrCpy $R0 $2 $3\r
-  IntOp $R2 $3 + $6\r
-  StrCpy $R1 $2 "" $R2\r
-  StrCpy $2 $R0$0$R1\r
-  IntOp $3 $3 + $7\r
-  Goto Loop\r
-  ExitLoop:\r
-  StrCpy $0 $2\r
-  Pop $R2\r
-  Pop $R1\r
-  Pop $R0\r
-  Pop $7\r
-  Pop $6\r
-  Pop $5\r
-  Pop $4\r
-  Pop $3\r
-  Pop $2\r
-  Pop $1\r
-  Exch $0\r
-FunctionEnd\r
-\r
-Function VersionCheck\r
-  Exch $0 ;second versionnumber\r
-  Exch\r
-  Exch $1 ;first versionnumber\r
-  Push $R0 ;counter for $0\r
-  Push $R1 ;counter for $1\r
-  Push $3 ;temp char\r
-  Push $4 ;temp string for $0\r
-  Push $5 ;temp string for $1\r
-  StrCpy $R0 "-1"\r
-  StrCpy $R1 "-1"\r
-  Start:\r
-  StrCpy $4 ""\r
-  DotLoop0:\r
-  IntOp $R0 $R0 + 1\r
-  StrCpy $3 $0 1 $R0\r
-  StrCmp $3 "" DotFound0\r
-  StrCmp $3 "." DotFound0\r
-  StrCpy $4 $4$3\r
-  Goto DotLoop0\r
-  DotFound0:\r
-  StrCpy $5 ""\r
-  DotLoop1:\r
-  IntOp $R1 $R1 + 1\r
-  StrCpy $3 $1 1 $R1\r
-  StrCmp $3 "" DotFound1\r
-  StrCmp $3 "." DotFound1\r
-  StrCpy $5 $5$3\r
-  Goto DotLoop1\r
-  DotFound1:\r
-  Strcmp $4 "" 0 Not4\r
-    StrCmp $5 "" Equal\r
-    Goto Ver2Less\r
-  Not4:\r
-  StrCmp $5 "" Ver2More\r
-  IntCmp $4 $5 Start Ver2Less Ver2More\r
-  Equal:\r
-  StrCpy $0 "0"\r
-  Goto Finish\r
-  Ver2Less:\r
-  StrCpy $0 "1"\r
-  Goto Finish\r
-  Ver2More:\r
-  StrCpy $0 "2"\r
-  Finish:\r
-  Pop $5\r
-  Pop $4\r
-  Pop $3\r
-  Pop $R1\r
-  Pop $R0\r
-  Pop $1\r
-  Exch $0\r
-FunctionEnd
\ No newline at end of file
index 5aa1fcf0b5b06bd3e9be20fb30f9da4514a6f9cb..7039503407518ca0c379d85e938c2c6036592531 100644 (file)
@@ -28,20 +28,21 @@ namespace Pdb2Mdb {
 
                public static void Convert (string filename)
                {
-                       var asm = AssemblyDefinition.ReadAssembly (filename);
+                       using (var asm = AssemblyDefinition.ReadAssembly (filename)) {
 
-                       var pdb = asm.Name.Name + ".pdb";
-                       pdb = Path.Combine (Path.GetDirectoryName (filename), pdb);
+                               var pdb = asm.Name.Name + ".pdb";
+                               pdb = Path.Combine (Path.GetDirectoryName (filename), pdb);
 
-                       if (!File.Exists (pdb))
-                               throw new FileNotFoundException ("PDB file doesn't exist: " + pdb);
+                               if (!File.Exists (pdb))
+                                       throw new FileNotFoundException ("PDB file doesn't exist: " + pdb);
 
-                       using (var stream = File.OpenRead (pdb)) {
-                               if (IsPortablePdb (stream))
-                                       throw new PortablePdbNotSupportedException ();
+                               using (var stream = File.OpenRead (pdb)) {
+                                       if (IsPortablePdb (stream))
+                                               throw new PortablePdbNotSupportedException ();
 
-                               var funcs = PdbFile.LoadFunctions (stream, true);
-                               Converter.Convert (asm, funcs, new MonoSymbolWriter (filename));
+                                       var funcs = PdbFile.LoadFunctions (stream, true);
+                                       Converter.Convert (asm, funcs, new MonoSymbolWriter (filename));
+                               }
                        }
                }
 
diff --git a/mcs/tools/scan-tests.pl b/mcs/tools/scan-tests.pl
deleted file mode 100755 (executable)
index 5cb0f86..0000000
+++ /dev/null
@@ -1,163 +0,0 @@
-#!/usr/bin/perl -w
-
-use strict;
-use Carp;
-
-my @allfiles;
-
-my @badsuites = qw[System\.Collections/HashtableTest System\.Collections/StackTest System\.Collections\.Specialized\.BasicOperationsTest];
-my @badtests = qw[PathTest:TestGetTempFileName XmlTextReaderTests:TestIsNameChar XmlTextReaderTests:TestIsFirstNameChar ByteTest:TestParse];
-my @mapfiles = ('s,^MonoTests\.(.*)/,$1/,',
-               's,^Ximian\.Mono\.Tests(.*)/,,',
-               's,^System\.Net/,,',
-               's,^Collections\.Specialized\.,,',
-               's,^Text\.RegularExpressions\.,,'
-               );
-my @maptests = ();
-my @mapnamespace = ();
-
-die "Usage: $0 input output" unless $#ARGV == 1;
-
-my $namespace = 'MonoTests';
-
-sub parse_test {
-    my ($filename, $namespace, $testname, $suite) = @_;
-
-    foreach (@badsuites) {
-       return if $filename =~ /$_/;
-    }
-
-    my $map;
-    foreach $map (@mapfiles) {
-       eval "\$filename =~ $map";
-    }
-
-    foreach (@allfiles) {
-       return if $filename eq $_->[0];
-    }
-
-    # print STDERR "PARSE: |$filename|\n";
-
-    push @allfiles, [$filename,$namespace,$testname,$suite,[]];
-
-    my $INPUT;
-    open $INPUT, $filename or croak "open ($filename): $!";
-    while (defined ($_ = <$INPUT>)) {
-       if (/^\s*namespace\s*([\w\.]+?)\s*$/) {
-           $namespace = $1;
-           next;
-       }
-       if (/^\s*suite\.AddTest\s*\((.*)\.(.*?)\.Suite\)/) {
-           my $filename = (defined $namespace) ? qq[$namespace.$1/$2.cs] : qq[$1/$2.cs];
-           my $nsprefix = (defined $namespace) ? qq[$namespace.$1] : qq[MonoTests.$1];
-           parse_test ($filename, $nsprefix, $1, $2);
-           next;
-       }
-       if (/^\s*suite\.AddTest\s*\((.*?)\.Suite\)/) {
-           my $filename = (defined $namespace) ? qq[$namespace/$1.cs] : qq[$1.cs];
-           parse_test ($filename, $namespace, '', $1);
-           next;
-       }
-       if (/^\s*suite\.AddTest\s*\(\s*new\s+TestSuite\s*\(\s*typeof\(\s*(.*)\s*\)\s*\)\s*\);/) {
-           my $filename = (defined $namespace) ? qq[$namespace/$1.cs] : qq[$1.cs];
-           parse_test ($filename, $namespace, '', $1);
-           next;
-       }
-    }
-    close $INPUT;
-}
-
-parse_test ($ARGV[0], undef, '', '');
-
-my $file;
-foreach $file (@allfiles) {
-    my ($filename,$namespace,$testname,$suite) = @$file;
-
-    open SUITE, $filename or croak "open ($filename): $!";
-    while (defined ($_ = <SUITE>)) {
-       next unless /^\s*public\s+void\s+(Test.*?)\s*\(\s*\)/;
-       push @{$file->[4]}, $1;
-    }
-    close SUITE;
-}
-
-open OUTPUT, "> $ARGV[1]" or croak "open (> $ARGV[1]): $!";
-select OUTPUT;
-
-print qq[using NUnit.Framework;\n];
-print qq[using System;\n];
-print qq[using System.Threading;\n];
-print qq[using System.Globalization;\n\n];
-
-
-my $alltest;
-foreach $alltest (@allfiles) {
-
-    my ($filename,$namespace,$testname,$suite,$tests) = @$alltest;
-    my @tests = @$tests;
-
-    next unless defined $namespace;
-    next unless $#tests >= 0;
-
-    # print STDERR "DOING TEST: |$testname|$filename|\n";
-
-    $namespace .= ".$testname" unless $testname eq '';
-
-    print qq[namespace $namespace\n\{\n];
-    print qq[\tpublic class Run$suite : $suite\n\t\{\n];
-    print qq[\t\tprotected override void RunTest ()\n\t\t\{\n];
-#    print qq[\t\t\tbool errorThrown = false;\n\n];
-    my $test;
-  testloop:
-    foreach $test (@tests) {
-       my $badtest;
-       $filename =~ s/\.cs$//;
-       my $fullname = qq[$filename:$test];
-       # print STDERR "TEST: |$fullname|\n";
-       foreach $badtest (@badtests) {
-           next testloop if $fullname =~ /$badtest/;
-       }
-#      print qq[\t\t\ttry \{\n\t\t\t\t$test ();\n\t\t\t\} catch \{\n];
-#      print qq[\t\t\t\tConsole.WriteLine ("$namespace:$suite:$test failed");\n];
-#      print qq[\t\t\t\terrorThrown = true;\n];
-#      print qq[\t\t\t\}\n];
-       print qq[\t\t\t$test ();\n];
-#      print qq[\t\t\tConsole.WriteLine ("$namespace:$suite:$test DONE");\n];
-    }
-    print qq[\n];
-#    print qq[\t\t\tif (errorThrown)\n\t\t\t\tthrow new ArgumentException ();\n];
-    print qq[\t\t\}\n\t\}\n];
-    print qq[\}\n\n];
-}
-
-print qq[namespace $namespace\n\{\n];
-print qq[\tpublic class RunAllTests\n\t\{\n];
-print qq[\t\tpublic static void AddAllTests (TestSuite suite)\n];
-print qq[\t\t\{\n];
-
-foreach $alltest (@allfiles) {
-    my ($filename,$namespace,$testname,$suite,$tests) = @$alltest;
-    my @tests = @$tests;
-
-    next unless defined $namespace;
-    next unless $#tests >= 0;
-
-    $namespace .= ".$testname" unless $testname eq '';
-
-    print qq[\t\t\tsuite.AddTest (new $namespace.Run$suite ());\n];
-}
-
-print qq[\t\t\}\n\t\}\n\}\n\n];
-
-print qq[class MainApp\n\{\n];
-print qq[\tpublic static void Main()\n\t\{\n];
-print qq[\t\tThread.CurrentThread.CurrentCulture = new CultureInfo ("en-US");\n\n];
-print qq[\t\tTestResult result = new TestResult ();\n];
-print qq[\t\tTestSuite suite = new TestSuite ();\n];
-print qq[\t\t$namespace.RunAllTests.AddAllTests (suite);\n];
-print qq[\t\tsuite.Run (result);\n];
-print qq[\t\tMonoTests.MyTestRunner.Print (result);\n];
-print qq[\t\}\n\}\n\n];
-
-close OUTPUT;
-
index 422de82f6216eb48c9eceee10c058cc82160d17d..257a814925bf1a61a6f2860729f91bf24b241a7a 100644 (file)
@@ -375,28 +375,29 @@ namespace Mono.Tools {
                                        return 0;
 
                                string assemblyName = args [args.Length - 1];
-                               AssemblyDefinition ad = AssemblyDefinition.ReadAssembly (assemblyName);
-                               if (ad != null) {
-                                       bool complete = false;
-                                       
-                                       if (declarative) {
-                                               // full output (assembly+classes+methods)
-                                               complete = ProcessAssemblyComplete (tw, ad);
-                                       } else if (xmloutput) {
-                                               // full output in XML (for easier diffs after c14n)
-                                               complete = ProcessAssemblyXml (tw, ad);
-                                       } else {
-                                               // default (assembly only)
-                                               complete = ProcessAssemblyOnly (tw, ad);
-                                       }
+                               using (AssemblyDefinition ad = AssemblyDefinition.ReadAssembly (assemblyName)) {
+                                       if (ad != null) {
+                                               bool complete = false;
+
+                                               if (declarative) {
+                                                       // full output (assembly+classes+methods)
+                                                       complete = ProcessAssemblyComplete (tw, ad);
+                                               } else if (xmloutput) {
+                                                       // full output in XML (for easier diffs after c14n)
+                                                       complete = ProcessAssemblyXml (tw, ad);
+                                               } else {
+                                                       // default (assembly only)
+                                                       complete = ProcessAssemblyOnly (tw, ad);
+                                               }
 
-                                       if (!complete) {
-                                               Console.Error.WriteLine ("Couldn't reflect informations.");
-                                               return 1;
+                                               if (!complete) {
+                                                       Console.Error.WriteLine ("Couldn't reflect informations.");
+                                                       return 1;
+                                               }
+                                       } else {
+                                               Console.Error.WriteLine ("Couldn't load assembly '{0}'.", assemblyName);
+                                               return 2;
                                        }
-                               } else {
-                                       Console.Error.WriteLine ("Couldn't load assembly '{0}'.", assemblyName);
-                                       return 2;
                                }
                                tw.Close ();
                        }
diff --git a/mcs/tools/security/security.proj b/mcs/tools/security/security.proj
deleted file mode 100644 (file)
index 33d6c52..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>\r
-<Project ToolsVersion="3.5" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
-  <PropertyGroup>\r
-    <OutputType>Exe</OutputType>\r
-    <AssemblyName>sn</AssemblyName>\r
-    <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>\r
-    <ResponseFile>sn.exe.sources</ResponseFile>\r
-    <CodePage>65001</CodePage>\r
-    <OutputPath>..\..\class\lib\basic\</OutputPath>\r
-    <UseVSHostingProcess>false</UseVSHostingProcess>\r
-  </PropertyGroup>\r
-  <Import Project="$(MSBuildProjectDirectory)\..\..\build\msbuild\Mono.Common.targets"/>\r
-  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />\r
-  <Target Name="Build" >\r
-     <Csc \r
-       CodePage="65001" \r
-       DefineConstants="BOOTSTRAP_BASIC,NET_1_1,NET_2_0"\r
-       OutputAssembly="..\..\class\lib\basic\sn.exe"\r
-       Sources="sn.cs;StrongNameManager.cs;AssemblyInfo.cs;..\..\build\common\Consts.cs"\r
-       References="..\..\class\lib\basic\Mono.Security.dll"\r
-        />\r
-  </Target>\r
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'basic|AnyCPU' ">\r
-    <Csc/>\r
-    <DefineConstants>BOOTSTRAP_BASIC,NET_1_1,NET_2_0</DefineConstants>\r
-  </PropertyGroup>\r
-\r
-</Project>
\ No newline at end of file
diff --git a/mcs/tools/tinderbox/smtp.c b/mcs/tools/tinderbox/smtp.c
deleted file mode 100644 (file)
index a4f0b03..0000000
+++ /dev/null
@@ -1,369 +0,0 @@
-// simple tool for sending smtp messages
-//
-//
-#include <stdio.h>
-#include <sys/socket.h>
-#include <arpa/inet.h>
-#include <string.h>
-#include <netdb.h>
-
-#include <unistd.h>
-#include <stdlib.h>
-#define _GNU_SOURCE
-#include <getopt.h>
-#include <ctype.h>
-#include <time.h>
-
-typedef int bool;
-enum { false = 0, true = 1};
-
-struct option rgOptions [] =
-{
-       {"cc",      required_argument,  NULL, 'c'},
-       {"help",    required_argument,  NULL, '?'},
-       {"to",      required_argument,  NULL, 't'},
-       {"from",    required_argument,  NULL, 'f'},
-       {"message", required_argument,  NULL, 'm'},
-       {"subject", required_argument,  NULL, 's'},
-       {"host",    required_argument,  NULL, 'h'},
-       {"attach",  required_argument,  NULL, 'a'},
-};
-
-typedef struct MailFields
-{
-       const char *szTo;
-       const char *szFrom;
-       const char *szHost;
-       const char *szSubject;
-       bool fAttachments;
-       bool fCC;
-       int cArgs;
-       char **rgszArgs;
-       FILE *pfMsg;
-} MailFields;
-
-const char *szOptions = "t:f:s:h:c:a:m:?";
-
-void help ()
-{
-       printf (
-               "Usage: smtp [OPTIONS]\n\n"
-               "Mandatory arguments:\n"
-               "\t-t, --to ADDRESS\tspecify destination email address\n"
-               "\t-f, --from ADDRESS\tspecify sender's email address\n"
-               "Optional arguments:\n"
-               "\t-s, --subject SUBJECT\tspecify subject of message\n"
-               "\t-m, --message FILENAME\tread text of message from FILENAME\n"
-               "\t-a, --attach FILENAME\tadd FILENAME to message as attachment\n"
-               "\t-c, --cc ADDRESS\tadd ADDRESS to CC list\n"
-               "\t-h, --host HOSTNAME\tconnect to smpt server HOSTNAME (default: localhost)\n"
-       );
-}
-
-int GetResponse (FILE *ps)
-{
-       char szLine [1024];
-       char *psz;
-       int hr;
-
-       fflush (ps);
-
-       do
-       {
-               fgets (szLine, sizeof (szLine), ps);
-
-               for (psz = szLine; isdigit (*psz); psz++)
-                       ;
-       }
-       while (*psz != '\0' && *psz != ' ');
-
-       hr = atol (szLine);
-       return hr;
-}
-
-FILE *TcpOpen (const char *szHost, int nPort)
-{
-       int s;
-       struct sockaddr_in sa;
-       struct hostent *he;
-       struct protoent *pe;
-       FILE *ps;
-
-       pe = getprotobyname ("TCP");
-       s = socket (PF_INET, SOCK_STREAM, pe->p_proto);
-       endprotoent ();
-
-       bzero ((char *)&sa,sizeof (sa));
-       sa.sin_family = AF_INET;
-       sa.sin_addr.s_addr = inet_addr (szHost);
-       sa.sin_port = htons (25);
-
-       if ((he = gethostbyname (szHost)) != NULL)
-               bcopy (he->h_addr, (char *)&sa.sin_addr, he->h_length);
-       else if ((sa.sin_addr.s_addr = inet_addr (szHost)) < 0)
-               perror ("gethostbyname ()");
-
-       if (connect (s, (struct sockaddr *) &sa, 16) == -1)
-               perror ("connect ()");
-       else if ((ps = fdopen (s, "r+")) == NULL)
-               perror ("fdopen ()");
-       else
-               return ps;
-
-       close (s);
-       return NULL;
-}
-
-
-void SendMail (const char *szTo, const MailFields *pmf)
-{
-       char rgchBoundary [20];
-       FILE *ps;
-       int hr;
-
-       ps = TcpOpen (pmf->szHost, 25);
-
-       hr = GetResponse (ps);
-
-       fprintf (ps, "HELO\r\n");
-       hr = GetResponse (ps);
-
-       fprintf (ps, "MAIL FROM: %s\r\n", pmf->szFrom);
-       hr = GetResponse (ps);
-
-       fprintf (ps, "RCPT TO: %s\r\n", szTo);
-       hr = GetResponse (ps);
-
-       fprintf (ps, "DATA %s\r\n", pmf->szSubject);
-       hr = GetResponse (ps);
-
-       fprintf (ps, "From: %s\r\nTo: %s\r\nSubject: %s\r\n", pmf->szFrom, pmf->szTo, pmf->szSubject);
-
-       if (pmf->fCC)
-       {
-               bool fFirst = true;
-               int nOpt, iOpt;
-               fprintf (ps, "CC:");
-               optind = 0;
-               while ((nOpt = getopt_long (pmf->cArgs, pmf->rgszArgs, szOptions, rgOptions, &iOpt)) != -1)
-               {
-                       if (nOpt == 'c')
-                       {
-                               if (!fFirst)
-                                       fprintf (ps, ";");
-                               fprintf (ps, " %s", optarg);
-                               fFirst = false;
-                       }
-               }
-               fprintf (ps, "\r\n");
-       }
-
-       if (pmf->fAttachments)
-       {
-               int ich;
-               srand ((int) time (NULL));
-               for (ich = 0; ich < sizeof (rgchBoundary) - 1; ich ++)
-                       rgchBoundary [ich] = rand () % ('Z'-'A') + 'A';
-               rgchBoundary [ich] = '\0';
-
-               fprintf (ps, 
-                       "MIME-Version: 1.0\r\n"
-                       "Content-Type: multipart/mixed; boundary=\"multipart-%s\"\r\n\r\n", rgchBoundary);
-
-               fprintf (ps, "--multipart-%s\r\n\r\n", rgchBoundary);
-       }
-
-       if (pmf->pfMsg != NULL)
-       {
-               rewind (pmf->pfMsg);
-               while (!feof (pmf->pfMsg))
-               {
-                       char strLine [1024];
-                       int cch;
-
-                       fgets (strLine, sizeof (strLine), pmf->pfMsg);
-                       cch = strlen (strLine);
-                       while (strLine [cch - 1] == '\r' || strLine [cch - 1] == '\n')
-                               cch --;
-                       strLine [cch] = '\0';
-
-                       if (cch == 1 && strLine [0] == '.')
-                               fputc ('.', ps);
-
-                       fprintf (ps, "%s\r\n", strLine);
-                       fflush (ps);
-               }
-       }
-
-       if (pmf->fAttachments)
-       {
-               int nOpt, iOpt;
-               optind = 0;
-               while ((nOpt = getopt_long (pmf->cArgs, pmf->rgszArgs, szOptions, rgOptions, &iOpt)) != -1)
-               {
-                       if (nOpt == 'a')
-                       {
-                               const char rgchBase64 [] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
-                               FILE *pf = fopen (optarg, "r");
-                               int cch = 0;
-
-                               const char *szBasename = (char *) strrchr ((const char *) optarg, '/');
-                               if (szBasename == NULL || szBasename [1] == '\0')
-                                       szBasename = optarg;
-                               else
-                                       szBasename ++;
-
-                               fprintf (ps, "--multipart-%s\r\nContent-Type: text/plain; name=\"%s\"\r\nContent-Disposition: attachment; name=\"%s\"\r\nContent-Transfer-Encoding: base64\r\n\r\n", rgchBoundary, szBasename, szBasename);
-
-                               while (true)
-                               {
-                                       int ch1, ch2, ch3;
-                                       if ((ch1 = fgetc (pf)) == -1)
-                                               break;
-
-                                       fputc (rgchBase64 [ch1 >> 2], ps);
-
-                                       if ((ch2 = fgetc (pf)) == -1)
-                                       {
-                                               fputc (rgchBase64 [(ch1 << 4) & 0x30], ps);
-                                               fputc ('=', ps);
-                                               fputc ('=', ps);
-                                               break;
-                                       }
-
-                                       fputc (rgchBase64 [(ch2 >> 4) | ((ch1 << 4) & 0x30)], ps);
-
-                                       if ((ch3 = fgetc (pf)) == -1)
-                                       {
-                                               fputc (rgchBase64 [(ch2 << 2) & 0x3c], ps);
-                                               fputc ('=', ps);
-                                               break;
-                                       }
-
-                                       fputc (rgchBase64 [((ch2 << 2) & 0x3c) | (ch3 >> 6)], ps);
-                                       fputc (rgchBase64 [ch3 & 0x3f], ps);
-                                       
-                                       cch += 4;
-                                       if (cch >= 76)
-                                               fprintf (ps, "\r\n");
-                               }
-                               fclose (pf);
-                               fprintf (ps, "\r\n\r\n");
-                       }
-               }
-       }
-
-       fprintf (ps, "\r\n.\r\nQUIT\r\n");
-       hr = GetResponse (ps);
-
-       fclose (ps);
-}
-
-int main (int cArgs, char *rgszArgs [])
-{
-       int nOpt, iOpt = 0;
-       MailFields mf;
-       bzero ((char *) &mf, sizeof (mf));
-       mf.cArgs = cArgs;
-       mf.rgszArgs = rgszArgs;
-
-       while ((nOpt = getopt_long (cArgs, rgszArgs, szOptions, rgOptions, &iOpt)) != -1)
-       {
-               switch (nOpt)
-               {
-                       case 't':
-                               if (mf.szTo != NULL)
-                                       goto _default;
-                               mf.szTo = optarg;
-                               break;
-                       case 'f':
-                               if (mf.szFrom != NULL)
-                                       goto _default;
-                               mf.szFrom = optarg;
-                               break;
-                       case 's':
-                               if (mf.szSubject != NULL)
-                                       goto _default;
-                               mf.szSubject = optarg;
-                               break;
-                       case 'h':
-                               if (mf.szHost != NULL)
-                                       goto _default;
-                               mf.szHost = optarg;
-                               break;
-                       case 'c':
-                               mf.fCC = true;
-                               break;
-                       case 'a':
-                               {
-                                       FILE *pfTmp = fopen (optarg, "r");
-                                       mf.fAttachments = true;
-                                       if (pfTmp == NULL)
-                                       {
-                                               fprintf (stderr, "File not found: %s\n", optarg);
-                                               exit (1);
-                                       }
-                                       fclose (pfTmp);
-                               }
-                               break;
-                       case 'm':
-                               if (mf.pfMsg != NULL)
-                                       goto _default;
-
-                               mf.pfMsg = fopen (optarg, "r");
-                               if (mf.pfMsg == NULL)
-                               {
-                                       fprintf (stderr, "File not found: %s\n", optarg);
-                                       exit (1);
-                               }
-                               break;
-                       case '?':
-                       default: _default:
-                               printf ("%c: %i\n", nOpt, iOpt);
-                               help ();
-                               return 1;
-               }
-       }
-       
-       if (mf.szHost == NULL)
-               mf.szHost = "localhost";
-
-       if (mf.szSubject == NULL)
-               mf.szSubject = "";
-
-       if (mf.szTo == NULL)
-       {
-               perror ("must specify 'to' field");
-               help ();
-               return 1;
-       }
-
-       if (mf.szFrom == NULL)
-       {
-               perror ("must specify 'from' field");
-               help ();
-               return 1;
-       }
-
-       SendMail (mf.szTo, &mf);
-
-       if (mf.fCC)
-       {
-               optind = 0;
-               while ((nOpt = getopt_long (cArgs, rgszArgs, szOptions, rgOptions, &iOpt)) != -1)
-               {
-                       if (nOpt == 'c')
-                       {
-                               int optindTmp = optind;
-                               SendMail (optarg, &mf);
-                               optind = optindTmp;
-                       }
-               }
-       }
-
-       if (mf.pfMsg != NULL)
-               fclose (mf.pfMsg);
-
-       return 0;
-}
-
diff --git a/mcs/tools/tinderbox/tinderbox.sh b/mcs/tools/tinderbox/tinderbox.sh
deleted file mode 100755 (executable)
index 3b99163..0000000
+++ /dev/null
@@ -1,286 +0,0 @@
-#!/bin/bash
-
-# TOPDIR: set this to the directory containing
-# your 'mono' and 'mcs' directories. Do NOT use '~' here.
-TOPDIR=$HOME/mono
-
-# BACKUP: initially this directory should contain a working install of mono.
-# this directory should minimally contain the 'bin' and 'lib' dirs.
-# after each successful build, the results are placed in here.
-BACKUP=$TOPDIR/install.bak
-
-# INSTALL: this is used as the install directory for
-# the various stages of the build.
-INSTALL=$TOPDIR/install
-
-# SENDMAIL: uncomment this line if you want to send notifications.
-# be careful to check the recipients below before running this script!
-SENDMAIL=$TOPDIR/mcs/tools/tinderbox/smtp
-
-# EMAIL_*: notification addresses. please change these before running!
-EMAIL_FATAL="piersh@friskit.com"
-EMAIL_MESSAGE="mono-patches@lists.ximian.com"
-#EMAIL_MESSAGE="piersh@friskit.com"
-#EMAIL_MESSAGE="mono-hackers-list@ximian.com"
-EMAIL_FROM="piersh@friskit.com"
-EMAIL_CC="-c mono-hackers-list@lists.ximian.com"
-EMAIL_HOST="zeus.sfhq.friskit.com"
-
-LOGBASE=$TOPDIR/.build.log
-LOG=$LOGBASE.txt
-LOGPREV=$LOGBASE.prev
-LOGFATAL=$LOGBASE.fatal
-LOGDATE=$TOPDIR/.build.date
-LOGLOG=$TOPDIR/.build.log.log
-BUILDMSG=$TOPDIR/.build.msg
-export LOGDATE
-
-DELAY_SUCCESS=5m                       # wait after a successful build
-DELAY_CHECK_BROKEN=5m          # wait while verifying the build is broken
-DELAY_STILL_BROKEN=3m          # wait while waiting for fix
-DELAY_BROKEN=5m                                # wait after notification sent
-
-FILTER_LOG="sed -e 's/^in <0x[0-9a-z]*>//' -e 's/:[0-9]*): WARNING \*\*:/): WARNING **/' -e 's/^\[[0-9][0-9]*:[0-9][0-9]*\] - .*//' -e 's/^[0-9][0-9]* - Member cache//' -e 's/^[0-9][0-9]* - Misc counter//' -e 's/: [0-9]* Trace\/breakpoint/ : Trace\/breakpoint/' -e 's/Needed to allocate blacklisted block at 0x[0-9a-f]*//'"
-
-function fatal ()
-{
-       $SENDMAIL -h $EMAIL_HOST -f $EMAIL_FROM -t $EMAIL_FATAL -a $LOGFATAL -s "[MONOBUILD] FATAL ERROR (`uname -s -m`)"
-       echo FATAL: `date` >> $LOGLOG
-       echo FATAL ERROR
-       exit 1
-}
-
-function build_mono ()
-{
-       # try to build
-
-       echo building...
-
-       cd $TOPDIR
-
-       rm -f $LOGFATAL
-       touch $LOGFATAL
-
-       [ -f $LOG ] && mv $LOG $LOGPREV
-       touch $LOG
-
-       # restore tools from backup
-       rm -fr $INSTALL
-       cp -a $BACKUP $INSTALL
-
-       # update from CVS
-       cvs -z3 update -APd mcs mono 2>&1 | tee -a $LOG
-       [ $PIPESTATUS == "0" ] || return 1
-
-       # clean mcs
-       cd $TOPDIR/mcs
-       make -f makefile.gnu clean 2>&1 | tee -a $LOG
-       [ $PIPESTATUS == "0" ] || return 1
-
-       # build JAY
-       cd $TOPDIR/mcs/jay
-       make -f makefile.gnu 2>&1 | tee -a $LOG
-       [ $PIPESTATUS == "0" ] || return 1
-
-       # build MCS compiler
-       cd $TOPDIR/mcs/mcs
-       make -f makefile.gnu 2>&1 | tee -a $LOG
-       [ $PIPESTATUS == "0" ] || return 1
-
-       # build CORLIB with old tools
-       cd $TOPDIR/mcs/class/corlib
-       make -f makefile.gnu 2>&1 | tee -a $LOG
-       [ $PIPESTATUS == "0" ] || return 1
-
-       # copy new MCS and CORLIB to build tools
-       cp -f $TOPDIR/mcs/class/lib/corlib.dll $INSTALL/lib/
-       cp -f $TOPDIR/mcs/mcs/mcs.exe $INSTALL/bin/
-
-
-
-       cd $TOPDIR/mono
-
-       # configure mono build
-       rm -f config.cache
-       ./autogen.sh --prefix=$INSTALL 2>&1 | tee -a $LOG
-       [ $PIPESTATUS == "0" ] || return 1
-
-       # clean mono
-       make clean 2>&1 | tee -a $LOG
-       [ $PIPESTATUS == "0" ] || return 1
-
-       # build mono
-       make 2>&1 | tee -a $LOG
-       [ $PIPESTATUS == "0" ] || return 1
-
-       # install runtime
-       cd $TOPDIR/mono/mono
-       make install 2>&1 | tee -a $LOG
-       [ $PIPESTATUS == "0" ] || return 1
-
-
-
-       # clean/make runtime libraries/tools
-       cd $TOPDIR/mcs
-       make -f makefile.gnu clean 2>&1 | tee -a $LOG
-       [ $PIPESTATUS == "0" ] || return 1
-
-       make -f makefile.gnu 2>&1 | tee -a $LOG
-       [ $PIPESTATUS == "0" ] || return 1
-
-
-
-       # retrieve runtime libraries
-       cd $TOPDIR/mono/runtime
-       rm -f *.dll *.exe
-
-       # install everything
-       cd $TOPDIR/mono
-       make install 2>&1 | tee -a $LOG
-       [ $PIPESTATUS == "0" ] || return 1
-
-
-       # test mcs self-build
-       cd $TOPDIR/mcs/mcs
-       make -f makefile.gnu clean 2>&1 | tee -a $LOG
-       [ $PIPESTATUS == "0" ] || return 1
-       make -f makefile.gnu 2>&1 | tee -a $LOG
-       [ $PIPESTATUS == "0" ] || return 1
-
-
-       # test corlib self-build
-       cd $TOPDIR/mcs/class/corlib
-       make -f makefile.gnu clean 2>&1 | tee -a $LOG
-       [ $PIPESTATUS == "0" ] || return 1
-       make -f makefile.gnu 2>&1 | tee -a $LOG
-       [ $PIPESTATUS == "0" ] || return 1
-
-
-       # it worked, backup build tools
-       rm -fr $BACKUP
-       cp -a $INSTALL $BACKUP
-
-       return 0
-}
-
-function compare_logs ()
-{
-       touch $LOG $LOGPREV
-       echo Comparing build logs
-       eval $FILTER_LOG $LOG > $LOG.tmp
-       eval $FILTER_LOG $LOGPREV > $LOGPREV.tmp
-       diff -b --brief $LOG.tmp $LOGPREV.tmp
-}
-
-function build_fixed ()
-{
-       echo "Build fixed:       `date`" > $BUILDMSG
-       echo "Previous breakage: `cat .build.date.last_fail`" >> $BUILDMSG
-       echo "Previous build:    `cat .build.date.last_success`" >> $BUILDMSG
-       echo >> $BUILDMSG
-
-       $SENDMAIL -h $EMAIL_HOST -f $EMAIL_FROM -t $EMAIL_MESSAGE $EMAIL_CC -s "[MONOBUILD] fixed (`uname -s -m`)" -m $BUILDMSG
-       rm -f $BUILDMSG
-}
-
-function build_failed ()
-{
-       echo "Build broken:   `date`" > $BUILDMSG
-       echo "Broken since:   `cat .build.date.last_fail`" >> $BUILDMSG
-       echo "Previous build: `cat .build.date.last_success`" >> $BUILDMSG
-       echo >> $BUILDMSG
-
-       sed -e 's/$/\r/' < $LOG > errors.txt
-       tail -25 errors.txt >> $BUILDMSG
-       rm -f errors.txt.gz
-       gzip errors.txt
-
-       $SENDMAIL -h $EMAIL_HOST -f $EMAIL_FROM -t $EMAIL_MESSAGE $EMAIL_CC -a errors.txt.gz -s "[MONOBUILD] broken (`uname -s -m`)" -m $BUILDMSG
-       rm -f $BUILDMSG errors.txt.gz
-}
-
-function stabilize ()
-{
-       cd $TOPDIR
-       while ! compare_logs ; do
-
-               date > $LOGDATE.last_fail
-               echo "|||||||||||||||||||||||||"
-               echo "|||||| LOGS DIFFER ||||||"
-               echo "|||||||||||||||||||||||||"
-               echo CHECK: `date` >> $LOGLOG
-
-               echo sleeping for $DELAY_CHECK_BROKEN
-               sleep $DELAY_CHECK_BROKEN
-
-               if build_mono ; then
-                       return 0
-               fi
-
-               cd $TOPDIR
-
-       done
-       return 1
-}
-
-[ -f $LOGPREV ] && mv $LOGPREV $LOG
-
-while [ 1 ] ; do
-
-       cd $TOPDIR
-       
-       if build_mono ; then
-
-               cd $TOPDIR
-
-               echo "|||||||||||||||||||||||||"
-               echo "|||| BUILD SUCCEEDED ||||"
-               echo "|||||||||||||||||||||||||"
-               echo SUCCESS: `date` >> $LOGLOG
-               date > $LOGDATE.last_success
-               echo sleeping for $DELAY_SUCCESS
-               sleep $DELAY_SUCCESS
-
-       else
-
-               if ! stabilize ; then
-
-                       build_failed
-
-                       echo "||||||||||||||||||||||"
-                       echo "|||| BUILD BROKEN ||||"
-                       echo "||||||||||||||||||||||"
-                       echo BROKEN: `date` >> $LOGLOG
-                       date > $LOGDATE.last_fail
-                       echo sleeping for $DELAY_BROKEN
-                       sleep $DELAY_BROKEN
-
-                       until build_mono ; do
-
-                               cd $TOPDIR
-                               echo "||||||||||||||||||||||||||||"
-                               echo "|||| BUILD STILL BROKEN ||||"
-                               echo "||||||||||||||||||||||||||||"
-                               echo STILL BROKEN: `date` >> $LOGLOG
-                               date > $LOGDATE.last_fail
-                               echo sleeping for $DELAY_STILL_BROKEN
-                               sleep $DELAY_STILL_BROKEN
-
-                       done
-
-                       cd $TOPDIR
-                       build_fixed
-                       echo "|||||||||||||||||||||"
-                       echo "|||| BUILD FIXED ||||"
-                       echo "|||||||||||||||||||||"
-                       echo FIXED: `date` >> $LOGLOG
-                       date > $LOGDATE.last_success
-                       echo sleeping for $DELAY_SUCCESS
-                       sleep $DELAY_SUCCESS
-
-               fi
-
-       fi
-
-done
-
diff --git a/mcs/winexe.in b/mcs/winexe.in
deleted file mode 100755 (executable)
index 19a4782..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-#!/bin/sh
-@bindir@/bin/mono.exe @bindir@/bin/@thewindowexe@ "$@"
index 14090d8c3ecc5d60c50a5d2225e23b0a559b3e47..06085362c54484072e624443e2c11b6a9dc573c3 100644 (file)
@@ -8,7 +8,7 @@ if SUPPORT_SGEN
 metadata_lib=$(top_builddir)/mono/metadata/libmonoruntimesgen-static.la
 gc_lib=$(top_builddir)/mono/sgen/libmonosgen-static.la
 else
-metadata_lib=$(top_builddir)/mono/metadata/libmonoruntime-static.a
+metadata_lib=$(top_builddir)/mono/metadata/libmonoruntime-static.la
 gc_lib=$(LIBGC_STATIC_LIBS)
 endif
 
index f8de9e2d23e3842a747a4948d641847b77f3464c..7bcd8fa7a752ca25f81c4f58b7d898492a6e7961 100644 (file)
@@ -1148,6 +1148,7 @@ leave:
 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;
@@ -1156,7 +1157,7 @@ mono_try_assembly_resolve_handle (MonoDomain *domain, MonoStringHandle fname, Mo
        error_init (error);
 
        if (mono_runtime_get_no_exec ())
-               return ret;
+               goto leave;
 
        g_assert (domain != NULL && !MONO_HANDLE_IS_NULL (fname));
 
@@ -1167,14 +1168,16 @@ mono_try_assembly_resolve_handle (MonoDomain *domain, MonoStringHandle fname, Mo
        MonoReflectionAssemblyHandle requesting_handle;
        if (requesting) {
                requesting_handle = mono_assembly_get_object_handle (domain, requesting, error);
-               return_val_if_nok (error, ret);
+               if (!is_ok (error))
+                       goto leave;
        }
        params [0] = MONO_HANDLE_RAW (fname);
        params[1] = requesting ? MONO_HANDLE_RAW (requesting_handle) : NULL;
        params [2] = &isrefonly;
        MonoReflectionAssemblyHandle result = MONO_HANDLE_NEW (MonoReflectionAssembly, mono_runtime_invoke_checked (method, domain->domain, params, error));
        ret = !MONO_HANDLE_IS_NULL (result) ? MONO_HANDLE_GETVAL (result, assembly) : NULL;
-       return ret;
+leave:
+       HANDLE_FUNCTION_RETURN_VAL (ret);
 }
 
 MonoAssembly *
@@ -1243,6 +1246,7 @@ add_assemblies_to_domain (MonoDomain *domain, MonoAssembly *ass, GHashTable *ht)
 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;
        MonoError error;
@@ -1253,7 +1257,7 @@ mono_domain_fire_assembly_load (MonoAssembly *assembly, gpointer user_data)
 
        if (!domain->domain)
                /* This can happen during startup */
-               return;
+               goto leave;
 #ifdef ASSEMBLY_LOAD_DEBUG
        fprintf (stderr, "Loading %s into domain %s\n", assembly->aname.name, domain->friendly_name);
 #endif
@@ -1271,7 +1275,7 @@ mono_domain_fire_assembly_load (MonoAssembly *assembly, gpointer user_data)
        mono_field_get_value ((MonoObject*) domain->domain, assembly_load_field, &load_value);
        if (load_value == NULL) {
                /* No events waiting to be triggered */
-               return;
+               goto leave;
        }
 
        MonoReflectionAssemblyHandle ref_assembly = mono_assembly_get_object_handle (domain, assembly, &error);
@@ -1286,6 +1290,8 @@ mono_domain_fire_assembly_load (MonoAssembly *assembly, gpointer user_data)
 
        mono_runtime_invoke_checked (assembly_load_method, domain->domain, params, &error);
        mono_error_cleanup (&error);
+leave:
+       HANDLE_FUNCTION_RETURN ();
 }
 
 /*
index 648442e8058444418b6c902c80801e82a4917105..ee0695ceccfbdb32dd39229a366fef7f3f01824d 100644 (file)
@@ -1631,8 +1631,7 @@ mono_class_setup_fields (MonoClass *klass)
                        char *class_name = mono_type_get_full_name (klass);
                        char *type_name = mono_type_full_name (field->type);
 
-                       mono_class_set_type_load_failure (klass, "");
-                       g_warning ("Invalid type %s for instance field %s:%s", type_name, class_name, field->name);
+                       mono_class_set_type_load_failure (klass, "Invalid type %s for instance field %s:%s", type_name, class_name, field->name);
                        g_free (class_name);
                        g_free (type_name);
                        break;
@@ -10033,7 +10032,7 @@ can_access_internals (MonoAssembly *accessing, MonoAssembly* accessed)
                /* Be conservative with checks */
                if (!friend_->name)
                        continue;
-               if (strcmp (accessing->aname.name, friend_->name))
+               if (g_ascii_strcasecmp (accessing->aname.name, friend_->name))
                        continue;
                if (friend_->public_key_token [0]) {
                        if (!accessing->aname.public_key_token [0])
index 00a11e67319e375ff9004906341b53320767fbcb..bdb1c773593c3f03c5ff7d5a57263a4057bcc9cb 100644 (file)
@@ -73,66 +73,12 @@ const MonoObjectHandle mono_null_value_handle = NULL;
 
 #define THIS_IS_AN_OK_NUMBER_OF_HANDLES 100
 
-enum {
-       HANDLE_CHUNK_PTR_OBJ = 0x0, /* chunk element points to beginning of a managed object */
-       HANDLE_CHUNK_PTR_INTERIOR = 0x1, /* chunk element points into the middle of a managed object */
-       HANDLE_CHUNK_PTR_MASK = 0x1
-};
-
-/* number of bits in each word of the interior pointer bitmap */
-#define INTERIOR_HANDLE_BITMAP_BITS_PER_WORD (sizeof(guint32) << 3)
-
-static gboolean
-bitset_bits_test (guint32 *bitmaps, int idx)
-{
-       int w = idx / INTERIOR_HANDLE_BITMAP_BITS_PER_WORD;
-       int b = idx % INTERIOR_HANDLE_BITMAP_BITS_PER_WORD;
-       guint32 bitmap = bitmaps [w];
-       guint32 mask = 1u << b;
-       return ((bitmap & mask) != 0);
-}
-
-static void
-bitset_bits_set (guint32 *bitmaps, int idx)
-{
-       int w = idx / INTERIOR_HANDLE_BITMAP_BITS_PER_WORD;
-       int b = idx % INTERIOR_HANDLE_BITMAP_BITS_PER_WORD;
-       guint32 *bitmap = &bitmaps [w];
-       guint32 mask = 1u << b;
-       *bitmap |= mask;
-}
-static void
-bitset_bits_clear (guint32 *bitmaps, int idx)
-{
-       int w = idx / INTERIOR_HANDLE_BITMAP_BITS_PER_WORD;
-       int b = idx % INTERIOR_HANDLE_BITMAP_BITS_PER_WORD;
-       guint32 *bitmap = &bitmaps [w];
-       guint32 mask = ~(1u << b);
-       *bitmap &= mask;
-}
-
-static gpointer*
-chunk_element_objslot_init (HandleChunk *chunk, int idx, gboolean interior)
-{
-       if (interior)
-               bitset_bits_set (chunk->interior_bitmap, idx);
-       else
-               bitset_bits_clear (chunk->interior_bitmap, idx);
-       return &chunk->elems [idx].o;
-}
-
 static HandleChunkElem*
 chunk_element (HandleChunk *chunk, int idx)
 {
        return &chunk->elems[idx];
 }
 
-static guint
-chunk_element_kind (HandleChunk *chunk, int idx)
-{
-       return bitset_bits_test (chunk->interior_bitmap, idx) ? HANDLE_CHUNK_PTR_INTERIOR : HANDLE_CHUNK_PTR_OBJ;
-}
-
 static HandleChunkElem*
 handle_to_chunk_element (MonoObjectHandle o)
 {
@@ -207,25 +153,12 @@ mono_handle_chunk_leak_check (HandleStack *handles) {
 }
 #endif
 
-MonoRawHandle
-#ifndef MONO_HANDLE_TRACK_OWNER
-mono_handle_new (MonoObject *object)
-#else
-mono_handle_new (MonoObject *object, const char *owner)
-#endif
-{
-#ifndef MONO_HANDLE_TRACK_OWNER
-       return mono_handle_new_full (object, FALSE);
-#else
-       return mono_handle_new_full (object, FALSE, owner);
-#endif
-}
 /* Actual handles implementation */
 MonoRawHandle
 #ifndef MONO_HANDLE_TRACK_OWNER
-mono_handle_new_full (gpointer rawptr, gboolean interior)
+mono_handle_new (MonoObject *obj)
 #else
-mono_handle_new_full (gpointer rawptr, gboolean interior, const char *owner)
+mono_handle_new (MonoObject *obj, const char *owner)
 #endif
 {
        MonoThreadInfo *info = mono_thread_info_current ();
@@ -238,7 +171,7 @@ mono_handle_new_full (gpointer rawptr, gboolean interior, const char *owner)
 retry:
        if (G_LIKELY (top->size < OBJECTS_PER_HANDLES_CHUNK)) {
                int idx = top->size;
-               gpointer* objslot = chunk_element_objslot_init (top, idx, interior);
+               gpointer* objslot = &top->elems [idx].o;
                /* can be interrupted anywhere here, so:
                 * 1. make sure the new slot is null
                 * 2. make the new slot scannable (increment size)
@@ -251,7 +184,7 @@ retry:
                mono_memory_write_barrier ();
                top->size++;
                mono_memory_write_barrier ();
-               *objslot = rawptr;
+               *objslot = obj;
                SET_OWNER (top,idx);
                SET_SP (handles, top, idx);
                return objslot;
@@ -266,7 +199,6 @@ retry:
        }
        HandleChunk *new_chunk = g_new (HandleChunk, 1);
        new_chunk->size = 0;
-       memset (new_chunk->interior_bitmap, 0, INTERIOR_HANDLE_BITMAP_WORDS);
        new_chunk->prev = top;
        new_chunk->next = NULL;
        /* make sure size == 0 before new chunk is visible */
@@ -276,20 +208,51 @@ retry:
        goto retry;
 }
 
+MonoRawHandle
+#ifndef MONO_HANDLE_TRACK_OWNER
+mono_handle_new_interior (gpointer rawptr)
+#else
+mono_handle_new_interior (gpointer rawptr, const char *owner)
+#endif
+{
+       MonoThreadInfo *info = mono_thread_info_current ();
+       HandleStack *handles = (HandleStack *)info->handle_stack;
+       HandleChunk *top = handles->interior;
+#ifdef MONO_HANDLE_TRACK_SP
+       mono_handle_chunk_leak_check (handles);
+#endif
+
+       g_assert (top);
 
+       /*
+        * Don't extend the chunk now, interior handles are
+        * only used for icall arguments, they shouldn't
+        * overflow.
+        */
+       g_assert (top->size < OBJECTS_PER_HANDLES_CHUNK);
+       int idx = top->size;
+       gpointer *objslot = &top->elems [idx].o;
+       *objslot = NULL;
+       mono_memory_write_barrier ();
+       top->size++;
+       mono_memory_write_barrier ();
+       *objslot = rawptr;
+       SET_OWNER (top,idx);
+       SET_SP (handles, top, idx);
+       return objslot;
+}
 
 HandleStack*
 mono_handle_stack_alloc (void)
 {
-       HandleStack *stack = g_new (HandleStack, 1);
-       HandleChunk *chunk = g_new (HandleChunk, 1);
+       HandleStack *stack = g_new0 (HandleStack, 1);
+       HandleChunk *chunk = g_new0 (HandleChunk, 1);
+       HandleChunk *interior = g_new0 (HandleChunk, 1);
 
-       chunk->size = 0;
-       memset (chunk->interior_bitmap, 0, INTERIOR_HANDLE_BITMAP_WORDS);
-       chunk->prev = chunk->next = NULL;
        mono_memory_write_barrier ();
        stack->top = stack->bottom = chunk;
-#ifdef MONO_HANDLE_TRACK_OWNER
+       stack->interior = interior;
+#ifdef MONO_HANDLE_TRACK_SP
        stack->stackmark_sp = NULL;
 #endif
        return stack;
@@ -309,9 +272,44 @@ mono_handle_stack_free (HandleStack *stack)
                c = next;
        }
        g_free (c);
+       g_free (stack->interior);
        g_free (stack);
 }
 
+void
+mono_handle_stack_free_domain (HandleStack *stack, MonoDomain *domain)
+{
+       /* Called by the GC while clearing out objects of the given domain from the heap. */
+       /* If there are no handles-related bugs, there is nothing to do: if a
+        * thread accessed objects from the domain it was aborted, so any
+        * threads left alive cannot have any handles that point into the
+        * unloading domain.  However if there is a handle leak, the handle stack is not */
+       if (!stack)
+               return;
+       /* Root domain only unloaded when mono is shutting down, don't need to check anything */
+       if (domain == mono_get_root_domain () || mono_runtime_is_shutting_down ())
+               return;
+       HandleChunk *cur = stack->bottom;
+       HandleChunk *last = stack->top;
+       if (!cur)
+               return;
+       while (cur) {
+               for (int idx = 0; idx < cur->size; ++idx) {
+                       HandleChunkElem *elem = &cur->elems[idx];
+                       if (!elem->o)
+                               continue;
+                       g_assert (mono_object_domain (elem->o) != domain);
+               }
+               if (cur == last)
+                       break;
+               cur = cur->next;
+       }
+       /* We don't examine the interior pointers here because the GC treats
+        * them conservatively and anyway we don't have enough information here to
+        * find the object's vtable.
+        */
+}
+
 static void
 check_handle_stack_monotonic (HandleStack *stack)
 {
@@ -362,46 +360,32 @@ mono_handle_stack_scan (HandleStack *stack, GcScanFunc func, gpointer gc_data, g
 
          Note that if we're running, we know the world is stopped.
        */
-       HandleChunk *cur = stack->bottom;
-       HandleChunk *last = stack->top;
-
-       if (!cur)
-               return;
+       if (precise) {
+               HandleChunk *cur = stack->bottom;
+               HandleChunk *last = stack->top;
 
-       while (cur) {
-               /* assume that object pointers will be much more common than interior pointers.
-                * scan the object pointers by iterating over the chunk elements.
-                * scan the interior pointers by iterating over the bitmap bits.
-                */
-               if (precise) {
+               while (cur) {
                        for (int i = 0; i < cur->size; ++i) {
                                HandleChunkElem* elem = chunk_element (cur, i);
-                               int kind = chunk_element_kind (cur, i);
                                gpointer* obj_slot = &elem->o;
-                               if (kind == HANDLE_CHUNK_PTR_OBJ && *obj_slot != NULL)
+                               if (*obj_slot != NULL)
                                        func (obj_slot, gc_data);
                        }
-               } else {
-                       int elem_idx = 0;
-                       for (int i = 0; i < INTERIOR_HANDLE_BITMAP_WORDS; ++i) {
-                               elem_idx = i * INTERIOR_HANDLE_BITMAP_BITS_PER_WORD;
-                               if (elem_idx >= cur->size)
-                                       break;
-                               /* no interior pointers in the range */ 
-                               if (cur->interior_bitmap [i] == 0)
-                                       continue;
-                               for (int j = 0; j < INTERIOR_HANDLE_BITMAP_BITS_PER_WORD && elem_idx < cur->size; ++j,++elem_idx) {
-                                       HandleChunkElem *elem = chunk_element (cur, elem_idx);
-                                       int kind = chunk_element_kind (cur, elem_idx);
-                                       gpointer *ptr_slot = &elem->o;
-                                       if (kind == HANDLE_CHUNK_PTR_INTERIOR && *ptr_slot != NULL)
-                                               func (ptr_slot, gc_data);
-                               }
-                       }            
+                       if (cur == last)
+                               break;
+                       cur = cur->next;
+               }
+       } else {
+               HandleChunk *cur = stack->interior;
+
+               if (!cur)
+                       return;
+               for (int i = 0; i < cur->size; ++i) {
+                       HandleChunkElem* elem = chunk_element (cur, i);
+                       gpointer* ptr_slot = &elem->o;
+                       if (*ptr_slot != NULL)
+                               func (ptr_slot, gc_data);
                }
-               if (cur == last)
-                       break;
-               cur = cur->next;
        }
 }
 
@@ -488,7 +472,6 @@ mono_gchandle_from_handle (MonoObjectHandle handle, mono_bool pinned)
        HandleChunk *chunk = chunk_element_to_chunk_idx (stack, elem, &elem_idx);
        /* gchandles cannot deal with interior pointers */
        g_assert (chunk != NULL);
-       g_assert (chunk_element_kind (chunk, elem_idx) != HANDLE_CHUNK_PTR_INTERIOR);
        return mono_gchandle_new (MONO_HANDLE_RAW (handle), pinned);
 }
 
index fd6d0cfffee7cbd002523a8a2b2ee1bc06604140..5a8e3356268585de1d5f97412760f4e3918a22b2 100644 (file)
@@ -25,7 +25,6 @@
 
 G_BEGIN_DECLS
 
-
 /*
 Handle stack.
 
@@ -73,13 +72,8 @@ typedef struct {
 #endif
 } HandleChunkElem;
 
-/* number of guint32's needed to store the interior pointers bitmap */
-#define INTERIOR_HANDLE_BITMAP_WORDS ((OBJECTS_PER_HANDLES_CHUNK + 31) / 32)
-
 struct _HandleChunk {
        int size; //number of handles
-       /* bits in the range 0..size-1 of interior_bitmap are valid; rest are ignored. */
-       guint32 interior_bitmap [INTERIOR_HANDLE_BITMAP_WORDS];
        HandleChunk *prev, *next;
        HandleChunkElem elems [OBJECTS_PER_HANDLES_CHUNK];
 };
@@ -90,10 +84,13 @@ typedef struct {
 #ifdef MONO_HANDLE_TRACK_SP
        gpointer stackmark_sp; // C stack pointer top when from most recent mono_stack_mark_init
 #endif
+       /* Chunk for storing interior pointers. Not extended right now */
+       HandleChunk *interior;
 } HandleStack;
 
+// Keep this in sync with RuntimeStructs.cs
 typedef struct {
-       int size;
+       int size, interior_size;
        HandleChunk *chunk;
 #ifdef MONO_HANDLE_TRACK_SP
        gpointer prev_sp; // C stack pointer from prior mono_stack_mark_init
@@ -108,18 +105,20 @@ typedef void (*GcScanFunc) (gpointer*, gpointer);
 #ifndef MONO_HANDLE_TRACK_OWNER
 MonoRawHandle mono_handle_new (MonoObject *object);
 MonoRawHandle mono_handle_new_full (gpointer rawptr, gboolean interior);
+MonoRawHandle mono_handle_new_interior (gpointer rawptr);
 #else
 MonoRawHandle mono_handle_new (MonoObject *object, const char* owner);
 MonoRawHandle mono_handle_new_full (gpointer rawptr, gboolean interior, const char *owner);
+MonoRawHandle mono_handle_new_interior (gpointer rawptr, const char *owner);
 #endif
 
-
 void mono_handle_stack_scan (HandleStack *stack, GcScanFunc func, gpointer gc_data, gboolean precise);
 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);
+void mono_handle_stack_free_domain (HandleStack *stack, MonoDomain *domain);
 
 #ifdef MONO_HANDLE_TRACK_SP
 void mono_handle_chunk_leak_check (HandleStack *handles);
@@ -134,6 +133,7 @@ mono_stack_mark_init (MonoThreadInfo *info, HandleStackMark *stackmark)
        HandleStack *handles = (HandleStack *)info->handle_stack;
        stackmark->size = handles->top->size;
        stackmark->chunk = handles->top;
+       stackmark->interior_size = handles->interior->size;
 #ifdef MONO_HANDLE_TRACK_SP
        stackmark->prev_sp = handles->stackmark_sp;
        handles->stackmark_sp = sptop;
@@ -148,6 +148,7 @@ mono_stack_mark_pop (MonoThreadInfo *info, HandleStackMark *stackmark)
        old_top->size = stackmark->size;
        mono_memory_write_barrier ();
        handles->top = old_top;
+       handles->interior->size = stackmark->interior_size;
 #ifdef MONO_HANDLE_TRACK_SP
        mono_memory_write_barrier (); /* write to top before prev_sp */
        handles->stackmark_sp = stackmark->prev_sp;
@@ -403,20 +404,6 @@ This is why we evaluate index and value before any call to MONO_HANDLE_RAW or ot
                mono_handle_array_getref (MONO_HANDLE_CAST(MonoObject, (DEST)), (HANDLE), (IDX)); \
        } while (0)
 
-/* Handles into the interior of objects.
- *
- * Typically when working with value types, we pass them by reference.  In the case where the value type
- * is a field in a managed class, the reference will be a pointer into the middle of a managed object.
- * We need to identify such pointers in order for SGen to scan them correctly.
- */
-
-#ifndef MONO_HANDLE_TRACK_OWNER
-#define MONO_HANDLE_NEW_GET_VALPTR(HANDLE,TYPE,FIELD) (TYPE_VALUE_HANDLE_NAME(TYPE))(mono_handle_new_full (&(HANDLE)->__raw->FIELD), TRUE))
-#else
-#define MONO_HANDLE_NEW_GET_VALPTR(HANDLE,TYPE,FIELD) (TYPE_VALUE_HANDLE_NAME(TYPE))(mono_handle_new_full (&(HANDLE)->__raw->FIELD), TRUE, HANDLE_OWNER_STRINGIFY(__FILE__, __LINE__))
-#endif
-
-
 #define MONO_HANDLE_ASSIGN(DESTH, SRCH)                                \
        mono_handle_assign (MONO_HANDLE_CAST (MonoObject, (DESTH)), MONO_HANDLE_CAST(MonoObject, (SRCH)))
 
index b8d6b81b1e76643bf7ea75cdcdfba5500dd831d0..51b333dce30ef07cdbf32d762525d9698e32770e 100644 (file)
@@ -207,9 +207,9 @@ ICALL(DECIMAL_13, "ToSingle", mono_decimal_to_float)
 #endif
 
 ICALL_TYPE(DELEGATE, "System.Delegate", DELEGATE_1)
-ICALL(DELEGATE_1, "AllocDelegateLike_internal", ves_icall_System_Delegate_AllocDelegateLike_internal)
-ICALL(DELEGATE_2, "CreateDelegate_internal", ves_icall_System_Delegate_CreateDelegate_internal)
-ICALL(DELEGATE_3, "GetVirtualMethod_internal", ves_icall_System_Delegate_GetVirtualMethod_internal)
+HANDLES(ICALL(DELEGATE_1, "AllocDelegateLike_internal", ves_icall_System_Delegate_AllocDelegateLike_internal))
+HANDLES(ICALL(DELEGATE_2, "CreateDelegate_internal", ves_icall_System_Delegate_CreateDelegate_internal))
+HANDLES(ICALL(DELEGATE_3, "GetVirtualMethod_internal", ves_icall_System_Delegate_GetVirtualMethod_internal))
 
 ICALL_TYPE(DEBUGR, "System.Diagnostics.Debugger", DEBUGR_1)
 ICALL(DEBUGR_1, "IsAttached_internal", ves_icall_System_Diagnostics_Debugger_IsAttached_internal)
@@ -683,8 +683,8 @@ ICALL(MARSHAL_7, "FreeHGlobal", ves_icall_System_Runtime_InteropServices_Marshal
 ICALL(MARSHAL_44, "GetCCW", ves_icall_System_Runtime_InteropServices_Marshal_GetCCW)
 ICALL(MARSHAL_8, "GetComSlotForMethodInfoInternal", ves_icall_System_Runtime_InteropServices_Marshal_GetComSlotForMethodInfoInternal)
 #endif
-ICALL(MARSHAL_9, "GetDelegateForFunctionPointerInternal", ves_icall_System_Runtime_InteropServices_Marshal_GetDelegateForFunctionPointerInternal)
-ICALL(MARSHAL_10, "GetFunctionPointerForDelegateInternal", ves_icall_System_Runtime_InteropServices_Marshal_GetFunctionPointerForDelegateInternal)
+HANDLES(ICALL(MARSHAL_9, "GetDelegateForFunctionPointerInternal", ves_icall_System_Runtime_InteropServices_Marshal_GetDelegateForFunctionPointerInternal))
+HANDLES(ICALL(MARSHAL_10, "GetFunctionPointerForDelegateInternal", ves_icall_System_Runtime_InteropServices_Marshal_GetFunctionPointerForDelegateInternal))
 #ifndef DISABLE_COM
 ICALL(MARSHAL_52, "GetHRForException_WinRT", ves_icall_System_Runtime_InteropServices_Marshal_GetHRForException_WinRT)
 ICALL(MARSHAL_45, "GetIDispatchForObjectInternal", ves_icall_System_Runtime_InteropServices_Marshal_GetIDispatchForObjectInternal)
@@ -697,9 +697,9 @@ ICALL(MARSHAL_47, "GetObjectForCCW", ves_icall_System_Runtime_InteropServices_Ma
 ICALL(MARSHAL_54, "GetRawIUnknownForComObjectNoAddRef", ves_icall_System_Runtime_InteropServices_Marshal_GetRawIUnknownForComObjectNoAddRef)
 ICALL(MARSHAL_48, "IsComObject", ves_icall_System_Runtime_InteropServices_Marshal_IsComObject)
 #endif
-ICALL(MARSHAL_12, "OffsetOf", ves_icall_System_Runtime_InteropServices_Marshal_OffsetOf)
-ICALL(MARSHAL_13, "Prelink", ves_icall_System_Runtime_InteropServices_Marshal_Prelink)
-ICALL(MARSHAL_14, "PrelinkAll", ves_icall_System_Runtime_InteropServices_Marshal_PrelinkAll)
+HANDLES(ICALL(MARSHAL_12, "OffsetOf", ves_icall_System_Runtime_InteropServices_Marshal_OffsetOf))
+HANDLES(ICALL(MARSHAL_13, "Prelink", ves_icall_System_Runtime_InteropServices_Marshal_Prelink))
+HANDLES(ICALL(MARSHAL_14, "PrelinkAll", ves_icall_System_Runtime_InteropServices_Marshal_PrelinkAll))
 HANDLES(ICALL(MARSHAL_15, "PtrToStringAnsi(intptr)", ves_icall_System_Runtime_InteropServices_Marshal_PtrToStringAnsi))
 ICALL(MARSHAL_16, "PtrToStringAnsi(intptr,int)", ves_icall_System_Runtime_InteropServices_Marshal_PtrToStringAnsi_len)
 ICALL(MARSHAL_17, "PtrToStringBSTR", ves_icall_System_Runtime_InteropServices_Marshal_PtrToStringBSTR)
@@ -716,7 +716,7 @@ ICALL(MARSHAL_23, "ReAllocHGlobal", ves_icall_System_Runtime_InteropServices_Mar
 ICALL(MARSHAL_49, "ReleaseComObjectInternal", ves_icall_System_Runtime_InteropServices_Marshal_ReleaseComObjectInternal)
 ICALL(MARSHAL_29, "ReleaseInternal", ves_icall_System_Runtime_InteropServices_Marshal_ReleaseInternal)
 #endif
-ICALL(MARSHAL_30, "SizeOf", ves_icall_System_Runtime_InteropServices_Marshal_SizeOf)
+HANDLES(ICALL(MARSHAL_30, "SizeOf", ves_icall_System_Runtime_InteropServices_Marshal_SizeOf))
 ICALL(MARSHAL_31, "StringToBSTR", ves_icall_System_Runtime_InteropServices_Marshal_StringToBSTR)
 ICALL(MARSHAL_32, "StringToHGlobalAnsi", ves_icall_System_Runtime_InteropServices_Marshal_StringToHGlobalAnsi)
 ICALL(MARSHAL_33, "StringToHGlobalUni", ves_icall_System_Runtime_InteropServices_Marshal_StringToHGlobalUni)
index 67acdcb521040d6570080ebe4d068ba3bae0648e..79329f935382f75dd2d2ba9e3be1e2825d17d45e 100644 (file)
@@ -6170,99 +6170,92 @@ ves_icall_RuntimeType_MakePointerType (MonoReflectionTypeHandle ref_type, MonoEr
        return mono_type_get_object_handle (domain, &pklass->byval_arg, error);
 }
 
-ICALL_EXPORT MonoObject *
-ves_icall_System_Delegate_CreateDelegate_internal (MonoReflectionType *type, MonoObject *target,
-                                                  MonoReflectionMethod *info, MonoBoolean throwOnBindFailure)
+ICALL_EXPORT MonoObjectHandle
+ves_icall_System_Delegate_CreateDelegate_internal (MonoReflectionTypeHandle ref_type, MonoObjectHandle target,
+                                                  MonoReflectionMethodHandle info, MonoBoolean throwOnBindFailure, MonoError *error)
 {
-       MonoError error;
-       MonoClass *delegate_class = mono_class_from_mono_type (type->type);
-       MonoObject *delegate;
+       MonoType *type = MONO_HANDLE_GETVAL (ref_type, type);
+       MonoClass *delegate_class = mono_class_from_mono_type (type);
        gpointer func;
-       MonoMethod *method = info->method;
+       MonoMethod *method = MONO_HANDLE_GETVAL (info, method);
        MonoMethodSignature *sig = mono_method_signature(method);
 
-       mono_class_init_checked (delegate_class, &error);
-       if (mono_error_set_pending_exception (&error))
-               return NULL;
+       mono_class_init_checked (delegate_class, error);
+       return_val_if_nok (error, NULL_HANDLE);
 
        if (!(delegate_class->parent == mono_defaults.multicastdelegate_class)) {
                /* FIXME improve this exception message */
-               mono_error_set_execution_engine (&error, "file %s: line %d (%s): assertion failed: (%s)", __FILE__, __LINE__,
+               mono_error_set_execution_engine (error, "file %s: line %d (%s): assertion failed: (%s)", __FILE__, __LINE__,
                                                 __func__,
                                                 "delegate_class->parent == mono_defaults.multicastdelegate_class");
-               mono_error_set_pending_exception (&error);
-               return NULL;
+               return NULL_HANDLE;
        }
 
        if (mono_security_core_clr_enabled ()) {
-               if (!mono_security_core_clr_ensure_delegate_creation (method, &error)) {
+               MonoError security_error;
+               if (!mono_security_core_clr_ensure_delegate_creation (method, &security_error)) {
                        if (throwOnBindFailure)
-                               mono_error_set_pending_exception (&error);
+                               mono_error_move (error, &security_error);
                        else
-                               mono_error_cleanup (&error);
-                       return NULL;
+                               mono_error_cleanup (&security_error);
+                       return NULL_HANDLE;
                }
        }
 
        if (sig->generic_param_count && method->wrapper_type == MONO_WRAPPER_NONE) {
                if (!method->is_inflated) {
-                       mono_set_pending_exception(mono_get_exception_argument("method", " Cannot bind to the target method because its signature differs from that of the delegate type"));
-                       return NULL;
+                       mono_error_set_argument (error, "method", " Cannot bind to the target method because its signature differs from that of the delegate type");
+                       return NULL_HANDLE;
                }
        }
 
-       delegate = mono_object_new_checked (mono_object_domain (type), delegate_class, &error);
-       if (mono_error_set_pending_exception (&error))
-               return NULL;
+       MonoObjectHandle delegate = MONO_HANDLE_NEW (MonoObject, mono_object_new_checked (MONO_HANDLE_DOMAIN (ref_type), delegate_class, error));
+       return_val_if_nok (error, NULL_HANDLE);
 
        if (method_is_dynamic (method)) {
                /* Creating a trampoline would leak memory */
-               func = mono_compile_method_checked (method, &error);
-               if (mono_error_set_pending_exception (&error))
-                       return NULL;
+               func = mono_compile_method_checked (method, error);
+               return_val_if_nok (error, NULL_HANDLE);
        } else {
-               if (target && method->flags & METHOD_ATTRIBUTE_VIRTUAL && method->klass != mono_object_class (target))
-                       method = mono_object_get_virtual_method (target, method);
-               gpointer trampoline = mono_runtime_create_jump_trampoline (mono_domain_get (), method, TRUE, &error);
-               if (mono_error_set_pending_exception (&error))
-                       return NULL;
+               if (!MONO_HANDLE_IS_NULL (target) && method->flags & METHOD_ATTRIBUTE_VIRTUAL && method->klass != mono_handle_class (target)) {
+                       method = mono_object_handle_get_virtual_method (target, method, error);
+                       return_val_if_nok (error, NULL_HANDLE);
+               }
+               gpointer trampoline = mono_runtime_create_jump_trampoline (mono_domain_get (), method, TRUE, error);
+               return_val_if_nok (error, NULL_HANDLE);
                func = mono_create_ftnptr (mono_domain_get (), trampoline);
        }
 
-       mono_delegate_ctor_with_method (delegate, target, func, method, &error);
-       if (mono_error_set_pending_exception (&error))
-               return NULL;
+       mono_delegate_ctor_with_method (delegate, target, func, method, error);
+       return_val_if_nok (error, NULL_HANDLE);
        return delegate;
 }
 
-ICALL_EXPORT MonoMulticastDelegate *
-ves_icall_System_Delegate_AllocDelegateLike_internal (MonoDelegate *delegate)
+ICALL_EXPORT MonoMulticastDelegateHandle
+ves_icall_System_Delegate_AllocDelegateLike_internal (MonoDelegateHandle delegate, MonoError *error)
 {
-       MonoError error;
-       MonoMulticastDelegate *ret;
+       error_init (error);
 
-       g_assert (mono_class_has_parent (mono_object_class (delegate), mono_defaults.multicastdelegate_class));
+       MonoClass *klass = mono_handle_class (delegate);
+       g_assert (mono_class_has_parent (klass, mono_defaults.multicastdelegate_class));
 
-       ret = (MonoMulticastDelegate*) mono_object_new_checked (mono_object_domain (delegate), mono_object_class (delegate), &error);
-       if (mono_error_set_pending_exception (&error))
-               return NULL;
+       MonoMulticastDelegateHandle ret = MONO_HANDLE_NEW (MonoMulticastDelegate,  mono_object_new_checked (MONO_HANDLE_DOMAIN (delegate), klass, error));
+       return_val_if_nok (error, MONO_HANDLE_CAST (MonoMulticastDelegate, NULL_HANDLE));
 
-       ret->delegate.invoke_impl = mono_runtime_create_delegate_trampoline (mono_object_class (delegate));
+       MONO_HANDLE_SETVAL (MONO_HANDLE_CAST (MonoDelegate, ret), invoke_impl, gpointer, mono_runtime_create_delegate_trampoline (klass));
 
        return ret;
 }
 
-ICALL_EXPORT MonoReflectionMethod*
-ves_icall_System_Delegate_GetVirtualMethod_internal (MonoDelegate *delegate)
+ICALL_EXPORT MonoReflectionMethodHandle
+ves_icall_System_Delegate_GetVirtualMethod_internal (MonoDelegateHandle delegate, MonoError *error)
 {
-       MonoReflectionMethod *ret = NULL;
-       MonoError error;
-       MonoMethod *m;
+       error_init (error);
 
-       m = mono_object_get_virtual_method (delegate->target, delegate->method);
-       ret = mono_method_get_object_checked (mono_domain_get (), m, m->klass, &error);
-       mono_error_set_pending_exception (&error);
-       return ret;
+       MonoObjectHandle delegate_target = MONO_HANDLE_NEW_GET (MonoObject, delegate, target);
+       MonoMethod *m = mono_object_handle_get_virtual_method (delegate_target, MONO_HANDLE_GETVAL (delegate, method), error);
+       return_val_if_nok (error, MONO_HANDLE_CAST (MonoReflectionMethod, NULL_HANDLE));
+       return mono_method_get_object_handle (mono_domain_get (), m, m->klass, error);
 }
 
 /* System.Buffer */
@@ -7508,38 +7501,34 @@ prelink_method (MonoMethod *method, MonoError *error)
                return;
        mono_lookup_pinvoke_call (method, &exc_class, &exc_arg);
        if (exc_class) {
-               mono_error_set_exception_instance (error,
-                       mono_exception_from_name_msg (mono_defaults.corlib, "System", exc_class, exc_arg));
+               mono_error_set_generic_error (error, "System", exc_class, "%s", exc_arg);
                return;
        }
        /* create the wrapper, too? */
 }
 
 ICALL_EXPORT void
-ves_icall_System_Runtime_InteropServices_Marshal_Prelink (MonoReflectionMethod *method)
+ves_icall_System_Runtime_InteropServices_Marshal_Prelink (MonoReflectionMethodHandle method, MonoError *error)
 {
-       MonoError error;
+       error_init (error);
 
-       prelink_method (method->method, &error);
-       mono_error_set_pending_exception (&error);
+       prelink_method (MONO_HANDLE_GETVAL (method, method), error);
 }
 
 ICALL_EXPORT void
-ves_icall_System_Runtime_InteropServices_Marshal_PrelinkAll (MonoReflectionType *type)
+ves_icall_System_Runtime_InteropServices_Marshal_PrelinkAll (MonoReflectionTypeHandle type, MonoError *error)
 {
-       MonoError error;
-       MonoClass *klass = mono_class_from_mono_type (type->type);
+       error_init (error);
+       MonoClass *klass = mono_class_from_mono_type (MONO_HANDLE_GETVAL (type, type));
        MonoMethod* m;
        gpointer iter = NULL;
 
-       mono_class_init_checked (klass, &error);
-       if (mono_error_set_pending_exception (&error))
-               return;
+       mono_class_init_checked (klass, error);
+       return_if_nok (error);
 
        while ((m = mono_class_get_methods (klass, &iter))) {
-               prelink_method (m, &error);
-               if (mono_error_set_pending_exception (&error))
-                       return;
+               prelink_method (m, error);
+               return_if_nok (error);
        }
 }
 
index 742a7375f14eab46f4511905c6e265d85bf50c6d..f878339b210764598dcd86d4a823bfe93e5e351e 100644 (file)
@@ -1158,6 +1158,7 @@ static const IgnoredAssembly ignored_assemblies [] = {
        IGNORED_ASSEMBLY (0x10CADA75, SYS_NET_HTTP, "EA2EC6DC-51DD-479C-BFC2-E713FB9E7E47", "4.1.1 net46"),
        IGNORED_ASSEMBLY (0x8437178B, SYS_NET_HTTP, "C0E04D9C-70CF-48A6-A179-FBFD8CE69FD0", "4.3.0 net46"),
        IGNORED_ASSEMBLY (0xFAFDA422, SYS_NET_HTTP, "817F01C3-4011-477D-890A-98232B85553D", "4.3.1 net46"),
+       IGNORED_ASSEMBLY (0x472FA630, SYS_NET_HTTP, "09D4A140-061C-4884-9B63-22067E841931", "4.3.2 net46"),
        IGNORED_ASSEMBLY (0x4A15555E, SYS_REF_DISP_PROXY, "E40AFEB4-CABE-4124-8412-B46AB79C92FD", "4.0.0 net46"),
        IGNORED_ASSEMBLY (0xD20D9783, SYS_REF_DISP_PROXY, "2A69F0AD-B86B-40F2-8E4C-5B671E47479F", "4.0.1 netstandard1.3"),
        IGNORED_ASSEMBLY (0xA33A7E68, SYS_REF_DISP_PROXY, "D4E8D2DB-BD65-4168-99EA-D2C1BDEBF9CC", "4.3.0 netstandard1.3"),
@@ -1192,6 +1193,7 @@ static const IgnoredAssemblyVersion ignored_assembly_versions [] = {
        IGNORED_ASM_VER (SYS_NET_HTTP, 4, 1, 0, 0),
        IGNORED_ASM_VER (SYS_NET_HTTP, 4, 1, 0, 1),
        IGNORED_ASM_VER (SYS_NET_HTTP, 4, 1, 1, 0),
+       IGNORED_ASM_VER (SYS_NET_HTTP, 4, 1, 1, 1),
        IGNORED_ASM_VER (SYS_REF_DISP_PROXY, 4, 0, 0, 0),
        IGNORED_ASM_VER (SYS_REF_DISP_PROXY, 4, 0, 1, 0),
        IGNORED_ASM_VER (SYS_REF_DISP_PROXY, 4, 0, 2, 0),
index 214b81f1adff43d7ec83d935284c40bc8a9d94bd..f60de81c46bdd63387cdb457671478449335dcdb 100644 (file)
@@ -89,7 +89,7 @@ static void ftnptr_eh_callback_default (guint32 gchandle);
 static MonoFtnPtrEHCallback ftnptr_eh_callback = ftnptr_eh_callback_default;
 
 static void
-delegate_hash_table_add (MonoDelegate *d);
+delegate_hash_table_add (MonoDelegateHandle d);
 
 static void
 delegate_hash_table_remove (MonoDelegate *d);
@@ -179,9 +179,15 @@ mono_string_to_byvalwstr (gpointer dst, MonoString *src, int size);
 gpointer
 mono_delegate_to_ftnptr (MonoDelegate *delegate);
 
+gpointer
+mono_delegate_handle_to_ftnptr (MonoDelegateHandle delegate, MonoError *error);
+
 MonoDelegate*
 mono_ftnptr_to_delegate (MonoClass *klass, gpointer ftn);
 
+MonoDelegateHandle
+mono_ftnptr_to_delegate_handle (MonoClass *klass, gpointer ftn, MonoError *error);
+
 gpointer
 mono_array_to_savearray (MonoArray *array);
 
@@ -216,7 +222,10 @@ static void
 mono_icall_end (MonoThreadInfo *info, HandleStackMark *stackmark, MonoError *error);
 
 static MonoObjectHandle
-mono_icall_handle_new_full (gpointer rawobj, MonoBoolean interior);
+mono_icall_handle_new (gpointer rawobj);
+
+static MonoObjectHandle
+mono_icall_handle_new_interior (gpointer rawobj);
 
 /* Lazy class loading functions */
 static GENERATE_GET_CLASS_WITH_CACHE (string_builder, "System.Text", "StringBuilder");
@@ -276,6 +285,21 @@ mono_marshal_init_tls (void)
 static MonoObject*
 mono_object_isinst_icall (MonoObject *obj, MonoClass *klass)
 {
+       if (!klass)
+               return NULL;
+
+       /* This is called from stelemref so it is expected to succeed */
+       /* Fastpath */
+       if (mono_class_is_interface (klass)) {
+               MonoVTable *vt = obj->vtable;
+
+               if (!klass->inited)
+                       mono_class_init (klass);
+
+               if (MONO_VTABLE_IMPLEMENTS_INTERFACE (vt, klass->interface_id))
+                       return obj;
+       }
+
        MonoError error;
        MonoObject *result = mono_object_isinst_checked (obj, klass, &error);
        mono_error_set_pending_exception (&error);
@@ -376,7 +400,8 @@ mono_marshal_init (void)
                register_icall (mono_threads_detach_coop, "mono_threads_detach_coop", "void ptr ptr", TRUE);
                register_icall (mono_icall_start, "mono_icall_start", "ptr ptr ptr", TRUE);
                register_icall (mono_icall_end, "mono_icall_end", "void ptr ptr ptr", TRUE);
-               register_icall (mono_icall_handle_new_full, "mono_icall_handle_new_full", "ptr ptr bool", TRUE);
+               register_icall (mono_icall_handle_new, "mono_icall_handle_new", "ptr ptr", TRUE);
+               register_icall (mono_icall_handle_new_interior, "mono_icall_handle_new_interior", "ptr ptr", TRUE);
 
                mono_cominterop_init ();
                mono_remoting_init ();
@@ -412,25 +437,44 @@ mono_marshal_unlock_internal (void)
 
 /* This is a JIT icall, it sets the pending exception and return NULL on error */
 gpointer
-mono_delegate_to_ftnptr (MonoDelegate *delegate)
+mono_delegate_to_ftnptr (MonoDelegate *delegate_raw)
 {
+       HANDLE_FUNCTION_ENTER ();
        MonoError error;
+       MONO_HANDLE_DCL (MonoDelegate, delegate);
+       gpointer result = mono_delegate_handle_to_ftnptr (delegate, &error);
+       mono_error_set_pending_exception (&error);
+       HANDLE_FUNCTION_RETURN_VAL (result);
+}
+
+gpointer
+mono_delegate_handle_to_ftnptr (MonoDelegateHandle delegate, MonoError *error)
+{
+       HANDLE_FUNCTION_ENTER ();
+       gpointer result = NULL;
+       error_init (error);
        MonoMethod *method, *wrapper;
        MonoClass *klass;
        uint32_t target_handle = 0;
 
-       if (!delegate)
-               return NULL;
+       if (MONO_HANDLE_IS_NULL (delegate))
+               goto leave;
 
-       if (delegate->delegate_trampoline)
-               return delegate->delegate_trampoline;
+       if (MONO_HANDLE_GETVAL (delegate, delegate_trampoline)) {
+               result = MONO_HANDLE_GETVAL (delegate, delegate_trampoline);
+               goto leave;
+       }
 
-       klass = ((MonoObject *)delegate)->vtable->klass;
+       klass = mono_handle_class (delegate);
        g_assert (klass->delegate);
 
-       method = delegate->method;
-       if (delegate->method_is_virtual)
-               method = mono_object_get_virtual_method (delegate->target, method);
+       method = MONO_HANDLE_GETVAL (delegate, method);
+       if (MONO_HANDLE_GETVAL (delegate, method_is_virtual)) {
+               MonoObjectHandle delegate_target = MONO_HANDLE_NEW_GET (MonoObject, delegate, target);
+               method = mono_object_handle_get_virtual_method (delegate_target, method, error);
+               if (!is_ok (error))
+                       goto leave;
+       }
 
        if (method->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL) {
                const char *exc_class, *exc_arg;
@@ -439,38 +483,39 @@ mono_delegate_to_ftnptr (MonoDelegate *delegate)
                ftnptr = mono_lookup_pinvoke_call (method, &exc_class, &exc_arg);
                if (!ftnptr) {
                        g_assert (exc_class);
-                       mono_set_pending_exception (mono_exception_from_name_msg (mono_defaults.corlib, "System", exc_class, exc_arg));
-                       return NULL;
+                       mono_error_set_generic_error (error, "System", exc_class, "%s", exc_arg);
+                       goto leave;
                }
-               return ftnptr;
+               result = ftnptr;
+               goto leave;
        }
 
-       if (delegate->target) {
+       MonoObjectHandle delegate_target = MONO_HANDLE_NEW_GET (MonoObject, delegate, target);
+       if (!MONO_HANDLE_IS_NULL (delegate_target)) {
                /* Produce a location which can be embedded in JITted code */
-               target_handle = mono_gchandle_new_weakref (delegate->target, FALSE);
+               target_handle = mono_gchandle_new_weakref (MONO_HANDLE_RAW (delegate_target), FALSE); /* FIXME: a version of mono_gchandle_new_weakref that takes a coop handle */
        }
 
-       wrapper = mono_marshal_get_managed_wrapper (method, klass, target_handle, &error);
-       if (!is_ok (&error))
-               goto fail;
+       wrapper = mono_marshal_get_managed_wrapper (method, klass, target_handle, error);
+       if (!is_ok (error))
+               goto leave;
 
-       delegate->delegate_trampoline = mono_compile_method_checked (wrapper, &error);
-       if (!is_ok (&error))
-               goto fail;
+       MONO_HANDLE_SETVAL (delegate, delegate_trampoline, gpointer, mono_compile_method_checked (wrapper, error));
+       if (!is_ok (error))
+               goto leave;
 
        // Add the delegate to the delegate hash table
        delegate_hash_table_add (delegate);
 
        /* when the object is collected, collect the dynamic method, too */
-       mono_object_register_finalizer ((MonoObject*)delegate);
+       mono_object_register_finalizer ((MonoObject*) MONO_HANDLE_RAW (delegate));
 
-       return delegate->delegate_trampoline;
+       result = MONO_HANDLE_GETVAL (delegate, delegate_trampoline);
 
-fail:
-       if (target_handle != 0)
+leave:
+       if (!is_ok (error) && target_handle != 0)
                mono_gchandle_free (target_handle);
-       mono_error_set_pending_exception (&error);
-       return NULL;
+       HANDLE_FUNCTION_RETURN_VAL (result);
 }
 
 /* 
@@ -502,7 +547,7 @@ delegate_hash_table_remove (MonoDelegate *d)
 }
 
 static void
-delegate_hash_table_add (MonoDelegate *d)
+delegate_hash_table_add (MonoDelegateHandle d)
 {
        guint32 gchandle;
        guint32 old_gchandle;
@@ -510,14 +555,15 @@ delegate_hash_table_add (MonoDelegate *d)
        mono_marshal_lock ();
        if (delegate_hash_table == NULL)
                delegate_hash_table = delegate_hash_table_new ();
+       gpointer delegate_trampoline = MONO_HANDLE_GETVAL (d, delegate_trampoline);
        if (mono_gc_is_moving ()) {
-               gchandle = mono_gchandle_new_weakref ((MonoObject*)d, FALSE);
-               old_gchandle = GPOINTER_TO_UINT (g_hash_table_lookup (delegate_hash_table, d->delegate_trampoline));
-               g_hash_table_insert (delegate_hash_table, d->delegate_trampoline, GUINT_TO_POINTER (gchandle));
+               gchandle = mono_gchandle_new_weakref ((MonoObject*) MONO_HANDLE_RAW (d), FALSE);
+               old_gchandle = GPOINTER_TO_UINT (g_hash_table_lookup (delegate_hash_table, delegate_trampoline));
+               g_hash_table_insert (delegate_hash_table, delegate_trampoline, GUINT_TO_POINTER (gchandle));
                if (old_gchandle)
                        mono_gchandle_free (old_gchandle);
        } else {
-               g_hash_table_insert (delegate_hash_table, d->delegate_trampoline, d);
+               g_hash_table_insert (delegate_hash_table, delegate_trampoline, MONO_HANDLE_RAW (d));
        }
        mono_marshal_unlock ();
 }
@@ -571,12 +617,23 @@ parse_unmanaged_function_pointer_attr (MonoClass *klass, MonoMethodPInvoke *piin
 MonoDelegate*
 mono_ftnptr_to_delegate (MonoClass *klass, gpointer ftn)
 {
+       HANDLE_FUNCTION_ENTER ();
        MonoError error;
+       MonoDelegateHandle result = mono_ftnptr_to_delegate_handle (klass, ftn, &error);
+       mono_error_set_pending_exception (&error);
+       HANDLE_FUNCTION_RETURN_OBJ (result);
+}
+
+MonoDelegateHandle
+mono_ftnptr_to_delegate_handle (MonoClass *klass, gpointer ftn, MonoError *error)
+{
+       HANDLE_FUNCTION_ENTER ();
+       error_init (error);
        guint32 gchandle;
-       MonoDelegate *d;
+       MonoDelegateHandle d = MONO_HANDLE_NEW (MonoDelegate, NULL);
 
        if (ftn == NULL)
-               return NULL;
+               goto leave;
 
        mono_marshal_lock ();
        if (delegate_hash_table == NULL)
@@ -586,30 +643,26 @@ mono_ftnptr_to_delegate (MonoClass *klass, gpointer ftn)
                gchandle = GPOINTER_TO_UINT (g_hash_table_lookup (delegate_hash_table, ftn));
                mono_marshal_unlock ();
                if (gchandle)
-                       d = (MonoDelegate*)mono_gchandle_get_target (gchandle);
-               else
-                       d = NULL;
+                       MONO_HANDLE_ASSIGN (d, MONO_HANDLE_CAST (MonoDelegate, mono_gchandle_get_target_handle (gchandle)));
        } else {
-               d = (MonoDelegate *)g_hash_table_lookup (delegate_hash_table, ftn);
+               MONO_HANDLE_ASSIGN (d, MONO_HANDLE_NEW (MonoDelegate, g_hash_table_lookup (delegate_hash_table, ftn)));
                mono_marshal_unlock ();
        }
-       if (d == NULL) {
+       if (MONO_HANDLE_IS_NULL (d)) {
                /* This is a native function, so construct a delegate for it */
                MonoMethodSignature *sig;
                MonoMethod *wrapper;
                MonoMarshalSpec **mspecs;
                MonoMethod *invoke = mono_get_delegate_invoke (klass);
                MonoMethodPInvoke piinfo;
-               MonoObject *this_obj;
+               MonoObjectHandle  this_obj;
                int i;
 
                if (use_aot_wrappers) {
                        wrapper = mono_marshal_get_native_func_wrapper_aot (klass);
-                       this_obj = mono_value_box_checked (mono_domain_get (), mono_defaults.int_class, &ftn, &error);
-                       if (!is_ok (&error)) {
-                               mono_error_set_pending_exception (&error);
-                               return NULL;
-                       }
+                       this_obj = MONO_HANDLE_NEW (MonoObject, mono_value_box_checked (mono_domain_get (), mono_defaults.int_class, &ftn, error));
+                       if (!is_ok (error))
+                               goto leave;
                } else {
                        memset (&piinfo, 0, sizeof (piinfo));
                        parse_unmanaged_function_pointer_attr (klass, &piinfo);
@@ -621,7 +674,7 @@ mono_ftnptr_to_delegate (MonoClass *klass, gpointer ftn)
                        sig->hasthis = 0;
 
                        wrapper = mono_marshal_get_native_func_wrapper (klass->image, sig, &piinfo, mspecs, ftn);
-                       this_obj = NULL;
+                       this_obj = MONO_HANDLE_NEW (MonoObject, NULL);
 
                        for (i = mono_method_signature (invoke)->param_count; i >= 0; i--)
                                if (mspecs [i])
@@ -630,25 +683,24 @@ mono_ftnptr_to_delegate (MonoClass *klass, gpointer ftn)
                        g_free (sig);
                }
 
-               d = (MonoDelegate*)mono_object_new_checked (mono_domain_get (), klass, &error);
-               if (!mono_error_ok (&error)) {
-                       mono_error_set_pending_exception (&error);
-                       return NULL;
-               }
-               gpointer compiled_ptr = mono_compile_method_checked (wrapper, &error);
-               if (mono_error_set_pending_exception (&error))
-                       return NULL;
-               mono_delegate_ctor_with_method ((MonoObject*)d, this_obj, compiled_ptr, wrapper, &error);
-               if (mono_error_set_pending_exception (&error))
-                       return NULL;
-       }
+               MONO_HANDLE_ASSIGN (d, MONO_HANDLE_NEW (MonoDelegate, mono_object_new_checked (mono_domain_get (), klass, error)));
+               if (!is_ok (error))
+                       goto leave;
+               gpointer compiled_ptr = mono_compile_method_checked (wrapper, error);
+               if (!is_ok (error))
+                       goto leave;
 
-       if (d->object.vtable->domain != mono_domain_get ()) {
-               mono_set_pending_exception (mono_get_exception_not_supported ("Delegates cannot be marshalled from native code into a domain other than their home domain"));
-               return NULL;
+               mono_delegate_ctor_with_method (MONO_HANDLE_CAST (MonoObject, d), this_obj, compiled_ptr, wrapper, error);
+               if (!is_ok (error))
+                       goto leave;
        }
 
-       return d;
+       g_assert (!MONO_HANDLE_IS_NULL (d));
+       if (MONO_HANDLE_DOMAIN (d) != mono_domain_get ())
+               mono_error_set_not_supported (error, "Delegates cannot be marshalled from native code into a domain other than their home domain");
+
+leave:
+       HANDLE_FUNCTION_RETURN_REF (MonoDelegate, d);
 }
 
 void
@@ -6045,8 +6097,10 @@ emit_marshal_object (EmitMarshalContext *m, int argnum, MonoType *t,
                        mono_mb_emit_ldloc (mb, 0);
                        mono_mb_emit_icall (mb, conv_to_icall (MONO_MARSHAL_CONV_FTN_DEL, NULL));
                        mono_mb_emit_stloc (mb, 3);
-               } else if (klass == mono_defaults.stringbuilder_class){
-                       // FIXME: implement
+               } else if (klass == mono_defaults.stringbuilder_class) {
+                       // FIXME:
+                       char *msg = g_strdup_printf ("Return marshalling of stringbuilders is not implemented.");
+                       mono_mb_emit_exception_marshal_directive (mb, msg);
                } else {
                        /* set src */
                        mono_mb_emit_stloc (mb, 0);
@@ -8014,8 +8068,8 @@ mono_marshal_get_native_wrapper (MonoMethod *method, gboolean check_exceptions,
                gboolean uses_handles = FALSE;
                gboolean save_handles_to_locals = FALSE;
                IcallHandlesLocal *handles_locals = NULL;
-               (void) mono_lookup_internal_call_full (method, &uses_handles);
 
+               (void) mono_lookup_internal_call_full (method, &uses_handles);
 
                /* If it uses handles and MonoError, it had better check exceptions */
                g_assert (!uses_handles || check_exceptions);
@@ -8107,8 +8161,7 @@ mono_marshal_get_native_wrapper (MonoMethod *method, gboolean check_exceptions,
                                mono_mb_emit_byte (mb, CEE_LDARG_0);
                                /* TODO support adding wrappers to non-static struct methods */
                                g_assert (!mono_class_is_valuetype(mono_method_get_class (method)));
-                               mono_mb_emit_byte (mb, CEE_LDC_I4_0);
-                               mono_mb_emit_icall (mb, mono_icall_handle_new_full);
+                               mono_mb_emit_icall (mb, mono_icall_handle_new);
                        }
                        for (i = 0; i < sig->param_count; i++) {
                                /* load each argument. references into the managed heap get wrapped in handles */
@@ -8118,27 +8171,24 @@ mono_marshal_get_native_wrapper (MonoMethod *method, gboolean check_exceptions,
                                        mono_mb_emit_ldarg (mb, j);
                                        break;
                                case ICALL_HANDLES_WRAP_OBJ:
-                                       /* argI = mono_handle_new_full (argI_raw, FALSE) */
+                                       /* argI = mono_handle_new (argI_raw) */
                                        mono_mb_emit_ldarg (mb, j);
-                                       mono_mb_emit_byte (mb, CEE_LDC_I4_0);
-                                       mono_mb_emit_icall (mb, mono_icall_handle_new_full);
+                                       mono_mb_emit_icall (mb, mono_icall_handle_new);
                                        break;
                                case ICALL_HANDLES_WRAP_OBJ_INOUT:
-                                       /* handleI = argI = mono_handle_new_full (NULL, FALSE) */
+                                       /* handleI = argI = mono_handle_new (NULL) */
                                        mono_mb_emit_byte (mb, CEE_LDNULL);
-                                       mono_mb_emit_byte (mb, CEE_LDC_I4_0);
-                                       mono_mb_emit_icall (mb, mono_icall_handle_new_full);
+                                       mono_mb_emit_icall (mb, mono_icall_handle_new);
                                        /* tmp = argI */
                                        mono_mb_emit_byte (mb, CEE_DUP);
                                        /* handleI = tmp */
                                        mono_mb_emit_stloc (mb, handles_locals[j].handle);
                                        break;
                                case ICALL_HANDLES_WRAP_VALUETYPE_REF:
-                                       /* (void) mono_handle_new_full (argI, TRUE); argI */
+                                       /* (void) mono_handle_new (argI); argI */
                                        mono_mb_emit_ldarg (mb, j);
                                        mono_mb_emit_byte (mb, CEE_DUP);
-                                       mono_mb_emit_byte (mb, CEE_LDC_I4_1);
-                                       mono_mb_emit_icall (mb, mono_icall_handle_new_full);
+                                       mono_mb_emit_icall (mb, mono_icall_handle_new_interior);
                                        mono_mb_emit_byte (mb, CEE_POP);
 #if 0
                                        fprintf (stderr, " Method %s.%s.%s has byref valuetype argument %d\n", method->klass->name_space, method->klass->name, method->name, i);
@@ -11008,18 +11058,23 @@ ves_icall_System_Runtime_InteropServices_Marshal_GetLastWin32Error (void)
 }
 
 guint32 
-ves_icall_System_Runtime_InteropServices_Marshal_SizeOf (MonoReflectionType *rtype)
+ves_icall_System_Runtime_InteropServices_Marshal_SizeOf (MonoReflectionTypeHandle rtype, MonoError *error)
 {
        MonoClass *klass;
        MonoType *type;
        guint32 layout;
 
-       MONO_CHECK_ARG_NULL (rtype, 0);
+       error_init (error);
+
+       if (MONO_HANDLE_IS_NULL (rtype)) {
+               mono_error_set_argument_null (error, "type", "");
+               return 0;
+       }
 
-       type = rtype->type;
+       type = MONO_HANDLE_GETVAL (rtype, type);
        klass = mono_class_from_mono_type (type);
        if (!mono_class_init (klass)) {
-               mono_set_pending_exception (mono_class_get_exception_for_failure (klass));
+               mono_error_set_for_class_failure (error, klass);
                return 0;
        }
 
@@ -11028,13 +11083,7 @@ ves_icall_System_Runtime_InteropServices_Marshal_SizeOf (MonoReflectionType *rty
        if (type->type == MONO_TYPE_PTR || type->type == MONO_TYPE_FNPTR) {
                return sizeof (gpointer);
        } else if (layout == TYPE_ATTRIBUTE_AUTO_LAYOUT) {
-               gchar *msg;
-               MonoException *exc;
-
-               msg = g_strdup_printf ("Type %s cannot be marshaled as an unmanaged structure.", klass->name);
-               exc = mono_get_exception_argument ("t", msg);
-               g_free (msg);
-               mono_set_pending_exception (exc);
+               mono_error_set_argument (error, "t", "Type %s cannot be marshaled as an unmanaged structure.", klass->name);
                return 0;
        }
 
@@ -11140,26 +11189,29 @@ ves_icall_System_Runtime_InteropServices_Marshal_PtrToStructure_type (gpointer s
 }
 
 int
-ves_icall_System_Runtime_InteropServices_Marshal_OffsetOf (MonoReflectionType *type, MonoString *field_name)
+ves_icall_System_Runtime_InteropServices_Marshal_OffsetOf (MonoReflectionTypeHandle ref_type, MonoStringHandle field_name, MonoError *error)
 {
-       MonoError error;
-       MonoMarshalType *info;
-       MonoClass *klass;
-       char *fname;
-       int match_index = -1;
-       
-       MONO_CHECK_ARG_NULL (type, 0);
-       MONO_CHECK_ARG_NULL (field_name, 0);
-
-       fname = mono_string_to_utf8_checked (field_name, &error);
-       if (mono_error_set_pending_exception (&error))
+       error_init (error);
+       if (MONO_HANDLE_IS_NULL (ref_type)) {
+               mono_error_set_argument_null (error, "type", "");
                return 0;
-       klass = mono_class_from_mono_type (type->type);
+       }
+       if (MONO_HANDLE_IS_NULL (field_name)) {
+               mono_error_set_argument_null (error, "fieldName", "");
+               return 0;
+       }
+
+       char *fname = mono_string_handle_to_utf8 (field_name, error);
+       return_val_if_nok (error, 0);
+
+       MonoType *type = MONO_HANDLE_GETVAL (ref_type, type);
+       MonoClass *klass = mono_class_from_mono_type (type);
        if (!mono_class_init (klass)) {
-               mono_set_pending_exception (mono_class_get_exception_for_failure (klass));
+               mono_error_set_for_class_failure (error, klass);
                return 0;
        }
 
+       int match_index = -1;
        while (klass && match_index == -1) {
                MonoClassField* field;
                int i = 0;
@@ -11181,21 +11233,14 @@ ves_icall_System_Runtime_InteropServices_Marshal_OffsetOf (MonoReflectionType *t
        g_free (fname);
 
        if(match_index == -1) {
-               MonoException* exc;
-               gchar *tmp;
-
                /* Get back original class instance */
-               klass = mono_class_from_mono_type (type->type);
+               klass = mono_class_from_mono_type (type);
 
-               tmp = g_strdup_printf ("Field passed in is not a marshaled member of the type %s", klass->name);
-               exc = mono_get_exception_argument ("fieldName", tmp);
-               g_free (tmp);
-               mono_set_pending_exception ((MonoException*)exc);
+               mono_error_set_argument (error, "fieldName", "Field passed in is not a marshaled member of the type %s", klass->name);
                return 0;
        }
 
-       info = mono_marshal_load_type_info (klass);     
+       MonoMarshalType *info = mono_marshal_load_type_info (klass);
        return info->fields [match_index].offset;
 }
 
@@ -11421,22 +11466,24 @@ ves_icall_System_Runtime_InteropServices_Marshal_UnsafeAddrOfPinnedArrayElement
        return mono_array_addr_with_size_fast (arrayobj, mono_array_element_size (arrayobj->obj.vtable->klass), index);
 }
 
-MonoDelegate*
-ves_icall_System_Runtime_InteropServices_Marshal_GetDelegateForFunctionPointerInternal (void *ftn, MonoReflectionType *type)
+MonoDelegateHandle
+ves_icall_System_Runtime_InteropServices_Marshal_GetDelegateForFunctionPointerInternal (void *ftn, MonoReflectionTypeHandle type, MonoError *error)
 {
-       MonoClass *klass = mono_type_get_class (type->type);
+       error_init (error);
+       MonoClass *klass = mono_type_get_class (MONO_HANDLE_GETVAL (type, type));
        if (!mono_class_init (klass)) {
-               mono_set_pending_exception (mono_class_get_exception_for_failure (klass));
+               mono_error_set_for_class_failure (error, klass);
                return NULL;
        }
 
-       return mono_ftnptr_to_delegate (klass, ftn);
+       return mono_ftnptr_to_delegate_handle (klass, ftn, error);
 }
 
 gpointer
-ves_icall_System_Runtime_InteropServices_Marshal_GetFunctionPointerForDelegateInternal (MonoDelegate *delegate)
+ves_icall_System_Runtime_InteropServices_Marshal_GetFunctionPointerForDelegateInternal (MonoDelegateHandle delegate, MonoError *error)
 {
-       return mono_delegate_to_ftnptr (delegate);
+       error_init (error);
+       return mono_delegate_handle_to_ftnptr (delegate, error);
 }
 
 /**
@@ -12317,11 +12364,21 @@ mono_icall_end (MonoThreadInfo *info, HandleStackMark *stackmark, MonoError *err
 }
 
 static MonoObjectHandle
-mono_icall_handle_new_full (gpointer rawobj, MonoBoolean interior)
+mono_icall_handle_new (gpointer rawobj)
+{
+#ifdef MONO_HANDLE_TRACK_OWNER
+       return mono_handle_new (rawobj, "<marshal args>");
+#else
+       return mono_handle_new (rawobj);
+#endif
+}
+
+static MonoObjectHandle
+mono_icall_handle_new_interior (gpointer rawobj)
 {
 #ifdef MONO_HANDLE_TRACK_OWNER
-       return mono_handle_new_full (rawobj, interior, "<marshal args>");
+       return mono_handle_new_interior (rawobj, "<marshal args>");
 #else
-       return mono_handle_new_full (rawobj, interior);
+       return mono_handle_new_interior (rawobj);
 #endif
 }
index 57018b828d41dbe1d0ee050ce98a27161586be3e..657193859061b252a75605813143c38043dd4af0 100644 (file)
@@ -458,7 +458,7 @@ guint32
 ves_icall_System_Runtime_InteropServices_Marshal_GetLastWin32Error (void);
 
 guint32 
-ves_icall_System_Runtime_InteropServices_Marshal_SizeOf (MonoReflectionType *rtype);
+ves_icall_System_Runtime_InteropServices_Marshal_SizeOf (MonoReflectionTypeHandle rtype, MonoError *error);
 
 void
 ves_icall_System_Runtime_InteropServices_Marshal_StructureToPtr (MonoObject *obj, gpointer dst, MonoBoolean delete_old);
@@ -470,7 +470,7 @@ MonoObject *
 ves_icall_System_Runtime_InteropServices_Marshal_PtrToStructure_type (gpointer src, MonoReflectionType *type);
 
 int
-ves_icall_System_Runtime_InteropServices_Marshal_OffsetOf (MonoReflectionType *type, MonoString *field_name);
+ves_icall_System_Runtime_InteropServices_Marshal_OffsetOf (MonoReflectionTypeHandle type, MonoStringHandle field_name, MonoError *error);
 
 gpointer
 ves_icall_System_Runtime_InteropServices_Marshal_StringToBSTR (MonoString *string);
@@ -514,11 +514,11 @@ ves_icall_System_Runtime_InteropServices_Marshal_FreeBSTR (void *ptr);
 void*
 ves_icall_System_Runtime_InteropServices_Marshal_UnsafeAddrOfPinnedArrayElement (MonoArray *arrayobj, int index);
 
-MonoDelegate*
-ves_icall_System_Runtime_InteropServices_Marshal_GetDelegateForFunctionPointerInternal (void *ftn, MonoReflectionType *type);
+MonoDelegateHandle
+ves_icall_System_Runtime_InteropServices_Marshal_GetDelegateForFunctionPointerInternal (void *ftn, MonoReflectionTypeHandle type, MonoError *error);
 
 gpointer
-ves_icall_System_Runtime_InteropServices_Marshal_GetFunctionPointerForDelegateInternal (MonoDelegate *delegate);
+ves_icall_System_Runtime_InteropServices_Marshal_GetFunctionPointerForDelegateInternal (MonoDelegateHandle delegate, MonoError *error);
 
 int
 ves_icall_System_Runtime_InteropServices_Marshal_AddRefInternal (gpointer pUnk);
index 59b1cc558995810ce60a38bd480b4515d0c5ccbc..7af56df2a72e2c59963beca822adaea5cf906cdd 100644 (file)
@@ -655,10 +655,10 @@ void
 mono_method_return_message_restore (MonoMethod *method, gpointer *params, MonoArray *out_args, MonoError *error);
 
 gboolean
-mono_delegate_ctor_with_method (MonoObject *this_obj, MonoObject *target, gpointer addr, MonoMethod *method, MonoError *error);
+mono_delegate_ctor_with_method (MonoObjectHandle this_obj, MonoObjectHandle target, gpointer addr, MonoMethod *method, MonoError *error);
 
 gboolean
-mono_delegate_ctor         (MonoObject *this_obj, MonoObject *target, gpointer addr, MonoError *error);
+mono_delegate_ctor         (MonoObjectHandle this_obj, MonoObjectHandle target, gpointer addr, MonoError *error);
 
 void*
 mono_class_get_allocation_ftn (MonoVTable *vtable, gboolean for_box, gboolean *pass_size_in_words);
@@ -768,12 +768,18 @@ struct _MonoDelegate {
        MonoBoolean method_is_virtual;
 };
 
+/* Safely access System.Delegate from native code */
+TYPED_HANDLE_DECL (MonoDelegate);
+
 typedef struct _MonoMulticastDelegate MonoMulticastDelegate;
 struct _MonoMulticastDelegate {
        MonoDelegate delegate;
        MonoArray *delegates;
 };
 
+/* Safely access System.MulticastDelegate from native code */
+TYPED_HANDLE_DECL (MonoMulticastDelegate);
+
 struct _MonoReflectionField {
        MonoObject object;
        MonoClass *klass;
index 92aa723f20a73f61c7ffec75631e46b6ee77ec94..d30f0413ac22f999432912235b52810720881244 100644 (file)
@@ -7817,43 +7817,44 @@ mono_print_unhandled_exception (MonoObject *exc)
  * On failure returns FALSE and sets \p error.
  */
 gboolean
-mono_delegate_ctor_with_method (MonoObject *this_obj, MonoObject *target, gpointer addr, MonoMethod *method, MonoError *error)
+mono_delegate_ctor_with_method (MonoObjectHandle this_obj, MonoObjectHandle target, gpointer addr, MonoMethod *method, MonoError *error)
 {
        MONO_REQ_GC_UNSAFE_MODE;
 
        error_init (error);
-       MonoDelegate *delegate = (MonoDelegate *)this_obj;
+       MonoDelegateHandle delegate = MONO_HANDLE_CAST (MonoDelegate, this_obj);
 
-       g_assert (this_obj);
+       g_assert (!MONO_HANDLE_IS_NULL (this_obj));
        g_assert (addr);
 
-       g_assert (mono_class_has_parent (mono_object_class (this_obj), mono_defaults.multicastdelegate_class));
+       MonoClass *klass = mono_handle_class (this_obj);
+       g_assert (mono_class_has_parent (klass, mono_defaults.multicastdelegate_class));
 
        if (method)
-               delegate->method = method;
+               MONO_HANDLE_SETVAL (delegate, method, MonoMethod*, method);
 
        mono_stats.delegate_creations++;
 
 #ifndef DISABLE_REMOTING
-       if (target && mono_object_is_transparent_proxy (target)) {
+       if (!MONO_HANDLE_IS_NULL (target) && mono_class_is_transparent_proxy (mono_handle_class (target))) {
                g_assert (method);
                method = mono_marshal_get_remoting_invoke (method);
 #ifdef ENABLE_INTERPRETER
                //g_error ("need RuntimeMethod in method_ptr when using interpreter");
 #endif
-               delegate->method_ptr = mono_compile_method_checked (method, error);
+               MONO_HANDLE_SETVAL (delegate, method_ptr, gpointer, mono_compile_method_checked (method, error));
                return_val_if_nok (error, FALSE);
-               MONO_OBJECT_SETREF (delegate, target, target);
+               MONO_HANDLE_SET (delegate, target, target);
        } else
 #endif
        {
-               delegate->method_ptr = addr;
-               MONO_OBJECT_SETREF (delegate, target, target);
+               MONO_HANDLE_SETVAL (delegate, method_ptr, gpointer, addr);
+               MONO_HANDLE_SET (delegate, target, target);
        }
 
-       delegate->invoke_impl = callbacks.create_delegate_trampoline (delegate->object.vtable->domain, delegate->object.vtable->klass);
+       MONO_HANDLE_SETVAL (delegate, invoke_impl, gpointer, callbacks.create_delegate_trampoline (MONO_HANDLE_DOMAIN (delegate), mono_handle_class (delegate)));
        if (callbacks.init_delegate)
-               callbacks.init_delegate (delegate);
+               callbacks.init_delegate (MONO_HANDLE_RAW (delegate)); /* FIXME: update init_delegate callback to take a MonoDelegateHandle */
        return TRUE;
 }
 
@@ -7867,7 +7868,7 @@ mono_delegate_ctor_with_method (MonoObject *this_obj, MonoObject *target, gpoint
  * On failure returns FALSE and sets \p error.
  */
 gboolean
-mono_delegate_ctor (MonoObject *this_obj, MonoObject *target, gpointer addr, MonoError *error)
+mono_delegate_ctor (MonoObjectHandle this_obj, MonoObjectHandle target, gpointer addr, MonoError *error)
 {
        MONO_REQ_GC_UNSAFE_MODE;
 
index 44adebbc0039700d42ef2ce34d3f9fb5bfd90735..7cb7f291259d689cacb1404e3142f599b5118b1a 100644 (file)
@@ -893,6 +893,10 @@ mono_gc_clear_domain (MonoDomain * domain)
 
        sgen_clear_nursery_fragments ();
 
+       FOREACH_THREAD (info) {
+               mono_handle_stack_free_domain ((HandleStack*)info->client_info.info.handle_stack, domain);
+       } FOREACH_THREAD_END
+
        if (sgen_mono_xdomain_checks && domain != mono_get_root_domain ()) {
                sgen_scan_for_registered_roots_in_domain (domain, ROOT_TYPE_NORMAL);
                sgen_scan_for_registered_roots_in_domain (domain, ROOT_TYPE_WBARRIER);
index dbbc43bc6f86643cbc5ec0a5706a45490091dddc..df41473dfe896fbc0e1fbe07c82f20b00a360eeb 100644 (file)
@@ -65,7 +65,7 @@ mono_w32error_unix_to_win32 (guint32 error)
        case EIO: return ERROR_INVALID_HANDLE;
        case EINTR: return ERROR_IO_PENDING; /* best match I could find */
        case EPIPE: return ERROR_WRITE_FAULT;
-       case ELOOP: return ERROR_ACCESS_DENIED; /* Empirically found by testing desktop dotnet. */
+       case ELOOP: return ERROR_CANT_RESOLVE_FILENAME;
 
        default:
                g_error ("%s: unknown error (%d) \"%s\"", __FILE__, error, g_strerror (error));
index c8fb1717a52225a1bb1fda4186822b821fc2a1b0..439bdd81a2a0d366e5f1a3fec63ac8448cbfed49 100644 (file)
@@ -42,6 +42,7 @@
 #define ERROR_FILENAME_EXCED_RANGE 206
 #define ERROR_DIRECTORY            267
 #define ERROR_IO_PENDING           997
+#define ERROR_CANT_RESOLVE_FILENAME 1921
 #define ERROR_ENCRYPTION_FAILED    6000
 #define WSAEINTR                   10004
 #define WSAEBADF                   10009
index f6e4d2df5138873927882d9bd3cda436dcba411b..6fcb0f691f19ed0ec8c362698b4ee38fe6893e9a 100644 (file)
@@ -2518,7 +2518,6 @@ gboolean mono_w32file_delete(const gunichar2 *name)
        gchar *filename;
        gint retval;
        gboolean ret = FALSE;
-       guint32 attrs;
 #if 0
        struct stat statbuf;
        FileShare *shareinfo;
@@ -2539,14 +2538,6 @@ gboolean mono_w32file_delete(const gunichar2 *name)
                return(FALSE);
        }
 
-       attrs = mono_w32file_get_attributes (name);
-       if (attrs == INVALID_FILE_ATTRIBUTES) {
-               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: file attributes error", __func__);
-               /* Error set by mono_w32file_get_attributes() */
-               g_free (filename);
-               return(FALSE);
-       }
-
 #if 0
        /* Check to make sure sharing allows us to open the file for
         * writing.  See bug 323389.
@@ -3748,7 +3739,7 @@ mono_w32file_get_attributes (const gunichar2 *name)
        }
 
        result = _wapi_stat (utf8_name, &buf);
-       if (result == -1 && errno == ENOENT) {
+       if (result == -1 && (errno == ENOENT || errno == ELOOP)) {
                /* Might be a dangling symlink... */
                result = _wapi_lstat (utf8_name, &buf);
        }
index 70b36ed2fa36feb4b22bd3579f3dc6e551a35207..75d90df2ed919996d24da13192ded7818e02f240 100644 (file)
@@ -12,6 +12,7 @@
 #include <pthread.h>
 #include <string.h>
 #include <stdlib.h>
+#include <sys/types.h>
 #include <sys/socket.h>
 #ifdef HAVE_SYS_IOCTL_H
 #include <sys/ioctl.h>
@@ -27,7 +28,6 @@
 #endif
 #include <errno.h>
 #include <fcntl.h>
-#include <sys/types.h>
 #ifdef HAVE_SYS_UIO_H
 #include <sys/uio.h>
 #endif
index d5ae8dbeece97b2fb080d546eaa4abcf04698354..30ef9a64ad7bc9628a0e2a5a52c7306b469dd6d1 100644 (file)
@@ -505,6 +505,7 @@ decode_klass_ref (MonoAotModule *module, guint8 *buf, guint8 **endbuf, MonoError
                                return NULL;
 
                        t = mini_get_shared_gparam (&par_klass->byval_arg, gshared_constraint);
+                       mono_metadata_free_type (gshared_constraint);
                        klass = mono_class_from_mono_type (t);
                } else {
                        int type = decode_value (p, &p);
@@ -3940,9 +3941,11 @@ load_method (MonoDomain *domain, MonoAotModule *amodule, MonoImage *image, MonoM
                                        if (!method)
                                                return NULL;
                                }
-                               full_name = mono_method_full_name (method, TRUE);
-                               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_AOT, "AOT: NOT FOUND: %s.", full_name);
-                               g_free (full_name);
+                               if (!(method->iflags & METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL)) {
+                                       full_name = mono_method_full_name (method, TRUE);
+                                       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_AOT, "AOT: NOT FOUND: %s.", full_name);
+                                       g_free (full_name);
+                               }
                        }
                        return NULL;
                }
index c7b10b3a4c1517217b7c56e798bf9379bced451c..f21ba2b5d18493d36caff6c2c3f4a94196963640 100644 (file)
@@ -2912,6 +2912,26 @@ class Tests
                // Console.WriteLine ("res2: " + res);
                return "outerFinally_fwos_fromFilter_2ndcatch_innerFinally_init" == res ? 1234 : 0;
        }
+
+    public struct FooStruct
+    {
+        public long Part1 { get; }
+        public long Part2 { get; }
+
+        public byte Part3 { get; }
+    }
+
+    [MethodImpl( MethodImplOptions.NoInlining )]
+    private static bool ExceptionFilter( byte x, FooStruct item ) => true;
+
+       public static int test_0_filter_caller_area () {
+        try {
+            throw new Exception();
+        }
+        catch (Exception) when (ExceptionFilter (default(byte), default (FooStruct))) {
+        }
+               return 0;
+       }
 }
 
 #if !__MOBILE__
index ef6ac1b428cc22cd8049df54da7ad6ea1e26cdbb..bea20a44f54c3f8ecc2fc534776564e4720e2e4a 100644 (file)
@@ -723,6 +723,7 @@ static InterpMethodArguments* build_args_from_sig (MonoMethodSignature *sig, Mon
 
 #ifdef TARGET_ARM
        g_assert (mono_arm_eabi_supported ());
+       int i8_align = mono_arm_i8_align ();
 #endif
 
        if (sig->hasthis)
@@ -757,7 +758,7 @@ static InterpMethodArguments* build_args_from_sig (MonoMethodSignature *sig, Mon
                case MONO_TYPE_I8:
 #ifdef TARGET_ARM
                        /* pairs begin at even registers */
-                       if (margs->ilen & 1)
+                       if (i8_align == 8 && margs->ilen & 1)
                                margs->ilen++;
 #endif
                        margs->ilen += 2;
@@ -834,7 +835,7 @@ static InterpMethodArguments* build_args_from_sig (MonoMethodSignature *sig, Mon
                        stackval *sarg = &frame->stack_args [i];
 #ifdef TARGET_ARM
                        /* pairs begin at even registers */
-                       if (int_i & 1)
+                       if (i8_align == 8 && int_i & 1)
                                int_i++;
 #endif
                        margs->iargs [int_i] = (gpointer) sarg->data.pair.lo;
index 401ac247e2a0569fb100aa530f9df08cb1682c03..648e69cf18cc49cff4c27e6ee517637df2d83a68 100644 (file)
@@ -1458,11 +1458,15 @@ mono_generic_class_init (MonoVTable *vtable)
 }
 
 void
-ves_icall_mono_delegate_ctor (MonoObject *this_obj, MonoObject *target, gpointer addr)
+ves_icall_mono_delegate_ctor (MonoObject *this_obj_raw, MonoObject *target_raw, gpointer addr)
 {
+       HANDLE_FUNCTION_ENTER ();
        MonoError error;
+       MONO_HANDLE_DCL (MonoObject, this_obj);
+       MONO_HANDLE_DCL (MonoObject, target);
        mono_delegate_ctor (this_obj, target, addr, &error);
        mono_error_set_pending_exception (&error);
+       HANDLE_FUNCTION_RETURN ();
 }
 
 gpointer
index b07f117d957ad765223db3a6feb794939df13379..5ce249f7f43d86e8a9ef71088b08702322186729 100644 (file)
@@ -9825,6 +9825,20 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
                                TYPE_LOAD_ERROR (cmethod->klass);
 
                        context_used = mini_method_check_context_used (cfg, cmethod);
+                                       
+                       if (!dont_verify && !cfg->skip_visibility) {
+                               MonoMethod *cil_method = cmethod;
+                               MonoMethod *target_method = cil_method;
+
+                               if (method->is_inflated) {
+                                       target_method = mini_get_method_allow_open (method, token, NULL, &(mono_method_get_generic_container (method_definition)->context), &cfg->error);
+                                       CHECK_CFG_ERROR;
+                               }
+                               
+                               if (!mono_method_can_access_method (method_definition, target_method) &&
+                                       !mono_method_can_access_method (method, cil_method))
+                                       emit_method_access_failure (cfg, method, cil_method);
+                       }
 
                        if (mono_security_core_clr_enabled ())
                                ensure_method_is_allowed_to_call_method (cfg, method, cmethod);
index e71d3d327169061beac384ebc404788eadd97c68..2978af64ecb07220ee87c0e7a8af7afb8f30c7f7 100644 (file)
@@ -1640,13 +1640,6 @@ mono_arch_allocate_vars (MonoCompile *cfg)
 
        /* Allocate locals */
        offsets = mono_allocate_stack_slots (cfg, cfg->arch.omit_fp ? FALSE: TRUE, &locals_stack_size, &locals_stack_align);
-       if (locals_stack_size > MONO_ARCH_MAX_FRAME_SIZE) {
-               char *mname = mono_method_full_name (cfg->method, TRUE);
-               mono_cfg_set_exception_invalid_program (cfg, g_strdup_printf ("Method %s stack is too big.", mname));
-               g_free (mname);
-               return;
-       }
-               
        if (locals_stack_align) {
                offset += (locals_stack_align - 1);
                offset &= ~(locals_stack_align - 1);
@@ -4836,7 +4829,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb)
                        amd64_mov_membase_reg (code, spvar->inst_basereg, spvar->inst_offset, AMD64_RSP, sizeof(gpointer));
 
                        if ((MONO_BBLOCK_IS_IN_REGION (bb, MONO_REGION_FINALLY) ||
-                                MONO_BBLOCK_IS_IN_REGION (bb, MONO_REGION_FINALLY)) &&
+                                MONO_BBLOCK_IS_IN_REGION (bb, MONO_REGION_FILTER)) &&
                                cfg->param_area) {
                                amd64_alu_reg_imm (code, X86_SUB, AMD64_RSP, ALIGN_TO (cfg->param_area, MONO_ARCH_FRAME_ALIGNMENT));
                        }
@@ -6679,7 +6672,26 @@ mono_arch_emit_prolog (MonoCompile *cfg)
                /* See mono_emit_stack_alloc */
 #if defined(MONO_ARCH_SIGSEGV_ON_ALTSTACK)
                guint32 remaining_size = alloc_size;
-               /*FIXME handle unbounded code expansion, we should use a loop in case of more than X interactions*/
+
+               /* Use a loop for large sizes */
+               if (remaining_size > 10 * 0x1000) {
+                       amd64_mov_reg_imm (code, X86_EAX, remaining_size / 0x1000);
+                       guint8 *label = code;
+                       amd64_alu_reg_imm (code, X86_SUB, AMD64_RSP, 0x1000);
+                       amd64_test_membase_reg (code, AMD64_RSP, 0, AMD64_RSP);
+                       amd64_alu_reg_imm (code, X86_SUB, AMD64_RAX, 1);
+                       amd64_alu_reg_imm (code, X86_CMP, AMD64_RAX, 0);
+                       guint8 *label2 = code;
+                       x86_branch8 (code, X86_CC_NE, 0, FALSE);
+                       amd64_patch (label2, label);
+                       if (cfg->arch.omit_fp) {
+                               cfa_offset += (remaining_size / 0x1000) * 0x1000;
+                               mono_emit_unwind_op_def_cfa_offset (cfg, code, cfa_offset);
+                       }
+
+                       remaining_size = remaining_size % 0x1000;
+               }
+
                guint32 required_code_size = ((remaining_size / 0x1000) + 1) * 11; /*11 is the max size of amd64_alu_reg_imm + amd64_test_membase_reg*/
                guint32 offset = code - cfg->native_code;
                if (G_UNLIKELY (required_code_size >= (cfg->code_size - offset))) {
index 62402dcc4185498b9e077c34a0b8320b242024a8..d568af78db8b190b775e019051bde842b4404605 100644 (file)
@@ -175,9 +175,6 @@ struct sigcontext {
  * reproduceable results for benchmarks */
 #define MONO_ARCH_CODE_ALIGNMENT 32
 
-/*This is the max size of the locals area of a given frame. I think 1MB is a safe default for now*/
-#define MONO_ARCH_MAX_FRAME_SIZE 0x100000
-
 struct MonoLMF {
        /* 
         * If the lowest bit is set, then this LMF has the rip field set. Otherwise,
index d88dc4f10cceca9aebb2a9d86ce38508f4eab103..10a9daa20ef24f7fd45f015a82d119d3c3f80a17 100644 (file)
@@ -323,7 +323,7 @@ mono_arm_patchable_bl (guint8 *code, int cond)
        return code;
 }
 
-#if defined(__ARM_EABI__) && defined(__linux__) && !defined(PLATFORM_ANDROID) && !defined(__native_client__)
+#if defined(__ARM_EABI__) && defined(__linux__) && !defined(PLATFORM_ANDROID) && !defined(__native_client__) && !defined(MONO_CROSS_COMPILE)
 #define HAVE_AEABI_READ_TP 1
 #endif
 
@@ -337,7 +337,6 @@ mono_arch_have_fast_tls (void)
 #ifdef HAVE_AEABI_READ_TP
        static gboolean have_fast_tls = FALSE;
         static gboolean inited = FALSE;
-       gpointer tp1, tp2;
 
        if (mini_get_debug_options ()->use_fallback_tls)
                return FALSE;
@@ -345,10 +344,14 @@ mono_arch_have_fast_tls (void)
        if (inited)
                return have_fast_tls;
 
-       tp1 = __aeabi_read_tp ();
-       asm volatile("mrc p15, 0, %0, c13, c0, 3" : "=r" (tp2));
+       if (v7_supported) {
+               gpointer tp1, tp2;
 
-       have_fast_tls = tp1 && tp1 == tp2;
+               tp1 = __aeabi_read_tp ();
+               asm volatile("mrc p15, 0, %0, c13, c0, 3" : "=r" (tp2));
+
+               have_fast_tls = tp1 && tp1 == tp2;
+       }
        inited = TRUE;
        return have_fast_tls;
 #else
@@ -359,6 +362,7 @@ mono_arch_have_fast_tls (void)
 static guint8*
 emit_tls_get (guint8 *code, int dreg, int tls_offset)
 {
+       g_assert (v7_supported);
        ARM_MRC (code, 15, 0, dreg, 13, 0, 3);
        ARM_LDR_IMM (code, dreg, dreg, tls_offset);
        return code;
@@ -368,6 +372,7 @@ static guint8*
 emit_tls_set (guint8 *code, int sreg, int tls_offset)
 {
        int tp_reg = (sreg != ARMREG_R0) ? ARMREG_R0 : ARMREG_R1;
+       g_assert (v7_supported);
        ARM_MRC (code, 15, 0, tp_reg, 13, 0, 3);
        ARM_STR_IMM (code, sreg, tp_reg, tls_offset);
        return code;
@@ -4039,6 +4044,12 @@ mono_arm_eabi_supported (void)
        return eabi_supported;
 }
 
+int
+mono_arm_i8_align (void)
+{
+       return i8_align;
+}
+
 #ifndef DISABLE_JIT
 
 static guint8*
index eec8a507f2815106fbfdccb18375cf6d79bc6382..671014199b8be525e33d87a860309975b9e4df74 100644 (file)
@@ -393,6 +393,9 @@ mono_arm_thumb_supported (void);
 gboolean
 mono_arm_eabi_supported (void);
 
+int
+mono_arm_i8_align (void);
+
 GSList*
 mono_arm_get_exception_trampolines (gboolean aot);
 
index d7475aebd3aff13266a7d01c0419a0fb04b675b2..5ef3b350bf065f713a12e9992a124a9d0c0b5b8f 100644 (file)
@@ -3498,6 +3498,7 @@ mini_get_shared_gparam (MonoType *t, MonoType *constraint)
        copy = (MonoGSharedGenericParam *)mono_image_alloc0 (image, sizeof (MonoGSharedGenericParam));
        memcpy (&copy->param, par, sizeof (MonoGenericParamFull));
        copy->param.info.pklass = NULL;
+       constraint = mono_metadata_type_dup (image, constraint);
        name = get_shared_gparam_name (constraint->type, ((MonoGenericParamFull*)copy)->info.name);
        copy->param.info.name = mono_image_strdup (image, name);
        g_free (name);
index 0d1b11f3e45a95dabae4f05a33ff37576f11fef5..3659f7b99a420a344268ab756e9daedbfde50f4f 100644 (file)
@@ -581,16 +581,28 @@ static void
 clock_init (void)
 {
        switch (mono_profiler_get_sampling_mode ()) {
-       case MONO_PROFILER_STAT_MODE_PROCESS:
+       case MONO_PROFILER_STAT_MODE_PROCESS: {
+       /*
+        * If we don't have clock_nanosleep (), measuring the process time
+        * makes very little sense as we can only use nanosleep () to sleep on
+        * real time.
+        */
 #ifdef HAVE_CLOCK_NANOSLEEP
+               struct timespec ts = { 0 };
+
                /*
-                * If we don't have clock_nanosleep (), measuring the process time
-                * makes very little sense as we can only use nanosleep () to sleep on
-                * real time.
+                * Some systems (e.g. Windows Subsystem for Linux) declare the
+                * CLOCK_PROCESS_CPUTIME_ID clock but don't actually support it. For
+                * those systems, we fall back to CLOCK_MONOTONIC if we get EINVAL.
                 */
-               sampling_posix_clock = CLOCK_PROCESS_CPUTIME_ID;
-               break;
+               if (clock_nanosleep (CLOCK_PROCESS_CPUTIME_ID, TIMER_ABSTIME, &ts, NULL) != EINVAL) {
+                       sampling_posix_clock = CLOCK_PROCESS_CPUTIME_ID;
+                       break;
+               }
 #endif
+
+               // fallthrough
+       }
        case MONO_PROFILER_STAT_MODE_REAL: sampling_posix_clock = CLOCK_MONOTONIC; break;
        default: g_assert_not_reached (); break;
        }
index 51c0cac6de625a0579fd85b262059f98a9e3f1f2..723238f4e94b55edada227fd251ffe40344a769b 100644 (file)
@@ -847,26 +847,31 @@ mono_arch_get_enter_icall_trampoline (MonoTrampInfo **info)
        guint8 *start = NULL, *code, *label_gexits [gregs_num], *label_fexits [fregs_num], *label_leave_tramp [3], *label_is_float_ret;
        MonoJumpInfo *ji = NULL;
        GSList *unwind_ops = NULL;
-       int buf_len, i, framesize = 0, off_methodargs, off_targetaddr;
+       int buf_len, i, framesize, off_methodargs, off_targetaddr;
        const int fp_reg = ARMREG_R7;
 
        buf_len = 512 + 1024;
        start = code = (guint8 *) mono_global_codeman_reserve (buf_len);
 
-       off_methodargs = framesize;
+       framesize = 5 * sizeof (mgreg_t); /* lr, r4, r8, r6 and plus one */
+
+       off_methodargs = -framesize;
        framesize += sizeof (mgreg_t);
 
-       off_targetaddr = framesize;
+       off_targetaddr = -framesize;
        framesize += sizeof (mgreg_t);
 
-       framesize = ALIGN_TO (framesize, MONO_ARCH_FRAME_ALIGNMENT);
+       framesize = ALIGN_TO (framesize + 4 * sizeof (mgreg_t), MONO_ARCH_FRAME_ALIGNMENT);
 
        /* allocate space on stack for argument passing */
        const int stack_space = ALIGN_TO (((gregs_num - ARMREG_R3) * sizeof (mgreg_t)), MONO_ARCH_FRAME_ALIGNMENT);
 
-       /* use r4, r5 and r6 as scratch registers */
-       ARM_PUSH (code, (1 << fp_reg) | (1 << ARMREG_LR) | (1 << ARMREG_R4) | (1 << ARMREG_R5) | (1 << ARMREG_R6));
+       /* iOS ABI */
+       ARM_PUSH (code, (1 << fp_reg) | (1 << ARMREG_LR));
        ARM_MOV_REG_REG (code, fp_reg, ARMREG_SP);
+
+       /* use r4, r8 and r6 as scratch registers */
+       ARM_PUSH (code, (1 << ARMREG_R4) | (1 << ARMREG_R8) | (1 << ARMREG_R6));
        ARM_SUB_REG_IMM8 (code, ARMREG_SP, ARMREG_SP, stack_space + framesize);
 
        /* save InterpMethodArguments* onto stack */
@@ -878,32 +883,32 @@ mono_arch_get_enter_icall_trampoline (MonoTrampInfo **info)
        /* load pointer to InterpMethodArguments* into r4 */
        ARM_MOV_REG_REG (code, ARMREG_R4, ARMREG_R1);
 
-       /* move flen into r5 */
-       ARM_LDR_IMM (code, ARMREG_R5, ARMREG_R4, MONO_STRUCT_OFFSET (InterpMethodArguments, flen));
+       /* move flen into r8 */
+       ARM_LDR_IMM (code, ARMREG_R8, ARMREG_R4, MONO_STRUCT_OFFSET (InterpMethodArguments, flen));
        /* load pointer to fargs into r6 */
        ARM_LDR_IMM (code, ARMREG_R6, ARMREG_R4, MONO_STRUCT_OFFSET (InterpMethodArguments, fargs));
 
        for (i = 0; i < fregs_num; ++i) {
-               ARM_CMP_REG_IMM (code, ARMREG_R5, 0, 0);
+               ARM_CMP_REG_IMM (code, ARMREG_R8, 0, 0);
                label_fexits [i] = code;
                ARM_B_COND (code, ARMCOND_EQ, 0);
 
                g_assert (i <= ARM_VFP_D7); /* otherwise, need to pass args on stack */
                ARM_FLDD (code, i, ARMREG_R6, i * sizeof (double));
-               ARM_SUB_REG_IMM8 (code, ARMREG_R5, ARMREG_R5, 1);
+               ARM_SUB_REG_IMM8 (code, ARMREG_R8, ARMREG_R8, 1);
        }
 
        for (i = 0; i < fregs_num; i++)
                arm_patch (label_fexits [i], code);
 
-       /* move ilen into r5 */
-       ARM_LDR_IMM (code, ARMREG_R5, ARMREG_R4, MONO_STRUCT_OFFSET (InterpMethodArguments, ilen));
+       /* move ilen into r8 */
+       ARM_LDR_IMM (code, ARMREG_R8, ARMREG_R4, MONO_STRUCT_OFFSET (InterpMethodArguments, ilen));
        /* load pointer to iargs into r6 */
        ARM_LDR_IMM (code, ARMREG_R6, ARMREG_R4, MONO_STRUCT_OFFSET (InterpMethodArguments, iargs));
 
        int stack_offset = 0;
        for (i = 0; i < gregs_num; i++) {
-               ARM_CMP_REG_IMM (code, ARMREG_R5, 0, 0);
+               ARM_CMP_REG_IMM (code, ARMREG_R8, 0, 0);
                label_gexits [i] = code;
                ARM_B_COND (code, ARMCOND_EQ, 0);
 
@@ -914,7 +919,7 @@ mono_arch_get_enter_icall_trampoline (MonoTrampInfo **info)
                        ARM_STR_IMM (code, ARMREG_R4, ARMREG_SP, stack_offset);
                        stack_offset += sizeof (mgreg_t);
                }
-               ARM_SUB_REG_IMM8 (code, ARMREG_R5, ARMREG_R5, 1);
+               ARM_SUB_REG_IMM8 (code, ARMREG_R8, ARMREG_R8, 1);
        }
 
        for (i = 0; i < gregs_num; i++)
@@ -930,24 +935,24 @@ mono_arch_get_enter_icall_trampoline (MonoTrampInfo **info)
        ARM_LDR_IMM (code, ARMREG_R4, fp_reg, off_methodargs);
 
        /* load is_float_ret */
-       ARM_LDR_IMM (code, ARMREG_R5, ARMREG_R4, MONO_STRUCT_OFFSET (InterpMethodArguments, is_float_ret));
+       ARM_LDR_IMM (code, ARMREG_R8, ARMREG_R4, MONO_STRUCT_OFFSET (InterpMethodArguments, is_float_ret));
 
        /* check if a float return value is expected */
-       ARM_CMP_REG_IMM (code, ARMREG_R5, 0, 0);
+       ARM_CMP_REG_IMM (code, ARMREG_R8, 0, 0);
        label_is_float_ret = code;
        ARM_B_COND (code, ARMCOND_NE, 0);
 
        /* greg return */
        /* load retval */
-       ARM_LDR_IMM (code, ARMREG_R5, ARMREG_R4, MONO_STRUCT_OFFSET (InterpMethodArguments, retval));
+       ARM_LDR_IMM (code, ARMREG_R8, ARMREG_R4, MONO_STRUCT_OFFSET (InterpMethodArguments, retval));
 
-       ARM_CMP_REG_IMM (code, ARMREG_R5, 0, 0);
+       ARM_CMP_REG_IMM (code, ARMREG_R8, 0, 0);
        label_leave_tramp [0] = code;
        ARM_B_COND (code, ARMCOND_EQ, 0);
 
        /* store greg result, always write back 64bit */
-       ARM_STR_IMM (code, ARMREG_R0, ARMREG_R5, 0);
-       ARM_STR_IMM (code, ARMREG_R1, ARMREG_R5, 4);
+       ARM_STR_IMM (code, ARMREG_R0, ARMREG_R8, 0);
+       ARM_STR_IMM (code, ARMREG_R1, ARMREG_R8, 4);
 
        label_leave_tramp [1] = code;
        ARM_B_COND (code, ARMCOND_AL, 0);
@@ -955,20 +960,22 @@ mono_arch_get_enter_icall_trampoline (MonoTrampInfo **info)
        /* freg return */
        arm_patch (label_is_float_ret, code);
        /* load retval */
-       ARM_LDR_IMM (code, ARMREG_R5, ARMREG_R4, MONO_STRUCT_OFFSET (InterpMethodArguments, retval));
+       ARM_LDR_IMM (code, ARMREG_R8, ARMREG_R4, MONO_STRUCT_OFFSET (InterpMethodArguments, retval));
 
-       ARM_CMP_REG_IMM (code, ARMREG_R5, 0, 0);
+       ARM_CMP_REG_IMM (code, ARMREG_R8, 0, 0);
        label_leave_tramp [2] = code;
        ARM_B_COND (code, ARMCOND_EQ, 0);
 
        /* store freg result */
-       ARM_FSTD (code, ARM_VFP_F0, ARMREG_R5, 0);
+       ARM_FSTD (code, ARM_VFP_F0, ARMREG_R8, 0);
 
        for (i = 0; i < 3; i++)
                arm_patch (label_leave_tramp [i], code);
 
+       ARM_ADD_REG_IMM8 (code, ARMREG_SP, ARMREG_SP, stack_space + framesize);
+       ARM_POP (code, (1 << ARMREG_R4) | (1 << ARMREG_R8) | (1 << ARMREG_R6));
        ARM_MOV_REG_REG (code, ARMREG_SP, fp_reg);
-       ARM_POP (code, (1 << fp_reg) | (1 << ARMREG_PC) | (1 << ARMREG_R4) | (1 << ARMREG_R5) | (1 << ARMREG_R6));
+       ARM_POP (code, (1 << fp_reg) | (1 << ARMREG_PC));
 
        g_assert (code - start < buf_len);
 
old mode 100644 (file)
new mode 100755 (executable)
index 1a4af53..f4182ec
@@ -15,6 +15,7 @@ check-local:
        $(MAKE) test-appdomain-unload || ok=false; \
        $(MAKE) test-process-stress || ok=false; \
        $(MAKE) test-pedump || ok=false; \
+       $(MAKE) test-internalsvisibleto || ok=false; \
        $(MAKE) rm-empty-logs || ok=false; \
        $(MAKE) runtest-gac-loading || ok=false; \
        $$ok
@@ -462,6 +463,7 @@ TESTS_CS_SRC=               \
        assemblyresolve_event2.2.cs     \
        appdomain-unload-callback.cs    \
        appdomain-unload-doesnot-raise-pending-events.cs        \
+       appdomain-unload-asmload.cs     \
        unload-appdomain-on-shutdown.cs \
        bug-47295.cs    \
        loader.cs       \
@@ -819,7 +821,9 @@ PROFILE_DISABLED_TESTS += \
        vt-sync-method.exe \
        resolve_method_bug.2.exe \
        resolve_field_bug.2.exe \
-       resolve_type_bug.2.exe
+       resolve_type_bug.2.exe \
+       bug-81691.exe \
+       bug-327438.2.exe
 
 # Tests which rely on remoting
 PROFILE_DISABLED_TESTS += \
@@ -942,7 +946,9 @@ PROFILE_DISABLED_TESTS += \
        sgen-domain-unload-2.exe
 
 PROFILE_DISABLED_TESTS += \
-       appdomain-loader.exe
+       appdomain-loader.exe \
+       assemblyresolve_event3.exe \
+       appdomain-serialize-exception.exe
 endif
 
 if HYBRID_AOT_TESTS
@@ -1207,27 +1213,29 @@ test-platform:  test-iomap-regression
 endif
 endif
 
-if X86
-if HOST_WIN32
-else
-test-platform: test-eglib-remap
-endif
-endif
-
 # Target to precompile the test executables
 tests: compile-tests
 
 #
 # Test that no symbols are missed in eglib-remap.h
 #
-OK_G_SYMBOLS='g_list\|g_slist\|g_concat_dir_and_file\|g_Ctoc'
 if NACL_CODEGEN
-test-eglib-remap:
 else
+if PLATFORM_LINUX
+test-platform: test-eglib-remap
+else
+if PLATFORM_DARWIN
+test-platform: test-eglib-remap
+endif
+endif
+endif
+# The following regexp describes all symbols that start with "g_" but are not part of eglibc.
+# The optional underscore prepending symbol names may or may not appear depending on the
+# system and the state of the leading-underscore compiler flag.
+OK_G_SYMBOLS='\<_?g_(s?list_(pre|ap)pend_(image|mempool)|concat_dir_and_file|Ctoc)\>'
 test-eglib-remap:
        @echo "Testing eglib remap..."
-       @if which nm > /dev/null; then if nm $(top_builddir)/mono/mini/mono | grep -v $(OK_G_SYMBOLS) | grep 't g_'; then exit 1; else exit 0; fi; fi
-endif
+       @if which nm > /dev/null; then if nm $(top_builddir)/mono/mini/mono | grep -Ev $(OK_G_SYMBOLS) | grep -E 't _?g_'; then exit 1; else exit 0; fi; fi
 
 test-env-options:
        MONO_ENV_OPTIONS="--version" $(RUNTIME) array-init.exe | grep -q Architecture:
@@ -2026,7 +2034,7 @@ test-console-output: console-output.exe
 test-pedump: test-runner.exe
        $(with_mono_path) $(mono_build_root)/tools/pedump/pedump --verify error test-runner.exe
 
-.PHONY: test-gac-loading
+.PHONY: test-gac-loading test-eglib-remap
 
 runtest-gac-loading: test-runner.exe
        $(MAKE) -C testing_gac runtest
@@ -2078,4 +2086,20 @@ endif
 libtest_la_SOURCES = libtest.c
 libtest_la_LIBADD = $(GLIB_LIBS) $(LIBICONV)
 
+test-internalsvisibleto: internalsvisibleto-runtimetest.exe internalsvisibleto-compilertest.exe internalsvisibleto-library.dll
+       $(Q) $(RUNTIME) internalsvisibleto-runtimetest.exe 1>internalsvisibleto-runtimetest.exe.stdout 2>internalsvisibleto-runtimetest.exe.stderr
+       $(Q) $(RUNTIME) internalsvisibleto-compilertest.exe 1>internalsvisibleto-compilertest.exe.stdout 2>internalsvisibleto-compilertest.exe.stderr
+
+internalsvisibleto-runtimetest.exe: internalsvisibleto-runtimetest.cs internalsvisibleto-library.cs
+       $(Q) $(MCS) -out:internalsvisibleto-correctcase.dll -target:library -d:CORRECT_CASE -d:PERMISSIVE internalsvisibleto-library.cs 
+       $(Q) $(MCS) -out:internalsvisibleto-wrongcase.dll -target:library -d:WRONG_CASE -d:PERMISSIVE internalsvisibleto-library.cs
+       $(Q) $(MCS) -out:internalsvisibleto-runtimetest.exe -warn:0 -r:internalsvisibleto-correctcase.dll -r:internalsvisibleto-wrongcase.dll internalsvisibleto-runtimetest.cs
+       $(Q) $(MCS) -out:internalsvisibleto-correctcase.dll -target:library -d:CORRECT_CASE internalsvisibleto-library.cs       
+       $(Q) $(MCS) -out:internalsvisibleto-wrongcase.dll -target:library -d:WRONG_CASE internalsvisibleto-library.cs
+
+internalsvisibleto-compilertest.exe: internalsvisibleto-compilertest.cs internalsvisibleto-library.cs
+       $(Q) $(MCS) -out:internalsvisibleto-correctcase-2.dll -target:library -d:CORRECT_CASE internalsvisibleto-library.cs     
+       $(Q) $(MCS) -out:internalsvisibleto-wrongcase-2.dll -target:library -d:WRONG_CASE internalsvisibleto-library.cs
+       $(Q) $(MCS) -out:internalsvisibleto-compilertest.exe -warn:0 -r:internalsvisibleto-correctcase-2.dll -r:internalsvisibleto-wrongcase-2.dll internalsvisibleto-compilertest.cs
+
 CLEANFILES = $(TESTS_CS) $(TESTS_IL) $(TESTS_BENCH) $(TESTS_STRESS) $(TESTSAOT_CS) $(TESTSAOT_IL) $(TESTSAOT_BENCH) $(TESTSAOT_STRESS) *.dll *.stdout *.aotlog *.exe stest.dat
diff --git a/mono/tests/appdomain-unload-asmload.cs b/mono/tests/appdomain-unload-asmload.cs
new file mode 100644 (file)
index 0000000..5f79890
--- /dev/null
@@ -0,0 +1,57 @@
+using System;
+using System.Threading.Tasks;
+
+/* This is a regression test that checks that after an AssemblyLoad event fires
+ * in a domain, the domain can be unloaded.  In bug # 56694, a
+ * System.Reflection.Assembly object from the unloaded domain was kept alive
+ * and crashed the GC.  */
+namespace AppDomainUnloadAsmLoad
+{
+       class Program
+       {
+               static void Main(string[] args)
+               {
+                       // Need some threads in play
+                       new Program().Run().Wait();
+               }
+
+               private async Task Run()
+               {
+                       var appDomain = AppDomain.CreateDomain("Test subdomain", null, AppDomain.CurrentDomain.SetupInformation);
+                       try
+                       {
+                               var driver = (AppDomainTestDriver)appDomain.CreateInstanceAndUnwrap(typeof(AppDomainTestDriver).Assembly.FullName,
+                                                                                                   typeof(AppDomainTestDriver).FullName);
+                               driver.Test();
+                       }
+                       finally
+                       {
+                               AppDomain.Unload(appDomain);
+                       }
+               }
+       }
+
+       class AppDomainTestDriver : MarshalByRefObject
+       {
+               static AppDomainTestDriver()
+               {
+                       // Needs a callback so that the runtime fires the
+                       // AssembyLoad event for this domain and materializes a System.Reflection.Assembly
+                       AppDomain.CurrentDomain.AssemblyLoad += CurrentDomain_AssemblyLoad;
+               }
+
+               private static void CurrentDomain_AssemblyLoad(object sender, AssemblyLoadEventArgs args)
+               {
+               }
+
+               internal void Test()
+               {
+                       /* this can be any class from any assembly that hasn't
+                        * already been loaded into the test domain.
+                        * System.Xml.dll is good because all the tests link
+                        * against it, but it's not otherwise used by this
+                        * domain. */
+                       var foo = default(System.Xml.XmlException);
+               }
+    }
+}
diff --git a/mono/tests/internalsvisibleto-compilertest.cs b/mono/tests/internalsvisibleto-compilertest.cs
new file mode 100755 (executable)
index 0000000..c38fb0d
--- /dev/null
@@ -0,0 +1,60 @@
+using System;
+
+namespace InternalsVisibleTo {
+    class Program {
+        static void Main (string[] args) {
+            var failCount = 0;
+
+            Console.WriteLine("-- Correct case --");
+
+            try {
+                var a = new CorrectCaseFriendAssembly.InternalClass(@internal: 0);
+                Console.WriteLine("Access internal class internal ctor: OK");
+            } catch (MemberAccessException) {
+                failCount += 1;
+                Console.WriteLine("Access friend internal ctor: Fail");
+            }
+
+            Console.WriteLine("-- Wrong case --");
+
+            try {
+                var a = new WrongCaseFriendAssembly.InternalClass(@internal: 0);
+                Console.WriteLine("Access internal class internal ctor: OK");
+            } catch (MemberAccessException) {
+                failCount += 1;
+                Console.WriteLine("Access friend internal ctor: Fail");
+            }
+
+            try {
+                // This also works in the Windows CLR. Huh.
+                WrongCaseFriendAssembly.InternalClass.PrivateStaticMethod();
+                Console.WriteLine("Access friend private static method: OK");
+            } catch (MemberAccessException) {
+                Console.WriteLine("Access friend private static method: Fail");
+                failCount += 1;
+            }
+
+            try {
+                WrongCaseFriendAssembly.InternalClass.InternalStaticMethod();
+                Console.WriteLine("Access friend internal static method: OK");
+            } catch (MemberAccessException) {
+                failCount += 1;
+                Console.WriteLine("Access friend internal static method: Fail");
+            }
+
+            try {
+                WrongCaseFriendAssembly.PublicClass.InternalStaticMethod();
+                Console.WriteLine("Access public internal static method: OK");
+            } catch (MemberAccessException) {
+                failCount += 1;
+                Console.WriteLine("Access public internal static method: Fail");
+            }
+
+            if (System.Diagnostics.Debugger.IsAttached)
+                Console.ReadLine();
+
+            Console.WriteLine("Incorrect results: {0}", failCount);
+            Environment.ExitCode = failCount;
+        }
+    }
+}
diff --git a/mono/tests/internalsvisibleto-library.cs b/mono/tests/internalsvisibleto-library.cs
new file mode 100644 (file)
index 0000000..a27547a
--- /dev/null
@@ -0,0 +1,106 @@
+using System;
+using System.Runtime.CompilerServices;
+
+#if CORRECT_CASE
+[assembly: InternalsVisibleTo("internalsvisibleto-runtimetest")]
+[assembly: InternalsVisibleTo("internalsvisibleto-compilertest")]
+#else
+[assembly: InternalsVisibleTo("iNtErnAlsVisibLETo-RUntimeTesT")]
+[assembly: InternalsVisibleTo("iNtErnAlsVisibLETo-COmpilerTesT")]
+#endif
+
+#if CORRECT_CASE
+namespace CorrectCaseFriendAssembly {
+#else
+namespace WrongCaseFriendAssembly {
+#endif
+
+#if PERMISSIVE
+    public
+#else
+    internal 
+#endif
+     class InternalClass
+    {
+        public InternalClass (char @public) {
+            Console.WriteLine("InternalClass(public)");
+        }
+
+#if PERMISSIVE
+        public
+#else
+        internal 
+#endif
+         InternalClass (int @internal) {
+            Console.WriteLine("InternalClass(internal)");
+        }
+
+#if PERMISSIVE
+        public
+#else
+        private
+#endif
+         InternalClass (bool @private) {
+            Console.WriteLine("InternalClass(private)");
+        }
+
+        public static void PrivateStaticMethod () {
+            Console.WriteLine("InternalClass.PrivateStaticMethod");
+        }
+
+#if PERMISSIVE
+        public
+#else
+        internal 
+#endif
+         static void InternalStaticMethod () {
+            Console.WriteLine("InternalClass.InternalStaticMethod");
+        }
+
+#if PERMISSIVE
+        public
+#else
+        internal 
+#endif
+         void InternalMethod () {
+            Console.WriteLine("InternalClass.InternalMethod");
+        }
+
+        public static void PublicStaticMethod () {
+            Console.WriteLine("PublicStaticMethod");
+        }
+
+        public void PublicMethod () {
+            Console.WriteLine("PublicMethod");
+        }
+    }
+
+    public class PublicClass {
+
+#if PERMISSIVE
+        public
+#else
+        internal 
+#endif
+         PublicClass () {
+        }
+
+#if PERMISSIVE
+        public
+#else
+        internal 
+#endif
+         static void InternalStaticMethod () {
+            Console.WriteLine("PublicClass.InternalStaticMethod");
+        }
+
+#if PERMISSIVE
+        public
+#else
+        internal 
+#endif
+         void InternalMethod () {
+            Console.WriteLine("PublicClass.InternalMethod");
+        }
+    }
+}
diff --git a/mono/tests/internalsvisibleto-runtimetest.cs b/mono/tests/internalsvisibleto-runtimetest.cs
new file mode 100755 (executable)
index 0000000..ec88055
--- /dev/null
@@ -0,0 +1,100 @@
+using System;
+
+namespace InternalsVisibleTo {
+    class Program {
+        static void Main (string[] args) {
+            var failCount = 0;
+
+            Console.WriteLine("-- Correct case --");
+
+            try {
+                var a = new CorrectCaseFriendAssembly.InternalClass(@private: false);
+                Console.WriteLine("Access internal class private ctor: OK");
+                // Microsoft behaves this way
+            } catch (MemberAccessException) {
+                Console.WriteLine("Access internal class private ctor: Fail");
+                // FIXME: Mono behaves this way
+                // failCount += 1;
+            }
+
+            try {
+                var a = new CorrectCaseFriendAssembly.InternalClass(@internal: 0);
+                Console.WriteLine("Access internal class internal ctor: OK");
+            } catch (MemberAccessException) {
+                failCount += 1;
+                Console.WriteLine("Access friend internal ctor: Fail");
+            }
+
+            try {
+                var b = new CorrectCaseFriendAssembly.InternalClass(@public: 'a');
+                Console.WriteLine("Access internal class public ctor: OK");
+                b.InternalMethod();
+                Console.WriteLine("Access friend internal method: OK");
+            } catch (MemberAccessException) {
+                failCount += 1;
+                Console.WriteLine("Access friend internal method with wrong case: Fail");
+            }
+
+            Console.WriteLine("-- Wrong case --");
+
+            try {
+                var a = new WrongCaseFriendAssembly.InternalClass(@private: false);
+                // Microsoft behaves this way
+                Console.WriteLine("Access internal class private ctor: OK");
+            } catch (MemberAccessException) {
+                // FIXME: Mono behaves this way
+                Console.WriteLine("Access internal class private ctor: Fail");
+                // failCount += 1;
+            }
+
+            try {
+                var a = new WrongCaseFriendAssembly.InternalClass(@internal: 0);
+                Console.WriteLine("Access internal class internal ctor: OK");
+            } catch (MemberAccessException) {
+                failCount += 1;
+                Console.WriteLine("Access friend internal ctor: Fail");
+            }
+
+            try {
+                var b = new WrongCaseFriendAssembly.InternalClass(@public: 'a');
+                Console.WriteLine("Access internal class public ctor: OK");
+                b.InternalMethod();
+                Console.WriteLine("Access friend internal method: OK");
+            } catch (MemberAccessException) {
+                failCount += 1;
+                Console.WriteLine("Access friend internal method: Fail");
+            }
+
+            try {
+                // Surprisingly this works in the Windows CLR, even though it seems like it shouldn't
+                WrongCaseFriendAssembly.InternalClass.PrivateStaticMethod();
+                Console.WriteLine("Access friend private static method: OK");
+            } catch (MemberAccessException) {
+                Console.WriteLine("Access friend private static method: Fail");
+                failCount += 1;
+            }
+
+            try {
+                WrongCaseFriendAssembly.InternalClass.InternalStaticMethod();
+                Console.WriteLine("Access friend internal static method: OK");
+            } catch (MemberAccessException) {
+                failCount += 1;
+                Console.WriteLine("Access friend internal static method: Fail");
+            }
+
+            try {
+                WrongCaseFriendAssembly.PublicClass.InternalStaticMethod();
+                Console.WriteLine("Access public internal static method: OK");
+            } catch (MemberAccessException) {
+                failCount += 1;
+                Console.WriteLine("Access public internal static method: Fail");
+            }
+
+            if (System.Diagnostics.Debugger.IsAttached)
+                Console.ReadLine();
+
+            Console.WriteLine("Incorrect results: {0}", failCount);
+            Environment.ExitCode = failCount;
+        }
+    }
+}
index 1a4e30a68f3ed7cd3d522643eeb9c4ba993ad204..a1fa3fe0325f20a69a57849c8092c1991b1b107c 100644 (file)
@@ -68,15 +68,15 @@ SIGNED_V2_DLL= signed_v2/gactestlib.dll
 GACTESTLIB_SRCS= $(V1_SRC) $(V2_SRC)
 GACTESTLIB_DLLS= $(SIGNED_V1_DLL) $(SIGNED_V2_DLL) $(UNSIGNED_V1_DLL) $(UNSIGNED_V2_DLL)
 
-if FULL_AOT_TESTS
-GACTESTLIB_DLLS_AOT=$(GACTESTLIB_DLLS:.dll=.dll$(PLATFORM_AOT_SUFFIX))
-APP_SIGNED_V1_AOT=$(APP_SIGNED_V1_EXE:.exe=.exe$(PLATFORM_AOT_SUFFIX))
-endif
-
-if HYBRID_AOT_TESTS
-GACTESTLIB_DLLS_AOT=$(GACTESTLIB_DLLS:.dll=.dll$(PLATFORM_AOT_SUFFIX))
-APP_SIGNED_V1_AOT=$(APP_SIGNED_V1_EXE:.exe=.exe$(PLATFORM_AOT_SUFFIX))
-endif
+#if FULL_AOT_TESTS
+#GACTESTLIB_DLLS_AOT=$(GACTESTLIB_DLLS:.dll=.dll$(PLATFORM_AOT_SUFFIX))
+#APP_SIGNED_V1_AOT=$(APP_SIGNED_V1_EXE:.exe=.exe$(PLATFORM_AOT_SUFFIX))
+#endif
+
+#if HYBRID_AOT_TESTS
+#GACTESTLIB_DLLS_AOT=$(GACTESTLIB_DLLS:.dll=.dll$(PLATFORM_AOT_SUFFIX))
+#APP_SIGNED_V1_AOT=$(APP_SIGNED_V1_EXE:.exe=.exe$(PLATFORM_AOT_SUFFIX))
+#endif
 
 
 SIGNING_KEY= $(srcdir)/testkey.snk
index b2c969ba0bd0cbfd5a79ecebc4eeb6f8732856cb..ec04c4d1c5f17f5df5dab43b834893dc048783f1 100644 (file)
@@ -10,6 +10,7 @@ endif
 if !CROSS_COMPILE
 if !HOST_WIN32
 if SUPPORT_BOEHM
+if SUPPORT_SGEN
 
 noinst_LTLIBRARIES = libtestlib.la
 libtestlib_la_SOURCES =
@@ -54,6 +55,7 @@ check-local:
                echo "</test-case></results></test-suite></test-results>" >> TestResult-unit-tests.xml; \
        fi;
 
+endif SUPPORT_SGEN
 endif SUPPORT_BOEHM
 endif !HOST_WIN32
 endif !CROSS_COMPILE
index f733896a6d73ae9a4997347724b5790488230aa4..5c5b891d607ab952d55bc3699d857566c6ce9c64 100644 (file)
@@ -131,11 +131,11 @@ mono_process_list (int *size)
                mib [2] = KERN_PROC_ALL;
                mib [3] = 0;
 
-               res = sysctl (mib, 4, NULL, &data_len, NULL, 0);
+               res = sysctl (mib, 3, NULL, &data_len, NULL, 0);
                if (res)
                        return NULL;
                processes = (struct kinfo_proc *) g_malloc (data_len);
-               res = sysctl (mib, 4, processes, &data_len, NULL, 0);
+               res = sysctl (mib, 3, processes, &data_len, NULL, 0);
                if (res < 0) {
                        g_free (processes);
                        if (errno != ENOMEM)
index 321bedfa12d6ea59649e87b6dba9020e98f10df3..a2cd4ec5860561bdcca9be7514b1f8655ab48531 100644 (file)
@@ -1,18 +1,26 @@
+import fileinput
 
-class NuGetPackage(GitHubPackage):
+
+class NuGetBinary (Package):
 
     def __init__(self):
-        GitHubPackage.__init__(self,
-                               'mono', 'nuget',
-                               '2.12.0',
-                               '9e2d2c1cc09d2a40eeb72e8c5db789e3b9bf2586',
-                               configure='')
+        Package.__init__(self, name='NuGet', version='4.3.0-preview1', sources=[
+                         'https://dist.nuget.org/win-x86-commandline/v%{version}/nuget.exe'])
 
     def build(self):
-        self.sh('%{make} update_submodules')
-        self.sh('%{make} PREFIX=%{package_prefix}')
+        pass
 
     def install(self):
-        self.sh('%{makeinstall} PREFIX=%{staged_prefix}')
+        source = os.path.join(self.workspace, 'nuget.exe')
+        target = os.path.join(self.staged_prefix, 'lib/mono/nuget/nuget.exe')
+        ensure_dir(os.path.dirname(target))
+        shutil.move(source, target)
 
-NuGetPackage()
+        launcher = os.path.join(self.staged_prefix, "bin/nuget")
+        ensure_dir(os.path.dirname(launcher))
+        with open(launcher, "w") as output:
+            output.write("#!/bin/sh\n")
+            output.write(
+                'exec "{0}/bin/mono" $MONO_OPTIONS "{1}" "$@"\n'.format(self.staged_prefix, target))
+        os.chmod(launcher, 0o755)
+NuGetBinary()
index e87ea8838ebd3797c40b857fd8c0667b4c7d1f98..a308f1b252b528b0c4c2ce34e8d0f042641c2136 100755 (executable)
@@ -5,7 +5,13 @@ export TESTCMD=${MONO_REPO_ROOT}/scripts/ci/run-step.sh
 
 export TEST_HARNESS_VERBOSE=1
 
-if [[ ${label} == w* ]]; then
+if [[ $CI_TAGS == *'collect-coverage'* ]]; then
+    # Collect coverage for further use by lcov and similar tools.
+    # Coverage must be collected with -O0 and debug information.
+    export CFLAGS="-ggdb3 --coverage -O0"
+    # Collect coverage on all optimizations
+    export MONO_ENV_OPTIONS="$MONO_ENV_OPTIONS -O=all"
+elif [[ ${label} == w* ]]; then
     # Passing -ggdb3 on Cygwin breaks linking against libmonosgen-x.y.dll
     export CFLAGS="-g -O2"
 else
index 90d65a194a6885269e45d363f15365d61aeee0e9..59dfb9121535523c69d85d2decf9a8360d0f02c9 100755 (executable)
@@ -55,7 +55,6 @@ ${TESTCMD} --label=System.Configuration --timeout=5m make -w -C mcs/class/System
 ${TESTCMD} --label=System.Transactions --timeout=5m make -w -C mcs/class/System.Transactions run-test
 ${TESTCMD} --label=System.Web.Extensions --timeout=5m make -w -C mcs/class/System.Web.Extensions run-test
 ${TESTCMD} --label=System.Core --timeout=15m make -w -C mcs/class/System.Core run-test
-if [[ ${label} == w* ]]; then ${TESTCMD} --label=symbolicate --skip; else ${TESTCMD} --label=symbolicate --timeout=60m make -w -C mcs/tools/mono-symbolicate check; fi
 ${TESTCMD} --label=System.Xml.Linq --timeout=5m make -w -C mcs/class/System.Xml.Linq run-test
 ${TESTCMD} --label=System.Data.DSE --timeout=5m make -w -C mcs/class/System.Data.DataSetExtensions run-test
 ${TESTCMD} --label=System.Web.Abstractions --timeout=5m make -w -C mcs/class/System.Web.Abstractions run-test
@@ -93,6 +92,9 @@ ${TESTCMD} --label=Microsoft.Build.Framework-14 --timeout=60m make -w -C mcs/cla
 ${TESTCMD} --label=Microsoft.Build.Tasks-14 --timeout=60m make -w -C mcs/class/Microsoft.Build.Tasks run-test PROFILE=xbuild_14
 ${TESTCMD} --label=Microsoft.Build.Utilities-14 --timeout=60m make -w -C mcs/class/Microsoft.Build.Utilities run-test PROFILE=xbuild_14
 ${TESTCMD} --label=System.IO.Compression --timeout=5m make -w -C mcs/class/System.IO.Compression run-test
+if [[ ${label} == w* ]]; then ${TESTCMD} --label=symbolicate --skip; else ${TESTCMD} --label=symbolicate --timeout=60m make -w -C mcs/tools/mono-symbolicate check; fi
+${TESTCMD} --label=monolinker --timeout=10m make -w -C mcs/tools/linker check
+
 if [[ ${label} == osx-* ]]
 then ${TESTCMD} --label=ms-test-suite --timeout=30m make -w -C acceptance-tests check-ms-test-suite
 else ${TESTCMD} --label=ms-test-suite --skip;
index c8b5d79d32b2ffd4128828ee4d9f2622f76ec07c..ccd228b57afc85ea3afff58e3cd1dd1fa748d2fd 100755 (executable)
@@ -30,5 +30,6 @@ ${TESTCMD} --label=Mono.CSharp --timeout=5m make -w -C mcs/class/Mono.CSharp run
 ${TESTCMD} --label=System.Numerics --timeout=5m make -w -C mcs/class/System.Numerics run-test
 ${TESTCMD} --label=System.Net.Http --timeout=5m make -w -C mcs/class/System.Net.Http run-test
 ${TESTCMD} --label=System.Json --timeout=5m make -w -C mcs/class/System.Json run-test
+${TESTCMD} --label=monolinker --timeout=10m make -w -C mcs/tools/linker check
 
 rm -fr /tmp/jenkins-temp-aspnet*
index 5a6acc86ad4a501b45a3abfa06861569e8f7bb51..aee4e36d21271fd6c9d0af819edcb1ca8a57bb57 100755 (executable)
@@ -15,6 +15,7 @@ wget https://www.nuget.org/api/v2/package/System.IO.Compression/4.1.0 -O nugets/
 wget https://www.nuget.org/api/v2/package/System.IO.Compression/4.0.0 -O nugets/system.io.compression.4.0.0.nupkg
 
 #System.Net.Http
+wget https://www.nuget.org/api/v2/package/System.Net.Http/4.3.2 -O nugets/system.net.http.4.3.2.nupkg
 wget https://www.nuget.org/api/v2/package/System.Net.Http/4.3.1 -O nugets/system.net.http.4.3.1.nupkg
 wget https://www.nuget.org/api/v2/package/System.Net.Http/4.3.0 -O nugets/system.net.http.4.3.0.nupkg
 wget https://www.nuget.org/api/v2/package/System.Net.Http/4.1.1 -O nugets/system.net.http.4.1.1.nupkg