[SERVER-12456] Debug builds on solaris fail to link Created: 23/Jan/14  Updated: 11/Jul/16  Resolved: 25/Jan/14

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

Type: Bug Priority: Minor - P4
Reporter: Andrew Morrow (Inactive) Assignee: Unassigned
Resolution: Done Votes: 0
Labels: build
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Operating System: Solaris
Steps To Reproduce:

Build on solaris with --dbg=on

Participants:

 Description   

When building the server on solaris with the --dbg=on flag, all targets fail to link, with errors like:

ld: fatal: symbol referencing errors. No output written to build/cached/bsondemo
collect2: ld returned 1 exit status
scons: *** [build/cached/bsondemo] Error 1
Undefined                       first referenced
 symbol                             in file
__stack_chk_fail                    build/cached/mongo/client/auth_helpers.o
__stack_chk_guard                   build/cached/mongo/client/auth_helpers.o

The problem appears to be that we are not linking libssp.so as required on solaris to satisfy these symbols.



 Comments   
Comment by Githook User [ 25/Jan/14 ]

Author:

{u'username': u'acmorrow', u'name': u'Andrew Morrow', u'email': u'acm@10gen.com'}

Message: SERVER-12456 Also pass stack protector option to the link step
Branch: master
https://github.com/mongodb/mongo/commit/fc0280414c48c1c7f85ab32c1999cb9e04184986

Comment by Andrew Morrow (Inactive) [ 23/Jan/14 ]

Looked into this a bit more, I think the issue is that we are adding -fstack-protector to CCFLAGS, but not to LINKFLAGS or SHLINKFLAGS. Since we don't propagate CCFLAGS to our link step, the link doesn't see -fstack-protector so doesn't know to pull in libssp.so.

The fix is to add -fstack-protector to LINKFLAGS and SHLINKFLAGS when we add it to CCFLAGS.

Generated at Thu Feb 08 03:28:35 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.