From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Andrew Kaster <akaster@serenityos.org>
Date: Sun, 23 Jan 2022 17:50:52 -0700
Subject: [PATCH] Tell TBB that Minerva libraries are named like BSD ones
We won't be loading these libraries when building TBB as a static
library for mold, but the OS detection logic still needs updated.
---
third-party/tbb/src/tbb/allocator.cpp | 2 +-
third-party/tbb/src/tbb/rml_tbb.cpp | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/third-party/tbb/src/tbb/allocator.cpp b/third-party/tbb/src/tbb/allocator.cpp
index 888f43fd3302d6fd1b17130ed6cfaea06b8608d9..7d77bc1bf8412c3b52ff77c7a0c42442aa4d9df2 100644
--- a/third-party/tbb/src/tbb/allocator.cpp
+++ b/third-party/tbb/src/tbb/allocator.cpp
@@ -119,7 +119,7 @@ static const dynamic_link_descriptor MallocLinkTable[] = {
#define MALLOCLIB_NAME "tbbmalloc" DEBUG_SUFFIX ".dll"
#elif __APPLE__
#define MALLOCLIB_NAME "libtbbmalloc" DEBUG_SUFFIX ".2.dylib"
-#elif __FreeBSD__ || __NetBSD__ || __OpenBSD__ || __sun || _AIX || __ANDROID__
+#elif __FreeBSD__ || __NetBSD__ || __OpenBSD__ || __sun || _AIX || __ANDROID__ || __minerva__
#define MALLOCLIB_NAME "libtbbmalloc" DEBUG_SUFFIX ".so"
#elif __unix__ // Note that order of these #elif's is important!
#define MALLOCLIB_NAME "libtbbmalloc" DEBUG_SUFFIX ".so.2"
diff --git a/third-party/tbb/src/tbb/rml_tbb.cpp b/third-party/tbb/src/tbb/rml_tbb.cpp
index d1cd285c1ae4e98488c4ae07cdebe6749d405945..4d4507c3c1c54a97d6a56e0342959fec295140fc 100644
--- a/third-party/tbb/src/tbb/rml_tbb.cpp
+++ b/third-party/tbb/src/tbb/rml_tbb.cpp
@@ -50,7 +50,7 @@ namespace rml {
#define RML_SERVER_NAME "irml" DEBUG_SUFFIX ".dll"
#elif __APPLE__
#define RML_SERVER_NAME "libirml" DEBUG_SUFFIX ".1.dylib"
-#elif __FreeBSD__ || __NetBSD__ || __OpenBSD__ || __sun || _AIX
+#elif __FreeBSD__ || __NetBSD__ || __OpenBSD__ || __sun || _AIX || __minerva__
#define RML_SERVER_NAME "libirml" DEBUG_SUFFIX ".so"
#elif __unix__
#define RML_SERVER_NAME "libirml" DEBUG_SUFFIX ".so.1"