base: fix cxx library compile errors with GCC 8.3.0

Fixes #3322
This commit is contained in:
Christian Prochaska 2019-05-07 13:21:23 +02:00 committed by Christian Helmuth
parent 47a2ad604c
commit 96627df4d4
5 changed files with 23 additions and 13 deletions

View File

@ -582,6 +582,7 @@ _ZThn8_N6Genode23Alarm_timeout_scheduler14handle_timeoutENS_8DurationE T
_ZThn8_N6Genode23Alarm_timeout_schedulerD0Ev T
_ZThn8_N6Genode23Alarm_timeout_schedulerD1Ev T
_ZdlPv W
_ZdlPvm W
_ZdlPvPN6Genode11DeallocatorE T
_ZdlPvPN6Genode9AllocatorE W
_ZdlPvRN6Genode11DeallocatorE T

View File

@ -14,6 +14,7 @@
/* libsupc++ includes */
#include <cxxabi.h>
#include <exception>
/* Genode includes */
#include <base/log.h>

View File

@ -64,7 +64,7 @@ void Genode::init_cxx_heap(Env &env)
typedef unsigned long Block_header;
extern "C" void *malloc(unsigned size)
extern "C" void *malloc(size_t size)
{
/* enforce size to be a multiple of 4 bytes */
size = (size + 3) & ~3;
@ -85,7 +85,7 @@ extern "C" void *malloc(unsigned size)
}
extern "C" void *calloc(unsigned nmemb, unsigned size)
extern "C" void *calloc(size_t nmemb, size_t size)
{
void *addr = malloc(nmemb*size);
Genode::memset(addr, 0, nmemb*size);

View File

@ -13,10 +13,12 @@
/* libsupc++ includes */
#include <cxxabi.h>
#include <exception>
/* Genode includes */
#include <base/env.h>
#include <base/log.h>
#include <base/sleep.h>
#include <base/stdint.h>
#include <base/thread.h>
#include <util/string.h>
@ -106,7 +108,7 @@ extern "C" __attribute__((weak)) void raise()
** Support for libsupc++ **
***************************/
extern "C" void *abort(void)
extern "C" void abort(void)
{
Genode::Thread const * const myself = Genode::Thread::myself();
Genode::Thread::Name name = "unknown";
@ -120,22 +122,22 @@ extern "C" void *abort(void)
if (name != "main")
genode_exit(1);
Genode::sleep_forever();
}
extern "C" int fputc(int, void*) {
return 0;
}
extern "C" void *fputc(void) {
return 0;
}
extern "C" void *fputs(const char *s, void *) {
extern "C" int fputs(const char *s, void *) {
Genode::warning("C++ runtime: ", s);
return 0;
}
extern "C" void *fwrite(void) {
extern "C" size_t fwrite(const void*, size_t, size_t, void*) {
return 0;
}
@ -147,14 +149,14 @@ extern "C" int memcmp(const void *p0, const void *p1, size_t size)
extern "C" __attribute__((weak))
void *memcpy(void *dst, void *src, size_t n)
void *memcpy(void *dst, const void *src, size_t n)
{
return Genode::memcpy(dst, src, n);
}
extern "C" __attribute__((weak))
void *memmove(void *dst, void *src, size_t n)
void *memmove(void *dst, const void *src, size_t n)
{
return Genode::memmove(dst, src, n);
}
@ -180,7 +182,7 @@ struct FILE;
FILE *__stderrp;
extern "C" void *strcat(void)
extern "C" char *strcat(char *, const char *)
{
Genode::warning("strcat - not yet implemented");
return 0;

View File

@ -72,3 +72,9 @@ __attribute__((weak)) void operator delete (void *)
Genode::error("cxx: operator delete (void *) called - not implemented. "
"A working implementation is available in the 'stdcxx' library.");
}
__attribute__((weak)) void operator delete (void *, unsigned long)
{
Genode::error("cxx: operator delete (void *, unsigned long) called - not implemented. "
"A working implementation is available in the 'stdcxx' library.");
}