Commit graph

289 commits

Author SHA1 Message Date
Danny Milosavljevic acf86208ed
ARM: Support comparing 32 bit values.
* lib/arm-mes/arm.M1 (cmp____$i32,%r0): New macro.
(cmp____$i32,%r1): New macro.
(cmp____$i32,%r2): New macro.
2020-06-19 02:45:51 +02:00
Danny Milosavljevic d9bda45853
ARM: Handle signed values in r-byte-mem-add, r-word-mem-add.
* lib/arm-mes/arm.M1 (ldrb___%r0,(%r1)): Delete macro.
(ldrh___%r0,(%r0)): Delete macro.
(ldrsh__%r0,(%r0)): New macro.
(ldrh___%r0,(%r1)): Delete macro.
(ldrsh__%r0,(%r1)): New macro.
(ldrh___%r1,(%r1)): Delete macro.
(ldrsh__%r1,(%r1)): New macro.
(ldrh___%r2,(%r2)): Delete macro.
(ldrsh__%r2,(%r2)): New macro.
(ldrh___%r3,(%r3)): Delete macro.
(ldrsh__%r3,(%r3)): New macro.
(ldrsb__%r0,(%r1)): New macro.
* module/mescc/armv4/as.scm (armv4:r-byte-mem-add): Use ldrsb.
(armv4:r-word-mem-add): Use ldrsh, add____$i32,(%r0).
(armv4:word-mem->r): Use ldrsh.
2020-06-19 02:45:33 +02:00
Danny Milosavljevic 821d1b8fe9
ntoab: Simplify LONG_MIN case.
* lib/mes/ntoab.c (ntoab): Simplify LONG_MIN case.

Co-Authored-By: Nathalie Kopaczewski <natkopa@gmail.com>
2020-06-17 00:21:57 +02:00
Danny Milosavljevic b11510f4da
ntoab: Handle LONG_MIN case.
* lib/mes/ntoab.c (ntoab): Handle LONG_MIN case.
* lib/tests/scaffold/60-math.c (main): Add test for INT_MIN and hex.
2020-06-15 11:26:43 +02:00
Danny Milosavljevic 449f3c7e00
Add ARM gcc scaffold assembly.
* lib/linux/arm-mes-gcc/exit-42.S: New file.
* lib/linux/arm-mes-gcc/hello-mes.S: New file.
2020-06-13 19:44:29 +02:00
Danny Milosavljevic 6478476ed7
Implement setjmp for ARM mescc.
* include/setjmp.h: Add ARM case.
* lib/arm-mes-mescc/setjmp.c: New file.
2020-06-12 23:20:17 +02:00
Danny Milosavljevic 48ecb2f29e
test: Test signed division.
* lib/tests/scaffold/36-compare-arithmetic.c (main): Test signed division.
2020-06-10 17:04:55 +02:00
Danny Milosavljevic 3f03574050
ldiv: Work around missing struct return feature.
* lib/mes/div.c (__mesabi_ldiv): Remove return type.
(__mesabi_imod): Adapt call site.
(__aeabi_idiv): Adapt call site and move it to conditional compilation.
(__aeabi_idivmod): Adapt call site.
2020-06-10 15:46:12 +02:00
Danny Milosavljevic d42f99e6cf
mescc: Mes C Library: Hang at the end if necessary.
* lib/linux/arm-mes-mescc/crt1.c (_start): Hang at the end if necessary.
2020-06-10 13:14:33 +02:00
Danny Milosavljevic 040220acee
Add ARM backend.
* build-aux/build-guile.sh: Add ARM backend.
* lib/arm-mes/arm.M1: New file.
* module/mescc/armv4/as.scm: New file.
* module/mescc/armv4/info.scm: New file.
* module/mescc/mescc.scm: Use it.
* module/mescc/M1.scm (info->M1): Support ARM symbolic instructions,
including little endian instructions.  Align functions.
2020-06-10 13:11:07 +02:00
Jan Nieuwenhuizen 80419817e6
ARM: Mes C Library: Support gcc-sans-libc.
* lib/linux/arm-mes-gcc/crt1.c: New file.
* lib/linux/arm-mes-gcc/mini.c: New file.
* lib/arm-mes-gcc/setjmp.c: New file.

