serenity/Ports/mold/patches/0001-Tell-TBB-that-SerenityOS-does-not-support-weak-symbo.patch
Andrew Kaster 32c9be30dc Ports/mold: Update to 1.5.1 and use CMake instead of Makefile
Per the release notes for 1.5.0, the CMake build is preferred going
forward. This lets us drop some Makefile patches and pass them as CMake
options instead, with the exception of disabling mold-wrapper.so.
2022-10-03 10:01:06 +01:00

27 lines
1.4 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Andrew Kaster <akaster@serenityos.org>
Date: Tue, 11 Jan 2022 01:04:05 -0700
Subject: [PATCH] Tell TBB that SerenityOS does not support weak symbols
Something about the Clang toolchain configuration causes undefined weak
references to scalable_malloc to remain in the mold executable even
though there's no chance we'll be loading the tbbmalloc library at
runtime. So, just lie to TBB that we don't support weak symbols.
---
third-party/tbb/include/oneapi/tbb/detail/_config.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/third-party/tbb/include/oneapi/tbb/detail/_config.h b/third-party/tbb/include/oneapi/tbb/detail/_config.h
index fa287cd2968ec7f336b754ee450a8da12f4ded23..b93878aa6369a8ffe386da4dd822ab5bd1fe3c3b 100644
--- a/third-party/tbb/include/oneapi/tbb/detail/_config.h
+++ b/third-party/tbb/include/oneapi/tbb/detail/_config.h
@@ -195,7 +195,7 @@
/** __TBB_WEAK_SYMBOLS_PRESENT denotes that the system supports the weak symbol mechanism **/
#ifndef __TBB_WEAK_SYMBOLS_PRESENT
- #define __TBB_WEAK_SYMBOLS_PRESENT ( !_WIN32 && !__APPLE__ && !__sun && (__TBB_GCC_VERSION >= 40000 || __INTEL_COMPILER ) )
+ #define __TBB_WEAK_SYMBOLS_PRESENT ( !_WIN32 && !__APPLE__ && !__sun && !__serenity__ && (__TBB_GCC_VERSION >= 40000 || __INTEL_COMPILER ) )
#endif
/** Presence of compiler features **/