Bug 233471 - net/mpd5 linker fails after update to 12-STABLE
Summary: net/mpd5 linker fails after update to 12-STABLE
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Eugene Grosbein
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-11-24 15:01 UTC by jakub_lach
Modified: 2018-11-25 12:47 UTC (History)
2 users (show)

See Also:
eugen: maintainer-feedback+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description jakub_lach 2018-11-24 15:01:36 UTC
/usr/bin/ld: error: undefined symbol: SSLv23_server_method
>>> referenced by http_server.c:200 (contrib/libpdel/http/http_server.c:200)
>>>               http_server.o:(http_server_start)

/usr/bin/ld: error: undefined symbol: SSL_load_error_strings
>>> referenced by http_ssl.c:68 (contrib/libpdel/http/http_ssl.c:68)
>>>               http_ssl.o:(http_ssl_do_init)

/usr/bin/ld: error: undefined symbol: SSL_library_init
>>> referenced by http_ssl.c:69 (contrib/libpdel/http/http_ssl.c:69)
>>>               http_ssl.o:(http_ssl_do_init)
cc: error: linker command failed with exit code 1 (use -v to see invocation)
*** [mpd5] Error code 1

it's either

20180530:
        As of r334391 lld is the default amd64 system linker; it is installed
        as /usr/bin/ld.  Kernel build workarounds (see 20180510 entry) are no
        longer necessary.

or LibreSSL
Comment 1 Herbert J. Skuhra 2018-11-24 15:20:59 UTC
MPD5 builds if you remove -I${PREFIX}/include from COPTS/CFLAGS in work/mpd-5.8/src/Makefile
Comment 2 Eugene Grosbein freebsd_committer freebsd_triage 2018-11-25 04:20:24 UTC
(In reply to Herbert J. Skuhra from comment #1)

Such simple attempt to work around the problem breaks build with option NG_IPACCT enabled. More seriously, mpd5 links with base system libfetch that requires system libssl (from openssl). Hence, one should not even attempt to build it with distinct ssl library such as libressl or else mpd5 will use conflicting headers and binary libraries.
Comment 3 commit-hook freebsd_committer freebsd_triage 2018-11-25 04:24:33 UTC
A commit references this bug:

Author: eugen
Date: Sun Nov 25 04:23:30 UTC 2018
New revision: 485843
URL: https://svnweb.freebsd.org/changeset/ports/485843

Log:
  net/mpd5: fix after incorrect change r484599

  openssl-1.1.1 is in FreeBSD12 base system and that was already
  resolved in r482627.

  While here, explicitly mark the port incompatible with alternative SSL
  libraries such as LibreSSL due to dependency of base system libfetch
  that links with base system libssl.

  PR:		233471

Changes:
  head/net/mpd5/Makefile
Comment 4 Herbert J. Skuhra 2018-11-25 07:35:33 UTC
(In reply to Eugene Grosbein from comment #2)

I am not saying that the suggested fix is perfect but at least it works
and NG_IPACCT is OFF by default. 

How about

- mark libressl broken only if NG_IPACCT is on 
- Create extra-patch that removes -I${PREFIX}/include from COPTS/CFLAGS in work/mpd-5.8/src/Makefile and apply it only if NG_IPPACT is off

I think we can neglect the wrong dependency on libressl... it probably also happens with ssl=(openssl|openssl111).
Comment 5 commit-hook freebsd_committer freebsd_triage 2018-11-25 07:49:06 UTC
A commit references this bug:

Author: eugen
Date: Sun Nov 25 07:48:22 UTC 2018
New revision: 485845
URL: https://svnweb.freebsd.org/changeset/ports/485845

Log:
  net/mpd5: fix build for systems having libressl installed

  Import upstream revisions r2258-r2260: do not use -I${LOCALBASE}/include
  by default when option NG_IPACCT is off. If NG_IPACCT is on,
  use -nostdinc to force needed header inclusion order to force
  usage of base system libssl.

  Bump PORTREVISION as package can change if built with default options
  when net-mgmt/ng_ipacct is installed.

  PR:	233471

Changes:
  head/net/mpd5/Makefile
  head/net/mpd5/files/extra-patch-no-ng_ipacct
  head/net/mpd5/files/patch-configure
  head/net/mpd5/files/patch-src-Makefile
Comment 6 Eugene Grosbein freebsd_committer freebsd_triage 2018-11-25 08:22:30 UTC
(In reply to Herbert J. Skuhra from comment #4)

It is always wrong to compile using libressl headers and linking with openssl libs, hence this PR and build error messages it shows.

Also, it is always wrong to link with libressl and base system libfetch same time as libfetch links with base system libssl.

I've just fixed net/mpd5 to build and link with no errors despite of presence of libressl, so you could use something like this in your /etc/make.conf:

.if ${.CURDIR:M*/net/mpd5}
DEFAULT_VERSIONS= ssl=base
.endif

However, our ports tree (the file Uses/ssl.mk specifically) prevents this from working for the moment.
Comment 7 Eugene Grosbein freebsd_committer freebsd_triage 2018-11-25 12:13:02 UTC
Fixed with removal of BROKEN_SSL in r485853. Please update your ports tree.
Comment 8 jakub_lach 2018-11-25 12:29:08 UTC
Great! I've just had time to recompile and wondered why it did work this time ;)