I have been using ollvm 9.0.1 (https://github.com/o2e/OLLVM-9.0.1 with clear instruction how to install ollvm on NDK) for Android NDK 21 and it's working great so far on Windows 10, no issues at all. The minor problem is it doesn't support c++20 flag so I needed to use newer NDK 23 with llvm 12
Now i'm having some issues with ollvm 12, it needs libunwind, it's looking for lib/linux/arm/libunwind.a even though i'm on Windows. I'm not sure why it's required
C:\Users\Administrator\Documents\GitHub\Android-Mod-Menu\app\src\main>C:\Users\Administrator\AppData\Local\Android\Sdk\ndk\23.0.7599858\ndk-build
fcntl(): Bad file descriptor
Android NDK: APP_PLATFORM not set. Defaulting to minimum supported version android-16.
Android NDK: WARNING: APP_PLATFORM android-16 is higher than android:minSdkVersion 1 in ./AndroidManifest.xml. NDK binaries will *not* be compatible with devices older than android-16. See https://android.googlesource.com/platform/ndk/+/master/docs/user/common_problems.md for more information.
Android NDK: ERROR:C:/Users/Administrator/AppData/Local/Android/Sdk/ndk/23.0.7599858/build//../sources/cxx-stl/llvm-libc++abi/Android.mk:unwind: LOCAL_SRC_FILES points to a missing file
Android NDK: Check that C:\Users\Administrator\AppData\Local\Android\Sdk\ndk\23.0.7599858\toolchains\llvm\prebuilt\windows-x86_64\lib\clang\12.0.0/lib/linux/arm/libunwind.a exists or that its path is correct
C:/Users/Administrator/AppData/Local/Android/Sdk/ndk/23.0.7599858/build//../build/core/prebuilt-library.mk:45: *** Android NDK: Aborting . Stop.
PS C:\Users\Administrator\Documents\GitHub\Android-Mod-Menu\app\src\main>
So I added libunwind in -DLLVM_ENABLE_PROJECTS flag
My way to compile:
cmake -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_PROJECTS="clang;libunwind" ../llvm
mingw32-make -j4
But getting compile error about declaring at 3%.
Why is libunwind required? and if it's required, what should I do to fix it without having to use linux? i'm not well familar with llvm
Note: I removed warnings to keep output log clearer
Log output:
from C:\Users\Administrator\Documents\GitHub\obfuscator\libunwind\src\libunwind.cpp:22:
[ 3%] Built target obj.clang-tblgen
In file included from C:\Users\Administrator\Documents\GitHub\obfuscator\libunwind\src\RWMutex.hpp:C:\Users\Administrator\Documents\GitHub\obfuscator\libunwind\src\UnwindCursor.hpp:73 In member function ',
from bool libunwind::RWMutex::lock_shared()[ 3%] C:\Users\Administrator\Documents\GitHub\obfuscator\libunwind\src\libunwind.cpp:22':
Building CXX object projects/libunwind/src/CMakeFiles/unwind_shared.dir/Unwind-EHABI.cpp.obj:
C:\Users\Administrator\Documents\GitHub\obfuscator\libunwind\src\RWMutex.hpp: In member function ' '':
AcquireSRWLockShared ' was not declared in this scope
(&_lock);
' In file included from
' was not declared in this scope
C:\Users\Administrator\Documents\GitHub\obfuscator\libunwind\src\UnwindCursor.hpp:73[ 3%] AcquireSRWLockShared,
from Building C object projects/libunwind/src/CMakeFiles/unwind_static.dir/UnwindLevel1.c.obj(&_lock);
C:\Users\Administrator\Documents\GitHub\obfuscator\libunwind\src\Unwind-seh.cpp:29^~~~~~~~~~~~~~~~~~~~C:\Users\Administrator\Documents\GitHub\obfuscator\libunwind\src\RWMutex.hpp:42:5::
C:\Users\Administrator\Documents\GitHub\obfuscator\libunwind\src\RWMutex.hpp:note: In member function 'suggested alternative: 'C:\Users\Administrator\Documents\GitHub\obfuscator\libunwind\src\RWMutex.hpp:42:5:bool libunwind::RWMutex::lock_shared()RpcSsContextLockShared':
'
C:\Users\Administrator\Documents\GitHub\obfuscator\libunwind\src\RWMutex.hpp:42:5: suggested alternative: '(&_lock);
error: ''
cc1.exe: warning: command line option '-nostdinc++' is valid for C++/ObjC++ but not for C
cc1.exe: warning: command line option '-Wno-suggest-override' is valid for C++/ObjC++ but not for C
cc1.exe: warning: command line option '-fno-rtti' is valid for C++/ObjC++ but not for C
AcquireSRWLockShared ' was not declared in this scope
(&_lock);
AcquireSRWLockShared^~~~~~~~~~~~~~~~~~~~C:\Users\Administrator\Documents\GitHub\obfuscator\libunwind\src\RWMutex.hpp:
(&_lock);
RpcSsContextLockShared^~~~~~~~~~~~~~~~~~~~bool libunwind::RWMutex::unlock_shared()
':
C:\Users\Administrator\Documents\GitHub\obfuscator\libunwind\src\RWMutex.hpp:46:5:C:\Users\Administrator\Documents\GitHub\obfuscator\libunwind\src\RWMutex.hpp:42:5: ':
suggested alternative: 'C:\Users\Administrator\Documents\GitHub\obfuscator\libunwind\src\RWMutex.hpp:46:5:ReleaseSRWLockShared ' was not declared in this scope
'
error: '(&_lock);
(&_lock);
ReleaseSRWLockShared ' was not declared in this scope
[ 3%] Built target libclang_exports
ReleaseSRWLockShared C:\Users\Administrator\Documents\GitHub\obfuscator\libunwind\src\RWMutex.hpp:46:5:(&_lock);
C:\Users\Administrator\Documents\GitHub\obfuscator\libunwind\src\RWMutex.hpp: Building CXX object projects/libunwind/src/CMakeFiles/unwind_shared.dir/Unwind-seh.cpp.obj
In member function 'suggested alternative: '
bool libunwind::RWMutex::unlock_shared()ReleaseSemaphore':
'
C:\Users\Administrator\Documents\GitHub\obfuscator\libunwind\src\RWMutex.hpp:46:5:C:\Users\Administrator\Documents\GitHub\obfuscator\libunwind\src\RWMutex.hpp:46:5:ReleaseSRWLockShared (&_lock);
^~~~~~~~~~~~~~~~~~~~ '
ReleaseSemaphoreReleaseSRWLockSharedReleaseSemaphore'
' was not declared in this scope
ReleaseSRWLockSharedReleaseSRWLockShared(&_lock);
C:\Users\Administrator\Documents\GitHub\obfuscator\libunwind\src\RWMutex.hpp:(&_lock);
^~~~~~~~~~~~~~~~~~~~ In member function '^~~~~~~~~~~~~~~~~~~~
bool libunwind::RWMutex::lock()
ReleaseSemaphore':
C:\Users\Administrator\Documents\GitHub\obfuscator\libunwind\src\RWMutex.hpp:50:5:C:\Users\Administrator\Documents\GitHub\obfuscator\libunwind\src\RWMutex.hpp:46:5:C:\Users\Administrator\Documents\GitHub\obfuscator\libunwind\src\RWMutex.hpp: note: error: '':
AcquireSRWLockExclusiveC:\Users\Administrator\Documents\GitHub\obfuscator\libunwind\src\RWMutex.hpp:50:5:'
' was not declared in this scope
AcquireSRWLockExclusive (&_lock);
(&_lock);
' ^~~~~~~~~~~~~~~~~~~~~~~
' was not declared in this scope
C:\Users\Administrator\Documents\GitHub\obfuscator\libunwind\src\RWMutex.hpp:50:5:(&_lock);
In file included from ^~~~~~~~~~~~~~~~~~~~~~~ C:\Users\Administrator\Documents\GitHub\obfuscator\libunwind\src\UnwindCursor.hpp:73
,
from suggested alternative: '':
C:\Users\Administrator\Documents\GitHub\obfuscator\libunwind\src\Unwind-seh.cpp:29 C:\Users\Administrator\Documents\GitHub\obfuscator\libunwind\src\RWMutex.hpp:50:5::
'
C:\Users\Administrator\Documents\GitHub\obfuscator\libunwind\src\RWMutex.hpp:AcquireSRWLockExclusiveerror: In member function '(&_lock);
bool libunwind::RWMutex::lock_shared()^~~~~~~~~~~~~~~~~~~~~~~AcquireSRWLockExclusive':
' was not declared in this scope
C:\Users\Administrator\Documents\GitHub\obfuscator\libunwind\src\RWMutex.hpp:42:5:RpcSsContextLockExclusive
note: error: (&_lock);
suggested alternative: ' ^~~~~~~~~~~~~~~~~~~~~~~RpcSsContextLockExclusive In member function '
'
AcquireSRWLockShared ' was not declared in this scope
':
C:\Users\Administrator\Documents\GitHub\obfuscator\libunwind\src\RWMutex.hpp:50:5:(&_lock);
AcquireSRWLockSharedC:\Users\Administrator\Documents\GitHub\obfuscator\libunwind\src\RWMutex.hpp:54:5: ^~~~~~~~~~~~~~~~~~~~~~~(&_lock);
error: RpcSsContextLockExclusive
RpcSsContextLockExclusive
ReleaseSRWLockExclusive'
C:\Users\Administrator\Documents\GitHub\obfuscator\libunwind\src\RWMutex.hpp:42:5:' was not declared in this scope
AcquireSRWLockExclusive In member function '(&_lock);
bool libunwind::RWMutex::unlock()(&_lock);
suggested alternative: '':
RpcSsContextLockShared
'
C:\Users\Administrator\Documents\GitHub\obfuscator\libunwind\src\RWMutex.hpp:54:5: AcquireSRWLockShared
(&_lock);
error: C:\Users\Administrator\Documents\GitHub\obfuscator\libunwind\src\RWMutex.hpp:
note: bool libunwind::RWMutex::unlock() suggested alternative: '' was not declared in this scope
':
RpcSsContextLockExclusiveReleaseSRWLockExclusiveC:\Users\Administrator\Documents\GitHub\obfuscator\libunwind\src\RWMutex.hpp:54:5:'
C:\Users\Administrator\Documents\GitHub\obfuscator\libunwind\src\RWMutex.hpp: (&_lock);
ReleaseSRWLockExclusive In member function 'error: (&_lock);
'
':
C:\Users\Administrator\Documents\GitHub\obfuscator\libunwind\src\RWMutex.hpp:46:5:C:\Users\Administrator\Documents\GitHub\obfuscator\libunwind\src\RWMutex.hpp:54:5:' was not declared in this scope
RpcSsContextLockExclusive
note: (&_lock);
' RpcSsContextLockExclusive
' was not declared in this scope
'
mingw32-make[2]: *** [projects\libunwind\src\CMakeFiles\unwind_static.dir\build.make:82: projects/libunwind/src/CMakeFiles/unwind_static.dir/libunwind.cpp.obj] Error 1
mingw32-make[2]: *** Waiting for unfinished jobs....
ReleaseSRWLockSharedReleaseSRWLockExclusiveC:\Users\Administrator\Documents\GitHub\obfuscator\libunwind\src\RWMutex.hpp:54:5:(&_lock);
(&_lock);
^~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~note:
[ 3%]
RpcSsContextLockExclusiveC:\Users\Administrator\Documents\GitHub\obfuscator\libunwind\src\RWMutex.hpp:46:5:'
ReleaseSRWLockExclusive note: (&_lock);
^~~~~~~~~~~~~~~~~~~~~~~
ReleaseSemaphore
mingw32-make[2]: *** [projects\libunwind\src\CMakeFiles\unwind_shared.dir\build.make:82: projects/libunwind/src/CMakeFiles/unwind_shared.dir/libunwind.cpp.obj] Error 1
'
mingw32-make[2]: *** Waiting for unfinished jobs....
(&_lock);
cc1.exe: warning: command line option '-nostdinc++' is valid for C++/ObjC++ but not for C
cc1.exe: warning: command line option '-Wno-suggest-override' is valid for C++/ObjC++ but not for C
cc1.exe: warning: command line option '-fno-rtti' is valid for C++/ObjC++ but not for C
^~~~~~~~~~~~~~~~~~~~
[ 3%] Built target scan-view
ReleaseSemaphoremingw32-make[2]: *** [projects\libunwind\src\CMakeFiles\unwind_static.dir\build.make:110: projects/libunwind/src/CMakeFiles/unwind_static.dir/Unwind-seh.cpp.obj] Error 1
mingw32-make[1]: *** [CMakeFiles\Makefile2:29444: projects/libunwind/src/CMakeFiles/unwind_static.dir/all] Error 2
mingw32-make[1]: *** Waiting for unfinished jobs....
C:\Users\Administrator\Documents\GitHub\obfuscator\libunwind\src\RWMutex.hpp: In member function 'bool libunwind::RWMutex::lock()':
[ 3%] Built target hmaptool
C:\Users\Administrator\Documents\GitHub\obfuscator\libunwind\src\RWMutex.hpp:50:5: error: 'AcquireSRWLockExclusive' was not declared in this scope
AcquireSRWLockExclusive(&_lock);
^~~~~~~~~~~~~~~~~~~~~~~
C:\Users\Administrator\Documents\GitHub\obfuscator\libunwind\src\RWMutex.hpp:50:5: note: suggested alternative: 'RpcSsContextLockExclusive'
AcquireSRWLockExclusive(&_lock);
^~~~~~~~~~~~~~~~~~~~~~~
RpcSsContextLockExclusive
C:\Users\Administrator\Documents\GitHub\obfuscator\libunwind\src\RWMutex.hpp: In member function 'bool libunwind::RWMutex::unlock()':
C:\Users\Administrator\Documents\GitHub\obfuscator\libunwind\src\RWMutex.hpp:54:5: error: 'ReleaseSRWLockExclusive' was not declared in this scope
ReleaseSRWLockExclusive(&_lock);
^~~~~~~~~~~~~~~~~~~~~~~
C:\Users\Administrator\Documents\GitHub\obfuscator\libunwind\src\RWMutex.hpp:54:5: note: suggested alternative: 'RpcSsContextLockExclusive'
ReleaseSRWLockExclusive(&_lock);
^~~~~~~~~~~~~~~~~~~~~~~
RpcSsContextLockExclusive
mingw32-make[2]: *** [projects\libunwind\src\CMakeFiles\unwind_shared.dir\build.make:110: projects/libunwind/src/CMakeFiles/unwind_shared.dir/Unwind-seh.cpp.obj] Error 1
mingw32-make[1]: *** [CMakeFiles\Makefile2:29417: projects/libunwind/src/CMakeFiles/unwind_shared.dir/all] Error 2
mingw32-make: *** [Makefile:170: all] Error 2
PS C:\Users\Administrator\Documents\GitHub\obfuscator\build>
I have been using ollvm 9.0.1 (https://github.com/o2e/OLLVM-9.0.1 with clear instruction how to install ollvm on NDK) for Android NDK 21 and it's working great so far on Windows 10, no issues at all. The minor problem is it doesn't support c++20 flag so I needed to use newer NDK 23 with llvm 12
Now i'm having some issues with ollvm 12, it needs libunwind, it's looking for lib/linux/arm/libunwind.a even though i'm on Windows. I'm not sure why it's required
So I added
libunwindin-DLLVM_ENABLE_PROJECTSflagMy way to compile:
But getting compile error about declaring at 3%.
Why is libunwind required? and if it's required, what should I do to fix it without having to use linux? i'm not well familar with llvm
Note: I removed warnings to keep output log clearer
Log output: