Skip to content
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

go-appimage treats executables as libraries to set RPATH #314

Open
brunvonlope opened this issue Nov 28, 2024 · 5 comments · May be fixed by #316
Open

go-appimage treats executables as libraries to set RPATH #314

brunvonlope opened this issue Nov 28, 2024 · 5 comments · May be fixed by #316

Comments

@brunvonlope
Copy link

Running objdump -c on binaries from an .appimage produced by go-appimage reveals that the tool uses executables paths as suitables to be appended on RPATH, not only the paths of libraries.

As far I know, it is not common dynamically linkining to executables on Linux. That was a thing on very early versions of Windows but not anymore. This seems a error.

@Samueru-sama probably can share some words too

@Samueru-sama
Copy link

Yeah that isn't right and quite a problem for gimp since there is a directory for each plugin.

@probonopd
Copy link
Owner

probonopd commented Nov 28, 2024

The intended behavior is that only directories containing libraries should be added to RPATH.

func patchRpathsInElf(appdir helpers.AppDir, libraryLocationsInAppDir []string, path string) does the patching.

Apparently somewhere directories not actually containing .so files get added to libraryLocationsInAppDir, can you spot where?

@brunvonlope
Copy link
Author

can you spot where?

@probonopd GIMP plug-ins are stored in lib path, this way:

AppDir/usr/lib/arch_triplet/gimp/3.0/plug-ins/plugin_name/plugin_name_executable

The intended behavior is that only directories containing libraries should be added to RPATH

What is a library for go_appimage? go-appimage seems to consider a library whatever ELF files that it found recursively on lib path, independently of the *so extension, creating this monstruosity:

388291568-b0223f31-255c-400f-860a-8a9f697b04d7

@probonopd
Copy link
Owner

probonopd commented Nov 28, 2024

Yes, I guess we need to change that by checking whether a path contains at least one file with the extension .so optionally followed by any combination of dots and numbers before adding to libraryLocationsInAppDir.

@probonopd
Copy link
Owner

Does the build in #316 improve the situation?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants