Commit graph

1498 commits

Author SHA1 Message Date
Jan Nieuwenhuizen a8a32a5280
tests: Expect srfi-13 failure, MesCC more resembles Gcc.
* tests/srfi-13.test (report): Expect INT-MIN failure for x86.
2018-10-07 14:14:50 +02:00
Jan Nieuwenhuizen 183514d103
core: reader: Support 64 bit.
* src/reader.c (reader_read_identifier_or_number): Support 64 bit.
(reader_read_binary): Likewise.
(reader_read_octal): Likewise.
(reader_read_hex): Likewise.
2018-10-07 00:58:31 +02:00
Jan Nieuwenhuizen 8f33bb5c4f
mescc: Mes C Library: Fix execve on x86_64.
* include/linux/x86_64/syscall.h (SYS_execve): Typo.  Fixes execve on
x86_64.
2018-10-06 22:38:28 +02:00
Jan Nieuwenhuizen a238986e43
build: Support make seed for x86_64.
* build-aux/GNUmakefile.in (seed): Support make seed for x86_64.
* build-aux/build-mes.sh[SEED]: Also build src/mes.S.
* build-aux/build-x86_64-mes.sh[SEED]: Also build src/mes.x86_64-mes.S.
2018-10-06 22:26:07 +02:00
Jan Nieuwenhuizen b31d431b5d
mes: Support fold-right 3.
* mes/module/srfi/srfi-1.mes (fold-right): Support fold-right 3.
* tests/srfi-1.test ("fold-right-3"): Test it.
2018-10-06 21:05:43 +02:00
Jan Nieuwenhuizen 6ab9a206bb
mescc: Nyacc comment escapes.
* module/mescc/compile.scm (ast->comment): Nyacc comment escapes.
2018-10-06 20:32:49 +02:00
Jan Nieuwenhuizen dc4b7f3a37
mescc: Fix clobbering of struct by value assign.
* module/mescc/x86_64/as.scm (long-r0->r1-mem): New instruction.
* module/mescc/i386/as.scm: Likewise.
* lib/x86_64-mes/x86_64.M1: Support it.
* module/mescc/compile.scm (r0->r1-mem*n-): Fix clobbering.
2018-10-06 20:23:43 +02:00
Jan Nieuwenhuizen 1f359b07a8
core: Add vector test.
* scaffold/boot/11-vector.scm: New test.
* build-aux/check-boot.sh: Run it.
2018-10-06 07:13:04 +02:00
Jan Nieuwenhuizen eedf2d2381
mescc: Fix obnoxious assignment ERROR message.
* module/mescc/compile.scm (expression->register): Fix assignment
ERROR message.
2018-10-06 19:22:16 +02:00
Jan Nieuwenhuizen f7e208dd7b
core: Avoid 64bit zero divide.
* src/math.c (divide): Avoid (64bit) 0 divide.
(modulo): Likewise.
2018-10-07 00:25:33 +02:00
Jan Nieuwenhuizen 3dd4da895f
mescc: Support negative divide.
* module/mescc/i386/as.scm (i386:r0/r1, i386:r0%r1): Support
negative divide.
* module/mescc/x86_64/as.scm (x86_64:r0/r1, x86_64:r0%r1): Likewise.
* lib/x86-mes/x86.M1: Likewise.
* lib/x86_64-mes/x86_64.M1: Likewise.
* scaffold/tests/a0-math-divide-signed-negative.c: Test it.
* build-aux/check-mescc.sh (tests): Run it.
2018-10-06 17:28:08 +02:00
Jan Nieuwenhuizen d862f1eceb
mescc: Support --align, off by default.
* scripts/mescc.in (parse-opts): Add --align.
* module/mescc/mescc.scm (mescc:compile): Support --align, off by
default.
* module/mescc/M1.scm (infos->M1): Add #:align parameter.
(M1:merge-infos): Likewise.  Keep types.
(info->M1): Likewise.  Make alignment switchable.
* module/mescc/compile.scm (r->ident):  Do not clobber.
(ident-add): Likewise.
(clean-info): Keep types.
* module/mescc/i386/as.scm (i386:r->byte-label): New instruction.
* lib/x86-mes/x86.M1: Add instructions.
* lib/x86_64-mes/x86_64.M1: Add instructions.
* module/mescc/x86_64/as.scm (x86_64:r->byte-label,
x86_64:r->word-label, x86_64:r->long-label): New instruction.
2018-10-06 15:56:14 +02:00
Jan Nieuwenhuizen 3584f45056
Revert "mescc: Make globals at least reg-size."
This reverts commit 30544316c35ed4a2472f2029beb27e007d913792.
2018-10-06 15:57:52 +02:00
Jan Nieuwenhuizen b456a32cf0
mescc: Make globals at least reg-size.
* module/mescc/compile.scm (global->info): Make globals at least reg-size.
2018-10-06 15:36:32 +02:00
Jan Nieuwenhuizen 51085ba25c
mescc: Support 64-bit immediates.
* module/mescc/M1.scm (hex2:address8, hex2:immediate8): New function.
(info->M1): Support 64-bit.
* module/mescc/compile.scm (convert-r0): FIXME!
* module/mescc/x86_64/as.scm (x86_64:value->r, x86_64:r->local,
x86_64:label->arg, x86_64:label->r, x86_64:r+value,
x86_64:r-cmp-value, x86_64:r-long-mem-add, x86_64:r-and): Support
64-bit immediates.
* lib/x86_64-mes/x86_64.M1: Likewise.
* scaffold/tests/17-compare-unsigned-char-le.c: Test it.
* scaffold/tests/17-compare-unsigned-short-le.c: Test it.
* build-aux/check-mescc.sh (tests): Run them.
2018-10-06 14:51:57 +02:00
Jan Nieuwenhuizen d0a1cc5096
core: Use proper name for %compiler.
* src/mes.c (mes_symbols, bload_env): : Use proper name for %compiler.
2018-10-06 08:43:26 +02:00
Jan Nieuwenhuizen e4e41a30b4
core: Resurrect MES_MINI for non-POSIX.
src/mes.c[MES_MINI,!POSIX]: Resurrect.
2018-10-06 07:25:39 +02:00
Jan Nieuwenhuizen 186d059c38
mescc: Mes C Library: Add ultoa.
* lib/mes/ultoa.c: New file.
* lib/libmes.c: Include it.
* include/libmes.h: Declare ultoa.
2018-10-06 12:02:16 +02:00
Jan Nieuwenhuizen 41f50664c1
mescc: Mes C Library: Add ltoa.
* lib/mes/ltoa.c: New file.
* lib/libmes.c: Include it.
* include/libmes.h: Declare ltoa.
2018-10-06 11:59:20 +02:00
Jan Nieuwenhuizen be4f23fae6
mescc: Fix truncation of short.
* module/mescc/compile.scm (convert-r0): Typo.  Fixes truncation of
short.  Thanks, pdewacht!
* scaffold/tests/a0-call-trunc-char.c: New file.
* scaffold/tests/a0-call-trunc-short.c: New file.
* build-aux/check-mescc.sh: Add them.
2018-10-06 11:57:04 +02:00
Jan Nieuwenhuizen 6078fa5083
build: Split-off x86_mes-gcc build.
* build-aux/build-cc64.sh: New file.
* build-aux/build.sh.in[CC64]: Invoke it.
* build-aux/build-cc.sh: Remove x86_64-mes-gcc build.
* build-aux/GNUmakefile.in (x86_64-mes-gcc): New target.
* build-aux/build-x86_64-mes.sh: Build all scafffold files.
2018-10-06 07:08:20 +02:00
Jan Nieuwenhuizen fed5929f80
build: Oops, use MES_LIBS.
* build-aux/build-x86_64-mes.sh: Use MES_LIBS instead of the unused
MES64_LIBS.  Fixes build.  Thanks, pdewacht!
2018-10-05 22:12:48 +02:00
Jan Nieuwenhuizen f1d93da665
build: remove bashism.
* build-aux/trace.sh (trace): Remove bashism.  Thanks pdewacht!
2018-10-05 21:24:14 +02:00
Jan Nieuwenhuizen 133013a3d2
core: Support x86_64.
* src/lib.c: Support x86_64.
* src/math.c: Likewise.
* src/mes.c: Likewise.
* src/reader.c: Likewise.
* src/vector.c Likewise.
2018-10-04 21:43:45 +02:00
Jan Nieuwenhuizen a2502ac96c
build: Oops, set VERSION.
* build-aux/install.sh.in (VERSION): New substituted variable.
2018-10-04 23:10:56 +02:00
Jan Nieuwenhuizen 5484e0ffdf
build: Resurrect make seed.
* build-aux/GNUmakefile.in (seed): Resurrect.
* build-aux/build-x86_64-mes.sh: Build from seed.
2018-09-30 12:15:11 +02:00
Jan Nieuwenhuizen 7a8a2fc517
mescc: x86_64 support: Refactor to abstracted assembly, add x86_64.
* module/mescc/as.scm: Support abstracted assembly.
* module/mescc/i386/as.scm: Rewrite.
* module/mescc/x86_64/as.scm: Implement.
* module/mescc/compile.scm: Refactor to abstracted assembly.
* module/mescc/M1.scm: Update for partial 64 bit support.
* module/mescc/bytevectors.scm (bytevector-u64-native-set!): New
procedure.
* module/mescc/i386/info.scm (i386:type-alist): Use 4 byte type length
also for faking double, long long, long double.
* module/mescc/info.scm:modified:
* module/mescc/x86_64/info.scm (x86_64:registers): New variable.
* lib/x86-mes/x86.M1: Update for new register scheme.
* lib/x86_64-mes/x86_64.M1: Implement.
* lib/x86-mes/setjmp.c: Implement.
* lib/x86_64-mes-gcc/setjmp.c: Implement.
* build-aux/build-cc.sh: Update for x86_64.
* build-aux/build-cc32.sh: Likewise.
* build-aux/build-mes.sh: Likewise.
* build-aux/build-x86_64-mes.sh: Likewise.
* build-aux/check-mescc.sh: Likewise.
* build-aux/test64.sh: Likewise.
* include/libmes.h: Likewise.
* include/setjmp.h: Likewise.
* include/signal.h: Likewise.
* include/stdarg.h: Likewise.
* include/sys/stat.h: Likewise.
* include/sys/types.h: Likewise.
* include/sys/wait.h: Likewise.
* include/unistd.h: Likewise.
* lib/libc+gnu.c: Likewise.
* lib/libc+tcc.c: Likewise.
* lib/linux/gnu.c: Likewise.
* lib/linux/libc-mini.c: Likewise.
* lib/linux/libc.c: Likewise.
* lib/linux/tcc.c: Likewise.
* lib/linux/x86_64-mes-gcc/mes.c: Likewise.
* lib/linux/x86_64-mes/crt1.c: Likewise.
* lib/mes/abtol.c: Likewise.
* lib/posix/mktemp.c: Likewise.
* lib/posix/wait.c: Likewise.
* lib/stdio/fopen.c: Likewise.
* lib/stdio/fputc.c: Likewise.
* lib/stdio/fseek.c: Likewise.
* lib/stdio/printf.c: Likewise.
* lib/stdio/sprintf.c: Likewise.
* lib/stdio/vfprintf.c: Likewise.
* lib/stdio/vsprintf.c: Likewise.
* lib/stdio/vsscanf.c: Likewise.
* lib/stdlib/qsort.c: Likewise.
* lib/x86-mes-gcc/setjmp.c: Likewise.
* scaffold/tests/11-if-1.c: Likewise.
* scaffold/tests/15-if-!f.c: Likewise.
* scaffold/tests/16-if-t.c: Likewise.
* scaffold/tests/21-char[].c: Likewise.
* scaffold/tests/23-pointer.c: Likewise.
* scaffold/tests/32-compare.c: Likewise.
* scaffold/tests/33-and-or.c: Likewise.
* scaffold/tests/34-pre-post.c: Likewise.
* scaffold/tests/35-compare-char.c: Likewise.
* scaffold/tests/36-compare-arithmetic.c: Likewise.
* scaffold/tests/37-compare-assign.c: Likewise.
* scaffold/tests/38-compare-call.c: Likewise.
* scaffold/tests/40-if-else.c: Likewise.
* scaffold/tests/41-?.c: Likewise.
* scaffold/tests/42-goto-label.c: Likewise.
* scaffold/tests/43-for-do-while.c: Likewise.
* scaffold/tests/44-switch.c: Likewise.
* scaffold/tests/45-void-call.c: Likewise.
* scaffold/tests/46-function-static.c: Likewise.
* scaffold/tests/51-strcmp.c: Likewise.
* scaffold/tests/51-strncmp.c: Likewise.
* scaffold/tests/53-strcpy.c: Likewise.
* scaffold/tests/54-argv.c: Likewise.
* scaffold/tests/60-math.c: Likewise.
* scaffold/tests/61-array.c: Likewise.
* scaffold/tests/63-struct-cell.c: Likewise.
* scaffold/tests/64-make-cell.c: Likewise.
* scaffold/tests/65-read.c: Likewise.
* scaffold/tests/70-printf.c: Likewise.
* scaffold/tests/71-struct-array.c: Likewise.
* scaffold/tests/72-typedef-struct-def.c: Likewise.
* scaffold/tests/74-multi-line-string.c: Likewise.
* scaffold/tests/76-pointer-arithmetic.c: Likewise.
* scaffold/tests/79-int-array.c: Likewise.
* scaffold/tests/7a-struct-char-array.c: Likewise.
* scaffold/tests/7b-struct-int-array.c: Likewise.
* scaffold/tests/7i-struct-struct.c: Likewise.
* scaffold/tests/7k-for-each-elem.c: Likewise.
* scaffold/tests/7l-struct-any-size-array.c: Likewise.
* scaffold/tests/7o-struct-pre-post.c: Likewise.
* scaffold/tests/7q-bit-field.c: Likewise.
* scaffold/tests/7s-struct-short.c: Likewise.
* scaffold/tests/80-setjmp.c: Likewise.
* scaffold/tests/81-qsort.c: Likewise.
* scaffold/tests/85-sizeof.c: Likewise.
* scaffold/tests/87-sscanf.c: Likewise.
* scaffold/tests/90-strpbrk.c: Likewise.
* scaffold/tests/91-fseek.c: Likewise.
* scaffold/tests/95-signal.c: Likewise.
* scaffold/tests/97-fopen.c: Likewise.
* scaffold/tests/99-readdir.c: Likewise.
* scaffold/tests/t.c: Likewise.
* lib/linux/x86_64-mes/mes.c: New file.
* lib/linux/x86_64-mes/mini.c: New file.
* lib/x86_64-mes/setjmp.c: New file.
* scaffold/tests/06-!call-1.c: New file.
* scaffold/tests/06-call-2.c: New file.
* scaffold/tests/06-call-variable.c: New file.
* scaffold/tests/08-assign-global.c: New file.
* scaffold/tests/08-assign-negative.c: New file.
* scaffold/tests/17-compare-and-or.c: New file.
* scaffold/tests/17-compare-and.c: New file.
* scaffold/tests/17-compare-ge.c: New file.
* scaffold/tests/17-compare-gt.c: New file.
* scaffold/tests/17-compare-le.c: New file.
* scaffold/tests/17-compare-lt.c: New file.
* scaffold/tests/17-compare-or.c: New file.
* scaffold/tests/17-compare-unsigned-ge.c: New file.
* scaffold/tests/17-compare-unsigned-gt.c: New file.
* scaffold/tests/17-compare-unsigned-le.c: New file.
* scaffold/tests/17-compare-unsigned-lt.c: New file.
* scaffold/tests/21-char[]-simple.c: New file.
* scaffold/tests/23-global-pointer-init-null.c: New file.
* scaffold/tests/23-global-pointer-init.c: New file.
* scaffold/tests/23-global-pointer-pointer-ref.c: New file.
* scaffold/tests/23-global-pointer-ref.c: New file.
* scaffold/tests/23-pointer-sub.c: New file.
* scaffold/tests/31-oputs.c: New file.
* scaffold/tests/32-call-wrap.c: New file.
* scaffold/tests/38-compare-call-2.c: New file.
* scaffold/tests/38-compare-call-3.c: New file.
* scaffold/tests/51-pointer-sub.c: New file.
* scaffold/tests/54-argc.c: New file.
* scaffold/tests/63-struct-array-assign.c: New file.
* scaffold/tests/63-struct-array-compare.c: New file.
* scaffold/tests/63-struct-array.c: New file.
* scaffold/tests/63-struct-assign.c: New file.
* scaffold/tests/63-struct-function.c: New file.
* scaffold/tests/63-struct-local.c: New file.
* scaffold/tests/63-struct-pointer.c: New file.
* scaffold/tests/63-struct.c: New file.
* scaffold/tests/70-printf-hello.c: New file.
* scaffold/tests/70-printf-simple.c: New file.
* scaffold/tests/70-stdarg.c: New file.
* scaffold/tests/70-strchr.c: New file.
* scaffold/tests/73-union-hello.c: New file.
* scaffold/tests/76-pointer-arithmetic-pp.c: New file.
* scaffold/tests/79-int-array-simple.c: New file.
* scaffold/tests/7b-struct-int-array-hello.c: New file.
* scaffold/tests/7b-struct-int-array-pointer.c: New file.
* scaffold/tests/7i-struct-struct-simple.c: New file.
* scaffold/tests/7k-for-each-elem-simple.c: New file.
* scaffold/tests/7l-struct-any-size-array-simple.c: New file.
* scaffold/tests/7o-struct-pre-post-simple.c: New file.
* scaffold/tests/7q-bit-field-simple.c: New file.
* scaffold/tests/90-strspn.c: New file.
* scaffold/tests/06-call-string.c.: Rename from 31-eputs.c.
* scaffold/tests/7t-function-destruct.c: Rename from 48-function-destruct.c.
* scaffold/tests/48-global-static.c: Rename from 49-global-static.c.
* scaffold/tests/55-char-array.c:renamed: Rename from 4a-char-array.c.
* scaffold/tests/51-itoa.c:r Rename from 52-itoa.c.
* include/signal.h:(struct sigaction):
2018-08-15 18:26:55 +02:00
Jan Nieuwenhuizen 2fac924c33
mescc: x86_64 support: Add tests. 2018-08-15 17:19:50 +02:00
Jan Nieuwenhuizen 3e1a197ed1
mescc: Initial x86_64 support.
make all-go && MES=guile ./pre-inst-env scripts/mescc -m64 -c scaffold/main.c
2018-08-14 20:32:56 +02:00
Jan Nieuwenhuizen ee9081f3ec
mescc: Prepare for x86_64 support.
* module/mescc/info.scm (info): Add allocated, registers.
* module/mescc/i386/info.scm: New file.
* build-aux/build-guile.sh (SCM_FILES): Add it.
* module/mescc/compile.scm (c99-input->info): Add info parameter.
(c99-ast->info): Likewise.
(i386:type-alist): Remove.
(alloc-register, free-register): New function.
(expr->register*): Rename from expr->accu*.  Update callers.
(expr->accu): Rename from expr->accu.  Update callers.
* module/mescc/mescc.scm(%info): New variable.
* module/mescc/mescc.scm (c->ast): Use it.
(mescc:compile): Likewise.
(E->info): Likewise.
2018-08-14 12:35:24 +02:00
Jan Nieuwenhuizen 92aad1ceaf
emacs: Add disassembly helpers.
* .dir-locals.el (as-32, as-64): Add disassembly helpers.
2018-09-16 11:07:39 +02:00
Jan Nieuwenhuizen 6ace89f417
guix: nyacc-for-mes: Update to 0.86.0.
* guix/git/mes.scm (nyacc-for-mes): Update to 0.86.0 plus fix binary
literals.
2018-09-11 19:35:24 +02:00
Jan Nieuwenhuizen 15e94917f0
mescc: Support gcc-3.0: Locale header fix.
* include/locale.h (LC_ALL, LC_NUMERIC): Numbers, not strings.
(LC_COLLATE, LC_CTYPE): New macro.
2018-09-11 07:01:33 +02:00
Jan Nieuwenhuizen b5a725256c
build: Oops, fix ./check.sh for bootstrap build.
* build-aux/config.sh (top_builddir): Set default to `.'.
2018-09-09 07:11:50 +02:00
Jan Nieuwenhuizen 74065eba40
guix: nyacc-for-mes: Update to 0.85.3.
* guix/git/mes.scm (nyacc-for-mes): Update to 0.85.3.
2018-09-05 22:13:18 +02:00
Jan Nieuwenhuizen d19d4ca3f4
mes: Support Nyacc 0.85.3: Integrate progress.
* mes/module/nyacc/lang/sx-util.mes: New file.
* mes/module/nyacc/version.mes: New file.
* mes/module/nyacc/lang/c99/cpp.mes (nyacc): Include them.
* mes/module/nyacc/lang/c99/parser.mes (nyacc): Include them.
* module/mescc/preprocess.scm (need-progress): New function.
(progress): New function.
(insert-progress-monitors): Use them to Integrate progress.
2018-09-05 22:14:34 +02:00
Jan Nieuwenhuizen d7f5af4a61
mes: Support Nyacc 0.85.3: Add char-set-copy.
* mes/module/srfi/srfi-14.mes (char-set-copy): New function>
2018-09-05 20:28:06 +02:00
Jan Nieuwenhuizen 738c009456
doc: Update bootstrap graph.
* doc/images/gcc-mesboot-graph.dot: Regenerate.
* build-aux/GNUmakefile.in (doc/mes.info): Oops change dependency to .png.
* doc/mes.texi (The Mes Bootstrap Process): Update image and wording.
2018-09-04 07:51:15 +02:00
Jan Nieuwenhuizen a88970257f
guix: Update hash.
* guix/git/mes.scm (mes): Update hash.
2018-09-04 06:40:47 +02:00
Jan Nieuwenhuizen 5fb94529b9
Release 0.17.1.
* configure (VERSION): Update to 0.17.1.
(main): Likewise.
* configure.sh (VERSION): Likewise.
* build-aux/GNUmakefile.in (gen-announce): Likewise.
* guix/git/mes.scm (mes, mes.git): Likewise.
2018-09-03 19:57:22 +02:00
Jan Nieuwenhuizen abcd24f517
doc: Release update.
* HACKING (prefix): Update.
* INSTALL (http): Update.
* NEWS: Update.
* README (C-compiler): Update.
* doc/announce/ANNOUNCE-0.17: Update.
2018-08-10 00:22:05 +02:00
Jan Nieuwenhuizen d814eeda79
build: ALlow releasing from worktree.
* build-aux/GNUmakefile.in (COMMIT): Check for .git file.
2018-09-03 20:09:45 +02:00
Jan Nieuwenhuizen db753e8fee
mescc: Mes C Library: Do not redefine size_t.
* include/stddef.h: Do not redefine size_t.
2018-09-01 16:55:45 +02:00
Jan Nieuwenhuizen ea357f506e
mescc: Mes C Library: Support make 3.80: Add setlocale, sigaddset.
* include/limits.h (ULONG_MAX): New macro.
* include/locale.h (LC_ALL, LC_NUMERIC): New macro.
* lib/stub/setlocale.c: New file.
* lib/stub/sigaddset.c: New file.
* lib/libc+gnu.c: Include them.
2018-08-28 00:45:23 +02:00
Jan Nieuwenhuizen f22cc0c173
mescc: Mes C Library: Fix qsort to support duplicate entries.
* lib/stdlib/qsort.c (qpart): Handle dupes.
* scaffold/tests/81-qsort-dupes.c: New file.
* build-aux/check-mescc.sh (tests): Run it.
2018-08-27 22:37:12 +02:00
Jan Nieuwenhuizen 06e9dd4bce
mescc: Mes C Library: Support make: Implement clock_gettime, time.
* include/linux/x86/syscall.h (SYS_time, SYS_clock_gettime,
SYS_gettimeofday): New macro.
* include/linux/x86_64/syscall.h (SYS_time, SYS_clock_gettime,
SYS_gettimeofday): New macro.
* lib/linux/tcc.c (gettimeofday, time): New function.
* lib/linux/gnu.c (clock_gettime): New function.
* include/time.h: Declare it.
* lib/stub/gettimeofday.c: Remove.
* lib/stub/time.c: Remove.
2018-08-27 00:34:13 +02:00
Jan Nieuwenhuizen 2fe2e556e8
mescc: Mes C Library: Support make: Support main with envp.
* lib/linux/x86-mes-gcc/crt1.c (_start): Also push envp.
* lib/linux/x86-mes/crt1.c (_start): Also push envp.
* lib/linux/x86_64-mes-gcc/crt1.c (_start): Also mov environment,%rdx.
2018-08-26 23:39:43 +02:00
Jan Nieuwenhuizen 8b9d51e4a4
mescc: Mes C Library: Support make: Add chdir, getlogin, setvbuf, sigblock.
* lib/stub/getlogin.c: New file.
* lib/stub/setvbuf.c: New file.
* lib/stub/sigblock.c: New file.
* lib/libc+gnu.c: Include them.
* include/linux/x86/syscall.h (SYS_chdir): New macro.
* include/linux/x86_64/syscall.h (SYS_chdir): New macro.
* include/stdio.h (_IOFBF, _IOLBF, _IONBF): New macro.
* include/errno.h (ENOEXEC, ECHILD): New macro.
* include/sys/wait.h (WNOHANG): New macro.
* lib/linux/gnu.c (chdir): New function.
* include/ar.h: New file.
2018-08-26 22:41:52 +02:00
Jan Nieuwenhuizen 543ae4df32
mescc: Mes C Library: Support diffutils: Add execl.
* include/limits.h (CHAR_MAX): New macro.
* lib/posix/execl.c: New file.
* include/unistd.h: Declare it.
2018-08-26 20:54:29 +02:00
Jan Nieuwenhuizen fa4ba916ea
mescc: Mes C Library: Add closedir, opendir, readdir.
* include/dirent.h: New file.  Import from glibc-2.2.5.
* include/dirstream.h: Likewise.
* lib/dirent/__getdirentries.c: Likewise.
* lib/dirent/closedir.c: Likewise.
* lib/dirent/readdir.c (readdir): Likewise.
* lib/libc+gnu.c: Include them.
* include/linux/x86/syscall.h (SYS_getdents): New macro.
* include/linux/x86_64/syscall.h (SYS_getdents): Likewise.
* lib/linux/gnu.c (getdents): New function.
* include/limits.h (NAME_MAX): New macro.
* include/fcntl.h (O_DIRECTORY): New macro.
* scaffold/tests/readdir.dir: New directory.
* scaffold/tests/99-readdir.c: New file, use it.
* build-aux/check-mescc.sh (tests): Run it.
2018-08-26 18:34:53 +02:00