Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 662352 - app-text/mupdf-1.13.0 [+libressl]: pkcs7-openssl.c:(.text.BIO_new_stream+0x26): undefined reference to `BIO_meth_new'
Summary: app-text/mupdf-1.13.0 [+libressl]: pkcs7-openssl.c:(.text.BIO_new_stream+0x26...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal
Assignee: Virgil Dupras (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-07-28 18:12 UTC by ernsteiswuerfel
Modified: 2018-08-27 19:53 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge --info (file_662352.txt,6.98 KB, text/plain)
2018-07-28 18:12 UTC, ernsteiswuerfel
Details
build.log (mupdf-1.13.0:20180728-174158.log,218.65 KB, text/plain)
2018-07-28 18:13 UTC, ernsteiswuerfel
Details
attempt to support libressl-2.6 (mupdf-libressl.patch,883 bytes, patch)
2018-08-25 18:37 UTC, Jouni Kosonen
Details | Diff
build.log (with mupdf-libressl.patch) (mupdf-1.13.0:20180825-185521.log,203.63 KB, text/plain)
2018-08-25 19:02 UTC, ernsteiswuerfel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description ernsteiswuerfel archtester 2018-07-28 18:12:39 UTC
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
Comment 1 ernsteiswuerfel archtester 2018-07-28 18:13:24 UTC
Created attachment 541542 [details]
build.log
Comment 2 Jouni Kosonen 2018-07-29 06:31:01 UTC
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?
Comment 3 ernsteiswuerfel archtester 2018-07-29 09:53:38 UTC
Just checked, mupdf-1.12.0-r2 builds fine.
Comment 4 Jouni Kosonen 2018-07-29 19:04:13 UTC
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
Comment 5 Virgil Dupras (RETIRED) gentoo-dev 2018-07-30 14:11:27 UTC
I confirm the build failure on a pristine libressl-enabled environment and I confirm that it's a regression from mupdf 1.12-r2.
Comment 6 Virgil Dupras (RETIRED) gentoo-dev 2018-07-30 14:17:05 UTC
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.
Comment 7 Virgil Dupras (RETIRED) gentoo-dev 2018-07-30 14:43:37 UTC
The "libressl" USE flag being already masked, a package-specific mask has no effect, so I did nothing.
Comment 8 Jouni Kosonen 2018-07-30 17:00:37 UTC
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.
Comment 9 ernsteiswuerfel archtester 2018-08-25 17:11:36 UTC
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.
Comment 10 Jouni Kosonen 2018-08-25 18:37:56 UTC
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.
Comment 11 ernsteiswuerfel archtester 2018-08-25 19:02:58 UTC
Created attachment 545012 [details]
build.log (with mupdf-libressl.patch)

Succesfully applied your patch. Many thanks!
Comment 12 Virgil Dupras (RETIRED) gentoo-dev 2018-08-27 19:48:10 UTC
I can apply it in my test env as well. Thanks Jouni, adding your patch now.
Comment 13 Larry the Git Cow gentoo-dev 2018-08-27 19:53:48 UTC
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(+)