shithub: mc

Download patch

ref: 98972288339fd5d5f6466557e704f3737eab3c67
parent: 0fb976c84f8eb424017c6ab6215a8e39cf14f727
author: glenda@cirno <glenda@cirno>
date: Thu Jun 25 19:00:02 EDT 2015

Export type info correctly on plan9

--- a/6/genp9.c
+++ b/6/genp9.c
@@ -555,9 +555,9 @@
             break;
         case Btref:
             if (b->ref.isextern)
-                fprintf(fd, "DATA %s+%zd(SB)/8,$%s<>+0(SB)\n", lbl, off+n, b->ref.str);
-            else
                 fprintf(fd, "DATA %s+%zd(SB)/8,$%s+0(SB)\n", lbl, off+n, b->ref.str);
+            else
+                fprintf(fd, "DATA %s+%zd(SB)/8,$%s<>+0(SB)\n", lbl, off+n, b->ref.str);
             n += 8;
             break;
         case Btbytes:
--- a/libstd/env+plan9.myr
+++ b/libstd/env+plan9.myr
@@ -37,7 +37,7 @@
 	match envfind(name)
 	| `Some val:	-> `Some val
 	| `None:
-		s = bfmt(buf[:], "/env/%s", name)
+		s = bfmt(buf[:], "/env/{}", name)
 		match std.slurp(s)
 		| `Fail m: -> `None
 		| `Ok data:
--- a/libstd/fmt.myr
+++ b/libstd/fmt.myr
@@ -143,9 +143,10 @@
 }
 
 const sbfmtv = {sb, fmt, ap -> size
-	var nfmt, nparams, pl
+	var nfmt, nparams, pl, orig
 	var c, params, ty
 
+	orig = fmt
 	nparams = ap.tc.nelt
 	nfmt = 0
 	if !fmtmapinited
@@ -186,6 +187,7 @@
 :fmtdone
 	;;
 	if nfmt != nparams
+		write(1, orig)
 		die("too many params for fmt\n")
 	;;
 	-> sb.len
--- a/libstd/syswrap+plan9.myr
+++ b/libstd/syswrap+plan9.myr
@@ -131,7 +131,7 @@
 	si.system = getenvv("osname", "Plan9")
 	si.release = "4"
 	si.version = "0"
-	si.arch = getenvv("objtype", "unknown")
+	si.arch = getenvv("objtype", "amd64")
 }
 
 const close	= {fd;		-> sys.close(fd castto(sys.fd)) castto(int64)}
--- a/mbld/fsel.myr
+++ b/mbld/fsel.myr
@@ -96,7 +96,7 @@
 	| "osx":	attrs = ["osx", "posixy"][:]
 	| "linux":	attrs = ["linux", "posixy"][:]
 	| "plan9":	attrs = ["plan9"][:]
-	| unknown:	std.fatal("unknown system \"{}\"\n", unknown)
+	| unknown:	std.fatal("unknown systemx \"{}\"\n", unknown)
 	;;
 	for a in attrs
 		std.htput(sa, a, true)
@@ -104,7 +104,7 @@
 
 	match opt_arch
 	| "x64":	attrs = ["x64"][:]
-	| unknown:	std.fatal("unknown arch {}\n", unknown)
+	| unknown:	std.fatal("unknown architecture {}\n", unknown)
 	;;
 	for a in attrs
 		std.htput(sa, a, true)
--- a/mbld/opts.myr
+++ b/mbld/opts.myr
@@ -56,7 +56,7 @@
 	| "Darwin":	opt_sys = "osx"
 	| "FreeBSD":	opt_sys = "freebsd"
 	| "Plan9":	opt_sys = "plan9"
-	| unknown:	std.fatal("unknown system \"{}\"\n", unknown)
+	| unknown:	std.fatal("unknown systemy \"{}\"\n", unknown)
 	;;
 
 	match si.arch
--- a/mk/bootstrap/bootstrap+Plan9-amd64.sh
+++ b/mk/bootstrap/bootstrap+Plan9-amd64.sh
@@ -19,8 +19,10 @@
 echo 	../6/6.out	-I . clear.myr ;	../6/6.out	-I . clear.myr 
 echo 	../6/6.out	-I . extremum.myr ;	../6/6.out	-I . extremum.myr 
 echo 	../6/6.out	-I . units.myr ;	../6/6.out	-I . units.myr 
-echo 	../6/6.out	-I . alloc.myr ;	../6/6.out	-I . alloc.myr 
-echo 	../6/6.out	-I . utf.myr ;	../6/6.out	-I . utf.myr 
+echo 	../6/6.out	-I . alloc.myr ;	../6/6.out	-I . alloc.myr
+ echo 	../6/6.out	-I . intparse.myr ;	../6/6.out	-I . intparse.myr 
+echo 	../6/6.out	-I . utf.myr ;	../6/6.out	-I .	utf.myr 
+echo	../6/6.out	-I . hasprefix.myr; ../6/6.out	-I .	hasprefix.myr
 echo 	../6/6.out	-I . `$pwd/sysselect.sh errno`;	../6/6.out	-I . `$pwd/sysselect.sh errno`
 echo 	../6/6.out	-I . cstrconv.myr ;	../6/6.out	-I . cstrconv.myr 
 echo 	../6/6.out	-I . `$pwd/sysselect.sh syswrap-ss`;	../6/6.out	-I . `$pwd/sysselect.sh syswrap-ss`
--- a/test/runtest.rc
+++ b/test/runtest.rc
@@ -7,7 +7,7 @@
 
 fn build {
 	rm -f $1 $1^.6 $1^.use
-	../myrbuild/6.out -b $1 -C../6/6.out -M../muse/6.out -I../libstd -r../rt/_myrrt.6 $1^.myr
+	../mbld/mbld -b $1 -C../6/6.out -M../muse/6.out -I../libstd -r../rt/_myrrt.6 $1^.myr
 }
 
 fn pass {