Created attachment 541540 [details] emerge --info # emerge -pqv mupdf [ebuild U ] app-text/mupdf-1.13.0 [1.12.0-r2] USE="curl lcms libressl openssl -X -javascript -opengl -static -static-libs -vanilla" build/debug/libmupkcs7.a(pkcs7-openssl.o): In function `BIO_new_stream': pkcs7-openssl.c:(.text.BIO_new_stream+0x26): undefined reference to `BIO_meth_new' pkcs7-openssl.c:(.text.BIO_new_stream+0x46): undefined reference to `BIO_meth_set_read' pkcs7-openssl.c:(.text.BIO_new_stream+0x5b): undefined reference to `BIO_meth_set_ctrl' pkcs7-openssl.c:(.text.BIO_new_stream+0x70): undefined reference to `BIO_meth_set_create' pkcs7-openssl.c:(.text.BIO_new_stream+0x85): undefined reference to `BIO_meth_set_destroy' pkcs7-openssl.c:(.text.BIO_new_stream+0x9a): undefined reference to `BIO_meth_set_callback_ctrl' pkcs7-openssl.c:(.text.BIO_new_stream+0xb3): undefined reference to `BIO_get_data' build/debug/libmupkcs7.a(pkcs7-openssl.o): In function `stream_new': pkcs7-openssl.c:(.text.stream_new+0x35): undefined reference to `BIO_set_init' pkcs7-openssl.c:(.text.stream_new+0x42): undefined reference to `BIO_set_data' build/debug/libmupkcs7.a(pkcs7-openssl.o): In function `stream_ctrl': pkcs7-openssl.c:(.text.stream_ctrl+0xf): undefined reference to `BIO_get_data' build/debug/libmupkcs7.a(pkcs7-openssl.o): In function `stream_read': pkcs7-openssl.c:(.text.stream_read+0xe): undefined reference to `BIO_get_data' build/debug/libmupkcs7.a(pkcs7-openssl.o): In function `add_from_bags': pkcs7-openssl.c:(.text.add_from_bags+0x5b): undefined reference to `PKCS12_SAFEBAG_get0_p8inf' pkcs7-openssl.c:(.text.add_from_bags+0x84): undefined reference to `PKCS12_SAFEBAG_get0_safes' build/debug/libmupkcs7.a(pkcs7-openssl.o): In function `stream_free': pkcs7-openssl.c:(.text.stream_free+0xc): undefined reference to `BIO_get_data' pkcs7-openssl.c:(.text.stream_free+0x20): undefined reference to `BIO_set_data' pkcs7-openssl.c:(.text.stream_free+0x2c): undefined reference to `BIO_set_init' collect2: error: ld returned 1 exit status make: *** [Makefile:373: build/debug/mutool] Error 1
Created attachment 541542 [details] build.log
I have no idea what's causing that but that ebuild came from my PR, so... is this a regression from mupdf-1.12.0-r2 or does that give the same error?
Just checked, mupdf-1.12.0-r2 builds fine.
So it looks like upstream dropped[0] the internal pkcs7 implementation and libressl confuses the version checker logic to believe it implements the openssl-1.1.0 API instead of the 1.0.x one. I would expect the eventual fix to be similar to the one in pkcs11-helper-1.24[1]. [0]http://git.ghostscript.com/?p=mupdf.git;a=commitdiff;h=0b04079f5057ba6c7726bd14b61abed9fde1957a [1]https://github.com/OpenSC/pkcs11-helper/commit/803b081e92d1832ddf1c21a750d2c956187bd15a
I confirm the build failure on a pristine libressl-enabled environment and I confirm that it's a regression from mupdf 1.12-r2.
I'm unfamiliar with libressl-related problems, but from what I understand from your analysis Jouni (thanks for it BTW), the problem is upstream and requires a patch to be made. I will mask the libressl USE flag on this package until we have a patch to apply.
The "libressl" USE flag being already masked, a package-specific mask has no effect, so I did nothing.
This might well be simpler than I thought. The package builds against <openssl-1.1.0 but doesn't set the -DHAVE_LIBCRYPTO in that case. All that should be needed is for someone who knows what they are doing to modify mupdf-1.13-openssl-curl-x11.patch to do the same for <libressl-2.7.3. The patch is Gentoo-specific but the line needing the change isn't.
If a patch is at some point made available I will gladly test it. ;) Would be a good thing since versions <mupdf-1.13.0 which build with +libressl are no longer in the portage tree.
Created attachment 545008 [details, diff] attempt to support libressl-2.6 (In reply to ernsteiswuerfel from comment #9) > If a patch is at some point made available I will gladly test it. ;) > > Would be a good thing since versions <mupdf-1.13.0 which build with > +libressl are no longer in the portage tree. You could try saving the attached patch as /etc/portage/patches/app-text/mupdf-1.13.0-r0/mupdf-libressl.patch and see if it helps. I don't use libressl myself so I can't really test it, but it should make libressl-2.6.x behave like openssl-1.0.x as far as mupdf is concerned – the package just gets compiled without pkcs7 support. Even if the patch does work, someone would then need to refactor it and mupdf-1.13-openssl-curl-x11.patch to an upstreamable patch and a gentoo-specific patch.
Created attachment 545012 [details] build.log (with mupdf-libressl.patch) Succesfully applied your patch. Many thanks!
I can apply it in my test env as well. Thanks Jouni, adding your patch now.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=faf6b578bd55a8010c3957e03901cc1dab35a328 commit faf6b578bd55a8010c3957e03901cc1dab35a328 Author: Virgil Dupras <vdupras@gentoo.org> AuthorDate: 2018-08-27 19:50:49 +0000 Commit: Virgil Dupras <vdupras@gentoo.org> CommitDate: 2018-08-27 19:53:30 +0000 app-text/mupdf: fix compilation with libressl Patch from Jouni Kosonen Closes: https://bugs.gentoo.org/662352 Package-Manager: Portage-2.3.48, Repoman-2.3.10 app-text/mupdf/files/mupdf-1.13-libressl.patch | 23 ++++ app-text/mupdf/mupdf-1.13.0-r1.ebuild | 168 +++++++++++++++++++++++++ 2 files changed, 191 insertions(+)