Commit Graph

1748 Commits

Author SHA1 Message Date
Jan Nieuwenhuizen 55f29fcade
guix: mes: Update to 0.20.
* guix/git/mes.scm (mes, mes.git): : Update to 0.20.
2019-09-07 20:03:12 +02:00
Jan Nieuwenhuizen a7f582f879
doc: Release update.
* BLURB: New file.
* AUTHORS: Update.
* HACKING: Update.
* INSTALL: Update.
* NEWS: Update.
* README: Update.
* doc/images/gcc-mesboot-graph.dot: Update.
* doc/mes.texi: Update.
* simple.sh: Update.
2019-09-07 19:57:13 +02:00
Jan Nieuwenhuizen c97168ff41
guix: Update Nyacc to 0.99.
* guix/git/mes.scm (nyacc): Update to 0.99.
2019-09-07 19:57:13 +02:00
Jan Nieuwenhuizen e355b70f20
doc: Add PORTING.
* PORTING: New file.
2019-09-07 19:57:12 +02:00
Jan Nieuwenhuizen 9a4f5a052a
doc: Typos. Thanks, dddddd.
* doc/announce/ANNOUNCE-0.11: Typo.
* doc/announce/ANNOUNCE-0.12: Typo.
* doc/announce/ANNOUNCE-0.13: Typo.
* doc/announce/ANNOUNCE-0.14: Typo.
2019-09-07 19:57:12 +02:00
Jan Nieuwenhuizen 6e9e650e37
mescc: Remove dead code. Thanks Mark Weaver.
* module/mescc/compile.scm (field-size): Remove dead function.
2019-09-07 19:57:12 +02:00
Jan Nieuwenhuizen 4d4691d449
guix: Update packaging.
* build-aux/manifest.scm (string-append):
* guix/git/mes.scm (nyacc, git-file?): Remove.
(mescc-tools): Bump to 0.6.0.
(%source-dir): New variable.
(mes.git): Ues it.
* guix.scm: Rename from .guix.scm.
2019-09-07 19:57:12 +02:00
Jan Nieuwenhuizen 0f973d72a7
build: Do not generate ChangeLog from tarball.
* configure (main): Set .git-for-build.
* build-aux/install.sh.in (DESTDIR): Use it as canary to skip
ChangeLog rebuild.
2019-09-07 19:57:12 +02:00
Jan Nieuwenhuizen 92a5296518
build: Use mesar instead of ar.
* scripts/mesar.in: Rename from ar.in.  Update users.
* build-aux/build.sh.in (LIBS): Update.
* build-aux/check.sh.in (recheck): Likwise.
* build-aux/install.sh.in (DESTDIR): Likwise.
* configure (main): Likwise.
* configure.sh (mes_system): Likwise.
* .gitignore: Update.
2019-09-07 19:57:12 +02:00
Jan Nieuwenhuizen e76dcdc387
getopt: Remove old FSF address, thanks Vagrant.
* lib/posix/getopt.c: Remove old FSF address.
2019-09-07 19:57:12 +02:00
Danny Milosavljevic 9847e2c224
Add missing #include.
* lib/tests/scaffold/55-char-array.c: Add missing #include.
2019-09-07 19:57:11 +02:00
Danny Milosavljevic 215a12703c
Add missing #include.
* lib/tests/io/90-stat.c: Add missing #include.
2019-09-07 19:57:11 +02:00
Danny Milosavljevic 4f6d919c11
Add missing #include.
* lib/posix/getcwd.c: Add missing #include.
2019-09-07 19:57:11 +02:00
Jan Nieuwenhuizen cde88d5bbf
signal: Use SA_RESTORER on x86-64.
* lib/linux/signal.c (signal)[x86_64]: Avoid segfault by setting
SA_RESTORER flag.
2019-09-07 19:57:11 +02:00
Danny Milosavljevic 6b9c40ab22
signal: Add comment on why we don't use the restorer.
* lib/linux/signal.c: Add comment on why we don't use the restorer.
2019-09-07 19:57:11 +02:00
Danny Milosavljevic ed923af631
signal: Remove SA_SIGINFO.
* lib/linux/signal.c (signal): Remove SA_SIGINFO.
2019-09-07 19:57:11 +02:00
Danny Milosavljevic 0daacdb057
signal: Don't use custom restorer.
* lib/linux/signal.c (signal): Don't use custom restorer.
2019-09-07 19:57:11 +02:00
Danny Milosavljevic ddfa0e583e
signal: Use SA_SIGINFO (like glibc).
* lib/linux/signal.c (_restorer): Rename to...
(_restorer_for_siginfo): ...this.
(signal): Use it.  Use SA_SIGINFO.
2019-09-07 19:57:10 +02:00
Danny Milosavljevic 39f2be799a
signal: Make sure that the signal mask is actually unsigned long.
* lib/linux/signal.c (signal): Make sure that the signal mask is actually
unsigned long.
2019-09-07 19:57:10 +02:00
Danny Milosavljevic b56c229ed8
Delete "__sigmask".
Follow-up to 6d95b89759d3c598fc84194429ae8c57249daa1a

