All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] package/mongodb: fix build with glibc >= 2.34
@ 2021-11-13  8:35 Fabrice Fontaine
  2021-11-13  9:32 ` Yann E. MORIN
  0 siblings, 1 reply; 2+ messages in thread
From: Fabrice Fontaine @ 2021-11-13  8:35 UTC (permalink / raw)
  To: buildroot; +Cc: Fabrice Fontaine

Fix the following build failure with glibc >= 2.34:

In file included from /home/giuliobenetti/autobuild/run/instance-0/output-1/host/arm-buildroot-linux-gnueabihf/sysroot/usr/include/signal.h:328,
                 from /home/giuliobenetti/autobuild/run/instance-0/output-1/host/arm-buildroot-linux-gnueabihf/include/c++/11.2.0/csignal:42,
                 from src/mongo/stdx/thread.h:33,
                 from src/mongo/db/client.h:46,
                 from src/mongo/db/operation_context.h:36,
                 from src/mongo/db/pipeline/variables.h:32,
                 from src/mongo/db/pipeline/dependencies.h:37,
                 from src/mongo/db/matcher/expression.h:38,
                 from src/mongo/db/matcher/expression_parser.h:34,
                 from src/mongo/db/pipeline/document_source_list_sessions.cpp:34:
src/mongo/stdx/thread.h:107:56: error: call to non-'constexpr' function 'long int sysconf(int)'
  107 |         std::max(kMongoMinSignalStackSize, std::size_t{MINSIGSTKSZ});
      |

Fixes:
 - http://autobuild.buildroot.org/results/6be8efb96547f8ec6e9b776abae8c1b51501e9ed

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
 ...-MINSIGSTKSZ-is-no-longer-a-constant.patch | 49 +++++++++++++++++++
 1 file changed, 49 insertions(+)
 create mode 100644 package/mongodb/0003-SERVER-59459-With-glibc-2-34-MINSIGSTKSZ-is-no-longer-a-constant.patch

diff --git a/package/mongodb/0003-SERVER-59459-With-glibc-2-34-MINSIGSTKSZ-is-no-longer-a-constant.patch b/package/mongodb/0003-SERVER-59459-With-glibc-2-34-MINSIGSTKSZ-is-no-longer-a-constant.patch
new file mode 100644
index 0000000000..02b35c6e4f
--- /dev/null
+++ b/package/mongodb/0003-SERVER-59459-With-glibc-2-34-MINSIGSTKSZ-is-no-longer-a-constant.patch
@@ -0,0 +1,49 @@
+From ef08d0dbc99db8c4620512e92bfb3154282eb5d3 Mon Sep 17 00:00:00 2001
+From: Andrew Morrow <acm@mongodb.com>
+Date: Wed, 15 Sep 2021 15:23:42 -0400
+Subject: [PATCH] SERVER-59459 With glibc-2.34, MINSIGSTKSZ is no longer a
+ constant
+
+[Retrieved (and backported) from:
+https://github.com/mongodb/mongo/commit/ef08d0dbc99db8c4620512e92bfb3154282eb5d3]
+Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+---
+ src/mongo/stdx/thread.h | 14 ++++++++++----
+ 1 file changed, 10 insertions(+), 4 deletions(-)
+
+diff --git a/src/mongo/stdx/thread.h b/src/mongo/stdx/thread.h
+index 7b15bb561bd9..6f1e16cdeb36 100644
+--- a/src/mongo/stdx/thread.h
++++ b/src/mongo/stdx/thread.h
+@@ -76,11 +76,19 @@ class SigAltStackController {
+     }
+ 
+ private:
++    static size_t _getStackSize() {
++        // It would be nice for this to be a constexpr, but
++        // MINSIGSTKSZ became a macro that invoked `sysconf` in glibc
++        // 2.34.
++        static const std::size_t kMinSigStkSz = MINSIGSTKSZ;
++        return std::max(kMongoMinSignalStackSize, kMinSigStkSz);
++    }
++
+     void _install() const {
+         stack_t ss;
+         ss.ss_sp = _stackStorage.get();
+         ss.ss_flags = 0;
+-        ss.ss_size = kStackSize;
++        ss.ss_size = _getStackSize();
+         if (sigaltstack(&ss, nullptr)) {
+             abort();
+         }
+@@ -107,9 +115,7 @@ class SigAltStackController {
+     //   ( https://jira.mongodb.org/secure/attachment/233569/233569_stacktrace-writeup.txt )
+     static constexpr std::size_t kMongoMinSignalStackSize = std::size_t{64} << 10;
+ 
+-    static constexpr std::size_t kStackSize =
+-        std::max(kMongoMinSignalStackSize, std::size_t{MINSIGSTKSZ});
+-    std::unique_ptr<std::byte[]> _stackStorage = std::make_unique<std::byte[]>(kStackSize);
++    std::unique_ptr<std::byte[]> _stackStorage = std::make_unique<std::byte[]>(_getStackSize());
+ 
+ #else   // !MONGO_HAS_SIGALTSTACK
+     auto makeInstallGuard() const {
-- 
2.33.0

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-11-13  9:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-11-13  8:35 [Buildroot] [PATCH 1/1] package/mongodb: fix build with glibc >= 2.34 Fabrice Fontaine
2021-11-13  9:32 ` Yann E. MORIN

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.