diff --git a/offload/DeviceRTL/src/Debug.cpp b/offload/DeviceRTL/src/Debug.cpp index 31cd54e3de35ce..4e16591cc6c510 100644 --- a/offload/DeviceRTL/src/Debug.cpp +++ b/offload/DeviceRTL/src/Debug.cpp @@ -26,8 +26,8 @@ using namespace ompx; extern "C" { void __assert_assume(bool condition) { __builtin_assume(condition); } -void __assert_fail(const char *expr, const char *file, unsigned line, - const char *function) { +[[gnu::weak]] void __assert_fail(const char *expr, const char *file, + unsigned line, const char *function) { __assert_fail_internal(expr, nullptr, file, line, function); } void __assert_fail_internal(const char *expr, const char *msg, const char *file, diff --git a/offload/DeviceRTL/src/LibC.cpp b/offload/DeviceRTL/src/LibC.cpp index e587c3057f5ba5..4bca5d29643fe9 100644 --- a/offload/DeviceRTL/src/LibC.cpp +++ b/offload/DeviceRTL/src/LibC.cpp @@ -49,7 +49,7 @@ int32_t omp_vprintf(const char *Format, void *Arguments, uint32_t) { extern "C" { -int memcmp(const void *lhs, const void *rhs, size_t count) { +[[gnu::weak]] int memcmp(const void *lhs, const void *rhs, size_t count) { auto *L = reinterpret_cast(lhs); auto *R = reinterpret_cast(rhs); @@ -60,7 +60,7 @@ int memcmp(const void *lhs, const void *rhs, size_t count) { return 0; } -void memset(void *dst, int C, size_t count) { +[[gnu::weak]] void memset(void *dst, int C, size_t count) { auto *dstc = reinterpret_cast(dst); for (size_t I = 0; I < count; ++I) dstc[I] = C;