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

other architecture compatibility? #5

Open
gotson opened this issue Jul 23, 2020 · 9 comments
Open

other architecture compatibility? #5

gotson opened this issue Jul 23, 2020 · 9 comments

Comments

@gotson
Copy link

gotson commented Jul 23, 2020

Hello,

is this compatible with ARM32/64 ?

@ediweissmann
Copy link
Contributor

Have not tested, I doubt it.

@gotson
Copy link
Author

gotson commented Jul 23, 2020

What would it take to make it compatible? I didn't check in details, do you pull the compiled native libraries from somewhere else or do you build them yourself?

@gotson
Copy link
Author

gotson commented Jul 27, 2020

I have been working on that and managed to get some results.

I have looked at how https://github.com/xerial/sqlite-jdbc does the cross-compilation for multiple OS and Architectures. It uses https://github.com/dockcross/dockcross mostly. That project is using make instead of cmake, so i tried to make it work using cmake, which is a bit more complex to handle especially for libwebp.

I managed to cross-compile for multiple Linux architectures. I have successfully tested the Linux Arm64 on Travis.

My Windows builds are failing however, the DLL is built, but Travis fails and i don't know why.

For Mac i could not make the cross compilation work, and even the one i compiled on my Mac after changing slightly the cmake instructions are failing on Travis.

I also changed the library loader to use the one from sqlite-jdbc, which handles better the various architectures.

From what i understand, this project uses manually built libraries for now? If that's the case, would you be open to a PR that would involve:

  • new libraries for various cpu architecture on Linux
  • a new loader, imported from the sqlite-jdbc project

libwebp doesn't seem to be updated that often, so if a new one is released i could recompile the Linux flavors.

FYI the problem i have with cross-compiling was the absence of JDK in the docker images, so cmake failed to import the JNI headers. I have added the JNI headers manually in the project (they don't change often), and added a dependency manually.

@gotson
Copy link
Author

gotson commented Jul 28, 2020

I found out why my Mac libraries where failing tests. I am using Mac 10.15, and there's a special parameter to use in cmake to compile for older version (there's one in the cmake script but it doesn't work). However I can only compile down to 10.9, but I don't know about the existing dylib. On Travis i could set up some Mac vms down to 10.11 which is the lowest one they have.

I'll try to get the cross compilation working for Mac and windows.

@gotson
Copy link
Author

gotson commented Jul 28, 2020

After another day of work, i managed to fix the cross-compilation using Docker for both Windows and Mac. The good news is that the Mac SDK in the docker image is 10.10, and can compile down to 10.5, which is what was set in the project CMake file.

I now have cross-build for (in bold the new ones compared to master):

  • Linux: x86, x86_64, arm, armv7, arm64, ppc64
  • Windows: x86, x86_64
  • Mac: x86_64

It would also simplify the build process of the native libs when upgrading the version of libwebp, not having to depend on multiple physical machines to compile for the various architectures.

I have also added more builds in Travis, see here: https://travis-ci.com/github/gotson/webp-imageio/builds/177412664

I would like to add some jobs for the Linux builds using other architecture, but I didn't manage to do so yet. It should be possible using multiarch/qemu-user-static.

@namero999
Copy link

Hey @gotson is this a custom build, or is it somehow possible to pull from maven repo a version of this lib that includes an aarch64 binary as well? Got a CI running on ARM and would like to see all the tests pass there as well.

@namero999
Copy link

namero999 commented Oct 15, 2021

Oh, I've found your fork of the library on maven central (same username). Thanks a lot!

@gotson
Copy link
Author

gotson commented Oct 15, 2021

yes, see here

joostoudeman pushed a commit to joostoudeman/webp-imageio that referenced this issue Jun 16, 2023
@kaiwidmann
Copy link

Hello there,

in September 2023 there was a security issue discovered in libwebp:
https://snyk.io/de/blog/critical-webp-0-day-cve-2023-4863/

Is there a way to rebuild the libs for the different architectures for the current version of libwebp (1.4)? I tried to do it myself, but I failed on Apple silicone.
Any help or response would be very appreciated.

Cheers,

Kai

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

4 participants