From: Tu Dinh Ngoc Date: Mon, 19 Dec 2022 22:37:51 +0000 (+0100) Subject: patches: Remove hash templates for `pthread_t` X-Git-Tag: RELEASE-0.12.0^0 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=dae1867bc62ea0e9b4e343972df98f9a510f287c;p=unikraft%2Flibs%2Flibcxx.git patches: Remove hash templates for `pthread_t` Musl defines `pthread_t` as `unsigned long`. This type already has a hash template, causing a redefinition error on builds with C++ atomics/threads enabled. Remove the offending patch. Signed-off-by: Tu Dinh Ngoc Reviewed-by: Radu Nichita Approved-by: Razvan Deaconescu Tested-by: Unikraft CI GitHub-Closes: #26 --- diff --git a/patches/0003-Add-hashtable-template-for-pthreads.patch b/patches/0003-Add-hashtable-template-for-pthreads.patch deleted file mode 100644 index 6a99062..0000000 --- a/patches/0003-Add-hashtable-template-for-pthreads.patch +++ /dev/null @@ -1,51 +0,0 @@ -From 215ae6f079c9d3e1ed21fc549e41ef5d6d796d71 Mon Sep 17 00:00:00 2001 -From: Teodora Serbanescu -Date: Thu, 18 Apr 2019 15:15:33 +0300 -Subject: [PATCH] Add hashtable template for pthreads - -Signed-off-by: Teodora Serbanescu ---- - include/utility | 20 +++++++++++++++++++++ - 1 file changed, 20 insertions(+) - -diff --git a/include/utility b/include/utility -index ed9bf03..c5b74fd 100644 ---- a/include/utility -+++ b/include/utility -@@ -205,6 +205,10 @@ template - #include - #include <__debug> - -+#if defined(_LIBCPP_HAS_THREAD_API_PTHREAD) -+#include -+#endif -+ - #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) - #pragma GCC system_header - #endif -@@ -1473,6 +1478,22 @@ struct _LIBCPP_TEMPLATE_VIS hash - } - }; - -+#if defined(_LIBCPP_HAS_THREAD_API_PTHREAD) -+template <> -+struct _LIBCPP_TEMPLATE_VIS hash -+ : public __scalar_hash -+{ -+ _LIBCPP_INLINE_VISIBILITY -+ size_t operator()(pthread_t __v) const _NOEXCEPT -+ { -+ // -0.0 and 0.0 should return same hash -+ if (__v == 0) -+ return 0; -+ return __scalar_hash::operator()((size_t) __v.p); -+ } -+}; -+#endif -+ - template <> - struct _LIBCPP_TEMPLATE_VIS hash - : public __scalar_hash --- -2.11.0 -