Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-48546

Linker error building with scons --gdbserver

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.7.0
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • Fully Compatible
    • ALL
    • Dev Platform 2020-06-29

      I added a call to breakpoint() in cluster_commands_helpers.cpp, along with #include "mongo/util/debugger.h", and built with scons --gdbserver but got a linker error:

      FAILED: build/ninja/mongo/s/libsharding_router_api.so
      PATH=/opt/mongodbtoolchain/v3/bin:/usr/local/bin:/opt/bin:/bin:/usr/bin CCACHE_NOCPP2=1 ICECC_VERSION=/mirror/co/mongo/build/scons/icecc/opt_mongodbtoolchain_v3_bin_gcc_opt_mongodbtoolchain_v3_bin_g++.tar.gz CCACHE_PREFIX=/usr/bin/icecc /usr/bin/icerun /opt/mongodbtoolchain/v3/bin/g++ @build/nin
      ja/mongo/s/libsharding_router_api.so.rsp
      src/mongo/s/cluster_commands_helpers.cpp:249: error: undefined reference to 'mongo::breakpoint()'
      collect2: error: ld returned 1 exit status
      

      acm said the short-term fix is to add "debugger" as a LIBDEP. To avoid this manual step in the future for --gdbserver builds, he suggested either 1) libdebugger should be come a public LIBDEP of libbase, OR 2) we should fold debugger.cpp into libbase.

            Assignee:
            andrew.morrow@mongodb.com Andrew Morrow (Inactive)
            Reporter:
            jesse@mongodb.com A. Jesse Jiryu Davis
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: