[Mono-list] compiler status on linux
Paolo Molaro
lupus@ximian.com
Sat, 5 Jan 2002 16:49:55 +0100
So, many of the bits needed to make the compiler working on linux
are starting to fit together: mcs can compile some simple programs
(about 12 in mono/mono/tests compiled just now), though not all
generate correct code, yet.
You'll need the latest mono from cvs as well as the latest corlib.
You'll also need to run the compiler with the interpreter.
I use the included patch to mcs to add /usr/local/lib to the search path
for the compiler and avoid the GetFiles() call that is still
unimplemented in corlib (the other changes are to get stack traces in
the interp, instead of the user-friendly error messages:
who says that usability isn't debugging backtraces? :-).
Have fun!
lupus
--
-----------------------------------------------------------------
lupus@debian.org debian/rules
lupus@ximian.com Monkeys do it better
Index: cs-parser.jay
===================================================================
RCS file: /cvs/public/mcs/mcs/cs-parser.jay,v
retrieving revision 1.126
diff -u -r1.126 cs-parser.jay
--- cs-parser.jay 2002/01/02 06:23:54 1.126
+++ cs-parser.jay 2002/01/05 11:39:25
@@ -3624,12 +3624,12 @@
StringBuilder value = new StringBuilder ();
global_errors = 0;
- try {
+ //try {
if (yacc_verbose_flag)
yyparse (lexer, new yydebug.yyDebugSimple ());
else
yyparse (lexer);
- } catch (Exception e){
+ //} catch (Exception e){
// Console.WriteLine ("Fatal error: " + name);
// Console.WriteLine (lexer.location);
@@ -3637,10 +3637,10 @@
// Please do not remove this, it is used during debugging
// of the grammar
//
- Console.WriteLine (lexer.location + " : Parsing error ");
+ /* Console.WriteLine (lexer.location + " : Parsing error ");
Console.WriteLine (e);
global_errors++;
- }
+ }*/
return global_errors;
}
Index: driver.cs
===================================================================
RCS file: /cvs/public/mcs/mcs/driver.cs,v
retrieving revision 1.51
diff -u -r1.51 driver.cs
--- driver.cs 2002/01/02 16:20:37 1.51
+++ driver.cs 2002/01/05 11:39:26
@@ -105,24 +105,24 @@
Stream input;
int errors;
- try {
+ //try {
input = File.OpenRead (input_file);
- } catch {
+ /*} catch {
Report.Error (2001, "Source file '" + input_file + "' could not be opened");
return 1;
- }
+ }*/
parser = new CSharpParser (input_file, input, defines);
parser.yacc_verbose = yacc_verbose;
- try {
+ //try {
errors = parser.parse ();
- } catch (Exception ex) {
+ /*} catch (Exception ex) {
Console.WriteLine (ex);
Console.WriteLine ("Compilation aborted");
return 1;
} finally {
input.Close ();
- }
+ }*/
return errors;
}
@@ -296,6 +296,7 @@
// path.
//
link_paths.Add ("file:///C:/WINNT/Microsoft.NET/Framework/v1.0.2914");
+ link_paths.Add ("/usr/local/lib");
int argc = args.Length;
for (i = 0; i < argc; i++){
@@ -500,7 +501,8 @@
if (first_source == null)
first_source = arg;
- string [] files = Directory.GetFiles (".", arg);
+ //string [] files = Directory.GetFiles (".", arg);
+ string [] files = {arg};
foreach (string f in files){
if (!f.ToLower ().EndsWith (".cs")){
error ("Do not know how to compile " + arg);