bluesadi / Pluto

Obfuscator based on LLVM 14.0.6
829 stars 185 forks source link

Failing to build project. #5

Closed afk-Legacy closed 2 years ago

afk-Legacy commented 2 years ago

Hi! I have compiled the project by following your instruction on bbs.pediy forum, everything goes smoothly but for some reason I cannot compile my project in Android Studio, following error shows whenever I try to compile.

CXX5202] This app only has 32-bit [armeabi-v7a] native libraries. Beginning August 1, 2019 Google Play store requires that all apps that include native libraries must provide 64-bit versions. For more information, visit https://g.co/64-bit-requirement
C/C++: process_begin: CreateProcess(F:\AndroidSdk\ndk\pluto-ndk\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++.exe, F:/AndroidSdk/ndk/pluto-ndk/build//../toolchains/llvm/prebuilt/windows-x86_64/bin/clang++.exe -print-resource-dir, ...) failed.
C/C++: F:/AndroidSdk/ndk/pluto-ndk/build//../build/core/setup-toolchain.mk:111: pipe: No error
C/C++: F:/AndroidSdk/ndk/pluto-ndk/build//../build/core/prebuilt-library.mk:45: *** Android NDK: Aborting    .  Stop.
[CXX1405] error when building with ndkBuild using C:\Users\Admin\Desktop\MyProject\app\src\main\jni\Android.mk: Build command failed.
Error while executing process F:\AndroidSdk\ndk\pluto-ndk\ndk-build.cmd with arguments {NDK_PROJECT_PATH=null APP_BUILD_SCRIPT=C:\Users\Admin\Desktop\MyProject\app\src\main\jni\Android.mk NDK_APPLICATION_MK=C:\Users\Admin\Desktop\MyProject\app\src\main\jni\Application.mk APP_ABI=armeabi-v7a NDK_ALL_ABIS=armeabi-v7a NDK_DEBUG=1 APP_PLATFORM=android-19 NDK_OUT=C:\Users\Admin\Desktop\MyProject\app\build\intermediates\cxx\Debug\1d81t4p4/obj NDK_LIBS_OUT=C:\Users\Admin\Desktop\MyProject\app\build\intermediates\cxx\Debug\1d81t4p4/lib APP_SHORT_COMMANDS=false LOCAL_SHORT_COMMANDS=false -B -n}
Android NDK: ERROR:F:/AndroidSdk/ndk/pluto-ndk/build//../sources/cxx-stl/llvm-libc++abi/Android.mk:unwind: LOCAL_SRC_FILES points to a missing file    
Android NDK: Check that /lib/linux/arm/libunwind.a exists  or that its path is correct   

process_begin: CreateProcess(F:\AndroidSdk\ndk\pluto-ndk\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++.exe, F:/AndroidSdk/ndk/pluto-ndk/build//../toolchains/llvm/prebuilt/windows-x86_64/bin/clang++.exe -print-resource-dir, ...) failed.
F:/AndroidSdk/ndk/pluto-ndk/build//../build/core/setup-toolchain.mk:111: pipe: No error
F:/AndroidSdk/ndk/pluto-ndk/build//../build/core/prebuilt-library.mk:45: *** Android NDK: Aborting    .  Stop.

The error states that Android NDK: Check that /lib/linux/arm/libunwind.a exists or that its path is correct but the file is clearly present under the path F:\AndroidSdk\ndk\pluto-ndk\toolchains\llvm\prebuilt\windows-x86_64\lib64\clang\12.0.8\lib\linux\arm

One more thing I have noticed that the clang++ of newly compile llvm cannot be executed, it states that 16-bit applications are not supported whereas the clang++ of original ndk is executed without any issue.

Dont know if its worth mentioning or not, but I compiled the modified llvm in ubuntu.

Any help or insight will be appreciated.

bluesadi commented 2 years ago

One more thing I have noticed that the clang++ of newly compile llvm cannot be executed, it states that 16-bit applications are not supported whereas the clang++ of original ndk is executed without any issue.

That seems to indicate that the clang++.exe is a 16-bit executable somehow. You can check the format of clang.exe via the file command:

image

afk-Legacy commented 2 years ago

Hey, I executed the command inside the bin folder and noticed differences in the output of both the compiled files and files from original ndk, I have attached the results of both below:

Original NDK(r23b):

legacy@ciphered:/media/legacy/LinDrive/AndroidSdk/ndk/android-ndk-r23b/toolchains/llvm/prebuilt/windows-x86_64/bin$ file *
clang-check.exe:                        PE32+ executable (console) x86-64, for MS Windows
clang-cl.exe:                           PE32+ executable (console) x86-64, for MS Windows
clang++.exe:                            PE32+ executable (console) x86-64, for MS Windows
clang.exe:                              PE32+ executable (console) x86-64, for MS Windows
clang-format.exe:                       PE32+ executable (console) x86-64, for MS Windows
clang-tidy.exe:                         PE32+ executable (console) x86-64, for MS Windows
dsymutil.exe:                           PE32+ executable (console) x86-64, for MS Windows
git-clang-format:                       Python script, ASCII text executable
ld.exe:                                 PE32+ executable (console) x86-64, for MS Windows
ld.lld.exe:                             PE32+ executable (console) x86-64, for MS Windows
liblldb.dll:                            PE32+ executable (DLL) (GUI) x86-64, for MS Windows
libwinpthread-1.dll:                    PE32+ executable (DLL) (console) x86-64, for MS Windows
libxml2.dll:                            PE32+ executable (DLL) (GUI) x86-64, for MS Windows
lldb-argdumper.exe:                     PE32+ executable (console) x86-64, for MS Windows
lldb.cmd:                               DOS batch file, ASCII text
lldb.exe:                               PE32+ executable (console) x86-64, for MS Windows
llvm-addr2line.exe:                     PE32+ executable (console) x86-64, for MS Windows
llvm-ar.exe:                            PE32+ executable (console) x86-64, for MS Windows
llvm-as.exe:                            PE32+ executable (console) x86-64, for MS Windows
llvm-cfi-verify.exe:                    PE32+ executable (console) x86-64, for MS Windows
llvm-config.exe:                        PE32+ executable (console) x86-64, for MS Windows
llvm-cov.exe:                           PE32+ executable (console) x86-64, for MS Windows
llvm-cxxfilt.exe:                       PE32+ executable (console) x86-64, for MS Windows
llvm-dis.exe:                           PE32+ executable (console) x86-64, for MS Windows
llvm-dwarfdump.exe:                     PE32+ executable (console) x86-64, for MS Windows
llvm-dwp.exe:                           PE32+ executable (console) x86-64, for MS Windows
llvm-lib.exe:                           PE32+ executable (console) x86-64, for MS Windows
llvm-link.exe:                          PE32+ executable (console) x86-64, for MS Windows
llvm-lipo.exe:                          PE32+ executable (console) x86-64, for MS Windows
llvm-modextract.exe:                    PE32+ executable (console) x86-64, for MS Windows
llvm-nm.exe:                            PE32+ executable (console) x86-64, for MS Windows
llvm-objcopy.exe:                       PE32+ executable (console) x86-64, for MS Windows
llvm-objdump.exe:                       PE32+ executable (console) x86-64, for MS Windows
llvm-profdata.exe:                      PE32+ executable (console) x86-64, for MS Windows
llvm-ranlib.exe:                        PE32+ executable (console) x86-64, for MS Windows
llvm-rc.exe:                            PE32+ executable (console) x86-64, for MS Windows
llvm-readelf.exe:                       PE32+ executable (console) x86-64, for MS Windows
llvm-readobj.exe:                       PE32+ executable (console) x86-64, for MS Windows
llvm-size.exe:                          PE32+ executable (console) x86-64, for MS Windows
llvm-strings.exe:                       PE32+ executable (console) x86-64, for MS Windows
llvm-strip.exe:                         PE32+ executable (console) x86-64, for MS Windows
llvm-symbolizer.exe:                    PE32+ executable (console) x86-64, for MS Windows
sancov.exe:                             PE32+ executable (console) x86-64, for MS Windows
sanstats.exe:                           PE32+ executable (console) x86-64, for MS Windows

Compiled Files:

legacy@ciphered:/bin/llvm-toolchain/out/install/windows-x86/clang-dev/bin$ file *
clang-check.exe:     PE32+ executable (console) x86-64, for MS Windows
clang-cl.exe:        symbolic link to clang.exe
clang++.exe:         symbolic link to clang.exe
clang.exe:           PE32+ executable (console) x86-64, for MS Windows
clang-format.exe:    PE32+ executable (console) x86-64, for MS Windows
clang-tidy.exe:      PE32+ executable (console) x86-64, for MS Windows
dsymutil.exe:        PE32+ executable (console) x86-64, for MS Windows
git-clang-format:    Python script, ASCII text executable
ld64.lld.exe:        symbolic link to lld.exe
ld.lld.exe:          symbolic link to lld.exe
liblldb.dll:         PE32+ executable (DLL) (GUI) x86-64, for MS Windows
libwinpthread-1.dll: PE32+ executable (DLL) (console) x86-64, for MS Windows
libxml2.dll:         PE32+ executable (DLL) (GUI) x86-64, for MS Windows
lldb-argdumper.exe:  PE32+ executable (console) x86-64, for MS Windows
lldb.cmd:            DOS batch file, ASCII text
lldb.exe:            PE32+ executable (console) x86-64, for MS Windows
lld.exe:             PE32+ executable (console) x86-64, for MS Windows
lld-link.exe:        symbolic link to lld.exe
llvm-addr2line.exe:  symbolic link to llvm-symbolizer.exe
llvm-ar.exe:         PE32+ executable (console) x86-64, for MS Windows
llvm-as.exe:         PE32+ executable (console) x86-64, for MS Windows
llvm-cfi-verify.exe: PE32+ executable (console) x86-64, for MS Windows
llvm-config.exe:     PE32+ executable (console) x86-64, for MS Windows
llvm-cov.exe:        PE32+ executable (console) x86-64, for MS Windows
llvm-cxxfilt.exe:    PE32+ executable (console) x86-64, for MS Windows
llvm-dis.exe:        PE32+ executable (console) x86-64, for MS Windows
llvm-dwarfdump.exe:  PE32+ executable (console) x86-64, for MS Windows
llvm-dwp.exe:        PE32+ executable (console) x86-64, for MS Windows
llvm-lib.exe:        symbolic link to llvm-ar.exe
llvm-link.exe:       PE32+ executable (console) x86-64, for MS Windows
llvm-lipo.exe:       PE32+ executable (console) x86-64, for MS Windows
llvm-modextract.exe: PE32+ executable (console) x86-64, for MS Windows
llvm-nm.exe:         PE32+ executable (console) x86-64, for MS Windows
llvm-objcopy.exe:    PE32+ executable (console) x86-64, for MS Windows
llvm-objdump.exe:    PE32+ executable (console) x86-64, for MS Windows
llvm-profdata.exe:   PE32+ executable (console) x86-64, for MS Windows
llvm-ranlib.exe:     symbolic link to llvm-ar.exe
llvm-rc.exe:         PE32+ executable (console) x86-64, for MS Windows
llvm-readelf.exe:    symbolic link to llvm-readobj.exe
llvm-readobj.exe:    PE32+ executable (console) x86-64, for MS Windows
llvm-size.exe:       PE32+ executable (console) x86-64, for MS Windows
llvm-strings.exe:    PE32+ executable (console) x86-64, for MS Windows
llvm-strip.exe:      symbolic link to llvm-objcopy.exe
llvm-symbolizer.exe: PE32+ executable (console) x86-64, for MS Windows
sancov.exe:          PE32+ executable (console) x86-64, for MS Windows
sanstats.exe:        PE32+ executable (console) x86-64, for MS Windows
bluesadi commented 2 years ago

My result is the same as yours, but it works finely:

clang-check.exe:     PE32+ executable (console) x86-64, for MS Windows
clang-cl.exe:        symbolic link to clang.exe
clang++.exe:         symbolic link to clang.exe
clang.exe:           PE32+ executable (console) x86-64, for MS Windows
clang-format.exe:    PE32+ executable (console) x86-64, for MS Windows
clang-tidy.exe:      PE32+ executable (console) x86-64, for MS Windows
dsymutil.exe:        PE32+ executable (console) x86-64, for MS Windows
git-clang-format:    Python script, ASCII text executable
ld64.lld.exe:        symbolic link to lld.exe
ld.lld.exe:          symbolic link to lld.exe
liblldb.dll:         PE32+ executable (DLL) (GUI) x86-64, for MS Windows

I have not encountered such a error as yours, and I don't know why too. Maybe you can try to compile NDK without adding any pass, and check out if it works well.

SsageParuders commented 2 years ago

Hey, I executed the command inside the bin folder and noticed differences in the output of both the compiled files and files from original ndk, I have attached the results of both below:

Original NDK(r23b):

legacy@ciphered:/media/legacy/LinDrive/AndroidSdk/ndk/android-ndk-r23b/toolchains/llvm/prebuilt/windows-x86_64/bin$ file *
clang-check.exe:                        PE32+ executable (console) x86-64, for MS Windows
clang-cl.exe:                           PE32+ executable (console) x86-64, for MS Windows
clang++.exe:                            PE32+ executable (console) x86-64, for MS Windows
clang.exe:                              PE32+ executable (console) x86-64, for MS Windows
clang-format.exe:                       PE32+ executable (console) x86-64, for MS Windows
clang-tidy.exe:                         PE32+ executable (console) x86-64, for MS Windows
dsymutil.exe:                           PE32+ executable (console) x86-64, for MS Windows
git-clang-format:                       Python script, ASCII text executable
ld.exe:                                 PE32+ executable (console) x86-64, for MS Windows
ld.lld.exe:                             PE32+ executable (console) x86-64, for MS Windows
liblldb.dll:                            PE32+ executable (DLL) (GUI) x86-64, for MS Windows
libwinpthread-1.dll:                    PE32+ executable (DLL) (console) x86-64, for MS Windows
libxml2.dll:                            PE32+ executable (DLL) (GUI) x86-64, for MS Windows
lldb-argdumper.exe:                     PE32+ executable (console) x86-64, for MS Windows
lldb.cmd:                               DOS batch file, ASCII text
lldb.exe:                               PE32+ executable (console) x86-64, for MS Windows
llvm-addr2line.exe:                     PE32+ executable (console) x86-64, for MS Windows
llvm-ar.exe:                            PE32+ executable (console) x86-64, for MS Windows
llvm-as.exe:                            PE32+ executable (console) x86-64, for MS Windows
llvm-cfi-verify.exe:                    PE32+ executable (console) x86-64, for MS Windows
llvm-config.exe:                        PE32+ executable (console) x86-64, for MS Windows
llvm-cov.exe:                           PE32+ executable (console) x86-64, for MS Windows
llvm-cxxfilt.exe:                       PE32+ executable (console) x86-64, for MS Windows
llvm-dis.exe:                           PE32+ executable (console) x86-64, for MS Windows
llvm-dwarfdump.exe:                     PE32+ executable (console) x86-64, for MS Windows
llvm-dwp.exe:                           PE32+ executable (console) x86-64, for MS Windows
llvm-lib.exe:                           PE32+ executable (console) x86-64, for MS Windows
llvm-link.exe:                          PE32+ executable (console) x86-64, for MS Windows
llvm-lipo.exe:                          PE32+ executable (console) x86-64, for MS Windows
llvm-modextract.exe:                    PE32+ executable (console) x86-64, for MS Windows
llvm-nm.exe:                            PE32+ executable (console) x86-64, for MS Windows
llvm-objcopy.exe:                       PE32+ executable (console) x86-64, for MS Windows
llvm-objdump.exe:                       PE32+ executable (console) x86-64, for MS Windows
llvm-profdata.exe:                      PE32+ executable (console) x86-64, for MS Windows
llvm-ranlib.exe:                        PE32+ executable (console) x86-64, for MS Windows
llvm-rc.exe:                            PE32+ executable (console) x86-64, for MS Windows
llvm-readelf.exe:                       PE32+ executable (console) x86-64, for MS Windows
llvm-readobj.exe:                       PE32+ executable (console) x86-64, for MS Windows
llvm-size.exe:                          PE32+ executable (console) x86-64, for MS Windows
llvm-strings.exe:                       PE32+ executable (console) x86-64, for MS Windows
llvm-strip.exe:                         PE32+ executable (console) x86-64, for MS Windows
llvm-symbolizer.exe:                    PE32+ executable (console) x86-64, for MS Windows
sancov.exe:                             PE32+ executable (console) x86-64, for MS Windows
sanstats.exe:                           PE32+ executable (console) x86-64, for MS Windows

Compiled Files:

legacy@ciphered:/bin/llvm-toolchain/out/install/windows-x86/clang-dev/bin$ file *
clang-check.exe:     PE32+ executable (console) x86-64, for MS Windows
clang-cl.exe:        symbolic link to clang.exe
clang++.exe:         symbolic link to clang.exe
clang.exe:           PE32+ executable (console) x86-64, for MS Windows
clang-format.exe:    PE32+ executable (console) x86-64, for MS Windows
clang-tidy.exe:      PE32+ executable (console) x86-64, for MS Windows
dsymutil.exe:        PE32+ executable (console) x86-64, for MS Windows
git-clang-format:    Python script, ASCII text executable
ld64.lld.exe:        symbolic link to lld.exe
ld.lld.exe:          symbolic link to lld.exe
liblldb.dll:         PE32+ executable (DLL) (GUI) x86-64, for MS Windows
libwinpthread-1.dll: PE32+ executable (DLL) (console) x86-64, for MS Windows
libxml2.dll:         PE32+ executable (DLL) (GUI) x86-64, for MS Windows
lldb-argdumper.exe:  PE32+ executable (console) x86-64, for MS Windows
lldb.cmd:            DOS batch file, ASCII text
lldb.exe:            PE32+ executable (console) x86-64, for MS Windows
lld.exe:             PE32+ executable (console) x86-64, for MS Windows
lld-link.exe:        symbolic link to lld.exe
llvm-addr2line.exe:  symbolic link to llvm-symbolizer.exe
llvm-ar.exe:         PE32+ executable (console) x86-64, for MS Windows
llvm-as.exe:         PE32+ executable (console) x86-64, for MS Windows
llvm-cfi-verify.exe: PE32+ executable (console) x86-64, for MS Windows
llvm-config.exe:     PE32+ executable (console) x86-64, for MS Windows
llvm-cov.exe:        PE32+ executable (console) x86-64, for MS Windows
llvm-cxxfilt.exe:    PE32+ executable (console) x86-64, for MS Windows
llvm-dis.exe:        PE32+ executable (console) x86-64, for MS Windows
llvm-dwarfdump.exe:  PE32+ executable (console) x86-64, for MS Windows
llvm-dwp.exe:        PE32+ executable (console) x86-64, for MS Windows
llvm-lib.exe:        symbolic link to llvm-ar.exe
llvm-link.exe:       PE32+ executable (console) x86-64, for MS Windows
llvm-lipo.exe:       PE32+ executable (console) x86-64, for MS Windows
llvm-modextract.exe: PE32+ executable (console) x86-64, for MS Windows
llvm-nm.exe:         PE32+ executable (console) x86-64, for MS Windows
llvm-objcopy.exe:    PE32+ executable (console) x86-64, for MS Windows
llvm-objdump.exe:    PE32+ executable (console) x86-64, for MS Windows
llvm-profdata.exe:   PE32+ executable (console) x86-64, for MS Windows
llvm-ranlib.exe:     symbolic link to llvm-ar.exe
llvm-rc.exe:         PE32+ executable (console) x86-64, for MS Windows
llvm-readelf.exe:    symbolic link to llvm-readobj.exe
llvm-readobj.exe:    PE32+ executable (console) x86-64, for MS Windows
llvm-size.exe:       PE32+ executable (console) x86-64, for MS Windows
llvm-strings.exe:    PE32+ executable (console) x86-64, for MS Windows
llvm-strip.exe:      symbolic link to llvm-objcopy.exe
llvm-symbolizer.exe: PE32+ executable (console) x86-64, for MS Windows
sancov.exe:          PE32+ executable (console) x86-64, for MS Windows
sanstats.exe:        PE32+ executable (console) x86-64, for MS Windows

Please refer to #6 . I had the same problem as you and have solved it.

SsageParuders commented 2 years ago

My result is the same as yours, but it works finely:

clang-check.exe:     PE32+ executable (console) x86-64, for MS Windows
clang-cl.exe:        symbolic link to clang.exe
clang++.exe:         symbolic link to clang.exe
clang.exe:           PE32+ executable (console) x86-64, for MS Windows
clang-format.exe:    PE32+ executable (console) x86-64, for MS Windows
clang-tidy.exe:      PE32+ executable (console) x86-64, for MS Windows
dsymutil.exe:        PE32+ executable (console) x86-64, for MS Windows
git-clang-format:    Python script, ASCII text executable
ld64.lld.exe:        symbolic link to lld.exe
ld.lld.exe:          symbolic link to lld.exe
liblldb.dll:         PE32+ executable (DLL) (GUI) x86-64, for MS Windows

I have not encountered such a error as yours, and I don't know why too. Maybe you can try to compile NDK without adding any pass, and check out if it works well.

Now u can close this issues ~

afk-Legacy commented 2 years ago

As mentioned in #6, the issue was related to copying of the resulting binaries to the desired place, following the solution provided by @SsageParuders , I was able to get the ndk working by putting the binaries in a zip file (in uncompressed format), and then copying to the desired destination. Thank you for your help!