* lib/linux/signal.c (__sigmask): Delete definition.
2019-09-07 19:57:10 +02:00
Danny Milosavljevic dc69243eb7
Fix "struct sigaction" structure for rt_sigaction.
* include/signal.h (sigset_t): Increase size.
* lib/linux/signal.c (signal): Use new sigset_t.
2019-09-07 19:57:10 +02:00
Danny Milosavljevic f33f0cb3f6
Inherit CFLAGS for mes.
* build-aux/check.sh.in: Inherit CFLAGS for mes.
2019-09-07 19:57:10 +02:00
Danny Milosavljevic d6ac93695c
Fix typo.
* build-aux/build.sh.in: Fix typo in "CFLAGS".
2019-09-07 19:57:10 +02:00
Danny Milosavljevic b47f25547d
tests: Fail early on nonexistent file.
* lib/tests/io/90-stat.c (main): Fail early on nonexistent file.
2019-09-07 19:57:10 +02:00
Danny Milosavljevic f018be6750
open: Check flags, and use _open2 if applicable.
* lib/linux/open.c (open): Check flags; use _open2.
2019-09-07 19:57:09 +02:00
Danny Milosavljevic 554da18fac
ldiv: Make rem < 0 if a < 0.
* lib/mes/div.c (ldiv): Make rem < 0 if a < 0.
2019-09-07 19:57:09 +02:00
Danny Milosavljevic b1090422c3
ldiv: Handle a == LONG_MIN.
* lib/mes/div.c (ldiv): Handle a == LONG_MIN.
2019-09-07 19:57:09 +02:00
Danny Milosavljevic fba1e15f02
Fix ntoab.
Follow-up to b5b19304b59fefbed923b146ec8c8d495556fa76.

