1. 下载 qcom llvm, https://developer.qualcomm.com/software/snapdragon-llvm-compiler-android/tools
  2. 把解压出来的文件复制到asop 内。 类似于 cp $(LLVM_DIR)/toolchains/llvm-Snapdragon_LLVM_for_Android_8.0/prebuilt/linux-x86_64/* $(TOP_DIR)/prebuilts/clang/host/linux-x86/sdclang-8/
  3. 在 BoardConfig.mk 中增加
    # SDClang Config
    ifneq ($(HOST_OS),darwin)
    SDCLANG := true 
    SDCLANG_PATH := prebuilts/clang/host/linux-x86/sdclang-8/bin
    SDCLANG_PATH_2 := prebuilts/clang/host/linux-x86/sdclang-8/bin
    SDCLANG_LTO_DEFS := device/qcom/common/sdllvm-lto-defs.mk
    endif
  4. export 变量
    # export SDCLANG_PATH=prebuilts/clang/host/linux-x86/sdclang-8/bin
    # export SDCLANG_PATH_2=prebuilts/clang/host/linux-x86/sdclang-8/bin

参考

https://developer.qualcomm.com/forum/qdn-forums/software/snapdragon-llvm-compiler-android/68403
https://blog.csdn.net/love_xiaozhao/article/details/89684756
http://bbs.raindi.net/thread-26209-1-1.html
https://blog.csdn.net/qq_23129309/article/details/85225017
https://discuss.96boards.org/t/build-fails-sdclang-path-can-not-be-empty/6669

标签: aosp

添加新评论