]> xenbits.xensource.com Git - unikraft/libs/libcxx.git/commitdiff
patches: Remove hash templates for `pthread_t` RELEASE-0.12.0 RELEASE-0.13.0 RELEASE-0.13.1
authorTu Dinh Ngoc <dinhngoc.tu@irit.fr>
Mon, 19 Dec 2022 22:37:51 +0000 (23:37 +0100)
committerUnikraft <monkey@unikraft.io>
Tue, 31 Jan 2023 20:40:14 +0000 (20:40 +0000)
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 <dinhngoc.tu@irit.fr>
Reviewed-by: Radu Nichita <radunichita99@gmail.com>
Approved-by: Razvan Deaconescu <razvand@unikraft.io>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Closes: #26

patches/0003-Add-hashtable-template-for-pthreads.patch [deleted file]

diff --git a/patches/0003-Add-hashtable-template-for-pthreads.patch b/patches/0003-Add-hashtable-template-for-pthreads.patch
deleted file mode 100644 (file)
index 6a99062..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-From 215ae6f079c9d3e1ed21fc549e41ef5d6d796d71 Mon Sep 17 00:00:00 2001
-From: Teodora Serbanescu <teo.serbanescu16@gmail.com>
-Date: Thu, 18 Apr 2019 15:15:33 +0300
-Subject: [PATCH] Add hashtable template for pthreads
-
-Signed-off-by: Teodora Serbanescu <teo.serbanescu16@gmail.com>
----
- 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 <size_t I>
- #include <cstdint>
- #include <__debug>
-
-+#if defined(_LIBCPP_HAS_THREAD_API_PTHREAD)
-+#include <pthread.h>
-+#endif
-+
- #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
- #pragma GCC system_header
- #endif
-@@ -1473,6 +1478,22 @@ struct _LIBCPP_TEMPLATE_VIS hash<double>
-     }
- };
-+#if defined(_LIBCPP_HAS_THREAD_API_PTHREAD)
-+template <>
-+struct _LIBCPP_TEMPLATE_VIS hash<pthread_t>
-+    : public __scalar_hash<size_t>
-+{
-+    _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<size_t>::operator()((size_t) __v.p);
-+    }
-+};
-+#endif
-+
- template <>
- struct _LIBCPP_TEMPLATE_VIS hash<long double>
-     : public __scalar_hash<long double>
--- 
-2.11.0
-