gdbsupport/configure.ac: source development.sh
authorVyacheslav Petrishchev <vyachemail@gmail.com>
Wed, 26 Feb 2020 06:32:03 +0000 (12:32 +0600)
committerSimon Marchi <simon.marchi@efficios.com>
Thu, 5 Mar 2020 19:33:17 +0000 (14:33 -0500)
[Commit message by Simon Marchi]

The GDB build in non-development mode (turn development to false in
bfd/development.sh if you want to try) is currently broken:

      CXXLD  gdb
    /home/smarchi/src/binutils-gdb/gdb/disasm-selftests.c:218: error: undefined reference to 'selftests::register_test_foreach_arch(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, void (*)(gdbarch*))'
    /home/smarchi/src/binutils-gdb/gdb/disasm-selftests.c:220: error: undefined reference to 'selftests::register_test_foreach_arch(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, void (*)(gdbarch*))'
    /home/smarchi/src/binutils-gdb/gdb/dwarf2/frame.c:2310: error: undefined reference to 'selftests::register_test_foreach_arch(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, void (*)(gdbarch*))'
    /home/smarchi/src/binutils-gdb/gdb/gdbarch-selftests.c:168: error: undefined reference to 'selftests::register_test_foreach_arch(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, void (*)(gdbarch*))'
    /home/smarchi/src/binutils-gdb/gdbsupport/selftest.cc:96: error: undefined reference to 'selftests::reset()'

This is because the gdbsupport configure script doesn't source
bfd/development.sh to set the development variable.  When $development
is unset, GDB_AC_SELFTEST defaults to enabling selftests.  I don't think
the macro was written with this intention in mind, it just happens to be
that way.

So gdbsupport thinks selftests are enabled, while gdb thinks they are
disabled.  gdbsupport compiles in code that calls selftests:: functions,
which are normally provided by gdb, but gdb doesn't provide them, hence
the undefined references.

Fix this by sourcing bfd/development.sh in gdbsupport/configure.ac, so
that the development variable is set.

gdbsupport/ChangeLog:

        * configure.ac: Added call development.sh.
        * configure: Regenerate.

gdbsupport/ChangeLog
gdbsupport/configure
gdbsupport/configure.ac

index c47bb4ebbbadb1e1fcb75bd2bab9602b56230ea1..6bfd6768727c5538dade3c8b7a2dd5bb0a8bd421 100644 (file)
@@ -1,3 +1,8 @@
+2020-03-05  Vyacheslav Petrishchev  <vyachemail@gmail.com>
+
+       * configure.ac: Added call development.sh.
+       * configure: Regenerate.
+
 2020-03-05  Tankut Baris Aktemur  <tankut.baris.aktemur@intel.com>
 
        * .gitattributes: New file.
index a4871f8d5bce1bd25f491b28d103099b58f60adf..e7a99e3ddfba2de630afbf9f390e96a107b8da23 100755 (executable)
@@ -6569,6 +6569,9 @@ fi
 am_cv_prog_cc_stdc=$ac_cv_prog_cc_stdc
 
 
+# Set the 'development' global.
+. $srcdir/../bfd/development.sh
+
 # We require a C++11 compiler.  Check if one is available, and if
 # necessary, set CXX_DIALECT to some -std=xxx switch.
 
index 401e16f821da462b81d39f9a949b0b419165780b..ab71a3cb3665f4f88e529ecac3b752f2c62de00d 100644 (file)
@@ -33,6 +33,9 @@ AC_USE_SYSTEM_EXTENSIONS
 ACX_LARGEFILE
 AM_PROG_CC_STDC
 
+# Set the 'development' global.
+. $srcdir/../bfd/development.sh
+
 # We require a C++11 compiler.  Check if one is available, and if
 # necessary, set CXX_DIALECT to some -std=xxx switch.
 AX_CXX_COMPILE_STDCXX(11, , mandatory)
This page took 0.028888 seconds and 4 git commands to generate.