summaryrefslogtreecommitdiff
path: root/gdbsupport/configure
diff options
context:
space:
mode:
authorLuis Machado <luis.machado@linaro.org>2021-11-26 11:31:18 -0300
committerLuis Machado <luis.machado@linaro.org>2021-12-15 17:00:00 -0300
commit261b07488b9dfe69090e6980f6de9d0f4f3f03ca (patch)
treec962f1627fd0fa4daa203300f8fc2fc77fd0c47b /gdbsupport/configure
parent4d3605c8ca92bcde848581a8ec031827c798501b (diff)
downloadbinutils-gdb-261b07488b9dfe69090e6980f6de9d0f4f3f03ca.tar.gz
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".
Diffstat (limited to 'gdbsupport/configure')
-rwxr-xr-xgdbsupport/configure24
1 files changed, 23 insertions, 1 deletions
diff --git a/gdbsupport/configure b/gdbsupport/configure
index 0b4e81a9c16..8b4cb7e098d 100755
--- a/gdbsupport/configure
+++ b/gdbsupport/configure
@@ -767,6 +767,7 @@ enable_silent_rules
enable_dependency_tracking
enable_plugins
enable_largefile
+enable_threading
with_intel_pt
with_gnu_ld
enable_rpath
@@ -1419,6 +1420,8 @@ Optional Features:
speeds up one-time build
--enable-plugins Enable support for plugins
--disable-largefile omit support for large files
+ --enable-threading include support for parallel processing of data
+ (yes/no)
--disable-rpath do not hardcode runtime library paths
--enable-unit-tests Enable the inclusion of unit tests when compiling
GDB
@@ -8277,6 +8280,22 @@ fi
done
+ # ----------------------- #
+ # 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
@@ -8974,10 +8993,13 @@ done
LIBS="$save_LIBS"
CXXFLAGS="$save_CXXFLAGS"
fi
- if test "$gdb_cv_cxx_std_thread" = "yes"; then
+
+ if test "$want_threading" = "yes"; then
+ if test "$gdb_cv_cxx_std_thread" = "yes"; then
$as_echo "#define CXX_STD_THREAD 1" >>confdefs.h
+ fi
fi
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'