[MDEV-20779] Fail to build with homebrew's openssl Created: 2019-10-09  Updated: 2020-09-02

Status: Open
Project: MariaDB Server
Component/s: libmariadb
Affects Version/s: 10.4.7, 10.4.8
Fix Version/s: 10.4

Type: Bug Priority: Major
Reporter: Andy Li Assignee: Georg Richter
Resolution: Unresolved Votes: 0
Labels: None
Environment:

macOS



 Description   

Since commit d5a11a1f0208df87ee9885f5eb7a7427ee9a6f4a (first bad commit), the server cannot be build with homebrew's openssl@1.1.

To reproduce:

brew install openssl@1.1
cd path/to/server
mkdir test-build
cd test-build
cmake .. -DWITH_SSL=/usr/local/opt/openssl@1.1
make sha256_password

Result in:

Scanning dependencies of target sha256_password
Building C object libmariadb/CMakeFiles/sha256_password.dir/plugins/auth/sha256_pw.c.o
Linking C shared module sha256_password.so
Undefined symbols for architecture x86_64:
  "_BIO_free", referenced from:
      _auth_sha256_client in sha256_pw.c.o
  "_BIO_new_mem_buf", referenced from:
      _auth_sha256_client in sha256_pw.c.o
  "_ERR_clear_error", referenced from:
      _auth_sha256_client in sha256_pw.c.o
  "_PEM_read_bio_RSA_PUBKEY", referenced from:
      _auth_sha256_client in sha256_pw.c.o
  "_RSA_free", referenced from:
      _auth_sha256_client in sha256_pw.c.o
  "_RSA_public_encrypt", referenced from:
      _auth_sha256_client in sha256_pw.c.o
  "_RSA_size", referenced from:
      _auth_sha256_client in sha256_pw.c.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[3]: *** [libmariadb/sha256_password.so] Error 1
make[2]: *** [libmariadb/CMakeFiles/sha256_password.dir/all] Error 2
make[1]: *** [libmariadb/CMakeFiles/sha256_password.dir/rule] Error 2
make: *** [sha256_password] Error 2



 Comments   
Comment by Andy Li [ 2019-10-09 ]

Further git bisecting the libmariadb submodule shows that the it's caused by https://github.com/MariaDB/mariadb-connector-c/commit/11a2d035dde02b2a4379d5c5b978ada7447e9bfd

Comment by Daniel Black [ 2020-09-02 ]

I suspect this just needs -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl as the cmake option.

It might also depend on your OSX version xcode10.1 was failing:
https://travis-ci.org/github/MariaDB/server/jobs/723272593/config

However later the later version xcode12u built successfully
https://travis-ci.org/github/grooverdan/mariadb-server/jobs/723310156#L5652

I haven't investigated where inbetween those version cause or fixed the build failure you observed.

Generated at Thu Feb 08 09:02:06 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.