cassandra-cpp-drvier 2.8.1-r2 unresolved reference to cass::rb::RingBufferBio::initialize()
https://github.com/datastax/cpp-driver/blob/master/examples/basic/basic.c failed to build:
cr-alpine:~$ cc basic.c -lcassandra
/usr/lib/gcc/x86_64-alpine-linux-musl/6.4.0/../../../../lib/libcassandra.so:
undefined reference to `cass::rb::RingBufferBio::initialize()’
collect2: error: ld returned 1 exit status
The following diff to datastax’s cpp cassandra driver seems to fix the issue:
diff —git a/src/ssl/ssl_openssl_impl.cpp
b/src/ssl/ssl_openssl_impl.cpp
index 1ec0b60b..43a38d3d 100644
—- a/src/ssl/ssl_openssl_impl.cpp
+ b/src/ssl/ssl_openssl_impl.cpp
@@ –113,7 +113,7 @@ static int pem_password_callback(char* buf, int
size, int rwflag, void* u) {
return len;
}
-#if OPENSSL_VERSION_NUMBER < 0x10100000L
+#if OPENSSL_VERSION_NUMBER < 0x10100000L ||
defined(LIBRESSL_VERSION_NUMBER)
static uv_rwlock_t* crypto_locks;
static void crypto_locking_callback(int mode, int n, const char*
file, int line) {
@@ –597,7 +597,7 @@ void OpenSslContextFactory::init() {
SSL_load_error_strings();
OpenSSL_add_all_algorithms();
-#if OPENSSL_VERSION_NUMBER < 0x10100000L
+#if OPENSSL_VERSION_NUMBER < 0x10100000L ||
defined(LIBRESSL_VERSION_NUMBER)
// We have to set the lock/id callbacks for use of OpenSSL thread
safety.
// It’s not clear what’s thread-safe in OpenSSL. Writing/Reading to
// a single “SSL” object is NOT and we don’t do that, but we do create
multiple
(from redmine: issue id 9204, created on 2018-08-07)