Commit Graph

2254 Commits

Author SHA1 Message Date
Jan (janneke) Nieuwenhuizen 2ed1f5a34b kaem: Add kaem.arm and kaem.x86.
* kaem.arm,
kaem.x86: New files.
2022-09-15 14:56:32 +02:00
Jan (janneke) Nieuwenhuizen cda70de448 kaem.run: Remove --bootstrap-mode.
* include/linux/arm/syscall.h,
include/linux/x86/syscall.h,
include/mes/constants.h: Remove CONSTANTs.
* lib/m2/open.c: Move to...
* lib/linux/open.c: ...here.  Update to make gcc-compatible.
* scaffold/argv.kaem: Update accordingly.
* lib/linux/lseek.c (lseek): Suport M2-Planet.
* lib/linux/waitpid.c (waitpid): Suport M2-Planet.
* lib/m2/getcwd.c (PATH_MAX): Remove CONSTANT.
* lib/m2/isatty.c (TCGETS): Remove CONSTANT.
* lib/mes/ntoab.c: Support M2-Planet.
* lib/posix/getcwd.c (__getcwd_buf): Remove.
* lib/posix/getenv.c (M2_PTR_SIZE)[__M2__]: Update to #define.
* lib/posix/setenv.c: Likewise.
* lib/stub/__raise.c (SIGABRT): Remove CONSTANT.
* src/core.c (error): Use __M2__ instead of __M2_PLANET__.
* src/gc.c (M2_CELL_SIZE)[__M2__]: Update to #define.  Support
non-bootstrap-mode.
* src/posix.c: Likewise.
* src/symbol.c: Likewise.
* src/vector.c: Likewise.
* kaem.run: Remove --botstrap-mode.  Update source list accordingly.
* simple.make (M2_PLANET_FLAGS): Remove --bootstrap-mode.
* simple.make (M2_SOURCES, M2_PLANET_INCLUDES): Update source list
accordingly.
2022-09-15 14:56:21 +02:00
Jan (janneke) Nieuwenhuizen dab5a9d5c7 lib: posix/open: Support M2-Planet.
* lib/posix/open.c (open)[__M2__]: New function.
2022-09-15 14:27:51 +02:00
Jan (janneke) Nieuwenhuizen 3905ef3613 lib: linux/_open3: Support M2-Planet.
* lib/linux/_open3.c (_open3): Use function casting.  Also call
__ungetc_init.
* lib/stub/__buffered_read.c: New file.
2022-09-15 14:27:51 +02:00
Jan (janneke) Nieuwenhuizen 76967b6494 kaem: read: Remove --bootstrap-mode.
* include/mes/lib.h[__M2__](__call_at_exit,abtod,dtoab,ultoa,
* include/sys/types.h[__M2__]: Fall back to unsigned instead of using
unsigned long.
* include/stdio.h[__M2__](fprintf, fscanf, printf, snprintf, sprintf,
sscanf): Hide prototypes.
* lib/stdlib/exit.c (exit)[__M2__]: Hide call to __call_at_exit.
* lib/linux/read.c (read)[__M2__]: Hide debugging.
* lib/linux/malloc.c (malloc)[__M2__]: Hide alignment.
__mesabi_umod, __mesabi_udiv, __mesabi_uldiv): Hide prototypes.
* scaffold/argv.kaem: Use them together with lib/mes/lib-mini.h instead of
lib/mes/* specializations.  Remove --bootstrap-mode from M2-Planet call.
2022-09-15 14:27:51 +02:00
Jan (janneke) Nieuwenhuizen 9b0c397cb0 kaem: argv: Remove --bootstrap-mode.
* scaffold/argv.kaem: Use lib/mes/lib-mini.h instead of lib/m2/lib.h.
Remove --bootstrap-mode from M2-Planet call.
2022-09-15 14:27:51 +02:00
Jan (janneke) Nieuwenhuizen 0305f345fe kaem: hello: Remove --bootstrap-mode.
* include/mes/lib-mini.h: Remove M2 bootstrap constants.
[__M2__](size_t): Fall-back to unsigned instead of unsigned long.
* scaffold/hello.kaem: Use it instead of lib/m2/lib.h.  Remove
--bootstrap-mode from M2-Planet call.
2022-09-15 14:27:51 +02:00
Jan (janneke) Nieuwenhuizen 5c436dae9f kaem: main: Remove --bootstrap-mode.
* scaffold/main.kaem: Remove --bootstrap-mode from M2-Planet call.
2022-09-15 14:27:51 +02:00
Jan (janneke) Nieuwenhuizen 6a031319e4 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-09-15 14:27:51 +02:00
Jan (janneke) Nieuwenhuizen d88da02892 simple.make: Resurrect.
* simple.make (M2_PLANET_FLAGS): Add --bootstrap-mode.
(M2_SOURCES): Use lib/mes/mini-write.c instead of lib/mes/write.c
2022-09-15 14:27:51 +02:00
Jan (janneke) Nieuwenhuizen a6ecd2c344 lib: linux/read: Fix compile warnings.
* lib/linux/read.c (read): Cast filedes, buffer to long.
2022-09-15 14:27:51 +02:00
Jan (janneke) Nieuwenhuizen 2edf1c997d lib: mes/write: Rename from mes/mini-write.c
* lib/mes/mini-write.c: Move to...
* lib/mes/write.c: ...here.
* build-aux/configure-lib.sh,
kaem.run,
scaffold/argv.kaem,
scaffold/global-array.kaem,
scaffold/hello.kaem,
scaffold/local-array.kaem,
scaffold/local-static-array.kaem,
scaffold/read.kaem,
simple.make,
simple.sh: Update accordingly.
2022-09-15 14:27:51 +02:00
Jan (janneke) Nieuwenhuizen bbb9b2546e build: Cater for colliding basename in C sources.
This is a follow-up to commit
    f785f8d560
    build: Fix --with-bootstrap build.

* build-aux/cc.sh: Retain directory name in object file name.
* build-aux/bootstrap.sh.in: Likewise.  Compile crt1.c from local
directory.
* build-aux/build-lib.sh: Likewise.
* build-aux/build.sh.in: Remove globals.o hack.
2022-09-15 14:27:51 +02:00
Jan (janneke) Nieuwenhuizen 3d3efa06dd guix: m2-planet: Update to 1.10.0.
* guix/git/mes.scm (m2-planet): Update to 1.10.0.
2022-09-15 14:27:51 +02:00
Gabriel Wicki 2b3e6fa7a0 core: Simplify math expressions.
* src/gc.c (gc_up_arena): Use division instead of shift.
(gc_flip): Simplify (free-news) * 1.5.
2022-09-15 14:27:51 +02:00
Jan (janneke) Nieuwenhuizen 1c220d9c3a doc: Update `PORTING'.
* PORTING (Setup environment): Update guile, gcc-toolchain, pin
nyacc@1.00.2.
2022-09-15 14:27:37 +02:00
Jan (janneke) Nieuwenhuizen 31e5f2e476 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-15 14:27:37 +02:00
Jan (janneke) Nieuwenhuizen 496fd10680 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-15 14:27:37 +02:00
Jan (janneke) Nieuwenhuizen cc796a5d61 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-15 14:27:37 +02:00
Jan (janneke) Nieuwenhuizen f9232e804f ARM: ntoab: Do not include __mesabi_uldiv for bootstrap tcc.
* lib/mes/ntoab.c (__mesabi_uldiv): Exclude for tinycc arm bootstrap.
2022-09-15 14:27:37 +02:00
Jan (janneke) Nieuwenhuizen 015e68a28a DRAFT 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 14:27:37 +02:00
Jan (janneke) Nieuwenhuizen a64e292ce2 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-09-12 10:25:51 +02:00
Jan (janneke) Nieuwenhuizen 688b4ffbb6 kaem: Fix version.
* src/symbol.c (MES_VERSION): Update to 0.24.
2022-09-12 10:25:51 +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