Jan Nieuwenhuizen
9532829d89
guix: Update M2-Planet to 1fc2aeab483208bd2ba117b21df3894c182470ec.
...
* guix/git/mes.scm (m2-planet): Update to 1fc2aeab483208bd2ba117b21df3894c182470ec.
* lib/m2/x86/x86_defs.M1: Update from M2-Planet.
2019-11-17 12:25:49 +01:00
Jan Nieuwenhuizen
25e159d622
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/stdlib/malloc.c (malloc): Likewise.
2019-11-17 12:25:48 +01:00
Jan Nieuwenhuizen
b4bab89d0a
mescc: Mes C Library: Add waitpid for M2-Planet.
...
* lib/m2/waitpid.c: New file.
2019-11-17 12:25:44 +01:00
Jan Nieuwenhuizen
7c8e423eae
mescc: Mes C Library: Add time for M2-Planet.
...
* lib/m2/time.c: New file.
2019-11-17 12:25:43 +01:00
Jan Nieuwenhuizen
3660297ef8
mescc: Mes C Library: Add ntoab for M2-Planet.
...
* lib/m2/ntoab.c: New file.
2019-11-17 12:25:43 +01:00
Jan Nieuwenhuizen
2202ab2599
mescc: Mes C Library: Add isatty for M2-Planet.
...
* lib/m2/isatty.c: New file.
2019-11-17 12:25:43 +01:00
Jan Nieuwenhuizen
3c3bb89c94
mescc: Mes C Library: Add ioctl for M2-Planet.
...
* lib/m2/ioctl.c: New file.
2019-11-17 12:25:43 +01:00
Jan Nieuwenhuizen
4355559473
mescc: Mes C Library: Add getcwd for M2-Planet.
...
* lib/m2/getcwd.c: New file.
2019-11-17 12:25:43 +01:00
Jan Nieuwenhuizen
05d5d6d1ee
mescc: Mes C Library: Add exit for M2-Planet.
...
* lib/m2/exit.c: New file.
2019-11-17 12:25:43 +01:00
Jan Nieuwenhuizen
05618820da
mescc: Mes C Library: Add execve for M2-Planet.
...
* lib/m2/execve.c: New file.
2019-11-17 12:25:42 +01:00
Jan Nieuwenhuizen
dda4ebcd21
mescc: Mes C Library: Add execv for M2-Planet.
...
* lib/m2/execv.c: New file.
2019-11-17 12:25:42 +01:00
Jan Nieuwenhuizen
81579b6066
mescc: Mes C Library: Add clock_gettime for M2-Planet.
...
* lib/m2/clock_gettime.c: New file.
2019-11-17 12:25:42 +01:00
Jan Nieuwenhuizen
065b90c82e
mescc: Mes C Library: Add chmod for M2-Planet.
...
* lib/m2/chmod.c: New file.
2019-11-17 12:25:42 +01:00
Jan Nieuwenhuizen
bad6ebeeaf
mescc: Mes C Library: Prepare for M2-Planet: realloc.
...
* lib/stdlib/realloc.c (realloc): Prepare for M2-Planet.
2019-11-17 12:25:42 +01:00
Jan Nieuwenhuizen
0115c9acbe
mescc: Mes C Library: Prepare for M2-Planet: fdputc.
...
* lib/mes/fdputc.c (fdputc): Prepare for M2-Planet.
2019-11-17 12:25:42 +01:00
Jan Nieuwenhuizen
a31d9207e5
mescc: Mes C Library: Prepare for M2-Planet: unlink.
...
* lib/linux/unlink.c (unlink): Prepare for M2-Planet.
2019-11-17 12:25:41 +01:00
Jan Nieuwenhuizen
85322abc07
mescc: Mes C Library: Prepare for M2-Planet: read.
...
* lib/linux/read.c (read): Prepare for M2-Planet.
2019-11-17 12:25:41 +01:00
Jan Nieuwenhuizen
847d1ef665
mescc: Mes C Library: Prepare for M2-Planet: gettimeofday.
...
* lib/linux/gettimeofday.c (gettimeofday): Prepare for M2-Planet.
2019-11-17 12:25:41 +01:00
Jan Nieuwenhuizen
c13d50f867
mescc: Mes C Library: Prepare for M2-Planet: dup2.
...
* lib/linux/dup2.c (dup2): Prepare for M2-Planet.
2019-11-17 12:25:41 +01:00
Jan Nieuwenhuizen
ed49f0d376
mescc: Mes C Library: Prepare for M2-Planet: dup.
...
* lib/linux/dup.c (dup): Prepare for M2-Planet.
2019-11-17 12:25:41 +01:00
Jan Nieuwenhuizen
71f57d9f36
mescc: Mes C Library: Prepare for M2-Planet: clock_gettime.
...
* lib/linux/clock_gettime.c (clock_gettime): Prepare for M2-Planet.
2019-11-17 12:25:41 +01:00
Jan Nieuwenhuizen
ec4abcb3cf
mescc: Mes C Library: Prepare for M2-Planet: chmod.
...
* lib/linux/chmod.c (chmod): Prepare for M2-Planet.
2019-11-17 12:25:41 +01:00
Jan Nieuwenhuizen
60c70cf262
mescc: Mes C Library: Prepare for M2-Planet: access.
...
* lib/linux/access.c (access): Prepare for M2-Planet.
2019-11-17 12:25:40 +01:00
Jan Nieuwenhuizen
ccfdbc0a91
mescc: Mes C Library: Prepare for M2-Planet: _getcwd.
...
* lib/linux/_getcwd.c (_getcwd): Prepare for M2-Planet.
2019-11-17 12:25:40 +01:00
Jan Nieuwenhuizen
6c897f5e63
mescc: Mes C Library: Bugfix __ungetc_clear.
...
* lib/m2/mes_open.c (mes_open): Remove __ungetc_init ();
* lib/m2/open.c (open): Likewise.
2019-11-17 12:25:40 +01:00
Jan Nieuwenhuizen
3427368d31
kaem: scaffold/read.kaem.
...
* .gitignore: Update.
* include/linux/x86/syscall.h: Update for M2-Planet.
* scaffold/read.c: Update for M2-Planet.
* lib/stdlib/malloc.c (malloc): Remove cast for M2-Planet.
* lib/string/memset.c (memset): Update for M2-Planet.
* lib/linux/brk.c (brk): Remove cast for M2-Planet.
2019-11-17 12:25:40 +01:00
Jan Nieuwenhuizen
54c18f998a
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.
2019-11-17 12:25:39 +01:00
Jan Nieuwenhuizen
56ee7781a5
kaem: scaffold/main.kaem.
...
* .gitignore: Update.
* lib/linux/x86-mes-m2/crt1.M1: New file.
* lib/linux/x86-mes-m2/crt1.c: New file.
* lib/m2/x86/x86_defs.M1: New file. Import from stage0.
* scaffold/main.c: Update for M2-Planet.
2019-11-17 12:25:39 +01:00
Jan Nieuwenhuizen
43197fff3c
mescc: Mes C Library: Prepare for M2-Planet: setenv.
...
* lib/posix/setenv.c: Rewrite C-constructs not supported by M2-Planet.
2019-11-17 12:25:32 +01:00
Jan Nieuwenhuizen
d454fe905d
mescc: Mes C Library: Prepare for M2-Planet: getenv.
...
* lib/posix/getenv.c: Rewrite C-constructs not supported by M2-Planet.
2019-11-17 12:25:32 +01:00
Jan Nieuwenhuizen
75895950fb
mescc: Mes C Library: Prepare for M2-Planet: ntoab.
...
* lib/mes/ntoab.c: Rewrite C-constructs not supported by M2-Planet.
2019-11-17 12:25:32 +01:00
Jan Nieuwenhuizen
ed29b83575
mescc: Mes C Library: Prepare for M2-Planet: malloc.
...
* lib/stdlib/malloc.c: Rewrite C-constructs not supported by M2-Planet.
2019-11-17 12:25:32 +01:00
Jan Nieuwenhuizen
cdc4256758
mescc: Mes C Library: Prepare for M2-Planet: fdungetc.
...
* lib/mes/fdungetc.c: Rewrite C-constructs not supported by M2-Planet.
2019-11-17 12:25:32 +01:00
Jan Nieuwenhuizen
790d2ebb91
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.
2019-11-17 12:25:31 +01:00
Jan Nieuwenhuizen
3209febc2e
mescc: Mes C Library: Prepare for M2-Planet: fdgetc.
...
* lib/mes/fdgetc.c: Rewrite C-constructs not supported by M2-Planet.
2019-11-17 12:25:31 +01:00
Jan Nieuwenhuizen
3f5f12201e
mescc: Mes C Library: Prepare for M2-Planet: abtol.
...
* lib/mes/abtol.c: Rewrite C-constructs not supported by M2-Planet.
2019-11-17 12:25:31 +01:00
Jan Nieuwenhuizen
b08281d75e
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.
2019-11-17 12:25:31 +01:00
Jan Nieuwenhuizen
ce11c855ff
mescc: Mes C Library: Prepare for M2-Planet: memcmp.
...
* lib/string/memcmp.c: Rewrite C-constructs not supported by M2-Planet.
2019-11-17 12:25:31 +01:00
Jan Nieuwenhuizen
8ba3abe0c4
mescc: Mes C Library: Prepare for M2-Planet: memcpy.
...
* lib/string/memcpy.c: Rewrite C-constructs not supported by M2-Planet.
2019-11-17 12:25:31 +01:00
Jan Nieuwenhuizen
c536ffb3bf
mescc: Mes C Library: Prepare for M2-Planet: memchr.
...
* lib/string/memchr.c: Rewrite C-constructs not supported by M2-Planet.
2019-11-17 12:25:31 +01:00
Jan Nieuwenhuizen
a5ba54c31f
mescc: Mes C Library: Prepare for M2-Planet: strncmp.
...
* lib/string/strncmp.c: Rewrite C-constructs not supported by M2-Planet.
2019-11-17 12:25:30 +01:00
Jan Nieuwenhuizen
6f3c78314d
mescc: Mes C Library: Prepare for M2-Planet: strlen.
...
* lib/string/strlen.c: : Rewrite C-constructs not supported by M2-Planet.
2019-11-17 12:25:30 +01:00
Jan Nieuwenhuizen
da85d20500
mescc: Mes C Library: Prepare for M2-Planet: strcpy.
...
* lib/string/strcpy.c: Rewrite C-constructs not supported by M2-Planet.
2019-11-17 12:25:30 +01:00
Jan Nieuwenhuizen
c3a7033886
mescc: Mes C Library: Prepare for M2-Planet: strcmp.
...
* lib/string/strcmp.c: Rewrite C-constructs not supported by M2-Planet.
2019-11-17 12:25:30 +01:00
Jan Nieuwenhuizen
2b8bb1abd2
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.
2019-11-17 12:25:30 +01:00
Jan Nieuwenhuizen
6f5d815e7d
mescc: Mes C Library: Add assert_msg.
...
* lib/mes/assert_msg.c: New file.
2019-11-17 12:25:30 +01:00
Danny Milosavljevic
35e84ff8aa
Add missing #include.
...
* lib/stdlib/mbstowcs.c: Add missing #include.
2019-11-17 12:24:47 +01:00
Danny Milosavljevic
58f9e644f4
Fix dtoab.
...
* lib/mes/dtoab.c (dtoab): Fix it.
* lib/tests/mes/90-dtoab.c (main): Fix test.
* build-aux/check-mescc.sh (XFAIL_TESTS: Remove it.
2019-11-17 12:24:47 +01:00
Danny Milosavljevic
0ea76f2f61
Add missing #include.
...
* lib/tests/mes/90-abtod.c (main): Add missing #include.
2019-11-17 12:24:46 +01:00
Danny Milosavljevic
809aa3f03a
Fix variable argument list traversal for doubles.
...
* include/stdarg.h (va_align): New macro.
(va_arg8): New macro.
* lib/stdio/vfprintf.c (vfprintf): Use it.
* lib/stdio/vsnprintf.c (vsnprintf): Use it.
2019-11-17 12:24:46 +01:00