Compare commits

..

339 Commits

Author SHA1 Message Date
Jan (janneke) Nieuwenhuizen 1608f9f38a
guix: mes: Update to 0.24.2.
* guix/git/mes.scm (mes)[source]: Update to 0.24.2.
2023-02-13 12:09:36 +01:00
Jan (janneke) Nieuwenhuizen 7562330ec7
build: Release 0.24.2.
* configure (VERSION): Bump to 0.24.2.
* configure.sh (VERSION): Likewise.
* src/symbol.c (MES_VERSION): Likewise.
* mes/module/mes/repl.mes (welcome): Update copyright years.
2023-02-13 09:22:39 +01:00
Jan (janneke) Nieuwenhuizen f0182ecf97
build: Update release procedure.
* build-aux/GNUmakefile.in: Add `./configure' stage before creating
tarball.
2023-02-13 09:27:52 +01:00
Jan (janneke) Nieuwenhuizen 56fed8d65e
doc: Update `ROADMAP'.
* ROADMAP (release 0.x, unsorted): Add Guile module support, Gash on
Mes, Guile as a Guix FSB dependency.
2023-02-13 09:18:57 +01:00
Jan (janneke) Nieuwenhuizen c824c62f85
doc: Add `ANNOUNCE-0.24.2'.
* doc/announce/ANNOUNCE-0.24.2: New file.
2023-02-13 09:15:37 +01:00
Jan (janneke) Nieuwenhuizen 029a891d4e
doc: Update `NEWS'.
* NEWS (Changes in 0.24.2 since 0.24.1): New section.
2023-02-13 07:19:16 +01:00
Jan (janneke) Nieuwenhuizen 43fe67e2f9
lib: Fix compile warnings.
* lib/linux/read.c (read): Add casts.
* lib/linux/signal.c (signal): Likewise.
* lib/stdio/vfscanf.c: Include stdlib.h.
(vfscanf): Add cast.
* lib/stdlib/mbstowcs.c (mbstowcs): Add cast.
2023-02-12 23:02:24 +01:00
R. Masters b28f42de07
lib: Support uppercase hex conversions.
Uppercase hex number conversions fail for abtol, strtol, strtoul,
strtoull, atoi, and abtod.

The following patch fixes it.  This allows tcc to handle assembly
language, which is necessary to build the Fiwix kernel as part of the
kernel bootstrapping in progress for the live-bootstrap project.

* lib/ctype/isxdigit.c (isxdigit): Also allow A-F.
* lib/mes/abtol.c (abtol): Also cater for A-F.
2023-01-31 08:22:49 -08:00
Jan (janneke) Nieuwenhuizen 1e14c26305
lib/m2: time: Fix segfault by allocating timeval struct.
Suggested by Meghan Denny <hello@nektro.net>.

* lib/m2/time.c (__tv): New global variable.
(time): Use it to allocate timeval struct.
2023-01-24 07:59:49 +01:00
Jan (janneke) Nieuwenhuizen c1f93c1d71
doc: Use HTTPS.
* COPYING: Replace by new version (which uses HTTPS).
* HACKING,
README,
doc/fdl-1.3.texi,
doc/mes.texi: Use HTTPS.
2022-10-30 09:40:40 +01:00
Jan (janneke) Nieuwenhuizen dbb446d906
doc: Update `HACKING'.
* HACKING (SETUP): Update arm triplet.
2022-10-16 23:19:36 +02:00
Jan (janneke) Nieuwenhuizen cfb620567a
mescc: Fix Guile warnings.
* module/mescc/mescc.scm (GUILE-with-output-to-file): Remove.n
(with-output-to-file): Rename to...
(with-output-to-file*): ...this.
(mescc:preprocess, mescc:compile, infos->hex2): Update callers.
2022-10-19 10:01:48 +02:00
Jan (janneke) Nieuwenhuizen bc1fa57851
lib: stat: Use SYS_stat64 for 32bit platforms.
This fixes <https://debbugs.gnu.org/41264>.

* include/linux/arm/syscall.h (SYS_stat64, SYS_lstat64,
SYS_fstat64)[__SIZEOF_LONG_LONG__ == 8]:
New defines.
(SYS_stat, SYS_lstat, SYS_fstat)[__SIZEOF_LONG_LONG__ == 8]: Redefine them.
* include/linux/x86/syscall.h (SYS_stat64, SYS_lstat64,
SYS_fstat64)[__SIZEOF_LONG_LONG__ == 8]:
New defines.
(SYS_stat, SYS_lstat, SYS_fstat)[__SIZEOF_LONG_LONG__ == 8]: Redefine them.
* include/sys/stat.h (struct stat): Move definition to...
* include/linux/arm/kernel-stat.h,
include/linux/m2/kernel-stat.h,
include/linux/x86/kernel-stat.h,
include/linux/x86_64/kernel-stat.h: These new files.
* include/gnu/x86/kernel-stat.h: New file.
* configure (main): Copy <srcdest>include/<kernel>/<arch>/*.h to
include/.
* configure.sh: Likewise.
* .gitignore: Ignore them.  Add copyright header.
* build-aux/GNUmakefile.in (X86_ARCH_HEADERS, ARCH_HEADERS): New
variables.
(build): Use them.
(include/arch/%.h, arch-dir): New targets.
* build-aux/bootstrap.sh.in (AM_CPPFLAGS): Replace
<srcdest>include/<kernel>/<cpu> with built ../include.
* build-aux/build.sh.in (AM_CPPFLAGS): Likewise.
* build-aux/install.sh.in: Also install built include.
* include/m2/types.h: New file.
* kaem.run: Use it.
* simple.sh: Copy kernel-stat.h, syscall.h for kernel/cpu to
include/arch.
2022-10-29 13:17:58 +02:00
Jan (janneke) Nieuwenhuizen 25e0c4d119
lib: __assert_fail: Update to standard.
* lib/mes/__assert_fail.c (__assert_fail): Add file, line, function
parameters.
* include/assert.h (assert): Update caller.
(__assert_fail): Update prototype.
* include/mes/lib.h (__assert_fail): Likewise.
* lib/mes/assert_msg.c (assert_msg): Likewise.  Include assert.h.
2022-10-26 21:14:05 +02:00
Jan (janneke) Nieuwenhuizen 84fd995f43
time.c: include sys/time for gettimeofday.
* lib/linux/time.c: Include <sys/time.h>.
2022-05-05 23:26:46 +02:00
Jan (janneke) Nieuwenhuizen 77602c2cde
lib: linux/time: Remove SYS_time specialization.
* lib/linux/time.c (time)[SYS_time]: Remove specialization.
[!SYS_time && !SYS_gettimeofday]: Remove fallback.
2022-05-04 14:14:51 +02:00
Jan (janneke) Nieuwenhuizen fc6e88ab89
simple.sh: Resurrect.
* simple.sh: Add src/globals.c, lib/stub/__raise.c.  Use
lib/linux/malloc.c instead of lib/stdlib/malloc.c.
2022-05-03 23:06:41 +02:00
Jan (janneke) Nieuwenhuizen 5f73e64480
simple.make: Resurrect.
* simple.make (M2_PLANET_FLAGS): Add --bootstrap-mode.
(M2_SOURCES): Add lib/mes/globals.c.  Use lib/mes/mini-write.c instead
of lib/mes/write.c.  Use lib/m2/malloc.c instead of lib/stdlib/malloc.c.
(GCC_SOURCES): Add lib/mes/globals.c
(check-mescc): Set LIBRARY_PATH.
(m2): New target.
(m2/mes-m2.M1): Use it.
(m2/mes-m2.blood-elf.M1): Likewise.
2022-05-03 22:51:21 +02:00
Gabriel Wicki 580782bb72
core: Simplify math expressions.
* src/gc.c (gc_up_arena): Use division instead of shift.
(gc_flip): Simplify (free-news) * 1.5.
2022-05-10 22:23:40 +02:00
Jan (janneke) Nieuwenhuizen ec12220737
scaffold: Remove obsolete malloc.
* scaffold/lib/stdlib/malloc.c: Remove.
2022-05-07 08:45:06 +02:00
Ekaitz f89fed3c3b
doc: Fix typos.
* doc/mes.texi (Invoking mescc): Fix typo.
* module/mescc.scm (parse-opts): Likewise.
2022-09-22 11:14:34 +02:00
Ekaitz 761420ac31
mescc: Add X86_64 assembly defines for TinyCC compilation.
* lib/x86_64-mes/x86_64.M1 ( mov____%si,(%rdi), mov____%sil,(%rdi),
mov____(%rax),%si, mov____(%rax),%sil): New defines.
2022-09-21 09:43:43 +02:00
Jan (janneke) Nieuwenhuizen 5fc5983e50
build: When courageous, do build libgetopt and libtcc1.
* build-aux/build-lib.sh: Move building of libc+gnu and courageous exit
down.
2022-10-18 07:34:27 +02:00
Jan (janneke) Nieuwenhuizen 358ae145ab
build: Support bootstrap build without kaem/M2-Planet.
* configure.sh (M2_PLANET): Typo.  Allow check to fail.
(KAEM): Allow check to fail.
2022-10-17 13:10:48 +02:00
Jan (janneke) Nieuwenhuizen 2a1976b6de
guix: mes: Update to 0.24.1.
* guix/git/mes.scm (mes)[source]: Update to 0.24.1.
2022-10-16 10:14:43 +02:00
Jan (janneke) Nieuwenhuizen 550ef59cf0
doc: Enlarge guix graph bootstrap image.
* doc/mes.texi (The Mes Bootstrap Process): Use 6in width.
2022-10-16 11:06:37 +02:00
Jan (janneke) Nieuwenhuizen 678b23a2ca
doc: Typo.
* doc/announce/ANNOUNCE-0.24.1: Typo.
2022-10-16 10:09:26 +02:00
Jan (janneke) Nieuwenhuizen 343ac812ca
doc: Typo.
* doc/announce/ANNOUNCE-0.24.1 (Subject): Typo.
2022-10-16 10:04:48 +02:00
Jan (janneke) Nieuwenhuizen d6e3d26478
doc: Post-release update.
* doc/announce/ANNOUNCE-0.24.1 (Subject): Update Add gen-announce
checksums by running `make sum-announce'.
* build-aux/GNUmakefile.in (--previous-version): Update to 0.24.1.
2022-10-16 09:57:43 +02:00
Jan (janneke) Nieuwenhuizen 62fbe42c5c
guix: mes: Update to 0.24.1.
* guix/git/mes.scm (mes)[source]: Update to 0.24.1.
2022-10-16 09:56:31 +02:00
Jan (janneke) Nieuwenhuizen e37e564ae3
build: Release 0.24.1.
* configure (VERSION): Bump to 0.24.1.
* configure.sh (VERSION): Likewise.
2022-10-15 09:52:04 +02:00
Jan (janneke) Nieuwenhuizen cb39c832a5
doc: Update `ROADMAP'.
* ROADMAP (release 0.x, unsorted): Add Full Source bootstrap and
wip-aarch64-bootstrap branch.  Move DONE item...
(DONE): ...here.
2022-10-15 10:05:13 +02:00
Jan (janneke) Nieuwenhuizen 60965a172c
doc: Add ANNOUNCE-0.24.1.
* doc/announce/ANNOUNCE-0.24 (Subject): New file.
2022-10-15 10:13:09 +02:00
Jan (janneke) Nieuwenhuizen e70409d666
doc: Update `NEWS'.
* NEWS (Changes in 0.24.1 since 0.24): New section.
2022-10-15 10:01:10 +02:00
Jan (janneke) Nieuwenhuizen 074fa78f5e
lib/test: Cater for gcc-12.2.0.
These inexplicably avoid segfaults with gcc-12.2.0.

* lib/tests/posix/50-open-read.c (main)[__GNUC__ > 11]: Use malloc
instead of local allocated string.
* lib/tests/scaffold/7i-struct-struct.c (main)[__GNUC__ > 11]:
Initialize all fields of struct.
* lib/tests/scaffold/t.c (main): Likewise.
2022-09-15 13:56:38 +02:00
Jan (janneke) Nieuwenhuizen ac1fab97e5
doc: Update `PORTING'.
* PORTING (Setup environment): Update guile, gcc-toolchain, pin
nyacc@1.00.2.
2022-06-01 14:24:34 +02:00
Rick Masters fdac9fd3f2
lib: abtol: Fix number digits in hex number conversion.
After a letter based digit, number based digits are off.

* lib/mes/abtol.c (abtol): Reset "m" for number based digit.
* lib/tests/stdlib/70-strtoull.c (main): Test it.
* lib/tests/stdlib/90-strtol.c (main): Likewise.
2022-10-07 11:59:57 +02:00
Jan (janneke) Nieuwenhuizen 2cfce3186b
ARM: Use explicit remainder in __mesabi_uldiv call.
This inexplicably fixes a segfault in tcc-boot0.

* module/mescc/armv4/as.scm (armv4:r0/r1): Instead of using "push 0",
use explicit slot for remainder.
2022-09-13 13:52:03 +02:00
Jan (janneke) Nieuwenhuizen eee5398f3b
ARM: Fix unsigned modulo.
* lib/arm-mes/arm.M1 (mov____%esp,%r3): New macro.
* module/mescc/armv4/as.scm (armv4:r0%r1): Use it to avoid overwriting
%r0 before caling __mesabi_uldiv.
2022-09-12 09:47:28 +02:00
Jan (janneke) Nieuwenhuizen dbec0c3845
test: Add 60-math-modulo.c.
* lib/tests/scaffold/60-math-modulo.c: New test.
* build-aux/check-mescc.sh (mes_tests): Add it.
2022-09-11 23:34:20 +02:00
Jan (janneke) Nieuwenhuizen e64d763ccd
ARM: ntoab: Do not include __mesabi_uldiv for bootstrap tcc.
* lib/mes/ntoab.c (__mesabi_uldiv): Exclude for tinycc arm bootstrap.
2022-09-13 19:12:31 +02:00
Jan (janneke) Nieuwenhuizen 06453020e6
build: Also use stage0_cpu detection in bootstrap.sh build.
* build-aux/build-scaffold.sh: Include cflags.sh.
(stage0_cpu): Move to...
* build-aux/cflags.sh (stage0_cpu): ...here.
* build-aux/build.sh.in (stage0_cpu): Remove.
2022-05-21 14:13:18 +02:00
Jan (janneke) Nieuwenhuizen adb232edd9
kaem: Fix version.
* src/symbol.c (MES_VERSION): Update to 0.24.
2022-05-03 22:52:45 +02:00
Jan (janneke) Nieuwenhuizen aa5f1533e1
build: Fix configure crashing when no compiler is present.
Reported by Andrius Štikonas <andrius@stikonas.eu> via IRC.

* configure (main): Cater for missing cc, actually set m2-planet when
found.
2022-05-14 21:09:06 +02:00
Gabriel Wicki 7b993b35b9
core: Remove code duplication.
* src/gc.c (copy_news): Remove copy of copy_cell.
(gc_copy): Use copy_cell instead.
2022-05-13 08:27:57 +02:00
Gabriel Wicki c7777121e8
core: Remove code duplication.
* src/gc.c (news_bytes): Remove copy of cell_bytes.
(gc_copy): Use cell_bytes instead.
* include/mes/mes.h (news_bytes): Remove prototype.
2022-05-13 08:27:56 +02:00
Jan (janneke) Nieuwenhuizen 810451c76b
build: Add publish-local.
* build-aux/GNUmakefile.in (publish-local): New target.
2022-05-13 08:27:56 +02:00
Jan (janneke) Nieuwenhuizen 6301625cf6
doc: Update `README'.
* README: Update to mention Further Reduced Binary Seed bootstrap.
2022-05-13 08:27:50 +02:00
Dor Askayo ce54ccc2c0
Fix definition of S_ISUID.
* include/sys/stat.h (S_ISUID: Append missing zero.
2022-05-09 07:01:01 +02:00
Jan (janneke) Nieuwenhuizen f785f8d560
build: Fix --with-bootstrap build.
Reported by Vagrant Cascadian <vagrant@debian.org>.

* build-aux/build.sh.in: Before building mes using mescc, in bootstrap
mode, remove globals.o built for lib.
2022-05-06 12:27:46 +02:00
Jan (janneke) Nieuwenhuizen 1c2a504cee
doc: Post-release update.
* doc/announce/ANNOUNCE-0.24: Add gen-announce checksums.
* build-aux/GNUmakefile.in (--previous-version): Update to 0.24.  Add
bug-mes to release announce.
2022-05-06 12:26:55 +02:00
Jan (janneke) Nieuwenhuizen 745017584a
guix: mes: Update to 0.24.
* guix/git/mes.scm (mes)[source]: Update to 0.24.
2022-05-02 18:54:33 +02:00
Jan (janneke) Nieuwenhuizen a36eb013f8
build: Release 0.24.
* configure (VERSION): Bump to 0.24.
* configure.sh (VERSION): Likewise.
* build-aux/GNUmakefile.in (gen-announce): Update previous-version to
0.23.
* mes/module/mes/repl.mes (welcome): Update copyright years.
2022-04-30 16:14:55 +02:00
Jan (janneke) Nieuwenhuizen 1cb3b51625
doc: Update `ROADMAP'.
* ROADMAP (release 0.x, unsorted): Move done item...
(DONE): ...here.
2022-05-01 23:44:34 +02:00
Jan (janneke) Nieuwenhuizen bf5b6a9052
doc: Add `ANNOUNCE-0.24'.
* doc/announce/ANNOUNCE-0.24: New file.
2022-05-01 22:49:51 +02:00
Jan (janneke) Nieuwenhuizen 2aced313c7
doc: Update `NEWS'.
* NEWS (Changes in 0.24 since 0.23): New section.
2022-04-30 16:02:01 +02:00
Jan (janneke) Nieuwenhuizen 76755d6be6
doc: Update `README'.
* README: Mention Mes can be bootstrapped using M2-Planet.
Mention Full Source Bootstrap sponsoring by NlNet.
2019-11-03 16:30:45 +01:00
Jan (janneke) Nieuwenhuizen c82c8da8ed
doc: Update 'AUTHORS'.
* AUTHORS: Mention Jeremiah Orians as co-author on ELF heanders and
mention M2-Planet imports.  Mention bug fixes by W.J. van der Laan.
2021-01-02 13:45:00 +01:00
Jan (janneke) Nieuwenhuizen d4589b6f0d
doc: Update Guix bootstrap status.
* doc/mes.texi (Bootstrappable Builds): Add reference to Guix.
(Reduced Binary Seed Bootstrap): Add node and section header.
(Scheme-only Bootsrap): New section.
(Full Source Bootstrap): Add node and section header.  Some updates.
(Stage0): Add node and section header.
(M2-Planet): New section.
(The Mes Bootstrap Process): Fix typos, update to current Guix reduced
binary seed bootstrap status.
* doc/images/gcc-mesboot-graph.dot: Regenerate.
2022-04-30 12:31:57 +02:00
Jan (janneke) Nieuwenhuizen 28a828ff4d
doc: Update dependencies, add M2-Planet.
* INSTALL (Other GNU/Linux): Update mescc-tools requirement, mention
M2-Planet.
(Prerequisites): Likewise.
* doc/mes.texi (Regular Requirements): Likewise.  Rename to...
(Requirements): ...this.
(Bootstrap Requirements): Likewise.
(Building from Git): Mention dependencies on GNU Texinfo, GNU help2man,
graphviz, and perl.
2022-04-30 11:12:48 +02:00
Jan (janneke) Nieuwenhuizen 796dc2dc39
doc: Use `guix shell' instead of `guix environment'.
* HACKING (SETUP): Use `guix shell' instead of `guix environment'.
* INSTALL (Guix): Likewise.
* PORTING (Setup environment): Likewise.
* doc/mes.texi (Building from Git): Likewise.
* simple.sh: Likewise.
* guix.scm: Likewise.  Add time-machine with working commit.
2022-04-30 09:44:57 +02:00
Jan (janneke) Nieuwenhuizen f71e333d61
build: Simple signature check for dist and release.
* build-aux/GNUmakefile.in (check-signature): New target.
(dist, release): Depend on it.
2022-05-02 11:37:27 +02:00
Jan (janneke) Nieuwenhuizen 8f36311d1f
build: Add `sum-announce' target.
* build-aux/GNUmakefile.in (sum-announce): New target.
(release): Check signature on release commit.
2022-05-02 11:24:06 +02:00
Jan (janneke) Nieuwenhuizen d1297688a8
ARM: build: Cater for M2-Planet.
* include/linux/arm/syscall.h: Add support for M2-Planet.
* lib/linux/arm-mes-m2/_exit.c,
lib/linux/arm-mes-m2/_write.c,
lib/linux/arm-mes-m2/crt1.M1,
lib/linux/arm-mes-m2/crt1.c,
lib/linux/arm-mes-m2/syscall.c,
lib/m2/arm/ELF-arm.hex2,
lib/m2/arm/arm_defs.M1: New files.
* build-aux/build.sh.in: Also allow kaem build for ARM.
2022-04-30 22:51:42 +02:00
Jan (janneke) Nieuwenhuizen 739ed40f5f
guix: m2-planet: Update to 1.9.0.
* guix/git/mes.scm (m2-planet)[source]: Update to 1.9.0.
2022-05-01 13:58:48 +02:00
Jan (janneke) Nieuwenhuizen df69a74ea9
build: Depend on M2-Planet-1.9.0.
* configure (main): Bump M2-Planet version to 1.8.0.
2022-04-30 22:42:55 +02:00
Jan (janneke) Nieuwenhuizen 79da3fc3e2
guix: mescc-tools: Update to 1.4.0
* gnu/packages/mes.scm (m2-planet): Update to 1.4.0.
[native-inputs]: Add which.
[argument]: Remove patch-prefix stage.
2022-05-01 23:04:03 +02:00
Jan (janneke) Nieuwenhuizen aa128eaa92
build: Depend on mescc-tools 1.4.0.
* configure (main): Check for hex2, M1 1.4.0, and blood-elf 2.0.0.
* module/mescc/mescc.scm (M1->blood-elf): Use --little-endian with blood-elf call.
* kaem.run,
scaffold/argv.kaem,
scaffold/global-array.kaem,
scaffold/hello.kaem,
scaffold/local-array.kaem,
scaffold/local-static-array.kaem,
scaffold/main.kaem,
scaffold/read.kaem,
simple.make: Likewise.
2022-05-02 07:46:01 +02:00
Jan (janneke) Nieuwenhuizen d0e5f812f3
guix: m2-planet: Update to 1.8.0.
* guix/git/mes.scm (m2-planet)[source]: Update to 1.8.0.
[arguments]: Remove patch-prefix stage.
[home-page]: Fix.
2022-04-30 08:51:35 +02:00
Jan (janneke) Nieuwenhuizen 93254bac8b
build: Depend on M2-Planet-1.8.0.
* configure (main): Bump M2-Planet version to 1.8.0.
* kaem.run,
scaffold/argv.kaem,
scaffold/global-array.kaem,
scaffold/hello.kaem,
scaffold/local-array.kaem,
scaffold/local-static-array.kaem,
scaffold/main.kaem,
scaffold/read.kaem:: Use M2-Planet --bootstrap-mode.
* build-aux/build-scaffold.sh: Remove obsolete --exec_enable.
2022-04-30 10:17:23 +02:00
Jan (janneke) Nieuwenhuizen 22f24be26a
guix: Update package inputs to new style.
* guix/git/mes.scm (m2-planet)[native-inputs]: Use simple list.
* guix/git/mes.scm (nyacc-0.99): Likewise.
[inputs]: Use simple list.
(nyacc): Likewise.
(mes)[propagated-inputs]: Use simple list.
[native-inputs]: Use list instead of alist.
[native-search-paths]: New field.
2022-04-30 09:15:24 +02:00
Jan (janneke) Nieuwenhuizen c45bd1bdd6
Mes C Library: memchr: Avoid compile warning.
* lib/string/memchr.c (memchr): Cast return to void*.
2022-04-30 16:40:57 +02:00
Jan (janneke) Nieuwenhuizen 8920f558c6
core: Fix FRAME_SIZE conflict.
This avoids conflicting with FRAME_SIZE from signal.h.

* include/mes/constants.h (FRAME_SIZE): Rename to...
(GC_FRAME_SIZE): ...this.
(FRAME_PROCEDURE): Rename to...
(GC_FRAME_PROCEDURE): ...this.
* src/eval-apply.c (eval_apply): Update accordingly.
* src/gc.c (gc_push_frame, gc_peek_frame, gc_pop_frame): Update accordingly.
* src/stack.c (make_frame, make_stack): Update accordingly.
2021-05-16 13:27:12 +02:00
Jan (janneke) Nieuwenhuizen 72e371d77f
core: Resurrect gcc-10 support.
* include/mes/mes.h (g_datadir, g_debug, g_buf, g_continuations,
g_symbols, g_symbol_max, g_mini, R0, R1, R2, R3, M0, g_macros, g_ports,
ARENA_SIZE, MAX_ARENA_SIZE, STACK_SIZE, JAM_SIZE, GC_SAFETY, MAX_STRING,
g_arena, cell_arena, cell_zero, g_free, g_symbol, g_stack_array,
g_cells, g_news, g_stack, gc_count, gc_start_time, gc_end_time, gc_time,
__execl_c_argv, __open_boot_buf, __open_boot_file_name, __setenv_buf,
__reader_read_char_buf, g_start_time, __gettimeofday_time,
__get_internal_run_time_ts): Declare extern.
* include/mes/symbols.h ( cell_nil, cell_f, cell_t, cell_dot,
cell_arrow, cell_undefined, cell_unspecified, cell_closure,
cell_circular, cell_vm_apply, cell_vm_apply2, cell_vm_begin,
cell_vm_begin_eval, cell_vm_begin_expand, cell_vm_begin_expand_eval,
cell_vm_begin_expand_macro, cell_vm_begin_expand_primitive_load,
cell_vm_begin_primitive_load, cell_vm_begin_read_input_file,
cell_vm_call_with_current_continuation2, cell_vm_call_with_values2,
cell_vm_eval, cell_vm_eval2, cell_vm_eval_check_func,
cell_vm_eval_define, cell_vm_eval_macro_expand_eval,
cell_vm_eval_macro_expand_expand, cell_vm_eval_pmatch_car,
cell_vm_eval_pmatch_cdr, cell_vm_eval_set_x, cell_vm_evlis,
cell_vm_evlis2, cell_vm_evlis3, cell_vm_if, cell_vm_if_expr,
cell_vm_macro_expand, cell_vm_macro_expand_car,
cell_vm_macro_expand_cdr, cell_vm_macro_expand_define,
cell_vm_macro_expand_define_macro, cell_vm_macro_expand_lambda,
cell_vm_macro_expand_set_x, cell_vm_return, cell_symbol_lambda,
cell_symbol_begin, cell_symbol_if, cell_symbol_quote,
cell_symbol_define, cell_symbol_define_macro, cell_symbol_quasiquote,
cell_symbol_unquote, cell_symbol_unquote_splicing, cell_symbol_syntax,
cell_symbol_quasisyntax, cell_symbol_unsyntax,
cell_symbol_unsyntax_splicing, cell_symbol_set_x, cell_symbol_sc_expand,
cell_symbol_macro_expand, cell_symbol_portable_macro_expand,
cell_symbol_sc_expander_alist, cell_symbol_call_with_values,
cell_symbol_call_with_current_continuation, cell_symbol_boot_module,
cell_symbol_current_module, cell_symbol_primitive_load, cell_symbol_car,
cell_symbol_cdr, cell_symbol_not_a_number, cell_symbol_not_a_pair,
cell_symbol_system_error, cell_symbol_throw,
cell_symbol_unbound_variable, cell_symbol_wrong_number_of_args,
cell_symbol_wrong_type_arg, cell_symbol_buckets, cell_symbol_builtin,
cell_symbol_frame, cell_symbol_hashq_table, cell_symbol_module,
cell_symbol_procedure, cell_symbol_record_type, cell_symbol_size,
cell_symbol_stack, cell_symbol_argv, cell_symbol_mes_datadir,
cell_symbol_mes_version, cell_symbol_internal_time_units_per_second,
cell_symbol_compiler, cell_symbol_arch, cell_symbol_pmatch_car,
cell_symbol_pmatch_cdr, cell_type_bytes, cell_type_char,
cell_type_closure, cell_type_continuation, cell_type_function,
cell_type_keyword, cell_type_macro, cell_type_number, cell_type_pair,
cell_type_port, cell_type_ref, cell_type_special, cell_type_string,
cell_type_struct, cell_type_symbol, cell_type_values,
cell_type_variable, cell_type_vector, cell_type_broken_heart,
cell_symbol_program, cell_symbol_test): Likewise.
* src/globals.c: New file.
* build-aux/configure-lib.sh (mes_SOURCES): Add it.
2021-05-02 14:58:23 +02:00
Jan (janneke) Nieuwenhuizen c18f2c0c89
guix: m2-planet: Update to 1.7.0-32-gaa3472b.
This adds support for skipping "extern".

* guix/git/mes.scm (m2-planet)[source]: Update to 1.7.0-32-gaa3472b.
2021-05-02 15:52:04 +02:00
Jan (janneke) Nieuwenhuizen 4ca839a064
scaffold: Add local-static-array.c.
GCC gives

    12:35:54 janneke@dundal:~/src/mes/wip-m2 [env]
    $ gcc scaffold/local-static-array.c
    12:36:01 janneke@dundal:~/src/mes/wip-m2 [env]
    $ ./a.out
    hello local static
    hello local static
    12:36:04 janneke@dundal:~/src/mes/wip-m2 [env]

M2-Planet gives

    12:36:04 janneke@dundal:~/src/mes/wip-m2 [env]
    $ kaem --verbose --strict --file scaffold/local-static-array.kaem
     +> M2-Planet --debug --architecture x86 -f lib/mes/globals.c -f lib/linux/x86-mes-m2/mini.c -f lib/mes/mini-write.c -f lib/string/strlen.c -f lib/string/strcpy.c -f lib/mes/eputs.c -f scaffold/local-static-array.c -o scaffold/local-static-array.M1
    scaffold/local-static-array.c:29:static is not a defined symbol
    Subprocess error 256
    ABORTING HARD
    [1]12:36:07 janneke@dundal:~/src/mes/wip-m2 [env]

* scaffold/local-static-array.c: New file.
* scaffold/local-static-array.kaem: New file.
2021-01-09 12:35:22 +01:00
Jan (janneke) Nieuwenhuizen 9ddb4389f1
scaffold: Add local-array.c.
GCC gives

    12:32:06 janneke@dundal:~/src/mes/wip-m2 [env]
    $ gcc scaffold/local-array.c
    12:34:27 janneke@dundal:~/src/mes/wip-m2 [env]
    $ ./a.out
    hello local
    12:34:31 janneke@dundal:~/src/mes/wip-m2 [env]

M2-Planet gives

    12:34:31 janneke@dundal:~/src/mes/wip-m2 [env]
    $ kaem --verbose --strict --file scaffold/local-array.kaem
     +> M2-Planet --debug --architecture x86 -f lib/mes/globals.c -f lib/linux/x86-mes-m2/mini.c -f lib/mes/mini-write.c -f lib/string/strlen.c -f lib/string/strcpy.c -f lib/mes/eputs.c -f scaffold/local-array.c -o scaffold/local-array.M1
    scaffold/local-array.c:29:ERROR in collect_local
    Missing ;
    Subprocess error 256
    ABORTING HARD
    [1]12:34:42 janneke@dundal:~/src/mes/wip-m2 [env]

* scaffold/local-array.c: New file.
* scaffold/local-array.kaem: New file.
2021-01-09 12:33:26 +01:00
Jan (janneke) Nieuwenhuizen e6bfaae273
scaffold: Add global-array.c.
GCC gives

    12:30:45 janneke@dundal:~/src/mes/wip-m2 [env]
    $ gcc scaffold/global-array.c
    12:31:53 janneke@dundal:~/src/mes/wip-m2 [env]
    $ ./a.out
    hello global
    12:31:54 janneke@dundal:~/src/mes/wip-m2 [env]

M2-Planet gives

    12:31:54 janneke@dundal:~/src/mes/wip-m2 [env]
    $ kaem --verbose --strict --file scaffold/global-array.kaem
     +> M2-Planet --debug --architecture x86 -f lib/mes/globals.c -f lib/linux/x86-mes-m2/mini.c -f lib/mes/mini-write.c -f lib/string/strlen.c -f lib/string/strcpy.c -f lib/mes/eputs.c -f scaffold/global-array.c -o scaffold/global-array.M1
    scaffold/global-array.c:20:Received [ in program
    Subprocess error 256
    ABORTING HARD
    [1]12:32:06 janneke@dundal:~/src/mes/wip-m2 [env]

* scaffold/global-array.c: New file.
* scaffold/global-array.kaem: New file.
2021-01-09 12:30:59 +01:00
Jan (janneke) Nieuwenhuizen ac0960f5e0
doc: Add test hints to `HACKING'.
* HACKING (TESTING): New section.
2021-01-01 11:58:36 +01:00
Jan (janneke) Nieuwenhuizen 9c2ba4829c
Revert "Mes C Library: m2/execve.c: Remove specialization."
This fixes

    gcc-lib/libc+gnu.c: At top level:
    gcc-lib/libc+gnu.c:2694:1: error: conflicting types for ‘execve’
     execve (char const *file_name, char **argv, char **env)
     ^~~~~~
    In file included from gcc-lib/libc+gnu.c:492:0:
    include/unistd.h:66:5: note: previous declaration of ‘execve’ was here
     int execve (char const *file, char *const argv[], char *const env[]);
         ^~~~~~

This reverts commit 828c27a073.
2021-01-02 10:00:35 +01:00
Jan (janneke) Nieuwenhuizen 99fbb9b2e5
bootstrap: Update M2-Planet x86 definitions from 1.7.0-31-g358b6cf.
* lib/m2/x86/x86_defs.M1: Update.
2021-01-01 19:07:22 +01:00
Jan (janneke) Nieuwenhuizen 4a77600868
guix: m2-planet: Update to 1.7.0-31-g358b6cf.
* guix/git/mes.scm (m2-planet)[source]: Update to 1.7.0-31-g358b6cf.
2021-01-01 18:53:07 +01:00
Jan (janneke) Nieuwenhuizen c881e18dae
Revert "Mes C Library: m2/getcwd.c: Remove specialization."
This reverts commit 37f44ce945.
2021-01-01 15:54:13 +01:00
Jan (janneke) Nieuwenhuizen b23c6885a6
core: Move __getcwd_buf to Mes C Library.
* include/mes/mes.h (__getcwd_buf): Move to..
* lib/posix/getcwd.c (__getcwd_buf): ...here.
(getcwd): Refactor.
* src/posix.c (getcwd_): Do not use __getcwd_buf.
2021-01-01 15:43:43 +01:00
Jan (janneke) Nieuwenhuizen 0d337be8ff
bootstrap: Support building with M2-Planet 1.4.
* lib/m2/x86/x86_defs.M1 (NOP): New define.
2021-01-01 11:40:51 +01:00
Jan (janneke) Nieuwenhuizen 348dcbcbd7
mescc: Only use signed division when numerator is signed.
Currently, sign-extension (CLTD vs XOR EDX) and signed division (IDIV vs
DIV) selected by setting "signed?".  See, module/mescc/x86/as.scm.
Possibly we need a signed? based on numerator and denominator, and
add a extend-sign? based on the signedness of the numerator?

* module/mescc/compile.scm (expr->register): Base "signed?" strictly on
signedness of numerator.
2021-01-01 10:31:46 +01:00
Jan (janneke) Nieuwenhuizen fac6a873f7
mescc: Use unsigned type for sizeof expression.
* module/mescc/compile.scm (ast->type): Use unsigned type for sizeof
expression.
2021-01-01 10:30:48 +01:00
Jan (janneke) Nieuwenhuizen da03a384c8
mescc: Respect integer literal type suffixes.
* module/mescc/compile.scm (ast->type): Respect ULL, UL, U, LL, L suffix
on integer literals.
2021-01-01 10:28:24 +01:00
Jan (janneke) Nieuwenhuizen 8f67315eb6
core: Use unsigned constants.
* src/gc.c (FRAME_SIZE, M2_CELL_SIZE): Declare unsigned.
(gc_init): Use unsigned suffixes for divisions.
* src/posix.c (TIME_UNITS_PER_SECOND): Declare unsigned.
(UL1000000000): New constant.
(seconds_and_nanoseconds_to_long): Use it.
* src/gc.c (U10, U100): New constants.
(gc_init): Use them.
2021-01-01 10:24:22 +01:00
Jan (janneke) Nieuwenhuizen b237308f26
core: Use size_t instead of long for gc sizes.
* include/mes/mes.h (ARENA_SIZE, MAX_ARENA_SIZE, STACK_SIZE, JAM_SIZE,
GC_SAFETY, MAX_STRING): Use size_t instead of long.
2021-01-01 09:47:22 +01:00
Jan (janneke) Nieuwenhuizen 1a97f941c3
core: Avoid Floating point exception dividing negative numbers.
* src/posix.c (seconds_and_nanoseconds_to_long): Use unsigned division.
2021-01-01 09:46:20 +01:00
Jan (janneke) Nieuwenhuizen 6a25b8d3aa
core: Avoid Floating point exception dividing negative numbers.
This fixes

    kaem --verbose --strict
    bin/mes-m2 -c '(display (modulo -1 -1))'

* src/math.c (modulo): Use unsigned division.
2021-01-01 09:04:39 +01:00
Jan (janneke) Nieuwenhuizen aac33c44b7
bootstrap: Use ./pre-inst-env mescc default.
* configure.sh: When CC is mescc, M2-Planet or unset, use
"./pre-inst-env mescc" as default.
2021-01-01 08:52:49 +01:00
Jan (janneke) Nieuwenhuizen 99adc7efdc
tests: string-join: Be noisy.
* scaffold/boot/50-string-join.scm ("string-join\n"): Avoid exit 0
without output.
2020-12-30 18:45:18 +01:00
Jan (janneke) Nieuwenhuizen d79b5edb4f
mes: simple-format: Use core display.
* mes/module/mes/simple-format.mes: Do not import (mes display).
2019-11-16 23:05:10 +01:00
Jan (janneke) Nieuwenhuizen 6561480506
mes: Resurrect backtraces.
* mes/module/mes/catch.mes (%eh): Resurrect backtraces.
(display-frame): New function.
(display-backtrace): Use it.
2019-11-10 16:08:13 +01:00
Jan (janneke) Nieuwenhuizen 96e6ecaf7d
core: Add abort.
* lib/stub/__raise.c: New file.
* kaem.run: Use it.
* src/posix.c (__raise)[SYSTEM_LIBC]: New macro.
 (abort_): New function: possibly use it.
* include/mes/builtins.h: Declare it.
* src/builtins.c (mes_builtins): Register it.
2019-11-10 16:04:25 +01:00
Jan (janneke) Nieuwenhuizen 94643f8361
mes: Remove PEG.
PEG is not used and mostly broken.

* mes/module/mes/peg.mes,
mes/module/mes/peg/cache.scm,
mes/module/mes/peg/codegen.scm,
mes/module/mes/peg/simplify-tree.scm,
mes/module/mes/peg/string-peg.scm,
mes/module/mes/peg/using-parsers.scm,
tests/peg.test: Remove.
* AUTHORS: Remove mention.
2020-12-30 17:28:21 +01:00
Jan (janneke) Nieuwenhuizen ed62c40cc6
.dir-locals: Add test macro indentation.
* .dir-locals.el (scheme-mode): Add indentation for pass-if,
pass-if-not, pass-if-eq, pass-if-equal, expect-fail, pass-if-timeout.
2020-12-30 11:47:32 +01:00
Jan (janneke) Nieuwenhuizen a551d9dcde
mescc: Use (format (current-error-port) ...) instead of stderr.
* module/mescc/M1.scm: Use (format (current-error-port) ...) instead of
stderr.
* module/mescc/compile.scm: Likewise.
* module/mescc/mescc.scm: Likewise.
* module/mescc/preprocess.scm: Likewise.
2020-12-30 21:20:19 +01:00
Jan (janneke) Nieuwenhuizen a788fcfda7
core: Add gc-stats.
* include/mes/mes.h (gc_start_time, gc_end_time, gc_time): New
variables.
* src/mes.c (init): Initialize them.
* src/gc.c: Use them.
* src/gc.c (gc_stats): New function.
* include/mes/builtins.h: Declare it.
* src/builtins.c (mes_builtins): Register it.
* tests/gc.test: Use it.
2020-12-31 10:34:07 +01:00
Jan (janneke) Nieuwenhuizen c16bdb576b
core: Avoid Floating point exception dividing negative numbers.
This fixes

    kaem --verbose --strict
    bin/mes-m2 -c '(display (/ -1 1))'

* src/math.c (divide): Use signed division.
2020-12-29 22:39:31 +01:00
Jan (janneke) Nieuwenhuizen d984618a48
Mes C Library: m2/execve.c: Remove specialization.
* lib/linux/execve.c (execve): Cater for M2-Planet.
* lib/m2/execve.c: Remove.
* kaem.run: Update accordingly.
* simple.make (M2_SOURCES): Likewise.
2020-12-29 19:13:02 +01:00
Jan (janneke) Nieuwenhuizen f07856de0f
Mes C Library: m2/getcwd.c: Remove specialization.
* lib/posix/getcwd.c (getcwd): Cater for M2-Planet.
* lib/m2/getcwd.c: Remove.
* kaem.run: Update accordingly.
* simple.make (M2_SOURCES): Likewise.
2020-12-29 18:52:37 +01:00
Jan (janneke) Nieuwenhuizen fca14d27ad
Mes C Library: m2/ioctl.c: Remove specialization.
* lib/stub/ioctl.c (ioctl3): Move to...
* lib/stub/ioctl3.c: ...new file.
* lib/m2/ioctl3.c: Move to...
* lib/linux/ioctl3.c: ...here.
* include/mes/lib.h (ioctl3): Declare it.
* lib/m2/isatty.c (isatty): Use it.
* build-aux/configure-lib.sh (libc_SOURCES): Include it; move
lib/linux/ioctl.c to ...
(libc_gnu_SOURCES): ... here.
* kaem.run: Update accordingly.
* simple.make (M2_SOURCES): Likewise.
* simple.sh (compiler): Likewise.
2020-12-29 18:41:45 +01:00
Jan (janneke) Nieuwenhuizen a4e56aac56
Mes C Library: m2/ntoab.c: Remove specialization.
* lib/mes/ntoab.c (__mesabi_uldiv)[__M2_PLANET__ || !(__MESC__ &&
__arm__)]:  New function.
* lib/mes/ntoab.c (ntoab): Use it to cater for M2-Planet.
* lib/m2/ntoab.c: Remove.
* kaem.run: Update accordingly.
* simple.make (M2_SOURCES, (M2_TODO): Likewise.
2020-12-29 15:39:33 +01:00
Jan (janneke) Nieuwenhuizen f7e772d7e0
build: Resurrect simple.sh.
* simple.sh: Do not attempt to build multiple C files with mescc.
Update for new and split C files.
2020-12-29 15:39:19 +01:00
Jan (janneke) Nieuwenhuizen b4f57f158a
guix: m2-planet: Update to 1.7.0.
* guix/git/mes.scm (m2-planet)[source]: Update to 1.7.0.
(native-inputs): Remove gcc-toolchain-7.
[arguments]: Add CC to make-flags.  Update sha256sum patch.
2020-12-29 11:28:13 +01:00
Jan (janneke) Nieuwenhuizen 795225ec29
core: Prepare for M2-Planet 1.7.0.
* src/eval-apply.c (expand_variable_, apply_builtin): Declare variables
at toplevel.
* src/gc.c (gc_cellcpy, gc_loop, gc_dump_arena): Likewise.
* src/hash.c (hash_table_printer): Likewise.
* src/lib.c (equal2_p): Likewise.
* src/math.c (greater_p, less_p, is_p, minus, plus, divide, multiply,
logand, logior, logxor): Likewise.
* src/posix.c (current_input_port, execl_): Likewise.
* src/reader.c (reader_read_string): Likewise.
* src/stack.c (make_stack): Likewise.
* src/string.c (list_to_cstring, bytes_to_list, string_append):
Likewise.
* src/struct.c (make_struct): Likewise.
* src/vector.c (vector_to_list): Likewise.
2020-12-29 13:38:38 +01:00
Jan (janneke) Nieuwenhuizen 41c126759e
mescc: Mes C Library: Prepare for M2-Planet 1.7.0.
* lib/m2/ntoab.c (ntoab): Declare variables at toplevel.
* lib/mes/abtol.c (abtol): Likewise.
* lib/posix/getenv.c (getenv): Likewise.
* lib/posix/setenv.c (setenv): Likewise.
2020-12-29 13:37:20 +01:00
Jan (janneke) Nieuwenhuizen 74d7d097e4
mescc: Mes C Library: isatty: Use fixed array size for M2-Planet.
* lib/m2/isatty.c (struct ktermios)[c_cc]: Hardcode to size 19.
2020-12-29 13:34:24 +01:00
Jan (janneke) Nieuwenhuizen a87e014ed6
mescc: Mes C Library: Update M2-Planet macros.
* lib/m2/x86/x86_defs.M1: Update from M2-Planet 1.7.0.
2020-12-29 13:33:12 +01:00
Jan (janneke) Nieuwenhuizen 40efaa47a3
mes: compatibility: Move (mes pmatch) to (system base pmatch).
* mes/module/system/base/pmatch.scm: Move from mes/pmatch.scm.  Update
users.
2020-11-01 16:20:12 +01:00
Jan (janneke) Nieuwenhuizen c30da3435f
mes: compatibility: Make base.mes pure guile.
* mes/module/mes/type-0.mes (procedure?): New function.  Rewrite
without `cond' from
* mes/module/mes/base.mes (procedure?): here; Remove.
2020-11-01 16:09:27 +01:00
Jan (janneke) Nieuwenhuizen 7a6505be6e
build: Cater for M2-Planet.
* configure: Drop MES_SEED, support M2-Planet.
* kaem.run: Also build bin/mes.
* build-aux/bootstrap.sh.in: Run kaem bootstrap.
* build-aux/build.sh.in: Set stage0_cpu.  On x86, run kaem bootstrap.
Build bin/mes.  Update scripts and users.
* build-aux/install.sh.in: Install all built bin/mes-* flavours.
2020-10-18 23:15:11 +02:00
Jan (janneke) Nieuwenhuizen d06a13aee4
guix: Update M2-Planet to 1fc2aeab483208bd2ba117b21df3894c182470ec.
* guix/git/mes.scm (m2-planet): Update to 1fc2aeab483208bd2ba117b21df3894c182470ec.
(native-inputs): Add gcc-toolchain-7.
* lib/m2/x86/x86_defs.M1: Update from M2-Planet.
2020-10-18 23:29:15 +02:00
Jan (janneke) Nieuwenhuizen cd0eb07c40
guix: Add m2-planet.
* guix/git/mes.scm (m2-planet): New variable.
2020-10-18 23:14:30 +02:00
Jan (janneke) Nieuwenhuizen 8f2bc16e7a
core: Use casting functions.
Silence all casting errors by using casting functions.

* src/cc.c (cast_charp_to_scmp, cast_charp_to_scmpp,
cast_voidp_to_charp, cast_scmp_to_long, cast_scmp_to_charp): New function.
* src/m2.c (cast_charp_to_scmp, cast_charp_to_scmpp,
cast_voidp_to_charp, cast_scmp_to_long, cast_scmp_to_charp): New function.
* include/mes/mes.h: Declare them.
(struct scm): Add car_value, cdr_value, function.
(g_continuations): Change to long.
* src/mes.c: Silence all casting errors by using casting functions.
2020-10-18 15:44:49 +02:00
Jan (janneke) Nieuwenhuizen ca8e9f0342
mescc: Mes C Library: Use casting functions.
Silence all casting errors by using casting functions.

* lib/mes/cast.c: New file.
* build-aux/configure-lib.sh (libmes_SOURCES): Add it.
* lib/m2/cast.c: New file.
* kaem.run: Add it.
* simple.make: Add them both.
* include/mes/lib.h: Add cast prototypes.
* include/m2/lib.h: Likewise.
* lib/linux/_getcwd.c (_getcwd): Use them.
* lib/linux/access.c (access): Likewise.
* lib/linux/brk.c (brk): Likewise.
* lib/linux/chmod.c (chmod): Likewise.
* lib/linux/clock_gettime.c (clock_gettime): Likewise.
* lib/linux/gettimeofday.c (gettimeofday): Likewise.
* lib/linux/unlink.c (unlink): Likewise.
* lib/mes/fdputc.c (fdputc): Likewise.
* lib/stdio/putchar.c (putchar): Likewise.
* lib/linux/malloc.c (malloc): Likewise.
2020-10-18 14:55:24 +02:00
Jan (janneke) Nieuwenhuizen 3b29abc850
core: Switch to pointer cells.
Run

   build-aux/pointer.sh

* include/mes/macros.h: Remove.
* src/*.c: Update.
* include/mes/*.h: Update.
* simple.make: Update.
* kaem.run: Update.
2020-10-18 11:34:32 +02:00
Jan (janneke) Nieuwenhuizen e4a8bdcc8f
build: Update snarfer.
* build-aux/mes-snarf.scm (symbol->header): Update for pointer cells.
(snarf-symbols): Likewise.
(snarf-functions): Likewise.
2020-09-27 19:07:00 +02:00
Jan (janneke) Nieuwenhuizen 1cdbadfe98
core: Drop support for number based cells.
This removes the POINTER_CELLS define and all its references.

* simple.make (CFLAGS): Remove -D POINTER_CELLS.
* include/mes/mes.h: Remove #define POINTER_CELLS.
* include/mes/cc.h: Remove !POINTER_CELLS branches.
* include/mes/macros.h: Likewise.
* src/gc.c: Likewise.
* src/symbol.c: Likewise.
* src/test/gc.c: Likewise.
2020-09-20 11:32:38 +02:00
Jan (janneke) Nieuwenhuizen 5c9f2edd90
core: gc: Pointer cells: Drop cells->news->cells flipping.
* src/gc.c (gc_init): Undo doubling of initial memory.
(gc_init_news)[!GC_NOFLIP]: Remove.
(gc_)[!GC_NOFLIP]: Remove symbol relocation.
(gc)[!GC_NOFLIP]: Remove second gc.
2020-09-20 11:11:08 +02:00
Jan (janneke) Nieuwenhuizen 3f368e29e1
core: gc: Abort upon broken heart failure.
* src/gc.c (gc_cellcpy, gc_loop): Abort upon broken heart failure.
2020-09-20 10:58:36 +02:00
Jan (janneke) Nieuwenhuizen 20595cd044
core: gc: Enable memory dump debugging.
* src/gc.c (gc): If MES_DUMP is set, dump arena.  [POINTER_CELLS &&
!GC_NOFLIP]: Run gc_ twice to enable comparing memory dumps.
2020-09-20 09:35:56 +02:00
Jan (janneke) Nieuwenhuizen b05558ec00
core: gc: Add gc_dump_arena.
* src/gc.c (dumpc, dumps, gc_dump_register, gc_dump_state,
gc_dump_stack, gc_dump_arena): New function.
2020-09-14 14:53:56 +02:00
Jan (janneke) Nieuwenhuizen 3de592d441
core: Pointer cells: Allow smaller memory footprint using cellcpy.
* src/gc.c (gc_init)[GC_NOFLIP]: Do not use double sized arena.
(gc_cellcpy): New function.
* src/gc.c (gc_flip): Use it, do not flip.
(gc_init_news)[GC_NOFLIP]: Update.
2020-09-13 18:20:52 +02:00
Jan (janneke) Nieuwenhuizen 543419134f
test/gc: Add three extra gc's.
* src/test/gc.c (test_gc): Add three extra gc's.
2020-08-17 20:46:47 +02:00
Jan (janneke) Nieuwenhuizen 0d6971b560
test/gc: struct.
* src/test/gc.c (test_struct): New function.
(main): Call it.
2020-08-16 17:20:28 +02:00
Jan (janneke) Nieuwenhuizen b8a4869c3e
test/gc: vector.
* src/test/gc.c (test_vector): New function.
(main): Call it.
(print_arena): New function.
(test_gc): Call it.
2020-08-16 16:24:42 +02:00
Jan (janneke) Nieuwenhuizen 0681f79b67
test/gc: string.
* src/test/gc.c (test_string): New function.
(main): Call it.
2020-08-16 17:09:27 +02:00
Jan (janneke) Nieuwenhuizen aee51fb1dd
test/gc: list.
* src/test/gc.c (test_list): New function.
(main): Call it.
2020-08-16 12:02:22 +02:00
Jan (janneke) Nieuwenhuizen f5c905ebd8
test/gc: cons. 2020-08-16 12:00:18 +02:00
Jan (janneke) Nieuwenhuizen 9868f41674
test/gc: number.
* src/test/gc.c (test_number): New function.
(main): Call it.
2020-08-16 11:56:02 +02:00
Jan (janneke) Nieuwenhuizen ea6fa6fdee
test/gc: empty.
* src/test/gc.c (test_empty): New function.
2020-08-16 11:22:30 +02:00
Jan (janneke) Nieuwenhuizen 4bcfc155c1
core: eval-apply: Prepare for M2-Planet.
* src/eval-apply.c (apply_builtin): Split M2-Planet specific and CC
specifi part off to ..
* src/cc.c: New file, and
* build-aux/configure-lib.sh (mes_SOURCES): Add it.
* src/m2.c: New file.
* simple.make (MES_SOURCES, M2_SOURCES): Likewise.
2020-08-18 23:01:53 +02:00
Jan (janneke) Nieuwenhuizen 99040a38c4
core: display: Prepare for pointer cells, M2-Planet.
Rewrite C-constructs not supported by M2-Planet

    if (foo)               -> if (foo != 0)
    if (!foo)              -> if (foo == 0)
    ;                      -> 0;
    // ...                 -> /* ... */

* src/display.c (display_helper): Use cell_ref.
2020-08-18 16:16:13 +02:00
Jan (janneke) Nieuwenhuizen 19ecbfe950
core: gc: Prepare for pointer cells, M2-Planet.
* include/mes/mes.h (cell_zero): Declare.
* src/gc.c (gc_init): Initialize it.
(gc_init_news): Likewise.
2020-08-16 14:45:18 +02:00
Jan (janneke) Nieuwenhuizen 020cb3661d
core: Remove cell_call_with_current_continuation special.
* include/mes/symbols.h (cell_call_with_current_continuation): Remove.
* src/eval-apply.c (eval_apply): Update to use
cell_symbol_call_with_current_continuation.
* src/symbol.c (init_symbols_): Remove inititialization.
2020-08-18 11:06:15 +02:00
Jan (janneke) Nieuwenhuizen c6fd15469c
core: Remove cell_begin special.
* include/mes/symbols.h (cell_begin): Remove.
* src/eval-apply.c (eval_apply): Update to use cell_symbol_begin.
* src/symbol.c (init_symbols_): Remove initialization.
2020-08-18 10:40:55 +02:00
Jan (janneke) Nieuwenhuizen f8152da76a
core: Remove unused symbols.
* include/mes/symbols.h (cell_symbol_dot, cell_symbol_read_input_file,
cell_symbol_write, cell_symbol_display): Remove
* src/symbol.c (init_symbols_): Remove initializations.
2020-08-18 10:33:56 +02:00
Jan (janneke) Nieuwenhuizen e1efd41abe
core: builtins: MES_MINI.
* include/mes/mes.h (g_mini): New global.
* src/mes.c (init): Initialize it with environment variable MES_MINI.
* src/builtins.c (mes_builtins): Register a minimal set of builtins
when g_mini.
2020-08-18 09:36:19 +02:00
Jan (janneke) Nieuwenhuizen 9e684b9886
boot: Add gc test.
* scaffold/boot/gc.test: New file.
* build-aux/check-boot.sh (TESTS): Add it.
* include/mes/symbols.h (cell_symbol_program): New symbol.
* src/symbol.c (init_symbols_): Initialize it.
* src/mes.c (main): Add it to environment.
2020-08-16 17:36:55 +02:00
Jan (janneke) Nieuwenhuizen 17805e9d3a
test/gc: Add gc inspection test.
* src/test/gc.c (main): New unit test.
* simple.make (test-gcc, test-m2): New target to build it.
* build-aux/pointer.sh: Add it.
2020-08-16 08:56:56 +02:00
Jan (janneke) Nieuwenhuizen c247733bcd
core: make_struct: Avoid creating garbage.
* src/struct.c (make_struct): Use STRUCT TYPE PRINTER FIELD0 ... FIELDN.
2020-08-16 17:03:31 +02:00
Jan (janneke) Nieuwenhuizen b30af2ce9f
core: make-vector: Move to core.
* src/vector.c (make_vector_): Rename from make_vector__.  Add
parameter.  Fix double allocation.
(make_vector): Rename from make_vector_.  Use arity n.  Update users.
2020-08-16 16:54:18 +02:00
Jan (janneke) Nieuwenhuizen 967d1473be
mescc: Mes C Library: Add M2-Planet support.
Mes can now be built with M2-Planet by running

    kaem --verbose --strict

* include/linux/x86/syscall.h (SYS_getcwd, SYS_dup, SYS_dup2,
SYS_unlilnk, SYS_gettimeofday, SYS_clock_gettime, SYS_time): Move to
libc section.  Add M2-Planet constants.
* include/m2/lib.h (struct timezone, struct timespec): struct timeval):
Define.  Add M2-Planet flavor prototypes for mes libc.
* include/mes/m2.h: Remove macros.
* include/mes/mes.h (g_start_time, __gettimeofday_time,
__get_internal_run_time_ts): Declare.
* src/mes.c (init): Initialize them.
* src/posix.c: Use them.
* lib/linux/_getcwd.c: Support M2-Planet.
* lib/linux/access.c: Likewise.
* lib/linux/chmod.c: Likewise.
* lib/linux/clock_gettime.c: Likewise.
* lib/linux/dup.c: Likewise.
* lib/linux/dup2.c: Likewise.
* lib/linux/gettimeofday.c: Likewise.
* lib/linux/read.c: Likewise.
* lib/linux/unlink.c: Likewise.
* lib/mes/fdgetc.c: Likewise.
* lib/mes/fdputc.c: Likewise.
* lib/posix/getenv.c: Likewise.
* lib/posix/setenv.c: Likewise.
* lib/stdlib/realloc.c: Likewise.
* lib/string/memcmp.c: Likewise.
* lib/string/memcpy.c: Likewise.
* lib/m2/abtol.c: New file.
* lib/m2/chmod.c: New file.
* lib/m2/clock_gettime.c: New file.
* lib/m2/execv.c: New file.
* lib/m2/execve.c: New file.
* lib/m2/exit.c: New file.
* lib/m2/getcwd.c: New file.
* lib/m2/ioctl.c: New file.
* lib/m2/isatty.c: New file.
* lib/m2/ntoab.c: New file.
* lib/m2/strncmp.c: New file.
* lib/m2/time.c: New file.
* lib/m2/waitpid.c: New file.
* simple.make: Use them.  Remove macro preprocessing for M2-Planet.
* kaem.run: New file.
2020-08-09 19:25:25 +02:00
Jan (janneke) Nieuwenhuizen a7273407ea
core: posix: Prepare for M2-Planet.
* src/posix.c (access_p): Prepare for M2-Planet.
2020-08-22 19:57:13 +02:00
Jan (janneke) Nieuwenhuizen c58049d48d
mescc: Mes C Library: Add waitpid for M2-Planet.
* lib/m2/waitpid.c: New file.
2020-07-25 20:05:29 +02:00
Jan (janneke) Nieuwenhuizen e103008c2e
mescc: Mes C Library: Add time for M2-Planet.
* lib/m2/time.c: New file.
2020-07-25 20:05:19 +02:00
Jan (janneke) Nieuwenhuizen e25edc22f7
mescc: Mes C Library: Add ntoab for M2-Planet.
* lib/m2/ntoab.c: New file.
2020-07-25 20:04:35 +02:00
Jan (janneke) Nieuwenhuizen d51c166364
mescc: Mes C Library: Add isatty for M2-Planet.
* lib/m2/isatty.c: New file.
2020-07-25 20:04:27 +02:00
Jan (janneke) Nieuwenhuizen 232d69befb
mescc: Mes C Library: Add ioctl for M2-Planet.
* lib/m2/ioctl.c: New file.
2020-07-25 20:04:19 +02:00
Jan (janneke) Nieuwenhuizen 38b14b20bf
mescc: Mes C Library: Add getcwd for M2-Planet.
* lib/m2/getcwd.c: New file.
2020-07-25 20:04:07 +02:00
Jan (janneke) Nieuwenhuizen e1175b49ea
mescc: Mes C Library: Add exit for M2-Planet.
* lib/m2/exit.c: New file.
2020-07-25 20:03:58 +02:00
Jan (janneke) Nieuwenhuizen f5f65a0c96
mescc: Mes C Library: Add execve for M2-Planet.
* lib/m2/execve.c: New file.
2020-07-25 20:03:47 +02:00
Jan (janneke) Nieuwenhuizen 8ebae4213e
mescc: Mes C Library: Add execv for M2-Planet.
* lib/m2/execv.c: New file.
2020-07-25 20:03:30 +02:00
Jan (janneke) Nieuwenhuizen ec79b8a0ae
mescc: Mes C Library: Add clock_gettime for M2-Planet.
* lib/m2/clock_gettime.c: New file.
2020-07-25 20:03:17 +02:00
Jan (janneke) Nieuwenhuizen 67f0dc8ec4
mescc: Mes C Library: Add chmod for M2-Planet.
* lib/m2/chmod.c: New file.
2020-07-25 20:03:06 +02:00
Jan (janneke) Nieuwenhuizen 8c6756e7f2
mescc: Mes C Library: Add M2-Planet support.
Mes can now be built with M2-Planet by running

    kaem --verbose --strict

* include/linux/x86/syscall.h (SYS_getcwd, SYS_dup, SYS_dup2,
SYS_unlilnk, SYS_gettimeofday, SYS_clock_gettime, SYS_time): Move to
libc section.  Add M2-Planet constants.
* include/m2/lib.h (struct timezone, struct timespec): struct timeval):
Define.  Add M2-Planet flavor prototypes for mes libc.
* include/mes/m2.h: Remove macros.
* include/mes/mes.h (g_start_time, __gettimeofday_time,
__get_internal_run_time_ts): Declare.
* src/mes.c (init): Initialize them.
* src/posix.c: Use them.
* simple.make: Use them.  Remove macro preprocessing for M2-Planet.
* kaem.run: New file.
2020-07-25 20:00:44 +02:00
Jan (janneke) Nieuwenhuizen c94ac66095
mescc: Mes C Library: Prepare for M2-Planet: realloc.
* lib/stdlib/realloc.c (realloc): Prepare for M2-Planet.
2020-07-25 19:56:16 +02:00
Jan (janneke) Nieuwenhuizen dbbc04172c
mescc: Mes C Library: Prepare for M2-Planet: fdputc.
* lib/mes/fdputc.c (fdputc): Prepare for M2-Planet.
2020-07-25 19:55:21 +02:00
Jan (janneke) Nieuwenhuizen d7d3d398eb
mescc: Mes C Library: Prepare for M2-Planet: unlink.
* lib/linux/unlink.c (unlink): Prepare for M2-Planet.
2020-07-25 19:54:49 +02:00
Jan (janneke) Nieuwenhuizen 8aedfd8f5f
mescc: Mes C Library: Prepare for M2-Planet: read.
* lib/linux/read.c (read): Prepare for M2-Planet.
2020-07-25 19:54:40 +02:00
Jan (janneke) Nieuwenhuizen eb28518a35
mescc: Mes C Library: Prepare for M2-Planet: gettimeofday.
* lib/linux/gettimeofday.c (gettimeofday): Prepare for M2-Planet.
2020-07-25 19:54:28 +02:00
Jan (janneke) Nieuwenhuizen 40f46eeb04
mescc: Mes C Library: Prepare for M2-Planet: dup2.
* lib/linux/dup2.c (dup2): Prepare for M2-Planet.
2020-07-25 19:54:16 +02:00
Jan (janneke) Nieuwenhuizen 4c6c73468a
mescc: Mes C Library: Prepare for M2-Planet: dup.
* lib/linux/dup.c (dup): Prepare for M2-Planet.
2020-07-25 19:54:02 +02:00
Jan (janneke) Nieuwenhuizen 4cef964aba
mescc: Mes C Library: Prepare for M2-Planet: clock_gettime.
* lib/linux/clock_gettime.c (clock_gettime): Prepare for M2-Planet.
2020-07-25 19:53:48 +02:00
Jan (janneke) Nieuwenhuizen edb2e5c142
mescc: Mes C Library: Prepare for M2-Planet: chmod.
* lib/linux/chmod.c (chmod): Prepare for M2-Planet.
2020-07-25 19:53:37 +02:00
Jan (janneke) Nieuwenhuizen 1273e19587
mescc: Mes C Library: Prepare for M2-Planet: access.
* lib/linux/access.c (access): Prepare for M2-Planet.
2020-07-25 19:53:20 +02:00
Jan (janneke) Nieuwenhuizen 442cef4c12
mescc: Mes C Library: Prepare for M2-Planet: _getcwd.
* lib/linux/_getcwd.c (_getcwd): Prepare for M2-Planet.
2020-07-25 19:52:33 +02:00
Jan (janneke) Nieuwenhuizen 178b063ffa
core: Split-out stack.c
* src/lib.c (exit_, frame_printer, make_frame_type, make_frame,
make_stack_type, make_stack, stack_length, stack_ref_): Move to ..
* src/posix.c (exit_): Here and to ..
* src/core.c: New file.
* build-aux/configure-lib.sh (mes_SOURCES): Add it.
* simple.make (LIBMES_SOURCES): Likewise.
* build-aux/snarf.sh: Likewise.
* include/mes/builtins.h: Update.
* src/builtins.c (mes_builtins): Update.
2020-07-19 08:53:46 +02:00
Jan (janneke) Nieuwenhuizen 3ff1fcb809
core: Split-out core.c.
* src/mes.c (assoc_string, car, cdr, list, null_p, eq_p, values, acons,
length__, length, error, append2, append_reverse, reverse_x_, assq,
assoc): Move to ...
* src/core.c: New file.
* build-aux/configure-lib.sh (mes_SOURCES): Add it.
* simple.make (MES_SOURCES): Likewise.
* build-aux/snarf.sh: Likewise.
* include/mes/builtins.h: Update.
* src/builtins.c (mes_builtins): Update.
2020-07-19 08:49:23 +02:00
Jan (janneke) Nieuwenhuizen 8e8fa14f03
mescc: Mes C Library: Bugfix __ungetc_clear.
* lib/m2/mes_open.c (mes_open): Remove __ungetc_init ();
* lib/m2/open.c (open): Likewise.
2020-08-02 00:37:37 +02:00
Jan (janneke) Nieuwenhuizen fd130a03d1
kaem: scaffold/read.kaem.
* .gitignore: Update.
* include/linux/x86/syscall.h: Update for M2-Planet.
* lib/linux/brk.c (brk): Remove cast for M2-Planet.
* lib/linux/x86-mes-m2/syscall.c: New file.
* lib/m2/malloc.c: New file.
* lib/string/memset.c (memset): Update for M2-Planet.
* scaffold/read.c: Update for M2-Planet.
* scaffold/kaem.read: New file.
2020-07-15 22:27:57 +02:00
Jan (janneke) Nieuwenhuizen 488d3f6afa
kaem: scaffold/argv.kaem.
* scaffold/argv.c (strcmp): Remove.
(main): Update.
* scaffold/argv.kaem: New file.
lib/x86-mes/x86.M1 (mov____%edi,%ebp, mov____%esp,%edi): New macro.
2020-07-15 22:15:36 +02:00
Jan (janneke) Nieuwenhuizen e8b426ebce
kaem: scaffold/hello.kaem.
* include/m2/lib.h: New file.
* scaffold/hello.kaem: New file.
2020-07-15 21:12:12 +02:00
Jan (janneke) Nieuwenhuizen 6297f36d4a
kaem: scaffold/main.kaem.
* lib/linux/x86-mes-m2/crt1.c,
lib/linux/x86-mes-m2/crt1.M1,
lib/linux/x86-mes-m2/_exit.c,
lib/linux/x86-mes-m2/_write.c: New files.
* lib/m2/x86/x86_defs.M1: New file.  Import from stage0.
* lib/m2/x86/ELF-x86.hex2: New file.  Import from M2-Planet.
* scaffold/main.c: Update for M2-Planet.
* scaffold/main.kaem: New file.
* .gitignore: Update.
2020-07-15 19:25:16 +02:00
Jan (janneke) Nieuwenhuizen d7c4fae997
core: Prepare for M2-Planet: if (foo).
Rewrite C-constructs not supported by M2-Planet

    if (foo)              -> if (foo != 0)

* src/posix.c: Rewrite C-constructs not supported by M2-Planet.
(current_input_port): Likewise.
* src/display.c (display_helper): : Likewise.
* src/eval-apply.c (expand_variable_): : Likewise.
(eval_apply): : Likewise.
* src/mes.c (open_boot): : Likewise.
* src/reader.c (reader_read_identifier_or_number): : Likewise.
* src/symbols.c (init_symbol): : Likewise.
2020-07-18 08:53:42 +02:00
Jan (janneke) Nieuwenhuizen 89c3246dd1
core: Outline hashq_get_handle, hash_set_x_.
* src/hash.c (hashq_ref): Use hashq_get_handle.
(hashq_set_x_): Enable.
(hash_set_x): Use it.
2020-07-17 15:25:37 +02:00
Jan (janneke) Nieuwenhuizen a3038a694e
core: Prepare for M2-Planet: continue.
Rewrite C-constructs not supported by M2-Planet

    continue              -> goto LABEL

* src/eval-apply.c (eval_apply): Add label: begin_expand_while.  Use it
instead of continue.
2020-07-18 20:40:06 +02:00
Jan (janneke) Nieuwenhuizen dfe8d3c16c
core: Prepare for M2-Planet: VALUE/TYPE indirections.
Rewrite C-constructs not supported by M2-Planet

    VALUE (CAR (foo))           -> SCM a = CAR (foo); VALUE (a)
    TYPE (CAR (foo))            -> SCM t = CAR (foo); TYPE (a)

* src/builtins.c (builtin_function): Use VALUE indirections.
(builtin_printer): Likewise.
* src/eval-apply.c (apply_builtin): Likewise.
(get_macro): Likewise.
(expand_variable_): Likewise.
(eval_apply): Likewise.
* src/hash.c (hashq_get_handle): Likewise.
(hashq_ref): Likewise.
(hash_ref): Likewise.
(hash_set_x): Likewise.
(hash_table_printer): Likewise.
* src/math.c (greater_p): Likewise.
(less_p): Likewise.
(is_p): Likewise.
(minus): Likewise.
(plus): Likewise.
(divide): Likewise.
(multiply): Likewise.
(logand): Likewise.
(logior): Likewise.
(logxor): Likewise.
* src/posix.c (current_input_port): Likewise.
(set_current_output_port): Likewise.
* src/reader.c (reader_read_list): Likewise.
(reader_read_character): Likewise.
(reader_read_string): Likewise.
* src/string.c (list_to_cstring): Likewise.
(read_string): Likewise.
2020-07-17 14:30:01 +02:00
Jan (janneke) Nieuwenhuizen a54f6e9028
core: Prepare for M2-Planet: M2_CELL_SIZE.
* src/gc.c (M2_CELL_SIZE): Hack for missing pointer arithmetic in
M2-Planet.
(gc_init, alloc, make_cell, gc_up_arena, gc_copy, gc_loop, gc_): Use it.
2020-07-16 21:56:49 +02:00
Jan (janneke) Nieuwenhuizen a6c9002c32
core: Use unique assert_msg.
* src/mes.c (error): Use unique assert_msg.
2020-07-18 08:12:41 +02:00
Jan (janneke) Nieuwenhuizen adb145f4cc
core: read_string: Prepare for M2-Planet.
* src/string.c (read_string): Prepare for M2-Planet.
2020-07-16 21:44:40 +02:00
Jan (janneke) Nieuwenhuizen 80c84dc069
core: string_equal_p: Prepare for M2-Planet.
* src/string.c (string_equal_p): Prepare for M2-Planet.
2020-07-16 21:43:29 +02:00
Jan (janneke) Nieuwenhuizen 7e8c6585a0
core: reader_read_block_comment: Prepare for M2-Planet.
* src/reader.c (reader_read_block_comment): Prepare for M2-Planet.
2020-07-16 21:38:21 +02:00
Jan (janneke) Nieuwenhuizen bd816cf29b
core: reader_eat_whitespace: Prepare for M2-Planet.
* src/reader.c (reader_eat_whitespace): Prepare for M2-Planet.
2020-07-16 21:37:41 +02:00
Jan (janneke) Nieuwenhuizen 9cbf29b70a
core: reader_read_sexp_: Prepare for M2-Planet.
* src/reader.c (reader_read_sexp_): Prepare for M2-Planet.
2020-07-16 21:36:36 +02:00
Jan (janneke) Nieuwenhuizen a1eade98c6
core: reader_read_identifier_or_number: Prepare for M2-Planet.
* src/reader.c (reader_read_identifier_or_number): Prepare for M2-Planet.
2020-07-16 21:35:50 +02:00
Jan (janneke) Nieuwenhuizen 82213b960e
core: open_output_file: Prepare for M2-Planet.
* src/posix.c (open_output_file): Prepare for M2-Planet.
2020-07-16 21:32:39 +02:00
Jan (janneke) Nieuwenhuizen 285d04043f
core: current_input_port: Prepare for M2-Planet.
* src/posix.c (current_input_port): Prepare for M2-Planet.
2020-07-16 21:31:51 +02:00
Jan (janneke) Nieuwenhuizen 752c5f7d1b
core: write_byte: Prepare for M2-Planet.
* src/posix.c (write_byte): Prepare for M2-Planet.
2020-07-16 21:29:45 +02:00
Jan (janneke) Nieuwenhuizen 2f0796cfb5
core: read_char: Prepare for M2-Planet.
* src/posix.c (read_char): Prepare for M2-Planet.
2020-07-16 21:26:24 +02:00
Jan (janneke) Nieuwenhuizen 9c099977a0
core: last_pair: Prepare for M2-Planet.
* src/lib.c (last_pair): Prepare for M2-Planet.
2020-07-16 21:25:06 +02:00
Jan (janneke) Nieuwenhuizen c48b847bf7
core: memq: Prepare for M2-Planet.
* src/lib.c (memq): Prepare for M2-Planet.
2020-07-16 21:23:38 +02:00
Jan (janneke) Nieuwenhuizen 9ffe861eaf
core: xassq: Prepare for M2-Planet.
* src/lib.c (xassq): Prepare for M2-Planet.
2020-07-16 21:20:17 +02:00
Jan (janneke) Nieuwenhuizen 53e509ecf4
core: hash_cstring: Prepare for M2-Planet.
* src/hash.c (hash_cstring): Prepare for M2-Planet.
2020-07-16 21:19:06 +02:00
Jan (janneke) Nieuwenhuizen 5bae8803b2
core: eval_apply: Prepare for M2-Planet.
* src/eval-apply.c (eval_apply): Prepare for M2-Planet.
2020-07-16 21:10:27 +02:00
Jan (janneke) Nieuwenhuizen c2e80904ad
core: apply_builtin: Prepare for M2-Planet.
* src/eval-apply.c (apply_builtin): Prepare for M2-Planet.
2020-07-16 20:53:11 +02:00
Jan (janneke) Nieuwenhuizen 065b026bfc
core: formal_p: Prepare for M2-Planet.
* src/eval-apply.c (formal_p): Prepare for M2-Planet.
2020-07-16 19:39:34 +02:00
Jan (janneke) Nieuwenhuizen 7a2f85b34b
core: builtin_p: Prepare for M2-Planet.
* src/builtins.c (builtin_p): Prepare for M2-Planet.
2020-07-16 19:07:22 +02:00
Jan (janneke) Nieuwenhuizen 6f60795489
core: assoc: Prepare for M2-Planet.
* src/mes.c (assoc): Prepare for M2-Planet.
2020-07-16 19:02:44 +02:00
Jan (janneke) Nieuwenhuizen 673ca85c64
core: assq: Prepare for M2-Planet.
* src/mes.c (assq): Prepare for M2-Planet.
2020-07-16 19:01:43 +02:00
Jan (janneke) Nieuwenhuizen 4c83a3bc6b
core: eq_p: Prepare for M2-Planet.
* src/mes.c (eq_p): Prepare for M2-Planet.
2020-07-16 12:49:52 +02:00
Jan (janneke) Nieuwenhuizen 4297746e72
core: assoc_string: Prepare for M2-Planet.
src/mes.c (assoc_string): Prepare for M2-Planet.
2020-07-16 11:29:08 +02:00
Jan (janneke) Nieuwenhuizen 7cc2b1f2ec
build: Add pointer.sh.
* build-aux/pointer.sh: New script.
2020-07-14 08:13:47 +02:00
Jan (janneke) Nieuwenhuizen f9a372de13
core: Prepare for pointer cells.
* include/mes/cc.h: Prepare for pointer-based cells.
* include/mes/macros.h[POINTER_CELLS]: Alternative set of macros.
* include/mes/mes.h (struct scm)[POINTER_CELLS]: Alternative definition.
* src/gc.c (copy_cell, copy_news): New function.
* include/mes/mes.h: Declare them.
2020-07-14 15:57:49 +02:00
Jan (janneke) Nieuwenhuizen 52c57da02f
core: gc: FRAME_SIZE.
* src/gc.c (gc_loop, gc_): Use FRAME_SIZE.
2020-06-22 19:26:55 +02:00
Jan (janneke) Nieuwenhuizen c6670b46c3
core: gc: Fixes.
* src/gc.c (gc_init, gc_up_arena, gc_flip): Change to void function.
Fixes 0 returns.
(make_bytes): Use plain.
(make_string): Add 1 to length, for zero-terminated C strings.
(gc_copy): Use plain bytes length.
(gc_loop): Manually reformat.
2020-06-22 18:00:15 +02:00
Jan (janneke) Nieuwenhuizen 4613b070e4
core: Create symbols dynamically.
* include/mes/symbols.h: New file.
* include/mes/mes.hh: Include it.
* include/mes/constants.h: Remove symbol constants.
* src/symbols.c (init_symbols): Create symbols dynamically.
* build-aux/mes-snarf.scm (snarf-symbols): Update.
2020-06-16 15:59:26 +02:00
Jan (janneke) Nieuwenhuizen 94e40691ba
core: Remove CBYTES, CSTRING, NCBYTES macros.
* src/gc.c (cell_bytes, news_bytes): New function.
* include/mes/macros.h (CBYTES, CSTRING, NCBYTES): Remove.  Update
users.
* include/mes/m2.h: Likewise.
2020-05-19 08:55:41 +02:00
Jan (janneke) Nieuwenhuizen a25dff6837
core: Prepare for conversion to pointer cells.
* src/posix.c (execl_): Prepare for conversion to pointer cells.
2020-05-19 09:11:29 +02:00
Jan (janneke) Nieuwenhuizen 96809cadf1
core: Remove dead macros.
* include/mes/macros.h (CSTRING_STRUCT, START, LEN): Remove.
2020-05-19 08:49:55 +02:00
Jan (janneke) Nieuwenhuizen 781f4f0e6c
core: Remove macros from cell creation: make_char .. make_string.
* src/gc.c (make_char, make_continuation, make_macro, make_number,
make_ref, make_string0, make_string_port): New function.
(make_string): Move from string.c.
* include/mes/macros.h (MAKE_CHAR, MAKE_CONTINUATION, MAKE_MACRO,
MAKE_NUMBER, MAKE_REF, MAKE_STRING0, MAKE_STRING_PORT): Remove macro.
Update users.
* include/mes/m2.h: Likewise.
2020-05-18 22:35:12 +02:00
Jan (janneke) Nieuwenhuizen 0f951cac5d
core: Remove macros from cell creation: make_bytes.
* src/gc.c (bytes_cells, make_bytes): Move from string.c.
* include/mes/macros.h (MAKE_BYTES0, NAME_SYMBOL): Remove.
* include/mes/m2.h: Likewise.
2020-05-18 21:57:55 +02:00
Jan (janneke) Nieuwenhuizen 7932d4bad7
core: Remove core:make-cell.
* src/gc.c (alloc, make_cell, cons): Move from mes.c
* src/mes.c: (make_cell_): Remove.
* src/lib.c (char_to_integer, integer_to_char): New function.
* src/builtins.c (mes_builtins): Add them; remove make_cell_.
* mes/module/mes/type-0.mes (char->integer, integer->char): Remove.
2020-05-18 00:40:50 +02:00
Jan (janneke) Nieuwenhuizen e0da734c8b
core: Refactor display. 2020-05-17 23:53:27 +02:00
Jan (janneke) Nieuwenhuizen f746db72c5
core: Upcase register names.
* include/mes/mes.h (R0, R1, R2, R3, M0): Rename from lower case.
Update users.
2020-05-17 22:32:53 +02:00
Jan (janneke) Nieuwenhuizen cadf047530
core: Split-out symbol.c.
* src/mes.c (init_symbol, mes_symbols): Move to ..
* src/symbol.c: New file.
* build-aux/configure-lib.sh (mes_SOURCES): Add it.
* simple.make: Likewise.
* include/mes/mes.h: Declare init_symbols.
2020-05-17 20:50:12 +02:00
Jan (janneke) Nieuwenhuizen c8bfa1478d
core: Split-out display.c.
* src/lib.c (display_helper, display_, display_error_, display_port_,
write_, write_error_, write_port_, fdisplay_): Move to ..
* src/display.c: New file.
* build-aux/configure-lib.sh (mes_SOURCES): Add it.
* simple.make: Likewise.
2020-05-17 20:42:48 +02:00
Jan (janneke) Nieuwenhuizen efd9f75ce2
core: eval-apply: Fix formal_p.
* src/eval-apply.c (formal_p): Return boolean.
2020-05-31 15:03:10 +02:00
Jan (janneke) Nieuwenhuizen c4dd954216
core: Split-out eval-apply.c.
* src/mes.c (check_formals, check_apply, pairlis, set_car_x, set_cdr_x,
set_env_x, call_lambda, make_closure_, make_variable_, macro_get_handle,
get_macro, macro_set_x, push_cc, add_formals, formal_p,
expand_variable_, expand_variable, apply_builtin, eval_apply, apply):
Move to ..
* src/eval-apply.c: New file.
* build-aux/configure-lib.sh (mes_SOURCES): Add it.
* simple.make: Likewise.
* src/eval.c (assert_defined): Likewise.
2020-05-17 20:14:08 +02:00
Jan (janneke) Nieuwenhuizen dd01e28e68
build: Update mes-snarf.
* build-aux/snarf.sh: Support C-style annotations.
2020-05-18 12:10:50 +02:00
Jan (janneke) Nieuwenhuizen 2012304dc8
mescc: Mes C Library: Prepare for M2-Planet: setenv.
* lib/posix/setenv.c: Rewrite C-constructs not supported by M2-Planet.
2020-05-17 19:28:58 +02:00
Jan (janneke) Nieuwenhuizen cf7fc8ec2b
mescc: Mes C Library: Prepare for M2-Planet: getenv.
* lib/posix/getenv.c: Rewrite C-constructs not supported by M2-Planet.
2020-05-17 19:28:51 +02:00
Jan (janneke) Nieuwenhuizen d49ea35044
mescc: Mes C Library: Prepare for M2-Planet: ntoab.
* lib/mes/ntoab.c: Rewrite C-constructs not supported by M2-Planet.
2020-05-17 19:28:37 +02:00
Jan (janneke) Nieuwenhuizen 5dbae4a29b
mescc: Mes C Library: Prepare for M2-Planet: malloc.
* lib/stdlib/malloc.c: Rewrite C-constructs not supported by M2-Planet.
2020-05-17 19:29:09 +02:00
Jan (janneke) Nieuwenhuizen fac29c0e7b
mescc: Mes C Library: Prepare for M2-Planet: fdungetc.
* lib/mes/fdungetc.c: Rewrite C-constructs not supported by M2-Planet.
2020-05-17 19:28:28 +02:00
Jan (janneke) Nieuwenhuizen 04061cbba5
mescc: Mes C Library: Bugfix __ungetc_clear.
* lib/linux/_open3.c (_open3): Remove __ungetc_init ();
* lib/mes/mes_open.c (mes_open): Likewise.
* lib/mes/fdungetc.c (fdungetc): Likewise.
* lib/mes/fdgetc.c (__ungetc_p, __ungetc_clear, __ungetc_set): Call
__ungetc_init if buffer is uninitialized.
2020-06-07 00:31:26 +02:00
Jan (janneke) Nieuwenhuizen 189b9d9e8c
mescc: Mes C Library: Prepare for M2-Planet: fdgetc.
* lib/mes/fdgetc.c: Rewrite C-constructs not supported by M2-Planet.
2020-05-17 19:28:04 +02:00
Jan (janneke) Nieuwenhuizen 11d6a9679d
mescc: Mes C Library: Prepare for M2-Planet: abtol.
* lib/mes/abtol.c: Rewrite C-constructs not supported by M2-Planet.
2020-05-17 19:27:53 +02:00
Jan (janneke) Nieuwenhuizen 902ed2524a
mescc: Mes C Library: memcmp: bugfix.
* lib/string/memcmp.c (memcmp): Bugfix.
* lib/tests/string/50-memcmp.c: Test it.
* build-aux/check-mescc.sh (TESTS): Add it.
2020-06-06 22:37:30 +02:00
Jan (janneke) Nieuwenhuizen 8e74d025f2
mescc: Mes C Library: Prepare for M2-Planet: memcmp.
* lib/string/memcmp.c: Rewrite C-constructs not supported by M2-Planet.
2020-05-17 19:29:29 +02:00
Jan (janneke) Nieuwenhuizen 3b68e7de64
mescc: Mes C Library: Prepare for M2-Planet: memcpy.
* lib/string/memcpy.c: Rewrite C-constructs not supported by M2-Planet.
2020-05-17 19:29:36 +02:00
Jan (janneke) Nieuwenhuizen b20a388715
mescc: Mes C Library: Prepare for M2-Planet: memchr.
* lib/string/memchr.c: Rewrite C-constructs not supported by M2-Planet.
2020-05-17 19:29:18 +02:00
Jan (janneke) Nieuwenhuizen b4895d7495
mescc: Mes C Library: Prepare for M2-Planet: strncmp.
* lib/string/strncmp.c: Rewrite C-constructs not supported by M2-Planet.
2020-05-17 19:44:02 +02:00
Jan (janneke) Nieuwenhuizen 99e24cd99a
mescc: Mes C Library: Prepare for M2-Planet: strlen.
* lib/string/strlen.c: : Rewrite C-constructs not supported by M2-Planet.
2020-05-17 19:30:04 +02:00
Jan (janneke) Nieuwenhuizen 8194ecfc0f
mescc: Mes C Library: Prepare for M2-Planet: strcpy.
* lib/string/strcpy.c: Rewrite C-constructs not supported by M2-Planet.
2020-05-17 19:29:57 +02:00
Jan (janneke) Nieuwenhuizen c117abe06a
mescc: Mes C Library: Prepare for M2-Planet: strcmp.
* lib/string/strcmp.c: Rewrite C-constructs not supported by M2-Planet.
2020-05-17 19:29:44 +02:00
Jan (janneke) Nieuwenhuizen 0ca159041d
mescc: Mes C Library: Prepare for M2-Planet: __assert_fail.
Rewrite C-constructs not supported by M2-Planet, such as

    foo ? bar : baz;       -> if (foo) bar; else baz;
    static char foo[1024]  -> __func_buf = malloc (1024); ... char *foo = __func_buf;
    *foo                   -> foo[0]
    foo++                  -> foo = foo + 1   TODO: pointer arithmetic
    foo += 1;              -> foo = foo + 1
    for (int foo = ;       -> int foo; for (foo=
    if (foo)               -> if (foo != 0)
    if (!foo)              -> if (foo == 0)
    ;                      -> 0;

* lib/mes/__assert_fail.c: Rewrite C-constructs not supported by
M2-Planet.
2020-05-17 19:27:27 +02:00
Jan (janneke) Nieuwenhuizen 6a96134eba
core: Use assert_msg.
* src/mes.c: Use assert_msg instead of assert.
* src/gc.c: Likewise.
* src/hash.c: Likewise.
* src/lib.c: Likewise.
* src/math.c: Likewise.
* src/module.c: Likewise.
* src/posix.c: Likewise.
* src/reader.c: Likewise.
* src/string.c: Likewise.
* src/struct.c: Likewise.
* src/vector.c: Likewise.
* simple.make (LIB_SOURCES): Add lib/mes/assert_msg.c.
2020-05-17 16:07:04 +02:00
Jan (janneke) Nieuwenhuizen cf22ba44ce
mescc: Mes C Library: Add assert_msg.
* lib/mes/assert_msg.c: New file.
2020-04-19 15:57:06 +02:00
Jan (janneke) Nieuwenhuizen 60929bf40e
core: Prepare for M2-Planet: vector.c.
* src/vector.c: Rewrite C constructs not supported by M2-Planet.
2020-04-19 13:40:25 +02:00
Jan (janneke) Nieuwenhuizen 2440143579
core: Prepare for M2-Planet: struct.c.
* src/struct.c: Rewrite C constructs not supported by M2-Planet.
2020-04-19 13:39:12 +02:00
Jan (janneke) Nieuwenhuizen 038884ec62
core: Prepare for M2-Planet: string.c.
* src/string.c: Rewrite C constructs not supported by M2-Planet.
2020-04-20 19:47:18 +02:00
Jan (janneke) Nieuwenhuizen b65cb4861e
core: Prepare for M2-Planet: reader.c.
* src/reader.c: Rewrite C constructs not supported by M2-Planet.
2020-04-19 13:29:40 +02:00
Jan (janneke) Nieuwenhuizen 188d80ffc4
core: Prepare for M2-Planet: posix.c.
* src/posix.c: Rewrite C constructs not supported by M2-Planet.
2020-04-20 19:47:10 +02:00
Jan (janneke) Nieuwenhuizen 988217e232
core: Prepare for M2-Planet: module.c.
* src/module.c: Rewrite C constructs not supported by M2-Planet.
2020-04-20 19:47:04 +02:00
Jan (janneke) Nieuwenhuizen f3f24e4100
core: Prepare for M2-Planet: math.c.
* src/math.c: Rewrite C constructs not supported by M2-Planet.
2020-04-20 19:46:55 +02:00
Jan (janneke) Nieuwenhuizen 7bc1d0cf9f
core: Prepare for M2-Planet: lib.c.
* src/lib.c: Rewrite C constructs not supported by M2-Planet.
2020-04-19 13:25:32 +02:00
Jan (janneke) Nieuwenhuizen 7d82ad9a85
core: Prepare for M2-Planet: hash.c.
* src/hash.c: Rewrite C constructs not supported by M2-Planet.
2020-04-19 13:24:43 +02:00
Jan (janneke) Nieuwenhuizen 948c6ef91d
core: Prepare for M2-Planet: gc.c.
* src/gc.c: Rewrite C constructs not supported by M2-Planet.
2020-04-19 13:23:47 +02:00
Jan (janneke) Nieuwenhuizen 3b347433e6
core: Prepare for M2-Planet: builtins.c.
* src/builtins.c: Rewrite C constructs not supported by M2-Planet.
2020-04-19 13:21:58 +02:00
Jan (janneke) Nieuwenhuizen 19a4f9df0b
core: Prepare for M2-Planet: mes.c.
Rewrite C-constructs not supported by M2-Planet, such as

    foo ? bar : baz;       -> if (foo) bar; else baz;
    static char foo[1024]  -> __func_buf = malloc (1024); ... char *foo = __func_buf;
    *foo                   -> foo[0]
    foo++                  -> foo = foo + 1   TODO: pointer arithmetic
    foo += 1;              -> foo = foo + 1
    for (int foo = ;       -> int foo; for (foo=
    if (foo)               -> if (foo != 0)
    if (!foo)              -> if (foo == 0)
    ;                      -> 0;
    // ...                 -> /* ... */

* src/mes.c: Rewrite C constructs not supported by M2-Planet.
* include/mes/mes.h (__execl_c_argv, __getcwd_buf, __open_boot_buf,
__open_boot_file_name, __setenv_buf, __reader_read_char_buf): Declare
buffers.
(init): Initialize them.
* include/mes/macros.h(__M2_PLANET__): Temporary M2 macros.
2020-04-19 13:18:09 +02:00
Jan (janneke) Nieuwenhuizen 348e070bac
build: Run indent for M2.
* src/gc.c: Indented.
* src/string.c: Likewise.
2020-04-19 11:36:18 +02:00
Jan (janneke) Nieuwenhuizen 9cbbb2fc78
build: mes-snarf.scm: Resurrect.
* build-aux/mes-snarf.scm (snarf-functions): Strip whitespace from
parameter list.
(function->source): Use function-scm-name, add (function1_t).
* build-aux/snarf.sh: Resurrect, combined dump to s, h, c.
* include/mes/builtins.h:
2020-04-20 18:53:28 +02:00
Jan (janneke) Nieuwenhuizen 94143959af
core: Split-out builtins.c.
* src/mes.c make_builtin_type, make_builtin, builtin_name,
builtin_arity, builtin_function, builtin_p, builtin_printer,
init_builtin, mes_builtins): Move to ..
* src/builtins.c: New file.
* build-aux/configure-lib.sh (mes_SOURCES): Add it.
* build-aux/snarf.sh: Likewise.
* build-aux/build-mes.sh (mes_sources): Remove.  Include
configure-lib.sh
* include/mes/builtins.h: Remove constants.
* include/mes/mes.h: Add prototypes.
* include/mes/constants.h (cell_symbol_test): Rename from cell_test.
* simple.make: New file.
2020-04-19 10:49:48 +02:00
Jan (janneke) Nieuwenhuizen 3470e47561
build: simple.make.
* simple.make: New file.
* src/posix.c: Make sure to define EOF.
2020-04-22 08:05:37 +02:00
Jan (janneke) Nieuwenhuizen c308778ec7
tests: Add gc.test.
* tests/gc.test: New file.
* build-aux/check-mes.sh (TESTS): Add it.
* scaffold/gc-test.scm: Remove.
2020-04-25 16:39:43 +02:00
Jan (janneke) Nieuwenhuizen dd0e2fea8e
guix: mescc-tools: Update to 1.1.0.
* guix/git/mes.scm (mescc-tools)[source]: Update to 1.1.0.
[arguments]: Update sha256sum patch.
2020-12-29 11:58:24 +01:00
Jan (janneke) Nieuwenhuizen 7d8c3391aa
build: Depend on mescc-tools 1.0.0.
* configure (main): Check for hex2, M1, and blood-elf version 1.0.0.
2022-05-02 08:22:17 +02:00
Jan (janneke) Nieuwenhuizen c22c1a82d9
mescc: Update to mescc-tools-1.0.0 option names.
* module/mescc/mescc.scm (M1->hex2):  Update to use --little-endian.
(hex2->elf): Likewise, and --base-address.
* module/mescc/mescc.scm (hex2->elf): Likewise, and remove
--exec_enable.
2021-10-10 09:06:50 +02:00
Jan (janneke) Nieuwenhuizen dab3e3a751
build: Update to mescc-tools-1.0.0 option names.
* build-aux/build-scaffold.sh: Update to use --base-address and
--little-endian.
* doc/mes.texi (Regular Requirements): Bump mescc-tools to 1.0.1.
(Bootstrap Requirements): Likewise.  Bump nyacc to 1.00.2.
* INSTALL (Other GNU/Linux): Bump mescc-tools to 1.0.1.
(Prerequisites): Likewise.  bump nyacc to 1.00.2.
2021-10-10 09:06:40 +02:00
Jan (janneke) Nieuwenhuizen a168beb767
guix: mescc-tools: Update to 1.0.1.
* guix/git/mes.scm (mescc-tools)[source]: Update to 1.0.1.
2021-10-10 09:21:12 +02:00
Jan (janneke) Nieuwenhuizen 3539572f9c
Relicense imported LGPL v3+ files to GPL v3+.
Fixes https://savannah.nongnu.org/task/?16067.
Reported via savannah by Ineiev <ineiev@gnu.org>.

* mes/module/mes/lalr.scm,
module/mes/getopt-long.scm,
module/mes/optargs.scm: Change header to GNU Mes header with GPL v3.
2021-11-09 12:01:04 +01:00
Andrius Štikonas f553d84de2
doc: Migration to Libera Chat.
* BOOTSTRAP: Replace Freenode with Libera Chat.
* ROADMAP: Likewise.
* doc/mes.texi: Likewise.

Signed-off-by: Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
2021-06-14 20:05:19 +02:00
Vagrant Cascadian 35892ae074
configure: Add no-op for "disable-option-checking" option.
This is a standard option supported in autoconf.

In Debian systems using recent versions of debhelper this argument is be
passed to configure by default.  See <https://bugs.debian.org/942813>
for more information.

* configure (parse-opts): Ignore disable-option-checking.
2021-05-08 10:46:41 +02:00
W. J. van der Laan 191d822e95
mescc: Make -m64 work again.
* module/mescc/mescc.scm (arch-get-machine): Make that -m64 on the command
line, which sets machine to "64", returns "64" and not "32".
2021-05-07 07:55:25 +02:00
W. J. van der Laan be4514c4de
lib/tests: Pass int to va_arg instead of char.
* lib/tests/scaffold/70-stdarg.c (stdarg1, stdarg2, stdarg3): Pass int
to va_arg instead of char to avoid gcc trap "warning: 'char’ is promoted
to ‘int’ when passed through ‘...’ [enabled by default] (so you should
pass ‘int’ not ‘char’ to ‘va_arg’) if this code is reached, the program
will abort".
2021-05-02 16:56:29 +02:00
W. J. van der Laan d7b2e0ab9b
mes: Prevent out-of-bounds access for stack frame 0.
* src/lib.c (make_frame): Add a check to prevent reads outside of the
stack when trying to determine the procedure for stack frame 0.
2021-05-02 16:45:32 +02:00
W. J. van der Laan c480c7e602
mescc: Pass --64 to bloodelf for 64 bit machines.
* module/mescc/mescc.scm (M1->blood-elf): Pass --64 argument to bloodelf
for 64-bit machines.  This makes it able to generate the correct ELF
format.
2021-05-02 16:45:24 +02:00
Jan (janneke) Nieuwenhuizen 0a9c8f92cb
configure: Do not use GUILD_OPTIMIZE=-O1 for Guile-2.
This is a follow-up to

    a0560aff67
    configure: Use GUILD_OPTIMIZE=-O1 for Guile-3.

and fixes using Guile-2.0.x, which does not support -O1.

Reported by W. J. van der Laan <laanwj@protonmail.com>.

* configure (main): Check for Guile > 2.9.x to set optimization.
2021-05-02 16:43:41 +02:00
Jan (janneke) Nieuwenhuizen 6c1ff75c5a
mescc: Mes C Library: crt: Support more than 255 command line parameters.
Reported by Paul Dersey <pdersey@gmail.com>.

* lib/freebsd/x86-mes-gcc/crt1.c (_start): Use mov instead of movzbl for
argc.
* lib/linux/x86-mes-gcc/crt0.c (_start): Likewise.
* lib/linux/x86-mes-gcc/crt1.c (_start): Likewise.
* lib/freebsd/x86-mes-mescc/crt1.c (_start): Likewise.
* lib/linux/x86-mes-mescc/crt1.c (_start): Likewise.
2021-05-02 14:22:21 +02:00
Jan (janneke) Nieuwenhuizen dfa8e6e9d5
mescc: Mes C Library: malloc.c: Move unix-variant to lib/linux.
* lib/stdlib/malloc.c: Move to...
lib/linux/malloc.c: ...here.
* build-aux/configure-lib.sh (libc_SOURCES): Move malloc.c...
[linux]: ...here.
2021-05-02 13:13:13 +02:00
Jan (janneke) Nieuwenhuizen 3a5a7d1e56
mescc: Support --bootstrap build on ARM.
The ARM port added the `-marm' option to mescc, where previously only
-m32' (the default) and `-m64' were supported.

Reported by Vagrant Cascadian <vagrant@reproducible-builds.org>.

* module/mescc/mescc.scm (arch-get-machine): When machine is "arm",
return "32".
* build-aux/build-mes.sh (LIBS)[mescc]: Add -lmescc.
2021-05-01 16:10:49 +02:00
W. J. van der Laan ce80c24ae4
mes: Make logand work correctly.
* src/math.c (logand): Start from -1 instead of 0, so that the bitwise AND-ed
result is the intersection of bit sets instead of always 0.
* tests/math.test ("logand", "logand 3"): Test it.

Co-authored-by: Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
2021-04-21 08:31:37 +02:00
Jan (janneke) Nieuwenhuizen 2a31c8742d
doc: Post-release update.
* README: Update wording.
* doc/announce/ANNOUNCE-0.23: Likewise.  Add gen-announce checksums.
2021-03-14 12:22:40 +01:00
Jan (janneke) Nieuwenhuizen 918868e4fb
guix: mes: Update to 0.23.
* guix/git/mes.scm (mes)[source]: Update to 0.23.
2021-03-14 12:07:23 +01:00
Jan (janneke) Nieuwenhuizen ee9f407abb
build: Release 0.23.
* configure (VERSION): Bump to 0.23.
(main): Update mes requirement to 0.22.
* configure.sh (VERSION): Likewise.
2021-03-14 12:06:31 +01:00
Jan (janneke) Nieuwenhuizen 8135a7784f
doc: Fix broken link in 'README'.
Reported by Arkadiusz.Ryś <Arkadiusz.Rys@protonmail.com>.

* README: Fix m2-planet link.
2021-03-14 12:06:31 +01:00
Jan (janneke) Nieuwenhuizen a1196c87b5
doc: Release update.
* ROADMAP (release 0.x, unsorted): Rewrite, move done items ...
(DONE): ...here.
* build-aux/GNUmakefile.in: Update release process.
(gen-announce): Remove trailing '-'.
* NEWS (Changes in 0.23 since 0.22): Add section.
* README: Add armhf-linux, aarch64-linux, NLNet sponsoring, remove
confusing references to mes-m2 fork.
* doc/announce/ANNOUNCE-0.23: New file.
* mes/module/mes/repl.mes: Update copyright years.
* doc/mes.texi (Porting GNU Mes): Mention that armhf-linux is supported.
(Regular Requirements): Update.
* INSTALL (Other GNU/Linux): Likewise.
2021-03-14 12:06:31 +01:00
Danny Milosavljevic 2e9b02043b
libtcc1: Fix integer division, modulo and shifting procedures.
* lib/libtcc1.c (__divdi3): Make parameters integer.
(__moddi3): Make parameters integer.
(__udivdi3): Use unsigned division.
(__umoddi3): Use unsigned modulo.
(__lshrdi3): Add comment.
(__ashrdi3): Add comment.
2021-03-14 11:05:00 +01:00
Danny Milosavljevic 27b06c6ddb
mescc: Mes C Library: Make malloc align the blocks it gives out.
* include/stddef.h (max_align_t): Add typedef for max_align_t.
* lib/stdlib/malloc.c (malloc): Align the blocks it gives out to multiples
of max_align_t.
2021-01-23 08:43:48 +01:00
Jan (janneke) Nieuwenhuizen 87c3dca401
tests: Update to bin/mes for standalone run.
* tests/base.test,
tests/boot.test,
tests/macro.test,
tests/perform.test,
tests/quasiquote.test,
tests/read.test,
tests/scm.test,
tests/srfi-0.test: Default to bin/mes.
2021-01-23 08:43:48 +01:00
Jan (janneke) Nieuwenhuizen 323337a29a
mescc: Mes C Library: div.c: Use only for ARM.
* build-aux/configure-lib.sh (libmescc_SOURCES): Remove div.c unless
ARM.
2021-01-23 08:43:48 +01:00
Jan (janneke) Nieuwenhuizen 381e8bd6e0
mescc: Mes C Library: feof: Bugfix for ARM.
* lib/stdio/feof.c (feof): Use int to compare with EOF.
2021-01-23 08:43:47 +01:00
Jan (janneke) Nieuwenhuizen 7ab9cfe864
mescc: Mes C Library: time.c: Use #if defined.
This helps resurrect the mes-0.19-based bootstrap.

* lib/linux/time.c: Use #if defined () instead of plain #if for possibly
undefined macros.
2021-01-23 08:43:47 +01:00
Jan (janneke) Nieuwenhuizen 5bb568e455
mescc: Change --align to --align=functions, --align=globals.
This makes function alignment optional and disables function alignment
when using MesCC-Tools 0.5.2 (numbered architecture).

* module/mescc.scm (parse-opts): Make --align take a value.
* module/mescc/mescc.scm (mescc:compile, infos->hex2): Parse it and pass
it as renamed #:align keyword argument to ...
* module/mescc/M1.scm (infos->M1): ...here.  Rename parameter align? to
align, pass it to...
(info->M1): ...here.  Likewise.  Use it to make function alignment
optional.
2021-01-23 08:43:47 +01:00
Jan (janneke) Nieuwenhuizen 3115261f2f
libtcc1: Compile float stubs conditionally.
* lib/libtcc1.c (__floatundidf, __floatundixf, __fixunsxfdi, __fixxfdi,
__fixsfdi, __fixunsdfdi, __fixunsdfsi, __floatdisf,
__floatdidf)[!(HAVE_FLOAT_STUB || HAVE_FLOAT)]: Remove.
2021-01-23 08:43:47 +01:00
Jan (janneke) Nieuwenhuizen d9226ca678
libtcc1: Make float stubs weak.
* lib/libtcc1.c (__floatundidf, __floatundixf, __fixunsxfdi, __fixxfdi,
__fixsfdi, __fixunsdfdi, __fixunsdfsi, __floatdisf, __floatdidf): Add
__attribute__ ((weak)).
2021-01-23 08:43:47 +01:00
Jan (janneke) Nieuwenhuizen 1e102e1d46
mescc: Skip attributes on function definitions.
* module/mescc/preprocess.scm (ast-strip-attributes): New procedure.
(c99-input->ast): Use it.
2021-01-23 08:43:47 +01:00
Jan (janneke) Nieuwenhuizen 5eaf1c14ef
mescc: Mes C Library: Declare __mesabi_uldiv.
* include/mes/lib.h (__mesabi_uldiv): Add prototype.
2021-01-23 08:43:46 +01:00
Jan (janneke) Nieuwenhuizen b7dff2c2a4
mescc: Mes C Library: ARM: setjmp.c: Inline fake asm.
* lib/linux/arm-mes-gcc/_exit.c (longjmp, setjmp): Use inline fake asm.
2021-01-23 08:43:46 +01:00
Jan (janneke) Nieuwenhuizen 6703c33f96
mescc: Mes C Library: ARM: syscall.c: Inline fake asm.
* lib/linux/arm-mes-gcc/syscall.c (__sys_call, __sys_call1, __sys_call2,
__sys_call3, __sys_call4): Use inline fake asm.
2021-01-23 08:43:46 +01:00
Jan (janneke) Nieuwenhuizen e5ce69ec3f
mescc: Mes C Library: ARM: _write.c: Inline fake asm.
* lib/linux/arm-mes-gcc/_write.c (_write): Use inline fake asm.
2021-01-23 08:43:46 +01:00
Jan (janneke) Nieuwenhuizen 0667d1aa25
mescc: Mes C Library: ARM: _exit: Inline fake asm.
* lib/linux/arm-mes-gcc/_exit.c (_exit): Use inline fake asm.
2021-01-23 08:43:46 +01:00
Jan (janneke) Nieuwenhuizen 4e7a6057aa
mescc: Mes C Library: ARM: _start: Inline fake asm.
* lib/linux/arm-mes-gcc/crt1.c (_start): Use inline fake asm.
2021-01-23 08:43:46 +01:00
Jan (janneke) Nieuwenhuizen 9711ed70ec
tests: Add 70-or-argument.c.
* lib/tests/scaffold/70-or-argument.c: New file.
* build-aux/check-mescc.sh (tcc_tests): Add it.
2021-01-23 08:43:46 +01:00
Jan (janneke) Nieuwenhuizen b531c73590
tests: Add 70-function-modulo.c.
* lib/tests/scaffold/70-function-modulo.c: New file.
* build-aux/check-mescc.sh (tcc_tests): Add it.
2021-01-23 08:43:45 +01:00
Jan (janneke) Nieuwenhuizen 4b194d7bc7
tests: 70-strchr.c: Rewrite for TinyCC.
* lib/tests/string/70-strchr.c (main): Use char* hello for comparison.
Allows for duplication of "hello" string.
2021-01-23 08:43:45 +01:00
Jan (janneke) Nieuwenhuizen bdb1e2ec56
test: scaffold/54-argv.c: Support running with TinyCC.
This fixes running as lib/tests/scaffold/54-argv-i686-unknown-linux-gnu-tcc.

* lib/tests/scaffold/54-argv.c (main): Compare only first 26 characters
of argv[0].
2021-01-23 08:43:45 +01:00
Jan (janneke) Nieuwenhuizen 905277a73a
mescc: Mes C Library: Split _exit.c, _write.c from mini.c.
* lib/freebsd/x86-mes-gcc/mini.c: Split into...
* lib/freebsd/x86-mes-gcc/_exit.c: ...this, and...
* lib/freebsd/x86-mes-gcc/_write.c: ...this.
* lib/freebsd/x86-mes-mescc/mini.c: Slpit into...
* lib/freebsd/x86-mes-mescc/_exit.c: ...this, and...
* lib/freebsd/x86-mes-mescc/_write.c: ...this.
* lib/gnu/x86-mes-gcc/mini.c: Split into...
* lib/gnu/x86-mes-gcc/_exit.c: ...this, and...
* lib/gnu/x86-mes-gcc/_write.c: ...this.
* lib/linux/arm-mes-gcc/mini.c: Split into...
* lib/linux/arm-mes-gcc/_exit.c: ...this, and...
* lib/linux/arm-mes-gcc/_write.c: ...this.
* lib/linux/arm-mes-mescc/mini.c: Split into...
* lib/linux/arm-mes-mescc/_exit.c: ...this, and...
* lib/linux/arm-mes-mescc/_write.c: ...this.
* build-aux/configure-lib.sh (libc_mini_shared_SOURCES): Replace mini.c
with add _exit.c, _write.c.
* simple.sh: Update accordingly.
2021-01-23 08:43:45 +01:00
Danny Milosavljevic 096939b819
mescc: define int64_t and uint64_t only if it's possible to define them as
exactly 64 bits.

* include/stdint.h[__SIZEOF_LONG_LONG__ != 8]: Remove typedefs for int64_t,
uint16_t.
2021-01-23 08:43:45 +01:00
Jan (janneke) Nieuwenhuizen afc922d1e2
mescc: Add __SIZEOF defines for int, long, long long.
* module/mescc/mescc.scm (arch-get-define): Rename
to...  (arch-get-defines): ...this.  Return a list of defines: Also
adding __SIZEOF_INT__, __SIZEOF_LONG__, and add __SIZEOF_LONG_LONG__ if
it's >=8.
(mescc:preprocess, c->info): Update callers.
* include/stdint.h[!__SIZEOF_LONG_LONG__]: Remove typedefs for int64_t,
uint16_t.
2021-01-23 08:43:45 +01:00
Jan (janneke) Nieuwenhuizen 4f66055f3b
ARM: Add fake asm for setjmp.c.
* lib/arm-mes-gcc/setjmp.c (longjmp, setjmp)[__TINYC__]: Add fake asm.
2021-01-23 08:43:44 +01:00
Jan (janneke) Nieuwenhuizen e5573ec23c
ARM: Add fake asm for syscall.c.
* lib/linux/arm-mes-gcc/syscall.c (__sys_call, __sys_call1, __sys_call2,
__sys_call3, __sys_call4) [__TINYC__]: Add fake asm.
2021-01-23 08:43:44 +01:00
Jan (janneke) Nieuwenhuizen 40f270f3d7
ARM: Add fake asm for mini.c.
* lib/linux/arm-mes-gcc/mini.c (_exit, _write)[__TINYC__]: Add fake asm.
2021-01-23 08:43:44 +01:00
Jan (janneke) Nieuwenhuizen 420d422e34
ARM: Add fake asm for crt1.c.
* lib/linux/arm-mes-gcc/crt1.c (_start)[__TINYC__]: Use fake asm.
2021-01-23 08:43:44 +01:00
Jan (janneke) Nieuwenhuizen ed59c243a8
mescc: Mes C Library: Support ARM tcc: Add crti.c, crtn.c.
* lib/linux/arm-mes-gcc/crti.c: New file.
* lib/linux/arm-mes-gcc/crtn.c: New file.
2021-01-23 08:43:44 +01:00
Jan (janneke) Nieuwenhuizen 5951148255
ARM: libtcc1: Add div.c, __memcpy, __memmove, __memset.
* build-aux/configure-lib.sh (libtcc1_SOURCES)[arm]: Add div.c,
__memcpy, __memmove, __memset.
* build-aux/build-source-lib.sh: Generate libtcc1.
2021-01-23 08:43:44 +01:00
Jan (janneke) Nieuwenhuizen e82a53a40f
mescc: Mes C Library: Support ARM tcc: Add __memset.
* lib/string/__memset.c: New file.
* include/mes/lib.h (__memset): Add prototype.
2021-01-23 08:43:43 +01:00
Jan (janneke) Nieuwenhuizen 82a2388db2
mescc: Mes C Library: Support ARM tcc: Add __memmove.
* lib/string/__memmove.c: New file.
* include/mes/lib.h (__memmove): Add prototype.
2021-01-23 08:43:43 +01:00
Jan (janneke) Nieuwenhuizen bebb8dabfb
mescc: Mes C Library: Support ARM tcc: Add __memcpy.
* lib/string/__memcpy.c: New file.
* include/mes/lib.h (__memcpy): Add prototype.
2021-01-23 08:43:43 +01:00
Jan (janneke) Nieuwenhuizen 6a9e9838f0
mescc: Mes C Library: abort: Avoid __raise for TinyCC.
* lib/stdlib/abort.c: Use "raise" instead of __raise.
2021-01-23 08:43:43 +01:00
Jan (janneke) Nieuwenhuizen b6cadb876f
doc: Update 'AUTHORS'.
* AUTHORS: Add Natalie Kopaczewski.
2021-01-23 08:43:43 +01:00
Jan (janneke) Nieuwenhuizen 98965c8807
test: Split-off scaffold/60-math-itoa.c.
* lib/tests/scaffold/60-math.c (main): Move itoa tests to...
* lib/tests/scaffold/60-math-itoa.c: ...this new file.
* build-aux/check-mescc.sh (mes_tests): Add it.
2021-01-23 08:43:43 +01:00
Jan (janneke) Nieuwenhuizen af2353dd23
test: Split-off 36-compare-arithmetic-negative.c.
* lib/tests/scaffold/36-compare-arithmetic.c (main): Move negative
divisions to...
* lib/tests/scaffold/36-compare-arithmetic-negative.c: ...new file here.
* build-aux/check-mescc.sh (mes_tests): Add it.
2021-01-23 08:43:43 +01:00
Jan (janneke) Nieuwenhuizen cd6131bc21
test: ARM: 08-assign.c: Avoid assembly for tcc.
* lib/tests/scaffold/08-assign.c (main)[__arm__ && __TINYC__]: Avoid assembly.
2021-01-23 08:43:42 +01:00
Jan (janneke) Nieuwenhuizen 691d25699c
test: Split-off 50-strcmp-itoa.c
* lib/tests/string/50-strcmp.c (main): Move itoa tests to...
* lib/tests/string/50-strcmp-itoa.c: ...this new file.
* build-aux/check-mescc.sh (mes_tests): Add it.
2021-01-23 08:43:42 +01:00
Jan (janneke) Nieuwenhuizen 4a9d7a1f33
ARM: libtcc1: Add __divsi3, __modsi3, __udivsi3, __umodsi3.
* lib/libtcc1.c (__divsi3, __modsi3, __udivsi3, __umodsi3): New functions.
2021-01-23 08:43:42 +01:00
Jan (janneke) Nieuwenhuizen 04afe3e238
ARM: libtcc1: Add stubs __floatundidf, __fixunsdfdi, __fixunsdfsi.
* lib/libtcc1.c (__floatdisf, __floatdidf)[__arm__]: New stubs.
2021-01-23 08:43:42 +01:00
Jan (janneke) Nieuwenhuizen e07e731dfd
libtcc1: Add stubs __floatundidf, __fixunsdfdi, __fixunsdfsi.
* lib/libtcc1.c (__floatundidf, __fixunsdfdi, __fixunsdfsi): New stubs.
2021-01-23 08:43:42 +01:00
Jan (janneke) Nieuwenhuizen 8c53e22434
ARM: libtcc1: Add support for TinyCC.
* lib/libtcc1.c: (__udivdi3, __umoddi3, __lshrdi3, __ashldi3,
__fixunsxfdi)[__arm__ && __TINYC__]: Use __mesabi functions.
2021-01-23 08:43:42 +01:00
Jan (janneke) Nieuwenhuizen 553539ad75
libtcc1: Remove mesabi dependencies for TinyCC.
* lib/libtcc1.c (__divdi3, __moddi3, __udivdi3, __umoddi3, __lshrdi3,
__ashldi3, __ashrdi3, __floatundixf, __fixunsxfdi, __fixxfdi,
__fixsfdi)[__TINYC__]: No stub printing.
2021-01-23 08:43:41 +01:00
Jan (janneke) Nieuwenhuizen ddd8349827
mescc: Mes C Library: div: Avoid __raise for TinyCC.
* lib/mes/div.c (__raise)[__TINYC__]: New macro.
2021-01-23 08:43:41 +01:00
Jan (janneke) Nieuwenhuizen ede49daabb
mescc: Mes C Library: Add __mesabi_umod, __mesabi_udiv.
* lib/mes/div.c (__mesabi_umod, __mesabi_udiv): New functions.
* include/mes/lib.h: Add prototypes.
2021-01-23 08:43:41 +01:00
Danny Milosavljevic c1dcdc5d7e
ARM: Implement long division.
* lib/mes/div.c (__mesabi_log2i): New procedure.
(__mesabi_uldiv1): New procedure.
(__mesabi_uldiv): Use it.

Co-Authored-By: Nathalie Kopaczewski <natkopa@gmail.com>
2021-01-23 08:43:41 +01:00
Danny Milosavljevic a5f30ee27b
ARM: Special-case setjmp struct for gcc with mes libc.
* include/setjmp.h (__jmp_buf): Special-case setjmp struct for gcc with mes
libc.
2021-01-23 08:43:41 +01:00
Jan (janneke) Nieuwenhuizen 13b69f4b9b
tests: Add 70-ternary-arithmetic-argument.c.
* lib/tests/scaffold/70-ternary-arithmetic-argument.c: New file.
* build-aux/check-mescc.sh (tcc_tests, xfail_tests): Add it.
2021-01-23 08:43:41 +01:00
Danny Milosavljevic 10bcb3709b
ARM: Speed up __mesabi_uldiv for powers-of-two divisors.
* lib/mes/div.c (__mesabi_uldiv): Speed up division for powers-of-two
divisors.
2021-01-23 08:43:41 +01:00
Jan (janneke) Nieuwenhuizen bfd6792d07
ARM: Revert to 4 byte types only.
* module/mescc/armv4/info.scm (armv4:type-alist): Use size 4 for long
longs too.
2021-01-23 08:43:40 +01:00
Paul Dersey 4492173466
Mes C Library: stdlib/qsort.c: Fix qswap segfault.
* stdlib/qsort.c (qswap): Remove hard coded buffer size.  Allow
swapping of objects of arbitrary size.
2021-01-23 08:43:05 +01:00
Jan (janneke) Nieuwenhuizen d3a039949b
doc: Update to bug-mes@gnu.org.
* doc/mes.texi (Submitting Patches): Use bug-gnu instead of
guix-patches, guix-devel.
2021-01-23 08:42:26 +01:00
Jan (janneke) Nieuwenhuizen 49b4a0f144
build: Update guix package version too.
* guix/git/mes.scm (mes, mes.git)[version]: Mark fields.
* build-aux/GNUmakefile.in (update-hash): Update mes version too.
(release): Remove gen-announce, guix-build dependencies.
2021-01-23 08:41:38 +01:00
Jan (janneke) Nieuwenhuizen 3f70993dd2
mescc: Update -g help text.
* module/mescc.scm (parse-opts): Remove TODO, mention call stack.
2021-01-23 08:41:13 +01:00
Jan (janneke) Nieuwenhuizen 3aecca4bdc
bootstrap: Resurrect.
* build-aux/bootstrap.sh.in (AM_CFLAGS): Use -L ${srcdest}lib.
Build libmescc.a and use it to link mes.
2021-01-23 08:40:58 +01:00
Jan (janneke) Nieuwenhuizen 8b2c4d48a9
mescc: Make sure includedir, libdir are set.
* scripts/mescc.in (prefix): New variable.
2021-01-23 08:40:55 +01:00
Jan (janneke) Nieuwenhuizen 7198c2d7ea
build: Make mescc more verbose on V=2, V=3.
* build-aux/cflags.sh (AM_CFLAGS): Add -v, -v -v for V=2, V=3
respectively.
2021-01-23 08:40:35 +01:00
207 changed files with 4084 additions and 2633 deletions

View File

@ -1,5 +1,5 @@
;;; GNU Mes --- Maxwell Equations of Software
;;; Copyright © 2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
;;; Copyright © 2018,2019,2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
;;;
;;; This file is part of GNU Mes.
;;;
@ -35,6 +35,14 @@
.
((geiser-active-implementations . (guile))
;; Guile syntax
(eval . (put 'pass-if 'scheme-indent-function 1))
(eval . (put 'pass-if-not 'scheme-indent-function 1))
(eval . (put 'pass-if-eq 'scheme-indent-function 2))
(eval . (put 'pass-if-equal 'scheme-indent-function 2))
(eval . (put 'expect-fail 'scheme-indent-function 2))
(eval . (put 'pass-if-timeout 'scheme-indent-function 2))
;; Guix package
(eval . (put 'package 'scheme-indent-function 0))
(eval . (put 'origin 'scheme-indent-function 0))
@ -50,6 +58,7 @@
(eval
.
(progn
(defun prefix-dir-locals-dir (elt)
(concat (locate-dominating-file buffer-file-name ".dir-locals.el") elt))

19
.gitignore vendored
View File

@ -1,3 +1,21 @@
# GNU Mes --- Maxwell Equations of Software
# Copyright © 2016,2017,2019,2020,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
#
# This file is part of GNU Mes.
#
# GNU Mes 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 3 of the License, or (at
# your option) any later version.
#
# GNU Mes 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 GNU Mes. If not, see <http://www.gnu.org/licenses/>.
*-
*~
.#*
@ -117,6 +135,7 @@
/doc/images/gcc-mesboot-graph.pdf
/doc/web/
/config.sh
/include/arch
/include/mes/config.h
/gcc-lib
/mescc-lib

12
AUTHORS
View File

@ -13,6 +13,8 @@ Additions and fixes throughout
Jeremiah Orians <jeremiah@pdp10.guru>
lib/stdio/fopen.c (first simple version of fopen)
scaffold/tests/98-fopen.c
Initial work on elf headers:
lib/linux/x86-mes/elf32-header.hex2 and similar
Han-Wen Nienhuys <hanwen@xs4all.nl>
lib/string/memmem.c (_memmem, memmem)
@ -32,6 +34,9 @@ Nathalie Kopaczewski <natkopa@gmail.com>
Fast long devision
lib/div.c (__mesabi_log2i)
W. J. van der Laan <laanwj@protonmail.com>
Bugfixes for logand, 64bit build, and va_arg
List of imported files
D A Gwyn
@ -56,9 +61,6 @@ module/mes/getopt-long.scm
Optargs from Guile
mes/module/mes/optargs.scm
PEG from Guile
mes/module/mes/peg/
Pmatch from Guile
mes/module/system/base/pmatch.scm
@ -84,6 +86,10 @@ lib/mach/msg.c
lib/mach/mach-init.c
lib/mach/*.S
M2-Planet dependencies
lib/m2/x86/x86_defs.M1
lib/m2/x86/ELF-x86.hex2
* legalese
Copyright © 2016,2017,2018,2019,2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>

View File

@ -160,5 +160,5 @@ be source.
* Contact
** bug-mes@gnu.org
** #bootstrappable, #guix on freenode
** #bootstrappable, #guix on libera.chat
** bootstrappable.org

View File

@ -1,7 +1,7 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
@ -645,7 +645,7 @@ the "copyright" line and a pointer to where the full notice is found.
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, see <http://www.gnu.org/licenses/>.
along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
@ -664,11 +664,11 @@ might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
<https://www.gnu.org/licenses/>.
The GNU 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 Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
<https://www.gnu.org/licenses/why-not-lgpl.html>.

56
HACKING
View File

@ -2,10 +2,11 @@
#+TITLE: Hacking GNU Mes
* SETUP
guix environment -l guix.scm #64 bit + 32bit
guix shell #64 bit + 32bit
CC=i686-unknown-linux-gnu-gcc ./configure
CC=arm-unknown-linux-gnu-gcc ./configure
CC=arm-unknown-linux-gnueabihf-gcc ./configure
or
./configure
@ -49,6 +50,23 @@ Configure to compile with Tiny CC
- bytes read
6) globals
* TESTING
** make check recheck=true TESTS="tests/base lib/tests/scaffold/t.c"
** mescc
*** To skip MES tests, in "./check.sh", comment-out check-boot.sh, check-mes.sh.
*** Running individual tests
#+BEGIN_SRC bash
cd gcc-lib
V=2 CC=i686-unknown-linux-gnu-gcc ../pre-inst-env test-c.sh ../lib/tests/scaffold/t.c
#+END_SRC
#+BEGIN_SRC bash
cd mescc-lib
V=2 CC=mescc ../pre-inst-env test-c.sh ../lib/tests/scaffold/t.c
#+END_SRC
* Bugs
** mes: performance, Mes is now 2-10x slower than Guile.
** mes/mescc lack support for fork/exec on the Hurd.
@ -112,30 +130,30 @@ x/s *((char **)($rsp+8))
** C parser/compiler
*** [[https://savannah.gnu.org/projects/nyacc][nyacc]]
*** PEG: [[http://piumarta.com/software/peg/][parse C using PEG]]
*** PEG: [[https://piumarta.com/software/peg/][parse C using PEG]]
*** [[https://en.wikipedia.org/wiki/Tiny_C_Compiler][Tiny C Compiler]]
*** [[http://www.t3x.org/subc/index.html][Sub C]]
*** [[https://www.t3x.org/subc/index.html][Sub C]]
*** [[https://groups.google.com/forum/#!topic/comp.lang.lisp/VPuX0VsjTTE][C intepreter in LISP/Scheme/Python]]
** C assembler/linker
*** [[http://www.tldp.org/HOWTO/Assembly-HOWTO/linux.html][Assembly HOWTO]]
*** [[https://www.tldp.org/HOWTO/Assembly-HOWTO/linux.html][Assembly HOWTO]]
*** ELF
7f 45 4c 46
*** [[http://www.muppetlabs.com/~breadbox/software/tiny/][Small ELF programs]]
*** [[http://www.cirosantilli.com/elf-hello-world/][Elf hello world]]
*** [[https://www.muppetlabs.com/~breadbox/software/tiny/][Small ELF programs]]
*** [[https://www.cirosantilli.com/elf-hello-world/][Elf hello world]]
** SC - c as s-expressions
sc: http://sph.mn/content/3d3
sc: https://sph.mn/content/3d3
** RNRS
*** [[http://www.scheme-reports.org/][Scheme Reports]]
*** [[https://www.scheme-reports.org/][Scheme Reports]]
*** [[ftp://publications.ai.mit.edu/ai-publications/pdf/AIM-349.pdf][Scheme - Report on Scheme]]
*** [[ftp://publications.ai.mit.edu/ai-publications/pdf/AIM-452.pdf][RRS - Revised Report on Scheme]]
** tiny schemes
http://forum.osdev.org/viewtopic.php?f=15&t=19937
https://forum.osdev.org/viewtopic.php?f=15&t=19937
http://www.stripedgazelle.org/joey/dreamos.html
http://armpit.sourceforge.net/
http://common-lisp.net/project/movitz/movitz.html
https://www.stripedgazelle.org/joey/dreamos.html
https://armpit.sourceforge.net/
https://common-lisp.net/project/movitz/movitz.html
<civodul> janneke: https://github.com/namin/inc looks interesting [15:18]
** Orians Jeremiah
@ -152,13 +170,13 @@ http://common-lisp.net/project/movitz/movitz.html
<janneke> OriansJ: i looked a few times and saw 'LISP empty', so thanks for
the pointer! [00:24]
<civodul> OriansJ, janneke: from that page, there's also:
https://web.archive.org/web/20160604035203fw_/http://homepage.ntlworld.com/edmund.grimley-evans/bcompiler.html
https://web.archive.org/web/20160604035203fw_/https://homepage.ntlworld.com/edmund.grimley-evans/bcompiler.html
** C4/C500
https://web.archive.org/web/20160604041431/http://homepage.ntlworld.com/edmund.grimley-evans/cc500/cc500.c
https://web.archive.org/web/20160604041431/https://homepage.ntlworld.com/edmund.grimley-evans/cc500/cc500.c
https://github.com/rswier/c4/blob/master/c4.c
** Compilers for free
http://codon.com/compilers-for-free
https://codon.com/compilers-for-free
** Small lisps
*** [[https://www.mirrorservice.org/sites/www.bitsavers.org/bits/TI/Explorer/zeta-c/][ZETA-C]]
** Small C compilers
@ -170,10 +188,10 @@ simple as possible.
*** pcc
*** early GCC?
https://miyuki.github.io/2017/10/04/gcc-archaeology-1.html
*** [[http://tack.sourceforge.net/][ack]]
*** [[https://tack.sourceforge.net/][ack]]
<rain1> it may be possible to compile like this: mes |> ack |> pcc |> tcc |>
gcc 4.7.4 |> gcc later version... up to modern
*** [[https://web.archive.org/web/20160402225843/http://homepage.ntlworld.com/edmund.grimley-evans/cc500/][cc500]]
*** [[https://web.archive.org/web/20160402225843/https://homepage.ntlworld.com/edmund.grimley-evans/cc500/][cc500]]
** rain1's Bootstrapping Wiki: https://bootstrapping.miraheze.org/wiki/Main_Page
** rain1's hex86
https://notabug.org/rain1/hex86/src/master/tests/hex0b3.hex86
@ -184,7 +202,7 @@ https://notabug.org/rain1/hex86/src/master/tests/hex0b3.hex86
** linux syscalls: https://fedora.juszkiewicz.com.pl/syscalls.html
* legalese
Copyright © 2016,2017,2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
Copyright © 2016,2017,2018,2019,2021,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
Copying and distribution of this file, with or without modification,
are permitted in any medium without royalty provided the copyright

26
INSTALL
View File

@ -1,7 +1,7 @@
-*- org -*-
#+TITLE: Building and Installing GNU Mes
Copyright © 2016,2017,2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
Copyright © 2016,2017,2018,2019,2021,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
Copying and distribution of this file, with or without modification,
are permitted in any medium without royalty provided the copyright
@ -20,19 +20,20 @@ similar way.
** Prerequisites
*** Guix
#+BEGIN_SRC bash
guix environment -l guix.scm #64 bit + 32bit
guix environment --system=i686-linux -l guix.scm #32 bit only
guix shell #64 bit + 32bit
guix shell --system=i686-linux #32 bit only
guix shell --system=armhf-linux #32 bit only
#+END_SRC
*** Other GNU/Linux
- [[https://savannah.gnu.org/projects/mescc-tools/][mescc-tools]], 0.6.1 is known to work.
- [[https://savannah.gnu.org/projects/nyacc][Nyacc]], 0.93.0 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.
- [[https://savannah.gnu.org/projects/mescc-tools/][mescc-tools]], 1.4.0 is known to work.
- [[https://github.com/oriansj/m2-planet][M2-Planet]] (optional), 1.9.0 is known to work.
- [[https://savannah.gnu.org/projects/nyacc][Nyacc]], 1.00.2 is known to work.
- GNU Gcc, 7.5.0 is known to work.
- GNU Guile, version 3.0.4 is know to work.
- SH, /bin/sh, GNU Bash 5.0.16 is known to work.
- GNU coreutils
- sed, GNU sed 4.2 is known to work.
- Perl, 5.22 is known to work.
- sed, GNU sed 4.8 is known to work.
** Build it
@ -78,8 +79,9 @@ The bootstrap build is part of Guix, see
https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/packages/commencement.scm
** Prerequisites
- [[https://savannah.gnu.org/projects/mescc-tools/][mescc-tools]], 0.6.1 is known to work.
- [[https://savannah.gnu.org/projects/nyacc][Nyacc]], 0.93.0 is known to work.
- [[https://savannah.gnu.org/projects/mescc-tools/][mescc-tools]], 1.4.0 is known to work.
- [[https://github.com/oriansj/m2-planet][M2-Planet]], 1.9.0 is known to work.
- [[https://savannah.gnu.org/projects/nyacc][Nyacc]], 1.00.2 is known to work.
** Build it

74
NEWS
View File

@ -2,7 +2,7 @@
#+TITLE: GNU Mes NEWS history of user-visible changes
#+STARTUP: content hidestars
Copyright © 2016,2017,2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
Copyright © 2016,2017,2018,2019,2021,2022,2023 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
Copying and distribution of this file, with or without modification,
are permitted in any medium without royalty provided the copyright
@ -10,6 +10,78 @@ Copyright © 2016,2017,2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
Please send Mes bug reports to bug-mes@gnu.org.
* Changes in 0.24.2 since 0.24.1
** Build
*** A number of compile warnings have been fixed.
*** The `simple.make' and `simple.sh' builds have been resurrected.
** MesCC
*** Some assembly defines were added for building TinyCC for x86_64.
*** `__assert_fail' has been updated to use the standard signature.
** Noteworthy bug fixes
*** A bootstrap build without M2-Planet is now supported again.
*** `gettimeofday' no longer segfaults in the M2-Planet build.
*** `stat64' and friends are now used on 32bit platforms.
This fixes https://debbugs.gnu.org/41264, and should also fix
https://debbugs.gnu.org/49985,
https://debbugs.gnu.org/53415,
https://debbugs.gnu.org/53416.
*** The Mes C Library now supports uppercase hex conversions.
* Changes in 0.24.1 since 0.24
** Build
*** Support M2-Planet bootstrap for ARM.
** MesCC
*** The Mes C Library now supports bootstrapping ARM.
** Noteworthy bug fixes
*** The definition of S_ISUID was fixed.
*** Unsigned modulo has been fixed for ARM.
*** A bug with abtol has been fixed.
*** Workarounds for building with gcc-12.2.0 have been added.
* Changes in 0.24 since 0.23
** Core
*** Mes and Mes C Library can now be built with M2-Planet.
*** Mes now supports the --bootstrap build on ARM.
** MesCC
*** MesCC now supports the integer suffixes:
Next to `U', also support `ULL', `UL', `L', and `LL'.
** Noteworthy bug fixes
*** MesCC now uses the unsigned type for sizeof.
*** MesCC now only uses signed division if numerator is signed.
*** The Mes C library now supports an argv bigger than 255.
*** Development build support with Guile-2 was resurrected.
*** The logand procedure now works correctly.
*** The 64bit build was resurrected.
* Changes in 0.23.1 since 0.23
** Build: Move to libera.chat.
** Core
*** Mes and Mes C Library can now support ARM bootstrap.
** MesCC
*** MesCC now supports ARM bootstrap.
** Noteworthy bug fixes
*** Stack frame 0 does not perform out of bounds access.
*** MesCC's -m64 works again.
*** Guile-2 support has been resurrected.
*** logand has been fixed.
*** Mes C Library now supports more than 255 command line parameters.
* Changes in 0.23 since 0.22
** Core
*** Mes and Mes C Library can now be built with GCC 10.x.
** MesCC
*** The Mes C Library now supports an armhf-linux bootstrap.
*** MesCC now supports ARM.
*** mini.c library was split into _exit.c, and _write.c.
*** When building with GCC, -lgcc is now used.
*** MesCC now has it's own support library libmescc.a (-lmescc).
*** MesCC now requires mescc-tools-0.7.0 or later for ARM.
*** MesCC can be now built with nyacc-1.00.2:
note that nyacc-1.03.0 is not (backwards) compatible.
*** MesCC can be built with Guile 3.0.x:
See https://bugs.gnu.org/43831; use guild compile -O1 with Guile 3.0.x.
*** MesCC now raises SIGABRT on abort, if supported.
** Noteworthy bug fixes
*** unreadchar on EOF is now a no-op.
*** malloc now aligns the blocks it gives out to max_align_t.
* Changes in 0.22 since 0.21
** Core
*** Mes now builds reproducibly with MesCC, cross distribution

View File

@ -22,7 +22,7 @@ to your config.scm and run guix system reconfigure.
For example (note: ARM is no longer a 'port', see HACKING)
#+BEGIN_SRC bash
guix environment -s armhf-linux --pure --ad-hoc bash coreutils diffutils findutils gawk gcc-toolchain@7 grep git guile@2.2 gzip help2man make mescc-tools nyacc openssh-sans-x pkg-config sed tar texinfo
guix shell --system=armhf-linux --pure bash coreutils diffutils findutils gawk gcc-toolchain grep git guile gzip help2man make mescc-tools nyacc openssh-sans-x pkg-config sed tar texinfo
#+END_SRC
** Try it
@ -75,7 +75,7 @@ a Reduced Binary seed, thus significantly reducing the Trusted Computing
Base (TCB), strategic decisions about the build process can start.
* Legalese
Copyright © 2019 Jan (janneke) Nieuwenhuizen <[[mailto:janneke@gnu.org][janneke@gnu.org]]>
Copyright © 2019,2022 Jan (janneke) Nieuwenhuizen <[[mailto:janneke@gnu.org][janneke@gnu.org]]>
Copying and distribution of this file, with or without modification,
are permitted in any medium without royalty provided the copyright

24
README
View File

@ -6,29 +6,32 @@
[[https://www.gnu.org/software/mes][GNU Mes]] is a Scheme interpreter and C compiler for bootstrapping the GNU
System. Since version 0.22 it has again helped to halve the size of
opaque, uninspectable binary seeds that are currently being used in the
[[https://guix.gnu.org/blog/2019/guix-reduces-bootstrap-seed-by-50/][Reduced Binary Seed bootstrap]] of [[https://www.gnu.org/software/guix][GNU Guix]]. The final goal is to help
create a full source bootstrap as part of the [[http://bootstrappable.org][bootstrappable builds]]
[[https://guix.gnu.org/blog/2020/guix-further-reduces-bootstrap-seed-to-25][Further Reduced Binary Seed bootstrap]] of [[https://www.gnu.org/software/guix][GNU Guix]]. The final goal is to
help create a full-source bootstrap as part of the [[https://bootstrappable.org][bootstrappable builds]]
effort for UNIX-like operating systems.
The Scheme interpreter is written in ~5,000 LOC of simple C, and the C
compiler written in Scheme and these are mutual self-hosting. Mes can
now be bootstrapped by [[https://github.com/oriansj/m2-planet][M2-Planet]] and [[https://savannah.nongnu.org/projects/mescc-tools][Mescc-Tools]].
now be bootstrapped from [[https://github.com/oriansj/m2-planet][M2-Planet]] and [[https://savannah.nongnu.org/projects/mescc-tools][Mescc-Tools]].
Mes has a Garbage Collector, a library of loadable Scheme modules--
notably Dominique Boucher's [[https://github.com/schemeway/lalr-scm][LALR]], Pre-R6RS [[https://www.cs.indiana.edu/chezscheme/syntax-case/old-psyntax.html][portable syntax-case]] with
R7RS ellipsis, Matt Wette's [[https://www.nongnu.org/nyacc][Nyacc]] --and test suite, just enough to
support a REPL and a C99 compiler: mescc.
Mes+MesCC can compile an only [[http://gitlab.com/janneke/tinycc][lightly patched TinyCC]] that is
Mes + MesCC + Mes C Library can build a [[https://gitlab.com/janneke/tinycc][bootstrappable 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-2.95.3. This is enough to bootstrap Guix for
i686-linux and x86_64-linux.
i686-linux, x86_64-linux, armhf-linux and aarch64-linux.
Mes is inspired by The Maxwell Equations of Software: [[http://www.softwarepreservation.org/projects/LISP/book/LISP%201.5%20Programmers%20Manual.pdf][LISP-1.5]] -- John
Mes is inspired by The Maxwell Equations of Software: [[https://www.softwarepreservation.org/projects/LISP/book/LISP%201.5%20Programmers%20Manual.pdf][LISP-1.5]] -- John
McCarthy page 13, GNU Guix's source/binary packaging transparency and
Jeremiah Orians's [[https://github.com/oriansj/stage0][stage0]] ~500 byte self-hosting hex assembler.
We are very grateful to NLNet for sponsoring the [[https://nlnet.nl/project/GNUMes][Reduced Binary Seed
bootstrap]], the [[https://nlnet.nl/project/GNUMes-arm][ARM port]], and the [[https://nlnet.nl/project/GNUMes-ARM_RISC-V][Full Source Bootstrap.]]
GNU Mes is free software, it is distributed under the terms of the GNU
General Public Licence version 3 or later. See the file [[file:COPYING][COPYING]].
@ -64,7 +67,7 @@ General Public Licence version 3 or later. See the file [[file:COPYING][COPYING
* Links
[0] https://www.gnu.org/software/mes
[1] https://guix.gnu.org/blog/2019/guix-reduces-bootstrap-seed-by-50/
[1] https://guix.gnu.org/blog/2020/guix-further-reduces-bootstrap-seed-to-25
[2] https://www.gnu.org/software/guix
[3] https://bootstrappable.org
[4] https://github.com/oriansj/m2-planet
@ -73,11 +76,14 @@ General Public Licence version 3 or later. See the file [[file:COPYING][COPYING
[7] https://www.cs.indiana.edu/chezscheme/syntax-case/old-psyntax.html
[8] https://www.nongnu.org/nyacc
[9] https://gitlab.com/janneke/tinycc
[10] [[http://www.softwarepreservation.org/projects/LISP/book/LISP%201.5%20Programmers%20Manual.pdf]]
[10] [[https://www.softwarepreservation.org/projects/LISP/book/LISP%201.5%20Programmers%20Manual.pdf]]
[11] https://savannah.nongnu.org/projects/stage0
[12] https://nlnet.nl/project/GNUMes
[13] https://nlnet.nl/project/GNUMes-arm
[14] https://nlnet.nl/project/GNUMes-ARM_RISC-V
* Legalese
Copyright © 2016,2017,2018,2019 Jan (janneke) Nieuwenhuizen <[[mailto:janneke@gnu.org][janneke@gnu.org]]>
Copyright © 2016,2017,2018,2019,2020,2021,2022 Jan (janneke) Nieuwenhuizen <[[mailto:janneke@gnu.org][janneke@gnu.org]]>
Copying and distribution of this file, with or without modification,
are permitted in any medium without royalty provided the copyright

53
ROADMAP
View File

@ -1,7 +1,7 @@
-*- org -*-
#+TITLE: Tentative GNU Mes Road Map
Copyright © 2016,2017,2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
Copyright © 2016,2017,2018,2019,2020,2022,2023 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
Copying and distribution of this file, with or without modification,
are permitted in any medium without royalty provided the copyright
@ -19,27 +19,29 @@ Since its inception, the project has gone a long way towards that goal. Below
is a list of items we want for version "1.0" of GNU Mes.
You're welcome to discuss this road map on bug-mes@gnu.org or #bootstrappable
on Freenode!
on Libera Chat!
* TODO
** release 0.x, unsorted
- Merge the Scheme-only bootstrap which uses Gash and Gash Core
Utilities to remove from bootstrap-binary seed : Awk, Bash, Core
Utilities, Grep, Gzip, Sed, Tar.
- Introduce the Reduced Binaries Seed bootstrap to NixOS (Debian,
Arch, Gentoo, ...?)
- Full Source Bootstrap: compile mes.c using M2-Planet. Jeremiah
branched-out from mes; see https://github.com/oriansj/mes-m2, also see the
branches: wip-full-source-bootstrap, wip-m2-merge and wip-m2.
- Full Guile-compatible module support: define-module, define-public,
export, use-modules, ...
- ARMv7/AArch64 support: Mes C Library and MesCC.
- Simplify eval-apply and other core functionality (see mes-m2).
- Full Guile module support.
- Run Gash and Gash-Utils on Mes.
- Remove Guile as a dependency for the Guix Full Source Bootstrap.
- Integrate Full Source bootstrap for ARM on GNU Guix;
see branch wip-aarch64-bootstrap.
- Integrate Reduced Binary Seed bootstrap for ARM on GNU Guix;
see branch wip-arm-bootstrap.
- Introduce the Reduced Binary Seed bootstrap to NixOS (Debian,
Arch, Gentoo, ...?).
- Full Guile-compatible module support; see branch wip-module.
- RISC-V support: Mes C Library and MesCC.
- AArch64 support: Mes C Library and MesCC.
- Simplify eval-apply and other core functionality
+ See https://github.com/oriansj/mes-m2 fork/rewrite of mes.
- Support native x86_64 bootstrap.
- Simplify MesCC ``MesCC should optimize ease of convincing us of its
correctness''
- tcc: remove or upstream patches from tcc-boot.
- tcc: build 0.9.27 directly instead of via 0.9.26, see tinycc
correctness''.
- Switch to Autotools for development build (bootstrap builds use
kaem.run and bootstrap.sh); see branch wip-auto.
** after release 1.0
- Build Guix packages using Mes: run or simplify (guix build utils),
(guix build gnu-build-system).
@ -48,9 +50,12 @@ on Freenode!
- Bootstrap support for the Hurd. Most needed now are fork and exec.
- Replace the initial gcc-2.95.3 with gcc-4.6.4.
- FreeBSD, *BSD?
wip-bootstrappable@0.9.27 branch
- Skip tcc: Build gcc using MesCC.
- better garbage collector.
- Tiny CC:
+ remove or upstream patches from tcc-boot,
+ build 0.9.27 directly instead of via 0.9.26; see tinycc branch
wip-bootstrappable@0.9.27
- Skip Tiny CC: Build gcc using MesCC.
- Better garbage collector.
- mes/mescc: proper docstrings, api reference documentation.
- mes/mescc: bootstrap a minimal Guile?
+ libguile/{eval,init,list,strings,values,..}.
@ -61,6 +66,14 @@ on Freenode!
https://srfi.schemers.org/srfi-72/srfi-72.html, or
+ ... drop it?
* DONE
- 0.24: Full Source Bootstrap:
+ integrate into GNU Guix; see branch wip-full-source-bootstrap.
- 0.23 Full Source Bootstrap:
+ compile mes.c using M2-Planet; see branch wip-m2,
- GNU Mes now supports building Tiny CC on ARM.
- Merge the Scheme-only bootstrap which uses Gash and Gash Core
Utilities to remove from bootstrap-binary seed : Awk, Bash, Core
Utilities, Grep, Gzip, Sed, Tar.
- 0.22 GNU Mes now builds reproducibly cross-platform, runs on the
Hurd and has better support for other distributions and kernels.
- 0.21 GNU Mes now supports a Scheme-only bootstrap and is packaged in

View File

@ -1,5 +1,5 @@
# GNU Mes --- Maxwell Equations of Software
# Copyright © 2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
# Copyright © 2018,2019,2021,2022,2023 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
#
# This file is part of GNU Mes.
#
@ -85,17 +85,26 @@ PHONY_TARGETS:=\
.PHONY: $(PHONY_TARGETS)
X86_ARCH_HEADERS = $(wildcard $(scrdest)include/linux/x86/*.h)
ARCH_HEADERS = $(X86_ARCH_HEADERS:$(srcdest)include/linux/x86/%=include/arch/%)
default: all
all: doc
doc: build
build:
build: | $(ARCH_HEADERS)
$(SHELL) build.sh
src/${program_prefix}mes: build
include/arch/%.h: $(srcdest)include/$(mes_kernel)/$(mes_cpu)/%.h | arch-dir
cp -f $< $@
arch-dir:
mkdir -p include/arch
clean:
rm -f *.o *.s bin/mes bin/mes-gcc bin/mes-mescc
rm -f mes.{aux,cp,cps,fn,info,log,tmp,toc,vr,vrs}
@ -261,6 +270,16 @@ WEB_IMAGES:=\
web: info $(WEB_IMAGES)
GENDOCS_TEMPLATE_DIR=doc build-aux/gendocs.sh -I doc -s ${srcdest}doc/mes.texi -o doc/web/manual --email bug-mes@gnu.org mes "GNU Mes manual"
SITE = /srv/mes.org
publish: web
rsync -P -v . $(SITE)/
rsync -P -v . $(SITE)/manual/
rsync -P -rvz doc/web/manual/ $(SITE)/manual/
LOCAL_SITE = $(HOME)/src/web/mes
publish-local: web
$(MAKE) publish SITE=$(LOCAL_SITE)
### dist
COMMIT=$(shell test -e ${srcdest}.git && (cd ${srcdir} && git describe --dirty 2>/dev/null) || cat ${srcdest}.tarball-version)
TARBALL_VERSION=$(COMMIT:v%=%)
@ -282,7 +301,10 @@ GIT_LS_FILES:=find
MTIME:=0
endif
dist: $(TARBALL)
check-signature:
git show HEAD --show-signature |grep 'gpg: Good signature'
dist: check-signature $(TARBALL)
sign-dist: $(TARBALL)
gpg -a --output $(TARBALL).sig --detach-sig $(TARBALL)
@ -310,8 +332,10 @@ $(TARBALL): .tarball-version | generate-ChangeLog
ifdef GUIX
update-hash: $(TARBALL)
$(GUIX) download file://$(PWD)/$<
sed -i -e 's,(base32 #!mes!# "[^"]*"),(base32 #!mes!# "$(shell $(GUIX) hash $<)"),' guix/git/mes.scm
sed -i \
-e 's,version #!mes!# "[^"]*"),version #!mes!# "$(VERSION)"),' \
-e 's,(base32 #!mes!# "[^"]*"),(base32 #!mes!# "$(shell $(GUIX) hash $<)"),' \
guix/git/mes.scm
else
$(warning update-hash: no guix)
endif
@ -321,35 +345,72 @@ tag:
# Release process
# 0. Prepare git, see history:
# - doc: Release update
# + NEWS, etc.
# + doc/announce/ANNOUNCE-0.22, using xxx for checksums
# - Release 0.22
# 1. make tag VERSION=0.22
# 2. make sign-dist
# 3. make release
# - Update doc/announce/ANNOUNCE-0.22
# - doc: Release update (NEWS, etc.)
# - Generate announcement
# + touch mes-0.23.tar.gz
# + make gen-announce VERSION=0.23
# + Update and commit doc/announce/ANNOUNCE-0.23,
# using xxx (32,40) for checksums
# - create "Release 0.23" commit (see Release 0.22).
# + configure
# + configure.sh
# 1. Tag for release
# make tag VERSION=0.23
# 2. Create signed tarball
# ./configure
# make sign-dist
# 3. Update Guix package description
# make release
# 4. Finish announcement
# - make sum-announce
# - doc: Post-release update.
# 4. verify bootstrap
# - build-aux/GNUMakefile.in: gen-announce: update previous-version
# 5. Verify
# - Update package in Guix master.
# - If applicable, verify bootstrap.
# 6. Upload to ftp.gnu.org
# 7. Update web
# - make publish-local
# - Update ~/src/web/mes/index.html
# - Upload: cvs ci
# 8. Create blog post
# cp doc/announce/ANNOUNCE-0.23 ~/src/web/joyofsource.com/posts/announce-0.23.md
# fix urls and all
# 9. Send mail
# To: info-gnu@gnu.org
# Cc: bug-mes@gnu.org
# Cc: guix-devel@gnu.org
# Cc: bootstrappable@freelists.org
# Cc: rb-general@lists.reproducible-builds.org
guix-build:
./pre-inst-env $(GUIX) build mes@$(VERSION) --with-source=$(TARBALL)
release: update-hash | gen-announce guix-build
release: check-signature update-hash
git commit -m 'guix: mes: Update to $(VERSION).' \
-m '* guix/git/mes.scm (mes)[source]: Update to $(VERSION).' \
guix/git/mes.scm
GPG_KEY_ID:=1A858392E331EAFDB8C27FFBF3C1A0D9C1D65273
GEN_ANNOUNCE=$(GNULIB)/build-aux/announce-gen
GNULIB=../../gnulib
gen-announce:
$(GEN_ANNOUNCE)\
--release-type=beta\
--package-name=mes\
--previous-version='0.21 '\
--current-version=$(VERSION)\
--gpg-key-id=$(GPG_KEY_ID)\
--url-directory=https://ftp.gnu.org/gnu/mes\
--news=NEWS\
> doc/announce/ANNOUNCE-$(VERSION)-
$(GEN_ANNOUNCE) \
--release-type=beta \
--package-name=mes \
--previous-version='0.24.1' \
--current-version=$(VERSION) \
--gpg-key-id=$(GPG_KEY_ID) \
--url-directory=https://ftp.gnu.org/gnu/mes \
--news=NEWS \
> doc/announce/ANNOUNCE-$(VERSION)
sum-announce:
sed -i \
-e "s, xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx $(PACKAGE)-$(VERSION).tar.gz, $(shell sha256sum $(PACKAGE)-$(VERSION).tar.gz)," \
-e "s, xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx $(PACKAGE)-$(VERSION).tar.gz, $(shell sha1sum $(PACKAGE)-$(VERSION).tar.gz)," \
-e "s, xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx $(PACKAGE)-$(VERSION).tar.gz, $(shell md5sum $(PACKAGE)-$(VERSION).tar.gz)," \
doc/announce/ANNOUNCE-$(VERSION)
installdirs: mkinstalldirs
mkdir -p\

View File

@ -50,7 +50,7 @@ srcdest=../${srcdest}
ln -sf ${srcdest}mes .
ln -sf ${srcdest}module .
ln -sf ${srcdest}src .
AM_CPPFLAGS="-D HAVE_CONFIG_H=1 -I ${srcdest}include -I ${srcdest}include/$mes_kernel/$mes_cpu"
AM_CPPFLAGS="-D HAVE_CONFIG_H=1 -I ${srcdest}include -I ../include -I include"
AM_CFLAGS="-L ${srcdest}lib"
mkdir -p $mes_cpu-mes
@ -108,7 +108,7 @@ $AR crD $mes_cpu-mes/libc+tcc.a $objects
cd ..
srcdest=
CPPFLAGS="-D HAVE_CONFIG_H=1 -I ${srcdest}include -I ${srcdest}include/$mes_kernel/$mes_cpu"
AM_CPPFLAGS="-D HAVE_CONFIG_H=1 -I ${srcdest}include -I ../include -I include"
AM_CFLAGS="-L ${srcdest}lib"
objects=

View File

@ -64,16 +64,6 @@ if test -e libc+tcc.s; then
cp libc+tcc.s $mes_cpu-mes
fi
if $courageous; then
exit 0
fi
archive libc+gnu.a $libc_gnu_SOURCES
cp libc+gnu.a $mes_cpu-mes
if test -e libc+gnu.s; then
cp libc+gnu.s $mes_cpu-mes
fi
archive libtcc1.a $libtcc1_SOURCES
cp libtcc1.a $mes_cpu-mes
if test -e libtcc1.s; then
@ -85,3 +75,13 @@ cp libgetopt.a $mes_cpu-mes
if test -e libgetopt.s; then
cp libgetopt.s $mes_cpu-mes
fi
if $courageous; then
exit 0
fi
archive libc+gnu.a $libc_gnu_SOURCES
cp libc+gnu.a $mes_cpu-mes
if test -e libc+gnu.s; then
cp libc+gnu.s $mes_cpu-mes
fi

View File

@ -1,7 +1,7 @@
#! /bin/sh
# GNU Mes --- Maxwell Equations of Software
# Copyright © 2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
# Copyright © 2019,2021 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
#
# This file is part of GNU Mes.
#
@ -47,5 +47,8 @@ then
# See <https://www.openwall.com/lists/musl/2018/05/09/1>.
LIBS="${LIBS} -lgcc -lc"
fi
if [ "$compiler" = "mescc" ]; then
LIBS="${LIBS} -lc -lmescc"
fi
link bin/mes-$compiler
cp bin/mes-$compiler bin/mes

View File

@ -1,7 +1,7 @@
#! /bin/sh
# GNU Mes --- Maxwell Equations of Software
# Copyright © 2017,2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
# Copyright © 2017,2018,2019,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
#
# This file is part of GNU Mes.
#
@ -29,6 +29,7 @@ fi
. ./config.sh
. ${srcdest}build-aux/trace.sh
. ${srcdest}build-aux/cflags.sh
if $courageous; then
set +e
@ -42,25 +43,6 @@ else
}
fi
case "$mes_cpu" in
arm)
stage0_arch=40
stage0_cpu=armv7l
;;
x86_64)
stage0_arch=2
stage0_cpu=amd64
;;
x86)
stage0_arch=1
stage0_cpu=x86
;;
*)
stage0_arch=1
stage0_cpu=$mes_cpu
;;
esac
trace "CCLD ${srcdest}lib/$mes_kernel/$mes_cpu-mes-$compiler/exit-42.S" $CC\
-nostdlib\
-g\
@ -79,12 +61,11 @@ else
fi
trace "HEX2 ${srcdest}lib/$mes_kernel/$mes_cpu-mes/elf$mes_bits-0exit-42.hex2" $HEX2\
--LittleEndian\
--little-endian\
$stage0_cpu_flag\
--BaseAddress 0x1000000\
--base-address 0x1000000\
-f ${srcdest}lib/$mes_kernel/$mes_cpu-mes/elf$mes_bits-0header.hex2\
-f ${srcdest}lib/$mes_kernel/$mes_cpu-mes/elf$mes_bits-0exit-42.hex2\
--exec_enable\
-o 0exit-42
trace "TEST 0exit-42"
@ -93,13 +74,12 @@ trace "TEST 0exit-42"
[ $r = 42 ]
trace "HEX2 ${srcdest}lib/$mes_kernel/$mes_cpu-mes/elf$mes_bits-body-exit-42.hex2" $HEX2\
--LittleEndian\
--little-endian\
$stage0_cpu_flag\
--BaseAddress 0x1000000\
--base-address 0x1000000\
-f ${srcdest}lib/$mes_kernel/$mes_cpu-mes/elf$mes_bits-header.hex2\
-f ${srcdest}lib/$mes_kernel/$mes_cpu-mes/elf$mes_bits-body-exit-42.hex2\
-f ${srcdest}lib/$mes_kernel/$mes_cpu-mes/elf$mes_bits-footer-single-main.hex2\
--exec_enable\
-o body-exit-42
trace "TEST body-exit-42"
@ -120,12 +100,11 @@ trace "TEST hello-mes"
[ $r = 0 ]
trace "HEX2 ${srcdest}lib/$mes_kernel/$mes_cpu-mes/elf$mes_bits-0hello-mes.hex2" $HEX2\
--LittleEndian\
--little-endian\
$stage0_cpu_flag\
--BaseAddress 0x1000000\
--base-address 0x1000000\
-f ${srcdest}lib/$mes_kernel/$mes_cpu-mes/elf$mes_bits-0header.hex2\
-f ${srcdest}lib/$mes_kernel/$mes_cpu-mes/elf$mes_bits-0hello-mes.hex2\
--exec_enable\
-o 0hello-mes
trace "TEST 0hello-mes"
@ -134,13 +113,12 @@ trace "TEST 0hello-mes"
[ $r = 0 ]
trace "HEX2 ${srcdest}lib/$mes_kernel/$mes_cpu-mes/elf$mes_bits-body-hello-mes.hex2" $HEX2\
--LittleEndian\
--little-endian\
$stage0_cpu_flag\
--BaseAddress 0x1000000\
--base-address 0x1000000\
-f ${srcdest}lib/$mes_kernel/$mes_cpu-mes/elf$mes_bits-header.hex2\
-f ${srcdest}lib/$mes_kernel/$mes_cpu-mes/elf$mes_bits-body-hello-mes.hex2\
-f ${srcdest}lib/$mes_kernel/$mes_cpu-mes/elf$mes_bits-footer-single-main.hex2\
--exec_enable\
-o body-hello-mes
trace "TEST body-hello-mes"

View File

@ -1,7 +1,7 @@
#! /bin/sh
# GNU Mes --- Maxwell Equations of Software
# Copyright © 2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
# Copyright © 2018,2019,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
#
# This file is part of GNU Mes.
#
@ -66,9 +66,8 @@ fi
AM_CPPFLAGS="
-D HAVE_CONFIG_H=1
-I ${srcdest}lib
-I include
-I ${srcdest}include
-I ${srcdest}include/$mes_kernel/$mes_cpu
-I ../include
"
if test $mes_kernel = gnu; then
AM_CPPFLAGS="$AM_CPPFLAGS
@ -93,16 +92,17 @@ fi
AM_CPPFLAGS="
-D HAVE_CONFIG_H=1
-I ${srcdest}lib
-I include
-I ${srcdest}include
-I ${srcdest}include/$mes_kernel/$mes_cpu
-I ../include
-I include
"
if test "$compiler" != bootstrap; then
${SHELL} ${srcdest}build-aux/build-mes.sh
fi
)
if test -n "$M2_PLANET"; then
if test -n "$M2_PLANET" && (test "$mes_cpu" == "x86" \
|| test "$mes_cpu" == "arm"); then
(
. ${srcdest}build-aux/trace.sh
if [ -z "$V" -o "$V" = 0 ]; then
@ -136,9 +136,9 @@ fi
AM_CPPFLAGS="
-D HAVE_CONFIG_H=1
-I ${srcdest}lib
-I include
-I ${srcdest}include
-I ${srcdest}include/$mes_kernel/$mes_cpu
-I ../include
-I include
"
compiler=mescc
AR=${MESAR-"${srcdest}pre-inst-env mesar"}
@ -150,6 +150,7 @@ fi
${SHELL} ${srcdest}build-aux/build-lib.sh
${SHELL} ${srcdest}build-aux/build-source-lib.sh
if $bootstrap; then
rm -f globals.* # FIXME: avoid name clash with globals from lib
${SHELL} ${srcdest}build-aux/build-mes.sh
cp -f bin/mes-mescc ../bin
cp -f bin/mes ../bin

View File

@ -1,5 +1,5 @@
# GNU Mes --- Maxwell Equations of Software
# Copyright © 2018,2019,2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
# Copyright © 2018,2019,2020,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
#
# This file is part of GNU Mes.
#
@ -16,6 +16,25 @@
# You should have received a copy of the GNU General Public License
# along with GNU Mes. If not, see <http://www.gnu.org/licenses/>.
case "$mes_cpu" in
arm)
stage0_arch=40
stage0_cpu=armv7l
;;
x86_64)
stage0_arch=2
stage0_cpu=amd64
;;
x86)
stage0_arch=1
stage0_cpu=x86
;;
*)
stage0_arch=1
stage0_cpu=$mes_cpu
;;
esac
AM_CPPFLAGS="
-D HAVE_CONFIG_H=1
-I ${srcdest}include

View File

@ -1,7 +1,7 @@
#! /bin/sh
# GNU Mes --- Maxwell Equations of Software
# Copyright © 2017,2018,2019,2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
# Copyright © 2017,2018,2019,2020,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
#
# This file is part of GNU Mes.
#
@ -117,6 +117,7 @@ lib/tests/scaffold/54-argv.c
lib/tests/scaffold/55-char-array.c
lib/tests/scaffold/60-math.c
lib/tests/scaffold/60-math-itoa.c
lib/tests/scaffold/60-math-modulo.c
lib/tests/scaffold/61-array.c
lib/tests/scaffold/62-array.c
lib/tests/scaffold/63-struct.c

View File

@ -101,8 +101,10 @@ export V
export colors
export compiler
export courageous
export mes_cpu
export srcdest
export srcdir
export stage0_cpu
export GUILE_AUTO_COMPILE
export MES_PREFIX
export TESTS

View File

@ -1,7 +1,7 @@
#! /bin/sh
# GNU Mes --- Maxwell Equations of Software
# Copyright © 2019, 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
# Copyright © 2019,2020,2021 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
#
# This file is part of GNU Mes.
#
@ -107,6 +107,7 @@ lib/mes/ntoab.c
lib/mes/oputc.c
lib/mes/ultoa.c
lib/mes/utoa.c
lib/stub/__raise.c
"
if test $mes_libc = mes; then
@ -157,7 +158,6 @@ lib/stdio/putc.c
lib/stdio/putchar.c
lib/stdio/ungetc.c
lib/stdlib/free.c
lib/stdlib/malloc.c
lib/stdlib/realloc.c
lib/string/memchr.c
lib/string/memcmp.c
@ -189,7 +189,7 @@ lib/stub/execve.c
lib/stub/fork.c
lib/stub/_getcwd.c
lib/stub/gettimeofday.c
lib/stub/ioctl.c
lib/stub/ioctl3.c
lib/stub/time.c
lib/stub/unlink.c
lib/stub/waitpid.c
@ -209,8 +209,9 @@ lib/linux/fork.c
lib/linux/fsync.c
lib/linux/_getcwd.c
lib/linux/gettimeofday.c
lib/linux/ioctl.c
lib/linux/ioctl3.c
lib/linux/_open3.c
lib/linux/malloc.c
lib/linux/_read.c
lib/linux/time.c
lib/linux/unlink.c
@ -413,6 +414,7 @@ lib/linux/getgid.c
lib/linux/getppid.c
lib/linux/getrusage.c
lib/linux/getuid.c
lib/linux/ioctl.c
lib/linux/link.c
lib/linux/lstat.c
lib/linux/mkdir.c
@ -437,6 +439,7 @@ src/core.c
src/display.c
src/eval-apply.c
src/gc.c
src/globals.c
src/hash.c
src/lib.c
src/math.c

View File

@ -50,6 +50,7 @@ export mes_cpu
export mes_bits
export mes_libc
export mes_kernel
export stage0_cpu
ifdef V
export V

View File

@ -1,7 +1,7 @@
#! @SHELL@
# GNU Mes --- Maxwell Equations of Software
# Copyright © 2017,2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
# Copyright © 2017,2018,2019,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
#
# This file is part of GNU Mes.
#
@ -99,6 +99,7 @@ mkdir -p $DESTDIR$includedir
mkdir -p $DESTDIR$libdir
mkdir -p $DESTDIR$pkgdatadir
tar -cf- -C ${srcdir}/include . | tar -${v}xf- -C $DESTDIR$includedir
tar -cf- -C include . | tar -${v}xf- -C $DESTDIR$includedir
tar -cf- -C ${srcdir}/lib $mes_cpu-mes | tar -${v}xf- -C $DESTDIR$libdir
tar -cf- -C ${srcdir}/lib $mes_kernel/$mes_cpu-mes | tar -${v}xf- -C $DESTDIR$libdir
if test -z "$srcdest"; then

43
configure vendored
View File

@ -4,7 +4,8 @@ MES_ARENA=100000000 exec ${SCHEME-guile} -L . --no-auto-compile -e '(configure)'
!#
;;; GNU Mes --- Maxwell Equations of Software
;;; Copyright © 2016,2017,2018,2019,2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
;;; Copyright © 2016,2017,2018,2019,2020,2021,2022,2023 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
;;; Copyright © 2020 Vagrant Cascadian <vagrant@reproducible-builds.org>
;;;
;;; configure: This file is part of GNU Mes.
;;;
@ -36,7 +37,7 @@ MES_ARENA=100000000 exec ${SCHEME-guile} -L . --no-auto-compile -e '(configure)'
(define PACKAGE "mes")
(define PACKAGE-NAME "GNU Mes")
(define PACKAGE-BUGREPORT "bug-mes@gnu.org")
(define VERSION "0.22")
(define VERSION "0.24.2")
(cond-expand
(guile)
@ -321,14 +322,14 @@ MES_ARENA=100000000 exec ${SCHEME-guile} -L . --no-auto-compile -e '(configure)'
(enable-silent-rules)
(with-system-libc)
(enable-fast-install) ; Ignored for Guix
(mandir (value #t)) ; Ignored for Debian
(localstatedir (value #t)) ; Ignored for Debian
(libexecdir (value #t)) ; Ignored for Debian
(runstatedir (value #t)) ; Ignored for Debian
(disable-maintainer-mode) ; Ignored for Debian
(enable-fast-install) ; Ignored for Guix
(disable-dependency-tracking) ; Ignored for Debian
)))
(disable-maintainer-mode) ; Ignored for Debian
(disable-option-checking) ; Ignored for Debian
(libexecdir (value #t)) ; Ignored for Debian
(localstatedir (value #t)) ; Ignored for Debian
(mandir (value #t)) ; Ignored for Debian
(runstatedir (value #t))))) ; Ignored for Debian
(getopt-long args option-spec)))
@ -453,14 +454,14 @@ Some influential environment variables:
(deps (fold (lambda (program results)
(cons (check-program-version program) results))
'()
(list (make-dep "kaem" #:version '(0 6) #:optional? #t)
(make-dep "M2-Planet" #:version '(0 1 3) #:optional? #t)
(make-dep "hex2")
(make-dep "M1")
(make-dep "blood-elf")
(list (make-dep "hex2" #:version '(1 4 0))
(make-dep "M1" #:version '(1 4 0))
(make-dep "blood-elf" #:version '(2 0 0))
(make-dep "kaem" #:version '(1 0 0) #:optional? #t)
(make-dep "M2-Planet" #:version '(1 9 0) #:optional? #t)
(make-dep "diff" #:optional? #t)
(make-dep "guile" #:version '(2 0) #:commands '("guile-3.0" "guile-3" "guile-2.2" "guile-2.0" "guile-2" "guile") #:optional? #t)
(make-dep "mes" #:version '(0 20) #:optional? #t)
(make-dep "mes" #:version '(0 22) #:optional? #t)
(make-dep "guix" #:version '() #:optional? #t)
(make-dep "ar" #:version '(2 10) #:optional? #t)
(make-dep "sh" #:optional? #t)
@ -481,7 +482,7 @@ Some influential environment variables:
(guile (file-name "guile" deps))
;; See https://bugs.gnu.org/43831; use -O1 with Guile-3
(guild-optimize (let ((guile-version (and=> (find-dep "guile" deps) dependency-version-found)))
(and guile-version (tuple< '(2) guile-version) "-O1")))
(and guile-version (tuple< '(2 9) guile-version) "-O1")))
(deps (if guile (cons (check-program-version (make-dep "nyacc" #:version '(0 99 0) #:commands (list (string-append guile " -c '(use-modules (nyacc lalr)) (display *nyacc-version*)'")) #:file-name #t #:version-option #f))
deps)
deps))
@ -493,6 +494,7 @@ Some influential environment variables:
(file-name "cc" deps)
(file-name "cc-v" deps)
(file-name "mescc" deps)))
(m2-planet (file-name "M2-Planet" deps))
(deps (if cc
(cons* (check-header-c cc (make-dep "limits.h"))
(check-header-c cc (make-dep "stdio.h" #:optional? #t))
@ -628,7 +630,7 @@ See \"Porting GNU Mes\" in the manual, or try --with-courage\n" mes-system)
("@AR@" . ,(or (file-name "ar" deps) ""))
("@BASH@" . ,bash)
("@CC@" . ,cc)
("@CC@" . ,(or cc ""))
("@DIFF@" . ,(or (file-name "diff" deps) (string-append abs-top-builddir "/pre-inst-env diff.scm")))
("@DOT@" . ,(or (file-name "dot" deps) ""))
("@GIT@" . ,(or (file-name "git" deps) ""))
@ -705,6 +707,13 @@ See \"Porting GNU Mes\" in the manual, or try --with-courage\n" mes-system)
#define MES_VERSION \"" VERSION "\"
")))))
(substitute (string-append srcdest "build-aux/config.make.in") pairs #:target ".config.make"))
(let ((arch-dir (string-append srcdest "include/" mes-kernel "/" mes-cpu)))
(define (copy-header file-name)
(system* "cp" "-f" "-v"
(string-append arch-dir "/" file-name)
(string-append "include/arch/" file-name)))
(system* "mkdir" "-p" "include/arch")
(for-each copy-header '("kernel-stat.h" "syscall.h")))
(let ((make (and=> (file-name "make" deps) basename)))
(display (string-append "

View File

@ -1,7 +1,7 @@
#! /bin/sh
# GNU Mes --- Maxwell Equations of Software
# Copyright © 2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
# Copyright © 2018,2019,2021,2022,2023 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
#
# This file is part of GNU Mes.
#
@ -20,7 +20,7 @@
set -e
VERSION=0.22
VERSION=0.24.2
srcdir=${srcdir-$(dirname $0)}
srcdest=
if test "$srcdir" != "."; then
@ -77,8 +77,8 @@ GUILE=${GUILE-$(command -v guile)} || true
HEX2=${HEX2-$(command -v hex2)}
LDPFLAGS=${LDFLAGS-}
M1=${M1-$(command -v M1)}
M2_PLANET=${M1-$(command -v M2-Planet)}
KAEM=${KAEM-$(command -v kaem)}
M2_PLANET=${M2_PLANET-$(command -v M2-Planet)} || true
KAEM=${KAEM-$(command -v kaem)} || true
MES_FOR_BUILD=${MES_FOR_BUILD-$(command -v mes || command -v guile || echo mes)}
GIT=${GIT-$(command -v git)} || true
PERL=${PERL-$(command -v perl)} || true
@ -221,7 +221,13 @@ elif $CC --version | grep tcc; then
compiler=gcc
else
compiler=mescc
AR=${AR-$PWD/scripts/mesar}
if ! $CC --version; then
CC="$PWD/pre-inst-env mescc"
fi
if test "$CC" = "M2-Planet"; then
CC="$PWD/pre-inst-env mescc"
fi
AR=${AR-$PWD/pre-inst-env mesar}
fi
AR=${AR-$(command -v ar)} || true
@ -265,6 +271,10 @@ cat >> include/mes/config.h <<EOF
#define MES_VERSION "$VERSION"
EOF
mkdir -p include/arch
cp -f -v ${srcdest}include/${mes_kernel}/${mes_cpu}/kernel-stat.h include/arch
cp -f -v ${srcdest}include/${mes_kernel}/${mes_cpu}/syscall.h include/arch
cat <<EOF
GNU Mes is configured for
compiler: $compiler

120
doc/announce/ANNOUNCE-0.23 Normal file
View File

@ -0,0 +1,120 @@
Subject: GNU Mes 0.23 released
<#secure method=pgpmime mode=sign>
We are happy to announce the release of GNU Mes 0.23, representing 125
commits over one year by four people.
Mes was ported to ARM and can now be used in the GNU Guix Reduced Binary
Seed bootstrap as described here
https://guix.gnu.org/blog/2020/guix-further-reduces-bootstrap-seed-to-25/
and now also for armhf-linux and aarch-linux. Work to integrate this
into Guix is ongoing: tinycc and gcc-core-2.95.3 have been built.
We are excited that the Nlnet Foundation is now sponsoring this work!
Enjoy,
Janneke and Danny.
* About
GNU Mes[0] is a Scheme interpreter and C compiler for bootstrapping the
GNU System. Since version 0.22 it has again helped to halve the size of
opaque, uninspectable binary seeds that are currently being used in the
Reduced Binary Seed bootstrap[1] of GNU Guix[2]. The final goal is to
help create a full source bootstrap as part of the bootstrappable
builds[3] effort for UNIX-like operating systems.
The Scheme interpreter is written in ~5,000 LOC of simple C, and the C
compiler written in Scheme and these are mutual self-hosting. This
mes.c is now being simplified to be transpiled by M2-Planet[4].
Mes 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] --and test suite, just
enough to support a REPL and a C99 compiler: mescc.
Mes + MesCC + Mes C Library can build a bootstrappable TinyCC[8] 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-2.95.3. This is enough to bootstrap Guix for
i686-linux, x86_64-linux, armhf-linux and aarch64-linux.
Mes is inspired by The Maxwell Equations of Software: LISP-1.5[9] -- John
McCarthy page 13, GNU Guix's source/binary packaging transparency and
Jeremiah Orians's stage0[10] ~500 byte self-hosting hex assembler.
We are very grateful to NLNet for sponsoring the Reduced Binary Seed
bootstrap[11] and the ARM port[12].
* Download
git clone git://git.savannah.gnu.org/mes.git
Here are the compressed sources and a GPG detached signature[*]:
https://ftp.gnu.org/gnu/mes/mes-0.23.tar.gz
https://ftp.gnu.org/gnu/mes/mes-0.23.tar.gz.sig
Use a mirror for higher download bandwidth:
https://ftpmirror.gnu.org/mes/mes-0.23.tar.gz
https://ftpmirror.gnu.org/mes/mes-0.23.tar.gz.sig
Here are the MD5 and SHA1 checksums:
e9a0ae6e2c3842cf57fccb54909463ba mes-0.23.tar.gz
0560879358e5a980f7374844c495c92014b47878 mes-0.23.tar.gz
[*] Use a .sig file to verify that the corresponding file (without the
.sig suffix) is intact. First, be sure to download both the .sig file
and the corresponding tarball. Then, run a command like this:
gpg --verify mes-0.23.tar.gz.sig
If that command fails because you don't have the required public key,
then run this command to import it:
gpg --keyserver keys.gnupg.net --recv-keys 1A858392E331EAFDB8C27FFBF3C1A0D9C1D65273
and rerun the 'gpg --verify' command.
* Get informed, get involved
See https://bootstrappable.org
Join #bootstrappable on irc.freenode.net.
* NEWS
* Changes in 0.23 since 0.22
** Core
*** Mes and Mes C Library can now be built with GCC 10.x.
** MesCC
*** The Mes C Library now supports an armhf-linux bootstrap.
*** MesCC now supports ARM.
*** mini.c library was split into _exit.c, and _write.c.
*** When building with GCC, -lgcc is now used.
*** MesCC now has it's own support library libmescc.a (-lmescc).
*** MesCC now requires mescc-tools-0.7.0 or later for ARM.
*** MesCC can be now built with nyacc-1.00.2:
note that nyacc-1.03.0 is not (backwards) compatible.
*** MesCC can be built with Guile 3.0.x:
See https://bugs.gnu.org/43831; use guild compile -O1 with Guile 3.0.x.
*** MesCC now raises SIGABRT on abort, if supported.
** Noteworthy bug fixes
*** unreadchar on EOF is now a no-op.
*** malloc now aligns the blocks it gives out to max_align_t.
[0] https://www.gnu.org/software/mes
[1] https://guix.gnu.org/blog/2020/guix-further-reduces-bootstrap-seed-to-25
[2] https://www.gnu.org/software/guix
[3] https://bootstrappable.org
[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://gitlab.com/janneke/tinycc
[9] http://www.softwarepreservation.org/projects/LISP/book/LISP%201.5%20Programmers%20Manual.pdf
[10] https://savannah.nongnu.org/projects/stage0
[11] https://nlnet.nl/project/GNUMes
[12] https://nlnet.nl/project/GNUMes-arm

119
doc/announce/ANNOUNCE-0.24 Normal file
View File

@ -0,0 +1,119 @@
Subject: GNU Mes 0.24 released
<#secure method=pgpmime mode=sign>
We are thrilled to announce the release of GNU Mes 0.24, representing
222 commits over one year by four people.
Mes has now been ported to M2-Planet and can be bootstrapped using
stage0-posix[0], starting from the 357-byte hex0 binary of the
bootstrap-seeds[1], as was promised at FOSDEM'21[2].
We are exciteda that the NlNet Foundation[4] is again sponsoring this
work!
What's next?
Work to integrate this so-called "Full Source Bootstrap" is happening on
the wip-full-source-bootstrap[3] branch. Also, full Guile compatible
module support, and RICS-V support.
Enjoy!
* About
GNU Mes[5] is a Scheme interpreter and C compiler for bootstrapping
the GNU System. Since version 0.22 it has again helped to halve the
size of opaque, uninspectable binary seeds that are currently being
used in the Reduced Binary Seed bootstrap[6] of GNU Guix[7]. The
final goal is to help create a full source bootstrap as part of the
bootstrappable builds[8] effort for UNIX-like operating systems.
The Scheme interpreter is written in ~5,000 LOC of simple C, and the C
compiler written in Scheme and these are mutual self-hosting. Mes can
now be bootstrapped from M2-Planet[9] and Mescc-Tools[10].
Mes has a Garbage Collector, a library of loadable Scheme modules--
notably Dominique Boucher's LALR[11], Pre-R6RS portable
syntax-case[12] with R7RS ellipsis, Matt Wette's Nyacc[13] --and test
suite, just enough to support a REPL and a C99 compiler: mescc.
Mes + MesCC + Mes C Library can build a bootstrappable TinyCC[14] 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-2.95.3. This is enough to bootstrap Guix for
i686-linux, x86_64-linux, armhf-linux and aarch64-linux.
Mes is inspired by The Maxwell Equations of Software: LISP-1.5[15] --
John McCarthy page 13, GNU Guix's source/binary packaging transparency
and Jeremiah Orians's stage0[16] 357-byte self-hosting hex assembler.
* Download
git clone git://git.savannah.gnu.org/mes.git
Here are the compressed sources and a GPG detached signature[*]:
https://ftp.gnu.org/gnu/mes/mes-0.24.tar.gz
https://ftp.gnu.org/gnu/mes/mes-0.24.tar.gz.sig
Use a mirror for higher download bandwidth:
https://ftpmirror.gnu.org/mes/mes-0.24.tar.gz
https://ftpmirror.gnu.org/mes/mes-0.24.tar.gz.sig
Here are the SHA1 and SHA256 checksums:
f6681aa02edc6729af43f1d7c46ae1a97cbc1c92 mes-0.24.tar.gz
828be15e02c103df8a248232491fba10d763724d6ec10f08a2e0e1d249bd9902 mes-0.24.tar.gz
[*] Use a .sig file to verify that the corresponding file (without the
.sig suffix) is intact. First, be sure to download both the .sig file
and the corresponding tarball. Then, run a command like this:
gpg --verify mes-0.24.tar.gz.sig
If that command fails because you don't have the required public key,
or that public key has expired, try the following commands to update
or refresh it, and then rerun the 'gpg --verify' command.
gpg --recv-keys 1A858392E331EAFDB8C27FFBF3C1A0D9C1D65273
* Get informed, get involved
See https://bootstrappable.org
Join #bootstrappable on irc.libera.chat
* NEWS
* Changes in 0.24 since 0.23
** Core
*** Mes and Mes C Library can now be built with M2-Planet.
*** Mes now supports the --bootstrap build on ARM.
** MesCC
*** MesCC now supports the integer suffixes:
Next to `U', also support `ULL', `UL', `L', and `LL'.
** Noteworthy bug fixes
*** MesCC now uses the unsigned type for sizeof.
*** MesCC now only uses signed division if numerator is signed.
*** The Mes C library now supports an argv bigger than 255.
*** Development build support with Guile-2 was resurrected.
*** The logand procedure now works correctly.
*** The 64bit build was resurrected.
* Links
[0] https://github.com/oriansj/stage0-posix
[1] https://github.com/oriansj/bootstrap-seeds
[2] https://archive.fosdem.org/2021/schedule/event/gnumes/
[3] https://git.savannah.gnu.org/cgit/guix.git/log/?h=wip-full-source-bootstrap
[4] https://nlnet.nl/project/GNUMes-ARM_RISC-V
[5] https://www.gnu.org/software/mes
[6] https://guix.gnu.org/blog/2020/guix-further-reduces-bootstrap-seed-to-25
[7] https://www.gnu.org/software/guix
[8] https://bootstrappable.org
[9] https://github.com/oriansj/m2-planet
[10] https://savannah.nongnu.org/projects/mescc-tools
[11] https://github.com/schemeway/lalr-scm
[12] https://www.cs.indiana.edu/chezscheme/syntax-case/old-psyntax.html
[13] https://www.nongnu.org/nyacc
[14] https://gitlab.com/janneke/tinycc
[15] http://www.softwarepreservation.org/projects/LISP/book/LISP%201.5%20Programmers%20Manual.pdf
[16] https://savannah.nongnu.org/projects/stage0

View File

@ -0,0 +1,115 @@
Subject: GNU Mes 0.24.1 released
<#secure method=pgpmime mode=sign>
We are happy to announce the release of GNU Mes 0.24.1, representing 23
commits over five months by four people.
Mes now supports the stage0-posix and M2-Planet Full Source bootstrap on
Aarch64 for ARM. Because stage0-posix does not support ARM yet, the Mes
ARM bootstrap is currently prototyped on Aarch64.
We are excited that the NlNet Foundation[4] is again sponsoring this
work!
What's next?
Work to prototype this so-called "Full Source Bootstrap" for ARM on
Aarch64 is happening on the wip-aarch64-bootstrap[3] branch. Also, full
Guile compatible module support, and RISC-V support.
Enjoy!
* About
GNU Mes[5] is a Scheme interpreter and C compiler for bootstrapping
the GNU System. Since version 0.22 it has again helped to halve the
size of opaque, uninspectable binary seeds that are currently being
used in the Reduced Binary Seed bootstrap[6] of GNU Guix[7]. The
final goal is to help create a full source bootstrap as part of the
bootstrappable builds[8] effort for UNIX-like operating systems.
The Scheme interpreter is written in ~5,000 LOC of simple C, and the C
compiler written in Scheme and these are mutual self-hosting. Mes can
now be bootstrapped from M2-Planet[9] and Mescc-Tools[10].
Mes has a Garbage Collector, a library of loadable Scheme modules--
notably Dominique Boucher's LALR[11], Pre-R6RS portable
syntax-case[12] with R7RS ellipsis, Matt Wette's Nyacc[13] --and test
suite, just enough to support a REPL and a C99 compiler: mescc.
Mes + MesCC + Mes C Library can build a bootstrappable TinyCC[14] 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-2.95.3. This is enough to bootstrap Guix for
i686-linux, x86_64-linux, armhf-linux and aarch64-linux.
Mes is inspired by The Maxwell Equations of Software: LISP-1.5[15] --
John McCarthy page 13, GNU Guix's source/binary packaging transparency
and Jeremiah Orians's stage0[16] 357-byte self-hosting hex assembler.
* Download
git clone git://git.savannah.gnu.org/mes.git
Here are the compressed sources and a GPG detached signature[*]:
https://ftp.gnu.org/gnu/mes/mes-0.24.1.tar.gz
https://ftp.gnu.org/gnu/mes/mes-0.24.1.tar.gz.sig
Use a mirror for higher download bandwidth:
https://ftpmirror.gnu.org/mes/mes-0.24.1.tar.gz
https://ftpmirror.gnu.org/mes/mes-0.24.1.tar.gz.sig
Here are the SHA1 and SHA256 checksums:
bceaaaf1cafaa31ccb1ee1247ce2dd651a2f67be mes-0.24.1.tar.gz
35120ceb0676632e58973355b9f86dff9cc717ed65ed2a17ff5272c59f2a0535 mes-0.24.1.tar.gz
[*] Use a .sig file to verify that the corresponding file (without the
.sig suffix) is intact. First, be sure to download both the .sig file
and the corresponding tarball. Then, run a command like this:
gpg --verify mes-0.24.1.tar.gz.sig
If that command fails because you don't have the required public key,
or that public key has expired, try the following commands to update
or refresh it, and then rerun the 'gpg --verify' command.
gpg --recv-keys 1A858392E331EAFDB8C27FFBF3C1A0D9C1D65273
* Get informed, get involved
See https://bootstrappable.org
Join #bootstrappable on irc.libera.chat
* NEWS
* Changes in 0.24.1 since 0.24
** Build
*** Support M2-Planet bootstrap for ARM.
** MesCC
*** The Mes C Library now supports bootstrapping ARM.
** Noteworthy bug fixes
*** The definition of S_ISUID was fixed.
*** Unsigned modulo has been fixed for ARM.
*** A bug with abtol has been fixed.
*** Workarounds for building with gcc-12.2.0 have been added.
* Links
[0] https://github.com/oriansj/stage0-posix
[1] https://github.com/oriansj/bootstrap-seeds
[2] https://archive.fosdem.org/2021/schedule/event/gnumes/
[3] https://git.savannah.gnu.org/cgit/guix.git/log/?h=wip-aarch64-bootstrap
[4] https://nlnet.nl/project/GNUMes-ARM_RISC-V
[5] https://www.gnu.org/software/mes
[6] https://guix.gnu.org/blog/2020/guix-further-reduces-bootstrap-seed-to-25
[7] https://www.gnu.org/software/guix
[8] https://bootstrappable.org
[9] https://github.com/oriansj/m2-planet
[10] https://savannah.nongnu.org/projects/mescc-tools
[11] https://github.com/schemeway/lalr-scm
[12] https://www.cs.indiana.edu/chezscheme/syntax-case/old-psyntax.html
[13] https://www.nongnu.org/nyacc
[14] https://gitlab.com/janneke/tinycc
[15] http://www.softwarepreservation.org/projects/LISP/book/LISP%201.5%20Programmers%20Manual.pdf
[16] https://savannah.nongnu.org/projects/stage0

View File

@ -0,0 +1,117 @@
Subject: GNU Mes 0.24.2 released
<#secure method=pgpmime mode=sign>
We are happy to announce the release of GNU Mes 0.24.2, representing 25
commits over nine months by four people.
This release should fix the long standing `stat64' bug #41264[0].
We are very grateful that the NLnet Foundation[1] is sponsoring this
work!
What's next?
Work to prototype this so-called "Full Source Bootstrap" for ARM on
Aarch64 is happening on the wip-aarch64-bootstrap[2] branch. Also, full
Guile compatible module support, and RISC-V support.
Enjoy!
* About
GNU Mes[3] is a Scheme interpreter and C compiler for bootstrapping
the GNU System. Since version 0.22 it has again helped to halve the
size of opaque, uninspectable binary seeds that are currently being
used in the Reduced Binary Seed bootstrap[4] of GNU Guix[5]. The
final goal is to help create a full source bootstrap as part of the
bootstrappable builds[6] effort for UNIX-like operating systems.
The Scheme interpreter is written in ~5,000 LOC of simple C, and the C
compiler written in Scheme and these are mutual self-hosting. Mes can
now be bootstrapped from M2-Planet[7] and Mescc-Tools[8].
Mes has a Garbage Collector, a library of loadable Scheme modules--
notably Dominique Boucher's LALR[9], Pre-R6RS portable
syntax-case[10] with R7RS ellipsis, Matt Wette's Nyacc[11] --and test
suite, just enough to support a REPL and a C99 compiler: mescc.
Mes + MesCC + Mes C Library can build a bootstrappable TinyCC[12] 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-2.95.3. This is enough to bootstrap Guix for
i686-linux, x86_64-linux, armhf-linux and aarch64-linux.
Mes is inspired by The Maxwell Equations of Software: LISP-1.5[13] --
John McCarthy page 13, GNU Guix's source/binary packaging transparency
and Jeremiah Orians's stage0[14] 357-byte self-hosting hex assembler.
* Download
git clone git://git.savannah.gnu.org/mes.git
Here are the compressed sources and a GPG detached signature[*]:
https://ftp.gnu.org/gnu/mes/mes-0.24.2.tar.gz
https://ftp.gnu.org/gnu/mes/mes-0.24.2.tar.gz.sig
Use a mirror for higher download bandwidth:
https://ftpmirror.gnu.org/mes/mes-0.24.2.tar.gz
https://ftpmirror.gnu.org/mes/mes-0.24.2.tar.gz.sig
Here are the SHA1 and SHA256 checksums:
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx mes-0.24.2.tar.gz
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx mes-0.24.2.tar.gz
[*] Use a .sig file to verify that the corresponding file (without the
.sig suffix) is intact. First, be sure to download both the .sig file
and the corresponding tarball. Then, run a command like this:
gpg --verify mes-0.24.2.tar.gz.sig
If that command fails because you don't have the required public key,
or that public key has expired, try the following commands to update
or refresh it, and then rerun the 'gpg --verify' command.
gpg --recv-keys 1A858392E331EAFDB8C27FFBF3C1A0D9C1D65273
* Get informed, get involved
See https://bootstrappable.org
Join #bootstrappable on irc.libera.chat
* NEWS
* Changes in 0.24.2 since 0.24.1
** Build
*** A number of compile warnings have been fixed.
*** The `simple.make' and `simple.sh' builds have been resurrected.
** MesCC
*** Some assembly defines were added for building TinyCC for x86_64.
*** `__assert_fail' has been updated to use the standard signature.
** Noteworthy bug fixes
*** A bootstrap build without M2-Planet is now supported again.
*** `gettimeofday' no longer segfaults in the M2-Planet build.
*** `stat64' and friends are now used on 32bit platforms.
This fixes https://debbugs.gnu.org/41264, and should also fix
https://debbugs.gnu.org/49985,
https://debbugs.gnu.org/53415,
https://debbugs.gnu.org/53416.
*** The Mes C Library now supports uppercase hex conversions.
* Links
[0] https://debbugs.gnu.org/41264
[1] https://nlnet.nl/project/GNUMes-ARM_RISC-V
[2] https://git.savannah.gnu.org/cgit/guix.git/log/?h=wip-aarch64-bootstrap
[3] https://www.gnu.org/software/mes
[4] https://guix.gnu.org/blog/2020/guix-further-reduces-bootstrap-seed-to-25
[5] https://www.gnu.org/software/guix
[6] https://bootstrappable.org
[7] https://github.com/oriansj/m2-planet
[8] https://savannah.nongnu.org/projects/mescc-tools
[9] https://github.com/schemeway/lalr-scm
[10] https://www.cs.indiana.edu/chezscheme/syntax-case/old-psyntax.html
[11] https://www.nongnu.org/nyacc
[12] https://gitlab.com/janneke/tinycc
[13] http://www.softwarepreservation.org/projects/LISP/book/LISP%201.5%20Programmers%20Manual.pdf
[14] https://github.com/oriansj/stage0-posix

View File

@ -6,7 +6,7 @@
@display
Copyright @copyright{} 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc.
@uref{http://fsf.org/}
@uref{https://fsf.org/}
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
@ -414,7 +414,7 @@ The Free Software Foundation may publish new, revised versions
of the GNU Free Documentation 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. See
@uref{http://www.gnu.org/copyleft/}.
@uref{https://www.gnu.org/copyleft/}.
Each version of the License is given a distinguishing version number.
If the Document specifies that a particular numbered version of this

View File

@ -1,123 +1,107 @@
digraph "Guix bag" {
"/gnu/store/q8f5yjxp0kcdn2mwqf83bvhal71cnr71-gcc-mesboot-4.9.4.drv" [label = "gcc-mesboot@4.9.4", shape = box, fontname = Helvetica];
"/gnu/store/q8f5yjxp0kcdn2mwqf83bvhal71cnr71-gcc-mesboot-4.9.4.drv" -> "/gnu/store/2lpg626q4x8v7hgqajywpq1rc8y72hzx-binutils-mesboot-2.20.1a.drv" [color = magenta];
"/gnu/store/q8f5yjxp0kcdn2mwqf83bvhal71cnr71-gcc-mesboot-4.9.4.drv" -> "/gnu/store/7v6fpp5msmjbhmprikrfcj047016gd54-gcc-mesboot1-wrapper-4.7.4.drv" [color = magenta];
"/gnu/store/q8f5yjxp0kcdn2mwqf83bvhal71cnr71-gcc-mesboot-4.9.4.drv" -> "/gnu/store/7pllq0crksfkr7856y1pawcy4scc7l4q-gcc-mesboot1-4.7.4.drv" [color = magenta];
"/gnu/store/q8f5yjxp0kcdn2mwqf83bvhal71cnr71-gcc-mesboot-4.9.4.drv" -> "/gnu/store/lp6fycqqd8adndlfylh4mlihm0qakxzw-glibc-mesboot-2.16.0.drv" [color = magenta];
"/gnu/store/q8f5yjxp0kcdn2mwqf83bvhal71cnr71-gcc-mesboot-4.9.4.drv" -> "/gnu/store/7wqw4023spvggi15vcxyxvivxa4rmmv8-bootstrap-binaries-0.drv" [color = magenta];
"/gnu/store/q8f5yjxp0kcdn2mwqf83bvhal71cnr71-gcc-mesboot-4.9.4.drv" -> "/gnu/store/7wqw4023spvggi15vcxyxvivxa4rmmv8-bootstrap-binaries-0.drv" [color = magenta];
"/gnu/store/q8f5yjxp0kcdn2mwqf83bvhal71cnr71-gcc-mesboot-4.9.4.drv" -> "/gnu/store/r50fj43103526ga6pi2f9jkk4gvaav7m-diffutils-mesboot-2.7.drv" [color = magenta];
"/gnu/store/q8f5yjxp0kcdn2mwqf83bvhal71cnr71-gcc-mesboot-4.9.4.drv" -> "/gnu/store/r0z9bix88pz0wf6sgcn9185iwcsdracs-linux-libre-headers-bootstrap-0.drv" [color = magenta];
"/gnu/store/q8f5yjxp0kcdn2mwqf83bvhal71cnr71-gcc-mesboot-4.9.4.drv" -> "/gnu/store/5ad88jy4a1gpbslzdiksk7zjyh28wzkr-make-mesboot-3.82.drv" [color = magenta];
"/gnu/store/2lpg626q4x8v7hgqajywpq1rc8y72hzx-binutils-mesboot-2.20.1a.drv" [label = "binutils-mesboot@2.20.1a", shape = box, fontname = Helvetica];
"/gnu/store/2lpg626q4x8v7hgqajywpq1rc8y72hzx-binutils-mesboot-2.20.1a.drv" -> "/gnu/store/x9shp86cz9f4rb5xvhs37zzxg1ngi4dr-binutils-mesboot0-2.20.1a.drv" [color = magenta];
"/gnu/store/2lpg626q4x8v7hgqajywpq1rc8y72hzx-binutils-mesboot-2.20.1a.drv" -> "/gnu/store/2633565gzh4jqh7c5zf6i0iy9yxqigcv-glibc-mesboot0-2.2.5.drv" [color = magenta];
"/gnu/store/2lpg626q4x8v7hgqajywpq1rc8y72hzx-binutils-mesboot-2.20.1a.drv" -> "/gnu/store/slnyk8gbnvfwy1m1was8myivpss58idd-gcc-mesboot0-2.95.3.drv" [color = magenta];
"/gnu/store/2lpg626q4x8v7hgqajywpq1rc8y72hzx-binutils-mesboot-2.20.1a.drv" -> "/gnu/store/7wqw4023spvggi15vcxyxvivxa4rmmv8-bootstrap-binaries-0.drv" [color = magenta];
"/gnu/store/2lpg626q4x8v7hgqajywpq1rc8y72hzx-binutils-mesboot-2.20.1a.drv" -> "/gnu/store/7wqw4023spvggi15vcxyxvivxa4rmmv8-bootstrap-binaries-0.drv" [color = magenta];
"/gnu/store/2lpg626q4x8v7hgqajywpq1rc8y72hzx-binutils-mesboot-2.20.1a.drv" -> "/gnu/store/r50fj43103526ga6pi2f9jkk4gvaav7m-diffutils-mesboot-2.7.drv" [color = magenta];
"/gnu/store/2lpg626q4x8v7hgqajywpq1rc8y72hzx-binutils-mesboot-2.20.1a.drv" -> "/gnu/store/r0z9bix88pz0wf6sgcn9185iwcsdracs-linux-libre-headers-bootstrap-0.drv" [color = magenta];
"/gnu/store/2lpg626q4x8v7hgqajywpq1rc8y72hzx-binutils-mesboot-2.20.1a.drv" -> "/gnu/store/57da9mdiqhyn72m8wv00pdvzqi2ng4xb-make-mesboot0-3.80.drv" [color = magenta];
"/gnu/store/x9shp86cz9f4rb5xvhs37zzxg1ngi4dr-binutils-mesboot0-2.20.1a.drv" [label = "binutils-mesboot0@2.20.1a", shape = box, fontname = Helvetica];
"/gnu/store/x9shp86cz9f4rb5xvhs37zzxg1ngi4dr-binutils-mesboot0-2.20.1a.drv" -> "/gnu/store/fglx0fz62bygkdxxg878j7x9pfl37zhh-tcc-boot-0.9.27.drv" [color = red];
"/gnu/store/x9shp86cz9f4rb5xvhs37zzxg1ngi4dr-binutils-mesboot0-2.20.1a.drv" -> "/gnu/store/7wqw4023spvggi15vcxyxvivxa4rmmv8-bootstrap-binaries-0.drv" [color = red];
"/gnu/store/x9shp86cz9f4rb5xvhs37zzxg1ngi4dr-binutils-mesboot0-2.20.1a.drv" -> "/gnu/store/7wqw4023spvggi15vcxyxvivxa4rmmv8-bootstrap-binaries-0.drv" [color = red];
"/gnu/store/x9shp86cz9f4rb5xvhs37zzxg1ngi4dr-binutils-mesboot0-2.20.1a.drv" -> "/gnu/store/r50fj43103526ga6pi2f9jkk4gvaav7m-diffutils-mesboot-2.7.drv" [color = red];
"/gnu/store/x9shp86cz9f4rb5xvhs37zzxg1ngi4dr-binutils-mesboot0-2.20.1a.drv" -> "/gnu/store/57da9mdiqhyn72m8wv00pdvzqi2ng4xb-make-mesboot0-3.80.drv" [color = red];
"/gnu/store/fglx0fz62bygkdxxg878j7x9pfl37zhh-tcc-boot-0.9.27.drv" [label = "tcc-boot@0.9.27", shape = box, fontname = Helvetica];
"/gnu/store/fglx0fz62bygkdxxg878j7x9pfl37zhh-tcc-boot-0.9.27.drv" -> "/gnu/store/mw6swkryp89aml4jzac5lm8kmcv5k6gy-mes-boot-0.19.drv" [color = dimgrey];
"/gnu/store/fglx0fz62bygkdxxg878j7x9pfl37zhh-tcc-boot-0.9.27.drv" -> "/gnu/store/nvhjn6b5hi4mj7wnjxrmj0dmdigq9m2z-tcc-boot0-0.9.26-6.c004e9a.drv" [color = dimgrey];
"/gnu/store/fglx0fz62bygkdxxg878j7x9pfl37zhh-tcc-boot-0.9.27.drv" -> "/gnu/store/7wqw4023spvggi15vcxyxvivxa4rmmv8-bootstrap-binaries-0.drv" [color = dimgrey];
"/gnu/store/mw6swkryp89aml4jzac5lm8kmcv5k6gy-mes-boot-0.19.drv" [label = "mes-boot@0.19", shape = box, fontname = Helvetica];
"/gnu/store/mw6swkryp89aml4jzac5lm8kmcv5k6gy-mes-boot-0.19.drv" -> "/gnu/store/msykyiih9lwrd86x00vs00i8s5ipjks4-bootstrap-mescc-tools-0.5.2.drv" [color = darkgoldenrod];
"/gnu/store/mw6swkryp89aml4jzac5lm8kmcv5k6gy-mes-boot-0.19.drv" -> "/gnu/store/7wqw4023spvggi15vcxyxvivxa4rmmv8-bootstrap-binaries-0.drv" [color = darkgoldenrod];
"/gnu/store/mw6swkryp89aml4jzac5lm8kmcv5k6gy-mes-boot-0.19.drv" -> "/gnu/store/cfw60j3987wrvb26f2bpbw5l5q6q53fj-bootstrap-mes-0.drv" [color = darkgoldenrod];
"/gnu/store/msykyiih9lwrd86x00vs00i8s5ipjks4-bootstrap-mescc-tools-0.5.2.drv" [label = "bootstrap-mescc-tools@0.5.2", shape = box, fontname = Helvetica];
"/gnu/store/7wqw4023spvggi15vcxyxvivxa4rmmv8-bootstrap-binaries-0.drv" [label = "bootstrap-binaries@0", shape = box, fontname = Helvetica];
"/gnu/store/cfw60j3987wrvb26f2bpbw5l5q6q53fj-bootstrap-mes-0.drv" [label = "bootstrap-mes@0", shape = box, fontname = Helvetica];
"/gnu/store/nvhjn6b5hi4mj7wnjxrmj0dmdigq9m2z-tcc-boot0-0.9.26-6.c004e9a.drv" [label = "tcc-boot0@0.9.26-6.c004e9a", shape = box, fontname = Helvetica];
"/gnu/store/nvhjn6b5hi4mj7wnjxrmj0dmdigq9m2z-tcc-boot0-0.9.26-6.c004e9a.drv" -> "/gnu/store/mw6swkryp89aml4jzac5lm8kmcv5k6gy-mes-boot-0.19.drv" [color = magenta];
"/gnu/store/nvhjn6b5hi4mj7wnjxrmj0dmdigq9m2z-tcc-boot0-0.9.26-6.c004e9a.drv" -> "/gnu/store/msykyiih9lwrd86x00vs00i8s5ipjks4-bootstrap-mescc-tools-0.5.2.drv" [color = magenta];
"/gnu/store/nvhjn6b5hi4mj7wnjxrmj0dmdigq9m2z-tcc-boot0-0.9.26-6.c004e9a.drv" -> "/gnu/store/7wqw4023spvggi15vcxyxvivxa4rmmv8-bootstrap-binaries-0.drv" [color = magenta];
"/gnu/store/nvhjn6b5hi4mj7wnjxrmj0dmdigq9m2z-tcc-boot0-0.9.26-6.c004e9a.drv" -> "/gnu/store/cfw60j3987wrvb26f2bpbw5l5q6q53fj-bootstrap-mes-0.drv" [color = magenta];
"/gnu/store/r50fj43103526ga6pi2f9jkk4gvaav7m-diffutils-mesboot-2.7.drv" [label = "diffutils-mesboot@2.7", shape = box, fontname = Helvetica];
"/gnu/store/r50fj43103526ga6pi2f9jkk4gvaav7m-diffutils-mesboot-2.7.drv" -> "/gnu/store/mw6swkryp89aml4jzac5lm8kmcv5k6gy-mes-boot-0.19.drv" [color = peachpuff4];
"/gnu/store/r50fj43103526ga6pi2f9jkk4gvaav7m-diffutils-mesboot-2.7.drv" -> "/gnu/store/fglx0fz62bygkdxxg878j7x9pfl37zhh-tcc-boot-0.9.27.drv" [color = peachpuff4];
"/gnu/store/r50fj43103526ga6pi2f9jkk4gvaav7m-diffutils-mesboot-2.7.drv" -> "/gnu/store/7wqw4023spvggi15vcxyxvivxa4rmmv8-bootstrap-binaries-0.drv" [color = peachpuff4];
"/gnu/store/r50fj43103526ga6pi2f9jkk4gvaav7m-diffutils-mesboot-2.7.drv" -> "/gnu/store/7wqw4023spvggi15vcxyxvivxa4rmmv8-bootstrap-binaries-0.drv" [color = peachpuff4];
"/gnu/store/r50fj43103526ga6pi2f9jkk4gvaav7m-diffutils-mesboot-2.7.drv" -> "/gnu/store/57da9mdiqhyn72m8wv00pdvzqi2ng4xb-make-mesboot0-3.80.drv" [color = peachpuff4];
"/gnu/store/57da9mdiqhyn72m8wv00pdvzqi2ng4xb-make-mesboot0-3.80.drv" [label = "make-mesboot0@3.80", shape = box, fontname = Helvetica];
"/gnu/store/57da9mdiqhyn72m8wv00pdvzqi2ng4xb-make-mesboot0-3.80.drv" -> "/gnu/store/fglx0fz62bygkdxxg878j7x9pfl37zhh-tcc-boot-0.9.27.drv" [color = dimgrey];
"/gnu/store/57da9mdiqhyn72m8wv00pdvzqi2ng4xb-make-mesboot0-3.80.drv" -> "/gnu/store/7wqw4023spvggi15vcxyxvivxa4rmmv8-bootstrap-binaries-0.drv" [color = dimgrey];
"/gnu/store/57da9mdiqhyn72m8wv00pdvzqi2ng4xb-make-mesboot0-3.80.drv" -> "/gnu/store/7wqw4023spvggi15vcxyxvivxa4rmmv8-bootstrap-binaries-0.drv" [color = dimgrey];
"/gnu/store/2633565gzh4jqh7c5zf6i0iy9yxqigcv-glibc-mesboot0-2.2.5.drv" [label = "glibc-mesboot0@2.2.5", shape = box, fontname = Helvetica];
"/gnu/store/2633565gzh4jqh7c5zf6i0iy9yxqigcv-glibc-mesboot0-2.2.5.drv" -> "/gnu/store/x9shp86cz9f4rb5xvhs37zzxg1ngi4dr-binutils-mesboot0-2.20.1a.drv" [color = red];
"/gnu/store/2633565gzh4jqh7c5zf6i0iy9yxqigcv-glibc-mesboot0-2.2.5.drv" -> "/gnu/store/kcyh6k46ijm9nsq1as26rr0aq7rkx4f7-gcc-core-mesboot-2.95.3.drv" [color = red];
"/gnu/store/2633565gzh4jqh7c5zf6i0iy9yxqigcv-glibc-mesboot0-2.2.5.drv" -> "/gnu/store/7wqw4023spvggi15vcxyxvivxa4rmmv8-bootstrap-binaries-0.drv" [color = red];
"/gnu/store/2633565gzh4jqh7c5zf6i0iy9yxqigcv-glibc-mesboot0-2.2.5.drv" -> "/gnu/store/7wqw4023spvggi15vcxyxvivxa4rmmv8-bootstrap-binaries-0.drv" [color = red];
"/gnu/store/2633565gzh4jqh7c5zf6i0iy9yxqigcv-glibc-mesboot0-2.2.5.drv" -> "/gnu/store/r50fj43103526ga6pi2f9jkk4gvaav7m-diffutils-mesboot-2.7.drv" [color = red];
"/gnu/store/2633565gzh4jqh7c5zf6i0iy9yxqigcv-glibc-mesboot0-2.2.5.drv" -> "/gnu/store/hnxdqmhjdvh1ra9ar4lxl25xf6a7bhzz-mesboot-headers-0.19.drv" [color = red];
"/gnu/store/2633565gzh4jqh7c5zf6i0iy9yxqigcv-glibc-mesboot0-2.2.5.drv" -> "/gnu/store/57da9mdiqhyn72m8wv00pdvzqi2ng4xb-make-mesboot0-3.80.drv" [color = red];
"/gnu/store/kcyh6k46ijm9nsq1as26rr0aq7rkx4f7-gcc-core-mesboot-2.95.3.drv" [label = "gcc-core-mesboot@2.95.3", shape = box, fontname = Helvetica];
"/gnu/store/kcyh6k46ijm9nsq1as26rr0aq7rkx4f7-gcc-core-mesboot-2.95.3.drv" -> "/gnu/store/x9shp86cz9f4rb5xvhs37zzxg1ngi4dr-binutils-mesboot0-2.20.1a.drv" [color = dimgrey];
"/gnu/store/kcyh6k46ijm9nsq1as26rr0aq7rkx4f7-gcc-core-mesboot-2.95.3.drv" -> "/gnu/store/fglx0fz62bygkdxxg878j7x9pfl37zhh-tcc-boot-0.9.27.drv" [color = dimgrey];
"/gnu/store/kcyh6k46ijm9nsq1as26rr0aq7rkx4f7-gcc-core-mesboot-2.95.3.drv" -> "/gnu/store/7wqw4023spvggi15vcxyxvivxa4rmmv8-bootstrap-binaries-0.drv" [color = dimgrey];
"/gnu/store/kcyh6k46ijm9nsq1as26rr0aq7rkx4f7-gcc-core-mesboot-2.95.3.drv" -> "/gnu/store/7wqw4023spvggi15vcxyxvivxa4rmmv8-bootstrap-binaries-0.drv" [color = dimgrey];
"/gnu/store/kcyh6k46ijm9nsq1as26rr0aq7rkx4f7-gcc-core-mesboot-2.95.3.drv" -> "/gnu/store/r50fj43103526ga6pi2f9jkk4gvaav7m-diffutils-mesboot-2.7.drv" [color = dimgrey];
"/gnu/store/kcyh6k46ijm9nsq1as26rr0aq7rkx4f7-gcc-core-mesboot-2.95.3.drv" -> "/gnu/store/57da9mdiqhyn72m8wv00pdvzqi2ng4xb-make-mesboot0-3.80.drv" [color = dimgrey];
"/gnu/store/hnxdqmhjdvh1ra9ar4lxl25xf6a7bhzz-mesboot-headers-0.19.drv" [label = "mesboot-headers@0.19", shape = box, fontname = Helvetica];
"/gnu/store/hnxdqmhjdvh1ra9ar4lxl25xf6a7bhzz-mesboot-headers-0.19.drv" -> "/gnu/store/7wqw4023spvggi15vcxyxvivxa4rmmv8-bootstrap-binaries-0.drv" [color = blue];
"/gnu/store/hnxdqmhjdvh1ra9ar4lxl25xf6a7bhzz-mesboot-headers-0.19.drv" -> "/gnu/store/r0z9bix88pz0wf6sgcn9185iwcsdracs-linux-libre-headers-bootstrap-0.drv" [color = blue];
"/gnu/store/r0z9bix88pz0wf6sgcn9185iwcsdracs-linux-libre-headers-bootstrap-0.drv" [label = "linux-libre-headers-bootstrap@0", shape = box, fontname = Helvetica];
"/gnu/store/slnyk8gbnvfwy1m1was8myivpss58idd-gcc-mesboot0-2.95.3.drv" [label = "gcc-mesboot0@2.95.3", shape = box, fontname = Helvetica];
"/gnu/store/slnyk8gbnvfwy1m1was8myivpss58idd-gcc-mesboot0-2.95.3.drv" -> "/gnu/store/x9shp86cz9f4rb5xvhs37zzxg1ngi4dr-binutils-mesboot0-2.20.1a.drv" [color = darkseagreen];
"/gnu/store/slnyk8gbnvfwy1m1was8myivpss58idd-gcc-mesboot0-2.95.3.drv" -> "/gnu/store/kcyh6k46ijm9nsq1as26rr0aq7rkx4f7-gcc-core-mesboot-2.95.3.drv" [color = darkseagreen];
"/gnu/store/slnyk8gbnvfwy1m1was8myivpss58idd-gcc-mesboot0-2.95.3.drv" -> "/gnu/store/2633565gzh4jqh7c5zf6i0iy9yxqigcv-glibc-mesboot0-2.2.5.drv" [color = darkseagreen];
"/gnu/store/slnyk8gbnvfwy1m1was8myivpss58idd-gcc-mesboot0-2.95.3.drv" -> "/gnu/store/7wqw4023spvggi15vcxyxvivxa4rmmv8-bootstrap-binaries-0.drv" [color = darkseagreen];
"/gnu/store/slnyk8gbnvfwy1m1was8myivpss58idd-gcc-mesboot0-2.95.3.drv" -> "/gnu/store/7wqw4023spvggi15vcxyxvivxa4rmmv8-bootstrap-binaries-0.drv" [color = darkseagreen];
"/gnu/store/slnyk8gbnvfwy1m1was8myivpss58idd-gcc-mesboot0-2.95.3.drv" -> "/gnu/store/r50fj43103526ga6pi2f9jkk4gvaav7m-diffutils-mesboot-2.7.drv" [color = darkseagreen];
"/gnu/store/slnyk8gbnvfwy1m1was8myivpss58idd-gcc-mesboot0-2.95.3.drv" -> "/gnu/store/r0z9bix88pz0wf6sgcn9185iwcsdracs-linux-libre-headers-bootstrap-0.drv" [color = darkseagreen];
"/gnu/store/slnyk8gbnvfwy1m1was8myivpss58idd-gcc-mesboot0-2.95.3.drv" -> "/gnu/store/57da9mdiqhyn72m8wv00pdvzqi2ng4xb-make-mesboot0-3.80.drv" [color = darkseagreen];
"/gnu/store/7v6fpp5msmjbhmprikrfcj047016gd54-gcc-mesboot1-wrapper-4.7.4.drv" [label = "gcc-mesboot1-wrapper@4.7.4", shape = box, fontname = Helvetica];
"/gnu/store/7v6fpp5msmjbhmprikrfcj047016gd54-gcc-mesboot1-wrapper-4.7.4.drv" -> "/gnu/store/7wqw4023spvggi15vcxyxvivxa4rmmv8-bootstrap-binaries-0.drv" [color = red];
"/gnu/store/7v6fpp5msmjbhmprikrfcj047016gd54-gcc-mesboot1-wrapper-4.7.4.drv" -> "/gnu/store/lp6fycqqd8adndlfylh4mlihm0qakxzw-glibc-mesboot-2.16.0.drv" [color = red];
"/gnu/store/7v6fpp5msmjbhmprikrfcj047016gd54-gcc-mesboot1-wrapper-4.7.4.drv" -> "/gnu/store/7pllq0crksfkr7856y1pawcy4scc7l4q-gcc-mesboot1-4.7.4.drv" [color = red];
"/gnu/store/lp6fycqqd8adndlfylh4mlihm0qakxzw-glibc-mesboot-2.16.0.drv" [label = "glibc-mesboot@2.16.0", shape = box, fontname = Helvetica];
"/gnu/store/lp6fycqqd8adndlfylh4mlihm0qakxzw-glibc-mesboot-2.16.0.drv" -> "/gnu/store/2lpg626q4x8v7hgqajywpq1rc8y72hzx-binutils-mesboot-2.20.1a.drv" [color = magenta];
"/gnu/store/lp6fycqqd8adndlfylh4mlihm0qakxzw-glibc-mesboot-2.16.0.drv" -> "/gnu/store/2633565gzh4jqh7c5zf6i0iy9yxqigcv-glibc-mesboot0-2.2.5.drv" [color = magenta];
"/gnu/store/lp6fycqqd8adndlfylh4mlihm0qakxzw-glibc-mesboot-2.16.0.drv" -> "/gnu/store/p9sl13frcs2wdcddkh20hc51l7lpavza-glibc-headers-mesboot-2.16.0.drv" [color = magenta];
"/gnu/store/lp6fycqqd8adndlfylh4mlihm0qakxzw-glibc-mesboot-2.16.0.drv" -> "/gnu/store/7pllq0crksfkr7856y1pawcy4scc7l4q-gcc-mesboot1-4.7.4.drv" [color = magenta];
"/gnu/store/lp6fycqqd8adndlfylh4mlihm0qakxzw-glibc-mesboot-2.16.0.drv" -> "/gnu/store/7wqw4023spvggi15vcxyxvivxa4rmmv8-bootstrap-binaries-0.drv" [color = magenta];
"/gnu/store/lp6fycqqd8adndlfylh4mlihm0qakxzw-glibc-mesboot-2.16.0.drv" -> "/gnu/store/7wqw4023spvggi15vcxyxvivxa4rmmv8-bootstrap-binaries-0.drv" [color = magenta];
"/gnu/store/lp6fycqqd8adndlfylh4mlihm0qakxzw-glibc-mesboot-2.16.0.drv" -> "/gnu/store/r50fj43103526ga6pi2f9jkk4gvaav7m-diffutils-mesboot-2.7.drv" [color = magenta];
"/gnu/store/lp6fycqqd8adndlfylh4mlihm0qakxzw-glibc-mesboot-2.16.0.drv" -> "/gnu/store/r0z9bix88pz0wf6sgcn9185iwcsdracs-linux-libre-headers-bootstrap-0.drv" [color = magenta];
"/gnu/store/lp6fycqqd8adndlfylh4mlihm0qakxzw-glibc-mesboot-2.16.0.drv" -> "/gnu/store/5ad88jy4a1gpbslzdiksk7zjyh28wzkr-make-mesboot-3.82.drv" [color = magenta];
"/gnu/store/p9sl13frcs2wdcddkh20hc51l7lpavza-glibc-headers-mesboot-2.16.0.drv" [label = "glibc-headers-mesboot@2.16.0", shape = box, fontname = Helvetica];
"/gnu/store/p9sl13frcs2wdcddkh20hc51l7lpavza-glibc-headers-mesboot-2.16.0.drv" -> "/gnu/store/2lpg626q4x8v7hgqajywpq1rc8y72hzx-binutils-mesboot-2.20.1a.drv" [color = darkgoldenrod];
"/gnu/store/p9sl13frcs2wdcddkh20hc51l7lpavza-glibc-headers-mesboot-2.16.0.drv" -> "/gnu/store/2633565gzh4jqh7c5zf6i0iy9yxqigcv-glibc-mesboot0-2.2.5.drv" [color = darkgoldenrod];
"/gnu/store/p9sl13frcs2wdcddkh20hc51l7lpavza-glibc-headers-mesboot-2.16.0.drv" -> "/gnu/store/7pllq0crksfkr7856y1pawcy4scc7l4q-gcc-mesboot1-4.7.4.drv" [color = darkgoldenrod];
"/gnu/store/p9sl13frcs2wdcddkh20hc51l7lpavza-glibc-headers-mesboot-2.16.0.drv" -> "/gnu/store/hnxdqmhjdvh1ra9ar4lxl25xf6a7bhzz-mesboot-headers-0.19.drv" [color = darkgoldenrod];
"/gnu/store/p9sl13frcs2wdcddkh20hc51l7lpavza-glibc-headers-mesboot-2.16.0.drv" -> "/gnu/store/7wqw4023spvggi15vcxyxvivxa4rmmv8-bootstrap-binaries-0.drv" [color = darkgoldenrod];
"/gnu/store/p9sl13frcs2wdcddkh20hc51l7lpavza-glibc-headers-mesboot-2.16.0.drv" -> "/gnu/store/7wqw4023spvggi15vcxyxvivxa4rmmv8-bootstrap-binaries-0.drv" [color = darkgoldenrod];
"/gnu/store/p9sl13frcs2wdcddkh20hc51l7lpavza-glibc-headers-mesboot-2.16.0.drv" -> "/gnu/store/r50fj43103526ga6pi2f9jkk4gvaav7m-diffutils-mesboot-2.7.drv" [color = darkgoldenrod];
"/gnu/store/p9sl13frcs2wdcddkh20hc51l7lpavza-glibc-headers-mesboot-2.16.0.drv" -> "/gnu/store/r0z9bix88pz0wf6sgcn9185iwcsdracs-linux-libre-headers-bootstrap-0.drv" [color = darkgoldenrod];
"/gnu/store/p9sl13frcs2wdcddkh20hc51l7lpavza-glibc-headers-mesboot-2.16.0.drv" -> "/gnu/store/5ad88jy4a1gpbslzdiksk7zjyh28wzkr-make-mesboot-3.82.drv" [color = darkgoldenrod];
"/gnu/store/7pllq0crksfkr7856y1pawcy4scc7l4q-gcc-mesboot1-4.7.4.drv" [label = "gcc-mesboot1@4.7.4", shape = box, fontname = Helvetica];
"/gnu/store/7pllq0crksfkr7856y1pawcy4scc7l4q-gcc-mesboot1-4.7.4.drv" -> "/gnu/store/2lpg626q4x8v7hgqajywpq1rc8y72hzx-binutils-mesboot-2.20.1a.drv" [color = cyan3];
"/gnu/store/7pllq0crksfkr7856y1pawcy4scc7l4q-gcc-mesboot1-4.7.4.drv" -> "/gnu/store/slnyk8gbnvfwy1m1was8myivpss58idd-gcc-mesboot0-2.95.3.drv" [color = cyan3];
"/gnu/store/7pllq0crksfkr7856y1pawcy4scc7l4q-gcc-mesboot1-4.7.4.drv" -> "/gnu/store/2633565gzh4jqh7c5zf6i0iy9yxqigcv-glibc-mesboot0-2.2.5.drv" [color = cyan3];
"/gnu/store/7pllq0crksfkr7856y1pawcy4scc7l4q-gcc-mesboot1-4.7.4.drv" -> "/gnu/store/7wqw4023spvggi15vcxyxvivxa4rmmv8-bootstrap-binaries-0.drv" [color = cyan3];
"/gnu/store/7pllq0crksfkr7856y1pawcy4scc7l4q-gcc-mesboot1-4.7.4.drv" -> "/gnu/store/7wqw4023spvggi15vcxyxvivxa4rmmv8-bootstrap-binaries-0.drv" [color = cyan3];
"/gnu/store/7pllq0crksfkr7856y1pawcy4scc7l4q-gcc-mesboot1-4.7.4.drv" -> "/gnu/store/r50fj43103526ga6pi2f9jkk4gvaav7m-diffutils-mesboot-2.7.drv" [color = cyan3];
"/gnu/store/7pllq0crksfkr7856y1pawcy4scc7l4q-gcc-mesboot1-4.7.4.drv" -> "/gnu/store/r0z9bix88pz0wf6sgcn9185iwcsdracs-linux-libre-headers-bootstrap-0.drv" [color = cyan3];
"/gnu/store/7pllq0crksfkr7856y1pawcy4scc7l4q-gcc-mesboot1-4.7.4.drv" -> "/gnu/store/5ad88jy4a1gpbslzdiksk7zjyh28wzkr-make-mesboot-3.82.drv" [color = cyan3];
"/gnu/store/5ad88jy4a1gpbslzdiksk7zjyh28wzkr-make-mesboot-3.82.drv" [label = "make-mesboot@3.82", shape = box, fontname = Helvetica];
"/gnu/store/5ad88jy4a1gpbslzdiksk7zjyh28wzkr-make-mesboot-3.82.drv" -> "/gnu/store/x9shp86cz9f4rb5xvhs37zzxg1ngi4dr-binutils-mesboot0-2.20.1a.drv" [color = dimgrey];
"/gnu/store/5ad88jy4a1gpbslzdiksk7zjyh28wzkr-make-mesboot-3.82.drv" -> "/gnu/store/2633565gzh4jqh7c5zf6i0iy9yxqigcv-glibc-mesboot0-2.2.5.drv" [color = dimgrey];
"/gnu/store/5ad88jy4a1gpbslzdiksk7zjyh28wzkr-make-mesboot-3.82.drv" -> "/gnu/store/slnyk8gbnvfwy1m1was8myivpss58idd-gcc-mesboot0-2.95.3.drv" [color = dimgrey];
"/gnu/store/5ad88jy4a1gpbslzdiksk7zjyh28wzkr-make-mesboot-3.82.drv" -> "/gnu/store/57da9mdiqhyn72m8wv00pdvzqi2ng4xb-make-mesboot0-3.80.drv" [color = dimgrey];
"/gnu/store/5ad88jy4a1gpbslzdiksk7zjyh28wzkr-make-mesboot-3.82.drv" -> "/gnu/store/7wqw4023spvggi15vcxyxvivxa4rmmv8-bootstrap-binaries-0.drv" [color = dimgrey];
"/gnu/store/5ad88jy4a1gpbslzdiksk7zjyh28wzkr-make-mesboot-3.82.drv" -> "/gnu/store/7wqw4023spvggi15vcxyxvivxa4rmmv8-bootstrap-binaries-0.drv" [color = dimgrey];
"/gnu/store/5ad88jy4a1gpbslzdiksk7zjyh28wzkr-make-mesboot-3.82.drv" -> "/gnu/store/r0z9bix88pz0wf6sgcn9185iwcsdracs-linux-libre-headers-bootstrap-0.drv" [color = dimgrey];
"/gnu/store/3va8hfvfyp6dbwqk3036kb25wbp0f81z-gcc-core-mesboot0-2.95.3.drv" [label = "gcc-core-mesboot0@2.95.3", shape = box, fontname = sans];
"/gnu/store/3va8hfvfyp6dbwqk3036kb25wbp0f81z-gcc-core-mesboot0-2.95.3.drv" -> "/gnu/store/8ghnzf9idpmva8l4n8fyvvgqlln4rddi-binutils-mesboot0-2.14.drv" [color = red];
"/gnu/store/3va8hfvfyp6dbwqk3036kb25wbp0f81z-gcc-core-mesboot0-2.95.3.drv" -> "/gnu/store/yx5dz5gi00q8h5i138h59j1jmbhr3qa4-bash-mesboot0-2.05b.drv" [color = red];
"/gnu/store/3va8hfvfyp6dbwqk3036kb25wbp0f81z-gcc-core-mesboot0-2.95.3.drv" -> "/gnu/store/yy8bxckakx5f4rpvqfggrfy21y7bn53g-bzip2-mesboot-1.0.8.drv" [color = red];
"/gnu/store/3va8hfvfyp6dbwqk3036kb25wbp0f81z-gcc-core-mesboot0-2.95.3.drv" -> "/gnu/store/qyphha8i1pylf10pm76400kq5d07zsvr-gzip-mesboot-1.2.4.drv" [color = red];
"/gnu/store/3va8hfvfyp6dbwqk3036kb25wbp0f81z-gcc-core-mesboot0-2.95.3.drv" -> "/gnu/store/vn42sjmbh0zr9wn9lnbsdrxlh1zihx50-patch-mesboot-2.5.9.drv" [color = red];
"/gnu/store/3va8hfvfyp6dbwqk3036kb25wbp0f81z-gcc-core-mesboot0-2.95.3.drv" -> "/gnu/store/16w6l2c80hh98kfykal9hpbm93cscbcg-sed-mesboot0-1.18.drv" [color = red];
"/gnu/store/3va8hfvfyp6dbwqk3036kb25wbp0f81z-gcc-core-mesboot0-2.95.3.drv" -> "/gnu/store/yl8gsvanaj8wgngmgc4an06g5ybadad2-gash-utils-boot-0.1.0.drv" [color = red];
"/gnu/store/3va8hfvfyp6dbwqk3036kb25wbp0f81z-gcc-core-mesboot0-2.95.3.drv" -> "/gnu/store/h1m81zsyi3l4yd9r7pd3ffanb61pszxy-tcc-boot-0.9.27.drv" [color = red];
"/gnu/store/3va8hfvfyp6dbwqk3036kb25wbp0f81z-gcc-core-mesboot0-2.95.3.drv" -> "/gnu/store/hlm2wxhh0irfjnds4i86imdqi13iwj81-make-mesboot0-3.80.drv" [color = red];
"/gnu/store/3va8hfvfyp6dbwqk3036kb25wbp0f81z-gcc-core-mesboot0-2.95.3.drv" -> "/gnu/store/jrf5jckbwk949npav1p62vgcg95lr4mx-gash-boot-0.2.0.drv" [color = red];
"/gnu/store/3va8hfvfyp6dbwqk3036kb25wbp0f81z-gcc-core-mesboot0-2.95.3.drv" -> "/gnu/store/yl8gsvanaj8wgngmgc4an06g5ybadad2-gash-utils-boot-0.1.0.drv" [color = red];
"/gnu/store/3va8hfvfyp6dbwqk3036kb25wbp0f81z-gcc-core-mesboot0-2.95.3.drv" -> "/gnu/store/w77kjhmj4c4sncndnh0kvf0jfpwpradm-bootar-1a.drv" [color = red];
"/gnu/store/3va8hfvfyp6dbwqk3036kb25wbp0f81z-gcc-core-mesboot0-2.95.3.drv" -> "/gnu/store/qs4086i9b9q0b74l4wjqgzbdc3c0f58f-guile-bootstrap-2.0.drv" [color = red];
"/gnu/store/8ghnzf9idpmva8l4n8fyvvgqlln4rddi-binutils-mesboot0-2.14.drv" [label = "binutils-mesboot0@2.14", shape = box, fontname = sans];
"/gnu/store/8ghnzf9idpmva8l4n8fyvvgqlln4rddi-binutils-mesboot0-2.14.drv" -> "/gnu/store/yx5dz5gi00q8h5i138h59j1jmbhr3qa4-bash-mesboot0-2.05b.drv" [color = cyan3];
"/gnu/store/8ghnzf9idpmva8l4n8fyvvgqlln4rddi-binutils-mesboot0-2.14.drv" -> "/gnu/store/yy8bxckakx5f4rpvqfggrfy21y7bn53g-bzip2-mesboot-1.0.8.drv" [color = cyan3];
"/gnu/store/8ghnzf9idpmva8l4n8fyvvgqlln4rddi-binutils-mesboot0-2.14.drv" -> "/gnu/store/qyphha8i1pylf10pm76400kq5d07zsvr-gzip-mesboot-1.2.4.drv" [color = cyan3];
"/gnu/store/8ghnzf9idpmva8l4n8fyvvgqlln4rddi-binutils-mesboot0-2.14.drv" -> "/gnu/store/vn42sjmbh0zr9wn9lnbsdrxlh1zihx50-patch-mesboot-2.5.9.drv" [color = cyan3];
"/gnu/store/8ghnzf9idpmva8l4n8fyvvgqlln4rddi-binutils-mesboot0-2.14.drv" -> "/gnu/store/16w6l2c80hh98kfykal9hpbm93cscbcg-sed-mesboot0-1.18.drv" [color = cyan3];
"/gnu/store/8ghnzf9idpmva8l4n8fyvvgqlln4rddi-binutils-mesboot0-2.14.drv" -> "/gnu/store/yl8gsvanaj8wgngmgc4an06g5ybadad2-gash-utils-boot-0.1.0.drv" [color = cyan3];
"/gnu/store/8ghnzf9idpmva8l4n8fyvvgqlln4rddi-binutils-mesboot0-2.14.drv" -> "/gnu/store/h1m81zsyi3l4yd9r7pd3ffanb61pszxy-tcc-boot-0.9.27.drv" [color = cyan3];
"/gnu/store/8ghnzf9idpmva8l4n8fyvvgqlln4rddi-binutils-mesboot0-2.14.drv" -> "/gnu/store/hlm2wxhh0irfjnds4i86imdqi13iwj81-make-mesboot0-3.80.drv" [color = cyan3];
"/gnu/store/8ghnzf9idpmva8l4n8fyvvgqlln4rddi-binutils-mesboot0-2.14.drv" -> "/gnu/store/jrf5jckbwk949npav1p62vgcg95lr4mx-gash-boot-0.2.0.drv" [color = cyan3];
"/gnu/store/8ghnzf9idpmva8l4n8fyvvgqlln4rddi-binutils-mesboot0-2.14.drv" -> "/gnu/store/yl8gsvanaj8wgngmgc4an06g5ybadad2-gash-utils-boot-0.1.0.drv" [color = cyan3];
"/gnu/store/8ghnzf9idpmva8l4n8fyvvgqlln4rddi-binutils-mesboot0-2.14.drv" -> "/gnu/store/w77kjhmj4c4sncndnh0kvf0jfpwpradm-bootar-1a.drv" [color = cyan3];
"/gnu/store/8ghnzf9idpmva8l4n8fyvvgqlln4rddi-binutils-mesboot0-2.14.drv" -> "/gnu/store/qs4086i9b9q0b74l4wjqgzbdc3c0f58f-guile-bootstrap-2.0.drv" [color = cyan3];
"/gnu/store/yx5dz5gi00q8h5i138h59j1jmbhr3qa4-bash-mesboot0-2.05b.drv" [label = "bash-mesboot0@2.05b", shape = box, fontname = sans];
"/gnu/store/yx5dz5gi00q8h5i138h59j1jmbhr3qa4-bash-mesboot0-2.05b.drv" -> "/gnu/store/hlm2wxhh0irfjnds4i86imdqi13iwj81-make-mesboot0-3.80.drv" [color = darkgoldenrod];
"/gnu/store/yx5dz5gi00q8h5i138h59j1jmbhr3qa4-bash-mesboot0-2.05b.drv" -> "/gnu/store/0izhx7j1n6lcpcbvy9i9pyjkzjpbxrcj-tcc-boot0-0.9.26-1103-g6e62e0e.drv" [color = darkgoldenrod];
"/gnu/store/yx5dz5gi00q8h5i138h59j1jmbhr3qa4-bash-mesboot0-2.05b.drv" -> "/gnu/store/jrf5jckbwk949npav1p62vgcg95lr4mx-gash-boot-0.2.0.drv" [color = darkgoldenrod];
"/gnu/store/yx5dz5gi00q8h5i138h59j1jmbhr3qa4-bash-mesboot0-2.05b.drv" -> "/gnu/store/yl8gsvanaj8wgngmgc4an06g5ybadad2-gash-utils-boot-0.1.0.drv" [color = darkgoldenrod];
"/gnu/store/yx5dz5gi00q8h5i138h59j1jmbhr3qa4-bash-mesboot0-2.05b.drv" -> "/gnu/store/w77kjhmj4c4sncndnh0kvf0jfpwpradm-bootar-1a.drv" [color = darkgoldenrod];
"/gnu/store/yx5dz5gi00q8h5i138h59j1jmbhr3qa4-bash-mesboot0-2.05b.drv" -> "/gnu/store/qs4086i9b9q0b74l4wjqgzbdc3c0f58f-guile-bootstrap-2.0.drv" [color = darkgoldenrod];
"/gnu/store/hlm2wxhh0irfjnds4i86imdqi13iwj81-make-mesboot0-3.80.drv" [label = "make-mesboot0@3.80", shape = box, fontname = sans];
"/gnu/store/hlm2wxhh0irfjnds4i86imdqi13iwj81-make-mesboot0-3.80.drv" -> "/gnu/store/0izhx7j1n6lcpcbvy9i9pyjkzjpbxrcj-tcc-boot0-0.9.26-1103-g6e62e0e.drv" [color = magenta];
"/gnu/store/hlm2wxhh0irfjnds4i86imdqi13iwj81-make-mesboot0-3.80.drv" -> "/gnu/store/jrf5jckbwk949npav1p62vgcg95lr4mx-gash-boot-0.2.0.drv" [color = magenta];
"/gnu/store/hlm2wxhh0irfjnds4i86imdqi13iwj81-make-mesboot0-3.80.drv" -> "/gnu/store/yl8gsvanaj8wgngmgc4an06g5ybadad2-gash-utils-boot-0.1.0.drv" [color = magenta];
"/gnu/store/hlm2wxhh0irfjnds4i86imdqi13iwj81-make-mesboot0-3.80.drv" -> "/gnu/store/w77kjhmj4c4sncndnh0kvf0jfpwpradm-bootar-1a.drv" [color = magenta];
"/gnu/store/hlm2wxhh0irfjnds4i86imdqi13iwj81-make-mesboot0-3.80.drv" -> "/gnu/store/qs4086i9b9q0b74l4wjqgzbdc3c0f58f-guile-bootstrap-2.0.drv" [color = magenta];
"/gnu/store/0izhx7j1n6lcpcbvy9i9pyjkzjpbxrcj-tcc-boot0-0.9.26-1103-g6e62e0e.drv" [label = "tcc-boot0@0.9.26-1103-g6e62e0e", shape = box, fontname = sans];
"/gnu/store/0izhx7j1n6lcpcbvy9i9pyjkzjpbxrcj-tcc-boot0-0.9.26-1103-g6e62e0e.drv" -> "/gnu/store/iny72b5k1f531xv7fr2i31j4gqknjv2l-mes-boot-0.22.drv" [color = darkseagreen];
"/gnu/store/0izhx7j1n6lcpcbvy9i9pyjkzjpbxrcj-tcc-boot0-0.9.26-1103-g6e62e0e.drv" -> "/gnu/store/a6nbjivhxp65wqj5s8rz0fnmwzqxmhry-bootstrap-mescc-tools-0.5.2.drv" [color = darkseagreen];
"/gnu/store/0izhx7j1n6lcpcbvy9i9pyjkzjpbxrcj-tcc-boot0-0.9.26-1103-g6e62e0e.drv" -> "/gnu/store/jrf5jckbwk949npav1p62vgcg95lr4mx-gash-boot-0.2.0.drv" [color = darkseagreen];
"/gnu/store/0izhx7j1n6lcpcbvy9i9pyjkzjpbxrcj-tcc-boot0-0.9.26-1103-g6e62e0e.drv" -> "/gnu/store/yl8gsvanaj8wgngmgc4an06g5ybadad2-gash-utils-boot-0.1.0.drv" [color = darkseagreen];
"/gnu/store/0izhx7j1n6lcpcbvy9i9pyjkzjpbxrcj-tcc-boot0-0.9.26-1103-g6e62e0e.drv" -> "/gnu/store/w77kjhmj4c4sncndnh0kvf0jfpwpradm-bootar-1a.drv" [color = darkseagreen];
"/gnu/store/0izhx7j1n6lcpcbvy9i9pyjkzjpbxrcj-tcc-boot0-0.9.26-1103-g6e62e0e.drv" -> "/gnu/store/qs4086i9b9q0b74l4wjqgzbdc3c0f58f-guile-bootstrap-2.0.drv" [color = darkseagreen];
"/gnu/store/iny72b5k1f531xv7fr2i31j4gqknjv2l-mes-boot-0.22.drv" [label = "mes-boot@0.22", shape = box, fontname = sans];
"/gnu/store/iny72b5k1f531xv7fr2i31j4gqknjv2l-mes-boot-0.22.drv" -> "/gnu/store/xdhz4v7icrfwdbq1j5j052id8l04arms-bootstrap-mes-rewired-0.19.drv" [color = peachpuff4];
"/gnu/store/iny72b5k1f531xv7fr2i31j4gqknjv2l-mes-boot-0.22.drv" -> "/gnu/store/a6nbjivhxp65wqj5s8rz0fnmwzqxmhry-bootstrap-mescc-tools-0.5.2.drv" [color = peachpuff4];
"/gnu/store/iny72b5k1f531xv7fr2i31j4gqknjv2l-mes-boot-0.22.drv" -> "/gnu/store/jrf5jckbwk949npav1p62vgcg95lr4mx-gash-boot-0.2.0.drv" [color = peachpuff4];
"/gnu/store/iny72b5k1f531xv7fr2i31j4gqknjv2l-mes-boot-0.22.drv" -> "/gnu/store/yl8gsvanaj8wgngmgc4an06g5ybadad2-gash-utils-boot-0.1.0.drv" [color = peachpuff4];
"/gnu/store/iny72b5k1f531xv7fr2i31j4gqknjv2l-mes-boot-0.22.drv" -> "/gnu/store/w77kjhmj4c4sncndnh0kvf0jfpwpradm-bootar-1a.drv" [color = peachpuff4];
"/gnu/store/iny72b5k1f531xv7fr2i31j4gqknjv2l-mes-boot-0.22.drv" -> "/gnu/store/qs4086i9b9q0b74l4wjqgzbdc3c0f58f-guile-bootstrap-2.0.drv" [color = peachpuff4];
"/gnu/store/xdhz4v7icrfwdbq1j5j052id8l04arms-bootstrap-mes-rewired-0.19.drv" [label = "bootstrap-mes-rewired@0.19", shape = box, fontname = sans];
"/gnu/store/xdhz4v7icrfwdbq1j5j052id8l04arms-bootstrap-mes-rewired-0.19.drv" -> "/gnu/store/r7bbw2ywmgqp6m5a1hp0fs4lhc51w3sq-bootstrap-mes-0.drv" [color = cyan3];
"/gnu/store/xdhz4v7icrfwdbq1j5j052id8l04arms-bootstrap-mes-rewired-0.19.drv" -> "/gnu/store/jrf5jckbwk949npav1p62vgcg95lr4mx-gash-boot-0.2.0.drv" [color = cyan3];
"/gnu/store/r7bbw2ywmgqp6m5a1hp0fs4lhc51w3sq-bootstrap-mes-0.drv" [label = "bootstrap-mes@0", shape = box, fontname = sans];
"/gnu/store/jrf5jckbwk949npav1p62vgcg95lr4mx-gash-boot-0.2.0.drv" [label = "gash-boot@0.2.0", shape = box, fontname = sans];
"/gnu/store/jrf5jckbwk949npav1p62vgcg95lr4mx-gash-boot-0.2.0.drv" -> "/gnu/store/w77kjhmj4c4sncndnh0kvf0jfpwpradm-bootar-1a.drv" [color = darkviolet];
"/gnu/store/jrf5jckbwk949npav1p62vgcg95lr4mx-gash-boot-0.2.0.drv" -> "/gnu/store/qs4086i9b9q0b74l4wjqgzbdc3c0f58f-guile-bootstrap-2.0.drv" [color = darkviolet];
"/gnu/store/w77kjhmj4c4sncndnh0kvf0jfpwpradm-bootar-1a.drv" [label = "bootar@1a", shape = box, fontname = sans];
"/gnu/store/w77kjhmj4c4sncndnh0kvf0jfpwpradm-bootar-1a.drv" -> "/gnu/store/qs4086i9b9q0b74l4wjqgzbdc3c0f58f-guile-bootstrap-2.0.drv" [color = blue];
"/gnu/store/qs4086i9b9q0b74l4wjqgzbdc3c0f58f-guile-bootstrap-2.0.drv" [label = "guile-bootstrap@2.0", shape = box, fontname = sans];
"/gnu/store/a6nbjivhxp65wqj5s8rz0fnmwzqxmhry-bootstrap-mescc-tools-0.5.2.drv" [label = "bootstrap-mescc-tools@0.5.2", shape = box, fontname = sans];
"/gnu/store/yl8gsvanaj8wgngmgc4an06g5ybadad2-gash-utils-boot-0.1.0.drv" [label = "gash-utils-boot@0.1.0", shape = box, fontname = sans];
"/gnu/store/yl8gsvanaj8wgngmgc4an06g5ybadad2-gash-utils-boot-0.1.0.drv" -> "/gnu/store/w77kjhmj4c4sncndnh0kvf0jfpwpradm-bootar-1a.drv" [color = blue];
"/gnu/store/yl8gsvanaj8wgngmgc4an06g5ybadad2-gash-utils-boot-0.1.0.drv" -> "/gnu/store/jrf5jckbwk949npav1p62vgcg95lr4mx-gash-boot-0.2.0.drv" [color = blue];
"/gnu/store/yl8gsvanaj8wgngmgc4an06g5ybadad2-gash-utils-boot-0.1.0.drv" -> "/gnu/store/qs4086i9b9q0b74l4wjqgzbdc3c0f58f-guile-bootstrap-2.0.drv" [color = blue];
"/gnu/store/yy8bxckakx5f4rpvqfggrfy21y7bn53g-bzip2-mesboot-1.0.8.drv" [label = "bzip2-mesboot@1.0.8", shape = box, fontname = sans];
"/gnu/store/yy8bxckakx5f4rpvqfggrfy21y7bn53g-bzip2-mesboot-1.0.8.drv" -> "/gnu/store/hlm2wxhh0irfjnds4i86imdqi13iwj81-make-mesboot0-3.80.drv" [color = blue];
"/gnu/store/yy8bxckakx5f4rpvqfggrfy21y7bn53g-bzip2-mesboot-1.0.8.drv" -> "/gnu/store/0izhx7j1n6lcpcbvy9i9pyjkzjpbxrcj-tcc-boot0-0.9.26-1103-g6e62e0e.drv" [color = blue];
"/gnu/store/yy8bxckakx5f4rpvqfggrfy21y7bn53g-bzip2-mesboot-1.0.8.drv" -> "/gnu/store/jrf5jckbwk949npav1p62vgcg95lr4mx-gash-boot-0.2.0.drv" [color = blue];
"/gnu/store/yy8bxckakx5f4rpvqfggrfy21y7bn53g-bzip2-mesboot-1.0.8.drv" -> "/gnu/store/yl8gsvanaj8wgngmgc4an06g5ybadad2-gash-utils-boot-0.1.0.drv" [color = blue];
"/gnu/store/yy8bxckakx5f4rpvqfggrfy21y7bn53g-bzip2-mesboot-1.0.8.drv" -> "/gnu/store/w77kjhmj4c4sncndnh0kvf0jfpwpradm-bootar-1a.drv" [color = blue];
"/gnu/store/yy8bxckakx5f4rpvqfggrfy21y7bn53g-bzip2-mesboot-1.0.8.drv" -> "/gnu/store/qs4086i9b9q0b74l4wjqgzbdc3c0f58f-guile-bootstrap-2.0.drv" [color = blue];
"/gnu/store/qyphha8i1pylf10pm76400kq5d07zsvr-gzip-mesboot-1.2.4.drv" [label = "gzip-mesboot@1.2.4", shape = box, fontname = sans];
"/gnu/store/qyphha8i1pylf10pm76400kq5d07zsvr-gzip-mesboot-1.2.4.drv" -> "/gnu/store/0izhx7j1n6lcpcbvy9i9pyjkzjpbxrcj-tcc-boot0-0.9.26-1103-g6e62e0e.drv" [color = red];
"/gnu/store/qyphha8i1pylf10pm76400kq5d07zsvr-gzip-mesboot-1.2.4.drv" -> "/gnu/store/jrf5jckbwk949npav1p62vgcg95lr4mx-gash-boot-0.2.0.drv" [color = red];
"/gnu/store/qyphha8i1pylf10pm76400kq5d07zsvr-gzip-mesboot-1.2.4.drv" -> "/gnu/store/yl8gsvanaj8wgngmgc4an06g5ybadad2-gash-utils-boot-0.1.0.drv" [color = red];
"/gnu/store/qyphha8i1pylf10pm76400kq5d07zsvr-gzip-mesboot-1.2.4.drv" -> "/gnu/store/w77kjhmj4c4sncndnh0kvf0jfpwpradm-bootar-1a.drv" [color = red];
"/gnu/store/qyphha8i1pylf10pm76400kq5d07zsvr-gzip-mesboot-1.2.4.drv" -> "/gnu/store/qs4086i9b9q0b74l4wjqgzbdc3c0f58f-guile-bootstrap-2.0.drv" [color = red];
"/gnu/store/vn42sjmbh0zr9wn9lnbsdrxlh1zihx50-patch-mesboot-2.5.9.drv" [label = "patch-mesboot@2.5.9", shape = box, fontname = sans];
"/gnu/store/vn42sjmbh0zr9wn9lnbsdrxlh1zihx50-patch-mesboot-2.5.9.drv" -> "/gnu/store/hlm2wxhh0irfjnds4i86imdqi13iwj81-make-mesboot0-3.80.drv" [color = darkseagreen];
"/gnu/store/vn42sjmbh0zr9wn9lnbsdrxlh1zihx50-patch-mesboot-2.5.9.drv" -> "/gnu/store/0izhx7j1n6lcpcbvy9i9pyjkzjpbxrcj-tcc-boot0-0.9.26-1103-g6e62e0e.drv" [color = darkseagreen];
"/gnu/store/vn42sjmbh0zr9wn9lnbsdrxlh1zihx50-patch-mesboot-2.5.9.drv" -> "/gnu/store/jrf5jckbwk949npav1p62vgcg95lr4mx-gash-boot-0.2.0.drv" [color = darkseagreen];
"/gnu/store/vn42sjmbh0zr9wn9lnbsdrxlh1zihx50-patch-mesboot-2.5.9.drv" -> "/gnu/store/yl8gsvanaj8wgngmgc4an06g5ybadad2-gash-utils-boot-0.1.0.drv" [color = darkseagreen];
"/gnu/store/vn42sjmbh0zr9wn9lnbsdrxlh1zihx50-patch-mesboot-2.5.9.drv" -> "/gnu/store/w77kjhmj4c4sncndnh0kvf0jfpwpradm-bootar-1a.drv" [color = darkseagreen];
"/gnu/store/vn42sjmbh0zr9wn9lnbsdrxlh1zihx50-patch-mesboot-2.5.9.drv" -> "/gnu/store/qs4086i9b9q0b74l4wjqgzbdc3c0f58f-guile-bootstrap-2.0.drv" [color = darkseagreen];
"/gnu/store/16w6l2c80hh98kfykal9hpbm93cscbcg-sed-mesboot0-1.18.drv" [label = "sed-mesboot0@1.18", shape = box, fontname = sans];
"/gnu/store/16w6l2c80hh98kfykal9hpbm93cscbcg-sed-mesboot0-1.18.drv" -> "/gnu/store/hlm2wxhh0irfjnds4i86imdqi13iwj81-make-mesboot0-3.80.drv" [color = darkgoldenrod];
"/gnu/store/16w6l2c80hh98kfykal9hpbm93cscbcg-sed-mesboot0-1.18.drv" -> "/gnu/store/0izhx7j1n6lcpcbvy9i9pyjkzjpbxrcj-tcc-boot0-0.9.26-1103-g6e62e0e.drv" [color = darkgoldenrod];
"/gnu/store/16w6l2c80hh98kfykal9hpbm93cscbcg-sed-mesboot0-1.18.drv" -> "/gnu/store/jrf5jckbwk949npav1p62vgcg95lr4mx-gash-boot-0.2.0.drv" [color = darkgoldenrod];
"/gnu/store/16w6l2c80hh98kfykal9hpbm93cscbcg-sed-mesboot0-1.18.drv" -> "/gnu/store/yl8gsvanaj8wgngmgc4an06g5ybadad2-gash-utils-boot-0.1.0.drv" [color = darkgoldenrod];
"/gnu/store/16w6l2c80hh98kfykal9hpbm93cscbcg-sed-mesboot0-1.18.drv" -> "/gnu/store/w77kjhmj4c4sncndnh0kvf0jfpwpradm-bootar-1a.drv" [color = darkgoldenrod];
"/gnu/store/16w6l2c80hh98kfykal9hpbm93cscbcg-sed-mesboot0-1.18.drv" -> "/gnu/store/qs4086i9b9q0b74l4wjqgzbdc3c0f58f-guile-bootstrap-2.0.drv" [color = darkgoldenrod];
"/gnu/store/h1m81zsyi3l4yd9r7pd3ffanb61pszxy-tcc-boot-0.9.27.drv" [label = "tcc-boot@0.9.27", shape = box, fontname = sans];
"/gnu/store/h1m81zsyi3l4yd9r7pd3ffanb61pszxy-tcc-boot-0.9.27.drv" -> "/gnu/store/yy8bxckakx5f4rpvqfggrfy21y7bn53g-bzip2-mesboot-1.0.8.drv" [color = blue];
"/gnu/store/h1m81zsyi3l4yd9r7pd3ffanb61pszxy-tcc-boot-0.9.27.drv" -> "/gnu/store/hlm2wxhh0irfjnds4i86imdqi13iwj81-make-mesboot0-3.80.drv" [color = blue];
"/gnu/store/h1m81zsyi3l4yd9r7pd3ffanb61pszxy-tcc-boot-0.9.27.drv" -> "/gnu/store/0izhx7j1n6lcpcbvy9i9pyjkzjpbxrcj-tcc-boot0-0.9.26-1103-g6e62e0e.drv" [color = blue];
"/gnu/store/h1m81zsyi3l4yd9r7pd3ffanb61pszxy-tcc-boot-0.9.27.drv" -> "/gnu/store/jrf5jckbwk949npav1p62vgcg95lr4mx-gash-boot-0.2.0.drv" [color = blue];
"/gnu/store/h1m81zsyi3l4yd9r7pd3ffanb61pszxy-tcc-boot-0.9.27.drv" -> "/gnu/store/yl8gsvanaj8wgngmgc4an06g5ybadad2-gash-utils-boot-0.1.0.drv" [color = blue];
"/gnu/store/h1m81zsyi3l4yd9r7pd3ffanb61pszxy-tcc-boot-0.9.27.drv" -> "/gnu/store/w77kjhmj4c4sncndnh0kvf0jfpwpradm-bootar-1a.drv" [color = blue];
"/gnu/store/h1m81zsyi3l4yd9r7pd3ffanb61pszxy-tcc-boot-0.9.27.drv" -> "/gnu/store/qs4086i9b9q0b74l4wjqgzbdc3c0f58f-guile-bootstrap-2.0.drv" [color = blue];
}

View File

@ -13,7 +13,7 @@
@set OPENPGP-SIGNING-KEY-ID 1A858392E331EAFDB8C27FFBF3C1A0D9C1D65273
@copying
Copyright @copyright{} 2018,2019 Jan (janneke) Nieuwenhuizen@*
Copyright @copyright{} 2018,2019,2020,2021,2022 Jan (janneke) Nieuwenhuizen@*
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or
@ -48,7 +48,7 @@ Edition @value{EDITION} @*
@contents
@c *********************************************************************
@node Top, Introduction, (dir), (dir)
@node Top
@top GNU Mes
This document describes GNU Mes version @value{VERSION}, a bootstrappable
@ -72,12 +72,19 @@ Software Freedom
* Reproducible Builds:: Reproducibility and free software.
* Bootstrappable Builds:: The freedom to build a software without binary seed.
* Full Source Bootstrap:: Software dependencies worthy of GNU.
* Reduced Binary Seed Bootstrap:: Guix reduces bootstrap binaries with 50%.
* Scheme-only Bootsrap:: Guix reduced bootstrap binaries to 25%.
* Full Source Bootstrap:: A bootstrap worthy of GNU.
* LISP as Maxwell's Equations of Software:: Auditable elegance.
Full Source Bootstrap
* Stage0:: The Magical Self-Hosting Hex Assembler.
* M2-Planet:: A Sub-C bootstrap compiler.
Installation
* Regular Requirements:: Software needed to build and run Mes.
* Requirements:: Software needed to build and run Mes.
* Bootstrap Requirements:: Software needed to bootstrap Mes.
* Running the Test Suites:: Testing Mes.
@ -109,7 +116,7 @@ Contributing
@end menu
@c *********************************************************************
@node Introduction, Installation, Top, Top
@node Introduction
@chapter Introduction
@quotation
@ -187,15 +194,17 @@ Freedom 1.
@menu
* Reproducible Builds:: Reproducibility and free software.
* Bootstrappable Builds:: The freedom to build a software without binary seed.
* Full Source Bootstrap:: Software dependencies worthy of GNU.
* Reduced Binary Seed Bootstrap:: Guix reduces bootstrap binaries with 50%.
* Scheme-only Bootsrap:: Guix reduced bootstrap binaries to 25%.
* Full Source Bootstrap:: A bootstrap worthy of GNU.
* LISP as Maxwell's Equations of Software:: Auditable elegance.
@end menu
@node Reproducible Builds, Bootstrappable Builds, Introduction, Introduction
@node Reproducible Builds
@section Reproducible Builds
The current Reproducible Builds effort incubated in the Debian
project@footnote{@url{http://debian.org, The Debian Project}} and was
project@footnote{@url{https://debian.org, The Debian Project}} and was
organized by Lunar. Quoting the Reproducible Builds
website@footnote{@url{https://reproducible-builds.org/,Reproducible
Builds}}
@ -240,7 +249,7 @@ packages could be rebuild bit-identical from source.
@author Martin Uecker
@end quotation
@node Bootstrappable Builds, Full Source Bootstrap, Reproducible Builds, Introduction
@node Bootstrappable Builds
@section Bootstrappable Builds
Software distributions that take reproducible builds seriously are
@ -258,10 +267,11 @@ binary seed that all software distributions inject are the so called
@emph{bootstrap binary seed}. Bootstrap binaries are the initial binary
seeds that are used to start building the distribution.
The GNU Guix operating system, version 1.0 had a relatively small
closure of bootstrap binary seed: GNU binutils, GNU gcc, GNU Libc, GNU
Guile, and ``Static binaries'' (think: bash, bzip2, coreutils, gawk,
grep, gzip, patch, sed, tar, xz).
The GNU Guix operating system (@pxref{Top,,, guix, The GNU Guix
Manual}), version 1.0 had a relatively small closure of bootstrap binary
seed: GNU binutils, GNU gcc, GNU Libc, GNU Guile, and ``Static
binaries'' (think: bash, bzip2, coreutils, gawk, grep, gzip, patch, sed,
tar, xz).
@example
$ du -schx $(readlink $(guix build bootstrap-tarballs)/*)
@ -288,6 +298,9 @@ $ du -schx *
252M total
@end example
@node Reduced Binary Seed Bootstrap
@section Reduced Binary Seed Bootstrap
During the Guix 1.1 development series we managed to create the first
reduction by 50% of the Guix @emph{bootstrap binary seed}@footnote{See
@url{https://guix.gnu.org/blog/2019/guix-reduces-bootstrap-seed-by-50/}}.
@ -295,16 +308,37 @@ This was a very important step because the ~250MB @emph{seed} of binary
code was practically non-auditable, which makes it hard to establish
what source code produced them.
@node Full Source Bootstrap, , Bootstrappable Builds, Introduction
@section Full Source Bootstrap
@node Scheme-only Bootsrap
@section Scheme-only Bootstrap
There is an obvious solution: we cannot allow any binary seeds in our
software stack. Not even in the bootstrap binary seed. Maybe that is a
bit too strong: we want to have the absolute minimum of binary seeds and
all binary seeds need to be inspectable and must be reviewed. How big
would the absolute minimal set be?
The next step that Guix has taken is to replace the shell and all its
utilities with implementations in Guile Scheme, the @emph{Scheme-only
bootstrap}. This second halving of the boostrap binaries reduced their
size to 25% @footnote{See
@url{https://guix.gnu.org/en/blog/2020/guix-further-reduces-bootstrap-seed-to-25/}}.
Gash (@pxref{Gash,,, gash, The Gash manual}) is a POSIX-compatible shell
that replaces Bash, and it comes with Gash Utils which has minimalist
replacements for Awk, the GNU Core Utilities, Grep, Gzip, Sed, and Tar.
The rest of the bootstrap binary seeds that were removed are now built
from source.
@subsection The Magical Self-Hosting Hex Assembler
@node Full Source Bootstrap
@section Full Source Bootstrap
Reduction of binary seeds is great, but there is an obvious target: we
cannot allow any binary seeds in our software stack. Not even in the
bootstrap binary seed. Maybe that is a bit too strong: we want to have
the absolute minimum of binary seeds and all binary seeds need to be
inspectable and must be reviewed. How big would the absolute minimal
set be?
@menu
* Stage0:: The Magical Self-Hosting Hex Assembler.
* M2-Planet:: A Sub-C bootstrap compiler.
@end menu
@node Stage0
@subsection Stage0
June 2016 I learnt about
@url{https://github.com/oriansj/stage0/,Stage0}. Jeremiah Orians
@ -331,7 +365,7 @@ Most computers work pretty well so apparently there is not a pressing
need to inspect and study all of these codes. At the same time it is
tricky to fully trust@footnote{ Ken Thompson's 1984 Turing award
acceptance speech
@url{http://www.ece.cmu.edu/~ganger/712.fall02/papers/p761-thompson.pdf,
@url{https://www.ece.cmu.edu/~ganger/712.fall02/papers/p761-thompson.pdf,
Reflections on Trusting Tust}.} a computer that was bootstrapped in this
way.
@ -409,13 +443,25 @@ nothing to all of the programs that our computer runs. Something that
seemed to be an impossible dream is suddenly starting to look like
``just a couple years of work''.
@node M2-Planet
@subsection M2-Planet
@url{https://github.com/oriansj/m2-planet/,M2-Planet} @footnote{The
PLAtform NEutral Transpiler}, when combined with
@url{https://savannah.gnu.org/projects/mescc-tools/, mescc-tools};
allows one to compile a subset of the C language into working binaries
with introspective steps inbetween. In 2021 M2-Planet with release
1.8.0 reached a level of maturity that allowed to build MesCC-Tools and
Mes. This allows for another reduction the Guix bootstrap binaries: mes
and mescc-tools can be removed.
@node LISP as Maxwell's Equations of Software
@section LISP as Maxwell's Equations of Software
As fate would have it, I stumbled upon this
@url{https://queue.acm.org/detail.cfm?id=1039523, interview with Alan
Kay}, where he shares a revelation he had when reading John McCarthy's
@url{http://www.softwarepreservation.org/projects/LISP/book/LISP%201.5%20Programmers%20Manual.pdf,
@url{https://www.softwarepreservation.org/projects/LISP/book/LISP%201.5%20Programmers%20Manual.pdf,
LISP-1.5} manual:
@quotation
@ -480,7 +526,7 @@ It is our sincerest hope to bring back this level of quality and
elegance..
@c *********************************************************************
@node Installation, Bootstrapping, Introduction, Top
@node Installation
@chapter Installation
@cindex installing Mes
@ -491,13 +537,13 @@ to use it.
@menu
* Regular Requirements:: Software needed to build and run Mes.
* Requirements:: Software needed to build and run Mes.
* Bootstrap Requirements:: Software needed to bootstrap Mes.
* Running the Test Suites:: Testing Mes.
@end menu
@node Regular Requirements, Bootstrap Requirements, Installation, Installation
@section Regular Requirements
@node Requirements
@section Requirements
This section lists requirements when building Mes from source. The
build procedure for Mes is the same as for other GNU software, and is
@ -507,12 +553,19 @@ in the Mes source tree for additional details.
GNU Mes depends on the following packages:
@itemize
@item @url{http://gnu.org/software/guile/, GNU Guile}, version 2.0.13 or
later, including 2.2.x;
@item @url{http://www.gnu.org/software/make/, GNU Make}.
@item @url{https://savannah.gnu.org/projects/nyacc/, NYACC}, 0.93.0 or later, including 0.99.0.
@item @url{http://gcc.gnu.org, GCC's gcc}, version 2.95.3 or later.
@item @url{https://savannah.gnu.org/projects/mescc-tools/, mescc-tools}, version 0.6.1 or later,
@item @url{https://gnu.org/software/guile/, GNU Guile}, version 2.0.13 or
later, including 2.2.x and 3.0.x,
@item @url{https://www.gnu.org/software/make/, GNU Make}.
@item @url{https://savannah.gnu.org/projects/nyacc/, NYACC}, version 1.00.2,
@item @url{https://gcc.gnu.org, GCC's gcc}, version 2.95.3 or later, including 10.2.0,
@item @url{https://savannah.gnu.org/projects/mescc-tools/, mescc-tools}, version 1.4.0,
@end itemize
The following dependencies are optional:
@itemize
Support for building the bootstrap @file{bin/mes-m2} depends on
@item @url{https://github.com/oriansj/m2-planet/, M2-Planet}, version 1.9.0.
@end itemize
@cindex Guile, compatibility
@ -520,7 +573,7 @@ Mes is compatible with GNU Guile, so it is possible to share the same
Scheme code between both. Currently Mes only supports the minimal
subset of R5RS and Guile extensions to run MesCC.
@node Bootstrap Requirements, Running the Test Suites, Regular Requirements, Installation
@node Bootstrap Requirements
@section Bootstrap Requirements
This section lists requirements when building Mes as a bootstrap
@ -541,11 +594,12 @@ Bootstrapping Mes depends on the following packages:
@itemize
@item a POSIX-compatible shell
@item @url{https://github.com/oriansj/mescc-tools/, mescc-tools}, version 0.6.1 or later.
@item @url{https://savannah.gnu.org/projects/nyacc/, NYACC}, 0.93.0 or later, including 0.99.0.
@item @url{https://savannah.gnu.org/projects/mescc-tools/, mescc-tools}, version 1.4.0,
@item @url{https://github.com/oriansj/m2-planet/, M2-Planet}, version 1.9.0.
@item @url{https://savannah.gnu.org/projects/nyacc/, NYACC}, version 1.00.2,
@end itemize
@node Running the Test Suites, , Bootstrap Requirements, Installation
@node Running the Test Suites
@section Running the Test Suites
@cindex test suites
@ -588,7 +642,7 @@ CC=gcc CC32=i686-unknown-linux-gnu-gcc MES=guile \
build-aux/test.sh scaffold/tests/00-exit-0
@end example
@node Bootstrapping, Contributing, Installation, Top
@node Bootstrapping
@chapter Bootstrapping
@quotation
@ -633,14 +687,14 @@ responsibility.
* Invoking mesar::
@end menu
@node The Mes Bootstrap Process, Invoking mes, Bootstrapping, Bootstrapping
@node The Mes Bootstrap Process
@section The Mes Bootstrap Process
The Reduced Binary Seed bootstrap currently adopted by Guix@footnote{See
@file{gnu/packages/commencement.scm} in the @var{master} branch in Guix
git
@url{http://git.savannah.gnu.org/cgit/guix.git/tree/gnu/packages/commencement.scm}}.
In its intiial form it is only available for x86-linux.
@url{https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/packages/commencement.scm}}.
In its intiial form it is only available for x86-linux and armhf-linux.
Currently, it goes like this:
@ -679,19 +733,23 @@ Currently, it goes like this:
^
|
*
bootstrap-mescc-tools, bootstrap-mes (~10MB)
bootstrap-bash, bootstrap-coreutils&co, bootstrap-guile (~120MB)
gash-boot, gash-utils-boot
^
|
*
bootstrap-mescc-tools, bootstrap-mes (~12 MiB)
bootstrap-guile (~48 MiB)
@end verbatim
@c This graph is generated from wip-bootstrap, doing:
@c ~/src/guix/core-updates/pre-inst-env guix graph --type=bag -e '(@@ (gnu packages commencement) gcc-mesboot)' > doc/images/gcc-mesboot-graph.dot
@c guix graph --type=bag -e '(@@ (gnu packages commencement) gcc-core-mesboot0)' > doc/images/gcc-mesboot-graph.dot
@c dot -T png doc/images/gcc-mesboot-graph.dot > doc/images/gcc-mesboot-graph.png
Here's a generated dependency diagram to for the final bootstrap gcc
Here's a generated dependency diagram to for the initial bootstrap gcc
that builds the rest of Guix.
@image{images/gcc-mesboot-graph,2in,,Reference graph of the gcc-mesboot}
@image{images/gcc-mesboot-graph,6in,,Reference graph of the gcc-core-mesboot0}
Work is ongoing to remove these binary seeds that were intentionally
injected by our own doing as temporary shortcut
@ -699,19 +757,16 @@ injected by our own doing as temporary shortcut
bootstrap-mescc-tools (seed), bootstrap-mes (seed)
@end example
For now, these additional non-bootstrapped dependencies (i.e., binary
For now, this additional non-bootstrapped dependencies (i.e., binary
seeds) are taken for granted
@example
bootstrap-guile, bash, bzip2, coreutils, gawk, grep, gzip, patch, sed,
tar, xz
bootstrap-guile
@end example
Although we think these are less essential and thus less interesting
than the GNU toolchain triplet that we focussed on initially, our next
priority is to eleminate these one by one.
Our next priority is to eleminate these one by one.
@node Invoking mes, Invoking mescc, The Mes Bootstrap Process, Bootstrapping
@node Invoking mes
@section Invoking mes
@cindex repl
@ -787,7 +842,7 @@ Display the current version of mes%, and then exit.
* Environment Variables:: If the bits won't change, change their habitat.
@end menu
@node Environment Variables, , Invoking mes, Invoking mes
@node Environment Variables
@subsection Environment Variables
@cindex environment variables
@cindex shell
@ -865,7 +920,7 @@ Mes uses @var{@strong{GUILE}_LOAD_PATH} for compatibility with Guile.
@end table
@node Invoking mescc, Invoking mesar, Invoking mes, Bootstrapping
@node Invoking mescc
@section Invoking mescc
@example
@ -880,7 +935,7 @@ The @var{option}s can be among the following:
align @var{symbol}, the default is @code{functions}; other valid values
are: @code{globals}.
@item --base-address=ADRRESS
@item --base-address=ADDRESS
use BaseAddress ADDRESS [0x1000000]
@item -c
@ -947,7 +1002,7 @@ specify LANGUAGE of the following input files
* MesCC Environment Variables:: There's no NIX like POSIX.
@end menu
@node MesCC Environment Variables, , Invoking mescc, Invoking mescc
@node MesCC Environment Variables
@subsection MesCC Environment Variables
@table @env
@ -976,7 +1031,7 @@ during the parsing phase.
@end table
@node Invoking mesar, , Invoking mescc, Bootstrapping
@node Invoking mesar
@section Invoking mesar
@example
@ -1006,7 +1061,7 @@ display version and exit
@end table
@c *********************************************************************
@node Contributing, Acknowledgments, Bootstrapping, Top
@node Contributing
@chapter Contributing
@menu
@ -1018,7 +1073,7 @@ display version and exit
* Submitting Patches:: Share your work.
@end menu
@node Building from Git, Running Mes From the Source Tree, Contributing, Contributing
@node Building from Git
@section Building from Git
If you want to hack GNU Mes itself, it is recommended to use the latest
@ -1034,15 +1089,26 @@ all the dependencies and appropriate environment variables are set up to
hack on Mes:
@example
guix environment -l .guix.scm
guix shell
@end example
If you are unable to use Guix when building Mes from a Git checkout,
the following are the required packages in addition to those mentioned
in the installation instructions (@pxref{Requirements}).
@itemize
@item @url{https://gnu.org/software/help2man/, GNU Help2man};
@item @url{https://gnu.org/software/texinfo/, GNU Texinfo};
@item @url{https://www.graphviz.org/, Graphviz};
@item @url{https://www.perl.org/, Perl}.
@end itemize
Finally, you have to invoke @code{make check} to run tests
(@pxref{Running the Test Suites}). If anything fails, take a look at
installation instructions (@pxref{Installation}) or send a message to
the @email{bug-mes@@gnu.org} mailing list.
@node Running Mes From the Source Tree, Porting GNU Mes, Building from Git, Contributing
@node Running Mes From the Source Tree
@section Running Mes From the Source Tree
First, you need to have an environment with all the dependencies
@ -1050,15 +1116,15 @@ available (@pxref{Building from Git}), and then simply prefix each
command by @command{./pre-inst-env} (the @file{pre-inst-env} script
lives in the top build tree of Mes).
@node Porting GNU Mes, The Perfect Setup, Running Mes From the Source Tree, Contributing
@node Porting GNU Mes
@section Porting GNU Mes
Mes was written for x86-linux. A 64 bit (x86_64) is almost done, only a
few bugs remain. The Guix bootstrap for x86_64 uses x86 mes and that is
not expected to change.
Mes is supported for x86-linux and armhf-linux. A 64 bit (x86_64-linux)
is almost done, only a few bugs remain. The Guix bootstrap for
x86_64-linux uses mes for x86-lunix and that is not expected to change.
Likewise, aarch64-linux uses mes for armhf-linux.
An ARM (armv4/armv7l) linux port is underway. A port to GNU/Hurd
(x86-gnu) is also underway.
A port to GNU/Hurd (x86-gnu) is underway.
Initial scaffold, built by @file{build-aux/build-scaffold.sh}:
@example
@ -1083,14 +1149,14 @@ Porting MesCC:
@file{mes/module/mescc/i386/info.mes}
@end example
@node The Perfect Setup, Coding Style, Porting GNU Mes, Contributing
@node The Perfect Setup
@section The Perfect Setup
The Perfect Setup to hack on Mes is basically the perfect setup used
for Guile hacking (@pxref{Using Guile in Emacs,,, guile, Guile Reference
Manual}). First, you need more than an editor, you need
@url{http://www.gnu.org/software/emacs, Emacs}, empowered by the
wonderful @url{http://nongnu.org/geiser/, Geiser}.
@url{https://www.gnu.org/software/emacs, Emacs}, empowered by the
wonderful @url{https://nongnu.org/geiser/, Geiser}.
Geiser allows for interactive and incremental development from within
Emacs: code compilation and evaluation from within buffers, access to
@ -1098,7 +1164,7 @@ on-line documentation (docstrings), context-sensitive completion,
@kbd{M-.} to jump to an object definition, a REPL to try out your code,
and more (@pxref{Introduction,,, geiser, Geiser User Manual}).
@node Coding Style, Submitting Patches, The Perfect Setup, Contributing
@node Coding Style
@section Coding Style
In general our code follows the GNU Coding Standards (@pxref{Top,,,
@ -1115,7 +1181,7 @@ Scheme code in Mes is written in a purely functional style.
@cindex coding style
When writing Scheme code, we follow common wisdom among Scheme
programmers. In general, we follow the
@url{http://mumble.net/~campbell/scheme/style.txt, Riastradh's Lisp
@url{https://mumble.net/~campbell/scheme/style.txt, Riastradh's Lisp
Style Rules}. This document happens to describe the conventions mostly
used in Guiles code too. It is very thoughtful and well written, so
please do read it.
@ -1134,13 +1200,13 @@ Additionally, in Mes we prefer to format @code{if} statements like this
else))
@end example
@node Submitting Patches, , Coding Style, Contributing
@node Submitting Patches
@section Submitting Patches
Development is done using the Git distributed version control system.
Thus, access to the repository is not strictly necessary. We welcome
contributions in the form of patches as produced by @code{git
format-patch} sent to the @email{guix-patches@@gnu.org} mailing list.
format-patch} sent to the @email{bug-mes@@gnu.org} mailing list.
Please write commit logs in the ChangeLog format (@pxref{Change Logs,,,
standards, GNU Coding Standards}); you can check the commit history for
@ -1177,14 +1243,14 @@ It will be ready sooner if you help.
@end quotation
@cindex contact, irc, mailing list
Join us on @code{#bootstrappable} on the Freenode IRC network or on
@email{guix-devel@@gnu.org} to share your experience---good or bad.
Join us on @code{#bootstrappable} on the Libera Chat IRC network or on
@email{bug-mes@@gnu.org} to share your experience---good or bad.
@cindex bug, bug report, reporting a bug
Please send bug reports with full details to @email{bug-mes@@gnu.org}.
@c *********************************************************************
@node Acknowledgments, Resources, Contributing, Top
@node Acknowledgments
@chapter Acknowledgments
We would like to thank the following people for their help: Jeremiah
@ -1196,7 +1262,7 @@ LISP-1.5 and Alan Kay for their inspiring comment on
@url{https://queue.acm.org/detail.cfm?id=1039523, Page 13}.
@c *********************************************************************
@node Resources, GNU Free Documentation License, Acknowledgments, Top
@node Resources
@chapter Resources
@itemize
@ -1220,8 +1286,8 @@ collection of small/bootstrappable compilers, operating systems,
anything you need.
@item
@url{irc.freenode.net, #bootstrappable} The bootstrapping community home
at the freenode IRC network.
@url{irc.libera.chat, #bootstrappable} The bootstrapping community home
at the Libera Chat IRC network.
@item
@file{guix-devel@@gnu.org} The Guix mailing list, where it all started.
@ -1230,17 +1296,17 @@ at the freenode IRC network.
@end itemize
@c *********************************************************************
@node GNU Free Documentation License, Concept Index, Resources, Top
@node GNU Free Documentation License
@appendix GNU Free Documentation License
@cindex license, GNU Free Documentation License
@include fdl-1.3.texi
@c *********************************************************************
@node Concept Index, Programming Index, GNU Free Documentation License, Top
@node Concept Index
@unnumbered Concept Index
@printindex cp
@node Programming Index, , Concept Index, Top
@node Programming Index
@unnumbered Programming Index
@syncodeindex tp fn
@syncodeindex vr fn

View File

@ -1,7 +1,7 @@
;;; guix.scm -- Guix package definition
;;; GNU Mes --- Maxwell Equations of Software
;;; Copyright © 2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
;;; Copyright © 2018,2019,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
;;;
;;; This file is part of GNU Mes.
;;;
@ -30,7 +30,7 @@
;;
;; To use as the basis for a development environment, run:
;;
;; guix environment -l guix.scm
;; guix time-machine --commit=ffb616b69dced25b840f2e5178062072d89623eb -- shell
;;
;;; Code:

View File

@ -1,5 +1,5 @@
;;; GNU Mes --- Maxwell Equations of Software
;;; Copyright © 2016,2017,2018,2019,2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
;;; Copyright © 2016,2017,2018,2019,2020,2021,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
;;;
;;; This file is part of GNU Mes.
;;;
@ -54,32 +54,27 @@
(define-public mescc-tools
(package
(name "mescc-tools")
(version "1.1.0")
(source
(origin
(method url-fetch)
(uri (string-append
"http://git.savannah.nongnu.org/cgit/mescc-tools.git/snapshot/"
name "-Release_" version
".tar.gz"))
(file-name (string-append name "-" version ".tar.gz"))
(sha256
(base32
"12cjryqfd6m6j807pvhk7i4vr2q0jiibpfrpnq5s67iq9l4rrc6b"))))
(version "1.4.0")
(source (origin
(method git-fetch)
(uri (git-reference
(url "https://git.savannah.nongnu.org/r/mescc-tools.git")
(commit (string-append "Release_" version))
(recursive? #t))) ;for M2libc
(file-name (git-file-name name version))
(sha256
(base32
"0z2ni2qn2np1walcaqlxz8sinzb78d4hiq9glddzf26wxc226hs4"))))
(build-system gnu-build-system)
(supported-systems
'("aarch64-linux" "armhf-linux" "i686-linux" "x86_64-linux"))
(native-inputs (list which))
(arguments
`(#:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
(string-append "CC=" ,(cc-for-target)))
#:test-target "test"
#:phases (modify-phases %standard-phases
(delete 'configure)
(add-after 'unpack 'patch-prefix
(lambda _
(substitute* "sha256.sh"
(("\\$\\(which sha256sum\\)") (which "sha256sum")))
#t)))))
(delete 'configure))))
(synopsis "Tools for the full source bootstrapping process")
(description
"Mescc-tools is a collection of tools for use in a full source
@ -92,19 +87,18 @@ get_machine.")
(define-public m2-planet
(package
(name "m2-planet")
(version "1.7.0")
(source
(origin
(method git-fetch)
(uri (git-reference
(url "https://github.com/oriansj/m2-planet.git")
(commit (string-append "Release_" version))))
(file-name (string-append name "-" version ".tar.gz"))
(sha256
(base32
"052j63xv44zqy7jndjw36jpyciz00p11d78w2rhy539qa5vdzad7"))))
(native-inputs
`(("mescc-tools" ,mescc-tools)))
(version "1.9.0")
(source (origin
(method git-fetch)
(uri (git-reference
(url "https://github.com/oriansj/m2-planet")
(commit (string-append "Release_" version))
(recursive? #t))) ;for M2libc
(file-name (git-file-name name version))
(sha256
(base32
"0cgvvq91cbxxm93k8ayyvhpaf3c2lv10qw4wyqwn3hc1qb1cfyvr"))))
(native-inputs (list mescc-tools))
(build-system gnu-build-system)
(arguments
`(#:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
@ -112,18 +106,13 @@ get_machine.")
#:tests? #f
#:phases (modify-phases %standard-phases
(delete 'bootstrap)
(delete 'configure)
(add-after 'unpack 'patch-prefix
(lambda _
(substitute* "sha256.sh"
(("\\$\\(which sha256sum\\)") (which "sha256sum")))
#t)))))
(delete 'configure))))
(synopsis "The PLAtform NEutral Transpiler")
(description
"M2-Planet, The PLAtform NEutral Transpiler, when combined with
mescc-tools compiles a subset of the C language into working binaries
with introspective steps inbetween.")
(home-page "https://savannah.nongnu.org/projects/mescc-tools")
(home-page "https://github.com/oriansj/m2-planet")
(license gpl3+)))
(define-public nyacc-0.99
@ -153,10 +142,8 @@ with introspective steps inbetween.")
"DOCDIR = @prefix@/share/doc/$(PACKAGE_TARNAME)\n"))
#t))))
(build-system gnu-build-system)
(native-inputs
`(("pkg-config" ,pkg-config)))
(inputs
`(("guile" ,guile-2.2)))
(native-inputs (list pkg-config))
(inputs (list guile-2.2))
(synopsis "LALR(1) Parser Generator in Guile")
(description
"NYACC is an LALR(1) parser generator implemented in Guile.
@ -191,49 +178,55 @@ extensive examples, including parsers for the Javascript and C99 languages.")
(sha256
(base32
"065ksalfllbdrzl12dz9d9dcxrv97wqxblslngsc6kajvnvlyvpk"))))
(inputs
`(("guile" ,guile-3.0)))))
(inputs (list guile-3.0))))
(define-public mes
(package
(name "mes")
(version "0.22")
(version #!mes!# "0.24.2")
(source (origin
(method url-fetch)
(uri (string-append
"https://ftp.gnu.org/pub/gnu/mes/mes-" version ".tar.gz"))
(sha256
(base32 #!mes!# "04pajp8v31na34ls4730ig5f6miiplhdvkmsb9ls1b8bbmw2vb4n"))))
(base32 #!mes!# "0vp8v88zszh1imm3dvdfi3m8cywshdj7xcrsq4cgmss69s2y1nkx"))))
(build-system gnu-build-system)
(supported-systems '("aarch64-linux" "armhf-linux" "i686-linux" "x86_64-linux"))
(propagated-inputs
`(("mescc-tools" ,mescc-tools)
("nyacc" ,nyacc)))
(propagated-inputs (list mescc-tools nyacc))
(native-inputs
`(("guile" ,guile-3.0-latest)
,@(cond ((string-prefix? "x86_64-linux" (or (%current-target-system)
(%current-system)))
;; Use cross-compiler rather than #:system "i686-linux" to get
;; MesCC 64 bit .go files installed ready for use with Guile.
(let ((triplet "i686-unknown-linux-gnu"))
`(("i686-linux-binutils" ,(cross-binutils triplet))
("i686-linux-gcc" ,(cross-gcc triplet)))))
((string-prefix? "aarch64-linux" (or (%current-target-system)
(%current-system)))
;; Use cross-compiler rather than #:system "armhf-linux" to get
;; MesCC 64 bit .go files installed ready for use with Guile.
(let ((triplet "arm-linux-gnueabihf"))
`(("arm-linux-binutils" ,(cross-binutils triplet))
("arm-linux-gcc" ,(cross-gcc triplet)))))
(else
'()))
("graphviz" ,graphviz)
("help2man" ,help2man)
("m2-planet" ,m2-planet)
("perl" ,perl) ; build-aux/gitlog-to-changelog
("texinfo" ,texinfo)))
(append
(list guile-3.0)
(let ((target-system (or (%current-target-system)
(%current-system))))
(cond
((string-prefix? "x86_64-linux" target-system)
;; Use cross-compiler rather than #:system "i686-linux" to get
;; MesCC 64 bit .go files installed ready for use with Guile.
(list (cross-binutils "i686-unknown-linux-gnu")
(cross-gcc "i686-unknown-linux-gnu")))
((string-prefix? "aarch64-linux" target-system)
;; Use cross-compiler rather than #:system "armhf-linux" to get
;; MesCC 64 bit .go files installed ready for use with Guile.
(let ((triplet "arm-linux-gnueabihf"))
(list (cross-binutils triplet) (cross-gcc triplet))))
(else
'())))
(list graphviz help2man m2-planet
perl ;build-aux/gitlog-to-changelog
texinfo)))
(arguments
`(#:strip-binaries? #f)) ; binutil's strip b0rkes MesCC/M1/hex2 binaries
(native-search-paths
(list (search-path-specification
(variable "C_INCLUDE_PATH")
(files '("include")))
(search-path-specification
(variable "LIBRARY_PATH")
(files '("lib")))
(search-path-specification
(variable "MES_PREFIX")
(separator #f)
(files '("")))))
(synopsis "Scheme interpreter and C compiler for full source bootstrapping")
(description
"GNU Mes--Maxwell Equations of Software--brings the Reduced Binary Seed
@ -245,7 +238,7 @@ Guile.")
(license gpl3+)))
(define-public mes.git
(let ((version "0.22")
(let ((version #!mes!# "0.24.2")
(revision "0")
(commit (read-string (open-pipe "git show HEAD | head -1 | cut -d ' ' -f 2" OPEN_READ))))
(package

View File

@ -1,6 +1,6 @@
/* -*-comment-start: "//";comment-end:""-*-
* GNU Mes --- Maxwell Equations of Software
* Copyright © 2017 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
* Copyright © 2017,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
*
* This file is part of GNU Mes.
*
@ -27,8 +27,9 @@
#undef __MES_ASSERT_H
#include_next <assert.h>
#else // ! SYSTEM_LIBC
#define assert(x) ((x) ? (void)0 : __assert_fail (#x))
void __assert_fail (char *s);
#define assert(x) ((x) ? (void)0 : __assert_fail (#x, 0, 0, 0))
void __assert_fail (char const *s, char const *file, unsigned line,
char const *function);
#endif // ! SYSTEM_LIBC
#endif // __MES_ASSERT_H

View File

@ -0,0 +1,25 @@
/* -*-comment-start: "//";comment-end:""-*-
* GNU Mes --- Maxwell Equations of Software
* Copyright © 2017,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
*
* This file is part of GNU Mes.
*
* GNU Mes 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 3 of the License, or (at
* your option) any later version.
*
* GNU Mes 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 GNU Mes. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __MES_GNU_X86_KERNEL_STAT_H
#define __MES_GNU_X86_KERNEL_STAT_H 1
#include <arch/syscall.h>
#endif // __MES_GNU_X86_KERNEL_STAT_H

View File

@ -0,0 +1,79 @@
/* -*-comment-start: "//";comment-end:""-*-
* GNU Mes --- Maxwell Equations of Software
* Copyright © 2017,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
*
* This file is part of GNU Mes.
*
* GNU Mes 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 3 of the License, or (at
* your option) any later version.
*
* GNU Mes 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 GNU Mes. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __MES_LINUX_ARM_KERNEL_STAT_H
#define __MES_LINUX_ARM_KERNEL_STAT_H 1
// https://github.com/torvalds/linux/blob/master/arch/arm/include/uapi/asm/stat.h
#include <arch/syscall.h>
#if __SIZEOF_LONG_LONG__ != 8
// *INDENT-OFF*
struct stat
{
unsigned long st_dev;
unsigned long st_ino;
unsigned short st_mode;
unsigned short st_nlink;
unsigned short st_uid;
unsigned short st_gid;
unsigned long st_rdev;
unsigned long st_size;
unsigned long st_blksize;
unsigned long st_blocks;
unsigned long st_atime;
unsigned long st_atime_usec;
unsigned long st_mtime;
unsigned long st_mtime_usec;
unsigned long st_ctime;
unsigned long st_ctime_usec;
unsigned long __pad0;
unsigned long __pad1;
};
#else // __SIZEOF_LONG_LONG__ == 8
struct stat
{
unsigned long long st_dev;
unsigned char __pad0[4];
unsigned long __st_ino;
unsigned int st_mode;
unsigned int st_nlink;
unsigned long st_uid;
unsigned long st_gid;
unsigned long long st_rdev;
unsigned char __pad3[4];
long long st_size;
unsigned long st_blksize;
unsigned long long st_blocks;
unsigned long st_atime;
unsigned long st_atime_nsec;
unsigned long st_mtime;
unsigned int st_mtime_nsec;
unsigned long st_ctime;
unsigned long st_ctime_nsec;
unsigned long long st_ino;
};
#endif // __SIZEOF_LONG_LONG__ == 8
#endif // __MES_LINUX_ARM_KERNEL_STAT_H

View File

@ -1,6 +1,6 @@
/* -*-comment-start: "//";comment-end:""-*-
* GNU Mes --- Maxwell Equations of Software
* Copyright © 2018 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
* Copyright © 2018,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
* Copyright © 2020 Danny Milosavljevic <dannym@scratchpost.org>
*
* This file is part of GNU Mes.
@ -23,29 +23,58 @@
/* See https://github.com/torvalds/linux/blob/v4.19/arch/arm/tools/syscall.tbl */
// libc
/* libc-mini */
#ifndef SYS_exit
// CONSTANT SYS_exit 0x01
#define SYS_exit 0x01
#endif
#ifndef SYS_write
// CONSTANT SYS_write 0x04
#define SYS_write 0x04
#endif
/* libc */
// CONSTANT SYS_fork 0x02
#define SYS_fork 0x02
// CONSTANT SYS_read 0x03
#define SYS_read 0x03
// CONSTANT SYS_open 0x05
#define SYS_open 0x05
//#define SYS_waitpid
// CONSTANT SYS_wait4 0x72
#define SYS_wait4 0x72
// CONSTANT SYS_execve 0x0b
#define SYS_execve 0x0b
// CONSTANT SYS_chmod 0x0f
#define SYS_chmod 0x0f
// CONSTANT SYS_access 0x21
#define SYS_access 0x21
// CONSTANT SYS_brk 0x2d
#define SYS_brk 0x2d
// CONSTANT SYS_ioctl 0x36
#define SYS_ioctl 0x36
// CONSTANT SYS_fsync 0x76
#define SYS_fsync 0x76
// CONSTANT SYS_getcwd 0xb7
#define SYS_getcwd 0xb7
// CONSTANT SYS_dup 0x29
#define SYS_dup 0x29
// CONSTANT SYS_dup2 0x3f
#define SYS_dup2 0x3f
// CONSTANT SYS_unlink 0x0a
#define SYS_unlink 0x0a
// CONSTANT SYS_gettimeofday 0x4e
#define SYS_gettimeofday 0x4e
// CONSTANT SYS_clock_gettime 0x107
#define SYS_clock_gettime 0x107
// libc+tcc
/* libc+tcc */
#define SYS_close 0x06
#define SYS_lseek 0x13
#define SYS_unlink 0x0a
#define SYS_rmdir 0x28
#define SYS_gettimeofday 0x4e
#define SYS_stat 0x6a
#define SYS_getcwd 0xb7
// libc+gnu
/* libc+gnu */
#define SYS_chdir 0x0c
#define SYS_link 0x09
#define SYS_getpid 0x14
@ -53,34 +82,50 @@
#define SYS_kill 0x25
#define SYS_rename 0x26
#define SYS_mkdir 0x27
#define SYS_dup 0x29
#define SYS_pipe 0x2a
#define SYS_getgid 0x2f
#define SYS_rt_sigaction 0xae
#define SYS_rt_sigreturn 0xad
#define SYS_fcntl 0x37
#define SYS_dup2 0x3f
#define SYS_getrusage 0x4d
#define SYS_lstat 0x6b
#define SYS_setitimer 0x68
#define SYS_fstat 0x6c
#define SYS_nanosleep 0xa2
#define SYS_getdents 0x8d
#define SYS_clock_gettime 0x107
// bash
/* bash */
#define SYS_setuid 0x17
#define SYS_setgid 0x2e
#define SYS_geteuid 0x31
#define SYS_getegid 0x32
#define SYS_getppid 0x40
// make+WITH_GLIBC
/* make+WITH_GLIBC */
#define SYS_rt_sigprocmask 0xaf
// tar
/* tar */
#define SYS_symlink 0x53
#define SYS_readlink 0x55
#define SYS_mknod 0x0e
#endif // __MES_LINUX_ARM_SYSCALL_H
#if __SIZEOF_LONG_LONG__ == 8
#define SYS_stat64 0xc3
#define SYS_lstat64 0xc4
#define SYS_fstat64 0xc5
#define SYS_fcntl64 0xdd
#define SYS_getdents64 0xdc
#undef SYS_stat
#define SYS_stat SYS_stat64
#undef SYS_lstat
#define SYS_lstat SYS_lstat64
#undef SYS_fstat
#define SYS_fstat SYS_fstat64
#endif // __SIZEOF_LONG_LONG__ == 8
#endif /* __MES_LINUX_ARM_SYSCALL_H */

View File

@ -0,0 +1,47 @@
/* -*-comment-start: "//";comment-end:""-*-
* GNU Mes --- Maxwell Equations of Software
* Copyright © 2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
*
* This file is part of GNU Mes.
*
* GNU Mes 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 3 of the License, or (at
* your option) any later version.
*
* GNU Mes 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 GNU Mes. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __LINUX_M2_KERNEL_STAT_H
#define __LINUX_M2_KERNEL_STAT_H
/* https://github.com/torvalds/linux/blob/master/arch/x86/include/uapi/asm/stat.h */
/* *INDENT-OFF* */
struct stat
{
unsigned st_dev;
unsigned st_ino;
char st_mode[2];
char st_nlink[2];
char st_uid[2];
char st_gid[2];
unsigned st_rdev;
unsigned st_size;
unsigned st_blksize;
unsigned st_blocks;
unsigned st_atime;
unsigned st_atime_usec;
unsigned st_mtime;
unsigned st_mtime_usec;
unsigned st_ctime;
unsigned st_ctime_usec;
unsigned __pad0;
unsigned __pad1;
};
#endif /* __LINUX_M2_KERNEL_STAT_H */

View File

@ -0,0 +1,79 @@
/* -*-comment-start: "//";comment-end:""-*-
* GNU Mes --- Maxwell Equations of Software
* Copyright © 2017,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
*
* This file is part of GNU Mes.
*
* GNU Mes 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 3 of the License, or (at
* your option) any later version.
*
* GNU Mes 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 GNU Mes. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __MES_LINUX_X86_KERNEL_STAT_H
#define __MES_LINUX_X86_KERNEL_STAT_H 1
// https://github.com/torvalds/linux/blob/master/arch/x86/include/uapi/asm/stat.h
#include <arch/syscall.h>
#if __SIZEOF_LONG_LONG__ != 8
// *INDENT-OFF*
struct stat
{
unsigned long st_dev;
unsigned long st_ino;
unsigned short st_mode;
unsigned short st_nlink;
unsigned short st_uid;
unsigned short st_gid;
unsigned long st_rdev;
unsigned long st_size;
unsigned long st_blksize;
unsigned long st_blocks;
unsigned long st_atime;
unsigned long st_atime_usec;
unsigned long st_mtime;
unsigned long st_mtime_usec;
unsigned long st_ctime;
unsigned long st_ctime_usec;
unsigned long __pad0;
unsigned long __pad1;
};
#else // __SIZEOF_LONG_LONG__ == 8
struct stat
{
unsigned long long st_dev;
unsigned char __pad0[4];
unsigned long __st_ino;
unsigned int st_mode;
unsigned int st_nlink;
unsigned long st_uid;
unsigned long st_gid;
unsigned long long st_rdev;
unsigned char __pad3[4];
long long st_size;
unsigned long st_blksize;
unsigned long long st_blocks;
unsigned long st_atime;
unsigned long st_atime_nsec;
unsigned long st_mtime;
unsigned int st_mtime_nsec;
unsigned long st_ctime;
unsigned long st_ctime_nsec;
unsigned long long st_ino;
};
#endif // __SIZEOF_LONG_LONG__ == 8
#endif // __MES_LINUX_X86_KERNEL_STAT_H

View File

@ -75,7 +75,6 @@
#define SYS_stat 0x6a
/* libc+gnu */
#define SYS_chdir 0x0c
#define SYS_link 0x09
#define SYS_getpid 0x14
@ -112,4 +111,23 @@
#define SYS_readlink 0x55
#define SYS_mknod 0x0e
#if __SIZEOF_LONG_LONG__ == 8
#define SYS_stat64 0xc3
#define SYS_lstat64 0xc4
#define SYS_fstat64 0xc5
#define SYS_fcntl64 0xdd
#define SYS_getdents64 0xdc
#undef SYS_stat
#define SYS_stat SYS_stat64
#undef SYS_lstat
#define SYS_lstat SYS_lstat64
#undef SYS_fstat
#define SYS_fstat SYS_fstat64
#endif // __SIZEOF_LONG_LONG__ == 8
#endif /* __MES_LINUX_X86_SYSCALL_H */

View File

@ -0,0 +1,51 @@
/* -*-comment-start: "//";comment-end:""-*-
* GNU Mes --- Maxwell Equations of Software
* Copyright © 2017,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
*
* This file is part of GNU Mes.
*
* GNU Mes 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 3 of the License, or (at
* your option) any later version.
*
* GNU Mes 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 GNU Mes. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __MES_LINUX_X86_64_KERNEL_STAT_H
#define __MES_LINUX_X86_64_KERNEL_STAT_H 1
// https://github.com/torvalds/linux/blob/master/arch/x86/include/uapi/asm/stat.h
// *INDENT-OFF*
struct stat
{
unsigned long st_dev;
unsigned long st_ino;
unsigned long st_nlink;
unsigned int st_mode;
unsigned int st_uid;
unsigned int st_gid;
unsigned int __pad0;
unsigned long st_rdev;
unsigned long st_size;
unsigned long st_atime;
unsigned long st_atime_nsec;
unsigned long st_mtime;
unsigned long st_mtime_nsec;
unsigned long st_ctime;
unsigned long st_ctime_nsec;
unsigned long st_blksize;
long st_blocks;
unsigned long __pad1;
unsigned long __pad2;
unsigned long __pad3;
unsigned long __pad4;
};
#endif // __MES_LINUX_X86_64_KERNEL_STAT_H

138
include/m2/types.h Normal file
View File

@ -0,0 +1,138 @@
/* -*-comment-start: "//";comment-end:""-*-
* GNU Mes --- Maxwell Equations of Software
* Copyright © 2017,2022,2023 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
*
* This file is part of GNU Mes.
*
* GNU Mes 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 3 of the License, or (at
* your option) any later version.
*
* GNU Mes 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 GNU Mes. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __M2_TYPES_H
#define __M2_TYPES_H 1
/*
#ifndef __MES_CLOCK_T
#define __MES_CLOCK_T
#undef clock_t
typedef long clock_t;
#endif
*/
#ifndef __MES_DEV_T
#define __MES_DEV_T
#undef dev_t
typedef long dev_t;
#endif
/*
#if !defined (__MES_FILE_T) && ! defined (_FILE_T)
#define __MES_FILE_T
#define _FILE_T
typedef long FILE;
#endif
*/
#ifndef __MES_GID_T
#define __MES_GID_T
#undef gid_t
typedef unsigned gid_t;
#endif
#ifndef __MES_INO_T
#define __MES_INO_T
#undef ino_t
typedef unsigned ino_t;
#endif
#if __SIZEOF_LONG_LONG__ == 8
#ifndef __MES_INO64_T
#define __MES_INO64_T
#undef ino64_t
typedef unsigned ino64_t;
#endif
#endif // __SIZEOF_LONG_LONG__ == 8
#if !defined (__MES_INTPTR_T) && !defined (__intptr_t_defined)
#define __MES_INTPTR_T
#define __intptr_t_defined
#undef intptr_t
typedef long intptr_t;
#undef uintptr_t
typedef unsigned uintptr_t;
#endif
#ifndef __MES_OFF_T
#define __MES_OFF_T
#undef off_t
typedef long off_t;
#endif
#if __SIZEOF_LONG_LONG__ == 8
#ifndef __MES_OFF64_T
#define __MES_OFF64_T
#undef off64_t
typedef unsigned off64_t;
#endif
#endif // __SIZEOF_LONG_LONG__ == 8
#ifndef __MES_PID_T
#define __MES_PID_T
#undef pid_t
typedef int pid_t;
#endif
#ifndef __PTRDIFF_T
#define __PTRDIFF_T
#ifndef __MES_PTRDIFF_T
#define __MES_PTRDIFF_T
#undef ptrdiff_t
typedef long ptrdiff_t;
#endif
#endif
#ifndef __MES_SIGVAL_T
#define __MES_SIGVAL_T
#undef clock_t
typedef long sigval_t;
#endif
#ifndef __SIZE_T
#define __SIZE_T
#ifndef __MES_SIZE_T
#define __MES_SIZE_T
typedef unsigned size_t;
#endif
#endif
#ifndef __MES_SSIZE_T
#define __MES_SSIZE_T
#undef ssize_t
typedef long ssize_t;
#endif
#ifndef __MES_UID_T
#define __MES_UID_T
#undef uid_t
typedef unsigned uid_t;
#endif
#ifndef __WCHAR_T
#define __WCHAR_T
#ifndef __MES_WCHAR_T
#define __MES_WCHAR_T
#undef wchar_t
typedef int wchar_t;
#endif
#endif
#endif // __M2_TYPES_H

View File

@ -1,6 +1,6 @@
/* -*-comment-start: "//";comment-end:""-*-
* GNU Mes --- Maxwell Equations of Software
* Copyright © 2016,2017,2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
* Copyright © 2016,2017,2018,2019,2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
*
* This file is part of GNU Mes.
*
@ -57,6 +57,7 @@ struct scm *set_env_x (struct scm *x, struct scm *e, struct scm *a);
struct scm *add_formals (struct scm *formals, struct scm *x);
struct scm *eval_apply ();
/* src/gc.c */
struct scm *gc_stats ();
struct scm *cons (struct scm *x, struct scm *y);
struct scm *gc_check ();
struct scm *gc ();
@ -102,6 +103,7 @@ struct scm *module_variable (struct scm *module, struct scm *name);
struct scm *module_ref (struct scm *module, struct scm *name);
struct scm *module_define_x (struct scm *module, struct scm *name, struct scm *value);
/* src/posix.c */
struct scm *abort_ ();
struct scm *exit_ (struct scm *x);
struct scm *peek_byte ();
struct scm *read_byte ();

View File

@ -68,10 +68,10 @@
// CONSTANT STRUCT_PRINTER 1
#define STRUCT_PRINTER 1
// CONSTANT FRAME_SIZE 5
#define FRAME_SIZE 5
// CONSTANT FRAME_PROCEDURE 4
#define FRAME_PROCEDURE 4
// CONSTANT GC_FRAME_SIZE 5
#define GC_FRAME_SIZE 5
// CONSTANT GC_FRAME_PROCEDURE 4
#define GC_FRAME_PROCEDURE 4
// CONSTANT STDIN 0
// CONSTANT STDOUT 1

View File

@ -23,18 +23,12 @@
#include <mes/lib-mini.h>
char* cast_intp_to_charp (int const *i);
char* cast_long_to_charp (long i);
char *cast_intp_to_charp (int const *i);
char *cast_long_to_charp (long i);
long cast_charp_to_long (char const *);
long cast_int_to_long (int i);
long cast_voidp_to_long (void const *);
// #define cast_intp_to_charp(x) ((char*) x)
// #define cast_long_to_charp(x) ((char*) x)
// #define cast_charp_to_long(x) ((long) x)
// #define cast_int_to_long(x) ((long) x)
// #define cast_voidp_to_long(x) ((long) x)
int __mes_debug ();
void __ungetc_init ();
void __ungetc_clear (int filedes);
@ -55,7 +49,8 @@ char * fdgets (char *s, int count, int fd);
int fdputc (int c, int fd);
int fdputs (char const *s, int fd);
int fdungetc (int c, int fd);
char * _getcwd (char *buffer, size_t size);
char *_getcwd (char *buffer, size_t size);
int ioctl3 (int filedes, size_t command, long data);
int isnumber (int c, int base);
int mes_open (char const *file_name, int flags, int mask);
int _open2 (char const *file_name, int flags);
@ -72,7 +67,8 @@ extern void (*__call_at_exit) (void);
#define __FILEDES_MAX 512
#if !SYSTEM_LIBC
void __assert_fail (char *s);
void __assert_fail (char const *s, char const *file, unsigned line,
char const *function);
ssize_t __buffered_read (int filedes, void *buffer, size_t size);
size_t __buffered_read_clear (int filedes);
void _exit (int code);
@ -89,5 +85,6 @@ unsigned long __mesabi_uldiv (unsigned long a, unsigned long b,
void *__memcpy (void *dest, void const *src, size_t n);
void *__memmove (void *dest, void const *src, size_t n);
void *__memset (void *s, int c, size_t n);
int __raise (int signal);
#endif //__MES_LIB_H

View File

@ -1,6 +1,6 @@
/* -*-comment-start: "//";comment-end:""-*-
* GNU Mes --- Maxwell Equations of Software
* Copyright © 2016,2017,2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
* Copyright © 2016,2017,2018,2019,2020,2021 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
*
* This file is part of GNU Mes.
*
@ -54,68 +54,65 @@ struct scm
};
/* mes */
char *g_datadir;
int g_debug;
char *g_buf;
int g_continuations;
struct scm *g_symbols;
struct scm *g_symbol_max;
int g_mini;
extern char *g_datadir;
extern int g_debug;
extern char *g_buf;
extern int g_continuations;
extern struct scm *g_symbols;
extern struct scm *g_symbol_max;
extern int g_mini;
/* a/env */
struct scm *R0;
extern struct scm *R0;
/* param 1 */
struct scm *R1;
extern struct scm *R1;
/* save 2 */
struct scm *R2;
extern struct scm *R2;
/* continuation */
struct scm *R3;
extern struct scm *R3;
/* current-module */
struct scm *M0;
extern struct scm *M0;
/* macro */
struct scm *g_macros;
struct scm *g_ports;
extern struct scm *g_macros;
extern struct scm *g_ports;
/* gc */
long ARENA_SIZE;
long MAX_ARENA_SIZE;
long STACK_SIZE;
long JAM_SIZE;
long GC_SAFETY;
long MAX_STRING;
char *g_arena;
struct scm *cell_arena;
struct scm *cell_zero;
extern size_t ARENA_SIZE;
extern size_t MAX_ARENA_SIZE;
extern size_t STACK_SIZE;
extern size_t JAM_SIZE;
extern size_t GC_SAFETY;
extern size_t MAX_STRING;
extern char *g_arena;
extern struct scm *cell_arena;
extern struct scm *cell_zero;
struct scm *g_free;
struct scm *g_symbol;
extern struct scm *g_free;
extern struct scm *g_symbol;
struct scm **g_stack_array;
struct scm *g_cells;
struct scm *g_news;
long g_stack;
extern struct scm **g_stack_array;
extern struct scm *g_cells;
extern struct scm *g_news;
extern long g_stack;
extern size_t gc_count;
extern struct timespec *gc_start_time;
extern struct timespec *gc_end_time;
extern size_t gc_time;
char **__execl_c_argv;
char *__getcwd_buf;
char *__open_boot_buf;
char *__open_boot_file_name;
char *__setenv_buf;
char *__reader_read_char_buf;
struct timespec *g_start_time;
struct timeval *__gettimeofday_time;
struct timespec *__get_internal_run_time_ts;
extern char **__execl_c_argv;
extern char *__open_boot_buf;
extern char *__open_boot_file_name;
extern char *__setenv_buf;
extern char *__reader_read_char_buf;
extern struct timespec *g_start_time;
extern struct timeval *__gettimeofday_time;
extern struct timespec *__get_internal_run_time_ts;
struct scm *cast_charp_to_scmp (char const *i);
struct scm ** cast_charp_to_scmpp (char const *i);
char* cast_voidp_to_charp (void const *i);
struct scm **cast_charp_to_scmpp (char const *i);
char *cast_voidp_to_charp (void const *i);
long cast_scmp_to_long (struct scm *i);
char* cast_scmp_to_charp (struct scm *i);
// #define cast_voidp_to_charp(x) ((char*) x)
// #define cast_charp_to_scmp(x) ((struct scm *) x)
// #define cast_charp_to_scmpp(x) ((struct scm **) x)
// #define cast_scmp_to_long(x) ((long) x)
// #define cast_scmp_to_charp(x) ((char*) x)
char *cast_scmp_to_charp (struct scm *i);
struct scm *alloc (long n);
struct scm *apply (struct scm *f, struct scm *x, struct scm *a);
@ -156,7 +153,6 @@ struct scm *vector_ref_ (struct scm *x, long i);
struct scm *vector_set_x_ (struct scm *x, long i, struct scm *e);
FUNCTION builtin_function (struct scm *builtin);
char *cell_bytes (struct scm *x);
char *news_bytes (struct scm *x);
int peekchar ();
int readchar ();
int unreadchar ();
@ -175,6 +171,7 @@ void gc_pop_frame ();
void gc_push_frame ();
void gc_stats_ (char const* where);
void init_symbols_ ();
long seconds_and_nanoseconds_to_long (long s, long ns);
#include "mes/builtins.h"
#include "mes/constants.h"

View File

@ -1,6 +1,6 @@
/* -*-comment-start: "//";comment-end:""-*-
* GNU Mes --- Maxwell Equations of Software
* Copyright © 2016,2017,2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
* Copyright © 2016,2017,2018,2019,2021 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
*
* This file is part of GNU Mes.
*
@ -21,121 +21,121 @@
#ifndef __MES_SYMBOLS_H
#define __MES_SYMBOLS_H
struct scm *cell_nil;
struct scm *cell_f;
struct scm *cell_t;
struct scm *cell_dot;
struct scm *cell_arrow;
struct scm *cell_undefined;
struct scm *cell_unspecified;
struct scm *cell_closure;
struct scm *cell_circular;
extern struct scm *cell_nil;
extern struct scm *cell_f;
extern struct scm *cell_t;
extern struct scm *cell_dot;
extern struct scm *cell_arrow;
extern struct scm *cell_undefined;
extern struct scm *cell_unspecified;
extern struct scm *cell_closure;
extern struct scm *cell_circular;
struct scm *cell_vm_apply;
struct scm *cell_vm_apply2;
struct scm *cell_vm_begin;
struct scm *cell_vm_begin_eval;
struct scm *cell_vm_begin_expand;
struct scm *cell_vm_begin_expand_eval;
struct scm *cell_vm_begin_expand_macro;
struct scm *cell_vm_begin_expand_primitive_load;
struct scm *cell_vm_begin_primitive_load;
struct scm *cell_vm_begin_read_input_file;
struct scm *cell_vm_call_with_current_continuation2;
struct scm *cell_vm_call_with_values2;
struct scm *cell_vm_eval;
struct scm *cell_vm_eval2;
struct scm *cell_vm_eval_check_func;
struct scm *cell_vm_eval_define;
struct scm *cell_vm_eval_macro_expand_eval;
struct scm *cell_vm_eval_macro_expand_expand;
struct scm *cell_vm_eval_pmatch_car;
struct scm *cell_vm_eval_pmatch_cdr;
struct scm *cell_vm_eval_set_x;
struct scm *cell_vm_evlis;
struct scm *cell_vm_evlis2;
struct scm *cell_vm_evlis3;
struct scm *cell_vm_if;
struct scm *cell_vm_if_expr;
struct scm *cell_vm_macro_expand;
struct scm *cell_vm_macro_expand_car;
struct scm *cell_vm_macro_expand_cdr;
struct scm *cell_vm_macro_expand_define;
struct scm *cell_vm_macro_expand_define_macro;
struct scm *cell_vm_macro_expand_lambda;
struct scm *cell_vm_macro_expand_set_x;
struct scm *cell_vm_return;
extern struct scm *cell_vm_apply;
extern struct scm *cell_vm_apply2;
extern struct scm *cell_vm_begin;
extern struct scm *cell_vm_begin_eval;
extern struct scm *cell_vm_begin_expand;
extern struct scm *cell_vm_begin_expand_eval;
extern struct scm *cell_vm_begin_expand_macro;
extern struct scm *cell_vm_begin_expand_primitive_load;
extern struct scm *cell_vm_begin_primitive_load;
extern struct scm *cell_vm_begin_read_input_file;
extern struct scm *cell_vm_call_with_current_continuation2;
extern struct scm *cell_vm_call_with_values2;
extern struct scm *cell_vm_eval;
extern struct scm *cell_vm_eval2;
extern struct scm *cell_vm_eval_check_func;
extern struct scm *cell_vm_eval_define;
extern struct scm *cell_vm_eval_macro_expand_eval;
extern struct scm *cell_vm_eval_macro_expand_expand;
extern struct scm *cell_vm_eval_pmatch_car;
extern struct scm *cell_vm_eval_pmatch_cdr;
extern struct scm *cell_vm_eval_set_x;
extern struct scm *cell_vm_evlis;
extern struct scm *cell_vm_evlis2;
extern struct scm *cell_vm_evlis3;
extern struct scm *cell_vm_if;
extern struct scm *cell_vm_if_expr;
extern struct scm *cell_vm_macro_expand;
extern struct scm *cell_vm_macro_expand_car;
extern struct scm *cell_vm_macro_expand_cdr;
extern struct scm *cell_vm_macro_expand_define;
extern struct scm *cell_vm_macro_expand_define_macro;
extern struct scm *cell_vm_macro_expand_lambda;
extern struct scm *cell_vm_macro_expand_set_x;
extern struct scm *cell_vm_return;
struct scm *cell_symbol_lambda;
struct scm *cell_symbol_begin;
struct scm *cell_symbol_if;
struct scm *cell_symbol_quote;
struct scm *cell_symbol_define;
struct scm *cell_symbol_define_macro;
struct scm *cell_symbol_quasiquote;
struct scm *cell_symbol_unquote;
struct scm *cell_symbol_unquote_splicing;
struct scm *cell_symbol_syntax;
struct scm *cell_symbol_quasisyntax;
struct scm *cell_symbol_unsyntax;
struct scm *cell_symbol_unsyntax_splicing;
struct scm *cell_symbol_set_x;
struct scm *cell_symbol_sc_expand;
struct scm *cell_symbol_macro_expand;
struct scm *cell_symbol_portable_macro_expand;
struct scm *cell_symbol_sc_expander_alist;
struct scm *cell_symbol_call_with_values;
struct scm *cell_symbol_call_with_current_continuation;
struct scm *cell_symbol_boot_module;
struct scm *cell_symbol_current_module;
struct scm *cell_symbol_primitive_load;
struct scm *cell_symbol_car;
struct scm *cell_symbol_cdr;
struct scm *cell_symbol_not_a_number;
struct scm *cell_symbol_not_a_pair;
struct scm *cell_symbol_system_error;
struct scm *cell_symbol_throw;
struct scm *cell_symbol_unbound_variable;
struct scm *cell_symbol_wrong_number_of_args;
struct scm *cell_symbol_wrong_type_arg;
struct scm *cell_symbol_buckets;
struct scm *cell_symbol_builtin;
struct scm *cell_symbol_frame;
struct scm *cell_symbol_hashq_table;
struct scm *cell_symbol_module;
struct scm *cell_symbol_procedure;
struct scm *cell_symbol_record_type;
struct scm *cell_symbol_size;
struct scm *cell_symbol_stack;
struct scm *cell_symbol_argv;
struct scm *cell_symbol_mes_datadir;
struct scm *cell_symbol_mes_version;
struct scm *cell_symbol_internal_time_units_per_second;
struct scm *cell_symbol_compiler;
struct scm *cell_symbol_arch;
struct scm *cell_symbol_pmatch_car;
struct scm *cell_symbol_pmatch_cdr;
struct scm *cell_type_bytes;
struct scm *cell_type_char;
struct scm *cell_type_closure;
struct scm *cell_type_continuation;
struct scm *cell_type_function;
struct scm *cell_type_keyword;
struct scm *cell_type_macro;
struct scm *cell_type_number;
struct scm *cell_type_pair;
struct scm *cell_type_port;
struct scm *cell_type_ref;
struct scm *cell_type_special;
struct scm *cell_type_string;
struct scm *cell_type_struct;
struct scm *cell_type_symbol;
struct scm *cell_type_values;
struct scm *cell_type_variable;
struct scm *cell_type_vector;
struct scm *cell_type_broken_heart;
struct scm *cell_symbol_program;
struct scm *cell_symbol_test;
extern struct scm *cell_symbol_lambda;
extern struct scm *cell_symbol_begin;
extern struct scm *cell_symbol_if;
extern struct scm *cell_symbol_quote;
extern struct scm *cell_symbol_define;
extern struct scm *cell_symbol_define_macro;
extern struct scm *cell_symbol_quasiquote;
extern struct scm *cell_symbol_unquote;
extern struct scm *cell_symbol_unquote_splicing;
extern struct scm *cell_symbol_syntax;
extern struct scm *cell_symbol_quasisyntax;
extern struct scm *cell_symbol_unsyntax;
extern struct scm *cell_symbol_unsyntax_splicing;
extern struct scm *cell_symbol_set_x;
extern struct scm *cell_symbol_sc_expand;
extern struct scm *cell_symbol_macro_expand;
extern struct scm *cell_symbol_portable_macro_expand;
extern struct scm *cell_symbol_sc_expander_alist;
extern struct scm *cell_symbol_call_with_values;
extern struct scm *cell_symbol_call_with_current_continuation;
extern struct scm *cell_symbol_boot_module;
extern struct scm *cell_symbol_current_module;
extern struct scm *cell_symbol_primitive_load;
extern struct scm *cell_symbol_car;
extern struct scm *cell_symbol_cdr;
extern struct scm *cell_symbol_not_a_number;
extern struct scm *cell_symbol_not_a_pair;
extern struct scm *cell_symbol_system_error;
extern struct scm *cell_symbol_throw;
extern struct scm *cell_symbol_unbound_variable;
extern struct scm *cell_symbol_wrong_number_of_args;
extern struct scm *cell_symbol_wrong_type_arg;
extern struct scm *cell_symbol_buckets;
extern struct scm *cell_symbol_builtin;
extern struct scm *cell_symbol_frame;
extern struct scm *cell_symbol_hashq_table;
extern struct scm *cell_symbol_module;
extern struct scm *cell_symbol_procedure;
extern struct scm *cell_symbol_record_type;
extern struct scm *cell_symbol_size;
extern struct scm *cell_symbol_stack;
extern struct scm *cell_symbol_argv;
extern struct scm *cell_symbol_mes_datadir;
extern struct scm *cell_symbol_mes_version;
extern struct scm *cell_symbol_internal_time_units_per_second;
extern struct scm *cell_symbol_compiler;
extern struct scm *cell_symbol_arch;
extern struct scm *cell_symbol_pmatch_car;
extern struct scm *cell_symbol_pmatch_cdr;
extern struct scm *cell_type_bytes;
extern struct scm *cell_type_char;
extern struct scm *cell_type_closure;
extern struct scm *cell_type_continuation;
extern struct scm *cell_type_function;
extern struct scm *cell_type_keyword;
extern struct scm *cell_type_macro;
extern struct scm *cell_type_number;
extern struct scm *cell_type_pair;
extern struct scm *cell_type_port;
extern struct scm *cell_type_ref;
extern struct scm *cell_type_special;
extern struct scm *cell_type_string;
extern struct scm *cell_type_struct;
extern struct scm *cell_type_symbol;
extern struct scm *cell_type_values;
extern struct scm *cell_type_variable;
extern struct scm *cell_type_vector;
extern struct scm *cell_type_broken_heart;
extern struct scm *cell_symbol_program;
extern struct scm *cell_symbol_test;
// CONSTANT SYMBOL_MAX 114
#define SYMBOL_MAX 114

View File

@ -1,6 +1,7 @@
/* -*-comment-start: "//";comment-end:""-*-
* GNU Mes --- Maxwell Equations of Software
* Copyright © 2017 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
* Copyright © 2021 Danny Milosavljevic <dannym@scratchpost.org>
*
* This file is part of GNU Mes.
*
@ -37,6 +38,10 @@
#endif // !__MESC__
#endif // offsetof
/* Note: on banana gcc, max_align_t is 16 Byte big instead! */
typedef double max_align_t;
#endif // ! SYSTEM_LIBC
#endif // __MES_STDDEF_H

View File

@ -1,6 +1,7 @@
/* -*-comment-start: "//";comment-end:""-*-
* GNU Mes --- Maxwell Equations of Software
* Copyright © 2017 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
* Copyright © 2022 Dor Askayo <dor.askayo@gmail.com>
*
* This file is part of GNU Mes.
*
@ -18,7 +19,7 @@
* along with GNU Mes. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __MES_SYS_STAT_H
#define __MES_SYS_STAT_H 1lei
#define __MES_SYS_STAT_H 1
#if SYSTEM_LIBC
#undef __MES_SYS_STAT_H
@ -28,60 +29,13 @@
#include <time.h>
#include <sys/types.h>
#include <arch/kernel-stat.h>
#ifndef __MES_MODE_T
#define __MES_MODE_T
typedef int mode_t;
#endif
// *INDENT-OFF*
#if __i386__ || __arm__
struct stat
{
unsigned long st_dev;
unsigned long st_ino;
unsigned short st_mode;
unsigned short st_nlink;
unsigned short st_uid;
unsigned short st_gid;
unsigned long st_rdev;
long st_size; /* Linux: unsigned long; glibc: off_t (i.e. signed) */
unsigned long st_blksize;
unsigned long st_blocks;
time_t st_atime; /* Linux: unsigned long; glibc: time_t */
unsigned long st_atime_usec;
time_t st_mtime; /* Linux: unsigned long; glibc: time_t */
unsigned long st_mtime_usec;
time_t st_ctime; /* Linux: unsigned long; glibc: time_t */
unsigned long st_ctime_usec;
unsigned long __foo0;
unsigned long __foo1;
};
#elif __x86_64__
struct stat
{
unsigned long st_dev;
unsigned long st_ino;
unsigned int st_mode;
unsigned int st_nlink;
unsigned int st_uid;
unsigned int st_gid;
unsigned long st_rdev;
long st_size;
unsigned long st_blksize;
unsigned long st_blocks;
time_t st_atime;
unsigned long st_atime_usec;
time_t st_mtime;
unsigned long st_mtime_usec;
time_t st_ctime;
unsigned long st_ctime_usec;
unsigned long __foo0;
unsigned long __foo1;
};
#endif
// *INDENT-ON*
int chmod (char const *file_name, mode_t mode);
int fstat (int filedes, struct stat *buf);
int mkdir (char const *file_name, mode_t mode);
@ -107,7 +61,7 @@ int stat (char const *file_name, struct stat *buf);
#define S_IWUSR 00200
#define S_IRUSR 00400
#define S_ISUID 0400
#define S_ISUID 04000
#define S_ISGID 02000
#define S_IXGRP 00010
#define S_IXOTH 00001

View File

@ -1,5 +1,5 @@
#! /bin/sh
# Copyright © 2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
# Copyright © 2019,2020,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
#
# This file is part of GNU Mes.
#
@ -19,22 +19,28 @@
# Usage:
# kaem --verbose --strict
mes_cpu=${mes_cpu:-x86}
stage0_cpu=${stage0_cpu:-x86}
mkdir -p m2
M2-Planet \
--bootstrap-mode \
--debug \
--architecture x86 \
--architecture ${stage0_cpu} \
-f include/m2/lib.h \
-f lib/linux/x86-mes-m2/crt1.c \
-f lib/linux/x86-mes-m2/mini.c \
-f lib/linux/${mes_cpu}-mes-m2/crt1.c \
-f lib/linux/${mes_cpu}-mes-m2/_exit.c \
-f lib/linux/${mes_cpu}-mes-m2/_write.c \
-f lib/mes/globals.c \
-f lib/m2/cast.c \
-f lib/m2/exit.c \
-f lib/mes/mini-write.c \
-f lib/linux/x86-mes-m2/syscall.c \
-f include/linux/x86/syscall.h \
-f lib/linux/${mes_cpu}-mes-m2/syscall.c \
-f include/linux/${mes_cpu}/syscall.h \
-f lib/stub/__raise.c \
-f lib/linux/brk.c \
-f lib/stdlib/malloc.c \
-f lib/m2/malloc.c \
-f lib/string/memset.c \
-f lib/m2/read.c \
-f lib/mes/fdgetc.c \
@ -47,6 +53,7 @@ M2-Planet \
-f lib/mes/fdputc.c \
-f lib/mes/eputc.c \
\
-f include/m2/types.h \
-f include/mes/mes.h \
-f include/mes/builtins.h \
-f include/mes/constants.h \
@ -75,8 +82,10 @@ M2-Planet \
-f lib/mes/fdungetc.c \
-f lib/posix/setenv.c \
-f lib/linux/access.c \
-f include/linux/m2/kernel-stat.h \
-f include/sys/stat.h \
-f lib/m2/chmod.c \
-f lib/m2/ioctl.c \
-f lib/linux/ioctl3.c \
-f lib/m2/isatty.c \
-f lib/linux/fork.c \
-f lib/m2/execve.c \
@ -112,25 +121,24 @@ M2-Planet \
-f src/vector.c \
-o m2/mes.M1
blood-elf -f m2/mes.M1 -o m2/mes.blood-elf-M1
blood-elf --little-endian -f m2/mes.M1 -o m2/mes.blood-elf-M1
M1 \
--LittleEndian \
--architecture x86 \
-f lib/m2/x86/x86_defs.M1 \
-f lib/x86-mes/x86.M1 \
-f lib/linux/x86-mes-m2/crt1.M1 \
--architecture ${stage0_cpu} \
--little-endian \
-f lib/m2/${mes_cpu}/${mes_cpu}_defs.M1 \
-f lib/${mes_cpu}-mes/${mes_cpu}.M1 \
-f lib/linux/${mes_cpu}-mes-m2/crt1.M1 \
-f m2/mes.M1 \
-f m2/mes.blood-elf-M1 \
-o m2/mes.hex2
mkdir -p bin
hex2 \
--LittleEndian \
--architecture x86 \
--BaseAddress 0x1000000 \
--exec_enable \
-f lib/linux/x86-mes/elf32-header.hex2 \
--architecture ${stage0_cpu} \
--little-endian \
--base-address 0x1000000 \
-f lib/m2/${mes_cpu}/ELF-${mes_cpu}.hex2 \
-f m2/mes.hex2 \
-o bin/mes-m2

View File

@ -1,5 +1,5 @@
### GNU Mes --- Maxwell Equations of Software
### Copyright © 2017,2018,2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
### Copyright © 2017,2018,2020,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
### Copyright © 2019,2020 Danny Milosavljevic <dannym@scratchpost.org>
###
### This file is part of GNU Mes.
@ -91,6 +91,7 @@ DEFINE mov____%r0,(%r1) 000081e5
DEFINE mov____%r1,%r0 0100a0e1
DEFINE mov____%r1,%r2 0120a0e1
DEFINE mov____%esp,%r0 0d00a0e1
DEFINE mov____%esp,%r3 0d30a0e1
# e59f9004 ldr r9, [pc, #4] ; <L1>
# e5890000 str r0, [r9]

View File

@ -1,6 +1,7 @@
/* -*-comment-start: "//";comment-end:""-*-
* GNU Mes --- Maxwell Equations of Software
* Copyright © 2016,2017,2018 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
* Copyright © 2023 Rick Masters <grick23@gmail.com>
*
* This file is part of GNU Mes.
*

View File

@ -24,5 +24,5 @@
int
isxdigit (int c)
{
return isdigit (c) || (c >= 'a' && c <= 'f');
return isdigit (c) || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
}

View File

@ -48,7 +48,7 @@ _start ()
asm (
"mov %%ebp,%%eax\n\t"
"add $4,%%eax\n\t"
"movzbl (%%eax),%%eax\n\t"
"mov (%%eax),%%eax\n\t"
"add $3,%%eax\n\t"
"shl $2,%%eax\n\t"
"add %%ebp,%%eax\n\t"
@ -64,7 +64,7 @@ _start ()
"mov %ebp,%eax\n\t"
"add $4,%eax\n\t"
"movzbl (%eax),%eax\n\t"
"mov (%eax),%eax\n\t"
"push %eax\n\t"
"call main\n\t"

View File

@ -1,6 +1,6 @@
/* -*-comment-start: "//";comment-end:""-*-
* GNU Mes --- Maxwell Equations of Software
* Copyright © 2017,2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
* Copyright © 2017,2018,2019,2021 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
*
* This file is part of GNU Mes.
*
@ -37,7 +37,7 @@ _start ()
asm ("mov____%ebp,%eax");
asm ("add____$i8,%eax !4");
asm ("movzbl_(%eax),%eax");
asm ("mov____(%eax),%eax");
asm ("add____$i8,%eax !3");
asm ("shl____$i8,%eax !0x02");
@ -51,7 +51,7 @@ _start ()
asm ("mov____%ebp,%eax");
asm ("add____$i8,%eax !4");
asm ("movzbl_(%eax),%eax");
asm ("mov____(%eax),%eax");
asm ("push___%eax");
main ();

View File

@ -1,6 +1,7 @@
/* -*-comment-start: "//";comment-end:""-*-
* GNU Mes --- Maxwell Equations of Software
* Copyright © 2017,2018,2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
* Copyright © 2021 Danny Milosavljevic <dannym@scratchpost.org>
*
* This file is part of GNU Mes.
*
@ -20,8 +21,13 @@
#include <mes/lib.h>
double
__divdi3 (double a, double b)
#if HAVE_LONG_LONG
long long
__divdi3 (long long a, long long b)
#else
long
__divdi3 (long a, long b)
#endif
{
#if !__TINYC__
static int stub = 0;
@ -29,6 +35,7 @@ __divdi3 (double a, double b)
eputs ("__divdi3 stub\n");
stub = 1;
#endif
// FIXME: Actually use long long
long ai = a;
long bi = b;
#if __arm__ && __TINYC__
@ -38,8 +45,13 @@ __divdi3 (double a, double b)
#endif
}
double
__moddi3 (double a, double b)
#if HAVE_LONG_LONG
long long
__moddi3 (long long a, long long b)
#else
long
__moddi3 (long a, long b)
#endif
{
#if !__TINYC__
static int stub = 0;
@ -47,6 +59,7 @@ __moddi3 (double a, double b)
eputs ("__moddi3 stub\n");
stub = 1;
#endif
// FIXME: Actually use long long
long ai = a;
long bi = b;
#if __arm__ && __TINYC__
@ -70,12 +83,13 @@ __udivdi3 (unsigned long a, long ah, unsigned long b)
eputs ("__udivdi3 stub\n");
stub = 1;
#endif
// FIXME: Actually use long long
unsigned long ai = a;
unsigned long bi = b;
if (!b)
return 0;
#if __arm__ && __TINYC__
return __mesabi_idiv (ai, bi);
return __mesabi_udiv (ai, bi);
#else
return ai / bi;
#endif
@ -95,10 +109,11 @@ __umoddi3 (unsigned long a, long ah, unsigned long b)
eputs ("__umoddi3 stub\n");
stub = 1;
#endif
// FIXME: Actually use long long
unsigned long ai = a;
unsigned long bi = b;
#if __arm__ && __TINYC__
return __mesabi_imod (ai, bi);
return __mesabi_umod (ai, bi);
#else
return ai % bi;
#endif
@ -121,7 +136,7 @@ __lshrdi3 (unsigned long a, long ah, long b)
#else // __TINYC__
for (int i = 0; i < b; i++)
#if __arm__
a = __mesabi_idiv (a, 2);
a = __mesabi_udiv (a, 2); // I sure hope that doesn't endless recurse because of the optimizations in __mesabi_udiv that shift
#else // !__arm__
a /= 2;
#endif // !__arm__
@ -167,7 +182,7 @@ __ashrdi3 (long a, long ah, long b)
#else // __TINYC__
for (int i = 0; i < b; i++)
#if __arm__
a = __mesabi_idiv (a, 2);
a = __mesabi_idiv (a, 2); // I sure hope that doesn't endless recurse because of the optimizations in __mesabi_udiv that shift
#else // !__arm__
a /= 2;
#endif // !__arm__

View File

@ -1,6 +1,6 @@
/* -*-comment-start: "//";comment-end:""-*-
* GNU Mes --- Maxwell Equations of Software
* Copyright © 2016,2017,2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
* Copyright © 2016,2017,2018,2019,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
*
* This file is part of GNU Mes.
*
@ -20,7 +20,7 @@
#include <mes/lib.h>
#include <linux/syscall.h>
#include <syscall.h>
#include <arch/syscall.h>
char *
_getcwd (char *buffer, size_t size)

View File

@ -19,7 +19,7 @@
*/
#include <linux/syscall.h>
#include <syscall.h>
#include <arch/syscall.h>
#include <mes/lib.h>
#include <fcntl.h>

View File

@ -1,6 +1,6 @@
/* -*-comment-start: "//";comment-end:""-*-
* GNU Mes --- Maxwell Equations of Software
* Copyright © 2016,2017,2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
* Copyright © 2016,2017,2018,2019,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
*
* This file is part of GNU Mes.
*
@ -19,7 +19,7 @@
*/
#include <linux/syscall.h>
#include <syscall.h>
#include <arch/syscall.h>
#include <mes/lib.h>
#include <fcntl.h>

View File

@ -1,6 +1,6 @@
/* -*-comment-start: "//";comment-end:""-*-
* GNU Mes --- Maxwell Equations of Software
* Copyright © 2016,2017,2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
* Copyright © 2016,2017,2018,2019,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
*
* This file is part of GNU Mes.
*
@ -20,7 +20,7 @@
#include <mes/lib.h>
#include <linux/syscall.h>
#include <syscall.h>
#include <arch/syscall.h>
int
access (char const *file_name, int how)

View File

@ -0,0 +1,28 @@
/* -*-comment-start: "//";comment-end:""-*-
* GNU Mes --- Maxwell Equations of Software
* Copyright © 2016,2017,2020,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
* Copyright © 2020 Danny Milosavljevic <dannym@scratchpost.org>
*
* This file is part of GNU Mes.
*
* GNU Mes 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 3 of the License, or (at
* your option) any later version.
*
* GNU Mes 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 GNU Mes. If not, see <http://www.gnu.org/licenses/>.
*/
void
_exit ()
{
asm ("SYS_exit mov____$i8,%r7");
asm ("!4 ldr____%r0,(%fp,-#$i8)");
asm ("swi____$0");
}

View File

@ -0,0 +1,30 @@
/* -*-comment-start: "//";comment-end:""-*-
* GNU Mes --- Maxwell Equations of Software
* Copyright © 2016,2017,2020,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
* Copyright © 2020 Danny Milosavljevic <dannym@scratchpost.org>
*
* This file is part of GNU Mes.
*
* GNU Mes 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 3 of the License, or (at
* your option) any later version.
*
* GNU Mes 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 GNU Mes. If not, see <http://www.gnu.org/licenses/>.
*/
void
_write ()
{
asm ("SYS_write mov____$i8,%r7");
asm ("!4 ldr____%r0,(%fp,-#$i8)");
asm ("!8 ldr____%r1,(%fp,-#$i8)");
asm ("!12 ldr____%r2,(%fp,-#$i8)");
asm ("swi____$0");
}

View File

@ -0,0 +1,145 @@
### GNU Mes --- Maxwell Equations of Software
### Copyright (C) 2016 Jeremiah Orians
### Copyright © 2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
###
### This file is part of GNU Mes.
###
### GNU Mes 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 3 of the License, or (at
### your option) any later version.
###
### GNU Mes 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 GNU Mes. If not, see <http://www.gnu.org/licenses/>.
:_start
'0' SP BP NO_SHIFT MOVE_ALWAYS ; Setup Base Pointer
;; Prepare argv
!4 R0 ADD BP ARITH_ALWAYS ; ARGV_address = BP + 4
{R0} PUSH_ALWAYS ; Put argv on the stack
;; Prepare envp
'0' BP R0 NO_SHIFT MOVE_ALWAYS ; Address we need to load from
!0 R0 LOAD32 R0 MEMORY ; Get ARGC
!2 R0 ADD R0 ARITH_ALWAYS ; OFFSET = ARGC + 2
'0' R0 R0 '1' MOVE_ALWAYS ; OFFSET = OFFSET * WORDSIZE
'0' R0 R0 ADD BP ARITH2_ALWAYS ; ENVP_address = BP + OFFSET
{R0} PUSH_ALWAYS ; Put envp on the stack
mov____%r0,0x32 &GLOBAL_environ
;; Stack offset
!4 BP ADD BP ARITH_ALWAYS ; Fix BP
;;^~FUNCTION___init_io CALL_ALWAYS ; Setup for FILE*
;; Initialize MesCC lib file descriptors.
!0 mov____$i8,%r0
mov____%r0,0x32 &GLOBAL___stdin
!1 mov____$i8,%r0
mov____%r0,0x32 &GLOBAL___stdout
!2 mov____$i8,%r0
mov____%r0,0x32 &GLOBAL___stderr
^~FUNCTION_main CALL_ALWAYS ; Jump right into main
SYS_exit mov____$i8,%r7
swi____$0
# Unsigned Divide
:divide
{R4} PUSH_ALWAYS ; Protect R4
{R3} PUSH_ALWAYS ; Protect R3
{R2} PUSH_ALWAYS ; Protect R2
'0' R0 R3 NO_SHIFT MOVE_ALWAYS ; MOV R3,R0
'0' R1 R2 NO_SHIFT MOVE_ALWAYS ; MOV R2,R1
!0 R0 LOADI8_ALWAYS ; MOV R0,#0
!0 CMPI8 R2 IMM_ALWAYS ; CMP R2,#0
!1 R0 SUB R0 ARITH_LT ; SUBLT R0,R0,#1
!0 CMPI8 R3 IMM_ALWAYS ; CMP R3,#0
!0 R3 RSUB R3 ARITH_LT ; RSBLT R3,R3,#0
'0' R0 R0 MVN_LT ; MVNLT R0,R0
'0' R0 R4 NO_SHIFT MOVE_ALWAYS ; MOV R4,R0
!32 R0 LOADI8_ALWAYS ; MOV R0,#32.
!0 R1 LOADI8_ALWAYS ; MOV R1,#0
:divide_loop
'0' R2 R2 ADDS R2 ARITH2_ALWAYS ; ADDS R2,R2,R2
'0' R1 R1 ADCS R1 ARITH2_ALWAYS ; ADCS R1,R1,R1
'0' R3 CMP R1 AUX_ALWAYS ; CMP R1,R3
'0' R3 R1 SUB R1 ARITH2_GE ; SUBGE R1,R1,R3
!1 R2 ADD R2 ARITH_GE ; ADDGE R2,R2,#1
!1 R0 SUB R0 ARITH_ALWAYS ; SUB R0,R0,#1
!0 CMPI8 R0 IMM_ALWAYS ; CMP R0,#0
^~divide_loop JUMP_NE ; BNE loop
'0' R2 R0 NO_SHIFT MOVE_ALWAYS ; MOV R0,R2
{R2} POP_ALWAYS ; Restore R2
{R3} POP_ALWAYS ; Restore R3
{R4} POP_ALWAYS ; Restore R4
'1' LR RETURN
# Signed Divide
:divides
{R4} PUSH_ALWAYS ; Protect R4
{R3} PUSH_ALWAYS ; Protect R3
{R2} PUSH_ALWAYS ; Protect R2
'0' R0 R3 NO_SHIFT MOVE_ALWAYS ; MOV R3,R0
'0' R1 R2 NO_SHIFT MOVE_ALWAYS ; MOV R2,R1
!0 R0 LOADI8_ALWAYS ; MOV R0,#0
!0 CMPI8 R2 IMM_ALWAYS ; CMP R2,#0
!0 R2 RSUB R2 ARITH_LT ; RSBLT R2,R2,#0
!1 R0 SUB R0 ARITH_LT ; SUBLT R0,R0,#1
!0 CMPI8 R3 IMM_ALWAYS ; CMP R3,#0
!0 R3 RSUB R3 ARITH_LT ; RSBLT R3,R3,#0
'0' R0 R0 MVN_LT ; MVNLT R0,R0
'0' R0 R4 NO_SHIFT MOVE_ALWAYS ; MOV R4,R0
!32 R0 LOADI8_ALWAYS ; MOV R0,#32.
!0 R1 LOADI8_ALWAYS ; MOV R1,#0
:divides_loop
'0' R2 R2 ADDS R2 ARITH2_ALWAYS ; ADDS R2,R2,R2
'0' R1 R1 ADCS R1 ARITH2_ALWAYS ; ADCS R1,R1,R1
'0' R3 CMP R1 AUX_ALWAYS ; CMP R1,R3
'0' R3 R1 SUB R1 ARITH2_GE ; SUBGE R1,R1,R3
!1 R2 ADD R2 ARITH_GE ; ADDGE R2,R2,#1
!1 R0 SUB R0 ARITH_ALWAYS ; SUB R0,R0,#1
!0 CMPI8 R0 IMM_ALWAYS ; CMP R0,#0
^~divides_loop JUMP_NE ; BNE loop
!0 CMPI8 R4 IMM_ALWAYS ; CMP R4,#0
!0 R2 RSUB R2 ARITH_NE ; RSBNE R2,R2,#0
'0' R2 R0 NO_SHIFT MOVE_ALWAYS ; MOV R0,R2
{R2} POP_ALWAYS ; Restore R2
{R3} POP_ALWAYS ; Restore R3
{R4} POP_ALWAYS ; Restore R4
'1' LR RETURN
# Unsigned Modulus
:modulus
{LR} PUSH_ALWAYS ; Prepare to leverage divide
^~divide CALL_ALWAYS ; Use divide
'0' R1 R0 NO_SHIFT MOVE_ALWAYS ; MOV R0,R1
{LR} POP_ALWAYS ; Prepare for return
'1' LR RETURN
# Signed Modulus
:moduluss
{LR} PUSH_ALWAYS ; Prepare to leverage divide
^~divides CALL_ALWAYS ; Use divides
'0' R1 R0 NO_SHIFT MOVE_ALWAYS ; MOV R0,R1
{LR} POP_ALWAYS ; Prepare for return
'1' LR RETURN

View File

@ -0,0 +1,34 @@
/* -*-comment-start: "//";comment-end:""-*-
* GNU Mes --- Maxwell Equations of Software
* Copyright © 2017,2018,2019,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
*
* This file is part of GNU Mes.
*
* GNU Mes 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 3 of the License, or (at
* your option) any later version.
*
* GNU Mes 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 GNU Mes. If not, see <http://www.gnu.org/licenses/>.
*/
#include "mes/lib-mini.h"
int __stdin;
int __stdout;
int __stderr;
char **environ;
int main (int argc, char **argv, char **envp);
/* FIXME: this is going to be called `FUNCTION__start' */
//#int
//#_start ()
//#{
//# ..
//#}

View File

@ -0,0 +1,165 @@
/* -*-comment-start: "//";comment-end:""-*-
* GNU Mes --- Maxwell Equations of Software
* Copyright © 2016,2017,2018,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
*
* This file is part of GNU Mes.
*
* GNU Mes 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 3 of the License, or (at
* your option) any later version.
*
* GNU Mes 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 GNU Mes. If not, see <http://www.gnu.org/licenses/>.
*/
#include <errno.h>
#include <linux/arm/syscall.h>
int errno;
int
__sys_call (int sys_call)
{
asm ("!4 ldr____%r7,(%fp,-#$i8)");
asm ("swi____$0");
}
int
__sys_call1 (int sys_call, int one)
{
asm ("!4 ldr____%r7,(%fp,-#$i8)");
asm ("!8 ldr____%r0,(%fp,-#$i8)");
asm ("swi____$0");
}
int
__sys_call2 (int sys_call, int one, int two)
{
asm ("!4 ldr____%r7,(%fp,-#$i8)");
asm ("!8 ldr____%r0,(%fp,-#$i8)");
asm ("!12 ldr____%r1,(%fp,-#$i8)");
asm ("swi____$0");
}
int
__sys_call3 (int sys_call, int one, int two, int three)
{
asm ("!4 ldr____%r7,(%fp,-#$i8)");
asm ("!8 ldr____%r0,(%fp,-#$i8)");
asm ("!12 ldr____%r1,(%fp,-#$i8)");
asm ("!16 ldr____%r2,(%fp,-#$i8)");
asm ("swi____$0");
}
int
__sys_call4 (int sys_call, int one, int two, int three, int four)
{
asm ("!4 ldr____%r7,(%fp,-#$i8)");
asm ("!8 ldr____%r0,(%fp,-#$i8)");
asm ("!12 ldr____%r1,(%fp,-#$i8)");
asm ("!16 ldr____%r2,(%fp,-#$i8)");
asm ("!20 ldr____%r2,(%fp,-#$i8)");
asm ("swi____$0");
}
int
__sys_call6 (int sys_call, int one, int two, int three, int four, int five, int six)
{
asm ("!4 ldr____%r7,(%fp,-#$i8)");
asm ("!8 ldr____%r0,(%fp,-#$i8)");
asm ("!12 ldr____%r1,(%fp,-#$i8)");
asm ("!16 ldr____%r2,(%fp,-#$i8)");
asm ("!20 ldr____%r2,(%fp,-#$i8)");
asm ("!24 ldr____%r2,(%fp,-#$i8)");
asm ("swi____$0");
}
int
_sys_call (int sys_call)
{
int r = __sys_call (sys_call);
if (r < 0)
{
errno = -r;
r = -1;
}
else
errno = 0;
return r;
}
int
_sys_call1 (int sys_call, int one)
{
int r = __sys_call1 (sys_call, one);
if (r < 0)
{
errno = -r;
r = -1;
}
else
errno = 0;
return r;
}
int
_sys_call2 (int sys_call, int one, int two)
{
int r = __sys_call2 (sys_call, one, two);
if (r < 0)
{
errno = -r;
r = -1;
}
else
errno = 0;
return r;
}
int
_sys_call3 (int sys_call, int one, int two, int three)
{
int r = __sys_call3 (sys_call, one, two, three);
if (r < 0)
{
errno = -r;
r = -1;
}
else
errno = 0;
return r;
}
int
_sys_call4 (int sys_call, int one, int two, int three, int four)
{
int r = __sys_call4 (sys_call, one, two, three, four);
if (r < 0)
{
errno = -r;
r = -1;
}
else
errno = 0;
return r;
}
int
_sys_call6 (int sys_call, int one, int two, int three, int four, int five, int six)
{
int r = __sys_call6 (sys_call, one, two, three, four, five, six);
if (r < 0)
{
errno = -r;
r = -1;
}
else
errno = 0;
return r;
}

View File

@ -1,6 +1,6 @@
/* -*-comment-start: "//";comment-end:""-*-
* GNU Mes --- Maxwell Equations of Software
* Copyright © 2016,2017,2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
* Copyright © 2016,2017,2018,2019,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
*
* This file is part of GNU Mes.
*
@ -20,7 +20,7 @@
#include <mes/lib.h>
#include <linux/syscall.h>
#include <syscall.h>
#include <arch/syscall.h>
long
brk (void *addr)

View File

@ -1,6 +1,6 @@
/* -*-comment-start: "//";comment-end:""-*-
* GNU Mes --- Maxwell Equations of Software
* Copyright © 2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
* Copyright © 2018,2019,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
*
* This file is part of GNU Mes.
*
@ -19,7 +19,7 @@
*/
#include <linux/syscall.h>
#include <syscall.h>
#include <arch/syscall.h>
int
chdir (char const *file_name)

View File

@ -1,6 +1,6 @@
/* -*-comment-start: "//";comment-end:""-*-
* GNU Mes --- Maxwell Equations of Software
* Copyright © 2016,2017,2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
* Copyright © 2016,2017,2018,2019,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
*
* This file is part of GNU Mes.
*
@ -20,7 +20,7 @@
#include <mes/lib.h>
#include <linux/syscall.h>
#include <syscall.h>
#include <arch/syscall.h>
#include <sys/stat.h>
int

View File

@ -1,6 +1,6 @@
/* -*-comment-start: "//";comment-end:""-*-
* GNU Mes --- Maxwell Equations of Software
* Copyright © 2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
* Copyright © 2018,2019,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
*
* This file is part of GNU Mes.
*
@ -20,7 +20,7 @@
#include <mes/lib.h>
#include <linux/syscall.h>
#include <syscall.h>
#include <arch/syscall.h>
#include <time.h>
int

View File

@ -1,6 +1,6 @@
/* -*-comment-start: "//";comment-end:""-*-
* GNU Mes --- Maxwell Equations of Software
* Copyright © 2016,2017,2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
* Copyright © 2016,2017,2018,2019,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
*
* This file is part of GNU Mes.
*
@ -19,7 +19,7 @@
*/
#include <linux/syscall.h>
#include <syscall.h>
#include <arch/syscall.h>
#include <mes/lib.h>
int

View File

@ -1,6 +1,6 @@
/* -*-comment-start: "//";comment-end:""-*-
* GNU Mes --- Maxwell Equations of Software
* Copyright © 2016,2017,2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
* Copyright © 2016,2017,2018,2019,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
*
* This file is part of GNU Mes.
*
@ -19,7 +19,7 @@
*/
#include <linux/syscall.h>
#include <syscall.h>
#include <arch/syscall.h>
int
dup (int old)

View File

@ -1,6 +1,6 @@
/* -*-comment-start: "//";comment-end:""-*-
* GNU Mes --- Maxwell Equations of Software
* Copyright © 2016,2017,2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
* Copyright © 2016,2017,2018,2019,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
*
* This file is part of GNU Mes.
*
@ -19,7 +19,7 @@
*/
#include <linux/syscall.h>
#include <syscall.h>
#include <arch/syscall.h>
int
dup2 (int old, int new)

View File

@ -1,6 +1,6 @@
/* -*-comment-start: "//";comment-end:""-*-
* GNU Mes --- Maxwell Equations of Software
* Copyright © 2016,2017,2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
* Copyright © 2016,2017,2018,2019,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
*
* This file is part of GNU Mes.
*
@ -19,7 +19,7 @@
*/
#include <linux/syscall.h>
#include <syscall.h>
#include <arch/syscall.h>
int
execve (char const *file_name, char *const argv[], char *const env[])

View File

@ -1,6 +1,6 @@
/* -*-comment-start: "//";comment-end:""-*-
* GNU Mes --- Maxwell Equations of Software
* Copyright © 2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
* Copyright © 2018,2019,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
*
* This file is part of GNU Mes.
*
@ -19,7 +19,7 @@
*/
#include <linux/syscall.h>
#include <syscall.h>
#include <arch/syscall.h>
#include <stdarg.h>
int

View File

@ -1,6 +1,6 @@
/* -*-comment-start: "//";comment-end:""-*-
* GNU Mes --- Maxwell Equations of Software
* Copyright © 2016,2017,2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
* Copyright © 2016,2017,2018,2019,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
*
* This file is part of GNU Mes.
*
@ -19,7 +19,7 @@
*/
#include <linux/syscall.h>
#include <syscall.h>
#include <arch/syscall.h>
int
fork ()

View File

@ -1,6 +1,6 @@
/* -*-comment-start: "//";comment-end:""-*-
* GNU Mes --- Maxwell Equations of Software
* Copyright © 2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
* Copyright © 2018,2019,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
*
* This file is part of GNU Mes.
*
@ -19,7 +19,7 @@
*/
#include <linux/syscall.h>
#include <syscall.h>
#include <arch/syscall.h>
#include <sys/stat.h>
int

View File

@ -1,6 +1,6 @@
/* -*-comment-start: "//";comment-end:""-*-
* GNU Mes --- Maxwell Equations of Software
* Copyright © 2016,2017,2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
* Copyright © 2016,2017,2018,2019,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
*
* This file is part of GNU Mes.
*
@ -19,7 +19,7 @@
*/
#include <linux/syscall.h>
#include <syscall.h>
#include <arch/syscall.h>
int
fsync (int filedes)

View File

@ -1,6 +1,6 @@
/* -*-comment-start: "//";comment-end:""-*-
* GNU Mes --- Maxwell Equations of Software
* Copyright © 2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
* Copyright © 2018,2019,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
*
* This file is part of GNU Mes.
*
@ -19,7 +19,7 @@
*/
#include <linux/syscall.h>
#include <syscall.h>
#include <arch/syscall.h>
#include <sys/types.h>
int

View File

@ -1,6 +1,6 @@
/* -*-comment-start: "//";comment-end:""-*-
* GNU Mes --- Maxwell Equations of Software
* Copyright © 2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
* Copyright © 2018,2019,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
*
* This file is part of GNU Mes.
*
@ -19,7 +19,7 @@
*/
#include <linux/syscall.h>
#include <syscall.h>
#include <arch/syscall.h>
#include <unistd.h>
gid_t

View File

@ -1,6 +1,6 @@
/* -*-comment-start: "//";comment-end:""-*-
* GNU Mes --- Maxwell Equations of Software
* Copyright © 2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
* Copyright © 2018,2019,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
*
* This file is part of GNU Mes.
*
@ -19,7 +19,7 @@
*/
#include <linux/syscall.h>
#include <syscall.h>
#include <arch/syscall.h>
#include <unistd.h>
uid_t

View File

@ -1,6 +1,6 @@
/* -*-comment-start: "//";comment-end:""-*-
* GNU Mes --- Maxwell Equations of Software
* Copyright © 2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
* Copyright © 2018,2019,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
*
* This file is part of GNU Mes.
*
@ -19,7 +19,7 @@
*/
#include <linux/syscall.h>
#include <syscall.h>
#include <arch/syscall.h>
#include <unistd.h>
gid_t

View File

@ -1,6 +1,6 @@
/* -*-comment-start: "//";comment-end:""-*-
* GNU Mes --- Maxwell Equations of Software
* Copyright © 2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
* Copyright © 2018,2019,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
*
* This file is part of GNU Mes.
*
@ -19,7 +19,7 @@
*/
#include <linux/syscall.h>
#include <syscall.h>
#include <arch/syscall.h>
#include <unistd.h>
pid_t

View File

@ -1,6 +1,6 @@
/* -*-comment-start: "//";comment-end:""-*-
* GNU Mes --- Maxwell Equations of Software
* Copyright © 2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
* Copyright © 2018,2019,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
*
* This file is part of GNU Mes.
*
@ -19,7 +19,7 @@
*/
#include <linux/syscall.h>
#include <syscall.h>
#include <arch/syscall.h>
#include <unistd.h>
pid_t

View File

@ -1,6 +1,6 @@
/* -*-comment-start: "//";comment-end:""-*-
* GNU Mes --- Maxwell Equations of Software
* Copyright © 2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
* Copyright © 2018,2019,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
*
* This file is part of GNU Mes.
*
@ -19,7 +19,7 @@
*/
#include <linux/syscall.h>
#include <syscall.h>
#include <arch/syscall.h>
#include <sys/resource.h>
int

View File

@ -1,6 +1,6 @@
/* -*-comment-start: "//";comment-end:""-*-
* GNU Mes --- Maxwell Equations of Software
* Copyright © 2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
* Copyright © 2018,2019,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
*
* This file is part of GNU Mes.
*
@ -20,7 +20,7 @@
#include <mes/lib.h>
#include <linux/syscall.h>
#include <syscall.h>
#include <arch/syscall.h>
#include <sys/time.h>
int

View File

@ -1,6 +1,6 @@
/* -*-comment-start: "//";comment-end:""-*-
* GNU Mes --- Maxwell Equations of Software
* Copyright © 2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
* Copyright © 2018,2019,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
*
* This file is part of GNU Mes.
*
@ -19,7 +19,7 @@
*/
#include <linux/syscall.h>
#include <syscall.h>
#include <arch/syscall.h>
#include <unistd.h>
uid_t

View File

@ -1,6 +1,6 @@
/* -*-comment-start: "//";comment-end:""-*-
* GNU Mes --- Maxwell Equations of Software
* Copyright © 2016,2017,2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
* Copyright © 2016,2017,2018,2019,2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
*
* This file is part of GNU Mes.
*
@ -19,7 +19,7 @@
*/
#include <linux/syscall.h>
#include <syscall.h>
#include <arch/syscall.h>
#include <stdarg.h>
#include <sys/ioctl.h>
@ -33,10 +33,3 @@ ioctl (int filedes, unsigned long command, ...)
va_end (ap);
return r;
}
int
ioctl3 (int filedes, unsigned long command, long data)
{
int r = _sys_call3 (SYS_ioctl, filedes, command, data);
return r;
}

View File

@ -1,6 +1,6 @@
/* -*-comment-start: "//";comment-end:""-*-
* GNU Mes --- Maxwell Equations of Software
* Copyright © 2016,2017,2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
* Copyright © 2016,2017,2018,2019,2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
*
* This file is part of GNU Mes.
*
@ -19,16 +19,13 @@
*/
#include <linux/syscall.h>
#include <syscall.h>
#include <stdarg.h>
#include <sys/ioctl.h>
#include <arch/syscall.h>
#include <mes/lib.h>
int
ioctl (int filedes, long command, int data)
ioctl3 (int filedes, size_t command, long data)
{
long long_filedes = filedes;
long long_command = command;
long long_data = data;
int r = _sys_call3 (SYS_ioctl, long_filedes, long_command, long_data);
long long_filedes = cast_int_to_long (filedes);
int r = _sys_call3 (SYS_ioctl, long_filedes, command, data);
return r;
}

View File

@ -1,6 +1,6 @@
/* -*-comment-start: "//";comment-end:""-*-
* GNU Mes --- Maxwell Equations of Software
* Copyright © 2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
* Copyright © 2018,2019,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
*
* This file is part of GNU Mes.
*
@ -19,7 +19,7 @@
*/
#include <linux/syscall.h>
#include <syscall.h>
#include <arch/syscall.h>
#include <unistd.h>
int

View File

@ -1,6 +1,6 @@
/* -*-comment-start: "//";comment-end:""-*-
* GNU Mes --- Maxwell Equations of Software
* Copyright © 2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
* Copyright © 2018,2019,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
*
* This file is part of GNU Mes.
*
@ -19,7 +19,7 @@
*/
#include <linux/syscall.h>
#include <syscall.h>
#include <arch/syscall.h>
int
link (char const *old_name, char const *new_name)

View File

@ -20,7 +20,7 @@
#include <mes/lib.h>
#include <linux/syscall.h>
#include <syscall.h>
#include <arch/syscall.h>
#include <stdio.h>
#include <sys/types.h>

View File

@ -1,6 +1,6 @@
/* -*-comment-start: "//";comment-end:""-*-
* GNU Mes --- Maxwell Equations of Software
* Copyright © 2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
* Copyright © 2018,2019,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
*
* This file is part of GNU Mes.
*
@ -19,7 +19,7 @@
*/
#include <linux/syscall.h>
#include <syscall.h>
#include <arch/syscall.h>
#include <sys/stat.h>
int

View File

@ -1,6 +1,7 @@
/* -*-comment-start: "//";comment-end:""-*-
* GNU Mes --- Maxwell Equations of Software
* Copyright © 2016,2017,2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
* Copyright © 2016,2017,2018,2019,2021 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
* Copyright © 2021 Danny Milosavljevic <dannym@scratchpost.org>
*
* This file is part of GNU Mes.
*
@ -20,16 +21,9 @@
#include <mes/lib.h>
#include <string.h>
#include <stddef.h>
#include <stdint.h>
/* FIXME: We want bin/mes-mescc's x86-linux sha256sum to stay the same.
Therfore we cannot remove stdlib/malloc from libc_SOURCES, which is
what GNU suggests.
move stdlib/malloc.c to unix/malloc.c and move it from shared
libc_SOURCES to linux-specific list when the checksum of mes.c
changes. */
#if !__GNU__
char *__brk = 0;
void *
@ -37,10 +31,12 @@ malloc (size_t size)
{
if (!__brk)
__brk = cast_long_to_charp (brk (0));
/* align what we give back. */
__brk = (char*) (((uintptr_t) __brk
+ sizeof (max_align_t) - 1) & -sizeof (max_align_t));
if (brk (__brk + size) == -1)
return 0;
char *p = __brk;
__brk = __brk + size;
return p;
}
#endif /* !__GNU__ */

View File

@ -1,6 +1,6 @@
/* -*-comment-start: "//";comment-end:""-*-
* GNU Mes --- Maxwell Equations of Software
* Copyright © 2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
* Copyright © 2018,2019,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
*
* This file is part of GNU Mes.
*
@ -19,7 +19,7 @@
*/
#include <linux/syscall.h>
#include <syscall.h>
#include <arch/syscall.h>
#include <sys/stat.h>
int

View File

@ -1,6 +1,6 @@
/* -*-comment-start: "//";comment-end:""-*-
* GNU Mes --- Maxwell Equations of Software
* Copyright © 2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
* Copyright © 2018,2019,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
*
* This file is part of GNU Mes.
*
@ -19,7 +19,7 @@
*/
#include <linux/syscall.h>
#include <syscall.h>
#include <arch/syscall.h>
#include <sys/stat.h>
int

View File

@ -1,6 +1,6 @@
/* -*-comment-start: "//";comment-end:""-*-
* GNU Mes --- Maxwell Equations of Software
* Copyright © 2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
* Copyright © 2018,2019,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
*
* This file is part of GNU Mes.
*
@ -19,7 +19,7 @@
*/
#include <linux/syscall.h>
#include <syscall.h>
#include <arch/syscall.h>
#include <time.h>
#include <sys/time.h>

View File

@ -1,6 +1,6 @@
/* -*-comment-start: "//";comment-end:""-*-
* GNU Mes --- Maxwell Equations of Software
* Copyright © 2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
* Copyright © 2018,2019,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
*
* This file is part of GNU Mes.
*
@ -19,7 +19,7 @@
*/
#include <linux/syscall.h>
#include <syscall.h>
#include <arch/syscall.h>
#include <unistd.h>
int

View File

@ -1,6 +1,6 @@
/* -*-comment-start: "//";comment-end:""-*-
* GNU Mes --- Maxwell Equations of Software
* Copyright © 2016,2017,2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
* Copyright © 2016,2017,2018,2019,2023 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
*
* This file is part of GNU Mes.
*
@ -19,7 +19,7 @@
*/
#include <linux/syscall.h>
#include <syscall.h>
#include <arch/syscall.h>
#include <mes/lib.h>
#include <fcntl.h>
@ -27,7 +27,7 @@ ssize_t
read (int filedes, void *buffer, size_t size)
{
long long_filedes = filedes;
ssize_t bytes = _sys_call3 (SYS_read, long_filedes, buffer, size);
ssize_t bytes = _sys_call3 (SYS_read, long_filedes, (long) buffer, (long) size);
if (__mes_debug () > 4)
{
if (bytes == 1)

View File

@ -1,6 +1,6 @@
/* -*-comment-start: "//";comment-end:""-*-
* GNU Mes --- Maxwell Equations of Software
* Copyright © 2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
* Copyright © 2018,2019,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
*
* This file is part of GNU Mes.
*
@ -19,7 +19,7 @@
*/
#include <linux/syscall.h>
#include <syscall.h>
#include <arch/syscall.h>
#include <sys/stat.h>
ssize_t

Some files were not shown because too many files have changed in this diff Show More