[CXX-921] legacy driver fails to build on FreeBSD Created: 07/Jun/16  Updated: 21/Jun/16  Resolved: 21/Jun/16

Status: Closed
Project: C++ Driver
Component/s: Build, Portability
Affects Version/s: legacy-1.1.1
Fix Version/s: legacy-1.1.2

Type: Bug Priority: Major - P3
Reporter: Giulio Paci Assignee: J Rassi
Resolution: Done Votes: 0
Labels: legacy-cxx
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on CXX-924 legacy driver fails to build on Hurd Closed

 Description   

Trying to compile mongo-cxx-driver on FreeBSD fails with error
#error Must implement SecureRandom for platform

The OpenBSD implementation for SecureRandom should work on FreeBSD as well (not checked, as I have no direct access to a FreeBSD installation at the moment).

You can see a complete log of the failure here:
https://buildd.debian.org/status/fetch.php?pkg=mongo-cxx-driver-legacy&arch=kfreebsd-amd64&ver=1.1.1-1&stamp=1464681161



 Comments   
Comment by Githook User [ 21/Jun/16 ]

Author:

{u'username': u'giuliopaci', u'name': u'Giulio Paci', u'email': u'giuliopaci@gmail.com'}

Message: CXX-921 Fix compilation on Debian GNU/kFreeBSD.

Signed-off-by: J. Rassi <rassi@10gen.com>
Branch: legacy
https://github.com/mongodb/mongo-cxx-driver/commit/c182bcf098417c826c5fa82609e8530baf2330e3

Comment by David Golden [ 13/Jun/16 ]

Thanks!

Comment by Giulio Paci [ 13/Jun/16 ]

This also did not work (apparently this macro is for old kernels) however in https://jira.mongodb.org/browse/CXX-924 I attached a patch that makes compilation work.
The correct macro on this system is _FreeBSD_kernel_.

Comment by David Golden [ 09/Jun/16 ]

Apologies for my bad Jira markup – to clarify, that define should be __FreeBSD__.

Comment by David Golden [ 09/Jun/16 ]

That error suggests the compiler macro for FreeBSD is incorrect. According to this page, it should probably be __FreeBSD__.

If you change this line to check __FreeBSD__, does it compile? If not, what errors do you get?

Comment by Andrew Morrow (Inactive) [ 07/Jun/16 ]

Thanks for the bug report. I suspect that you are right that the fix is straightforward. Unfortunately, we do no testing on either OpenBSD or FreeBSD. My recommendation is that you create a pull request with the necessary FreeBSD changes to get it to build and we can start from there.

Generated at Wed Feb 07 22:00:47 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.