1 Star 0 Fork 0

yymm31/duo-examples

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
envsetup.sh 1.34 KB
一键复制 编辑 原始数据 按行查看 历史
carbon 提交于 2024-04-01 15:40 . optimize gcc parameters
#!/bin/bash
SDK_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &> /dev/null && pwd)
echo "SDK_DIR: ${SDK_DIR}"
MILKV_DUO_SDK=${SDK_DIR}/duo-sdk
TOOLCHAIN_DIR=${MILKV_DUO_SDK}/riscv64-linux-musl-x86_64
SDK_URL="https://github.com/milkv-duo/duo-app-sdk/releases/download/duo-app-sdk-v1.2.0/duo-sdk-v1.2.0.tar.gz"
function get_duo_sdk()
{
pushd ${SDK_DIR}
echo "SDK_URL: ${SDK_URL}"
sdk_file=${SDK_URL##*/}
echo "sdk_file: ${sdk_file}"
wget ${SDK_URL} -O ${sdk_file}
if [ $? -ne 0 ]; then
echo "Failed to download ${SDK_URL} !"
return 1
fi
if [ ! -f ${sdk_file} ]; then
echo "${sdk_file} not found!"
return 1
fi
echo "Extracting ${sdk_file}..."
tar -xf ${sdk_file}
if [ $? -ne 0 ]; then
echo "Extract ${sdk_file} failed!"
return 1
fi
[ -f ${sdk_file} ] && rm -rf ${sdk_file}
popd
}
if [ ! -d ${MILKV_DUO_SDK} ]; then
echo "SDK does not exist, download it now..."
get_duo_sdk
if [ $? -ne 0 ]; then
echo "Get SDK failed!"
return 1
fi
fi
export TOOLCHAIN_PREFIX=${TOOLCHAIN_DIR}/bin/riscv64-unknown-linux-musl-
export SYSROOT=${MILKV_DUO_SDK}/rootfs
export CC=${TOOLCHAIN_PREFIX}gcc
export CFLAGS="-mcpu=c906fdv -march=rv64imafdcv0p7xthead -mcmodel=medany -mabi=lp64d"
# -Os
export LDFLAGS="-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64"
echo "SDK environment is ready"
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/yymm31/duo-examples.git
git@gitee.com:yymm31/duo-examples.git
yymm31
duo-examples
duo-examples
main

搜索帮助