[Mono-devel-list] patches to remove corlib references

Paolo Molaro lupus at ximian.com
Wed Oct 15 12:26:15 EDT 2003


On 10/13/03 Jackson Harper wrote:
> 	Here are some patches to have mcs build mscorlib instead of corlib, and
> to remove the corlib/mscorlib aliasing from the runtime. I would
> appreciate it if some people could test, but please dont apply these
> patches to your main install. Changing th corlib name can make it very
> hard to bootstrap.

It should not be hard if you just change the name of the binary and
change the runtime to try to load mscorlib.dll first and then corlib.dll
if it fails.

> mcs patches: http://primates.ximian.com/~jackson/mcs.diff
> mono patches: http://primates.ximian.com/~jackson/mono.diff

Please, include the patches in the mail or send them as text
attachments, it makes it easier to comment on them.


Index: mcs/driver.cs
===================================================================
RCS file: /cvs/public/mcs/mcs/driver.cs,v
retrieving revision 1.160
diff -u -u -b -r1.160 driver.cs
--- mcs/driver.cs	8 Oct 2003 00:16:10 -0000	1.160
+++ mcs/driver.cs	13 Oct 2003 05:39:00 -0000
@@ -390,7 +390,7 @@
 
 			foreach (Assembly a in assemblies){
 				string codebase = a.Location;
-				if (codebase.EndsWith ("corlib.dll")){
+                                if (codebase.EndsWith ("mscorlib.dll")){

It seems you changed TABs to spaces. Also, not a problem of your change,
specifically, but the code is not really bullet-prrof: what if someone
references an assembly named diddly-mscorlib.dll? System.IO.Path has a
method to extract the basename from a path.

In the runtime changes, please leave the compatibility code for a few
days, so that people don't necessarily break their builds.

Index: mono/metadata/image.h
===================================================================
RCS file: /cvs/public/mono/mono/metadata/image.h,v
retrieving revision 1.49
diff -u -u -b -r1.49 image.h
--- mono/metadata/image.h	8 Sep 2003 13:16:45 -0000	1.49
+++ mono/metadata/image.h	13 Oct 2003 05:46:38 -0000
@@ -5,6 +5,9 @@
 #include <glib.h>
 #include <gmodule.h>
 
+#define CORLIB_ASSEMBLY_NAME "mscorlib"
+#define CORLIB_NAME "mscorlib.dll"
+

I don't think we need to export the defines to the world: they are not
going to change anymore anyway and exporting non-namespaced C symbols
shoule not be done (yes, this isssue was there before your patch, too,
but as long as we're going to review the code...;-).

Thanks. Feel free to commit after the changes.

lupus

-- 
-----------------------------------------------------------------
lupus at debian.org                                     debian/rules
lupus at ximian.com                             Monkeys do it better



More information about the Mono-devel-list mailing list