Statically linked galera library wrt. openssl

Bug #1237444 reported by Raghavendra D Prabhu
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona XtraDB Cluster moved to https://jira.percona.com/projects/PXC
Status tracked in 5.6
5.5
Fix Released
Undecided
Unassigned
5.6
Fix Released
Undecided
Unassigned

Bug Description

The binaries we provide are not linked statically wrt. galera
library which still depends on openssl library. This needs to be
fixed.

Tags: pkg
tags: added: pkg
Revision history for this message
Raghavendra D Prabhu (raghavendra-prabhu) wrote :

Adding galera component as well.

Revision history for this message
Raghavendra D Prabhu (raghavendra-prabhu) wrote :

Static linking to openssl is not straightforward here, even after overcoming the scons issues with static libs, it still leaves it with unresolved openssl symbols.

There is another way here - the whole thing can be created statifically - libgalera_smm.a but it is not possible to load (dlopen) this as wsrep_provider. Another option here is to statically link it with mysqld itself, but that will require a few changes in wsrep_load as well (to avoid dlopen and use dlsym).

Revision history for this message
Raghavendra D Prabhu (raghavendra-prabhu) wrote :

Creating the static library - libgalera_ssm.a is possible with few changes to SConscripts (I tried this) but again, need to follow up with latter if plausible.

Revision history for this message
Raghavendra D Prabhu (raghavendra-prabhu) wrote :

Also, building without SSL fails, will raise a separate issue for it.

summary: - Statically linked galera library
+ Statically linked galera library wrt. openssl
Revision history for this message
Raghavendra D Prabhu (raghavendra-prabhu) wrote :

https://bugs.launchpad.net/galera/+bug/1243729 is the issue reported for SSL=0 issue.

Revision history for this message
Raghavendra D Prabhu (raghavendra-prabhu) wrote :

13:45:58 /home/jenkins/workspace/percona-xtradb-cluster-55-binary-static-openssl/label_exp/centos6-32/percona-xtradb-cluster-galera/asio/asio/ssl/detail/openssl_init.hpp:63: undefined reference to `CRYPTO_set_id_callback'
13:45:58 /home/jenkins/workspace/percona-xtradb-cluster-55-binary-static-openssl/label_exp/centos6-32/percona-xtradb-cluster-galera/asio/asio/ssl/detail/openssl_init.hpp:64: undefined reference to `CRYPTO_set_locking_callback'
13:45:58 /home/jenkins/workspace/percona-xtradb-cluster-55-binary-static-openssl/label_exp/centos6-32/percona-xtradb-cluster-galera/asio/asio/ssl/detail/openssl_init.hpp:65: undefined reference to `ERR_free_strings'
13:45:58 /home/jenkins/workspace/percona-xtradb-cluster-55-binary-static-openssl/label_exp/centos6-32/percona-xtradb-cluster-galera/asio/asio/ssl/detail/openssl_init.hpp:66: undefined reference to `ERR_remove_state'
13:45:58 /home/jenkins/workspace/percona-xtradb-cluster-55-binary-static-openssl/label_exp/centos6-32/percona-xtradb-cluster-galera/asio/asio/ssl/detail/openssl_init.hpp:67: undefined reference to `EVP_cleanup'
13:45:58 /home/jenkins/workspace/percona-xtradb-cluster-55-binary-static-openssl/label_exp/centos6-32/percona-xtradb-cluster-galera/asio/asio/ssl/detail/openssl_init.hpp:68: undefined reference to `CRYPTO_cleanup_all_ex_data'

is the issue currently.

It is to do with unresolved SSL symbols.

It is not possible to build without ssl either due to lp:1243729.

Revision history for this message
Raghavendra D Prabhu (raghavendra-prabhu) wrote :

For now, the Galera libgalera_smm.so will be built without ssl (now that lp:1243729 is fixed) and distributed with staticially built mysqld.

Revision history for this message
Raghavendra D Prabhu (raghavendra-prabhu) wrote :

#7 won't be required since it is now possible to build with ssl. Fixed build-binary.sh accordingly.

Revision history for this message
Raghavendra D Prabhu (raghavendra-prabhu) wrote :

Note, for others building it:

This requires fPIC enabled zlib and openssl static libraries.

build-binary.sh is run like:

bash -x ./build/build-binary.sh --with-ssl="${openssl_prefix}" --tag="-static-openssl-${openssl_ver}" --with-jemalloc=jemalloc/ ./target

where openssl_prefix is where the openssl and zlib libraries are installed.

Revision history for this message
Raghavendra D Prabhu (raghavendra-prabhu) wrote :

build_binary.sh has also been modified for the build mentioned in #9.

no longer affects: galera
Revision history for this message
Shahriyar Rzayev (rzayev-sehriyar) wrote :

Percona now uses JIRA for bug reports so this bug report is migrated to: https://jira.percona.com/browse/PXC-1467

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.