Commit Graph

286 Commits

Author SHA1 Message Date
Jan Nieuwenhuizen ed9da00343
mescc: Mes C Library: Add waitpid for M2-Planet.
* lib/m2/waitpid.c: New file.
2019-11-02 21:32:45 +01:00
Jan Nieuwenhuizen 2fe6beeb89
mescc: Mes C Library: Add time for M2-Planet.
* lib/m2/time.c: New file.
2019-11-02 21:32:45 +01:00
Jan Nieuwenhuizen 8e63f6a1ee
mescc: Mes C Library: Add strncmp for M2-Planet.
* lib/m2/strncmp.c: New file.
2019-11-02 21:32:45 +01:00
Jan Nieuwenhuizen 084602e255
mescc: Mes C Library: Add ntoab for M2-Planet.
* lib/m2/ntoab.c: New file.
2019-11-02 21:32:45 +01:00
Jan Nieuwenhuizen d3b1702889
mescc: Mes C Library: Add isatty for M2-Planet.
* lib/m2/isatty.c: New file.
2019-11-02 21:32:45 +01:00
Jan Nieuwenhuizen 85a9799f1d
mescc: Mes C Library: Add ioctl for M2-Planet.
* lib/m2/ioctl.c: New file.
2019-11-02 21:32:45 +01:00
Jan Nieuwenhuizen dfa2a2313a
mescc: Mes C Library: Add getcwd for M2-Planet.
* lib/m2/getcwd.c: New file.
2019-11-02 21:32:45 +01:00
Jan Nieuwenhuizen 93c39de2a5
mescc: Mes C Library: Add exit for M2-Planet.
* lib/m2/exit.c: New file.
2019-11-02 21:32:44 +01:00
Jan Nieuwenhuizen e1ca7a322e
mescc: Mes C Library: Add execve for M2-Planet.
* lib/m2/execve.c: New file.
2019-11-02 21:32:44 +01:00
Jan Nieuwenhuizen 7d4ae93fd2
mescc: Mes C Library: Add execv for M2-Planet.
* lib/m2/execv.c: New file.
2019-11-02 21:32:44 +01:00
Jan Nieuwenhuizen cbd0f648fe
mescc: Mes C Library: Add clock_gettime for M2-Planet.
* lib/m2/clock_gettime.c: New file.
2019-11-02 21:32:44 +01:00
Jan Nieuwenhuizen 04aae72a82
mescc: Mes C Library: Add chmod for M2-Planet.
* lib/m2/chmod.c: New file.
2019-11-02 21:32:44 +01:00
Jan Nieuwenhuizen fd1d7c8b0e
mescc: Mes C Library: Add abtol for M2-Planet.
* lib/m2/abtol.c: New file.
2019-11-02 21:32:44 +01:00
Jan Nieuwenhuizen db831b9b87
mescc: Mes C Library: Prepare for M2-Planet: realloc.
* lib/stdlib/realloc.c (realloc): Prepare for M2-Planet.
2019-11-02 21:27:36 +01:00
Jan Nieuwenhuizen 340ad674f5
mescc: Mes C Library: Prepare for M2-Planet: fdputc.
* lib/mes/fdputc.c (fdputc): Prepare for M2-Planet.
2019-11-02 21:27:36 +01:00
Jan Nieuwenhuizen d00e41d1b1
mescc: Mes C Library: Prepare for M2-Planet: unlink.
* lib/linux/unlink.c (unlink): Prepare for M2-Planet.
2019-11-02 21:27:36 +01:00
Jan Nieuwenhuizen 0dce43bf4b
mescc: Mes C Library: Prepare for M2-Planet: read.
* lib/linux/read.c (read): Prepare for M2-Planet.
2019-11-02 21:27:36 +01:00
Jan Nieuwenhuizen 50cab9bd5c
mescc: Mes C Library: Prepare for M2-Planet: gettimeofday.
* lib/linux/gettimeofday.c (gettimeofday): Prepare for M2-Planet.
2019-11-02 21:27:36 +01:00
Jan Nieuwenhuizen 77d39cf0d6
mescc: Mes C Library: Prepare for M2-Planet: dup2.
* lib/linux/dup2.c (dup2): Prepare for M2-Planet.
2019-11-02 21:27:36 +01:00
Jan Nieuwenhuizen 2dde5d60b7
mescc: Mes C Library: Prepare for M2-Planet: dup.
* lib/linux/dup.c (dup): Prepare for M2-Planet.
2019-11-02 21:27:36 +01:00
Jan Nieuwenhuizen 5dd22c1ad2
mescc: Mes C Library: Prepare for M2-Planet: clock_gettime.
* lib/linux/clock_gettime.c (clock_gettime): Prepare for M2-Planet.
2019-11-02 21:27:35 +01:00
Jan Nieuwenhuizen 49d4e89335
mescc: Mes C Library: Prepare for M2-Planet: chmod.
* lib/linux/chmod.c (chmod): Prepare for M2-Planet.
2019-11-02 21:27:35 +01:00
Jan Nieuwenhuizen 7f8c6ec204
mescc: Mes C Library: Prepare for M2-Planet: access.
* lib/linux/access.c (access): Prepare for M2-Planet.
2019-11-02 21:27:35 +01:00
Jan Nieuwenhuizen 8a40e1bf27
mescc: Mes C Library: Prepare for M2-Planet: _getcwd.
* lib/linux/_getcwd.c (_getcwd): Prepare for M2-Planet.
2019-11-02 21:27:35 +01:00
Jan Nieuwenhuizen 3193e2608c
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-02 21:27:35 +01:00
Jan Nieuwenhuizen 314dadd569
kaem: scaffold/argv.kaem.
* scaffold/argv.c (strcmp): Remove.
(main): Update.
* scaffold/argv.kaem: New file.
2019-11-02 19:13:15 +01:00
Jan Nieuwenhuizen fe4ac6e18e
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-02 19:13:15 +01:00
Jan Nieuwenhuizen eab429a2b9
mescc: Mes C Library: Prepare for M2-Planet: setenv.
* lib/posix/setenv.c: Rewrite C-constructs not supported by M2-Planet.
2019-11-02 19:13:09 +01:00
Jan Nieuwenhuizen 3eb67a9cf3
mescc: Mes C Library: Prepare for M2-Planet: getenv.
* lib/posix/getenv.c: Rewrite C-constructs not supported by M2-Planet.
2019-11-02 19:13:08 +01:00
Jan Nieuwenhuizen 5d64189bc2
mescc: Mes C Library: Prepare for M2-Planet: ntoab.
* lib/mes/ntoab.c: Rewrite C-constructs not supported by M2-Planet.
2019-11-02 19:13:08 +01:00
Jan Nieuwenhuizen f6396cc15e
mescc: Mes C Library: Prepare for M2-Planet: malloc.
* lib/stdlib/malloc.c: Rewrite C-constructs not supported by M2-Planet.
2019-11-02 19:13:08 +01:00
Jan Nieuwenhuizen ae19ddbb47
mescc: Mes C Library: Prepare for M2-Planet: fdungetc.
* lib/mes/fdungetc.c: Rewrite C-constructs not supported by M2-Planet.
2019-11-02 19:13:08 +01:00
Jan Nieuwenhuizen 4ed9ef7085
mescc: Mes C Library: Prepare for M2-Planet: fdgetc.
* lib/mes/fdgetc.c: Rewrite C-constructs not supported by M2-Planet.
2019-11-02 19:13:08 +01:00
Jan Nieuwenhuizen 53b00e8f4f
mescc: Mes C Library: Prepare for M2-Planet: abtol.
* lib/mes/abtol.c: Rewrite C-constructs not supported by M2-Planet.
2019-11-02 19:13:07 +01:00
Jan Nieuwenhuizen b45bd942ef
mescc: Mes C Library: Prepare for M2-Planet: memcmp.
* lib/string/memcmp.c: Rewrite C-constructs not supported by M2-Planet.
2019-11-02 19:13:07 +01:00
Jan Nieuwenhuizen c3292b8bce
mescc: Mes C Library: Prepare for M2-Planet: memcpy.
* lib/string/memcpy.c: Rewrite C-constructs not supported by M2-Planet.
2019-11-02 19:13:07 +01:00
Jan Nieuwenhuizen 62a3c67030
mescc: Mes C Library: Prepare for M2-Planet: memchr.
* lib/string/memchr.c: Rewrite C-constructs not supported by M2-Planet.
2019-11-02 13:54:03 +01:00
Jan Nieuwenhuizen 923fa91960
mescc: Mes C Library: Prepare for M2-Planet: strncmp.
* lib/string/strncmp.c: Rewrite C-constructs not supported by M2-Planet.
2019-11-02 13:54:03 +01:00
Jan Nieuwenhuizen 7133038b50
mescc: Mes C Library: Prepare for M2-Planet: strlen.
* lib/string/strlen.c: : Rewrite C-constructs not supported by M2-Planet.
2019-11-02 13:54:03 +01:00
Jan Nieuwenhuizen dadc4a0927
mescc: Mes C Library: Prepare for M2-Planet: strcpy.
* lib/string/strcpy.c: Rewrite C-constructs not supported by M2-Planet.
2019-11-02 13:54:03 +01:00
Jan Nieuwenhuizen aaee701eb1
mescc: Mes C Library: Prepare for M2-Planet: strcmp.
* lib/string/strcmp.c: Rewrite C-constructs not supported by M2-Planet.
2019-11-02 13:54:03 +01:00
Jan Nieuwenhuizen adde421a0e
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-02 13:54:03 +01:00
Jan Nieuwenhuizen 6c94a05c95
mescc: Mes C Library: Add assert_msg.
* lib/mes/assert_msg.c: New file.
2019-11-02 13:54:02 +01:00
Danny Milosavljevic 738264c3bb
Add missing #include.
* lib/stdlib/mbstowcs.c: Add missing #include.
2019-10-21 21:43:04 +02:00
Danny Milosavljevic 30d362321e
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-10-21 21:43:03 +02:00
Danny Milosavljevic fce055e9da
Add missing #include.
* lib/tests/mes/90-abtod.c (main): Add missing #include.
2019-10-05 17:38:20 +02:00
Danny Milosavljevic a840c5398f
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-10-05 17:38:19 +02:00
Jan Nieuwenhuizen 52b9dd2b0e
build: Improve --with-system-libc support.
* build-aux/build-lib.sh: Avoid building libc for --with-system-libc.
Make libmes richer.
build-aux/check-mescc.sh: Enable 50-malloc test.
* include/dirstream.h: Use HAVE_DIRSTREAM_H to cater for non-existing
dirstream.h.
* include/grp.h[SYSTEM_LIBC]: Typo.
* include/mes/lib.h (__brk, __call_at_exit)[SYSTEM_LIBC]: Declare.
* include/stdlib.h (comparison_fn_t)[SYSTEM_LIBC]: Declare.
* include/time.h (mktime): Return time_t.
* lib/posix/isatty.c [SYSTEM_LIBC]: Do not (re)declare termios.
* lib/stub/mktime.c (mktime): Return time_t.
* lib/tests/scaffold/41-ternary.c (main): Remove assumption that
locals are initialized.
* lib/tests/scaffold/70-stdarg.c: Cater for SYSTEM_LIBC.
* lib/tests/setjmp/80-setjmp.c: Declare jmp buf.
* lib/*/*.c: Add missing mes/lib.h, errno.h includes.
2019-10-05 17:38:15 +02:00
Jan Nieuwenhuizen 7181d3dd9a
mescc: Mes C Library: vfprintf, vsnprintf: Pad floats with space.
* lib/stdio/vfprintf.c (vfprintf): Pad floats with space.
* lib/stdio/vsnprintf.c (vsnprintf): Pad floats with space.
* lib/tests/stdio/90-sprintf.c: Test it.
2019-10-05 17:37:28 +02:00
Jan Nieuwenhuizen f4d6851c63
mescc: Mes C Library: vsscanf: Increase count for scanned float.
* lib/stdio/vsscanf.c (vsscanf): Increase count for scanned float.
2019-10-05 17:37:05 +02:00