Created attachment 197896 [details] patch-Makefile libmupdf.so references symbols from libmupdfthird.so but does not link directly against it. This is problematic for ports using the --as-needed linker option, such as graphics/zathura-pdf-mupdf (>= 0.3.3) due to Meson's defaults. zathura-pdf-mupdf itself does not reference symbols from libmupdfthird.so, and so despite being included in the linker arguments, libmupdfthird.so is not actually linked in. (Note that this interaction would not arise if mupdf provided static libraries only, as was the case before ports r433550. Therefore, upstream rejected the suggestion of changing the Meson option b_asneeded to false.) $ zathura --version error: Could not load plugin '/usr/local/lib/zathura/libpdf-mupdf.so' (/usr/local/lib/libmupdf.so.1.13.0: Undefined symbol "js_tointeger"). zathura 0.4.0 girara 0.3.1 (runtime: 0.3.1) Attached is a proposed fix to ensure that libmupdf.so contains a DT_NEEDED tag for libmupdfthird.so. poudriere testport: OK
Thank you for your report and analysis Albert. CC'ing committer and submitter of ports r433550
Comment on attachment 197896 [details] patch-Makefile This change is: Approved by: portmgr (blanket: build/run fixes) Pending QA
A commit references this bug: Author: tobik Date: Tue Oct 9 07:01:54 UTC 2018 New revision: 481606 URL: https://svnweb.freebsd.org/changeset/ports/481606 Log: graphics/mupdf: Fix linking with libmupdf.so for third-party ports libmupdf.so references symbols from libmupdfthird.so but does not link directly against it. This is problematic for ports using the --as-needed linker option, such as graphics/zathura-pdf-mupdf (>= 0.3.3) due to Meson's defaults. zathura-pdf-mupdf itself does not reference symbols from libmupdfthird.so, and so despite being included in the linker arguments, libmupdfthird.so is not actually linked in. $ zathura --version error: Could not load plugin '/usr/local/lib/zathura/libpdf-mupdf.so' (/usr/local/lib/libmupdf.so.1.13.0: Undefined symbol "js_tointeger"). This is a consequence of us providing shared libraries in spite of upstream since r433550 to keep package sizes down, but not properly understanding the dependency between libmupdfthird and libmupdf. PR: 232059 Submitted by: Albert Ou <aou@eecs.berkeley.edu> Changes: head/graphics/mupdf/Makefile head/graphics/mupdf/files/patch-Makefile
A commit references this bug: Author: tobik Date: Tue Oct 9 07:04:11 UTC 2018 New revision: 481607 URL: https://svnweb.freebsd.org/changeset/ports/481607 Log: MFH: r481606 graphics/mupdf: Fix linking with libmupdf.so for third-party ports libmupdf.so references symbols from libmupdfthird.so but does not link directly against it. This is problematic for ports using the --as-needed linker option, such as graphics/zathura-pdf-mupdf (>= 0.3.3) due to Meson's defaults. zathura-pdf-mupdf itself does not reference symbols from libmupdfthird.so, and so despite being included in the linker arguments, libmupdfthird.so is not actually linked in. $ zathura --version error: Could not load plugin '/usr/local/lib/zathura/libpdf-mupdf.so' (/usr/local/lib/libmupdf.so.1.13.0: Undefined symbol "js_tointeger"). This is a consequence of us providing shared libraries in spite of upstream since r433550 to keep package sizes down, but not properly understanding the dependency between libmupdfthird and libmupdf. PR: 232059 Submitted by: Albert Ou <aou@eecs.berkeley.edu> Approved by: ports-secteam build/runtime fix blanket Changes: _U branches/2018Q4/ branches/2018Q4/graphics/mupdf/Makefile branches/2018Q4/graphics/mupdf/files/patch-Makefile
Track merge
Thanks for your working!
Thanks everyone for the quick responses!