From: Luis Machado Date: Fri, 26 Nov 2021 14:31:18 +0000 (-0300) Subject: New --enable-threading configure option to control use of threads in GDB/GDBserver X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7593e4c70cebd99301d8485c647b1052deea4eea;p=thirdparty%2Fbinutils-gdb.git New --enable-threading configure option to control use of threads in GDB/GDBserver Add the --enable-threading configure option so multithreading can be disabled at configure time. This is useful for statically-linked builds of GDB/GDBserver, since the thread library doesn't play well with that setup. If you try to run a statically-linked GDB built with threading, it will crash when setting up the number of worker threads. This new option is also convenient when debugging GDB in a system with lots of threads, where the thread discovery code in GDB will emit too many messages, like so: [New Thread 0xfffff74d3a50 (LWP 2625599)] If you have X threads, that message will be repeated X times. The default for --enable-threading is "yes". --- diff --git a/gdbserver/configure b/gdbserver/configure index bcb15941ed1..f72d9dd0ef6 100755 --- a/gdbserver/configure +++ b/gdbserver/configure @@ -7283,6 +7283,22 @@ else fi + # ----------------------- # + # Check for threading. # + # ----------------------- # + + # Check whether --enable-threading was given. +if test "${enable_threading+set}" = set; then : + enableval=$enable_threading; case "$enableval" in + yes) want_threading=yes ;; + no) want_threading=no ;; + *) as_fn_error $? "bad value $enableval for threading" "$LINENO" 5 ;; + esac +else + want_threading=yes +fi + + # Check for std::thread. This does not work on some platforms, like # mingw and DJGPP. ac_ext=cpp