Open terrencetang2023 opened 1 year ago
error: /data/local/ohos-sdk/linux/native/llvm/bin/arm-linux-ohos-clang-gcc not found
To support cross build, SRS extract the --cross-prefix
from --cc
, which only support gcc right now:
if [[ $SRS_CROSS_BUILD_PREFIX != "" && $SRS_CROSS_BUILD_HOST == "" ]]; then
SRS_CROSS_BUILD_HOST=$(echo $SRS_CROSS_BUILD_PREFIX| sed 's/-$//g')
fi
if [[ $SRS_TOOL_CC != "" && $SRS_CROSS_BUILD_HOST == "" ]]; then
SRS_CROSS_BUILD_HOST=$(echo $SRS_TOOL_CC| sed 's/-gcc$//g')
fi
if [[ $SRS_CROSS_BUILD_PREFIX == "" ]]; then
SRS_CROSS_BUILD_PREFIX="${SRS_CROSS_BUILD_HOST}-"
fi
SRS_TOOL_CC=${SRS_CROSS_BUILD_PREFIX}gcc
So there is a workaround, to specify the prefix and cc, for example:
--cross-prefix=/data/local/ohos-sdk/linux/native/llvm/bin/arm-linux-ohos- \
--cc=clang
Welcome to help to improve the auto/options.sh
script to support clang.
Description
When the cross-compilation tool uses clang/clang++, gcc/g++ is forcibly appended, please add the judgment condition of the clang tool
SRS Version: v6.0-d0
SRS Log:
Replay
Please describe how to replay the bug?
Step 1: run configure
Step 2: make
Expect
It is expected to add clang/clang++ support in cross-compilation environments
TRANS_BY_GPT3