AppImageCommunity / libappimage

Implements functionality for dealing with AppImage files
https://appimage.org
Other
46 stars 29 forks source link

fix AppImageKit compilation by restoring appimage_get_elf_size() #160

Closed hchunhui closed 1 year ago

hchunhui commented 2 years ago

Currently AppImageKit can not be compiled with the master branch of libappimage, the build script reports "undefined reference to appimage_get_elf_size()".

the runtime of AppImageKit can only be linked with libappimage_shared, but appimage_get_elf_size() is moved into libappimage since 4f22f90020f3fc5b9e37a2d5f048eb7fed690a54 . Restoring the function will fix the issue.

azubieta commented 2 years ago

@hchunhui thanks for the contribution, but I think that this fix should go in the AppImageKit repo instead. As we moved that function in a legacy header so it may be deorecated at some point.

@probonopd @TheAssassin may have some comments on this.

hchunhui commented 2 years ago

appimage_get_elf_size() can be replace by appimage_get_payload_offset() according to current implementation, but after the replacement we have to link to the whole C++ library instead of libappimage_shared (relatively small, written by C). As the function is used by runtime of AppImageKit, and we may want to keep runtime small, so it may be worth to restore it.

probonopd commented 2 years ago

Yes, we want runtime.c to be as small and lightweight as possible and no heavyweight C++ dependencies in runtime.c.

Once we had: https://github.com/AppImage/AppImageKit/blob/d66acbafe8e17f82f19d644b09df45c4e0bcd284/elf.c

lalten commented 2 years ago

What's the state of this? Without this fixed it looks like AppImageKit can not use any libappimage after https://github.com/AppImage/libappimage/commit/4f22f90020f3fc5b9e37a2d5f048eb7fed690a54 from Jan 2019

TheAssassin commented 1 year ago

I think we should not duplicate code within here, but instead really just move this code to AppImageKit's repository for now. Thanks anyway!