Bug 243316

Summary: graphics/gdal: 2.4.3_1 fails to compile on 11.3 with undefined reference to `EVP_MD_CTX_new'
Product: Ports & Packages Reporter: Philip Homburg <pch-freebsd-bugs-1>
Component: Individual Port(s)Assignee: Po-Chuan Hsieh <sunpoet>
Status: New ---    
Severity: Affects Only Me CC: bahlgren, t.m.guymer
Priority: --- Flags: bugzilla: maintainer-feedback? (sunpoet)
bahlgren: maintainer-feedback?
Version: Latest   
Hardware: Any   
OS: Any   
See Also: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=241799
Description Flags
poudriere log
Patch fixing problem with /usr/lib in linker library path none

Description Philip Homburg 2020-01-13 10:59:34 UTC
Created attachment 210693 [details]
poudriere log

undefined reference to `EVP_MD_CTX_new'
undefined reference to `EVP_MD_CTX_free'

See attached (trimmed) poudriere log
Comment 1 Thomas Guymer 2020-05-02 08:01:56 UTC
Is there any update on this bug? I am still experiencing it 5 months later.
Comment 2 Bengt Ahlgren 2020-07-14 15:29:07 UTC
I also ran into this when switching to DEFAULT_VERSIONS+=ssl=openssl on 11.4-STABLE.

There seems to be multiple issues with the gdal configure script.  Configuration of libz (--with-libz=/usr) makes ./configure add /usr/lib to the linker library path.  Unless some other library happen to add /usr/local/lib before that, -lcrypto will pick up libcrypto.so from base, while the compile used header files from /usr/local/. So enabling some options makes it work by accident.

I tried to add configure args "--with-crypto=${OPENSSLBASE}" in the ports Makefile, but that does not work.

But changing configure arguments to "--with-libz=external" in the ports Makefile at least produces a linker library path without /usr and /usr/lib. I believe this will work, but I haven't verified in poudriere with default options.

I also think that --with-exr=no and --with-crypto=yes should be added to the configure arguments, just to be consistent with how it is built in poudriere.
Comment 3 Bengt Ahlgren 2020-07-14 20:17:57 UTC
Created attachment 216447 [details]
Patch fixing problem with /usr/lib in linker library path

Attaching a patch fixing this issue by changing the --with-libz ./configure argument so that /usr/lib isn't added to the linker library path.

I also added ./configure arguments selecting crypto (--with-crypto=yes) and un-selecting EXR (--without-exr), making these choices explicit. They are however unrelated to the problem.
Comment 4 Bengt Ahlgren 2020-07-14 20:28:38 UTC
I tested the patch successfully with a poudriere testport run using DEFAULT_VERSIONS+=ssl=openssl in a 11.4-REL jail. The log was however too large to attach here.
Comment 5 Bengt Ahlgren 2020-09-02 14:17:14 UTC
Can the maintainer (sunpoet) please respond?
Comment 6 Thomas Guymer 2020-10-10 09:09:44 UTC
Hi everyone,

I have just managed, for the first time in almost a year, to compile gdal. I was able to install "gdal-3.1.0_6" with "DEFAULT_VERSIONS+= ssl=libressl" in my "/etc/make.conf" file with the following options set (on FreeBSD 12.1-RELEASE-p9):


Previously I had tried JASPER and JASPER+CURL but it still failed (even this morning), I have no idea why adding GEOS made the SSL symbols "EVP_MD_CTX_create" and "EVP_MD_CTX_create" available, but hey, I am not complaining!
Comment 7 Bengt Ahlgren 2020-10-11 15:40:12 UTC
(In reply to Thomas Guymer from comment #6)
Please see my comment #2 for an explanation! It is by accident it works for certain combinations of options. If you apply the patch it also works with default options.