Fix debug build.
* Restore missing definitions of std::nothrow and mynothrow that are required for the debug build. * Additionally, cleanup function overrides provided by kernel_cpp, such that any exceptions in kernel, bootloader or runtime_loader will trigger a panic.
This commit is contained in:
@@ -18,5 +18,5 @@ KernelMergeObject kernel_util.o :
|
|||||||
Random.cpp
|
Random.cpp
|
||||||
StringHash.cpp
|
StringHash.cpp
|
||||||
|
|
||||||
: $(TARGET_KERNEL_PIC_CCFLAGS)
|
: $(TARGET_KERNEL_PIC_CCFLAGS) -DUSING_LIBGCC
|
||||||
;
|
;
|
||||||
|
|||||||
@@ -29,6 +29,17 @@
|
|||||||
// Always define the symbols needed when not linking against libgcc.a --
|
// Always define the symbols needed when not linking against libgcc.a --
|
||||||
// we simply override them.
|
// we simply override them.
|
||||||
|
|
||||||
|
// ... it doesn't seem to work with this symbol at least.
|
||||||
|
#ifndef USING_LIBGCC
|
||||||
|
# if __GNUC__ >= 3
|
||||||
|
const std::nothrow_t std::nothrow = {};
|
||||||
|
# else
|
||||||
|
const nothrow_t std::nothrow = {};
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
const mynothrow_t mynothrow = {};
|
||||||
|
|
||||||
#if __GNUC__ == 2
|
#if __GNUC__ == 2
|
||||||
|
|
||||||
extern "C" void
|
extern "C" void
|
||||||
@@ -62,7 +73,9 @@ __cxa_finalize(void* dsoHandle)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// full C++ support in the kernel
|
// full C++ support in the kernel
|
||||||
#if (defined(_KERNEL_MODE) || defined(_LOADER_MODE)) && !defined(_BOOT_MODE)
|
#if (defined(_KERNEL_MODE) || defined(_LOADER_MODE))
|
||||||
|
|
||||||
|
#ifndef _BOOT_MODE
|
||||||
|
|
||||||
FILE *stderr = NULL;
|
FILE *stderr = NULL;
|
||||||
|
|
||||||
@@ -75,8 +88,6 @@ fprintf(FILE *f, const char *format, ...)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if __GNUC__ >= 3
|
|
||||||
|
|
||||||
extern "C"
|
extern "C"
|
||||||
size_t
|
size_t
|
||||||
fwrite(const void *buffer, size_t size, size_t numItems, FILE *stream)
|
fwrite(const void *buffer, size_t size, size_t numItems, FILE *stream)
|
||||||
@@ -110,7 +121,7 @@ printf(const char *format, ...)
|
|||||||
dprintf("printf(`%s',...)\n", format);
|
dprintf("printf(`%s',...)\n", format);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#endif
|
#endif // #ifndef _LOADER_MODE
|
||||||
|
|
||||||
extern "C"
|
extern "C"
|
||||||
int
|
int
|
||||||
@@ -119,10 +130,9 @@ puts(const char *string)
|
|||||||
return fputs(string, NULL);
|
return fputs(string, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif // #ifndef _BOOT_MODE
|
||||||
|
|
||||||
#endif // __GNUC__ >= 3
|
#if __GNUC__ >= 4
|
||||||
|
|
||||||
#if __GNUC__ >= 4 && !defined(USING_LIBGCC)
|
|
||||||
|
|
||||||
extern "C"
|
extern "C"
|
||||||
void
|
void
|
||||||
@@ -248,6 +258,8 @@ abort()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef _BOOT_MODE
|
||||||
|
|
||||||
extern "C"
|
extern "C"
|
||||||
void
|
void
|
||||||
debugger(const char *message)
|
debugger(const char *message)
|
||||||
@@ -255,7 +267,9 @@ debugger(const char *message)
|
|||||||
kernel_debugger(message);
|
kernel_debugger(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // _#if KERNEL_MODE
|
#endif // #ifndef _BOOT_MODE
|
||||||
|
|
||||||
|
#endif // #if (defined(_KERNEL_MODE) || defined(_LOADER_MODE))
|
||||||
|
|
||||||
|
|
||||||
extern "C"
|
extern "C"
|
||||||
|
|||||||
Reference in New Issue
Block a user