* lib/mes/ntoab.c (ntoab): Fix non-MESC case.
2019-09-07 19:57:09 +02:00
Danny Milosavljevic 914f4d40a7
signal: Define "_restorer" everywhere except on i386.
* lib/linux/signal.c: Define "_restorer" everywhere except on i386.
2019-09-07 19:57:09 +02:00
Danny Milosavljevic d79091ce4e
Clarify our data type choices in "struct stat".
* include/sys/stat.h: Clarify our data type choices in "struct stat".
2019-09-07 19:57:09 +02:00
Jan Nieuwenhuizen b5523ad09e
test: Bump timeout.
* build-aux/test-c.sh: Bump timeout to 10s, __mesabi_uldiv can be slow.
2019-09-07 19:57:06 +02:00
Danny Milosavljevic e6400e78d3
ntoab: Use __mesabi_uldiv only on __MESC__.
* lib/mes/ntoab.c (ntoab): Use __mesabi_uldiv only on __MESC__.
2019-09-07 16:31:46 +02:00
Jan Nieuwenhuizen 7eca5208b7
mescc: Mes C Library: Include mes/div.c for mescc builds.
* build-aux/configure-lib.sh (libmes_SOURCES): Add mes/div.c.
* simple.sh: Likewise.
2019-09-07 16:31:46 +02:00
Danny Milosavljevic 7cb40dd5a4
ntoab: Include "assert.h".
* lib/mes/ntoab.c: #include "assert.h".
2019-09-07 16:31:46 +02:00
Danny Milosavljevic 88db18509c
mescc: Mes C Library: Use __mesabi_uldiv.
* lib/mes/ntoab.c (ntoab): Use __mesabi_uldiv.
2019-09-07 16:31:46 +02:00
Danny Milosavljevic 947b916769
mescc: Mes C Library: Add integer division algorithm.
* lib/mes/div.c: New file.
2019-09-07 16:31:46 +02:00
Jan Nieuwenhuizen 4d23ca40d8
mescc: Mes C Library: Have write behave well with buffered reads.
* lib/mes/write.c: New file.
* build-aux/configure-lib.sh (libc_mini_SOURCES): Add it.
(libc_mini_shared_SOURCES): New variable.
(libc_mini_SOURCES, libmes_SOURCES): Use it.
(libmes_SOURCES): Add lib/linux/lseek.c, lib/posix/write.c.
(libc_tcc_SOURCES): Remove lib/linux/lseek.c.
* lib/posix/write.c (write): Correct for read buffer.
* lib/stdio/fwrite.c (fwrite): Remove read buffer correction.
* simple.sh: Update.
2019-09-07 16:31:46 +02:00
Jan Nieuwenhuizen 59c66e67e2
mescc: Mes C Library: Add buffered read.
* lib/mes/__buffered_read.c: New file.
* build-aux/configure-lib.sh (libc_SOURCES): Add it.  Also add memmove.c.
(libc_tcc_SOURCES): Remove memmove.c
* lib/linux/close.c (close): Clear read buffer.
* lib/linux/_open3.c (_open3): Likewise.
* lib/linux/lseek.c (lseek): Correct for read buffer.
* lib/stdio/fwrite.c (fwrite): Likewise.
* lib/posix/read.c (read): Call __buffered_read.
* lib/posix/write.c (write): Add FIXME note about buffered reads.
* simple.sh: Update.
2019-09-07 16:31:46 +02:00
Jan Nieuwenhuizen 7520d0842a
tests: Disable 70-extern.c for x86_64-gcc.
* build-aux/check-mescc.sh (XFAIL_TESTS)[x86_64-gcc]: Add
70-extern.c.
2019-09-07 16:31:45 +02:00
Danny Milosavljevic 62c7a7c37a
mescc: Put char's ASCII code into register, not char.
* module/mescc/compile.scm (expr-register): Put char's ASCII code into
register, not char.
2019-09-07 16:31:45 +02:00
Jan Nieuwenhuizen bf6c85a652
mes: Update to Nyacc 0.93.
* mes/module/nyacc/lang/c99/util.mes: New file.
* mes/module/nyacc/lang/c99/parser.mes: Use it.
* module/mescc/compile.scm (ast->info): Update for Nyacc 0.93.0.
* module/mescc/preprocess.scm (need-progress):  Likewise.
(ast-strip-comment): Likewise.
2019-09-07 16:31:45 +02:00
Jan Nieuwenhuizen f356867bea
mes: string->number: Support #x-prefixed hex numbers.
* mes/module/mes/scm.mes (string->number): Support "#x"-prefix.
* tests/math.test ("string->number #hex"): Test it.
2019-09-07 16:31:45 +02:00
Jan Nieuwenhuizen a9a0d142b6
mescc: Do not dump variables with extern storage.
* lib/tests/scaffold/70-extern.stdout: New file.
* lib/tests/scaffold/70-extern.c: New file.
* build-aux/check-mescc.sh (TESTS): Add it..
* module/mescc/M1.scm (global-string?, global-extern?): New function.
(info->M1): Dump strings first.  Skip extern symbols.
* module/mescc/info.scm (<global>): Add storage field.
(make-global): Add storage parameter.  Pass it.
* module/mescc/compile.scm (make-global-entry): Likewise.
(global->info): Likewise.
(init-declr->info): Likewise.
(decl->info): Pass storage.
2019-09-07 16:31:45 +02:00
Jan Nieuwenhuizen 910408996a
build: ./pre-inst-env MES_PREFIX fixup.
* build-aux/pre-inst-env.in: Set MES_PREFIX to abs_top_srcdir.
* src/mes.c (open_boot): Cater for MES_PREFIX/mes and ${srcdest}.
2019-09-07 16:31:45 +02:00
Jan Nieuwenhuizen 37996c845b
mescc: Be silent.
* module/mescc/M1.scm (infos->M1, info->M1): Add verbose?.  Move
debugging into verbose? > 1.
* module/mescc/compile.scm (c99-input->info, c99-ast->info): Likewise.
(mescc:trace-verbose): Rename from mescc:trace.
(mescc:trace): New function.
* module/mescc.scm (mescc:main): Likewise.
* module/mescc/mescc.scm (mescc:preprocess, c->ast mescc:compile,
c->info, E->info): Likewise.
* module/mescc/preprocess.scm (c99-input->full-ast, c99-input->ast):
Likewise.
2019-09-07 16:31:45 +02:00
Jan Nieuwenhuizen 28166e32bb
mescc: Add <include>/<kernel>/<arch> to include path.
* module/mescc/preprocess.scm (c99-input->full-ast): Add
<include>/<kernel>/<arch> to include path.
* module/mescc/compile.scm (c99-input->info): Pass arch.
* module/mescc/mescc.scm (mescc:preprocess): Likewise.
(c->info): Likewise.
(c->ast): Likewise.
2019-09-07 16:31:44 +02:00
Jan Nieuwenhuizen 8ad984fa69
mescc: Add 70-function-destruct-declare.c test.
* module/mescc/compile.scm (init-declr->info): Do not attempt to
re-calculate function type.
(ftn-declr:get-type): Remove.
* lib/tests/scaffold/70-function-destruct-declare.c: New file.
* build-aux/check-mescc.sh (TESTS): Add it.
2019-09-07 16:31:44 +02:00
Jan Nieuwenhuizen 637d77e2b0
mescc: Resurrect --write.
* module/mescc/mescc.scm (mescc:preprocess): Pass pretty-print/write
to c->ast.
2019-09-07 16:31:44 +02:00
Jan Nieuwenhuizen 5c633eca0f
build: Distribute crt*.c, libc+gnu.c for tcc, gcc bootstrap build.
* build-aux/build-lib.sh (libc_gnu_SOURCES): Build libc+gnu.c.  Copy
crt*.c, libc+gnu.c for distribution.
2019-09-07 16:31:44 +02:00
Jan Nieuwenhuizen 2a6015eece
build: Uniquify config macros.
* configure (main): Rename VERSION to MES_VERSION, pkgdatadir to
MES_PKGDATADIR.  Update users.
* configure.sh (mes_system): Likewise.
* src/mes.c (mes_symbols): Update.
(open_boot): Update.
* scaffold/cons-mes.c (main): Update.
* simple.sh: Update.
2019-09-07 16:31:44 +02:00