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

darling build fails to find libpng.so for wrapping #1523

Open
MagicalTux opened this issue Jun 27, 2024 · 1 comment
Open

darling build fails to find libpng.so for wrapping #1523

MagicalTux opened this issue Jun 27, 2024 · 1 comment

Comments

@MagicalTux
Copy link

Build Log
What is the build error?

cd /build/darling-0.1.20240614/temp/src/native && /build/darling-0.1.20240614/temp/src/libelfloader/wrapgen/wrapgen libpng.so /build/darling-0.1.20240614/temp/src/native/png.c /build/darling-0.1.20240614/temp/src/native/png_vars.h
Cannot load libpng.so: libpng.so: cannot open shared object file: No such file or directory

After some research it seems that when libpng.so isn't installed in a standard location it won't be found by wrapgen. The reason is that ld.so.cache contains entries for libpng16.so but not libpng.so.

There are multiple ways this error can be fixed:

  • Use libpng16.so (or whatever version is expected) so the right libpng is linked (probably for the best since that's libpng's abi version)
  • Use PNG_LIBRARY_RELEASE:FILEPATH cmake variable that already points to the right location for libpng.so
  • Have wrapgen scan env variables such as gcc's LIBRARY_PATH.

Implementing any of those three options would solve this issue for me. Implementing the first solution is just replacing libpng with libpng16, this will also ensure that if libpng18 is released nothing breaks with mysterious segfaults.

System Information
What system are you building with?

Software Version
Clang 18.1.1
CMake 3.28.3
Linux Kernel 6.6.30
Darling 203af1f
@MagicalTux
Copy link
Author

MagicalTux commented Jun 27, 2024

Confirming build works now for me with:

sed -i 's/libpng.so/libpng16.so/' src/native/CMakeLists.txt

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

No branches or pull requests

1 participant