-
-
Notifications
You must be signed in to change notification settings - Fork 14.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mupdf: fix library linking #30071
mupdf: fix library linking #30071
Conversation
Previously, libmupdf.so did not have DT_NEEDED references to its dependencies. Packages which linked against libmupdf would have to also manually link against its dependencies as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, thank you for adding a proper way to build shared mupdf!
I can test and merge this tomorrow; if anyone wants to do this sooner please go ahead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can not download mupdf-1.10a-shared_libs-1.patch
from IPv6 enabled hosts because www.linuxfromscratch.org advertises an IPv6 address in the DNS but does not respond on it. Could you find another source?
@orivej I've changed the url to a mirror which works on ipv6. Just a note that there are some other derivations which use a linuxfromscratch.org url: |
Thank you! Maybe I have not downloaded them, or maybe they were already cached by nixos cache servers, or maybe linuxfromscratch IPv6 is only temporarily down. |
Motivation for this change
A recent change 47f0997 broke a package I maintain (
k2pdfopt
), which would complain about missingopenssl
symbols. While a quick fix would just be to link inopenssl
manually for my package, I believe this is the proper fix to makelibmupdf
behave more like a normal shared library.Specifically,
libmupdf.so
does not haveDT_NEEDED
references to itsdependencies. Packages which link against
libmupdf.so
would have to alsomanually link against its dependencies as well. This adds unnecessary complexity to packages which depend on it. (See also
llpp
,jfbview
, andzathura-pdf-mupdf
)The first commit includes a patch which ensures that
libmupdf.so
is built with references to its own dependencies.An additional commit fixes k2pdfopt, which uses a patched version of mupdf and requires another patch for an older version.
Output of
readelf -d libmupdf.so
before change:After change:
I believe
llpp
,jfbview
, andzathura-pdf-mupdf
could also be cleaned to not have to refer to mupdf's dependencies. Those packages build anyway, so it's not strictly necessary. Finally, I'm not an expert on compilers or linking so let me know if I'm misunderstanding anything.CC @abbradar
Things done
build-use-sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)