From 47ce0408d5761543a925084f9fa24552868fa332 Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Sat, 15 Jun 2019 12:47:11 -0500 Subject: [PATCH] [ox/std] Add substitutes file with missing __cxa_pure_virtual handler --- deps/ox/src/ox/std/CMakeLists.txt | 1 + deps/ox/src/ox/std/substitutes.cpp | 29 +++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 deps/ox/src/ox/std/substitutes.cpp diff --git a/deps/ox/src/ox/std/CMakeLists.txt b/deps/ox/src/ox/std/CMakeLists.txt index e83e2ca2..ed77a94d 100644 --- a/deps/ox/src/ox/std/CMakeLists.txt +++ b/deps/ox/src/ox/std/CMakeLists.txt @@ -6,6 +6,7 @@ add_library( memops.cpp new.cpp random.cpp + substitutes.cpp stacktrace.cpp strops.cpp trace.cpp diff --git a/deps/ox/src/ox/std/substitutes.cpp b/deps/ox/src/ox/std/substitutes.cpp new file mode 100644 index 00000000..59a7a300 --- /dev/null +++ b/deps/ox/src/ox/std/substitutes.cpp @@ -0,0 +1,29 @@ +/* + * Copyright 2015 - 2018 gtalent2@gmail.com + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef OX_USE_STDLIB + +#include +#include + +// weak link panic to ensure that it exists, but allow it to be overriden by +// platform specific code +void __attribute__((weak)) panic(const char *msg) { + printf("Unexpected state:\n%s", msg); + std::abort(); +} + +extern "C" { + +void __cxa_pure_virtual() { + panic("Missing virtual function"); +} + +} + +#endif