Bug 211770 - databases/mysql57-client, databases/mysql57-server: Fix build with security/libressl OPENSSL_MAJOR_VERSION check
Summary: databases/mysql57-client, databases/mysql57-server: Fix build with security/l...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: Thomas Zander
URL:
Keywords: needs-patch, needs-qa
Depends on:
Blocks:
 
Reported: 2016-08-12 11:35 UTC by Markus Kohlmeyer
Modified: 2016-09-11 09:00 UTC (History)
4 users (show)

See Also:
koobs: maintainer-feedback? (brnrd)
mmokhi: maintainer-feedback+
koobs: merge-quarterly?


Attachments
Fix build against LibreSSL 2.4+ (1.43 KB, patch)
2016-08-12 11:35 UTC, Markus Kohlmeyer
mmokhi: maintainer-approval+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Kohlmeyer 2016-08-12 11:35:01 UTC
Created attachment 173580 [details]
Fix build against LibreSSL 2.4+

This patch fixes the build failure caused by the OPENSSL_MAJOR_VERSION check for builds against security/libressl 2.4.2+ since ports r420102 (Remove OPENSSL_VERSION_NUMBER patch)
Comment 1 Mahdi Mokhtari freebsd_committer freebsd_triage 2016-08-12 14:18:02 UTC
Comment on attachment 173580 [details]
Fix build against LibreSSL 2.4+

QA done,
Both Portlint and Poudriere were Okay.
Just single point is maybe, we should change USE_OPENSSL=yes to USES+=ssl which it'd be better to be done on another issue.

Thanks Markus :)
Comment 2 Thomas Zander freebsd_committer 2016-08-21 11:44:35 UTC
I am in the middle of running a couple of build tests.
Just to confirm: When using OpenSSL from base, it links to the shared ssl/crypto libs, but with libressl it links to the static ssl/crypto libs. Is this intentional?
Comment 3 Thomas Zander freebsd_committer 2016-08-21 12:06:51 UTC
Also there is a build failure on 9.3 / i386 in mysql-client:


