Commit graph

8 commits

Author SHA1 Message Date
Janneke Nieuwenhuizen 4a0bb97d70 Revert "crt1: Move main declaration to mes/lib-mini.h."
This reverts commit 5b55627e0ccf7c798284a380a20a2eb4d6b9c4c0.
2023-11-05 09:45:31 +01:00
Janneke Nieuwenhuizen ad6c02076f crt1: Move main declaration to mes/lib-mini.h.
* include/mes/lib-mini.h (main): New declaration.
lib/freebsd/x86-mes-gcc/crt1.c (main): Remove declaration.
lib/freebsd/x86-mes-mescc/crt1.c (main): Remove declaration.
lib/gnu/x86-mes-gcc/crt1.c (main): Remove declaration.
lib/linux/arm-mes-gcc/crt1.c (main): Remove declaration.
lib/linux/arm-mes-m2/crt1.c (main): Remove declaration.
lib/linux/arm-mes-mescc/crt1.c (main): Remove declaration.
lib/linux/riscv64-mes-gcc/crt1.c (main): Remove declaration.
lib/linux/riscv64-mes-m2/crt1.c (main): Remove declaration.
lib/linux/riscv64-mes-mescc/crt1.c (main): Remove declaration.
lib/linux/x86-mes-gcc/crt1.c (main): Remove declaration.
lib/linux/x86-mes-m2/crt1.c (main): Remove declaration.
lib/linux/x86-mes-mescc/crt1.c (main): Remove declaration.
lib/linux/x86_64-mes-gcc/crt0.c (main): Remove declaration.
lib/linux/x86_64-mes-gcc/crt1.c (main): Remove declaration.
lib/linux/x86_64-mes-m2/crt1.c (main): Remove declaration.
lib/linux/x86_64-mes-mescc/crt1.c (main): Remove declaration.
2023-11-05 09:45:31 +01:00
Janneke Nieuwenhuizen 88eb90dd38 x86_64: lib: Use __init_io.
* lib/linux/x86_64-mes-gcc/crt1.c (_start): Replace manual initialization
of __stdin, __stdout, __stderr, and environ with __init_io ().
* lib/linux/x86_64-mes-m2/crt1.M1 (_start): Likewise.
* lib/linux/x86_64-mes-mescc/crt1.c (_start): Likewise.
2023-11-05 09:40:37 +01:00
Jan (janneke) Nieuwenhuizen 905277a73a
mescc: Mes C Library: Split _exit.c, _write.c from mini.c.
* lib/freebsd/x86-mes-gcc/mini.c: Split into...
* lib/freebsd/x86-mes-gcc/_exit.c: ...this, and...
* lib/freebsd/x86-mes-gcc/_write.c: ...this.
* lib/freebsd/x86-mes-mescc/mini.c: Slpit into...
* lib/freebsd/x86-mes-mescc/_exit.c: ...this, and...
* lib/freebsd/x86-mes-mescc/_write.c: ...this.
* lib/gnu/x86-mes-gcc/mini.c: Split into...
* lib/gnu/x86-mes-gcc/_exit.c: ...this, and...
* lib/gnu/x86-mes-gcc/_write.c: ...this.
* lib/linux/arm-mes-gcc/mini.c: Split into...
* lib/linux/arm-mes-gcc/_exit.c: ...this, and...
* lib/linux/arm-mes-gcc/_write.c: ...this.
* lib/linux/arm-mes-mescc/mini.c: Split into...
* lib/linux/arm-mes-mescc/_exit.c: ...this, and...
* lib/linux/arm-mes-mescc/_write.c: ...this.
* build-aux/configure-lib.sh (libc_mini_shared_SOURCES): Replace mini.c
with add _exit.c, _write.c.
* simple.sh: Update accordingly.
2021-01-23 08:43:45 +01:00
Jan (janneke) Nieuwenhuizen 0650e08744
mescc: Mes C Library: x86_64: Add syscall-internal.
This resurrects the x86_64 build.

* lib/linux/x86_64-mes-gcc/syscall-internal.c (__sys_call_internal),
lib/linux/x86_64-mes-mescc/syscall-internal.c: New file.
2020-10-06 10:05:33 +02:00
Jan (janneke) Nieuwenhuizen e16d1e469a
mescc: Mes C Library: x86_64: Introduce __sys_call and friends.
This prepares for x86_64 syscall-internal.

* lib/linux/x86_64-mes-gcc/syscall.c (__sys_call, __sys_call1,
__sys_call2, __sys_call3, __sys_call4): New functions, copied from ...
(_sys_call, _sys_call1, _sys_call2, _sys_call3, _sys_call4): ... these.
Use them, handle errno only.
2020-10-06 10:05:33 +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 5dc245e739
build: Simplify.
core: Make mes src/ c files separate compilation units.

* include/mes/constants.h: New file.
* include/mes/macros.h: New file.
* include/mes/mes.h: New file.
* src/gc.c: Update.
* src/hash.c: Update.
* src/lib.c: Update.
* src/math.c: Update.
* src/mes.c: Update.
* src/module.c: Update.
* src/posix.c: Update.
* src/reader.c: Update.
* src/string.c: Update.
* src/struct.c: Update.
* src/vector.c: Update.

    mes: Update datadir.

* src/mes.c (g_datadir): New global.
(open_boot): Rename from read_boot.
(read_boot): New function.
* mes/module/mes/boot-0.scm: Move from boot-0.scm.in
* configure: Update.
* configure.sh: Update.

    mescc: Create libraries from separate files.

* .gitignore: Update.
* build-aux/bootstrap-mes.sh: Remove.
* build-aux/bootstrap.sh.in: Remove.
* build-aux/build-guile.sh: Update.
* build-aux/build-mes.sh: Update.
* build-aux/build-scaffold.sh: New file.
* build-aux/build.sh.in: Update.
* build-aux/cc.sh: Update.
* build-aux/check-tcc.sh: Remove.
* build-aux/config.sh.in: New file.
* build-aux/config.sh: Remove.
* build-aux/install.sh.in: Update.
* build-aux/test-boot.sh: New file.
* build-aux/test-c.sh: New file.
* build-aux/test-driver: New file.
* build-aux/test-suite.sh: New file.
* build-aux/trace.sh: Update.
* build-aux/uninstall.sh.in: Update.
* configure: Update.
* configure.sh: Update.
* lib/linux/x86-mes-mescc/crt1.c: Move from lib/linux/x86-mes.
* lib/linux/x86-mes-mescc/mini.c: Likewise.
* lib/linux/x86_64-mes-mescc/crt1.c: Move from lib/linux/x86_64-mes.
* lib/linux/x86_64-mes-mescc/mini.c: Likewise.
* lib/linux/x86-mes-gcc/syscall.c: Rename from mes.c.
* lib/linux/x86-mes-mescc/syscall.c: Likewise.
* lib/linux/x86_64-mes-gcc/syscall.c: Likewise.
* lib/linux/x86_64-mes-mescc/syscall.c: Likewise.
* lib/mes/mes_open.c: Include config.h.
* lib/tests/stdio/70-printf-hello.c: Likewise.
* lib/tests/stdio/70-printf-simple.c: Likewise.
* scaffold/gc-test.sh: New file.
* simple.sh: Update.
2019-06-08 15:36:22 +02:00