Repository navigation
[build] mongodb on SmartOS: g++ version #73
Description
Activity
It's something we will probably have to do at some point, but obviously it is a huge change so needs to be tested thoroughly. At present MongoDB is the only software that I'm aware of that requires a newer compiler than our current default of GCC 4.9.
I switched our daily bulk builds over to GCC 6 a while back so that we can start to look at what the state of play is, and there is quite a lot of fallout from the default compilation environment changing from C89 to C11:
I've been working on fixing issues as they come up when time permits but the builds with GCC 6 are still quite far behind those done with GCC 4.9. At the same time I've recently been looking at what's involved in switching to Clang to see if that might be a better option if we're going to have to do a bunch of work either way.
So, for now, we're still in a preparation and exploration phase. With only one piece of software requiring the upgrade we're not going to rush quickly into something that may cause regressions.
Hope that helps explain the situation.
That makes complete sense to me... switching compilers is not a change undertaken lightly. I'm not at all surprised I found the one package that has a problem!
I was able to get packages built that will solve the problem for me in the short term, so I was mainly attempting to get the problem and resolution on record in case anyone else runs into the problem.
I may go back through and see if it will build using 4.9. GCC 4.9 claims C++11 compliance which is what mongodb is supposedly tracking.
One other workaround would be to make sure all the MongoDB dependencies are built embedded. That's hardly a sanctioned approach in pkgsrc, but may be better than nothing. IIRC the MongoDB source tarball used to come with vendored sources for all (most?) deps and it was the default behavior.
The other thing is that upstream has dropped all SunOS support recently and we might see ugly portability issues coming our way.
I did attempt to build using the embedded dependencies and it didn't solve the problem (though the problem did move). I did not take the time to see if that was something that was easily fixable.
Getting on my soapbox, it's a shame that they're no longer supporting SunOS, but that seems to be an unfortunate trend. I have run into a number of projects that pretend that no other OS exist aside from Linux; that Darwin even exists is a major thorn, let alone SunOS.
- added a commit that references this issue
on Mar 15, 2018 - added a commit that references this issue
on Apr 5, 2018 - added 2 commits that reference this issue
on Aug 16, 2018 - added a commit that references this issue
on Sep 20, 2018 - added 2 commits that reference this issue
on Dec 1, 2018 - added a commit that references this issue
on Feb 2, 2019 161 remaining items
Load more actions- added a commit that references this issue
on Jun 7, 2026 - added a commit that references this issue
on Aug 11, 2026 - added a commit that references this issue
on Aug 25, 2026 - added a commit that references this issue
on Aug 26, 2026 - added a commit that references this issue
on Sep 9, 2026 - added a commit that references this issue
on Sep 29, 2026
Hi,
I spent some time trying to figure out why mongodb packages aren't available on SmartOS. The solution is fairly simple yet likely would result in upheaval... I'd love for the change to be made but will settle for it being documented here.
It seems that mongodb requires g++ version 5.3 or higher, however all of its dependencies have no such requirement, so they use the default g++ version (4.9 iirc). This results in name mangling incompatibilities which prevents the mongo binaries from linking.
I was able to get it to build by changing the system minimum gcc version (GCC_REQD) to 5.3 and recompiling the C++ dependencies.
Is there any chance of (or plans to) increasing the minimum g++ (c libraries obviously don't have this sort of version incompatibility for the most part) version in future joyent build releases?
There are other possible solutions, as referenced in this developer list email, but they all seem pretty brittle and/or don't make the situation any better on smartos:
https://groups.google.com/forum/#!topic/mongodb-dev/NVDytnnOUhg
Bill