Comments (4)
OLLVM 12.x 编译命令:
cmake -G "Ninja" -DLLVM_ENABLE_PROJECTS="clang" -DCMAKE_BUILD_TYPE=Release -DLLVM_TARGETS_TO_BUILD="ARM" -DBUILD_SHARED_LIBS=OFF ../llvm
CMake 版本: 最新 3.25
NinJa: 1.11
我看 5月份, 就有人提过这个 issue, 肯定不少人有这问题, 麻烦看下啊
from obfuscator.
最新的AS上跑首先确定ndk的llvm是从google那下载修改移植的,通用版本不适用最新ide
from obfuscator.
@heroims 大佬,你好,我的llvm是从google那下载修改移植的。编译出来后替换还是报错啊,求解决。
具体步骤:
- 在使用的ndk版本23.1.7779620的toolchains/llvm/prebuilt/darwin-x86_64/bin/目录下执行clang -v得到llvm的commit hash,然后根据hash去谷歌仓库下载一份相同的代码
-
根据上面的clang -v得知llvm是12.0.8版本的,所以根据大佬你的12.x通用版本进行手动修改移植
-
然后就是开始编译了,进入到项目根目录执行如下命令:
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release -DLLVM_CREATE_XCODE_TOOLCHAIN=ON ../llvm
make -j7 -
经过漫长的等待终于好了,但是发现编译出来的lib里面的clang是12.0.0版本的,而不是ndk里面的12.0.8版本。这个有点奇怪,根据同一个commit hash下载的代码,编译出来的版本为啥不一样呢?
-
最后还是尝试替换文件看下结果如何,分别将build/bin目录下的clang、clang++、clang-12、clang-format四个文件复制替换到 ndk目录/toolchains/llvm/prebuilt/darwin-x86_64/bin,然后进入到build/lib/clang/12.0.0/include目录下复制stdarg.h、stddef.h、__stddef_max_align_t.h、float.h、stdbool.h五个头文件到ndk目录/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include 文件夹下
-
最后就是在项目的CMakeLists.txt加入如下flag开启混淆进行编译:
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -mllvm -sub -mllvm -sobf -mllvm -fla ")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -mllvm -sub -mllvm -sobf -mllvm -fla")
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -mllvm -sub -mllvm -sobf -mllvm -fla" )
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -mllvm -sub -mllvm -sobf -mllvm -fla" )
编译报错了。。
不知道是不是上面clang版本不对的问题,我在 https://github.com/llvm/llvm-project 也没有找到llvm-project的clang12.0.8的版本,麻烦大佬解答下,这个编译过程太漫长了,一步步尝试很费时间。谢谢了
from obfuscator.
@anjiuzhe
建议看这个编译NDK:https://android.googlesource.com/toolchain/llvm_android/+/master/README.md, Instructions to rebuild a particular toolchain release
这一节
编译完以后把编译好的文件替换回同版本NDK的 toolchains/llvm/prebuilt/[system arch]
from obfuscator.
Related Issues (20)
- Compile 7.0 & 8.0 version of ollvm error on osx intel 10.15.7 HOT 2
- AutoRegistration Issue HOT 5
- String obfuscation NOT obfuscating in Windows HOT 1
- aesSeed flag causing duplicate symbols HOT 3
- 使用xcodebuild 命令行指定工具链进行ollvm混淆编译不会生效 HOT 2
- Support for 15.x
- Can't patch NDK source with Ollvm 14
- 开启-mllvm -bcf后编译卡住问题 HOT 3
- 请教一个入门问题,如何编译 32 位的 bin ? 🤣 HOT 1
- Support for LLVM 17
- llvm 14.x 集成ollvm 混淆无效 HOT 3
- LLVM 9.0.1 分支,字符串混淆 没有生效
- 字符串混淆后 运行时获取 显示为没有还原
- Android开发下 ubuntu上移植 有人成功了么
- 为什么使用 c++ 标准的头文件就会出现报错
- 集成google test, 单元测试缺少libclang_rt.profile-aarch64-android.a 文件
- Mac arm架构编译出来的clang,出现Bad CPU type in executable
- 字符数组,混淆不生效
- 编译好一个ollvm之后,在xcode下,无法正常编译ipa
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from obfuscator.