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

Add build support for Windows on ARM64 (based on llvm-mingw) #3252

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

ZIXT233
Copy link

@ZIXT233 ZIXT233 commented May 9, 2022

I tried to cross compile scrcpy for win on arm64 using llvm-mingw, which seems to be working properly and significantly improves video performance in win on arm64.

What I did:

  • Prebuilt libusb,ffmpeg,SDL2 for win on arm64, which was placed in my responsitories. (Removed libusb build flags "-mwin32" and "--add-stdcall-alias" to support llvm)
  • Added scripts to get prebuilt-deps.
  • Added win on arm64 build option in release.mk, which should be manually specified as llvm-mingw is a special toolchain. In addtion, I removed the linker option "-Wl,--allow-shlib-undefined" unsupported by llvm in build.ninja after meson completed. (There seems to be no way to prevent meson from passing this option so far, see: Meson passing extra linker options to ninja backend (-Wl,--allow-shlib-undefined) mesonbuild/meson#7506 )
  • Modified app/build.ninja to select libusb dll depending on host_machine.cpu_family().

Known issue:

  • Reported error "couldn't find image decorder" and "couldn't load icon" when starting.
    36F3D3382058CE4FCE21E4AEB551C50B

I'm not sure where to put the prebuilt package to ensure its maintenance .
Let me know if there are any problems.

@rom1v
Copy link
Collaborator

rom1v commented May 10, 2022

Thank you for your work.

The "prebuilt" mechanism of scrcpy is quite rudimentary (it downloads prebuilt releases). This can be a limitation (we could not patch dependencies as necessary), but in practice it "works".

However, this is acceptable only if the prebuilt binaries are "official" (e.g. linked from the official website of the dependency). It could not depend on binaries from random repositories. I understand that official binaries do not exist for ARM64 (so you did build them by yourself), but it is a problem to depend on https://github.com/ZIXT233/. 😞

@ZIXT233
Copy link
Author

ZIXT233 commented May 10, 2022

It is feasible to build dependencies from the official code. Maybe I can modify the script to support it? @rom1v

@rom1v
Copy link
Collaborator

rom1v commented May 10, 2022

@ZIXT233 Please read the discussion in #1753 first :)

It would be great to (optionally) build (from Linux) the dependencies (SDL, FFmpeg, libusb, adb), but still be able to use either the official prebuilt or the existing package already installed, if any. After that, yes, we could add the scripts/options to cross-build for Windows-arm64.

@ZIXT233
Copy link
Author

ZIXT233 commented May 10, 2022

@rom1v So are you considering adding optional deps dynamic building scripts/options for more common situation?

@rom1v
Copy link
Collaborator

rom1v commented May 10, 2022

Separate scripts to build the dependencies when requested (similar to the contribs in vlc), so that the resulting binaries could be used to build scrcpy, would be great, yes.

@ZIXT233
Copy link
Author

ZIXT233 commented May 12, 2022

I'll try it. It may take some time to design.

@rom1v
Copy link
Collaborator

rom1v commented May 21, 2022

I started a skeleton: #3283

@tormodvolden
Copy link

We'd like to fix this properly in libusb: libusb/libusb#1192

@srinya
Copy link

srinya commented Sep 12, 2022

I would like to cross-compile scrcpy application for ARM-32bit architecture. does it support ARM Platform ?

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 this pull request may close these issues.

4 participants