added my Recipes
This commit is contained in:
@@ -0,0 +1,448 @@
|
||||
From 3690dc5f567906c45f057509305fbaa021b33adb Mon Sep 17 00:00:00 2001
|
||||
From: Yichao Yu <yyc1992@gmail.com>
|
||||
Date: Tue, 15 Sep 2020 12:35:46 -0700
|
||||
Subject: [PATCH] Fix compilation with -fno-common.
|
||||
|
||||
Making all other archs consistent with IA64 which should not have this problem.
|
||||
Also move the FIXME to the correct place.
|
||||
|
||||
Also add some minimum comments about this...
|
||||
|
||||
Upstream-Status: Backport [https://github.com/libunwind/libunwind/pull/166/commits/29e17d8d2ccbca07c423e3089a6d5ae8a1c9cb6e]
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
---
|
||||
src/third_party/unwind/dist/src/aarch64/Ginit.c | 15 +++++++--------
|
||||
src/third_party/unwind/dist/src/arm/Ginit.c | 15 +++++++--------
|
||||
.../src/coredump/_UPT_get_dyn_info_list_addr.c | 5 +++++
|
||||
src/third_party/unwind/dist/src/hppa/Ginit.c | 15 +++++++--------
|
||||
src/third_party/unwind/dist/src/ia64/Ginit.c | 1 +
|
||||
.../unwind/dist/src/mi/Gfind_dynamic_proc_info.c | 1 +
|
||||
src/third_party/unwind/dist/src/mips/Ginit.c | 15 +++++++--------
|
||||
src/third_party/unwind/dist/src/ppc32/Ginit.c | 11 +++++++----
|
||||
src/third_party/unwind/dist/src/ppc64/Ginit.c | 11 +++++++----
|
||||
.../dist/src/ptrace/_UPT_get_dyn_info_list_addr.c | 5 +++++
|
||||
src/third_party/unwind/dist/src/s390x/Ginit.c | 15 +++++++--------
|
||||
src/third_party/unwind/dist/src/sh/Ginit.c | 15 +++++++--------
|
||||
src/third_party/unwind/dist/src/tilegx/Ginit.c | 15 +++++++--------
|
||||
src/third_party/unwind/dist/src/x86/Ginit.c | 15 +++++++--------
|
||||
src/third_party/unwind/dist/src/x86_64/Ginit.c | 15 +++++++--------
|
||||
15 files changed, 89 insertions(+), 80 deletions(-)
|
||||
|
||||
diff --git a/src/third_party/unwind/dist/src/aarch64/Ginit.c b/src/third_party/unwind/dist/src/aarch64/Ginit.c
|
||||
index dec235c829..35389762f2 100644
|
||||
--- a/src/third_party/unwind/dist/src/aarch64/Ginit.c
|
||||
+++ b/src/third_party/unwind/dist/src/aarch64/Ginit.c
|
||||
@@ -61,13 +61,6 @@ tdep_uc_addr (unw_tdep_context_t *uc, int reg)
|
||||
|
||||
# endif /* UNW_LOCAL_ONLY */
|
||||
|
||||
-HIDDEN unw_dyn_info_list_t _U_dyn_info_list;
|
||||
-
|
||||
-/* XXX fix me: there is currently no way to locate the dyn-info list
|
||||
- by a remote unwinder. On ia64, this is done via a special
|
||||
- unwind-table entry. Perhaps something similar can be done with
|
||||
- DWARF2 unwind info. */
|
||||
-
|
||||
static void
|
||||
put_unwind_info (unw_addr_space_t as, unw_proc_info_t *proc_info, void *arg)
|
||||
{
|
||||
@@ -78,7 +71,13 @@ static int
|
||||
get_dyn_info_list_addr (unw_addr_space_t as, unw_word_t *dyn_info_list_addr,
|
||||
void *arg)
|
||||
{
|
||||
- *dyn_info_list_addr = (unw_word_t) &_U_dyn_info_list;
|
||||
+#ifndef UNW_LOCAL_ONLY
|
||||
+# pragma weak _U_dyn_info_list_addr
|
||||
+ if (!_U_dyn_info_list_addr)
|
||||
+ return -UNW_ENOINFO;
|
||||
+#endif
|
||||
+ // Access the `_U_dyn_info_list` from `LOCAL_ONLY` library, i.e. libunwind.so.
|
||||
+ *dyn_info_list_addr = _U_dyn_info_list_addr ();
|
||||
return 0;
|
||||
}
|
||||
|
||||
diff --git a/src/third_party/unwind/dist/src/arm/Ginit.c b/src/third_party/unwind/dist/src/arm/Ginit.c
|
||||
index 2720d063a2..0bac0d72da 100644
|
||||
--- a/src/third_party/unwind/dist/src/arm/Ginit.c
|
||||
+++ b/src/third_party/unwind/dist/src/arm/Ginit.c
|
||||
@@ -57,18 +57,17 @@ tdep_uc_addr (unw_tdep_context_t *uc, int reg)
|
||||
|
||||
# endif /* UNW_LOCAL_ONLY */
|
||||
|
||||
-HIDDEN unw_dyn_info_list_t _U_dyn_info_list;
|
||||
-
|
||||
-/* XXX fix me: there is currently no way to locate the dyn-info list
|
||||
- by a remote unwinder. On ia64, this is done via a special
|
||||
- unwind-table entry. Perhaps something similar can be done with
|
||||
- DWARF2 unwind info. */
|
||||
-
|
||||
static int
|
||||
get_dyn_info_list_addr (unw_addr_space_t as, unw_word_t *dyn_info_list_addr,
|
||||
void *arg)
|
||||
{
|
||||
- *dyn_info_list_addr = (unw_word_t) &_U_dyn_info_list;
|
||||
+#ifndef UNW_LOCAL_ONLY
|
||||
+# pragma weak _U_dyn_info_list_addr
|
||||
+ if (!_U_dyn_info_list_addr)
|
||||
+ return -UNW_ENOINFO;
|
||||
+#endif
|
||||
+ // Access the `_U_dyn_info_list` from `LOCAL_ONLY` library, i.e. libunwind.so.
|
||||
+ *dyn_info_list_addr = _U_dyn_info_list_addr ();
|
||||
return 0;
|
||||
}
|
||||
|
||||
diff --git a/src/third_party/unwind/dist/src/coredump/_UPT_get_dyn_info_list_addr.c b/src/third_party/unwind/dist/src/coredump/_UPT_get_dyn_info_list_addr.c
|
||||
index 0d11905566..739ed0569b 100644
|
||||
--- a/src/third_party/unwind/dist/src/coredump/_UPT_get_dyn_info_list_addr.c
|
||||
+++ b/src/third_party/unwind/dist/src/coredump/_UPT_get_dyn_info_list_addr.c
|
||||
@@ -74,6 +74,11 @@ get_list_addr (unw_addr_space_t as, unw_word_t *dil_addr, void *arg,
|
||||
|
||||
#else
|
||||
|
||||
+/* XXX fix me: there is currently no way to locate the dyn-info list
|
||||
+ by a remote unwinder. On ia64, this is done via a special
|
||||
+ unwind-table entry. Perhaps something similar can be done with
|
||||
+ DWARF2 unwind info. */
|
||||
+
|
||||
static inline int
|
||||
get_list_addr (unw_addr_space_t as, unw_word_t *dil_addr, void *arg,
|
||||
int *countp)
|
||||
diff --git a/src/third_party/unwind/dist/src/hppa/Ginit.c b/src/third_party/unwind/dist/src/hppa/Ginit.c
|
||||
index 461e4b93da..265455a68c 100644
|
||||
--- a/src/third_party/unwind/dist/src/hppa/Ginit.c
|
||||
+++ b/src/third_party/unwind/dist/src/hppa/Ginit.c
|
||||
@@ -64,13 +64,6 @@ _Uhppa_uc_addr (ucontext_t *uc, int reg)
|
||||
|
||||
# endif /* UNW_LOCAL_ONLY */
|
||||
|
||||
-HIDDEN unw_dyn_info_list_t _U_dyn_info_list;
|
||||
-
|
||||
-/* XXX fix me: there is currently no way to locate the dyn-info list
|
||||
- by a remote unwinder. On ia64, this is done via a special
|
||||
- unwind-table entry. Perhaps something similar can be done with
|
||||
- DWARF2 unwind info. */
|
||||
-
|
||||
static void
|
||||
put_unwind_info (unw_addr_space_t as, unw_proc_info_t *proc_info, void *arg)
|
||||
{
|
||||
@@ -81,7 +74,13 @@ static int
|
||||
get_dyn_info_list_addr (unw_addr_space_t as, unw_word_t *dyn_info_list_addr,
|
||||
void *arg)
|
||||
{
|
||||
- *dyn_info_list_addr = (unw_word_t) &_U_dyn_info_list;
|
||||
+#ifndef UNW_LOCAL_ONLY
|
||||
+# pragma weak _U_dyn_info_list_addr
|
||||
+ if (!_U_dyn_info_list_addr)
|
||||
+ return -UNW_ENOINFO;
|
||||
+#endif
|
||||
+ // Access the `_U_dyn_info_list` from `LOCAL_ONLY` library, i.e. libunwind.so.
|
||||
+ *dyn_info_list_addr = _U_dyn_info_list_addr ();
|
||||
return 0;
|
||||
}
|
||||
|
||||
diff --git a/src/third_party/unwind/dist/src/ia64/Ginit.c b/src/third_party/unwind/dist/src/ia64/Ginit.c
|
||||
index b09a2ad57c..8601bb3ca8 100644
|
||||
--- a/src/third_party/unwind/dist/src/ia64/Ginit.c
|
||||
+++ b/src/third_party/unwind/dist/src/ia64/Ginit.c
|
||||
@@ -68,6 +68,7 @@ get_dyn_info_list_addr (unw_addr_space_t as, unw_word_t *dyn_info_list_addr,
|
||||
if (!_U_dyn_info_list_addr)
|
||||
return -UNW_ENOINFO;
|
||||
#endif
|
||||
+ // Access the `_U_dyn_info_list` from `LOCAL_ONLY` library, i.e. libunwind.so.
|
||||
*dyn_info_list_addr = _U_dyn_info_list_addr ();
|
||||
return 0;
|
||||
}
|
||||
diff --git a/src/third_party/unwind/dist/src/mi/Gfind_dynamic_proc_info.c b/src/third_party/unwind/dist/src/mi/Gfind_dynamic_proc_info.c
|
||||
index 98d3501286..2e7c62e5e8 100644
|
||||
--- a/src/third_party/unwind/dist/src/mi/Gfind_dynamic_proc_info.c
|
||||
+++ b/src/third_party/unwind/dist/src/mi/Gfind_dynamic_proc_info.c
|
||||
@@ -49,6 +49,7 @@ local_find_proc_info (unw_addr_space_t as, unw_word_t ip, unw_proc_info_t *pi,
|
||||
return -UNW_ENOINFO;
|
||||
#endif
|
||||
|
||||
+ // Access the `_U_dyn_info_list` from `LOCAL_ONLY` library, i.e. libunwind.so.
|
||||
list = (unw_dyn_info_list_t *) (uintptr_t) _U_dyn_info_list_addr ();
|
||||
for (di = list->first; di; di = di->next)
|
||||
if (ip >= di->start_ip && ip < di->end_ip)
|
||||
diff --git a/src/third_party/unwind/dist/src/mips/Ginit.c b/src/third_party/unwind/dist/src/mips/Ginit.c
|
||||
index 3df170c754..bf7a8f5a8f 100644
|
||||
--- a/src/third_party/unwind/dist/src/mips/Ginit.c
|
||||
+++ b/src/third_party/unwind/dist/src/mips/Ginit.c
|
||||
@@ -69,13 +69,6 @@ tdep_uc_addr (ucontext_t *uc, int reg)
|
||||
|
||||
# endif /* UNW_LOCAL_ONLY */
|
||||
|
||||
-HIDDEN unw_dyn_info_list_t _U_dyn_info_list;
|
||||
-
|
||||
-/* XXX fix me: there is currently no way to locate the dyn-info list
|
||||
- by a remote unwinder. On ia64, this is done via a special
|
||||
- unwind-table entry. Perhaps something similar can be done with
|
||||
- DWARF2 unwind info. */
|
||||
-
|
||||
static void
|
||||
put_unwind_info (unw_addr_space_t as, unw_proc_info_t *proc_info, void *arg)
|
||||
{
|
||||
@@ -86,7 +79,13 @@ static int
|
||||
get_dyn_info_list_addr (unw_addr_space_t as, unw_word_t *dyn_info_list_addr,
|
||||
void *arg)
|
||||
{
|
||||
- *dyn_info_list_addr = (unw_word_t) (intptr_t) &_U_dyn_info_list;
|
||||
+#ifndef UNW_LOCAL_ONLY
|
||||
+# pragma weak _U_dyn_info_list_addr
|
||||
+ if (!_U_dyn_info_list_addr)
|
||||
+ return -UNW_ENOINFO;
|
||||
+#endif
|
||||
+ // Access the `_U_dyn_info_list` from `LOCAL_ONLY` library, i.e. libunwind.so.
|
||||
+ *dyn_info_list_addr = _U_dyn_info_list_addr ();
|
||||
return 0;
|
||||
}
|
||||
|
||||
diff --git a/src/third_party/unwind/dist/src/ppc32/Ginit.c b/src/third_party/unwind/dist/src/ppc32/Ginit.c
|
||||
index ba302448a3..7b45455807 100644
|
||||
--- a/src/third_party/unwind/dist/src/ppc32/Ginit.c
|
||||
+++ b/src/third_party/unwind/dist/src/ppc32/Ginit.c
|
||||
@@ -91,9 +91,6 @@ tdep_uc_addr (ucontext_t *uc, int reg)
|
||||
|
||||
# endif /* UNW_LOCAL_ONLY */
|
||||
|
||||
-HIDDEN unw_dyn_info_list_t _U_dyn_info_list;
|
||||
-
|
||||
-
|
||||
static void
|
||||
put_unwind_info (unw_addr_space_t as, unw_proc_info_t *proc_info, void *arg)
|
||||
{
|
||||
@@ -104,7 +101,13 @@ static int
|
||||
get_dyn_info_list_addr (unw_addr_space_t as, unw_word_t *dyn_info_list_addr,
|
||||
void *arg)
|
||||
{
|
||||
- *dyn_info_list_addr = (unw_word_t) &_U_dyn_info_list;
|
||||
+#ifndef UNW_LOCAL_ONLY
|
||||
+# pragma weak _U_dyn_info_list_addr
|
||||
+ if (!_U_dyn_info_list_addr)
|
||||
+ return -UNW_ENOINFO;
|
||||
+#endif
|
||||
+ // Access the `_U_dyn_info_list` from `LOCAL_ONLY` library, i.e. libunwind.so.
|
||||
+ *dyn_info_list_addr = _U_dyn_info_list_addr ();
|
||||
return 0;
|
||||
}
|
||||
|
||||
diff --git a/src/third_party/unwind/dist/src/ppc64/Ginit.c b/src/third_party/unwind/dist/src/ppc64/Ginit.c
|
||||
index 4c88cd6e77..7bfb395a79 100644
|
||||
--- a/src/third_party/unwind/dist/src/ppc64/Ginit.c
|
||||
+++ b/src/third_party/unwind/dist/src/ppc64/Ginit.c
|
||||
@@ -95,9 +95,6 @@ tdep_uc_addr (ucontext_t *uc, int reg)
|
||||
|
||||
# endif /* UNW_LOCAL_ONLY */
|
||||
|
||||
-HIDDEN unw_dyn_info_list_t _U_dyn_info_list;
|
||||
-
|
||||
-
|
||||
static void
|
||||
put_unwind_info (unw_addr_space_t as, unw_proc_info_t *proc_info, void *arg)
|
||||
{
|
||||
@@ -108,7 +105,13 @@ static int
|
||||
get_dyn_info_list_addr (unw_addr_space_t as, unw_word_t *dyn_info_list_addr,
|
||||
void *arg)
|
||||
{
|
||||
- *dyn_info_list_addr = (unw_word_t) &_U_dyn_info_list;
|
||||
+#ifndef UNW_LOCAL_ONLY
|
||||
+# pragma weak _U_dyn_info_list_addr
|
||||
+ if (!_U_dyn_info_list_addr)
|
||||
+ return -UNW_ENOINFO;
|
||||
+#endif
|
||||
+ // Access the `_U_dyn_info_list` from `LOCAL_ONLY` library, i.e. libunwind.so.
|
||||
+ *dyn_info_list_addr = _U_dyn_info_list_addr ();
|
||||
return 0;
|
||||
}
|
||||
|
||||
diff --git a/src/third_party/unwind/dist/src/ptrace/_UPT_get_dyn_info_list_addr.c b/src/third_party/unwind/dist/src/ptrace/_UPT_get_dyn_info_list_addr.c
|
||||
index cc5ed04418..16671d453e 100644
|
||||
--- a/src/third_party/unwind/dist/src/ptrace/_UPT_get_dyn_info_list_addr.c
|
||||
+++ b/src/third_party/unwind/dist/src/ptrace/_UPT_get_dyn_info_list_addr.c
|
||||
@@ -71,6 +71,11 @@ get_list_addr (unw_addr_space_t as, unw_word_t *dil_addr, void *arg,
|
||||
|
||||
#else
|
||||
|
||||
+/* XXX fix me: there is currently no way to locate the dyn-info list
|
||||
+ by a remote unwinder. On ia64, this is done via a special
|
||||
+ unwind-table entry. Perhaps something similar can be done with
|
||||
+ DWARF2 unwind info. */
|
||||
+
|
||||
static inline int
|
||||
get_list_addr (unw_addr_space_t as, unw_word_t *dil_addr, void *arg,
|
||||
int *countp)
|
||||
diff --git a/src/third_party/unwind/dist/src/s390x/Ginit.c b/src/third_party/unwind/dist/src/s390x/Ginit.c
|
||||
index f0886ac933..db01743c06 100644
|
||||
--- a/src/third_party/unwind/dist/src/s390x/Ginit.c
|
||||
+++ b/src/third_party/unwind/dist/src/s390x/Ginit.c
|
||||
@@ -50,8 +50,6 @@ static struct unw_addr_space local_addr_space;
|
||||
|
||||
unw_addr_space_t unw_local_addr_space = &local_addr_space;
|
||||
|
||||
-HIDDEN unw_dyn_info_list_t _U_dyn_info_list;
|
||||
-
|
||||
static inline void *
|
||||
uc_addr (ucontext_t *uc, int reg)
|
||||
{
|
||||
@@ -75,11 +73,6 @@ tdep_uc_addr (ucontext_t *uc, int reg)
|
||||
|
||||
# endif /* UNW_LOCAL_ONLY */
|
||||
|
||||
-/* XXX fix me: there is currently no way to locate the dyn-info list
|
||||
- by a remote unwinder. On ia64, this is done via a special
|
||||
- unwind-table entry. Perhaps something similar can be done with
|
||||
- DWARF2 unwind info. */
|
||||
-
|
||||
static void
|
||||
put_unwind_info (unw_addr_space_t as, unw_proc_info_t *proc_info, void *arg)
|
||||
{
|
||||
@@ -90,7 +83,13 @@ static int
|
||||
get_dyn_info_list_addr (unw_addr_space_t as, unw_word_t *dyn_info_list_addr,
|
||||
void *arg)
|
||||
{
|
||||
- *dyn_info_list_addr = (unw_word_t) &_U_dyn_info_list;
|
||||
+#ifndef UNW_LOCAL_ONLY
|
||||
+# pragma weak _U_dyn_info_list_addr
|
||||
+ if (!_U_dyn_info_list_addr)
|
||||
+ return -UNW_ENOINFO;
|
||||
+#endif
|
||||
+ // Access the `_U_dyn_info_list` from `LOCAL_ONLY` library, i.e. libunwind.so.
|
||||
+ *dyn_info_list_addr = _U_dyn_info_list_addr ();
|
||||
return 0;
|
||||
}
|
||||
|
||||
diff --git a/src/third_party/unwind/dist/src/sh/Ginit.c b/src/third_party/unwind/dist/src/sh/Ginit.c
|
||||
index 52988a721e..9fe96d2bd4 100644
|
||||
--- a/src/third_party/unwind/dist/src/sh/Ginit.c
|
||||
+++ b/src/third_party/unwind/dist/src/sh/Ginit.c
|
||||
@@ -58,13 +58,6 @@ tdep_uc_addr (ucontext_t *uc, int reg)
|
||||
|
||||
# endif /* UNW_LOCAL_ONLY */
|
||||
|
||||
-HIDDEN unw_dyn_info_list_t _U_dyn_info_list;
|
||||
-
|
||||
-/* XXX fix me: there is currently no way to locate the dyn-info list
|
||||
- by a remote unwinder. On ia64, this is done via a special
|
||||
- unwind-table entry. Perhaps something similar can be done with
|
||||
- DWARF2 unwind info. */
|
||||
-
|
||||
static void
|
||||
put_unwind_info (unw_addr_space_t as, unw_proc_info_t *proc_info, void *arg)
|
||||
{
|
||||
@@ -75,7 +68,13 @@ static int
|
||||
get_dyn_info_list_addr (unw_addr_space_t as, unw_word_t *dyn_info_list_addr,
|
||||
void *arg)
|
||||
{
|
||||
- *dyn_info_list_addr = (unw_word_t) &_U_dyn_info_list;
|
||||
+#ifndef UNW_LOCAL_ONLY
|
||||
+# pragma weak _U_dyn_info_list_addr
|
||||
+ if (!_U_dyn_info_list_addr)
|
||||
+ return -UNW_ENOINFO;
|
||||
+#endif
|
||||
+ // Access the `_U_dyn_info_list` from `LOCAL_ONLY` library, i.e. libunwind.so.
|
||||
+ *dyn_info_list_addr = _U_dyn_info_list_addr ();
|
||||
return 0;
|
||||
}
|
||||
|
||||
diff --git a/src/third_party/unwind/dist/src/tilegx/Ginit.c b/src/third_party/unwind/dist/src/tilegx/Ginit.c
|
||||
index 7564a558be..925e641324 100644
|
||||
--- a/src/third_party/unwind/dist/src/tilegx/Ginit.c
|
||||
+++ b/src/third_party/unwind/dist/src/tilegx/Ginit.c
|
||||
@@ -64,13 +64,6 @@ tdep_uc_addr (ucontext_t *uc, int reg)
|
||||
|
||||
# endif /* UNW_LOCAL_ONLY */
|
||||
|
||||
-HIDDEN unw_dyn_info_list_t _U_dyn_info_list;
|
||||
-
|
||||
-/* XXX fix me: there is currently no way to locate the dyn-info list
|
||||
- by a remote unwinder. On ia64, this is done via a special
|
||||
- unwind-table entry. Perhaps something similar can be done with
|
||||
- DWARF2 unwind info. */
|
||||
-
|
||||
static void
|
||||
put_unwind_info (unw_addr_space_t as, unw_proc_info_t *proc_info, void *arg)
|
||||
{
|
||||
@@ -81,7 +74,13 @@ static int
|
||||
get_dyn_info_list_addr (unw_addr_space_t as, unw_word_t *dyn_info_list_addr,
|
||||
void *arg)
|
||||
{
|
||||
- *dyn_info_list_addr = (unw_word_t) (intptr_t) &_U_dyn_info_list;
|
||||
+#ifndef UNW_LOCAL_ONLY
|
||||
+# pragma weak _U_dyn_info_list_addr
|
||||
+ if (!_U_dyn_info_list_addr)
|
||||
+ return -UNW_ENOINFO;
|
||||
+#endif
|
||||
+ // Access the `_U_dyn_info_list` from `LOCAL_ONLY` library, i.e. libunwind.so.
|
||||
+ *dyn_info_list_addr = _U_dyn_info_list_addr ();
|
||||
return 0;
|
||||
}
|
||||
|
||||
diff --git a/src/third_party/unwind/dist/src/x86/Ginit.c b/src/third_party/unwind/dist/src/x86/Ginit.c
|
||||
index f6b8dc27d4..3cec74a216 100644
|
||||
--- a/src/third_party/unwind/dist/src/x86/Ginit.c
|
||||
+++ b/src/third_party/unwind/dist/src/x86/Ginit.c
|
||||
@@ -54,13 +54,6 @@ tdep_uc_addr (ucontext_t *uc, int reg)
|
||||
|
||||
# endif /* UNW_LOCAL_ONLY */
|
||||
|
||||
-HIDDEN unw_dyn_info_list_t _U_dyn_info_list;
|
||||
-
|
||||
-/* XXX fix me: there is currently no way to locate the dyn-info list
|
||||
- by a remote unwinder. On ia64, this is done via a special
|
||||
- unwind-table entry. Perhaps something similar can be done with
|
||||
- DWARF2 unwind info. */
|
||||
-
|
||||
static void
|
||||
put_unwind_info (unw_addr_space_t as, unw_proc_info_t *proc_info, void *arg)
|
||||
{
|
||||
@@ -71,7 +64,13 @@ static int
|
||||
get_dyn_info_list_addr (unw_addr_space_t as, unw_word_t *dyn_info_list_addr,
|
||||
void *arg)
|
||||
{
|
||||
- *dyn_info_list_addr = (unw_word_t) &_U_dyn_info_list;
|
||||
+#ifndef UNW_LOCAL_ONLY
|
||||
+# pragma weak _U_dyn_info_list_addr
|
||||
+ if (!_U_dyn_info_list_addr)
|
||||
+ return -UNW_ENOINFO;
|
||||
+#endif
|
||||
+ // Access the `_U_dyn_info_list` from `LOCAL_ONLY` library, i.e. libunwind.so.
|
||||
+ *dyn_info_list_addr = _U_dyn_info_list_addr ();
|
||||
return 0;
|
||||
}
|
||||
|
||||
diff --git a/src/third_party/unwind/dist/src/x86_64/Ginit.c b/src/third_party/unwind/dist/src/x86_64/Ginit.c
|
||||
index 6161da6401..5c4e4269a6 100644
|
||||
--- a/src/third_party/unwind/dist/src/x86_64/Ginit.c
|
||||
+++ b/src/third_party/unwind/dist/src/x86_64/Ginit.c
|
||||
@@ -49,13 +49,6 @@ static struct unw_addr_space local_addr_space;
|
||||
|
||||
unw_addr_space_t unw_local_addr_space = &local_addr_space;
|
||||
|
||||
-HIDDEN unw_dyn_info_list_t _U_dyn_info_list;
|
||||
-
|
||||
-/* XXX fix me: there is currently no way to locate the dyn-info list
|
||||
- by a remote unwinder. On ia64, this is done via a special
|
||||
- unwind-table entry. Perhaps something similar can be done with
|
||||
- DWARF2 unwind info. */
|
||||
-
|
||||
static void
|
||||
put_unwind_info (unw_addr_space_t as, unw_proc_info_t *proc_info, void *arg)
|
||||
{
|
||||
@@ -66,7 +59,13 @@ static int
|
||||
get_dyn_info_list_addr (unw_addr_space_t as, unw_word_t *dyn_info_list_addr,
|
||||
void *arg)
|
||||
{
|
||||
- *dyn_info_list_addr = (unw_word_t) &_U_dyn_info_list;
|
||||
+#ifndef UNW_LOCAL_ONLY
|
||||
+# pragma weak _U_dyn_info_list_addr
|
||||
+ if (!_U_dyn_info_list_addr)
|
||||
+ return -UNW_ENOINFO;
|
||||
+#endif
|
||||
+ // Access the `_U_dyn_info_list` from `LOCAL_ONLY` library, i.e. libunwind.so.
|
||||
+ *dyn_info_list_addr = _U_dyn_info_list_addr ();
|
||||
return 0;
|
||||
}
|
||||
|
||||
--
|
||||
2.28.0
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
From 81eabea4e4da55cddfe8bcfcbc3759fa90948254 Mon Sep 17 00:00:00 2001
|
||||
From: Khem Raj <raj.khem@gmail.com>
|
||||
Date: Fri, 3 Mar 2023 14:13:29 -0800
|
||||
Subject: [PATCH] Fix type mismatch on 32bit arches
|
||||
|
||||
std::set::size returns an unsigned integral type.
|
||||
std::max call therefore gets (unsigned int, unsigned long) here.
|
||||
Type of both arguments is not same, so its ambigous
|
||||
and there is no matching std::max implementation for mismatching
|
||||
arguments. std::max expects both input variables to be of
|
||||
same type, max(int,int) etc..
|
||||
|
||||
Fixes
|
||||
src/mongo/util/processinfo_linux.cpp:424:16: error: no matching function for call to 'max'
|
||||
return std::max(socketIds.size(), 1ul);
|
||||
|
||||
Upstream-Status: Submitted [https://jira.mongodb.org/browse/SERVER-74633]
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
---
|
||||
src/mongo/util/processinfo_linux.cpp | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
--- a/src/mongo/util/processinfo_linux.cpp
|
||||
+++ b/src/mongo/util/processinfo_linux.cpp
|
||||
@@ -421,7 +421,7 @@ public:
|
||||
|
||||
// On ARM64, the "physical id" field is unpopulated, causing there to be 0 sockets found. In
|
||||
// this case, we default to 1.
|
||||
- return std::max(socketIds.size(), 1ul);
|
||||
+ return std::max(static_cast<unsigned long>(socketIds.size()), 1ul);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -0,0 +1,35 @@
|
||||
From 97914aeab52b4d0ea0ab9e5ff985a1c5cddb0fa1 Mon Sep 17 00:00:00 2001
|
||||
From: Vincent Prince <vincent.prince.fr@gmail.com>
|
||||
Date: Mon, 16 Sep 2019 13:41:39 +0200
|
||||
Subject: [PATCH 06/10] IntelRDFPMathLib20U1: Check for __DEFINED_wchar_t
|
||||
|
||||
This is defined by musl if wchar_t is already defined
|
||||
|
||||
avoids errors like
|
||||
|
||||
src/third_party/IntelRDFPMathLib20U1/LIBRARY/src/bid_functions.h:46:15: error: typedef redefinition with different types
|
||||
('int' vs 'unsigned int')
|
||||
typedef int wchar_t;
|
||||
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
Signed-off-by: Vincent Prince <vincent.prince.fr@gmail.com>
|
||||
---
|
||||
src/third_party/IntelRDFPMathLib20U1/LIBRARY/src/bid_functions.h | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/third_party/IntelRDFPMathLib20U1/LIBRARY/src/bid_functions.h b/src/third_party/IntelRDFPMathLib20U1/LIBRARY/src/bid_functions.h
|
||||
index 56775bc..be96a85 100755
|
||||
--- a/src/third_party/IntelRDFPMathLib20U1/LIBRARY/src/bid_functions.h
|
||||
+++ b/src/third_party/IntelRDFPMathLib20U1/LIBRARY/src/bid_functions.h
|
||||
@@ -43,7 +43,7 @@
|
||||
|
||||
#if 0 // MongoDB Modification -- just `#include <stddef.h>`
|
||||
// Fix system header issue on Sun solaris and define required type by ourselves
|
||||
-#if !defined(_WCHAR_T) && !defined(_WCHAR_T_DEFINED) && !defined(__QNX__)
|
||||
+#if !defined(_WCHAR_T) && !defined(_WCHAR_T_DEFINED) && !defined(__QNX__) && !defined(__DEFINED_wchar_t)
|
||||
typedef int wchar_t;
|
||||
#endif
|
||||
#else
|
||||
--
|
||||
2.7.4
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
From ca004968b8d2149f72d4edcfe029489a8c5e10ca Mon Sep 17 00:00:00 2001
|
||||
From: Khem Raj <raj.khem@gmail.com>
|
||||
Date: Mon, 23 Sep 2019 12:31:31 -0700
|
||||
Subject: [PATCH] Mark one of strerror_r implementation glibc specific
|
||||
|
||||
glibc has two incompatible strerror_r definitions, one of them is
|
||||
specific to glibc, mark this one so
|
||||
|
||||
Upstream-Status: Pending
|
||||
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
---
|
||||
src/mongo/util/errno_util.cpp | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/mongo/util/errno_util.cpp b/src/mongo/util/errno_util.cpp
|
||||
index 564c0071ea..4f7e1d3a38 100644
|
||||
--- a/src/mongo/util/errno_util.cpp
|
||||
+++ b/src/mongo/util/errno_util.cpp
|
||||
@@ -61,7 +61,7 @@ std::string errnoWithDescription(int errNumber) {
|
||||
char buf[kBuflen];
|
||||
char* msg{nullptr};
|
||||
|
||||
-#if defined(__GNUC__) && defined(_GNU_SOURCE) && \
|
||||
+#if defined(__GNUC__) && defined(_GNU_SOURCE) && defined(__GLIBC__) && \
|
||||
(!defined(__ANDROID_API__) || !(__ANDROID_API__ <= 22)) && !defined(EMSCRIPTEN)
|
||||
msg = strerror_r(errNumber, buf, kBuflen);
|
||||
#elif defined(_WIN32)
|
||||
--
|
||||
2.23.0
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
From 8d035e84c2edb44461ef4df9cdef0a6dfce0a1d7 Mon Sep 17 00:00:00 2001
|
||||
From: Khem Raj <raj.khem@gmail.com>
|
||||
Date: Fri, 24 Aug 2018 12:56:22 -0700
|
||||
Subject: [PATCH 07/10] Support deprecated resolver functions
|
||||
|
||||
Needed for musl libc
|
||||
|
||||
Upstream-Status: Pending
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
---
|
||||
src/mongo/util/dns_query_posix-impl.h | 6 ++++++
|
||||
1 file changed, 6 insertions(+)
|
||||
|
||||
diff --git a/src/mongo/util/dns_query_posix-impl.h b/src/mongo/util/dns_query_posix-impl.h
|
||||
index a5e3629..fb29d2d 100644
|
||||
--- a/src/mongo/util/dns_query_posix-impl.h
|
||||
+++ b/src/mongo/util/dns_query_posix-impl.h
|
||||
@@ -54,6 +54,12 @@
|
||||
|
||||
#include <boost/noncopyable.hpp>
|
||||
|
||||
+#ifndef res_ninit
|
||||
+#define res_nclose(arg)
|
||||
+#define res_ninit(arg) res_init()
|
||||
+#define res_nsearch(sta, nam, clas, typ, ans, alen) res_search(nam, clas, typ, ans, alen)
|
||||
+#endif
|
||||
+
|
||||
namespace mongo {
|
||||
namespace dns {
|
||||
// The anonymous namespace is safe, in this header, as it is not really a header. It is only used
|
||||
--
|
||||
2.7.4
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
From 8295bb6a60896fed54d6450bca091aea4eea4fb2 Mon Sep 17 00:00:00 2001
|
||||
From: Vincent Prince <vincent.prince.fr@gmail.com>
|
||||
Date: Mon, 16 Sep 2019 13:21:44 +0200
|
||||
Subject: [PATCH 01/10] Tell scons to use build settings from environment
|
||||
variables
|
||||
|
||||
Signed-off-by: Sven Ebenfeld <sven.ebenfeld@gmail.com>
|
||||
Signed-off-by: Vincent Prince <vincent.prince.fr@gmail.com>
|
||||
---
|
||||
SConstruct | 8 ++++++--
|
||||
1 file changed, 6 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/SConstruct b/SConstruct
|
||||
index 89c044ab78..2044c0ddb8 100644
|
||||
--- a/SConstruct
|
||||
+++ b/SConstruct
|
||||
@@ -593,6 +593,7 @@ def variable_arch_converter(val):
|
||||
'amd64': 'x86_64',
|
||||
'emt64': 'x86_64',
|
||||
'x86': 'i386',
|
||||
+ 'aarch64': 'arm64',
|
||||
}
|
||||
val = val.lower()
|
||||
|
||||
@@ -723,7 +724,8 @@ env_vars.Add(
|
||||
)
|
||||
|
||||
env_vars.Add('CC',
|
||||
- help='Select the C compiler to use')
|
||||
+ help='Select the C compiler to use',
|
||||
+ default=os.getenv('CC'))
|
||||
|
||||
env_vars.Add('CCFLAGS',
|
||||
help='Sets flags for the C and C++ compiler',
|
||||
@@ -743,7 +745,8 @@ env_vars.Add('CPPPATH',
|
||||
converter=variable_shlex_converter)
|
||||
|
||||
env_vars.Add('CXX',
|
||||
- help='Select the C++ compiler to use')
|
||||
+ help='Select the C++ compiler to use',
|
||||
+ default=os.getenv('CXX'))
|
||||
|
||||
env_vars.Add('CXXFLAGS',
|
||||
help='Sets flags for the C++ compiler',
|
||||
@@ -1127,6 +1130,7 @@ if get_option('build-tools') == 'next' or get_option('ninja') == 'next':
|
||||
SCons.Tool.DefaultToolpath.insert(0, os.path.abspath('site_scons/site_tools/next'))
|
||||
|
||||
env = Environment(variables=env_vars, **envDict)
|
||||
+env.PrependENVPath('PATH', os.getenv('PATH'))
|
||||
|
||||
# Only print the spinner if stdout is a tty
|
||||
if sys.stdout.isatty():
|
||||
--
|
||||
2.24.0
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
From f9b55f5a1fab85bf73c95e6372779d6f50f75e84 Mon Sep 17 00:00:00 2001
|
||||
From: jzmaddock <john@johnmaddock.co.uk>
|
||||
Date: Mon, 11 Jul 2022 18:26:07 +0100
|
||||
Subject: [PATCH] The std lib unary/binary_function base classes are
|
||||
deprecated/removed from libcpp15. Fixes
|
||||
https://github.com/boostorg/container_hash/issues/24.
|
||||
|
||||
Upstream-Status: Backport [https://github.com/boostorg/config/pull/440/commits/f0af4a9184457939b89110795ae2d293582c5f66]
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
---
|
||||
src/third_party/boost-1.70.0/boost/config/stdlib/libcpp.hpp | 9 +++++++++
|
||||
1 file changed, 9 insertions(+)
|
||||
|
||||
--- a/src/third_party/boost-1.70.0/boost/config/stdlib/libcpp.hpp
|
||||
+++ b/src/third_party/boost-1.70.0/boost/config/stdlib/libcpp.hpp
|
||||
@@ -140,4 +140,13 @@
|
||||
# define BOOST_NO_CXX14_HDR_SHARED_MUTEX
|
||||
#endif
|
||||
|
||||
+#if _LIBCPP_VERSION >= 15000
|
||||
+//
|
||||
+// Unary function is now deprecated in C++11 and later:
|
||||
+//
|
||||
+#if __cplusplus >= 201103L
|
||||
+#define BOOST_NO_CXX98_FUNCTION_BASE
|
||||
+#endif
|
||||
+#endif
|
||||
+
|
||||
// --- end ---
|
||||
--- a/src/third_party/boost-1.70.0/boost/container_hash/hash.hpp
|
||||
+++ b/src/third_party/boost-1.70.0/boost/container_hash/hash.hpp
|
||||
@@ -118,7 +118,7 @@ namespace boost
|
||||
{
|
||||
namespace hash_detail
|
||||
{
|
||||
-#if defined(_HAS_AUTO_PTR_ETC) && !_HAS_AUTO_PTR_ETC
|
||||
+#if defined(BOOST_NO_CXX98_FUNCTION_BASE)
|
||||
template <typename T>
|
||||
struct hash_base
|
||||
{
|
||||
@@ -0,0 +1,41 @@
|
||||
From 6332823f9fdcb571305b716330e67d0b38810868 Mon Sep 17 00:00:00 2001
|
||||
From: Vincent Prince <vincent.prince.fr@gmail.com>
|
||||
Date: Mon, 16 Sep 2019 13:30:13 +0200
|
||||
Subject: [PATCH 03/10] Use __GLIBC__ to control use of gnu_get_libc_version
|
||||
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
Signed-off-by: Vincent Prince <vincent.prince.fr@gmail.com>
|
||||
---
|
||||
src/mongo/util/processinfo_linux.cpp | 8 ++++----
|
||||
1 file changed, 4 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/src/mongo/util/processinfo_linux.cpp b/src/mongo/util/processinfo_linux.cpp
|
||||
index a968c54727..0d8b8874e2 100644
|
||||
--- a/src/mongo/util/processinfo_linux.cpp
|
||||
+++ b/src/mongo/util/processinfo_linux.cpp
|
||||
@@ -44,10 +44,10 @@
|
||||
#include <unistd.h>
|
||||
#ifdef __BIONIC__
|
||||
#include <android/api-level.h>
|
||||
-#elif __UCLIBC__
|
||||
-#include <features.h>
|
||||
-#else
|
||||
+#elif defined(__GLIBC__) && !defined(__UCLIBC__)
|
||||
#include <gnu/libc-version.h>
|
||||
+#else
|
||||
+#include <features.h>
|
||||
#endif
|
||||
|
||||
#include <boost/filesystem.hpp>
|
||||
@@ -617,7 +617,7 @@ void ProcessInfo::SystemInfo::collectSystemInfo() {
|
||||
std::stringstream ss;
|
||||
ss << "uClibc-" << __UCLIBC_MAJOR__ << "." << __UCLIBC_MINOR__ << "." << __UCLIBC_SUBLEVEL__;
|
||||
bExtra.append("libcVersion", ss.str());
|
||||
-#else
|
||||
+#elif defined(__GLIBC__)
|
||||
bExtra.append("libcVersion", gnu_get_libc_version());
|
||||
#endif
|
||||
if (!verSig.empty())
|
||||
--
|
||||
2.24.0
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
From 4e7f15346682482bc2071c7209dec97507d3bc4c Mon Sep 17 00:00:00 2001
|
||||
From: Khem Raj <raj.khem@gmail.com>
|
||||
Date: Sat, 2 Sep 2017 10:03:37 -0700
|
||||
Subject: [PATCH 02/10] Use long long instead of int64_t
|
||||
|
||||
Fixes
|
||||
error: call to member function 'appendNumber' is ambiguous
|
||||
since this function expects long long as parameter and not int64_t
|
||||
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
Signed-off-by: Vincent Prince <vincent.prince.fr@gmail.com>
|
||||
---
|
||||
src/mongo/util/procparser.cpp | 10 +++++-----
|
||||
1 file changed, 5 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/src/mongo/util/procparser.cpp b/src/mongo/util/procparser.cpp
|
||||
index 24b9d1e2c9..0f274cfff6 100644
|
||||
--- a/src/mongo/util/procparser.cpp
|
||||
+++ b/src/mongo/util/procparser.cpp
|
||||
@@ -261,7 +261,7 @@ Status parseProcStat(const std::vector<StringData>& keys,
|
||||
|
||||
StringData stringValue((*partIt).begin(), (*partIt).end() - (*partIt).begin());
|
||||
|
||||
- uint64_t value;
|
||||
+ long long value;
|
||||
|
||||
if (!NumberParser{}(stringValue, &value).isOK()) {
|
||||
value = 0;
|
||||
@@ -273,7 +273,7 @@ Status parseProcStat(const std::vector<StringData>& keys,
|
||||
} else {
|
||||
StringData stringValue((*partIt).begin(), (*partIt).end() - (*partIt).begin());
|
||||
|
||||
- uint64_t value;
|
||||
+ long long value;
|
||||
|
||||
if (!NumberParser{}(stringValue, &value).isOK()) {
|
||||
value = 0;
|
||||
@@ -366,7 +366,7 @@ Status parseProcMemInfo(const std::vector<StringData>& keys,
|
||||
|
||||
StringData stringValue((*partIt).begin(), (*partIt).end());
|
||||
|
||||
- uint64_t value;
|
||||
+ long long value;
|
||||
|
||||
if (!NumberParser{}(stringValue, &value).isOK()) {
|
||||
value = 0;
|
||||
@@ -522,7 +522,7 @@ Status parseProcDiskStats(const std::vector<StringData>& disks,
|
||||
StringData data,
|
||||
BSONObjBuilder* builder) {
|
||||
bool foundKeys = false;
|
||||
- std::vector<uint64_t> stats;
|
||||
+ std::vector<long long> stats;
|
||||
stats.reserve(kDiskFieldCount);
|
||||
|
||||
using string_split_iterator = boost::split_iterator<StringData::const_iterator>;
|
||||
@@ -597,7 +597,7 @@ Status parseProcDiskStats(const std::vector<StringData>& disks,
|
||||
|
||||
StringData stringValue((*partIt).begin(), (*partIt).end());
|
||||
|
||||
- uint64_t value;
|
||||
+ long long value;
|
||||
|
||||
if (!NumberParser{}(stringValue, &value).isOK()) {
|
||||
value = 0;
|
||||
--
|
||||
2.24.0
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
From ad37ee80b32a1f740a3197105174d74dff11e4e8 Mon Sep 17 00:00:00 2001
|
||||
From: Khem Raj <raj.khem@gmail.com>
|
||||
Date: Wed, 13 Apr 2022 13:56:32 -0700
|
||||
Subject: [PATCH] add explict static_cast<size_t> to maxMemoryUsageBytes
|
||||
|
||||
Fixes
|
||||
src/mongo/db/pipeline/document_source_group.cpp:377:22: error: non-constant-expression cannot be narrowed from type 'long long' to 'size_t' (aka 'unsigned int') in initializer list [-Wc++11-narrowing]
|
||||
maxMemoryUsageBytes ? *maxMemoryUsageBytes
|
||||
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
src/mongo/db/pipeline/document_source_group.cpp:377:22: note: insert an explicit cast to silence this issue
|
||||
maxMemoryUsageBytes ? *maxMemoryUsageBytes
|
||||
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Upstream-Status: Pending
|
||||
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
---
|
||||
src/mongo/db/pipeline/document_source_group.cpp | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/src/mongo/db/pipeline/document_source_group.cpp b/src/mongo/db/pipeline/document_source_group.cpp
|
||||
index 4a7b48d6cd2..9a6076c6041 100644
|
||||
--- a/src/mongo/db/pipeline/document_source_group.cpp
|
||||
+++ b/src/mongo/db/pipeline/document_source_group.cpp
|
||||
@@ -374,8 +374,8 @@ DocumentSourceGroup::DocumentSourceGroup(const intrusive_ptr<ExpressionContext>&
|
||||
_usedDisk(false),
|
||||
_doingMerge(false),
|
||||
_memoryTracker{pExpCtx->allowDiskUse && !pExpCtx->inMongos,
|
||||
- maxMemoryUsageBytes ? *maxMemoryUsageBytes
|
||||
- : internalDocumentSourceGroupMaxMemoryBytes.load()},
|
||||
+ static_cast<size_t>(maxMemoryUsageBytes ? *maxMemoryUsageBytes
|
||||
+ : internalDocumentSourceGroupMaxMemoryBytes.load())},
|
||||
// We spill to disk in debug mode, regardless of allowDiskUse, to stress the system.
|
||||
_file(!pExpCtx->inMongos && (pExpCtx->allowDiskUse || kDebugBuild)
|
||||
? std::make_shared<Sorter<Value, Value>::File>(pExpCtx->tempDir + "/" +
|
||||
--
|
||||
2.35.2
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
From 03047c81b2601362bcf79cae67e06d1fba0a6101 Mon Sep 17 00:00:00 2001
|
||||
From: Khem Raj <raj.khem@gmail.com>
|
||||
Date: Thu, 2 Mar 2023 20:17:57 -0800
|
||||
Subject: [PATCH] apply msvc workaround for clang >= 16
|
||||
|
||||
This avoids a new Werror found with clang16
|
||||
|
||||
boost-1.70.0/boost/mpl/aux_/integral_wrapper.hpp:73:31: error: integer value -1 is outside the valid range of values [0, 3] for this enumeration type [-Wenum-constexpr-conversion]
|
||||
typedef AUX_WRAPPER_INST( BOOST_MPL_AUX_STATIC_CAST(AUX_WRAPPER_VALUE_TYPE, (value - 1)) ) prior;
|
||||
|
||||
Upstream-Status: Pending
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
---
|
||||
.../boost-1.70.0/boost/mpl/aux_/integral_wrapper.hpp | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/third_party/boost-1.70.0/boost/mpl/aux_/integral_wrapper.hpp b/src/third_party/boost-1.70.0/boost/mpl/aux_/integral_wrapper.hpp
|
||||
index 6bc05f7e96e..6bb8d24c9ce 100644
|
||||
--- a/src/third_party/boost-1.70.0/boost/mpl/aux_/integral_wrapper.hpp
|
||||
+++ b/src/third_party/boost-1.70.0/boost/mpl/aux_/integral_wrapper.hpp
|
||||
@@ -56,7 +56,7 @@ struct AUX_WRAPPER_NAME
|
||||
// have to #ifdef here: some compilers don't like the 'N + 1' form (MSVC),
|
||||
// while some other don't like 'value + 1' (Borland), and some don't like
|
||||
// either
|
||||
-#if BOOST_WORKAROUND(__EDG_VERSION__, <= 243)
|
||||
+#if BOOST_WORKAROUND(__EDG_VERSION__, <= 243) || __clang_major__ > 15
|
||||
private:
|
||||
BOOST_STATIC_CONSTANT(AUX_WRAPPER_VALUE_TYPE, next_value = BOOST_MPL_AUX_STATIC_CAST(AUX_WRAPPER_VALUE_TYPE, (N + 1)));
|
||||
BOOST_STATIC_CONSTANT(AUX_WRAPPER_VALUE_TYPE, prior_value = BOOST_MPL_AUX_STATIC_CAST(AUX_WRAPPER_VALUE_TYPE, (N - 1)));
|
||||
--
|
||||
2.39.2
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
From 097e8a66930cfa28ac8bfa35f62d0a9ee3b74488 Mon Sep 17 00:00:00 2001
|
||||
From: Vincent Prince <vincent.prince.fr@gmail.com>
|
||||
Date: Mon, 16 Sep 2019 13:46:52 +0200
|
||||
Subject: [PATCH 10/10] asio: Dont use experimental with clang
|
||||
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
Signed-off-by: Vincent Prince <vincent.prince.fr@gmail.com>
|
||||
---
|
||||
src/third_party/asio-master/asio/include/asio/detail/string_view.hpp | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/src/third_party/asio-master/asio/include/asio/detail/string_view.hpp b/src/third_party/asio-master/asio/include/asio/detail/string_view.hpp
|
||||
index f09cebc..fa307b5 100644
|
||||
--- a/src/third_party/asio-master/asio/include/asio/detail/string_view.hpp
|
||||
+++ b/src/third_party/asio-master/asio/include/asio/detail/string_view.hpp
|
||||
@@ -33,8 +33,8 @@ namespace asio {
|
||||
using std::basic_string_view;
|
||||
using std::string_view;
|
||||
#elif defined(ASIO_HAS_STD_EXPERIMENTAL_STRING_VIEW)
|
||||
-using std::experimental::basic_string_view;
|
||||
-using std::experimental::string_view;
|
||||
+using std::basic_string_view;
|
||||
+using std::string_view;
|
||||
#endif // defined(ASIO_HAS_STD_EXPERIMENTAL_STRING_VIEW)
|
||||
|
||||
} // namespace asio
|
||||
--
|
||||
2.7.4
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
From 5d8218b8a1b5bc71e2a0cf543a000e194daba599 Mon Sep 17 00:00:00 2001
|
||||
From: Khem Raj <raj.khem@gmail.com>
|
||||
Date: Sun, 29 Jan 2023 17:15:30 -0800
|
||||
Subject: [PATCH] free_mon: Include missing <cstdint>
|
||||
|
||||
gcc 13 moved some includes around and as a result <cstdint> is no
|
||||
longer transitively included [1]. Explicitly include it
|
||||
for uintXX_t.
|
||||
|
||||
[1] https://gcc.gnu.org/gcc-13/porting_to.html#header-dep-changes
|
||||
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
---
|
||||
src/mongo/db/free_mon/free_mon_options.h | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
--- a/src/mongo/db/free_mon/free_mon_options.h
|
||||
+++ b/src/mongo/db/free_mon/free_mon_options.h
|
||||
@@ -29,6 +29,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
+#include <cstdint>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
From 383b1dda4800c2514cb31446cd7478692d7d26cf Mon Sep 17 00:00:00 2001
|
||||
From: Khem Raj <raj.khem@gmail.com>
|
||||
Date: Wed, 3 Mar 2021 12:43:16 -0800
|
||||
Subject: [PATCH] include needed c++ header
|
||||
|
||||
Fixes
|
||||
plan_stats.h:214:10: error: 'optional' in namespace 'std' does not name a template type
|
||||
|
||||
Upstream-Status: Pending
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
---
|
||||
src/mongo/db/exec/plan_stats.h | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/src/mongo/db/exec/plan_stats.h b/src/mongo/db/exec/plan_stats.h
|
||||
index ea75f673b8..0cc9b4636d 100644
|
||||
--- a/src/mongo/db/exec/plan_stats.h
|
||||
+++ b/src/mongo/db/exec/plan_stats.h
|
||||
@@ -31,6 +31,7 @@
|
||||
|
||||
#include <cstdint>
|
||||
#include <cstdlib>
|
||||
+#include <optional>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
--
|
||||
2.30.1
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
From 5c9e0d0fc9188bab0ae09c9c33df01938b0c1b6c Mon Sep 17 00:00:00 2001
|
||||
From: Khem Raj <raj.khem@gmail.com>
|
||||
Date: Thu, 14 Apr 2022 09:25:33 -0700
|
||||
Subject: [PATCH] server: Adjust the cache alignment assumptions
|
||||
|
||||
aarch64 has 256 for hardware_destructive_interference_size and gcc 12
|
||||
has added a warning to complain about mismatches which results in
|
||||
static_assert failures
|
||||
|
||||
In file included from src/mongo/s/commands/cluster_find_cmd.cpp:39:
|
||||
src/mongo/db/stats/counters.h:185:47: error: static assertion failed: cache line spill
|
||||
185 | static_assert(sizeof(decltype(_together)) <= stdx::hardware_constructive_interference_size,
|
||||
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
The structure need to ensure true sharing for both the elements
|
||||
so align it to hardware_constructive_interference_size instead
|
||||
|
||||
Upstream-Status: Inappropriate [https://jira.mongodb.org/browse/SERVER-65664]
|
||||
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
---
|
||||
src/mongo/db/stats/counters.h | 6 +++---
|
||||
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
--- a/src/mongo/db/stats/counters.h
|
||||
+++ b/src/mongo/db/stats/counters.h
|
||||
@@ -182,8 +182,8 @@ private:
|
||||
AtomicWord<long long> requests{0};
|
||||
};
|
||||
CacheAligned<Together> _together{};
|
||||
- static_assert(sizeof(decltype(_together)) <= stdx::hardware_constructive_interference_size,
|
||||
- "cache line spill");
|
||||
+ static_assert(sizeof(Together) <= stdx::hardware_constructive_interference_size,
|
||||
+ "cache line spill");
|
||||
|
||||
CacheAligned<AtomicWord<long long>> _logicalBytesOut{0};
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
From efd79bda1b85a5a4398a71e5ea2bc00ee4b0ea46 Mon Sep 17 00:00:00 2001
|
||||
From: Khem Raj <raj.khem@gmail.com>
|
||||
Date: Tue, 15 Sep 2020 18:20:27 -0700
|
||||
Subject: [PATCH] stacktrace: Define ARCH_BITS for x86
|
||||
|
||||
stacktrace_somap.cpp:92:33: error: 'ELFCLASSARCH_BITS' was not declared in this scope
|
||||
|
||||
Upstream-Status: Pending
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
---
|
||||
src/mongo/util/stacktrace_somap.cpp | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/mongo/util/stacktrace_somap.cpp b/src/mongo/util/stacktrace_somap.cpp
|
||||
index f7ba66a142..2231948ce8 100644
|
||||
--- a/src/mongo/util/stacktrace_somap.cpp
|
||||
+++ b/src/mongo/util/stacktrace_somap.cpp
|
||||
@@ -83,7 +83,7 @@ void addUnameToSoMap(BSONObjBuilder* soMap) {
|
||||
#define ARCH_BITS __ELF_NATIVE_CLASS
|
||||
#elif defined(__x86_64__) || defined(__aarch64__)
|
||||
#define ARCH_BITS 64
|
||||
-#elif defined(__arm__)
|
||||
+#elif defined(__i386__) || defined(__arm__)
|
||||
#define ARCH_BITS 32
|
||||
#else
|
||||
#error Unknown target architecture.
|
||||
--
|
||||
2.28.0
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
From 0508c1518c2e7c586a231d344e9f93b08507885b Mon Sep 17 00:00:00 2001
|
||||
From: Khem Raj <raj.khem@gmail.com>
|
||||
Date: Sat, 31 Dec 2022 14:23:40 -0800
|
||||
Subject: [PATCH] wiredtiger: Avoid using off64_t
|
||||
|
||||
off64_t is not available on musl since off_t is already 64bit by
|
||||
default. Therefore replace using off64_t with off_t
|
||||
|
||||
Upstream-Status: Pending
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
---
|
||||
src/third_party/wiredtiger/src/os_posix/os_fs.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/third_party/wiredtiger/src/os_posix/os_fs.c b/src/third_party/wiredtiger/src/os_posix/os_fs.c
|
||||
index 3898eb74343..9ce2d5edb38 100644
|
||||
--- a/src/third_party/wiredtiger/src/os_posix/os_fs.c
|
||||
+++ b/src/third_party/wiredtiger/src/os_posix/os_fs.c
|
||||
@@ -533,7 +533,7 @@ __posix_file_sync_nowait(WT_FILE_HANDLE *file_handle, WT_SESSION *wt_session)
|
||||
pfh = (WT_FILE_HANDLE_POSIX *)file_handle;
|
||||
|
||||
/* See comment in __posix_sync(): sync cannot be retried or fail. */
|
||||
- WT_SYSCALL(sync_file_range(pfh->fd, (off64_t)0, (off64_t)0, SYNC_FILE_RANGE_WRITE), ret);
|
||||
+ WT_SYSCALL(sync_file_range(pfh->fd, 0, 0, SYNC_FILE_RANGE_WRITE), ret);
|
||||
if (ret == 0)
|
||||
return (0);
|
||||
|
||||
--
|
||||
2.39.0
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
From 28f34191eef1e70c24d2f81b66e4dd40dbefcd35 Mon Sep 17 00:00:00 2001
|
||||
From: Khem Raj <raj.khem@gmail.com>
|
||||
Date: Sat, 2 Sep 2017 12:42:30 -0700
|
||||
Subject: [PATCH 04/10] Add a definition for the macro __ELF_NATIVE_CLASS
|
||||
|
||||
It depends on the native arch's word size.
|
||||
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
Signed-off-by: Vincent Prince <vincent.prince.fr@gmail.com>
|
||||
---
|
||||
src/mongo/util/stacktrace_posix.cpp | 9 +++++++++
|
||||
1 file changed, 9 insertions(+)
|
||||
|
||||
diff --git a/src/mongo/util/stacktrace_posix.cpp b/src/mongo/util/stacktrace_posix.cpp
|
||||
index 531e21bdc2..fa611499e4 100644
|
||||
--- a/src/mongo/util/stacktrace_posix.cpp
|
||||
+++ b/src/mongo/util/stacktrace_posix.cpp
|
||||
@@ -42,6 +42,15 @@
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
+#if !defined(__GLIBC__)
|
||||
+#if defined __x86_64__ && !defined __ILP32__
|
||||
+# define __WORDSIZE 64
|
||||
+#else
|
||||
+# define __WORDSIZE 32
|
||||
+#endif
|
||||
+#define __ELF_NATIVE_CLASS __WORDSIZE
|
||||
+#endif
|
||||
+
|
||||
#include "mongo/base/init.h"
|
||||
#include "mongo/bson/json.h"
|
||||
#include "mongo/config.h"
|
||||
--
|
||||
2.24.0
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
From ffe6045b190b735601cd209d3e7ac121604c5a4e Mon Sep 17 00:00:00 2001
|
||||
From: Khem Raj <raj.khem@gmail.com>
|
||||
Date: Fri, 24 Aug 2018 13:07:01 -0700
|
||||
Subject: [PATCH 08/10] Fix default stack size to 256K
|
||||
|
||||
On musl default stack size is ~80K which is too low
|
||||
for mongodb
|
||||
|
||||
Upstream-Status: Pending
|
||||
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
---
|
||||
src/mongo/platform/stack_locator_pthread_getattr_np.cpp | 10 ++++++++++
|
||||
1 file changed, 10 insertions(+)
|
||||
|
||||
diff --git a/src/mongo/platform/stack_locator_pthread_getattr_np.cpp b/src/mongo/platform/stack_locator_pthread_getattr_np.cpp
|
||||
index 4f3044c..68e47e3 100644
|
||||
--- a/src/mongo/platform/stack_locator_pthread_getattr_np.cpp
|
||||
+++ b/src/mongo/platform/stack_locator_pthread_getattr_np.cpp
|
||||
@@ -36,6 +36,16 @@
|
||||
#include "mongo/util/assert_util.h"
|
||||
#include "mongo/util/scopeguard.h"
|
||||
|
||||
+__attribute__((constructor))
|
||||
+static void set_default_stack_size(void)
|
||||
+{
|
||||
+ pthread_attr_t attr;
|
||||
+ invariant(pthread_attr_init(&attr) == 0);
|
||||
+ invariant(pthread_attr_setstacksize(&attr, 256*1024) == 0);
|
||||
+ pthread_setattr_default_np(&attr);
|
||||
+ invariant(pthread_attr_destroy(&attr) == 0);
|
||||
+}
|
||||
+
|
||||
namespace mongo {
|
||||
|
||||
StackLocator::StackLocator() {
|
||||
--
|
||||
2.7.4
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
Index: git/SConstruct
|
||||
===================================================================
|
||||
--- git.orig/SConstruct
|
||||
+++ git/SConstruct
|
||||
@@ -977,6 +977,14 @@ env_vars.Add('WINDOWS_OPENSSL_BIN',
|
||||
help='Sets the path to the openssl binaries for packaging',
|
||||
default='c:/openssl/bin')
|
||||
|
||||
+env_vars.Add('PREFIX',
|
||||
+ help='installation prefix')
|
||||
+
|
||||
+env_vars.Add('prefix',
|
||||
+ help='installation prefix')
|
||||
+
|
||||
+
|
||||
+
|
||||
# -- Validate user provided options --
|
||||
|
||||
# A dummy environment that should *only* have the variables we have set. In practice it has
|
||||
@@ -0,0 +1,26 @@
|
||||
From cc95a8878fa581b164dee8fb1f07b05b9d919ef0 Mon Sep 17 00:00:00 2001
|
||||
From: Khem Raj <raj.khem@gmail.com>
|
||||
Date: Sat, 2 Sep 2017 13:13:15 -0700
|
||||
Subject: [PATCH 09/10] wiredtiger: Disable strtouq on musl
|
||||
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
---
|
||||
src/third_party/wiredtiger/build_linux/wiredtiger_config.h | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/third_party/wiredtiger/build_linux/wiredtiger_config.h b/src/third_party/wiredtiger/build_linux/wiredtiger_config.h
|
||||
index 82e9994..0399a67 100644
|
||||
--- a/src/third_party/wiredtiger/build_linux/wiredtiger_config.h
|
||||
+++ b/src/third_party/wiredtiger/build_linux/wiredtiger_config.h
|
||||
@@ -104,7 +104,7 @@
|
||||
#define HAVE_STRING_H 1
|
||||
|
||||
/* Define to 1 if you have the `strtouq' function. */
|
||||
-#define HAVE_STRTOUQ 1
|
||||
+/* #undef HAVE_STRTOUQ 1 */
|
||||
|
||||
/* Define to 1 if you have the `sync_file_range' function. */
|
||||
/* #undef HAVE_SYNC_FILE_RANGE */
|
||||
--
|
||||
2.7.4
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
Upstream-Status: submitted https://github.com/mongodb/mongo/pull/1296
|
||||
From 362be06fc16a5ad0f9e9aa90cc763c5242e8e35c Mon Sep 17 00:00:00 2001
|
||||
From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
|
||||
Date: Sat, 9 Feb 2019 12:41:45 +0100
|
||||
Subject: [PATCH] ssl_manager.cpp: fix build with gcc 7 and -fpermissive
|
||||
|
||||
Change prototype of DERToken::parse function from
|
||||
parse(ConstDataRange cdr, size_t* outLength);
|
||||
to parse(ConstDataRange cdr, uint64_t* outLength);
|
||||
|
||||
Otherwise, we got the following error:
|
||||
|
||||
src/mongo/util/net/ssl_manager.cpp: In static member function 'static mongo::StatusWith<mongo::{anonymous}::DERToken> mongo::{anonymous}::DERToken::parse(mongo::ConstDataRange, size_t*)':
|
||||
src/mongo/util/net/ssl_manager.cpp:575:79: error: invalid conversion from 'size_t* {aka unsigned int*}' to 'long unsigned int*' [-fpermissive]
|
||||
if (mongoUnsignedAddOverflow64(tagAndLengthByteCount, derLength, outLength) ||
|
||||
|
||||
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
|
||||
Signed-off-by: Vincent Prince <vincent.prince.fr@gmail.com>
|
||||
---
|
||||
src/mongo/util/net/ssl_manager.cpp | 6 +++---
|
||||
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/src/mongo/util/net/ssl_manager.cpp b/src/mongo/util/net/ssl_manager.cpp
|
||||
index 455a1662a5..e8497bc0d1 100644
|
||||
--- a/src/mongo/util/net/ssl_manager.cpp
|
||||
+++ b/src/mongo/util/net/ssl_manager.cpp
|
||||
@@ -810,7 +810,7 @@ public:
|
||||
*
|
||||
* Returns a DERToken which consists of the (tag, length, value) tuple.
|
||||
*/
|
||||
- static StatusWith<DERToken> parse(ConstDataRange cdr, size_t* outLength);
|
||||
+ static StatusWith<DERToken> parse(ConstDataRange cdr, uint64_t* outLength);
|
||||
|
||||
private:
|
||||
DERType _type{DERType::EndOfContent};
|
||||
@@ -827,7 +827,7 @@ struct DataType::Handler<DERToken> {
|
||||
size_t length,
|
||||
size_t* advanced,
|
||||
std::ptrdiff_t debug_offset) {
|
||||
- size_t outLength;
|
||||
+ uint64_t outLength;
|
||||
|
||||
auto swPair = DERToken::parse(ConstDataRange(ptr, length), &outLength);
|
||||
|
||||
@@ -889,7 +889,7 @@ StatusWith<DERInteger> readDERInt(ConstDataRangeCursor& cdc) {
|
||||
}
|
||||
|
||||
|
||||
-StatusWith<DERToken> DERToken::parse(ConstDataRange cdr, size_t* outLength) {
|
||||
+StatusWith<DERToken> DERToken::parse(ConstDataRange cdr, uint64_t* outLength) {
|
||||
const size_t kTagLength = 1;
|
||||
const size_t kTagLengthAndInitialLengthByteLength = kTagLength + 1;
|
||||
|
||||
--
|
||||
2.24.0
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
PTHREAD_STACK_MIN is no longer a compile time define in glibc 2.34+ and since
|
||||
we only care for glibc and musl where PTHREAD_STACK_MIN is always defined there
|
||||
is no need to check for constant called PTHREAD_STACK_MIN since its already defined
|
||||
this fix may not work for wider audience but for OE needs its sufficient
|
||||
|
||||
Upstream-Status: Inappropriate [OE-only fix]
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
--- a/src/third_party/boost-1.70.0/boost/thread/pthread/thread_data.hpp
|
||||
+++ b/src/third_party/boost-1.70.0/boost/thread/pthread/thread_data.hpp
|
||||
@@ -57,9 +57,7 @@ namespace boost
|
||||
#else
|
||||
std::size_t page_size = ::sysconf( _SC_PAGESIZE);
|
||||
#endif
|
||||
-#if PTHREAD_STACK_MIN > 0
|
||||
if (size<PTHREAD_STACK_MIN) size=PTHREAD_STACK_MIN;
|
||||
-#endif
|
||||
size = ((size+page_size-1)/page_size)*page_size;
|
||||
int res = pthread_attr_setstacksize(&val_, size);
|
||||
BOOST_VERIFY(!res && "pthread_attr_setstacksize failed");
|
||||
@@ -0,0 +1,54 @@
|
||||
From 298d958148f1fb2bb7725fed15c68c09677c14c9 Mon Sep 17 00:00:00 2001
|
||||
From: Vincent Prince <vincent.prince.fr@gmail.com>
|
||||
Date: Mon, 16 Sep 2019 13:37:10 +0200
|
||||
Subject: [PATCH 05/10] Add alises for arm64 which is same as aarch64
|
||||
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
Signed-off-by: Vincent Prince <vincent.prince.fr@gmail.com>
|
||||
---
|
||||
SConstruct | 1 +
|
||||
src/third_party/IntelRDFPMathLib20U1/SConscript | 2 +-
|
||||
src/third_party/wiredtiger/SConscript | 2 +-
|
||||
3 files changed, 3 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/SConstruct b/SConstruct
|
||||
index 448939bdd0..abfd816f3e 100644
|
||||
--- a/SConstruct
|
||||
+++ b/SConstruct
|
||||
@@ -1228,6 +1228,7 @@ if endian == "auto":
|
||||
processor_macros = {
|
||||
'arm' : { 'endian': 'little', 'defines': ('__arm__',) },
|
||||
'aarch64' : { 'endian': 'little', 'defines': ('__arm64__', '__aarch64__')},
|
||||
+ 'arm64' : { 'endian': 'little', 'defines': ('__arm64__', '__aarch64__')},
|
||||
'i386' : { 'endian': 'little', 'defines': ('__i386', '_M_IX86')},
|
||||
'ppc64le' : { 'endian': 'little', 'defines': ('__powerpc64__',)},
|
||||
's390x' : { 'endian': 'big', 'defines': ('__s390x__',)},
|
||||
diff --git a/src/third_party/IntelRDFPMathLib20U1/SConscript b/src/third_party/IntelRDFPMathLib20U1/SConscript
|
||||
index 58e1b7ba65..bffe83b462 100644
|
||||
--- a/src/third_party/IntelRDFPMathLib20U1/SConscript
|
||||
+++ b/src/third_party/IntelRDFPMathLib20U1/SConscript
|
||||
@@ -309,7 +309,7 @@ if processor == 'i386' or processor == 'emscripten':
|
||||
elif processor == 'arm':
|
||||
cpp_defines['IA32'] = '1'
|
||||
cpp_defines['ia32'] = '1'
|
||||
-elif processor == "aarch64":
|
||||
+elif processor == "aarch64" or processor == 'arm64':
|
||||
cpp_defines['efi2'] = '1'
|
||||
cpp_defines['EFI2'] = '1'
|
||||
# Using 64 bit little endian
|
||||
diff --git a/src/third_party/wiredtiger/SConscript b/src/third_party/wiredtiger/SConscript
|
||||
index d6bd665e23..2f1e656a19 100644
|
||||
--- a/src/third_party/wiredtiger/SConscript
|
||||
+++ b/src/third_party/wiredtiger/SConscript
|
||||
@@ -152,7 +152,7 @@ condition_map = {
|
||||
'POSIX_HOST' : not env.TargetOSIs('windows'),
|
||||
'WINDOWS_HOST' : env.TargetOSIs('windows'),
|
||||
|
||||
- 'ARM64_HOST' : env['TARGET_ARCH'] == 'aarch64',
|
||||
+ 'ARM64_HOST' : env['TARGET_ARCH'] in ('aarch64', 'arm64'),
|
||||
'POWERPC_HOST' : env['TARGET_ARCH'] == 'ppc64le',
|
||||
'X86_HOST' : env['TARGET_ARCH'] == 'x86_64',
|
||||
'ZSERIES_HOST' : env['TARGET_ARCH'] == 's390x',
|
||||
--
|
||||
2.24.0
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
Lets use cached result for this otherwise runtime test, on qemuppc64
|
||||
when this test is run using gcc11, it returns 1, since we dont worry
|
||||
about older compilers here, we can cache the result and use it here
|
||||
|
||||
Upstream-Status: Inappropriate [Cross-compile specific]
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
--- a/SConstruct
|
||||
+++ b/SConstruct
|
||||
@@ -3904,7 +3904,7 @@ def doConfigure(myenv):
|
||||
|
||||
conf.AddTest('CheckAltivecVbpermqOutput', CheckAltivecVbpermqOutput)
|
||||
|
||||
- outputIndex = next((idx for idx in [0,1] if conf.CheckAltivecVbpermqOutput(idx)), None)
|
||||
+ outputIndex = 1
|
||||
if outputIndex is not None:
|
||||
conf.env.SetConfigHeaderDefine("MONGO_CONFIG_ALTIVEC_VEC_VBPERMQ_OUTPUT_INDEX", outputIndex)
|
||||
else:
|
||||
@@ -0,0 +1,18 @@
|
||||
Subject: [PATCH] stacktrace: Define ARCH_BITS for ppc64
|
||||
|
||||
src/mongo/util/stacktrace_somap.cpp:89:2: error: #error Unknown target architecture.
|
||||
stacktrace_somap.cpp:92:33: error: 'ELFCLASSARCH_BITS' was not declared in this scope
|
||||
|
||||
Upstream-Status: Pending
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
--- a/src/mongo/util/stacktrace_somap.cpp
|
||||
+++ b/src/mongo/util/stacktrace_somap.cpp
|
||||
@@ -81,7 +81,7 @@ void addUnameToSoMap(BSONObjBuilder* soM
|
||||
|
||||
#if defined(__ELF_NATIVE_CLASS) // determine ARCH_BITS
|
||||
#define ARCH_BITS __ELF_NATIVE_CLASS
|
||||
-#elif defined(__x86_64__) || defined(__aarch64__)
|
||||
+#elif defined(__x86_64__) || defined(__aarch64__) || defined(__powerpc64__)
|
||||
#define ARCH_BITS 64
|
||||
#elif defined(__i386__) || defined(__arm__)
|
||||
#define ARCH_BITS 32
|
||||
@@ -0,0 +1,147 @@
|
||||
SUMMARY = "mongodb"
|
||||
LICENSE = "SSPL-1 & Apache-2.0 & Zlib"
|
||||
LIC_FILES_CHKSUM = "file://LICENSE-Community.txt;md5=3a865f27f11f43ecbe542d9ea387dcf1 \
|
||||
file://APACHE-2.0.txt;md5=3b83ef96387f14655fc854ddc3c6bd57"
|
||||
|
||||
DEPENDS = "openssl libpcap zlib boost curl python3 \
|
||||
python3-setuptools-native \
|
||||
python3-pyyaml-native python3-cheetah-native \
|
||||
python3-psutil-native python3-regex-native \
|
||||
"
|
||||
|
||||
inherit scons dos2unix siteinfo python3native systemd useradd
|
||||
|
||||
PV = "4.4.19"
|
||||
#v4.4.18
|
||||
SRCREV = "9a996e0ad993148b9650dc402e6d3b1804ad3b8a"
|
||||
SRC_URI = "git://github.com/mongodb/mongo.git;branch=v4.4;protocol=https \
|
||||
file://0001-Tell-scons-to-use-build-settings-from-environment-va.patch \
|
||||
file://0001-Use-long-long-instead-of-int64_t.patch \
|
||||
file://0001-Use-__GLIBC__-to-control-use-of-gnu_get_libc_version.patch \
|
||||
file://0002-Add-a-definition-for-the-macro-__ELF_NATIVE_CLASS.patch \
|
||||
file://arm64-support.patch \
|
||||
file://0001-IntelRDFPMathLib20U1-Check-for-__DEFINED_wchar_t.patch \
|
||||
file://0001-Support-deprecated-resolver-functions.patch \
|
||||
file://0003-Fix-unknown-prefix-env.patch \
|
||||
file://1296.patch \
|
||||
file://0001-Fix-compilation-with-fno-common.patch \
|
||||
file://0001-stacktrace-Define-ARCH_BITS-for-x86.patch \
|
||||
file://0001-include-needed-c-header.patch \
|
||||
file://disable_runtime_check.patch \
|
||||
file://ppc64_ARCH_BITS.patch \
|
||||
file://PTHREAD_STACK_MIN.patch \
|
||||
file://0001-add-explict-static_cast-size_t-to-maxMemoryUsageByte.patch \
|
||||
file://0001-server-Adjust-the-cache-alignment-assumptions.patch \
|
||||
file://0001-The-std-lib-unary-binary_function-base-classes-are-d.patch \
|
||||
file://0001-free_mon-Include-missing-cstdint.patch \
|
||||
file://0001-apply-msvc-workaround-for-clang-16.patch \
|
||||
file://0001-Fix-type-mismatch-on-32bit-arches.patch \
|
||||
"
|
||||
SRC_URI:append:libc-musl ="\
|
||||
file://0001-Mark-one-of-strerror_r-implementation-glibc-specific.patch \
|
||||
file://0002-Fix-default-stack-size-to-256K.patch \
|
||||
file://0004-wiredtiger-Disable-strtouq-on-musl.patch \
|
||||
file://0001-wiredtiger-Avoid-using-off64_t.patch \
|
||||
"
|
||||
|
||||
SRC_URI:append:toolchain-clang = "\
|
||||
file://0001-asio-Dont-use-experimental-with-clang.patch \
|
||||
"
|
||||
|
||||
S = "${WORKDIR}/git"
|
||||
|
||||
CVE_CHECK_IGNORE += "\
|
||||
CVE-2014-8180 \
|
||||
CVE-2017-18381 \
|
||||
CVE-2017-2665 \
|
||||
"
|
||||
|
||||
COMPATIBLE_HOST ?= '(x86_64|i.86|powerpc64|arm|aarch64).*-linux'
|
||||
|
||||
PACKAGECONFIG ??= "tcmalloc system-pcre"
|
||||
# gperftools compilation fails for arm below v7 because of missing support of
|
||||
# dmb operation. So we use system-allocator instead of tcmalloc
|
||||
PACKAGECONFIG:remove:armv6 = "tcmalloc"
|
||||
PACKAGECONFIG:remove:libc-musl = "tcmalloc"
|
||||
PACKAGECONFIG:remove:riscv64 = "tcmalloc"
|
||||
PACKAGECONFIG:remove:riscv32 = "tcmalloc"
|
||||
|
||||
PACKAGECONFIG[tcmalloc] = "--use-system-tcmalloc,--allocator=system,gperftools,"
|
||||
PACKAGECONFIG[shell] = ",--js-engine=none,,"
|
||||
PACKAGECONFIG[system-pcre] = "--use-system-pcre,,libpcre,"
|
||||
|
||||
MONGO_ARCH ?= "${HOST_ARCH}"
|
||||
MONGO_ARCH:powerpc64le = "ppc64le"
|
||||
WIREDTIGER ?= "off"
|
||||
WIREDTIGER:x86-64 = "on"
|
||||
WIREDTIGER:aarch64 = "on"
|
||||
|
||||
# ld.gold: fatal error: build/59f4f0dd/mongo/mongod: Structure needs cleaning
|
||||
LDFLAGS:append:x86:libc-musl = " -fuse-ld=bfd"
|
||||
LDFLAGS:remove:toolchain-clang = "-fuse-ld=bfd"
|
||||
|
||||
EXTRA_OESCONS = "PREFIX=${prefix} \
|
||||
DESTDIR=${D} \
|
||||
MAXLINELENGTH='2097152' \
|
||||
LIBPATH=${STAGING_LIBDIR} \
|
||||
LINKFLAGS='${LDFLAGS}' \
|
||||
CXXFLAGS='${CXXFLAGS}' \
|
||||
TARGET_ARCH=${MONGO_ARCH} \
|
||||
MONGO_VERSION=${PV} \
|
||||
OBJCOPY=${OBJCOPY} \
|
||||
--ssl \
|
||||
--disable-warnings-as-errors \
|
||||
--use-system-zlib \
|
||||
--nostrip \
|
||||
--endian=${@oe.utils.conditional('SITEINFO_ENDIANNESS', 'le', 'little', 'big', d)} \
|
||||
--wiredtiger='${WIREDTIGER}' \
|
||||
--separate-debug \
|
||||
${PACKAGECONFIG_CONFARGS}"
|
||||
|
||||
USERADD_PACKAGES = "${PN}"
|
||||
USERADD_PARAM:${PN} = "--system --no-create-home --home-dir /var/run/${BPN} --shell /bin/false --user-group ${BPN}"
|
||||
|
||||
scons_do_compile() {
|
||||
${STAGING_BINDIR_NATIVE}/scons ${PARALLEL_MAKE} ${EXTRA_OESCONS} install-core ||
|
||||
die "scons build execution failed."
|
||||
}
|
||||
|
||||
scons_do_install() {
|
||||
# install binaries
|
||||
install -d ${D}${bindir}
|
||||
for i in mongod mongos mongo; do
|
||||
if [ -f ${B}/build/*/mongo/$i ]; then
|
||||
install -m 0755 ${B}/build/*/mongo/$i ${D}${bindir}
|
||||
else
|
||||
bbnote "$i does not exist"
|
||||
fi
|
||||
done
|
||||
|
||||
# install config
|
||||
install -d ${D}${sysconfdir}
|
||||
install -m 0644 ${S}/debian/mongod.conf ${D}${sysconfdir}
|
||||
|
||||
# install systemd service
|
||||
install -d ${D}${systemd_system_unitdir}
|
||||
install -m 0644 ${S}/debian/mongod.service ${D}${systemd_system_unitdir}
|
||||
|
||||
# install mongo data folder
|
||||
install -m 755 -d ${D}${localstatedir}/lib/${BPN}
|
||||
chown ${BPN}:${BPN} ${D}${localstatedir}/lib/${BPN}
|
||||
|
||||
# Create /var/log/mongodb in runtime.
|
||||
if [ "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}" ]; then
|
||||
install -d ${D}${nonarch_libdir}/tmpfiles.d
|
||||
echo "d ${localstatedir}/log/${BPN} 0755 ${BPN} ${BPN} -" > ${D}${nonarch_libdir}/tmpfiles.d/${BPN}.conf
|
||||
fi
|
||||
if [ "${@bb.utils.filter('DISTRO_FEATURES', 'sysvinit', d)}" ]; then
|
||||
install -d ${D}${sysconfdir}/default/volatiles
|
||||
echo "d ${BPN} ${BPN} 0755 ${localstatedir}/log/${BPN} none" > ${D}${sysconfdir}/default/volatiles/99_${BPN}
|
||||
fi
|
||||
}
|
||||
|
||||
CONFFILES:${PN} = "${sysconfdir}/mongod.conf"
|
||||
|
||||
SYSTEMD_SERVICE:${PN} = "mongod.service"
|
||||
|
||||
FILES:${PN} += "${nonarch_libdir}/tmpfiles.d"
|
||||
Reference in New Issue
Block a user