Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Revert "To be investigated: restore cxa_pure_virtual"
This reverts commit 68651bc.
  • Loading branch information
facchinm committed Dec 19, 2024
commit a1faa7fad25f7b8ca3b0adfc0f7afbe71d39531f
24 changes: 24 additions & 0 deletions cores/arduino/abi.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
* Copyright (c) 2024 Arduino SA
*
* SPDX-License-Identifier: Apache-2.0
*/

#include <stdlib.h>

extern "C" void __cxa_pure_virtual(void) __attribute__ ((__noreturn__));
extern "C" void __cxa_deleted_virtual(void) __attribute__ ((__noreturn__));

namespace std {
[[gnu::weak, noreturn]] void terminate() {
abort();
}
}

void __cxa_pure_virtual(void) {
std::terminate();
}

void __cxa_deleted_virtual(void) {
std::terminate();
}
2 changes: 0 additions & 2 deletions cores/arduino/new.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@

#include "new.h"

extern "C" void __cxa_pure_virtual() {}

// The C++ spec dictates that allocation failure should cause the
// (non-nothrow version of the) operator new to throw an exception.
// Since we expect to have exceptions disabled, it would be more
Expand Down