Co-Authored-By: Danny Milosavljevic <dannym@scratchpost.org>
2020-06-04 21:59:30 +02:00
Danny Milosavljevic b0347bf53d
ntoab: Make sure not to get stuck on base 1.
* lib/mes/ntoab.c (ntoab): Make sure not to get stuck on base 1.
2020-06-03 20:56:51 +02:00
Danny Milosavljevic 1f47a76e7a
mescc: Mes C Library: Add crt1, mini.
* lib/linux/arm-mes-mescc/crt1.c: New file.
* lib/linux/arm-mes-mescc/mini.c: New file.
2020-06-03 20:46:41 +02:00
Danny Milosavljevic 85e690ea64
ARM: Mes C Library: Add comment.
* lib/linux/time.c: Add comment.
2020-06-03 11:24:03 +02:00
Jan Nieuwenhuizen be1ff7e625
ARM: Mes C Library: Add compile stub for time.
* lib/linux/time.c (time)[SYS_gettimeofday]: Implement using gettimeofday.
(time)[!SYS_time && !SYS_gettimeofday]: Compile stub.
2020-06-03 10:41:37 +02:00
Danny Milosavljevic a944400112
waitpid: Support ARM.
* lib/linux/waitpid.c (waitpid): Support ARM.
2020-06-03 00:55:07 +02:00
Danny Milosavljevic 65013db594
Add ARM linker support files.
* lib/linux/arm-mes/elf32-0exit-42.hex2,
lib/linux/arm-mes/elf32-0header.hex2,
lib/linux/arm-mes/elf32-0hello-mes.hex2,
lib/linux/arm-mes/elf32-body-exit-42.hex2,
lib/linux/arm-mes/elf32-body-hello-mes.hex2,
lib/linux/arm-mes/elf32-footer-single-main.hex2,
lib/linux/arm-mes/elf32-header.hex2: New files.
2020-06-02 20:27:52 +02:00
Danny Milosavljevic 4775de0021
Raise SIGABRT on abort().
* lib/stdlib/abort.c (abort): Raise SIGABRT.
2020-06-02 15:05:12 +02:00
Danny Milosavljevic 55d38162be
Introduce libmescc.a; Put division by integer in there; split syscalls' errno off.
* build-aux/configure-lib.sh (libmescc_SOURCES): Add lib/mes/div.c,
lib/linux/*/syscall-internal.c.
* build-aux/build-lib.sh: Add libmescc.a.
* build-aux/build-mes.sh: On gcc, add "-lmescc".
* build-aux/test-c.sh: Add "-lmescc".
* build-aux/check.sh.in: Add mescc to LIBS.
* module/mescc/mescc.scm (mescc:link): Add "mescc".
* module/mescc.scm (mescc:main): Update documentation of "-nodefaultlibs"
and "-nostdlib".
* lib/mes/div.c (ldiv): Rename to...
(__mesabi_ldiv): ...this.  Avoid assert.
(__mesabi_div0): Avoid assert.
(__aeabi_idivmod): New procedure.
(__aeabi_idiv): New procedure.
(__aeabi_uidivmod): New procedure.
(__aeabi_uidiv): New procedure.
* lib/linux/x86-mes-gcc/syscall.c (__sys_call, __sys_call1, __sys_call2,
__sys_call3, __sys_call4): Move to...
* lib/linux/x86-mes-gcc/syscall-internal.c: ...here.
(__raise): New procedure.
* lib/linux/x86-mes-mescc/syscall.c (__sys_call, __sys_call1, __sys_call2,
__sys_call3, __sys_call4): Move to...
* lib/linux/x86-mes-mescc/syscall-internal.c: ...here.
(__raise): New procedure.
* lib/linux/arm-mes-gcc/syscall.c: New file.
* lib/linux/arm-mes-gcc/syscall-internal.c: New file.
* lib/linux/arm-mes-mescc/syscall.c: New file.
* lib/linux/arm-mes-mescc/syscall-internal.c: New file.
* lib/gnu/syscall.c (__syscall, __syscall2, __syscall_get, __syscall_put):
Move to...
* lib/gnu/syscall-internal.c: ...here.
2020-06-02 15:04:13 +02:00
Danny Milosavljevic fbc249832c
Prepare tests for ARMv4.
* lib/tests/io/90-stat.c,
lib/tests/scaffold/76-pointer-arithmetic.c,
lib/tests/scaffold/7k-for-each-elem.c,
lib/tests/scaffold/85-sizeof.c: Prepare tests for ARMv4.
2020-06-02 14:30:02 +02:00
Jan Nieuwenhuizen d8fca8321e
mescc: Mes C Library: Fix execlp, execvp for file names with slash.
Reported by mid-kid.

* lib/posix/execlp.c (execlp): Do not use search_path when file name
contains a slash (WAS: when file name starts with slash).
* lib/posix/execvp.c (execvp): Likewise.
2020-01-20 22:47:52 +01:00
Jan Nieuwenhuizen 3abd3e0bcc
mescc: Mes C Library: lseek: Be careful clearing read buffer.
* lib/linux/lseek.c (_lseek): New function.
* lib/linux/lseek.c (lseek): Use it to check if we should reset read
buffer.
* lib/mes/__buffered_read.c (__read_buffer_max): New variable.
(__buffered_read_init): Add environment override: MES_READ_BUFFER.
(__buffered_read): Use it.
2020-01-20 22:47:52 +01:00
Jan Nieuwenhuizen ec9aecea07
freebsd: Initial x86 scaffold.
* lib/freebsd/x86-mes-gcc/crt1.c: New file.
* lib/freebsd/x86-mes-gcc/exit-42.S: New file.
* lib/freebsd/x86-mes-gcc/hello-mes.S: New file.
* lib/freebsd/x86-mes-gcc/mini.c: New file.
* lib/freebsd/x86-mes-mescc/crt1.c: New file.
* lib/freebsd/x86-mes-mescc/mini.c: New file.
* lib/freebsd/x86-mes/elf32-0exit-42.hex2: New file.
* lib/freebsd/x86-mes/elf32-0header.hex2: New file.
* lib/freebsd/x86-mes/elf32-0hello-mes.hex2: New file.
* lib/freebsd/x86-mes/elf32-body-exit-42.hex2: New file.
* lib/freebsd/x86-mes/elf32-body-hello-mes.hex2: New file.
* lib/freebsd/x86-mes/elf32-footer-single-main.hex2: New file.
* lib/freebsd/x86-mes/elf32-header.hex2: New file.
2019-12-17 21:08:18 +01:00
Jan Nieuwenhuizen 34106fc420
build: Prepare for kernel variants.
* configure: Fix detection of Arch, FreeBSD.
* lib/linux/x86-mes-gcc/exit-42.S: Move from ...
* lib/x86-mes-gcc/exit-42.S: ... here.
* lib/linux/x86-mes-gcc/hello-mes.S: Move from ...
* lib/x86-mes-gcc/hello-mes.S: ... here.
* lib/linux/x86-mes-mescc/exit-42.S: Move from ...
* lib/x86-mes-mescc/exit-42.S: ... here.
* lib/linux/x86-mes-mescc/hello-mes.S: Move from ...
* lib/x86-mes-mescc/hello-mes.S: ... here.
* lib/linux/x86-mes/elf32-0exit-42.hex2: Move from ...
* lib/x86-mes/elf32-0exit-42.hex2: ... here.
* lib/linux/x86-mes/elf32-0header.hex2: Move from ...
* lib/x86-mes/elf32-0header.hex2: ... here.
* lib/linux/x86-mes/elf32-0hello-mes.hex2: Move from ...
* lib/x86-mes/elf32-0hello-mes.hex2: ... here.
* lib/linux/x86-mes/elf32-body-exit-42.hex2: Move from ...
* lib/x86-mes/elf32-body-exit-42.hex2: ... here.
* lib/linux/x86-mes/elf32-body-hello-mes.hex2: Move from ...
* lib/x86-mes/elf32-body-hello-mes.hex2: ... here.
* lib/linux/x86-mes/elf32-footer-single-main.hex2: Move from ...
* lib/x86-mes/elf32-footer-single-main.hex2: ... here.
* lib/linux/x86-mes/elf32-header.hex2: Move from ...
* lib/x86-mes/elf32-header.hex2: ... here.
* lib/linux/x86_64-mes-gcc/exit-42.S: Move from ...
* lib/x86_64-mes-gcc/exit-42.S: ... here.
* lib/linux/x86_64-mes-gcc/hello-mes.S: Move from ...
* lib/x86_64-mes-gcc/hello-mes.S: ... here.
* lib/linux/x86_64-mes-mescc/exit-42.S: Move from ...
* lib/x86_64-mes-mescc/exit-42.S: ... here.
* lib/linux/x86_64-mes-mescc/hello-mes.S: Move from ...
* lib/x86_64-mes-mescc/hello-mes.S: ... here.
* lib/linux/x86_64-mes/elf64-0exit-42.hex2: Move from ...
* lib/x86_64-mes/elf64-0exit-42.hex2: ... here.
* lib/linux/x86_64-mes/elf64-0header.hex2: Move from ...
* lib/x86_64-mes/elf64-0header.hex2: ... here.
* lib/linux/x86_64-mes/elf64-0hello-mes.hex2: Move from ...
* lib/x86_64-mes/elf64-0hello-mes.hex2: ... here.
* lib/linux/x86_64-mes/elf64-body-exit-42.hex2: Move from ...
* lib/x86_64-mes/elf64-body-exit-42.hex2: ... here.
* lib/linux/x86_64-mes/elf64-body-hello-mes.hex2: Move from ...
* lib/x86_64-mes/elf64-body-hello-mes.hex2: ... here.
* lib/linux/x86_64-mes/elf64-footer-single-main.hex2: Move from ...
* lib/x86_64-mes/elf64-footer-single-main.hex2: ... here.
* lib/linux/x86_64-mes/elf64-header.hex2: Move from ...
* lib/x86_64-mes/elf64-header.hex2: ... here.
* module/mescc.scm (parse-opts): Support --kernel.
* module/mescc/mescc.scm (kernel-find): New function.
* module/mescc/mescc.scm (hex2->elf): Use it to find kernel-specific ELF
snippets.
* build-aux/install.sh.in: Install it.
2019-12-17 21:07:35 +01:00
Jan Nieuwenhuizen c673c9d303
mescc: Mes C Library: Add ioctl3 stub. 2019-12-13 21:52:31 +01:00
Jan Nieuwenhuizen f5bf3f4cf6
mescc: Mes C Library: Fix access stub.
* lib/stub/access.c (access): Use _open3 to give more meaningful
behaviour.  Fixes hanging of mes.
2019-12-13 21:52:31 +01:00
Jan Nieuwenhuizen 7c6da0c213
hurd: Fixes for upgrade to debian-hurd-20190220.img.
* include/mach/mach-init.h (__mach_host_self, __mach_task_self):
Remove macro magic.
(mach_host_self, mach_task_self): Remove macro magic; declare as function.
* lib/mach/mach-init.c (mach_host_self, mach_task_self): New function.
(mach_init): Use them.
* lib/gnu/hurd-start.c (_hurd_start): Use mach_task_self ().
* lib/gnu/_exit.c (_exit): Likewise.
2019-12-13 21:52:31 +01:00
Jan Nieuwenhuizen 9b0009a888
hurd: Add malloc.
* include/gnu/syscall.h (__vm_allocate): New value.
(__vm_allocate): Declare.
* lib/gnu/malloc.c: New file.
* lib/stdlib/malloc.c[__GNU__]: Disable.  See FIXME.
* lib/gnu/vm-allocate.c: New file.
* build-aux/configure-lib.sh (libc_SOURCES): Add it.
2019-12-13 21:52:31 +01:00
Jan Nieuwenhuizen 89945751d9
hurd: Add open.
* include/fcntl.h (O_RDONLY, O_WRONLY, O_RDWR, O_CREAT, O_APPEND,
O_TRUNC)[__GNU__]: Specialize for GNU.
* lib/gnu/dir-lookup.c: New file.
* lib/stdio/fopen.c (fopen): Use O_RDONLY.
* lib/tests/posix/50-open-read.c (main): Likewise.
* lib/tests/stdio/90-fseek.c (main): Likewise.
* include/gnu/syscall.h (SYS__dir_lookup): New value.
* lib/gnu/_open3.c: New file.
* build-aux/configure-lib.sh (libc_SOURCES): Build them.
2019-12-13 21:52:30 +01:00
Jan Nieuwenhuizen 67d82a6de5
hurd: Add argv and environ.
* include/gnu/hurd.h (struct hurd_startup_data): Add argp, envp.
* lib/gnu/hurd-start.c (__argv, __env): Define them.
* lib/gnu/exec-startup-get-data.c (mach_startup_info2hurd_startup_data):
Set them.
* lib/gnu/x86-mes-gcc/crt1.c (_start): Use them.
* build-aux/configure-lib.sh (libc_mini_SOURCES): Add argz-extract.c.
* include/argz.h: Build fix.
* lib/string/argz-count.c: Likewise.
* lib/string/argz-extract.c: Likewise.
2019-12-13 21:52:30 +01:00
Jan Nieuwenhuizen 72c76d6b3a
hurd: Add stubs for missing libc+tcc functions.
* lib/stub/close.c: New file.
* lib/stub/rmdir.c: New file.
* lib/stub/stat.c: New file.
* build-aux/configure-lib.sh (libc_tcc_SOURCES)[gnu]: Add them.
2019-12-13 21:52:30 +01:00
Jan Nieuwenhuizen 49ff9a7edd
hurd: Add stubs for missing libc functions.
* lib/stub/_getcwd.c: New file.
* lib/stub/_getcwd.c: New file.
* lib/stub/_open3.c: New file.
* lib/stub/access.c: New file.
* lib/stub/brk.c: New file.
* lib/stub/chmod.c: New file.
* lib/stub/clock_gettime.c: New file.
* lib/stub/dup.c: New file.
* lib/stub/dup2.c: New file.
* lib/stub/execve.c: New file.
* lib/stub/fork.c: New file.
* lib/stub/gettimeofday.c: New file.
* lib/stub/ioctl.c: New file.
* lib/stub/time.c: New file.
* lib/stub/unlink.c: New file.
* lib/stub/waitpid.c: New file.
* build-aux/configure-lib.sh (libc_SOURCES)[gnu]: Add them.
2019-12-13 21:52:30 +01:00
Jan Nieuwenhuizen 9b9d37ee95
hurd: Add stubs for missing libmes functions.
* lib/stub/lseek.c: New file.
* build-aux/configure-lib.sh (libmes_SOURCES)[gnu]: Add it.
2019-12-13 21:52:30 +01:00
Jan Nieuwenhuizen 6d3b9b687d
hurd: Add _read.
* include/gnu/hurd.h (fd_read): Declare.
* include/gnu/syscall.h (SYS__io_read): New value.
* lib/gnu/_read.c: New file.
* lib/gnu/fd-read.c: New file.
* lib/gnu/io-read.c: New file.
* build-aux/configure-lib.sh (libc_SOURCES): Add _read sources.
2019-12-13 21:52:30 +01:00
Jan Nieuwenhuizen db4a202c6b
hurd: Add _write.
* include/gnu/syscall.h (SYS__io_write): Add enum field.
(_hurd_dtable, _hurd_dtable_size): Declare variable.
(fd_get, fd_write, __io_write, __syscall_put): Declare.
* lib/gnu/hurd-start.c (_hurd_dtable, _hurd_dtable_size): Define
variable.
* lib/gnu/_write.c: New file.
* lib/gnu/fd-get.c (fd_get): New file.
* lib/gnu/fd-write.c (fd_write): New file.
* lib/gnu/io-write.c: New file.
* lib/gnu/syscall.c (__syscall_put): New function.
* build-aux/cofnigure-lib.sh (libc_mini_SOURCES): Add write sources.
* lib/tests/mes/30-oputs.c (main): Update.
* lib/tests/mes/30-oputs.stdout: New file.
* lib/tests/mes/30-eputs.c: New test.
* lib/tests/mes/30-eputs.stderr: New file.
* build-aux/check-mescc.sh (TESTS): Add it.
2019-12-13 21:52:30 +01:00
Jan Nieuwenhuizen 784838e368
hurd: Initial support.
This adds minimal Hurd support by implementing the _exit function.

* AUTHORS: Update.
* .gitignore: Ignore a.out, core, .config.
* include/sys/wait.h (W_EXITCODE): New define.
* lib/gnu/x86-mes-gcc/crt1.c: New file.
* lib/gnu/x86-mes-gcc/mini.c: New file.
* lib/gnu/hurd-start.c: New file.
* lib/gnu/_exit.c: New file.
* include/gnu/syscall.h: New file.
* include/gnu/hurd.h: New file.
* lib/gnu/_exit.c: New file.
* lib/gnu/exec-startup-get-data.c: New file.
* lib/gnu/hurd-start.c: New file.
* lib/gnu/proc-mark-exit.c: New file.
* lib/gnu/syscall.c: New file.
* lib/gnu/task-get-special-port.c: New file.
* lib/gnu/task-terminate.c: New file.
* lib/gnu/vm-statistics.c: New file.
* build-aux/configure-lib.sh (libc_mini_SOURCES): Add Hurd sources.
* build-aux/build.sh.in (CPPFLAGS): Add lib to includes, to find linux
crt1.c.
* build-aux/test-c.sh: Always use at least -l c+mini for GNU.
* lib/tests/scaffold/30-exit-42.exit: New file.
* lib/tests/scaffold/30-exit-42.c: New test.
* build-aux/check-mescc.sh (TESTS): Add it.
* lib/tests/scaffold/30-exit-0.c (main): Move from 00-exit-0.c; Rewrite,
use _exit.
* include/gnu/hurd-types.h: Import from GNU C Library.
* include/mach/mach-init.h: Likewise.
* lib/mach/mach-init.c: Likewise.
* lib/mach/mach_host_self.S: Likewise.
* lib/mach/mach_msg_trap.S: Likewise.
* lib/mach/mach_reply_port.S: Likewise.
* lib/mach/mach_task_self.S: Likewise.
* lib/mach/mach_thread_self.S: Likewise.
* lib/mach/msg.c: Likewise.
2019-12-13 21:52:29 +01:00
Jan Nieuwenhuizen 093a8b0903
bootstrap: Build files only once.
* build-aux/bootstrap.sh.in: Build files only once.
2019-12-07 23:29:34 +01:00
Jan Nieuwenhuizen b4b20d6ac4
build: Add mescc scaffold for regular build.
* lib/x86-mes-mescc/exit-42.S: New file.
* lib/x86-mes-mescc/hello-mes.S: New file.
* lib/x86_64-mes-mescc/exit-42.S: New file.
* lib/x86_64-mes-mescc/hello-mes.S: New file.
2019-12-06 19:53:50 +01:00
Jan Nieuwenhuizen 3de6450117
test: 90-abtod: Remove printf dependency. Fixes gcc.
* lib/tests/mes/90-abtod.stdout: Remove.
* lib/tests/mes/90-abtod.c (main): Remove printf.
2019-12-02 10:00:03 +01:00
Jan Nieuwenhuizen 35c97baaef
test: 90-readdir: Remove qsort dependency. Fixes tmpfs failures.
* lib/tests/dirent/90-readdir.c (check_seen): New function.
(main): Use it instead of qsort.
(qsort_strcmp): Remove.
2019-12-01 23:58:48 +01:00
Jan Nieuwenhuizen 2673d28e50
mescc: Mes C Library: Support gcc-4.6.4: Fix ctime stub.
* lib/stub/ctime.c (ctime): Fix stub to avoid segfault upon use.
2019-11-23 21:35:05 +01:00
Jan Nieuwenhuizen 5480c133ae
mescc: Mes C Library: Fix isatty for x86_64.
* lib/linux/ioctl.c (ioctl3): New function.
* include/sys/ioctl.h: Declare it.
* lib/posix/isatty.c (__tcgetattr): Use it.
2019-11-23 21:29:36 +01:00
Jan Nieuwenhuizen 0e55071bc7
mescc: Mes C Library: Support gcc-4.6.4: vfprintf, vsnprintf: pad with space.
* lib/stdio/vfprintf.c (vfprintf): pad with space.
* lib/stdio/vsnprintf.c (vsnprintf): pad with space.
2019-09-20 14:44:31 +02:00
Jan Nieuwenhuizen 98b9ac8e98
mescc: Mes C Library: Support gcc-4.6.4: Add math stubs.
* lib/math/ceil.c: New file.
* lib/math/floor.c: New file.
* lib/stub/atan2.c: New file.
* lib/stub/cos.c: New file.
* lib/stub/exp.c: New file.
* lib/stub/log.c: New file.
* lib/stub/modf.c: New file.
* lib/stub/pow.c: New file.
* lib/stub/sin.c: New file.
* lib/stub/sqrt.c: New file.
* lib/libc+gnu.c: Include them.
* include/math.h (atan2, ceil, cos, exp, fabs, floor, log, modf, pow,
sin, sqrt): Declare.
* lib/math/fabs.c: Update.
* lib/stub/ldexp.c: Update.
2019-09-13 15:11:38 +02:00
Jan Nieuwenhuizen 6bb225b403
mescc: Mes C Library: Support gcc-4.6.4: Add fscanf, vfscanf.
* lib/stdio/vfscanf.c: New file.
* lib/stdio/fscanf.c: New file.
* build-aux/configure-lib.sh (libc_gnu_SOURCES): Add them.
* include/stdio.h (fscanf): Declare.
* include/stdarg.h (vfscanf): Declare.
* lib/stub/fscanf.c: Remove.
2019-09-06 19:04:50 +02:00
Danny Milosavljevic 73715dab4a
Add missing #include.
* lib/stdlib/mbstowcs.c: Add missing #include.
2019-08-27 01:46:57 +02:00
Danny Milosavljevic 01ae1994ed
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-08-27 00:43:37 +02:00
Danny Milosavljevic abc0809bfa
Add missing #include.
* lib/tests/mes/90-abtod.c (main): Add missing #include.
2019-08-27 04:32:02 +02:00
Danny Milosavljevic 4c77c2c9ca
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-08-27 04:04:56 +02:00
Jan Nieuwenhuizen 58fb0cf764
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-08-24 19:05:58 +02:00