imlib2 svg loader linker option '-Wl,-z,nodelete' fails homebrew compilation on Mac (ld unknown option -z
) #8
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Homebrew installs imlib2 by default compiled
--without-svg
.If compiled from source with
svg
support, on MacOS (Catalina 10.15) the system linkerld
does not understand-Wl,-z,nodelete
as specified inlegacy-imlib2/src/modules/loaders/Makefile.am
line 145,
It can compile successfully however without any linker options, i.e.,
Hmm..
At least on linux it seems that the svg library (just checked with librsvg2-2.54.5) does not like to be loaded (dlopen'ed) more than once. libheif has (had?) the same problem.
If you have a git checkout, running
$ make -C test
fails with:
Adding the nodelete option when linking the loader module fixes this problem.
Normally loaders will never be loaded more than once. However, if imlib_flush_loaders() is called, then loaders may subsequently be re-loaded.
I would assume that there are no regular applications that call this function, but of course I cannot be sure.
When running the imlib2 test suite this function is called a couple of times for various testing purposes.
I think things will work just fine at your end if you just remove the option.
I'll consider not using the nodelete option and find some other way to handle the problem.
Should be fixed in git now.
Thank you so much for your quick response and code change!
:)
git clone git branch to local disk
git diff v1.11.0 master > ld.patch
use gnu patch -p1 < ld.patch to merge code to brew imlib2 code
re-run autoreconf -i
brew reinstall -s imlib2