[CDRIVER-367] Solaris bson.c does not compile / Warnings Created: 19/May/14  Updated: 03/May/17  Resolved: 19/May/14

Status: Closed
Project: C Driver
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Udo Grabowski Assignee: Unassigned
Resolution: Cannot Reproduce Votes: 0
Labels: bson
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

See Perl Driver #345 comment:
<https://jira.mongodb.org/browse/PERL-345>
libbson version as used in Perl driver 0.703.4 .



 Description   

problems with Solaris CC compiler (x86):

<https://github.com/mongodb/mongo-perl-driver/commit/16c440d9209b3f7eb5a42078b183419677878a18>

does still not completely fix bson-context.c, see Perl driver
#324 and #345 comments:

<https://jira.mongodb.org/browse/PERL-324?focusedCommentId=588896&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-588896>

"bson/bson.c", line 1267: left operand must be modifiable lvalue: op "=" is not fixed by this commit.

Additionally, the current head of libbson cannot be exported by
zip (broken archive), see Perl driver #324 comment:
<https://jira.mongodb.org/browse/PERL-324?focusedCommentId=588890&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-588890>



 Comments   
Comment by Udo Grabowski [ 19/May/14 ]

autoconf (GNU Autoconf) 2.69, automake (GNU automake) 1.11.6, libtool (GNU libtool) 2.4.2 (maybe a bit old).

Comment by Christian Hergert [ 19/May/14 ]

Missing valid libtool perhaps? We have a couple of more requirements when building from Git that are not required when building from a release tarball. Namely:

  • Recent automake
  • Recent autoconf
  • Recent libtool
Comment by Udo Grabowski [ 19/May/14 ]

Checked with autogen.sh (which left a spurios LT_PREREQ(2.2) in configure, which I deleted) and configure, exactly the same result as with
cmake (that is, it works with just a few workarounds to apply). So the cmake build system works at least on Openindiana as expected.

Comment by Christian Hergert [ 19/May/14 ]

We have gone through considerable effort to make the configure scripts to check for everything. Duplicating that in CMake is a Sisyphean task, so it really only has the minimum necessary to build Visual Studio project files on Win32.

Comment by Udo Grabowski [ 19/May/14 ]

Indeed, I DID use cmake, that usually works ok on OpenIndiana (has cmake 2.8.11).

Comment by Christian Hergert [ 19/May/14 ]

I just want to double check that you are not using CMake. CMake is our build system for Win32 and should not be used on *nix's. (Use ./autogen.sh or ./configure if a release tarball, make, make check).

Comment by Udo Grabowski [ 19/May/14 ]

I've "stealed" mbarrier.h and sys/mbarrier.h from the Update 2 distribution, and that compiled with Update 1. One error remained,
which I fixed by eliminating the alternative SunOS path in bson-clock.h, the struct timezone *tz works with Solaris x86 (openindiana-a9).
After that, everything compiled and passed the test-libbson !

"/tmp/libbson-e0af62fbe02ff07e0498814d1dfdba07644687c7/src/bson/bson-clock.c", line 55: identifier redeclared: bson_gettimeofday
current : function(pointer to struct timeval

{long tv_sec, long tv_usec}, pointer to struct timezone {int tz_minuteswest, int tz_dsttime}) returning int
previous: function(pointer to struct timeval {long tv_sec, long tv_usec}

, pointer to void) returning int : "/tmp/libbson-e0af62fbe02ff07e0498814d1dfdba07644687c7/src/bson/bson-clock.h", line 36
cc: acomp failed for /tmp/libbson-e0af62fbe02ff07e0498814d1dfdba07644687c7/src/bson/bson-clock.c
gmake[2]: *** [CMakeFiles/bson_shared.dir/src/bson/bson-clock.c.o] Error 1
gmake[1]: *** [CMakeFiles/bson_shared.dir/all] Error 2

Comment by Christian Hergert [ 19/May/14 ]

Thanks for the update Udo, I was just about to suggest using the tar.gz export version from github. I imagine they are building the exported zip's with GNU zip, which might not be compatible with Solaris zip. (I know the default gtar, not using ustar format has similar issues). Our release tarballs do explicitly work around this by using ustar format.

I'll look into adding a configure.ac check for mbarrier.h and fallback to an alternate means. If you are using Solaris Studio, however, this will probably be a lock/unlock and very much not optimal. (Otherwise I'll have to hand write assembler for SPARC/x86 which I'd like to avoid). Although, do you happen to know of an alternate memory barrier intrinsic for older Solaris Studio?

In terms of format support, however, we will be supporting the newest Solaris Studio only. That said, I'd certainly like to see it support as much as possible.

Comment by Udo Grabowski [ 19/May/14 ]

I could finally unzip it with 7z, but not unzip. Probably the 2.32 zip version is not compatible with the newer zip archive.

The latest libbson-e0af62fbe02ff07e0498814d1dfdba07644687c7 cannot be compiled with Sun Studio 12 Update 1, because it needs
mbarrier.h, which is only provided by Update >= 2. But Sun Studio > Update 1 is not free software anymore, you need a license to use it.
So all open-source Opensolaris variants like openindiana, smartos, etc.. cannot compile this version anymore (and the old Perl driver with
the older libbson leaks memory like hell...).

Comment by Christian Hergert [ 19/May/14 ]

Libbson works and is supported on Solaris with Solaris CC compiler. The version bundled in the Perl driver is behind the version of Libbson that added support for Solaris. I verified on Linux the exported zip from github which also works just fine.

Generated at Wed Feb 07 21:09:16 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.