Android 9编译报错sdclang设置

错误提示
goroutine 1 [running]:
android/soong/cc/config.setSdclangVars()
/home/vagrant/android-msm/build/soong/cc/config/global.go:197 +0x20d4
android/soong/cc/config.init.2()
/home/vagrant/android-msm/build/soong/cc/config/global.go:169 +0xcc9
android/soong/cc/config.init()
/home/vagrant/android-msm/build/soong/cc/config/tidy_test.go:42 +0x3969
main.init()
/home/vagrant/android-msm/out/soong/.bootstrap/soong-cc-
config/test/test.go:34 +0x4e
ninja: build stopped: subcommand failed.
这个问题出现在高通的Android高版本的源码编译的场合,解决办法能搜到一个stack上的解答,但是已经不适合当前的版本。
下面给出我发现的解决办法:
1.先要在任意一个vendorsetup.sh中添加变量。
export SDCLANG_AE_CONFIG=“device/qcom/common/sdclang.json”
我这里添加在device/qcom/common/vendorsetup.sh
2.添加sdclang.json
位置要和上面的路径一致,内容举例如下所示。
{
“default”: {
“SDCLANG”: false,
“SDCLANG_PATH”: “vendor/qcom/proprietary/llvm-arm-toolchain-ship/3.9/bin”,
“SDCLANG_PATH_2”: “vendor/qcom/proprietary/llvm-arm-toolchain-ship/4.0/bin”,
“SDCLANG_FLAGS”: “-Wno-vectorizer-no-neon”,
“SDCLANG_FLAGS_2”: “-Wno-vectorizer-no-neon”
},
“msmnile”: {
“SDCLANG”: true,
“SDCLANG_PATH”: “vendor/qcom/proprietary/llvm-arm-toolchain-ship/3.9/bin”,
“SDCLANG_PATH_2”: “vendor/qcom/proprietary/llvm-arm-toolchain-ship/4.0/bin”,
“SDCLANG_FLAGS”: “-Wno-vectorizer-no-neon”,
“SDCLANG_FLAGS_2”: “-Wno-vectorizer-no-neon”
},
“msm8998”: {
“SDCLANG”: true,
“SDCLANG_PATH”: “device/qcom/common/llvm-arm-toolchain-ship/4.0/bin”,
“SDCLANG_PATH_2”: “device/qcom/common/llvm-arm-toolchain-ship/4.0/bin”,
“SDCLANG_FLAGS”: “-Wno-vectorizer-no-neon”,
“SDCLANG_FLAGS_2”: “-Wno-vectorizer-no-neon”
},
}
3.sdclang对应的工具可使用OnePlus在github上的开源代码中的工具。
网址为:
https://github.com/OnePlusOSS/android_device_qcom_common/tree/oneplus6/9.0.0

你可能感兴趣的:(Android)