-
Notifications
You must be signed in to change notification settings - Fork 821
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
[WSL1] ndk_25 clang-14 Exec format error #8681
Comments
Is it possible to use WSL2? |
emmm, sorry, i just build something, |
Ran into the same problem in WSL1. WSL2 is too slow to build project in NTFS. |
This is exactly one of the reasons to avoid Windows 11 🤣🤣 |
i5-2550k: win_11 == joke; return -1; |
The issue is in the lxcore.sys kernel driver which implements WSL1. Here is the debug message associated with the exec error:
There is a somewhat similar issue with gzip in old Ubuntu release. clang-tidy and clangd from that NDK toolchain both work in same WSL1 environment. It may be possible to patch the ELF header of clang-14 binary to run it in WSL1. |
Why Microsoft lowers wsl1 priority? wsl1 can use the whole physical memory and cpues of host, better than wsl2 which is just a virtual machine, if microsoft implements a proxy with docker API, we will got a windows container immediately. Hope to take it into consideration. |
has same issue: OPTIONS: Generic Options: --help - Display available options (--help-hidden for more) clang-check options: |
workaround: |
cd /mnt/c/cpps/ndk/linux/toolchains/llvm/prebuilt/linux-x86_64/bin/ cd /mnt/c/cpps/libs/openssl/openssl-3.0.5 ./Configure android-arm64 -D__ANDROID_API__=26 --prefix="/mnt/c/cpps/libs/openssl/openssl-3.0.5/android/arm64-v8a" --openssldir="/mnt/c/cpps/libs/openssl/openssl-3.0.5/android/arm64-v8a" work but make: *** [Makefile:3200: build_sw] Error 2; |
i know google say "not support wsl1". |
if not cp clang-14 to clang++ clang, the openssl boost build can not run the clang; because clang++/clang file just a bash; my wsl1 can not run it; my reply is my openssl all build command, not have " [/home/binsys/work/]"; my build command without patchelf work good with ndk_23b on wsl1; and my build command without patchelf also work good with ndk_25 on original linux and vmware; my build command not work without patchelf with ndk25 on wsl1,see this issuess. my build command work but build make install error with patchelf with ndk25 on wsl1. |
must patchelf clang and clang++ after you cp,if you need cp. |
same problem friend; anyway, now, i use my j1900 x86 route to build android cpp lib then cp to win folder from samba for code use, no "zhe teng" le lol; |
@binsys Many thanks tor this workaround. It helped me with Win10 & Ubuntu 22.04 running via WSL v1 while buidling Kivy project using Buildozer with NDK 25b (issue).
|
If none of the above methods work, you can try the following operations I created a #!/bin/sh
/lib64/ld-linux-x86-64.so.2 /home/ronan/Android/SDK/ndk/26.1.10909125/toolchains/llvm/prebuilt/linux-x86_64/bin/clang-17 $@ |
Version
10.0.19044 N/A Build 19044
WSL Version
Kernel Version
Linux version 4.4.0-19041-Microsoft ([email protected]) (gcc version 5.4.0 (GCC) )
Distro Version
debian 11.4
Other Software
ndk https://developer.android.com/ndk/downloads
android-ndk-r25-linux.zip | 530938532 | 9fce956edb6abd5aca42acf6bbfb21a90a67f75b
Repro Steps
unzip android-ndk-r25-linux.zip
root@gamefunc-2550k:/mnt/c/cpps/ndk/android-ndk-r25/toolchains/llvm/prebuilt/linux-x86_64/bin# ./clang-14 --version
-bash: ./clang-14: cannot execute binary file: Exec format error
-bash: ./clang-14: cannot execute binary file: Exec format error
Expected Behavior
root@gamefunc:/media/extra1/android-ndk-r25/toolchains/llvm/prebuilt/linux-x86_64/bin# ./clang-14 --version
Android (8490178, based on r450784d) clang version 14.0.6 (https://android.googlesource.com/toolchain/llvm-project 4c603efb0cca074e9238af8b4106c30add4418f6)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /media/extra1/android-ndk-r25/toolchains/llvm/prebuilt/linux-x86_64/bin/.
Actual Behavior
-bash: ./clang-14: cannot execute binary file: Exec format error
Diagnostic Logs
No response
The text was updated successfully, but these errors were encountered: