From fe4cf8d6fe712066634b6bb3b5753bc6a11acafb Mon Sep 17 00:00:00 2001
From: Jonathan Schleifer <js@webkeks.org>
Date: Sun, 12 Jan 2014 17:03:34 +0100
Subject: [PATCH 5/6] Add dummy atexit() to kernel and bootloader.
Clang registers destructors of global objects using atexit(), therefore
a dummy is needed.
---
src/system/boot/loader/main.cpp | 11 +++++++++++
src/system/kernel/main.cpp | 10 ++++++++++
2 files changed, 21 insertions(+)
diff --git a/src/system/boot/loader/main.cpp b/src/system/boot/loader/main.cpp
index c0b8f31..4f9556d 100644
a
|
b
|
out:
|
150 | 150 | heap_release(args); |
151 | 151 | return 0; |
152 | 152 | } |
| 153 | |
| 154 | |
| 155 | /* |
| 156 | * Dummy function, as Clang (unlike GCC) correctly calls dtors of global |
| 157 | * objects using atexit(). |
| 158 | */ |
| 159 | extern "C" int |
| 160 | atexit(void (*func)(void)) |
| 161 | { |
| 162 | return 0; |
| 163 | } |
diff --git a/src/system/kernel/main.cpp b/src/system/kernel/main.cpp
index ef34cfe..63a30db 100644
a
|
b
|
main2(void *unused)
|
368 | 368 | return 0; |
369 | 369 | } |
370 | 370 | |
| 371 | |
| 372 | /* |
| 373 | * Dummy function, as Clang (unlike GCC) correctly calls dtors of global |
| 374 | * objects using atexit(). |
| 375 | */ |
| 376 | extern "C" int |
| 377 | atexit(void (*func)(void)) |
| 378 | { |
| 379 | return 0; |
| 380 | } |