[SERVER-48546] Linker error building with scons --gdbserver Created: 02/Jun/20  Updated: 29/Oct/23  Resolved: 25/Jun/20

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 4.7.0

Type: Bug Priority: Major - P3
Reporter: A. Jesse Jiryu Davis Assignee: Andrew Morrow (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-49375 Clang with --link-model=dynamic produ... Closed
is related to SERVER-41835 symbol clashes: libgcc vs vendored In... Backlog
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Dev Platform 2020-06-29
Participants:

 Description   

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.



 Comments   
Comment by Githook User [ 25/Jun/20 ]

Author:

{'name': 'Andrew Morrow', 'email': 'acm@mongodb.com', 'username': 'acmorrow'}

Message: SERVER-48546 Reduce scope of libraries injected via libbase
Branch: master
https://github.com/mongodb/mongo/commit/78168e2c40cb61431e9bb0591a08e724459895f8

Comment by Githook User [ 25/Jun/20 ]

Author:

{'name': 'Andrew Morrow', 'email': 'acm@mongodb.com', 'username': 'acmorrow'}

Message: SERVER-48546 The quick_exit library was folded into base
Branch: master
https://github.com/10gen/mongo-enterprise-modules/commit/a0582d48e42098b668e833d75a8855f2454c7300

Generated at Thu Feb 08 05:17:26 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.