Commit Graph

21 Commits

Author SHA1 Message Date
Ekaitz f89fed3c3b
doc: Fix typos.
* doc/mes.texi (Invoking mescc): Fix typo.
* module/mescc.scm (parse-opts): Likewise.
2022-09-22 11:14:34 +02:00
Jan (janneke) Nieuwenhuizen 5bb568e455
mescc: Change --align to --align=functions, --align=globals.
This makes function alignment optional and disables function alignment
when using MesCC-Tools 0.5.2 (numbered architecture).

* module/mescc.scm (parse-opts): Make --align take a value.
* module/mescc/mescc.scm (mescc:compile, infos->hex2): Parse it and pass
it as renamed #:align keyword argument to ...
* module/mescc/M1.scm (infos->M1): ...here.  Rename parameter align? to
align, pass it to...
(info->M1): ...here.  Likewise.  Use it to make function alignment
optional.
2021-01-23 08:43:47 +01:00
Jan (janneke) Nieuwenhuizen 3f70993dd2
mescc: Update -g help text.
* module/mescc.scm (parse-opts): Remove TODO, mention call stack.
2021-01-23 08:41:13 +01:00
Danny Milosavljevic 443f662361
command line: Support "mescc --print-libgcc-file-name".
* module/mescc.scm (parse-opts): Add "--print-libgcc-file-name".
2020-10-06 10:04:41 +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
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 27de9aa0e3
mescc: Add mes 0.19 compatibility.
* mes/module/mes/boot-0.scm (%datadir): Cater for %datadir not being
set.
2019-12-08 10:10:02 +01:00
Jan Nieuwenhuizen 82c85c24da
build: Support mescc-tools 0.5.2.
* configure: Remove version check for mescc-tools.
Check for stage0 architecture flag type.
* configure.sh: Likewise.
* build-aux/build-scaffold.sh: Add stage0 flag type indirection.
* module/mescc/mescc.scm (arch-get-architecture): Likewise.
2019-12-07 14:39:19 +01:00
Jan Nieuwenhuizen 2659caeffa
mescc: Ignore -fno-stack-protector.
* module/mescc.scm (parse-opts): Ignore it.
2019-12-02 18:27:32 +01:00
Jan Nieuwenhuizen 2c2f03c9e4
mescc: Honor --includedir, --libdir.
* guix/git/mes.scm (mes):
* module/mescc.scm (%includedir, %libdir): New variable.
(mescc:main): Add them to options.
* module/mescc/mescc.scm (mescc:preprocess, c->info): Add %includedir.
(arch-find): Use %libdir instead of
prefix-file.
(prefix-file): Remove.
* scripts/mescc.scm.in (%includedir, %libdir): Initialize from and set
in environment.

xx

* module/mescc/mescc.scm :
2019-11-24 11:14:14 +01:00
Jan Nieuwenhuizen c6cceb47f3
build: Update script help and usage.
* doc/mes.texi (Invoking mesar): New section.
* mes/module/mes/boot-0.scm: Add one line help description.
* module/mescc.scm (parse-opts): Likewise.
* scripts/diff.scm (main): Add -h,--help, -v,--version.
* scripts/mesar.in: Likewise.
2019-11-04 23:56:15 +01:00
Jan Nieuwenhuizen c03807b78f
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-07-27 09:51:21 +02:00
Jan Nieuwenhuizen 479bf10878
build: Handle gcc with --pie-by-default.
This fixes upgrading to debian-hurd-20190220.img.

* build-aux/build.sh.in (CFLAGS): Add -static.  Fixes using gcc
compiled with --pie-by-default
* build-aux/check.sh.in (CFLAGS): Likewise.
* module/mescc.scm (parse-opts): Ignore -no-pie, -static.
2019-07-06 13:57:30 +02:00
Jan Nieuwenhuizen 78b3c85f15
build: Cater for ARM.
* configure: Cater for ARM.
* configure.sh: Likewise
* build-aux/GNUmakefile.in: Likewise.
* build-aux/bootstrap.sh.in: Likewise.
* module/mescc.scm (parse-opts): Likewise.
* src/mes.c (mes_environment): Likewise.
* build-aux/build.sh.in: Likewise.
* build-aux/config.sh Likewise.
* build-aux/install.sh.in: Likewise.
* module/mes/guile.scm: Likewise.
* scripts/mescc.scm.in: Likewise.
* module/mescc/mescc.scm (arch-get): New function.
(arch-get-info): New function.
(arch-get-define): New function.
(arch-get-m1-options): New function.
(arch-get-Architecture): New function.
(mescc:preprocess c->info, E->info, M1->hex2, hex2->elf,
M1->blood-elf, arch-find): Use them.
2019-05-22 17:55:20 +02:00
Jan Nieuwenhuizen 9cc3b10763
mescc: Robustify against empty `V' in environment.
* module/mescc.scm: Robustify against empty V in environment.
2019-05-29 16:47:54 +02:00
Jan Nieuwenhuizen 1444c67010
mescc: Fix -dumpmachine to respect -m bits selection.
* module/mescc.scm (parse-opts): Fix -dumpmachine to respect -m bits
selection.  Also display kernel.
2019-05-29 00:04:47 +02:00
Jan Nieuwenhuizen 115feda4fc
mescc: Ignore -fnobuiltin, -nostdinc for GCC compatibility.
* module/mescc.scm (parse-opts): Add -fnobuiltin, -nostdinc.
(mescc:main): Ignore them.
2019-05-29 16:44:31 +02:00
Jan Nieuwenhuizen fb13083d08
mescc: Support -nodefaultlibs, -nostartfiles, -nostdlib.
* module/mescc.scm (parse-opts): Parse -nodefaultlibs, -nostartfiles, -nostdlib.
* module/mescc/mescc.scm (mescc:link): Handle -nodefaultlibs, -nostdlib.
(hex2->elf): Handle -nostartfiles, -nostdlib.
2019-05-05 20:25:22 +02:00
Jan Nieuwenhuizen 3e41363232
mescc: Enhance POSIX command-line support, e.g. -DFOO=1.
* module/mescc.scm (unclump-single): New function.
(main): Use it to support -DFOO=bar, and equivalent.
2018-12-26 14:14:02 +01:00
Jan Nieuwenhuizen 32dcd3a575
doc: Release update.
* AUTHORS: Update.
* HACKING: Update.
* NEWS: Update.
* doc/mes.guix: Update.
* scripts/mescc.in: Update.
* mes/module/mes/boot-0.scm.in: Update.
* doc/announce/ANNOUNCE-0.19: New file.
2018-10-20 09:53:44 +02:00
Jan Nieuwenhuizen 6b841a0cab
mescc: Run without shell.
* mes/module/mescc.mes: New file.
* module/mescc.scm: Include it.
* scripts/mescc.scm.in: New file.
* scripts/mescc.in: Use it; Make pure shell.
* configure: Substitute it.
* configure.sh: Substitute it.
* build-aux/install.sh.in: Install it.
2018-11-25 13:21:03 +01:00