diff --git a/BOOTSTRAP b/BOOTSTRAP index 0ee93c89..57299ee1 100644 --- a/BOOTSTRAP +++ b/BOOTSTRAP @@ -103,6 +103,7 @@ be source. ** x86_64, arm, the Hurd * DONE +** bootstrap gcc+glibc-built binutils-20.1, gcc-4.1.0. ** have tcc-boot compile gnutools triplet: binutils-2.14, gcc-2.95.3, glibc-2.2.5. ** have tcc-boot's mes-tcc compile a fully functional tcc ** hex.0, hex.1, M0 diff --git a/HACKING b/HACKING index f69dffe3..b7dbb848 100644 --- a/HACKING +++ b/HACKING @@ -62,10 +62,14 @@ mes.c. - upstream mes-boot to GuixSD. - add full source gcc-4.7 package build. - replace GuixSD bootstrap for x86. - - tcc: remove or upstream patches from tcc-boot - - mes: prepare src/mes.c for M2-Planet transpiler. + - replace bootstrap utils (with gash?): flex, bash, bzip2, + coreutils, diffutils, gawk, grep, gzip, make, sed, tar. + - tcc: remove or upstream patches from tcc-boot. + - tcc: build 0.9.27 directly instead of via 0.9.26, + see tinycc wip-bootstrappable@0.9.27 branch + - mes: prepare src/mes.c for M2-Planet transpiler, + Jeremiah branched-out from mes; see https://github.com/oriansj/mes-m2. - mes: real module support, bonus for supporting Guile's define-module/define-public syntax. - - mes: produce functional mes from mes.M1 transpiled by M2-Planet. - mes: we're a full Scheme now, drop .MES suffix, use .SCM. + find a way to fix foo.mes/foo.scm trickery (full Guile-like module support?) + how about setting `guile' or even `guile-2' cond-expand features @@ -89,8 +93,9 @@ mes.c. *** release 1.0 - replace GuixSD's bootstrap binaries for x86. - add x86_64, replace GuixSD's bootstrap binaries for x86_64. - - more architectures? + - more architectures (does GuixSD require this, i.e. before 1.0?). ** DONE +*** 0.16 Mes Lib C now bootstraps glibc-2.2.5, binutils-2.20.1, gcc-4.1.0. *** 0.15: MesCC now has a libc+gnu that supports compiling binutils-2.14, gcc-2.95.3 and glibc-2.2.5. *** 0.14: Mes+MesCC now compiles a slightly patched self-hosting tcc. *** 0.13: Mes+MesCC now compiles a modified, functional tcc.c (~25,000LOC) in 1h30'. @@ -100,7 +105,7 @@ mes.c. *** 0.9: Mescc now writes M1 macro assembly files and compiles tcc. *** 0.8: Mescc now writes object files in stage0's labeled hex2 format. *** 0.7: Mescc supports -E, -c, -o options, include more complete set of header files, -eenough to work on compiling tinycc's tcc.c albeit a somewhat modified version. +enough to work on compiling tinycc's tcc.c albeit a somewhat modified version. *** 0.6: Work with unmodified, unbundled Nyacc; compile 33/55 tinycc's tests/test2 suite. *** 0.5: Mutual self-hosting Scheme interpreter and C compiler: mes.c and mescc, Support call-with-current-continuation, refactor catch/throw @@ -130,6 +135,7 @@ eenough to work on compiling tinycc's tcc.c albeit a somewhat modified version. * Bugs +** tcc: tcc-built lib/libc+tcc.c segfaults with mes, with tcc. ** mes: remove pmatch-car/pmatch-cdr hack. ** mescc: softcode stack frame size, now hardcoded and very large ** mes+mescc: parse tcc.c->tcc.E works, compile tcc.E -> tcc.M1 segfaults. diff --git a/INSTALL b/INSTALL index 081cdaf8..b11e1d95 100644 --- a/INSTALL +++ b/INSTALL @@ -1,53 +1,64 @@ -*- org -*- Building and Installing Mes -* Get it +Mes can be built in two modes: as a regulare package build or as +a bootstrap package. +After bootstrapping Mes, it can be used to bootstrap TinyCC (tcc) in a +similar way. + +* Get it git clone https://gitlab.com/janneke/mes -* Prerequisites -** Bootstrapping -For bootstrapping, the M1 macro assembler and hex2 linker and Nyacc -*** [[https://github.com/oriansj/mescc-tools][mescc-tools]], 0.4 is known to work. -*** [[https://savannah.gnu.org/projects/nyacc][Nyacc]], [[https://gitlab.com/janneke/nyacc][patched Nyacc]] 0.80.42 is known to work. -For development -** Development -For development, there are some more dependencies. +* Regular build +** Prerequisites *** Guix - guix environment -l guix.scm #64 bit + 32bit guix environment --system=i686-linux -l guix.scm #32 bit only *** Other GNU/Linux -**** [[https://github.com/oriansj/mescc-tools][mescc-tools]], 0.4 is known to work. -**** [[https://savannah.gnu.org/projects/nyacc][Nyacc]], [[https://gitlab.com/janneke/nyacc][patched Nyacc]] 0.80.42 is known to work. -**** GNU Gcc, 4.9.3 is known to work. -The idea is to drop this requirement, of course. - -**** GNU Guile, version 2.0.12 or is know to work. -Guile is not strictly necessary but it is used by the configure script -and in development. - -**** /bin/sh, GNU Bash 4.3 is known to work. -Let's just say for now that it gets awkward without a shell. - -**** GNU coreutils -**** sed, GNU sed 4.2 is known to work. -**** git, 2.10 is known to work. -**** Perl, 5.22 is known to work. - -* Build it + - [[https://github.com/oriansj/mescc-tools][mescc-tools]], 0.4 is known to work. + - [[https://savannah.gnu.org/projects/nyacc][Nyacc]], [[https://gitlab.com/janneke/nyacc][patched Nyacc]] 0.80.42 is known to work. + - GNU Gcc, 4.9.3 is known to work. + - GNU Guile, version 2.0.12 or is know to work. + - SH, /bin/sh, GNU Bash 4.3 is known to work. + - GNU coreutils + - sed, GNU sed 4.2 is known to work. + - git, 2.10 is known to work. + - Perl, 5.22 is known to work. +** Build it ./configure make -* Check it - +** Check it make check -* Install it - +** Install it make install -* Guix it... +* Guix it guix package -f guix.scm + +* Bootstrap build + +The bootstrap build is being prototyped in GuixSD, see +https://gitlab.com/janneke/guix/blob/wip-bootstrap/gnu/packages/mes.scm + +** Prerequisites + - [[https://github.com/oriansj/mescc-tools][mescc-tools]], 0.4 is known to work. + - [[https://savannah.gnu.org/projects/nyacc][Nyacc]], [[https://gitlab.com/janneke/nyacc][patched Nyacc]] 0.80.42 is known to work. + - [[https://github.com/oriansj/mescc-tools][mes-seed]], 0.15 is known to work. + +** Build it + + + ./build.sh + +** Check it + + ./check.sh + +** Install it + + ./install.sh diff --git a/NEWS b/NEWS index 153047d8..136f28e8 100644 --- a/NEWS +++ b/NEWS @@ -10,6 +10,24 @@ Copyright © 2016,2017,2018 Jan (janneke) Nieuwenhuizen Please send Mes bug reports to janneke@gnu.org. +* Changes in 0.16 since 0.15 +** Core +*** Support building with tcc, including Mes Lib C in-line assembly. +*** core:execl now supports 1000 arguments. +** MesCC +*** Mes Lib C now bootstraps glibc-2.2.5, binutils-2.20.1, gcc-4.1.0. +*** MesCC binaries now run on Linux 4.17 too, i.e. survive Linus' new `sane mmap limits.' +*** MesCC now runs with mescc-tools 0.5 (no = in long options). +**** 3 new C test +88-strrchrc, 97-fopen.c, 98-fopen.c. +** Noteworthy bug fixes +*** strrchr now stops when it reaches start of string. +*** fopen now return 0 upon failure. Supports binutils' hack: fd=-2 means `cached'. +*** vfprintf, vsprintf now support precision and width on integers strings better. +*** fread now produces ungetc'd chars too. +*** memcmp now supports comparing 0 bytes, supporting binutils. + +*** The unused ELF header data section, identical to the text section, has been removed. * Changes in 0.15 since 0.14 ** Core *** Support fork, exec, waitpid. diff --git a/README b/README index 0b6dd0c1..d00d025f 100644 --- a/README +++ b/README @@ -6,7 +6,7 @@ of the [[http://bootstrappable.org][bootstrappable builds]] effort. It currently consists of a mutual self-hosting Scheme interpreter prototype written in C and a Nyacc-based C compiler written in Scheme. -This C prototype is being simplified to be transpiled by [[https://github.com/oriansj/m2-planet][M2-Planet]]. +This C prototype is [[https://github.com/oriansj/mes-m2][being simplified]] to be transpiled by [[https://github.com/oriansj/m2-planet][M2-Planet]]. The Scheme interpreter prototype (mes.c) has a Garbage Collector, a library of loadable Scheme modules-- notably Dominique Boucher's [[https://github.com/schemeway/lalr-scm][LALR]], @@ -14,25 +14,14 @@ Pre-R6RS [[https://www.cs.indiana.edu/chezscheme/syntax-case/old-psyntax.html][p Guile's [[https://www.gnu.org/software/guile/docs/master/guile.html/PEG-Parsing.html][PEG]] --and test suite just barely enough to support a simple REPL and simple C-compiler: MesCC. -Mes+MesCC can compile a only [[https://gitlab.com/janneke/tinycc][lightly modified TinyCC]] that is -self-hosting. Using the Mes C library, this tcc can now build the -gnutools triplet: binutils-2.14, gcc-2.95.3, glibc-2.2.5. +Mes+MesCC can compile an only [[https://gitlab.com/janneke/tinycc][lightly patched TinyCC]] that is +self-hosting. Using this tcc and the Mes C library we now have a +reduced-binary-seed bootstrap for the gnutools triplet: glibc-2.2.5, +binutils-2.20.1, gcc-4.1.0. Mes is inspired by The Maxwell Equations of Software: [[http://www.softwarepreservation.org/projects/LISP/book/LISP%2525201.5%252520Programmers%252520Manual.pdf][LISP-1.5]] -- John McCarthy page 13, GNU Guix's source/binary packaging transparency and -Jeremiah Orians's stage0 ~300 byte self-hosting hex assembler. - -[0] https://gitlab.com/janneke/mes -[1] https://www.gnu.org/software/guix -[2] http://bootstrappable.org -[3] https://github.com/oriansj/m2-planet -[4] https://github.com/schemeway/lalr-scm -[5] https://www.cs.indiana.edu/chezscheme/syntax-case/old-psyntax.html -[6] https://www.nongnu.org/nyacc -[7] https://www.gnu.org/software/guile/docs/master/guile.html/PEG-Parsing.html -[8] https://gitlab.com/janneke/tinycc -[9] http://www.softwarepreservation.org/projects/LISP/book/LISP%25201.5%2520Programmers%2520Manual.pdf -[10] https://github.com/oriansj/stage0 +Jeremiah Orians's [[https://github.com/oriansj/stage0][stage0]] ~500 byte self-hosting hex assembler. Mes is free software, it is distributed under the terms of the GNU General Public Licence version 3 or later. See the file COPYING. @@ -56,3 +45,20 @@ General Public Licence version 3 or later. See the file COPYING. * MesCC compiler scripts/mescc -c scaffold/main.c + +* Bugs + + Please send Mes bug reports to janneke@gnu.org. + +[0] https://gitlab.com/janneke/mes +[1] https://www.gnu.org/software/guix +[2] http://bootstrappable.org +[3] https://github.com/oriansj/mes-m2 +[4] https://github.com/oriansj/m2-planet +[5] https://github.com/schemeway/lalr-scm +[6] https://www.cs.indiana.edu/chezscheme/syntax-case/old-psyntax.html +[7] https://www.nongnu.org/nyacc +[8] https://www.gnu.org/software/guile/docs/master/guile.html/PEG-Parsing.html +[9] https://gitlab.com/janneke/tinycc +[10] http://www.softwarepreservation.org/projects/LISP/book/LISP%25201.5%2520Programmers%2520Manual.pdf +[11] https://github.com/oriansj/stage0 diff --git a/doc/ANNOUNCE-0.16 b/doc/ANNOUNCE-0.16 new file mode 100644 index 00000000..db0722f4 --- /dev/null +++ b/doc/ANNOUNCE-0.16 @@ -0,0 +1,100 @@ +Subject: Mes 0.16 released + +I am pleased to announce the release of Mes 0.16, representing 27 +commits over 2 weeks. + +A most annoying ELF header bug was fixed that suddenly had all Mes +binaries segfault before entering `_start' on Linux 4.17 and later. + +We now have binutils-2.20.1 and gcc-4.1.0, both compiled with +gcc-2.95.3 and glibc-2.2.5. + +This reduced-binary-seed bootstrap still depends on these bootstrap +binaries: BOOTSTRAP-GUILE, flex, bash, bzip2, coreutils, diffutils, +gawk, grep, gzip, make, sed, tar, on the small binary seeds: +tinycc-seed, mescc-seed and on the mes.M1 ASCII seed. + +Next targets: + + - build a Gcc 4.7 and Glibc 2.23 + - upstream the x86 Mes bootstrap to GuixSD + - reduce the 1MB ASCII M1 seed to ~5000 LOC/~100KB of M2 source + - revive Gash: a posix shell for Guile to reduce the bootstrap binary + dependencies + - and/or otherwise reduce the bootstrap binary dependencies + +Packages are available from Guix's wip-bootstrap branch. + +* About + +Mes[0] aims to help create full source bootstrapping for GuixSD[1] as +part of the bootstrappable builds[2] effort. + +It currently consists of a mutual self-hosting Scheme interpreter +prototype written in C and a Nyacc-based C compiler written in Scheme. +This C prototype is being simplified[3] to be transpiled by M2-Planet[4]. + +The Scheme interpreter prototype (mes.c) has a Garbage Collector, a +library of loadable Scheme modules-- notably Dominique Boucher's LALR[5], +Pre-R6RS portable syntax-case[6] with R7RS ellipsis, Matt Wette's Nyacc[7], +Guile's PEG[8] --and test suite just barely enough to support a simple +REPL and simple C-compiler: MesCC. + +Mes+MesCC can compile an only lighty patched TinyCC[9] that is +self-hosting. Using this tcc and the Mes C library we now have a +reduced-binary-seed bootstrap for the gnutools triplet: glibc-2.2.5, +binutils-2.20.1, gcc-4.1.0. + +Mes is inspired by The Maxwell Equations of Software: LISP-1.5[10] -- +John McCarthy page 13, GNU Guix's source/binary packaging transparency +and Jeremiah Orians's stage0[11] ~500 byte self-hosting hex assembler. + +* Download + + git clone https://gitlab.com/janneke/mes + + wget https://gitlab.com/janneke/mes/-/archive/v0.16/mes-0.16.tar.gz + +Mes runs from the source tree and can also be built, packaged and +installed in Guix[SD] by the usual + + guix package -f guix.scm + +* Get informed, get involved + + Join #bootstrappable on irc.freenode.net. + +* Changes in 0.16 since 0.15 + ** Core + *** Support building with tcc, including Mes Lib C in-line assembly. + *** core:execl now supports 1000 arguments. + ** MesCC + *** Mes Lib C now bootstraps glibc-2.2.5, binutils-2.20.1, gcc-4.1.0. + *** MesCC binaries now run on Linux 4.17 too, i.e. survive Linus' new `sane mmap limits.' + *** MesCC now runs with mescc-tools 0.5 (no = in long options). + **** 3 new C test + 88-strrchrc, 97-fopen.c, 98-fopen.c. + ** Noteworthy bug fixes + *** strrchr now stops when it reaches start of string. + *** fopen now return 0 upon failure. Supports binutils' hack: fd=-2 means `cached'. + *** vfprintf, vsprintf now support precision and width on integers strings better. + *** fread now produces ungetc'd chars too. + *** memcmp now supports comparing 0 bytes, supporting binutils. + + *** The unused ELF header data section, identical to the text section, has been removed. + +Greetings, +janneke + +[0] https://gitlab.com/janneke/mes +[1] https://www.gnu.org/software/guix +[2] http://bootstrappable.org +[3] https://github.com/oriansj/mes-m2 +[4] https://github.com/oriansj/m2-planet +[5] https://github.com/schemeway/lalr-scm +[6] https://www.cs.indiana.edu/chezscheme/syntax-case/old-psyntax.html +[7] https://www.nongnu.org/nyacc +[8] https://www.gnu.org/software/guile/docs/master/guile.html/PEG-Parsing.html +[9] https://gitlab.com/janneke/tinycc +[10] http://www.softwarepreservation.org/projects/LISP/book/LISP%25201.5%2520Programmers%2520Manual.pdf +[11] https://github.com/oriansj/stage0