[ 45%] Building C object extra/CMakeFiles/comp_err.dir/comp_err.c.o
cd /wrkdirs/usr/ports/databases/mysql57-client/work/.build/extra && /usr/local/libexec/ccache/clang  -DBOOST_GEOMETRY_SQRT_CHECK_FINITENESS -DHAVE_CONFIG_H -DMUTEX_EVENT -I/wrkdirs/usr/ports/databases/mysql57-client/work/.build/include -I/wrkdirs/usr/ports/databases/mysql57-client/work/mysql-5.7.13/extra/rapidjson/include -I/wrkdirs/usr/ports/databases/mysql57-client/work/.build/libbinlogevents/include -I/wrkdirs/usr/ports/databases/mysql57-client/work/mysql-5.7.13/libbinlogevents/export -I/wrkdirs/usr/ports/databases/mysql57-client/work/mysql-5.7.13/include -I/usr/local/include -I/wrkdirs/usr/ports/databases/mysql57-client/work/mysql-5.7.13/storage/ndb/include -I/wrkdirs/usr/ports/databases/mysql57-client/work/.build/storage/ndb/include -I/wrkdirs/usr/ports/databases/mysql57-client/work/mysql-5.7.13/storage/ndb/include/ndbapi -I/wrkdirs/usr/ports/databases/mysql57-client/work/mysql-5.7.13/storage/ndb/include/mgmapi -O2 -pipe -isystem /usr/local/include -fno-strict-aliasing -Wall -Wextra -Wformat-security -Wvla -Wwrite-strings -Wdeclaration-after-statement -O2 -pipe -isystem /usr/local/include -fno-strict-aliasing -DDBUG_OFF -o CMakeFiles/comp_err.dir/comp_err.c.o   -c /wrkdirs/usr/ports/databases/mysql57-client/work/mysql-5.7.13/extra/comp_err.c
[ 46%] Linking CXX executable comp_err
cd /wrkdirs/usr/ports/databases/mysql57-client/work/.build/extra && /usr/local/bin/cmake -E cmake_link_script CMakeFiles/comp_err.dir/link.txt --verbose=1
/usr/local/libexec/ccache/clang++   -O2 -pipe -isystem /usr/local/include -fno-strict-aliasing -isystem /usr/local/include -Wall -Wextra -Wformat-security -Wvla -Woverloaded-virtual -Wno-unused-parameter -Wno-null-conversion -Wno-unused-private-field -O2 -pipe -isystem /usr/local/include -fno-strict-aliasing -isystem /usr/local/include -DDBUG_OFF   -L/usr/local/lib -Wl,-rpath,/usr/local/lib CMakeFiles/comp_err.dir/comp_err.c.o  -o comp_err  -pthread ../mysys/libmysys.a ../mysys_ssl/libmysys_ssl.a ../mysys/libmysys.a ../dbug/libdbug.a ../mysys/libmysys.a ../dbug/libdbug.a -lm -lrt ../strings/libstrings.a -pthread -lz /usr/local/lib/libssl.a /usr/local/lib/libcrypto.a 
/usr/local/lib/libcrypto.a(libcrypto_la-bss_bio.o): In function `BIO_s_bio':
(.text+0x33): undefined reference to `__stack_chk_fail_local'
/usr/local/lib/libcrypto.a(libcrypto_la-bss_bio.o): In function `bio_destroy_pair':
(.text+0xc4): undefined reference to `__stack_chk_fail_local'
/usr/local/lib/libcrypto.a(libcrypto_la-bss_bio.o): In function `BIO_nwrite':
(.text+0x174): undefined reference to `__stack_chk_fail_local'
/usr/local/lib/libcrypto.a(libcrypto_la-bss_bio.o): In function `BIO_nwrite0':
(.text+0x214): undefined reference to `__stack_chk_fail_local'
/usr/local/lib/libcrypto.a(libcrypto_la-bss_bio.o): In function `BIO_nread':
(.text+0x2c4): undefined reference to `__stack_chk_fail_local'
/usr/local/lib/libcrypto.a(libcrypto_la-bss_bio.o):(.text+0x364): more undefined references to `__stack_chk_fail_local' follow
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
*** [extra/comp_err] Error code 1

Stop in /wrkdirs/usr/ports/databases/mysql57-client/work/.build.
*** [extra/CMakeFiles/comp_err.dir/all] Error code 1

Stop in /wrkdirs/usr/ports/databases/mysql57-client/work/.build.
*** [all] Error code 1

Stop in /wrkdirs/usr/ports/databases/mysql57-client/work/.build.
*** [do-build] Error code 1

Stop in /usr/ports/databases/mysql57-client.

Could you take a look?
Comment 4 Markus Kohlmeyer 2016-08-21 12:29:49 UTC
(In reply to Thomas Zander from comment #2)
Maybe that is related to bug #211592 ?
Comment 5 Markus Kohlmeyer 2016-08-21 12:37:21 UTC
(In reply to Thomas Zander from comment #3)
IIRC: There was a 9.3 related fix in the mysql57-server/Makefile in the past, maybe we need something like that again?
Lines 120-127 https://svnweb.freebsd.org/ports/head/databases/mysql57-server/Makefile?revision=412695&view=markup
Comment 6 commit-hook freebsd_committer 2016-08-24 18:57:10 UTC
A commit references this bug:

Author: brnrd
Date: Wed Aug 24 18:56:35 UTC 2016
New revision: 420816
URL: https://svnweb.freebsd.org/changeset/ports/420816

Log:
  databases/mysql57-server: Fix build with LibreSSL

    - Fix building when OPENSSL_VERSION_NUMBER == 2
    - Switch USE_OPENSSL to USES= ssl

  PR:		211770
  Submitted by:	Markus Kohlmeyer <rootservice@gmail.com>
  Reported by:	Markus Kohlmeyer <rootservice@gmail.com>
  Approved by:	Mahdi Mokhtari <mokhi64@gmail.com>
  MFH:		2016Q3

Changes:
  head/databases/mysql57-client/files/patch-cmake_ssl.cmake
  head/databases/mysql57-server/Makefile
  head/databases/mysql57-server/files/patch-cmake_ssl.cmake
Comment 7 Bernard Spil freebsd_committer 2016-08-24 18:59:08 UTC
(In reply to Thomas Zander from comment #3)

Can you please open a new PR for any remaining issues?
Comment 8 commit-hook freebsd_committer 2016-09-11 09:00:27 UTC
A commit references this bug:

Author: brnrd
Date: Sun Sep 11 09:00:17 UTC 2016
New revision: 421809
URL: https://svnweb.freebsd.org/changeset/ports/421809

Log:
  MFH: r420816

  databases/mysql57-server: Fix build with LibreSSL

    - Fix building when OPENSSL_VERSION_NUMBER == 2
    - Switch USE_OPENSSL to USES= ssl

  PR:		211770
  Submitted by:	Markus Kohlmeyer <rootservice@gmail.com>
  Reported by:	Markus Kohlmeyer <rootservice@gmail.com>
  Approved by:	Mahdi Mokhtari <mokhi64@gmail.com>

  Approved by:	ports-secteam (junovitch)

Changes:
_U  branches/2016Q3/
  branches/2016Q3/databases/mysql57-client/files/patch-cmake_ssl.cmake
  branches/2016Q3/databases/mysql57-server/Makefile
  branches/2016Q3/databases/mysql57-server/files/patch-cmake_ssl.cmake