Re: [e-users] error on statically linked programs that use imlib2 static libraries

Kim Woelders <[email protected]>
Newsgroups gmane.comp.window-managers.enlightenment.user
Message-ID <[email protected]>
As is, things will not work when using -static. The loaders are loaded 
dynamically as separate shared objects.

One reason to do this is to avoid loading all libraries used by all 
loaders (libpng, librsvg2, etc., and their dependencies) at application 
startup but defer it until needed.
Another is to isolate applications using imlib2 from the licencing of 
the libraries used by the loaders.

/Kim


On 2023-07-26 22:13, ruivlea via enlightenment-users wrote:
> i rebuilt imlib2 static libraries only:
> 
> export CFLAGS="-g2"
> export LDFLAGS="$LDFLAGS -static"
> 
> ./configure \
>      --build=x86_64-unknown-linux-musl \
>      --prefix=/usr \
>      --sysconfdir=/etc/imlib2 \
>      --disable-shared \
>      --enable-debug \
>      --without-svg \
>      --without-tiff \
>      --without-bz2 \
>      --without-zlib \
>      --without-lzma \
>      --without-j2k
> 
> and tried this:
> 
> % gdb imlib2_view
> GNU gdb (GDB) 13.2
> Copyright (C) 2023 Free Software Foundation, Inc.
> License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
> This is free software: you are free to change and redistribute it.
> There is NO WARRANTY, to the extent permitted by law.
> Type "show copying" and "show warranty" for details.
> This GDB was configured as "x86_64-unknown-linux-musl".
> Type "show configuration" for configuration details.
> For bug reporting instructions, please see:
> <https://www.gnu.org/software/gdb/bugs/>.
> Find the GDB manual and other documentation resources online at:
>      <http://www.gnu.org/software/gdb/documentation/>.
> 
> For help, type "help".
> Type "apropos word" to search for commands related to "word"...
> Reading symbols from imlib2_view...
> (gdb) run ~/downloads/sample-1.gif
> Starting program: /usr/bin/imlib2_view ~/downloads/sample-1.gif
> No loadable image
> [Inferior 1 (process 5683) exited normally]
> (gdb) run -d ~/downloads/sample-1.gif
> Starting program: /usr/bin/imlib2_view -d ~/downloads/sample-1.gif
>   Cache usage: 0/4194304
> No loadable image
> [Inferior 1 (process 5694) exited normally]
> (gdb) bt
> No stack.
> (gdb)
> 
> using static libraries image failed to open.
> 
> then i rebuilt imlib2 both static and shared libraries:
> 
> export CFLAGS="-g2"
> 
> ./configure \
>      --build=x86_64-unknown-linux-musl \
>      --prefix=/usr \
>      --sysconfdir=/etc/imlib2 \
>      --enable-debug \
>      --without-svg \
>      --without-tiff \
>      --without-bz2 \
>      --without-zlib \
>      --without-lzma \
>      --without-j2k
> 
> and tried:
> % gdb imlib2_view
> GNU gdb (GDB) 13.2
> Copyright (C) 2023 Free Software Foundation, Inc.
> License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
> This is free software: you are free to change and redistribute it.
> There is NO WARRANTY, to the extent permitted by law.
> Type "show copying" and "show warranty" for details.
> This GDB was configured as "x86_64-unknown-linux-musl".
> Type "show configuration" for configuration details.
> For bug reporting instructions, please see:
> <https://www.gnu.org/software/gdb/bugs/>.
> Find the GDB manual and other documentation resources online at:
>      <http://www.gnu.org/software/gdb/documentation/>.
> 
> For help, type "help".
> Type "apropos word" to search for commands related to "word"...
> Reading symbols from imlib2_view...
> (gdb) run -d ~/downloads/sample-1.gif
> Starting program: /usr/bin/imlib2_view -d ~/downloads/sample-1.gif
>   Cache usage: 0/4194304
> U=0,0 350x233 F=0,0 350x233 O=0,0 350x233
>   Screen WxH=1888x1048
>   Window WxH=350x233
>   Render 0,0 350x233 -> 0,0
>   Update 0,0 350x233
>   Paint  0,0 350x233
>   showing frame 1/18 (x,y=0,0, wxh=350x233 T=100)
>   Cache usage: 0/4194304
> U=0,0 350x233 F=0,0 350x233 O=0,0 350x233
>   Render 0,0 350x233 -> 0,0
>   Update 0,0 350x233
>   Paint  0,0 350x233
>   showing frame 2/18 (x,y=0,0, wxh=350x233 T=100)
>   Cache usage: 0/4194304
> U=0,0 350x233 F=0,0 350x233 O=0,0 350x233
>   Render 0,0 350x233 -> 0,0
>   Update 0,0 350x233
>   Paint  0,0 350x233
>   showing frame 3/18 (x,y=0,0, wxh=350x233 T=100)
>   Cache usage: 0/4194304
> [Inferior 1 (process 17927) exited normally]
> (gdb) q
> 
> image successfully opened. the gif file animation played normally.
> 
> ------- Original Message -------
> On Wednesday, July 26th, 2023 at 7:00 PM, Benoît-Pierre Demaine <[email protected]> wrote:
> 
> 
>> You need to build with debug symbols, and run in debugger. Nobody can
>> help you with that few infos.
>>
>> On 26/07/2023 20:36, ruivlea via enlightenment-users wrote:
>>
>>> hello,
>>>
>>> i tried to statically build programs (scrot and nsxiv) that use imlib2. They can be built. But unusable.
>>> *scrot:
>>> % scrot -s
>>> scrot: Saving to file 2023-07-26-181818_137x107_scrot.png failed
>>>
>>> *nsxiv:
>>> % nsxiv /home/ruivlea/downloads/sample-1.gif
>>> nsxiv: /home/ruivlea/downloads/sample-1.gif: Error opening image
>>> nsxiv: no more files to display, aborting
>>>
>>> tried open png and jpg, same result.
>>> But both scrot and nsxiv usable and works well if shared linked.
>>> is imlib2 designed only for shared linked programs? or is there a bug on imlib2 static libraries?
>>>
>>> _______________________________________________
>>> enlightenment-users mailing list
>>> [email protected]
>>> https://lists.sourceforge.net/lists/listinfo/enlightenment-users
>>
>>
>>
>> --
>>
>>> o_/ DEMAINE Benoît-Pierre (aka DoubleHP) http://benoit.demaine.info/
>>
>> If computing were an exact science, IT engineers would'nt have work \_o<
>>
>> "So all that's left, Is the proof that love's not only blind but deaf."
>> (FAKE TALES OF SAN FRANCISCO, Arctic Monkeys)
>>
>>
>>
>> _______________________________________________
>> enlightenment-users mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/enlightenment-users
> 
> 
> _______________________________________________
> enlightenment-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/enlightenment-users



_______________________________________________
enlightenment-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.