[SERVER-12255] Building with --32 on a 64 bit host machine fails due to tcmalloc linking errors Created: 05/Jan/14  Updated: 11/Jul/16  Resolved: 07/Apr/14

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

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

Linux 64, targeting linux-32


Issue Links:
Depends
Operating System: Linux
Participants:

 Description   

Our build system declares that tcmalloc is the default allocator for 64-bit builds, and that the system allocator is the default for 32-bit builds. However, it accomplishes this by examining the host architecture, rather than the target architecture.

As a result, when building on a 64-bit machine with the --32 flag, tcmalloc is enabled. However, our tcmalloc SConscript does not include all of the files necessary to build tcmalloc in 32-bit mode, in particular the files base/vdso_support and base/elf_mem_image.cc.

Being able to do 32 bit builds on a 64 bit machine would be nice. We should either:

1) Change the selection rules so that disabling tcmalloc is done based on the target, rather than the host architecture.
2) Fix our tcmalloc build rules to include the missing files.

If we do the latter, I'm not aware of anything that would prevent us from using tcmalloc in 32-bit environments.



 Comments   
Comment by Githook User [ 07/Apr/14 ]

Author:

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

Message: SERVER-12255 Use tcmalloc on 32-bit linux and darwin as well
Branch: master
https://github.com/mongodb/mongo/commit/267065628351063a6738cdba7430ab4701a74325

Comment by Githook User [ 07/Apr/14 ]

Author:

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

Message: SERVER-12255 Fix missing symbols when building a 32 bit tcmalloc
Branch: master
https://github.com/mongodb/mongo/commit/77d93e43de30b997145c9a8a91d9a47f86b46b56

Comment by Githook User [ 07/Apr/14 ]

Author:

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

Message: SERVER-12255 Be explicit about target micro-architecture for 32-bit x86 builds
Branch: master
https://github.com/mongodb/mongo/commit/025a54c830e3315d89475db1ee93b5a99033d726

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

dan@10gen.com If we want to tackle MCI-1150, we will need to get this done first.

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

This is really more a multi-arch compile rather than a true cross compile. Ubuntu has been multi-arch for a while, and the standard issue gcc already knows how to target 32 bit.

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