From: ljsebald <ljs...@us...> - 2023-01-05 03:58:50
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "A pseudo Operating System for the Dreamcast.". The branch, master has been updated via 289fd0c65b6ca086f9e309ff81e7001a9f80e03e (commit) from e4e80f4806c88ab20a8a5e13182e56402f22c8b9 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 289fd0c65b6ca086f9e309ff81e7001a9f80e03e Author: Lawrence Sebald <ljs...@us...> Date: Wed Jan 4 22:58:26 2023 -0500 Remove vestiges of ancient GCC versions. ----------------------------------------------------------------------- Summary of changes: environ_base.sh | 1 + include/kos/cdefs.h | 6 +---- kernel/arch/dreamcast/kernel/init.c | 19 +++----------- kernel/libc/koslib/Makefile | 7 ------ kernel/libc/koslib/crtbegin.c | 49 ------------------------------------- kernel/libc/koslib/crtend.c | 28 --------------------- 6 files changed, 5 insertions(+), 105 deletions(-) delete mode 100644 kernel/libc/koslib/crtbegin.c delete mode 100644 kernel/libc/koslib/crtend.c diff --git a/environ_base.sh b/environ_base.sh index 46f781f..d8580be 100644 --- a/environ_base.sh +++ b/environ_base.sh @@ -46,6 +46,7 @@ export KOS_GCCVER="`kos-cc -dumpversion`" case $KOS_GCCVER in 2* | 3*) + echo "Your GCC version is too old. You probably will run into major problems!" export KOS_LDFLAGS="${KOS_LDFLAGS} -nostartfiles -nostdlib ${KOS_LIB_PATHS}" ;; *) export KOS_LDFLAGS="${KOS_LDFLAGS} ${KOS_LD_SCRIPT} -nodefaultlibs ${KOS_LIB_PATHS}" ;; diff --git a/include/kos/cdefs.h b/include/kos/cdefs.h index 4052cb3..19eeb7c 100644 --- a/include/kos/cdefs.h +++ b/include/kos/cdefs.h @@ -23,11 +23,7 @@ #include <sys/cdefs.h> /* Check GCC version */ -#if __GNUC__ < 2 -# warning Your GCC is too old. This will probably not work right. -#endif - -#if __GNUC__ == 2 && __GNUC_MINOR__ < 97 +#if __GNUC__ <= 3 # warning Your GCC is too old. This will probably not work right. #endif diff --git a/kernel/arch/dreamcast/kernel/init.c b/kernel/arch/dreamcast/kernel/init.c index 8fef9b9..04e8cfe 100644 --- a/kernel/arch/dreamcast/kernel/init.c +++ b/kernel/arch/dreamcast/kernel/init.c @@ -24,16 +24,15 @@ extern int _bss_start, end; void _atexit_call_all(); +/* ctor/dtor stuff from libgcc. */ #if __GNUC__ == 4 #define _init init #define _fini fini #endif -#if __GNUC__ >= 4 void _init(void); void _fini(void); void __verify_newlib_patch(); -#endif int main(int argc, char **argv); uint32 _fs_dclsocket_get_ip(void); @@ -63,10 +62,12 @@ int dbgio_handler_cnt = sizeof(dbgio_handlers) / sizeof(dbgio_handler_t *); this to be linked into your code (and do the same with the arch_auto_shutdown function too). */ int __attribute__((weak)) arch_auto_init() { +#ifndef _arch_sub_naomi union { uint32 ipl; uint8 ipb[4]; } ip; +#endif /* Initialize memory management */ mm_init(); @@ -215,11 +216,6 @@ int arch_main() { *DMAOR = 0x8201; #endif /* _arch_sub_naomi */ - /* Ensure that we pull in crtend.c in the linking process */ -#if __GNUC__ < 4 - __crtend_pullin(); -#endif - /* Ensure that UBC is not enabled from a previous session */ ubc_disable_all(); @@ -230,12 +226,8 @@ int arch_main() { arch_auto_init(); /* Run ctors */ -#if __GNUC__ < 4 - arch_ctors(); -#else __verify_newlib_patch(); _init(); -#endif /* Call the user's main function */ rv = main(0, NULL); @@ -257,12 +249,7 @@ void arch_set_exit_path(int path) { void arch_shutdown() { /* Run dtors */ _atexit_call_all(); - -#if __GNUC__ < 4 - arch_dtors(); -#else _fini(); -#endif dbglog(DBG_CRITICAL, "arch: shutting down kernel\n"); diff --git a/kernel/libc/koslib/Makefile b/kernel/libc/koslib/Makefile index dc996d7..5f46faa 100644 --- a/kernel/libc/koslib/Makefile +++ b/kernel/libc/koslib/Makefile @@ -16,11 +16,4 @@ OBJS = abort.o byteorder.o memset2.o memset4.o memcpy2.o memcpy4.o \ gethostbyname.o getaddrinfo.o dirfd.o nanosleep.o basename.o dirname.o \ sched_yield.o -GCC_MAJORMINOR = $(basename $(KOS_GCCVER)) -GCC_MAJOR = $(basename $(GCC_MAJORMINOR)) - -ifeq ($(strip $(GCC_MAJOR)), 3) -OBJS += crtbegin.o crtend.o -endif - include $(KOS_BASE)/Makefile.prefab diff --git a/kernel/libc/koslib/crtbegin.c b/kernel/libc/koslib/crtbegin.c deleted file mode 100644 index f3be45c..0000000 --- a/kernel/libc/koslib/crtbegin.c +++ /dev/null @@ -1,49 +0,0 @@ -/* KallistiOS ##version## - - crtbegin.c - Copyright (C)2002 Dan Potter -*/ - -/* Handles ctors and dtors (for C++ programs). This is modeled on the - FreeBSD crtbegin.c code. Note that the default linker scripts for - GCC will automatically put our ctors at the front of the list. */ - -#if __GNUC__ < 4 - -#include <arch/types.h> - -/* Here we gain access to the ctor and dtor sections of the program by - defining new data in them. */ -typedef void (*fptr)(void); - -static fptr ctor_list[1] __attribute__((section(".ctors"))) = { (fptr) - 1 }; -static fptr dtor_list[1] __attribute__((section(".dtors"))) = { (fptr) - 1 }; - -void __verify_newlib_patch(); - -/* Call this to execute all ctors */ -void arch_ctors() { - fptr *fpp; - - __verify_newlib_patch(); - - /* Run up to the end of the list (defined by crtend) */ - for(fpp = ctor_list + 1; *fpp != 0; ++fpp) - ; - - /* Now run the ctors backwards */ - while(--fpp > ctor_list) - (**fpp)(); -} - -/* Call this to execute all dtors */ -void arch_dtors() { - fptr *fpp; - - /* Do the dtors forwards */ - for(fpp = dtor_list + 1; *fpp != 0; ++fpp) - (**fpp)(); -} - -#endif /* __GNUC__ < 4 */ - diff --git a/kernel/libc/koslib/crtend.c b/kernel/libc/koslib/crtend.c deleted file mode 100644 index 6d02486..0000000 --- a/kernel/libc/koslib/crtend.c +++ /dev/null @@ -1,28 +0,0 @@ -/* KallistiOS ##version## - - crtend.c - Copyright (C)2002 Dan Potter -*/ - -/* Handles ctors and dtors (for C++ programs). This is modeled on the - FreeBSD crtend.c code. Note that the default linker scripts for - GCC will automatically put our ctors at the end of the list. */ - -#if __GNUC__ < 4 - -#include <sys/cdefs.h> - -/* Here we gain access to the ctor and dtor sections of the program by - defining new data in them. */ -typedef void (*fptr)(void); - -static fptr ctor_list[1] __attribute__((section(".ctors"))) = { (fptr) 0 }; -static fptr dtor_list[1] __attribute__((section(".dtors"))) = { (fptr) 0 }; - -/* Ensures that this gets linked in */ -void __crtend_pullin() { - (void)ctor_list; - (void)dtor_list; -} - -#endif /* __GNUC__ < 4 */ hooks/post-receive -- A pseudo Operating System for the Dreamcast. |