构建riscv64版本下webview中浏览器引擎二进制文件
需求
webview中有个浏览器引擎二进制文件,需要重新构建下riscv64版本的,构建方式在三方库chromium中。参照readme教程构建下riscv版本,替换一下哈。
过程
一、阅读third_party下chromium中的README_ZH.md
(对自己要求高的就安装“TYPORA”打开,notepad++打开也一样)。
二、分步执行./init_chromium.sh
第一步为git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git。执行时“正克隆到 ‘depot_tools’…”卡住了,需要爬梯子,不然下不下来,不知道有没有镜像,没去找。找同事帮忙开了个代理
root@znvhwd:/home/ptg/qemu_download/3.2release/third_party/chromium# export {http,https,all}_proxy=http://192.168.***.***:7890
root@znvhwd:/home/ptg/qemu_download/3.2release/third_party/chromium# echo $http
$http_proxy $https_proxy
root@znvhwd:/home/ptg/qemu_download/3.2release/third_party/chromium#root@znvhwd:/home/ptg/qemu_download/3.2release/third_party/chromium# curl google.com
curl: (7) Failed to connect to 192.168.101.*** port 7890: 拒绝连接
root@znvhwd:/home/ptg/qemu_download/3.2release/third_party/chromium# curl google.com
“<HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8">
<TITLE>301 Moved</TITLE></HEAD><BODY>
<H1>301 Moved</H1>
The document has moved
<A HREF="http://www.google.com/">here<A>.
</BODY></HTML>
root@znvhwd:/home/ptg/qemu_download/3.2release/third_party/chromium# git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
正克隆到 'depot_tools'...
remote: Sending approximately 49.73 MiB ...
remote: Total 54089 (delta 36264), reused 54089 (delta 36264)
接收对象中: 100% (54089/54089), 49.71 MiB | 6.07 MiB/s, 完成.
处理 delta 中: 100% (36264/36264), 完成。
三、配置depot_tools环境变量
export CR_BRANCH="99.0.4844.88"
export PATH="$PATH:${PWD}/depot_tools"
执行正常。第一行暂时不需要,后续步骤中再配置也可,第二行的${PWD}替换成自己depot_tools所在目录即可。
四、执行fetch --nohooks android
fetch --nohooks chromium,有搜到说不要加参数- -no-history的。
卡一会开始执行(确保硬盘空间40G以上,据说编译需要100G),执行过程中报错。
FileNotFoundError: [Errno 2] No such file or directory: ‘/home/ptg/qemu_download/3.2release/third_party/chromium/src’
解决表象原因:mkdir /home/ptg/qemu_download/3.2release/third_party/chromium/src
使用gclient sync命令进行断点续传。
________ running 'git -c core.deltaBaseCacheLimit=2g clone --no-checkout --progress https://chromium.googlesource.com/chromium/src.git /home/ptg/qemu_download/3.2release/third_party/chromium/_gclient_src_6wg648qg' in '/home/ptg/qemu_download/3.2release/third_party/chromium'
Cloning into '/home/ptg/qemu_download/3.2release/third_party/chromium/_gclient_src_6wg648qg'...
remote: Sending approximately 39.40 GiB ...
remote: Counting objects: 869822, done
remote: Finding sources: 100% (1603/1603)
Receiving objects: 2% (541000/20613079), 307.34 MiB | 5.81 MiB/s
Receiving objects: 61% (12653612/20613079), 6.16 GiB | 5.38 MiB/s /s
admin@znvhwd:/home/ptg$ gclient sync
Updating depot_tools...
________ running 'git -c core.deltaBaseCacheLimit=2g clone --no-checkout --progress https://chromium.googlesource.com/chromium/src.git /home/ptg/_gclient_src_h1560bww' in '/home/ptg'
Cloning into '/home/ptg/_gclient_src_h1560bww'...
remote: Sending approximately 40.47 GiB ...
remote: Counting objects: 870025, done
remote: Finding sources: 100% (771/771)
error: RPC failed; curl 56 GnuTLS recv error (-9): Error decoding the received TLS packet.
fatal: the remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed
1>WARNING: subprocess '"git" "-c" "core.deltaBaseCacheLimit=2g" "clone" "--no-checkout" "--progress" "https://chromium.googlesource.com/chromium/src.git" "/home/ptg/_gclient_src_h1560bww"' in /home/ptg failed; will retry after a short nap...
________ running 'git -c core.deltaBaseCacheLimit=2g clone --no-checkout --progress https://chromium.googlesource.com/chromium/src.git /home/ptg/_gclient_src_h1560bww' in '/home/ptg' attempt 2 / 2
Cloning into '/home/ptg/_gclient_src_h1560bww'...
remote: Sending approximately 40.47 GiB ...
remote: Counting objects: 870169, done
remote: Finding sources: 100% (915/915)
error: RPC failed; curl 56 GnuTLS recv error (-9): Error decoding the received TLS packet.
fatal: the remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed
1>WARNING: subprocess '"git" "-c" "core.deltaBaseCacheLimit=2g" "clone" "--no-checkout" "--progress" "https://chromium.googlesource.com/chromium/src.git" "/home/ptg/_gclient_src_h1560bww"' in /home/ptg failed; will retry after a short nap...
________ running 'git -c core.deltaBaseCacheLimit=2g clone --no-checkout --progress https://chromium.googlesource.com/chromium/src.git /home/ptg/_gclient_src_mzjy2ogh' in '/home/ptg'
Cloning into '/home/ptg/_gclient_src_mzjy2ogh'...
remote: Sending approximately 40.47 GiB ...
remote: Counting objects: 870181, done
remote: Finding sources: 100% (927/927)
Receiving objects: 65% (13487287/20629502), 12.31 GiB | 4.15 MiB/s
下谷歌内核的代码已经第三天了,还是各种失败,期间尝试了各种方法,换代理,各种配置:
admin@znvhwd:~/temp$ git config --list
filter.lfs.clean=git-lfs clean -- %f
filter.lfs.smudge=git-lfs smudge -- %f
filter.lfs.process=git-lfs filter-process
filter.lfs.required=true
http.sslverify=false
http.postbuffer=1048576000
http.lowspeedlimit=0
http.lowspeedtime=999999
core.compression=-1
或者是从https://gitee.com/mirrors/chromium下载镜像
admin@znvhwd:~/temp$ GIT_TRACE=1 git -c core.deltaBaseCacheLimit=2g clone https://gitee.com/mirrors/chromium.git
10:34:39.954862 git.c:439 trace: built-in: git clone https://gitee.com/mirrors/chromium.git
正克隆到 'chromium'...
10:34:39.965491 run-command.c:663 trace: run_command: git-remote-https origin https://gitee.com/mirrors/chromium.git
10:34:46.547940 run-command.c:663 trace: run_command: git fetch-pack --stateless-rpc --stdin --lock-pack --thin --check-self-contained-and-connected --cloning https://gitee.com/mirrors/chromium.git/
10:34:46.549727 git.c:439 trace: built-in: git fetch-pack --stateless-rpc --stdin --lock-pack --thin --check-self-contained-and-connected --cloning https://gitee.com/mirrors/chromium.git/
remote: Enumerating objects: 20623684, done.
remote: Counting objects: 100% (2331475/2331475), done.
remote: Compressing objects: 100% (473601/473601), done.
10:36:48.210266 run-command.c:663 trace: run_command: git index-pack --stdin -v --fix-thin '--keep=fetch-pack 8507 on znvhwd' --check-self-contained-and-connected --pack_header=2,20623684
10:36:48.211493 git.c:439 trace: built-in: git index-pack --stdin -v --fix-thin '--keep=fetch-pack 8507 on znvhwd' --check-self-contained-and-connected --pack_header=2,20623684
error: RPC 失败。curl 56 GnuTLS recv error (-9): Error decoding the received TLS packet.
fatal: 远端意外挂断了
fatal: 过早的文件结束符(EOF)
fatal: index-pack 失败
反正就是遇到各种错误后失败。
1>WARNING: subprocess '"git" "-c" "core.deltaBaseCacheLimit=2g" "clone" "--no-checkout" "--progress" "https://chromium.googlesource.com/chromium/src.git" "/home/ptg/_gclient_src_h1560bww"' in /home/ptg failed; will retry after a short nap...
________ running 'git -c core.deltaBaseCacheLimit=2g clone --no-checkout --progress https://chromium.googlesource.com/chromium/src.git /home/ptg/_gclient_src_mzjy2ogh' in '/home/ptg'
Cloning into '/home/ptg/_gclient_src_mzjy2ogh'...
remote: Sending approximately 40.47 GiB ...
remote: Counting objects: 870181, done
remote: Finding sources: 100% (927/927)
fatal: the remote end hung up unexpectedly), 35.20 GiB | 340.00 KiB/s
fatal: early EOF
fatal: index-pack failed
1>WARNING: subprocess '"git" "-c" "core.deltaBaseCacheLimit=2g" "clone" "--no-checkout" "--progress" "https://chromium.googlesource.com/chromium/src.git" "/home/ptg/_gclient_src_mzjy2ogh"' in /home/ptg failed; will retry after a short nap...
________ running 'git -c core.deltaBaseCacheLimit=2g clone --no-checkout --progress https://chromium.googlesource.com/chromium/src.git /home/ptg/_gclient_src_mzjy2ogh' in '/home/ptg' attempt 2 / 2
Cloning into '/home/ptg/_gclient_src_mzjy2ogh'...
remote: Sending approximately 40.47 GiB ...
remote: Counting objects: 870337, done
remote: Finding sources: 100% (1083/1083)
Receiving objects: 60% (12398735/20629947), 4.93 GiB | 1.79 MiB/s
1>WARNING: subprocess '"git" "-c" "core.deltaBaseCacheLimit=2g" "clone" "--no-checkout" "--progress" "https://chromium.googlesource.com/chromium/src.git" "/home/ptg/_gclient_src_mzjy2ogh"' in /home/ptg failed; will retry after a short nap...
Syncing projects: 100% ( 1/ 1) src
src (ERROR)
----------------------------------------
[0:00:00] Started.
[0:01:19]
Traceback (most recent call last):
File "/home/ptg/depot_tools/gclient_scm.py", line 1169, in _Clone
self._Run(clone_cmd,
File "/home/ptg/depot_tools/gclient_scm.py", line 1515, in _Run
gclient_utils.CheckCallAndFilter(cmd, env=env, **kwargs)
File "/home/ptg/depot_tools/gclient_utils.py", line 715, in CheckCallAndFilter
raise subprocess2.CalledProcessError(
subprocess2.CalledProcessError: Command 'git -c core.deltaBaseCacheLimit=2g clone --no-checkout --progress https://chromium.googlesource.com/chromium/src.git /home/ptg/_gclient_src_h1560bww' returned non-zero exit status 128 in /home/ptg
[0:50:14] _____ Conflicting directory found in /home/ptg/src. Moving to /home/ptg/_bad_scm/srcsj6rw4im.
[0:50:14]
Traceback (most recent call last):
File "/home/ptg/depot_tools/gclient_scm.py", line 647, in update
self._Clone(revision, url, options)
File "/home/ptg/depot_tools/gclient_scm.py", line 1169, in _Clone
self._Run(clone_cmd,
File "/home/ptg/depot_tools/gclient_scm.py", line 1515, in _Run
gclient_utils.CheckCallAndFilter(cmd, env=env, **kwargs)
File "/home/ptg/depot_tools/gclient_utils.py", line 715, in CheckCallAndFilter
raise subprocess2.CalledProcessError(
subprocess2.CalledProcessError: Command 'git -c core.deltaBaseCacheLimit=2g clone --no-checkout --progress https://chromium.googlesource.com/chromium/src.git /home/ptg/_gclient_src_h1560bww' returned non-zero exit status 128 in /home/ptg
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/ptg/depot_tools/gclient_scm.py", line 1169, in _Clone
self._Run(clone_cmd,
File "/home/ptg/depot_tools/gclient_scm.py", line 1515, in _Run
gclient_utils.CheckCallAndFilter(cmd, env=env, **kwargs)
File "/home/ptg/depot_tools/gclient_utils.py", line 715, in CheckCallAndFilter
raise subprocess2.CalledProcessError(
subprocess2.CalledProcessError: Command 'git -c core.deltaBaseCacheLimit=2g clone --no-checkout --progress https://chromium.googlesource.com/chromium/src.git /home/ptg/_gclient_src_mzjy2ogh' returned non-zero exit status 128 in /home/ptg
----------------------------------------
Error: Command 'git -c core.deltaBaseCacheLimit=2g clone --no-checkout --progress https://chromium.googlesource.com/chromium/src.git /home/ptg/_gclient_src_mzjy2ogh' returned non-zero exit status 128 in /home/ptg
Warnings:
Conflicting directory /home/ptg/src moved to /home/ptg/_bad_scm/srcsj6rw4im.
均告失败。再尝试几次,还不行的话试着重新编译git或者尝试配置CAF镜像
git config --global url.https://source.codeaurora.org.insteadOf git://codeaurora.org
git config --global url.https://beijing.source.codeaurora.org.insteadOf git://codeaurora.org
git config --global url.https://beijing.source.codeaurora.org.insteadOf
跟同事尝试无数次,终于下载成功,查阅资料,怀疑大概率还是网络原因导致。建议遇到上述同样问题的朋友们有条件的情况下可以尝试换个网络环境。
五、执行脚本剩余内容
cd src
git fetch origin $CR_BRANCH
git checkout -b $CR_BRANCH FETCH_HEAD
gclient sync --force --nohooks --with_branch_heads -D -v
# 下载依赖
./build/install-build-deps-android.sh
gclient runhooks -v
# 使用Openharmony nweb的patch
git apply --whitespace=nowarn --ignore-whitespace -p2 ../patch/*.patch
基本没遇到什么困难。
1)$CR_BRANCH变量为之前配置的export CR_BRANCH=“99.0.4844.88”,没配的要再配置一下。
2)执行gclient sync --force --nohooks --with_branch_heads -D -v时要解决冲突
admin@znvhwd:/home/ptg/chromium/src$ gclient sync --force --nohooks --with_branch_heads -D -v
Updating depot_tools...
depot_tools update failed. Conflict in /home/ptg/depot_tools
error: 您对下列文件的本地修改将被检出操作覆盖:
gerrit_util.py
infra/config/recipes.cfg
recipes/README.recipes.md
recipes/recipe_modules/gerrit/api.py
recipes/recipe_modules/gerrit/examples/full.expected/basic.json
recipes/recipe_modules/gerrit/examples/full.py
recipes/recipe_modules/tryserver/api.py
recipes/recipe_modules/tryserver/examples/full.expected/basic_tags.json
recipes/recipe_modules/tryserver/tests/gerrit_change_owner.py
请在切换分支前提交或贮藏您的修改。
正在终止
admin@znvhwd:/home/ptg/chromium/src$ git status gerrit_util.py
位于分支 99.0.4844.88
无文件要提交,干净的工作区
admin@znvhwd:/home/ptg/chromium/src$ git diff gerrit_util.py
fatal: 有歧义的参数 'gerrit_util.py':未知的版本或路径不存在于工作区中。
使用 '--' 来分隔版本和路径,例如:
'git <命令> [<版本>...] -- [<文件>...]'
admin@znvhwd:/home/ptg/chromium/src$ find ./ -name gerrit_util.py
./third_party/depot_tools/gerrit_util.py
admin@znvhwd:/home/ptg/chromium/src$ git diff ./third_party/depot_tools/gerrit_util.py
admin@znvhwd:/home/ptg/chromium/src$ cd /home/ptg/depot_tools
admin@znvhwd:/home/ptg/depot_tools$ git diff gerrit_util.py
diff --git a/gerrit_util.py b/gerrit_util.py
old mode 100644
new mode 100755
admin@znvhwd:/home/ptg/depot_tools$ git diff infra/config/recipes.cfg
diff --git a/infra/config/recipes.cfg b/infra/config/recipes.cfg
old mode 100644
new mode 100755
admin@znvhwd:/home/ptg/depot_tools$ git diff recipes/recipe_modules/tryserver/tests/gerrit_change_owner.py
diff --git a/recipes/recipe_modules/tryserver/tests/gerrit_change_owner.py b/recipes/recipe_modules/tryserver/tests/gerrit_change_owner.py
old mode 100644
new mode 100755
admin@znvhwd:/home/ptg/depot_tools$ chmod -R 644 gerrit_util.py infra/config/recipes.cfg recipes/README.recipes.md recipes/recipe_modules/gerrit/api.py recipes/recipe_modules/gerrit/examples/full.expected/basic.json recipes/recipe_modules/gerrit/examples/full.py recipes/recipe_modules/tryserver/api.py recipes/recipe_modules/tryserver/examples/full.expected/basic_tags.json recipes/recipe_modules/tryserver/tests/gerrit_change_owner.py
3)./install-build-deps-android.sh需要root密码。要更新本地的一些程序,挺多的,要耐心等待。
admin@znvhwd:/home/ptg/chromium/src/build$ ./install-build-deps-android.sh
Running as non-root user.
You might have to enter your password one or more times for 'sudo'.
[sudo] admin 的密码:
六、赶紧把代码打包备份,继续
在源代码基础上增加针对nweb的构建修改,主要包括:增加cef代码,openharmony编译构建适配,nweb构建源码,chromium漏洞补丁以及nweb的bugfix修改。
关于cef的介绍,可以访问cef仓:third_party_cef
七、安装DevEco Studio并成功运行hello world
官网下载https://developer.harmonyos.com/cn/develop/deveco-studio#download
我下的是windows版本。
解压、安装软件。安装node.js(刚开始还傻乎乎的跑去官网下,下个了18.多的版本DevEco Studio还因为node.js版本太新不支持,结果DevEco Studio可以帮你安装,只需要选目录就可以),安装ohpm(DevEco Studio同样可以帮你安装)。
新建项目(IDE的一个默认hello world),选择设备(DevEco Studio会帮你下载解压安装新设备),注册华为账号并登录。
解决问题:
https://developer.huawei.com/consumer/cn/forum/topic/0201881937079880118
https://developer.huawei.com/consumer/cn/forum/topic/0201818905738020056?fid=26
运行成功。
这部分不难,最多一上午就可以解决。
八、src代码适配riscv64
在3.2release/third_party/chromium目录中执行 ./build.sh riscv64。遇到错误解决错误,一般都是编译体系中增加riscv64 相关内容。
部分错误解决方法如下:
问题:
ERROR at //build/config/ohos/BUILD.gn:163:19: Undefined identifier
rebase_path(libclang_rt_file),
^---------------
See //build/config/compiler/BUILD.gn:275:18: which caused the file to be included.
configs += [ "//build/config/ohos:compiler" ]
^-----------------------------
问题代码:
if (use_musl) {
ldflags += [ "-Wl,--dynamic-linker,/lib/ld-musl-arm.so.1" ]
if (current_cpu == "arm") {
ldflags += [ "-L" + rebase_path("$ohos_sysroot/usr/lib/arm-linux-ohos",
root_build_dir) ]
ldflags +=
[ "-L" + rebase_path("$ohos_toolchain_root/lib/arm-linux-ohos/c++",
root_build_dir) ]
ldflags +=
[ "-L" + rebase_path(
"$ohos_toolchain_root/lib/clang/current/lib/arm-linux-ohos",
root_build_dir) ]
libclang_rt_file = "$ohos_toolchain_root/lib/clang/current/lib/arm-linux-ohos/libclang_rt.builtins.a"
}
if (current_cpu == "arm64") {
ldflags += [ "-Wl,-z,max-page-size=4096" ]
ldflags += [ "-Wl,--hash-style=gnu" ]
ldflags +=
[ "-L" + rebase_path("$ohos_sysroot/usr/lib/aarch64-linux-ohos",
root_build_dir) ]
ldflags += [ "-L" + rebase_path(
"$ohos_toolchain_root/lib/aarch64-linux-ohos/c++",
root_build_dir) ]
ldflags +=
[ "-L" + rebase_path(
"$ohos_toolchain_root/lib/clang/current/lib/aarch64-linux-ohos",
root_build_dir) ]
libclang_rt_file = "$ohos_toolchain_root/lib/clang/current/lib/aarch64-linux-ohos/libclang_rt.builtins.a"
}
libs += [
rebase_path(libclang_rt_file),
"c",
"c++",
"c++abi",
]
} else {
cflags = [
"-isystem" + rebase_path(
"$ohos_ndk_root/aosp_prebuilt_libs/asdk_libs/ndk/libcxx/include",
root_build_dir),
"-isystem" + rebase_path(
"$ohos_ndk_root/aosp_prebuilt_libs/asdk_libs/ndk/libcxxabi/include",
root_build_dir),
"-isystem" + rebase_path("$ohos_toolchain_root/lib64/clang/9.0.3/include",
root_build_dir),
"-isystem" + rebase_path(
"$ohos_ndk_root/aosp_prebuilt_libs/asdk_libs/ndk/sysroot/usr/include",
root_build_dir),
"-isystem" + rebase_path(
"$ohos_ndk_root/aosp_prebuilt_libs/asdk_libs/ndk/sysroot/usr/include/arm-linux-androideabi",
root_build_dir),
]
cflags_cc = [
"-isystem" + rebase_path(
"$ohos_ndk_root/aosp_prebuilt_libs/asdk_libs/ndk/libcxx/include",
root_build_dir),
"-isystem" + rebase_path(
"$ohos_ndk_root/aosp_prebuilt_libs/asdk_libs/ndk/libcxxabi/include",
root_build_dir),
]
if (current_cpu == "arm") {
ldflags += [ "-L" + rebase_path(
"$ohos_ndk_root/gcc/linux-x86/arm/gcc-linaro-7.5.0-arm-linux-gnueabi/arm-linux-gnueabi/lib",
root_build_dir) ]
ldflags += [ "-L" + rebase_path(
"$ohos_ndk_root/gcc/linux-x86/arm/gcc-linaro-7.5.0-arm-linux-gnueabi/lib/gcc/arm-linux-gnueabi/7.5.0",
root_build_dir) ]
ldflags += [ "-l:libgcc.a" ]
ldflags +=
[ "-L" + rebase_path(
"$ohos_ndk_root/aosp_prebuilt_libs/asdk_libs/ndk/libcxx/arm",
root_build_dir) ]
ldflags += [ "-l:libc++_static.a" ]
ldflags += [ "-L" + rebase_path(
"$ohos_toolchain_root/lib64/clang/9.0.3/lib/linux",
root_build_dir) ]
ldflags += [ "-l:libclang_rt.builtins-arm-android.a" ]
ldflags += [ "-L" + rebase_path(
"$ohos_ndk_root/aosp_prebuilt_libs/asdk_libs/sdk/shared_library/arm",
root_build_dir) ]
ldflags += [ "-l:liblog.so" ]
ldflags += [ "-L" + rebase_path(
"$ohos_ndk_root/aosp_prebuilt_libs/asdk_libs/ndk/platforms/current/arch-arm/usr/lib",
root_build_dir) ]
}
if (current_cpu == "arm64") {
ldflags += [ "-Wl,-z,max-page-size=4096" ]
ldflags += [ "-Wl,--hash-style=gnu" ]
ldflags += [ "-L" + rebase_path(
"$ohos_ndk_root/gcc/linux-x86/arm/gcc-linaro-7.5.0-arm-linux-gnueabi/arm-linux-gnueabi/lib",
root_build_dir) ]
ldflags += [ "-L" + rebase_path(
"$ohos_ndk_root/gcc/linux-x86/arm/gcc-linaro-7.5.0-arm-linux-gnueabi/lib/gcc/arm-linux-gnueabi/7.5.0",
root_build_dir) ]
ldflags += [ "-l:libgcc.a" ]
ldflags +=
[ "-L" + rebase_path(
"$ohos_ndk_root/aosp_prebuilt_libs/asdk_libs/ndk/libcxx/arm64",
root_build_dir) ]
ldflags += [ "-l:libc++_static.a" ]
ldflags += [ "-L" + rebase_path(
"$ohos_toolchain_root/lib64/clang/9.0.3/lib/linux",
root_build_dir) ]
ldflags += [ "-l:libclang_rt.builtins-aarch64-android.a" ]
ldflags += [ "-L" + rebase_path(
"//ohos_ndk_aosp/aosp_prebuilt_libs/asdk_libs/sdk/shared_library/arm64",
root_build_dir) ]
ldflags += [ "-l:liblog.so" ]
ldflags += [ "-L" + rebase_path(
"$ohos_ndk_root/aosp_prebuilt_libs/asdk_libs/ndk/platforms/current/arch-arm64/usr/lib",
root_build_dir) ]
}
libs += [ "unwind_llvm" ]
}
解决:在if (use_musl) 中增加
if(current_cpu == "riscv64")
{
ldflags += [ "-L" + rebase_path("$ohos_sysroot/usr/lib/riscv64-linux-ohos",
root_build_dir) ]
ldflags += [ "-L" + rebase_path(
"$ohos_toolchain_root/lib/riscv64-linux-ohos/c++",
root_build_dir) ]
ldflags +=
[ "-L" + rebase_path(
"$ohos_toolchain_root/lib/clang/current/lib/riscv64-linux-ohos",
root_build_dir) ]
libclang_rt_file = "$ohos_toolchain_root/lib/clang/current/lib/riscv64-linux-ohos/libclang_rt.builtins.a"
}
问题:
ninja: Entering directory `out/riscv64/'
[32/52377] CC obj/base/third_party/libevent/libevent/signal.o
FAILED: obj/base/third_party/libevent/libevent/signal.o
../../../../../prebuilts/clang/ohos/linux-x86_64/llvm/bin/clang -MMD -MF obj/base/third_party/libevent/libevent/signal.o.d -DHAVE_CONFIG_H -DUSE_MUSL -DUSE_AURA=1 -DUSE_OZONE=1 -DOFFICIAL_BUILD -DNO_UNWIND_TABLES -D_GNU_SOURCE -DOSOHOS -DHAVE_SYS_UIO_H -D__MUSL__ -D_LIBCPP_HAS_MUSL_LIBC -D__BUILD_LINUX_WITH_CLANG -DCR_CLANG_REVISION=\"llvmorg-14-init-12719-gc4b45eeb-3\" -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -I../../base/third_party/libevent/ohos -I../../base/third_party/libevent/compat -I/home/ptg/qemu_download/3.2release/prebuilts/clang/ohos/linux-x86_64/llvm/include/libcxx-ohos/include/c++/v1 -I../.. -Igen -fprofile-sample-use=../../chrome/android/profiles/afdo.prof -fprofile-sample-accurate -fno-delete-null-pointer-checks -fno-ident -fno-strict-aliasing --param=ssp-buffer-size=4 -fstack-protector -fno-unwind-tables -fno-asynchronous-unwind-tables -fPIC -fcolor-diagnostics -fmerge-all-constants -fcrash-diagnostics-dir=../../tools/clang/crashreports -mllvm -instcombine-lower-dbg-declare=0 -ffp-contract=off -ffunction-sections -fno-short-enums --target= -no-canonical-prefixes -fomit-frame-pointer -g1 -gdwarf-aranges -fdebug-info-for-profiling -fvisibility=hidden -Wheader-hygiene -Wstring-conversion -Wtautological-overlap-compare -O2 -fdata-sections -ffunction-sections -fno-unique-section-names -Werror -Wall -Wno-unused-variable -Wno-c++11-narrowing -Wno-unused-but-set-variable -Wno-misleading-indentation -Wno-psabi -Wno-unknown-pragmas -Wno-cpp -Wno-extra-tokens -Wno-error=c99-designator -Wno-error=anon-enum-enum-conversion -Wno-error=implicit-fallthrough -Wno-error=sizeof-array-div -Wno-error=reorder-init-list -Wno-error=range-loop-construct -Wno-error=deprecated-copy -Wno-error=implicit-int-float-conversion -Wno-error=inconsistent-dllimport -Wno-unknown-warning-option -Wno-error=abstract-final-class -Wno-error=sign-compare -Wno-error=int-in-bool-context -Wno-error=xor-used-as-pow -Wno-error=return-stack-address -Wno-error=dangling-gsl -Wno-error=implicit-function-declaration -Wno-error=non-c-typedef-for-linkage -Wno-c++11-narrowing -Wno-builtin-assume-aligned-alignment -Wno-missing-field-initializers -Wno-unused-parameter -Wloop-analysis -Wno-unneeded-internal-declaration -Wenum-compare-conditional -Wno-psabi -Wno-ignored-pragma-optimize -std=c11 --sysroot=../../../../../out/rk3568/obj/third_party/musl -c ../../base/third_party/libevent/signal.c -o obj/base/third_party/libevent/libevent/signal.o
error: unknown target triple 'unknown', please use -triple or -arch
解决方法:查了半天,跟./build.sh rk3568 对比发现,上面编译命令的–target= 缺少参数。修改文件chromium\src\build\config\ohos\BUILD.gn增加一下内容即可。
else if (current_cpu == "riscv64") {
abi_target = ""
if (use_musl) {
abi_target = "riscv64-linux-ohosmusl"
}
}
问题:error Please add support for your architecture in build/build_config.h
解决:由于没办法确认riscv的宏应该在build/build_config.h文件中如何定义,所以用了一下临时解决方案。
#else
#define ARCH_CPU_RISCV_FAMILY 1
#define ARCH_CPU_RISCV64 1
#define ARCH_CPU_64_BITS 1
#define ARCH_CPU_LITTLE_ENDIAN 1
//#error Please add support for your architecture in build/build_config.h
#endif
问题:
[2/52248] CC obj/base/third_party/libevent/libevent/evdns.o
FAILED: obj/base/third_party/libevent/libevent/evdns.o
../../../../../prebuilts/clang/ohos/linux-x86_64/llvm/bin/clang -MMD -MF obj/base/third_party/libevent/libevent/evdns.o.d -DHAVE_CONFIG_H -DUSE_MUSL -DUSE_AURA=1 -DUSE_OZONE=1 -DOFFICIAL_BUILD -DNO_UNWIND_TABLES -D_GNU_SOURCE -DOSOHOS -DHAVE_SYS_UIO_H -D__MUSL__ -D_LIBCPP_HAS_MUSL_LIBC -D__BUILD_LINUX_WITH_CLANG -DCR_CLANG_REVISION=\"llvmorg-14-init-12719-gc4b45eeb-3\" -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -I../../base/third_party/libevent/ohos -I../../base/third_party/libevent/compat -I/home/ptg/qemu_download/3.2release/prebuilts/clang/ohos/linux-x86_64/llvm/include/libcxx-ohos/include/c++/v1 -I../.. -Igen -fprofile-sample-use=../../chrome/android/profiles/afdo.prof -fprofile-sample-accurate -fno-delete-null-pointer-checks -fno-ident -fno-strict-aliasing --param=ssp-buffer-size=4 -fstack-protector -fno-unwind-tables -fno-asynchronous-unwind-tables -fPIC -fcolor-diagnostics -fmerge-all-constants -fcrash-diagnostics-dir=../../tools/clang/crashreports -mllvm -instcombine-lower-dbg-declare=0 -ffp-contract=off -ffunction-sections -fno-short-enums --target=riscv64-linux-ohosmusl -no-canonical-prefixes -fomit-frame-pointer -g1 -gdwarf-aranges -fdebug-info-for-profiling -fvisibility=hidden -Wheader-hygiene -Wstring-conversion -Wtautological-overlap-compare -O2 -fdata-sections -ffunction-sections -fno-unique-section-names -Werror -Wall -Wno-unused-variable -Wno-c++11-narrowing -Wno-unused-but-set-variable -Wno-misleading-indentation -Wno-psabi -Wno-unknown-pragmas -Wno-cpp -Wno-extra-tokens -Wno-error=c99-designator -Wno-error=anon-enum-enum-conversion -Wno-error=implicit-fallthrough -Wno-error=sizeof-array-div -Wno-error=reorder-init-list -Wno-error=range-loop-construct -Wno-error=deprecated-copy -Wno-error=implicit-int-float-conversion -Wno-error=inconsistent-dllimport -Wno-unknown-warning-option -Wno-error=abstract-final-class -Wno-error=sign-compare -Wno-error=int-in-bool-context -Wno-error=xor-used-as-pow -Wno-error=return-stack-address -Wno-error=dangling-gsl -Wno-error=implicit-function-declaration -Wno-error=non-c-typedef-for-linkage -Wno-c++11-narrowing -Wno-builtin-assume-aligned-alignment -Wno-missing-field-initializers -Wno-unused-parameter -Wloop-analysis -Wno-unneeded-internal-declaration -Wenum-compare-conditional -Wno-psabi -Wno-ignored-pragma-optimize -std=c11 --sysroot=../../../../../out/rk3568/obj/third_party/musl -c ../../base/third_party/libevent/evdns.c -o obj/base/third_party/libevent/libevent/evdns.o
In file included from ../../base/third_party/libevent/evdns.c:83:
In file included from /home/ptg/qemu_download/3.2release/prebuilts/clang/ohos/linux-x86_64/llvm/include/libcxx-ohos/include/c++/v1/string.h:54:
/home/ptg/qemu_download/3.2release/prebuilts/clang/ohos/linux-x86_64/llvm/include/libcxx-ohos/include/c++/v1/__config:23:9: error: '_LIBCPP_HAS_MUSL_LIBC' macro redefined [-Werror,-Wmacro-redefined]
#define _LIBCPP_HAS_MUSL_LIBC
^
<command line>:11:9: note: previous definition is here
#define _LIBCPP_HAS_MUSL_LIBC 1
^
1 error generated.
分析:应该是chromium的src跟openharmony3.2release版本代码有冲突导致。编译arm的./build.sh rk3568同样会遇到一系列代码冲突的问提。
分析:没看懂这个<command line>:9:9: 到底是啥文件。
对这个#define _LIBCPP_HAS_MUSL_LIBC 1进行grep也没找到。。
换个思路。由于之前的报错:-DCR_CLANG_REVISION=“llvmorg-14-init-12719-gc4b45eeb-3”,所以决定将clang-llvm的版本换到14.现在用的版本是12.
admin@znvhwd:/home/ptg/qemu_download/3.2release/prebuilts/clang/ohos/linux-x86_64/llvm-bak/bin$ ./clang --version
OHOS (dev) clang version 12.0.1 (llvm-project a4ac5794e1cb96f600dbfd63c3528ebcb467b660)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/ptg/qemu_download/3.2release/prebuilts/clang/ohos/linux-x86_64/llvm-bak/bin/.
去官网找14版本的x86_64clang。
https://github.com/llvm/llvm-project/releases/tag/llvmorg-14.0.6
结果发现没有合适的Asset。。。尝试了一下clang+llvm-14.0.6-x86_64-linux-gnu-rhel-8.4.tar.xz
这个包,替换后进行编译发现编译报错都是下面这种。
[38/52256] CC obj/third_party/zlib/minizip/zip.o
FAILED: obj/third_party/zlib/minizip/zip.o
../../../../../prebuilts/clang/ohos/linux-x86_64/llvm/bin/clang -MMD -MF obj/third_party/zlib/minizip/zip.o.d -DUSE_AURA=1 -DUSE_OZONE=1 -DOFFICIAL_BUILD -DNO_UNWIND_TABLES -D_GNU_SOURCE -DOSOHOS -DHAVE_SYS_UIO_H -D__MUSL__ -D_LIBCPP_HAS_MUSL_LIBC -D__BUILD_LINUX_WITH_CLANG -DCR_CLANG_REVISION=\"llvmorg-14-init-12719-gc4b45eeb-3\" -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -I/home/ptg/qemu_download/3.2release/prebuilts/clang/ohos/linux-x86_64/llvm/include/libcxx-ohos/include/c++/v1 -I../.. -Igen -I../../third_party/zlib -fprofile-sample-use=../../chrome/android/profiles/afdo.prof -fprofile-sample-accurate -fno-delete-null-pointer-checks -fno-ident -fno-strict-aliasing --param=ssp-buffer-size=4 -fstack-protector -fno-unwind-tables -fno-asynchronous-unwind-tables -fPIC -fcolor-diagnostics -fmerge-all-constants -fcrash-diagnostics-dir=../../tools/clang/crashreports -mllvm -instcombine-lower-dbg-declare=0 -ffp-contract=off -ffunction-sections -fno-short-enums --target=riscv64-linux-ohosmusl -no-canonical-prefixes -Oz -fdata-sections -ffunction-sections -fno-unique-section-names -fomit-frame-pointer -g1 -gdwarf-aranges -fdebug-info-for-profiling -fvisibility=hidden -Wheader-hygiene -Wstring-conversion -Wtautological-overlap-compare -Werror -Wall -Wno-unused-variable -Wno-c++11-narrowing -Wno-unused-but-set-variable -Wno-misleading-indentation -Wno-psabi -Wno-unknown-pragmas -Wno-cpp -Wno-extra-tokens -Wno-error=c99-designator -Wno-error=anon-enum-enum-conversion -Wno-error=implicit-fallthrough -Wno-error=sizeof-array-div -Wno-error=reorder-init-list -Wno-error=range-loop-construct -Wno-error=deprecated-copy -Wno-error=implicit-int-float-conversion -Wno-error=inconsistent-dllimport -Wno-unknown-warning-option -Wno-error=abstract-final-class -Wno-error=sign-compare -Wno-error=int-in-bool-context -Wno-error=xor-used-as-pow -Wno-error=return-stack-address -Wno-error=dangling-gsl -Wno-error=implicit-function-declaration -Wno-error=non-c-typedef-for-linkage -Wno-c++11-narrowing -Wno-builtin-assume-aligned-alignment -Wno-missing-field-initializers -Wno-unused-parameter -Wloop-analysis -Wno-unneeded-internal-declaration -Wenum-compare-conditional -Wno-psabi -Wno-ignored-pragma-optimize -Wno-parentheses-equality -std=c11 --sysroot=../../../../../out/rk3568/obj/third_party/musl -c ../../third_party/zlib/contrib/minizip/zip.c -o obj/third_party/zlib/minizip/zip.o
../../third_party/zlib/contrib/minizip/zip.c:25:10: fatal error: 'stdio.h' file not found
#include <stdio.h>
^~~~~~~~~
1 error generated.
所以决定自己编译clang14.06适合ubuntu的x86_64版本。
好不容易编译出来,替换后再对src代码进行编译,报错。。。
[35/52256] CC obj/third_party/zlib/minizip/zip.o
FAILED: obj/third_party/zlib/minizip/zip.o
../../../../../prebuilts/clang/ohos/linux-x86_64/llvm/bin/clang -MMD -MF obj/third_party/zlib/minizip/zip.o.d -DUSE_AURA=1 -DUSE_OZONE=1 -DOFFICIAL_BUILD -DNO_UNWIND_TABLES -D_GNU_SOURCE -DOSOHOS -DHAVE_SYS_UIO_H -D__MUSL__ -D_LIBCPP_HAS_MUSL_LIBC -D__BUILD_LINUX_WITH_CLANG -DCR_CLANG_REVISION=\"llvmorg-14-init-12719-gc4b45eeb-3\" -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -I/home/ptg/qemu_download/3.2release/prebuilts/clang/ohos/linux-x86_64/llvm/include/libcxx-ohos/include/c++/v1 -I../.. -Igen -I../../third_party/zlib -fprofile-sample-use=../../chrome/android/profiles/afdo.prof -fprofile-sample-accurate -fno-delete-null-pointer-checks -fno-ident -fno-strict-aliasing --param=ssp-buffer-size=4 -fstack-protector -fno-unwind-tables -fno-asynchronous-unwind-tables -fPIC -fcolor-diagnostics -fmerge-all-constants -fcrash-diagnostics-dir=../../tools/clang/crashreports -mllvm -instcombine-lower-dbg-declare=0 -ffp-contract=off -ffunction-sections -fno-short-enums --target=riscv64-linux-ohosmusl -no-canonical-prefixes -Oz -fdata-sections -ffunction-sections -fno-unique-section-names -fomit-frame-pointer -g1 -gdwarf-aranges -fdebug-info-for-profiling -fvisibility=hidden -Wheader-hygiene -Wstring-conversion -Wtautological-overlap-compare -Werror -Wall -Wno-unused-variable -Wno-c++11-narrowing -Wno-unused-but-set-variable -Wno-misleading-indentation -Wno-psabi -Wno-unknown-pragmas -Wno-cpp -Wno-extra-tokens -Wno-error=c99-designator -Wno-error=anon-enum-enum-conversion -Wno-error=implicit-fallthrough -Wno-error=sizeof-array-div -Wno-error=reorder-init-list -Wno-error=range-loop-construct -Wno-error=deprecated-copy -Wno-error=implicit-int-float-conversion -Wno-error=inconsistent-dllimport -Wno-unknown-warning-option -Wno-error=abstract-final-class -Wno-error=sign-compare -Wno-error=int-in-bool-context -Wno-error=xor-used-as-pow -Wno-error=return-stack-address -Wno-error=dangling-gsl -Wno-error=implicit-function-declaration -Wno-error=non-c-typedef-for-linkage -Wno-c++11-narrowing -Wno-builtin-assume-aligned-alignment -Wno-missing-field-initializers -Wno-unused-parameter -Wloop-analysis -Wno-unneeded-internal-declaration -Wenum-compare-conditional -Wno-psabi -Wno-ignored-pragma-optimize -Wno-parentheses-equality -std=c11 --sysroot=../../../../../out/rk3568/obj/third_party/musl -c ../../third_party/zlib/contrib/minizip/zip.c -o obj/third_party/zlib/minizip/zip.o
../../../../../prebuilts/clang/ohos/linux-x86_64/llvm/bin/clang: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.36' not found (required by ../../../../../prebuilts/clang/ohos/linux-x86_64/llvm/bin/clang)
../../../../../prebuilts/clang/ohos/linux-x86_64/llvm/bin/clang: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by ../../../../../prebuilts/clang/ohos/linux-x86_64/llvm/bin/clang)
../../../../../prebuilts/clang/ohos/linux-x86_64/llvm/bin/clang: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found (required by ../../../../../prebuilts/clang/ohos/linux-x86_64/llvm/bin/clang)
../../../../../prebuilts/clang/ohos/linux-x86_64/llvm/bin/clang: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.33' not found (required by ../../../../../prebuilts/clang/ohos/linux-x86_64/llvm/bin/clang)
../../../../../prebuilts/clang/ohos/linux-x86_64/llvm/bin/clang: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.30' not found (required by ../../../../../prebuilts/clang/ohos/linux-x86_64/llvm/bin/clang)
../../../../../prebuilts/clang/ohos/linux-x86_64/llvm/bin/clang: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.29' not found (required by ../../../../../prebuilts/clang/ohos/linux-x86_64/llvm/bin/clang)
../../../../../prebuilts/clang/ohos/linux-x86_64/llvm/bin/clang: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `CXXABI_1.3.13' not found (required by ../../../../../prebuilts/clang/ohos/linux-x86_64/llvm/bin/clang)
根据这的文档https://github.com/riscv-collab/riscv-gnu-toolchain尝试了好多种配置和编译选项才把clang编出来。编译时可能会需要升级glibc版本,多次make时可能需要先make clean 不然会有编译报错。配置如下:
admin@znvhwd:~/riscv-gnu-toolchain$ ./configure --prefix=/home/admin/clang --enable-llvm --enable-linux make
make all -j$(nproc)
移动clang至对应目录,进行编译,然后报错:
[41/52256] CXX obj/third_party/jsoncpp/jsoncpp/json_reader.o
FAILED: obj/third_party/jsoncpp/jsoncpp/json_reader.o
../../../../../prebuilts/clang/ohos/linux-x86_64/llvm/bin/clang++ -MMD -MF obj/third_party/jsoncpp/jsoncpp/json_reader.o.d -DJSON_USE_EXCEPTION=0 -DJSON_USE_NULLREF=0 -DUSE_AURA=1 -DUSE_OZONE=1 -DOFFICIAL_BUILD -DNO_UNWIND_TABLES -D_GNU_SOURCE -DOSOHOS -DHAVE_SYS_UIO_H -D__MUSL__ -D_LIBCPP_HAS_MUSL_LIBC -D__BUILD_LINUX_WITH_CLANG -DCR_CLANG_REVISION=\"llvmorg-14-init-12719-gc4b45eeb-3\" -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D_FORTIFY_SOURCE=2 -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -I../../third_party/jsoncpp/source/src/lib_json -I/home/ptg/qemu_download/3.2release/prebuilts/clang/ohos/linux-x86_64/llvm/include/libcxx-ohos/include/c++/v1 -I../.. -Igen -I../../third_party/jsoncpp/source/include -fprofile-sample-use=../../chrome/android/profiles/afdo.prof -fprofile-sample-accurate -fno-delete-null-pointer-checks -fno-ident -fno-strict-aliasing --param=ssp-buffer-size=4 -fstack-protector -fno-unwind-tables -fno-asynchronous-unwind-tables -fPIC -fcolor-diagnostics -fmerge-all-constants -fcrash-diagnostics-dir=../../tools/clang/crashreports -mllvm -instcombine-lower-dbg-declare=0 -ffp-contract=off -ffunction-sections -fno-short-enums --target=riscv64-linux-ohosmusl -no-canonical-prefixes -Wall -Werror -Wextra -Wimplicit-fallthrough -Wunreachable-code-aggressive -Wthread-safety -Wno-psabi -Wno-unknown-pragmas -Wno-cpp -Wno-extra-tokens -Wno-error=c99-designator -Wno-error=anon-enum-enum-conversion -Wno-error=implicit-fallthrough -Wno-error=sizeof-array-div -Wno-error=reorder-init-list -Wno-error=range-loop-construct -Wno-error=deprecated-copy -Wno-error=implicit-int-float-conversion -Wno-error=inconsistent-dllimport -Wno-unknown-warning-option -Wno-error=abstract-final-class -Wno-error=sign-compare -Wno-error=int-in-bool-context -Wno-error=xor-used-as-pow -Wno-error=return-stack-address -Wno-error=dangling-gsl -Wno-error=implicit-function-declaration -Wno-error=non-c-typedef-for-linkage -Wno-c++11-narrowing -Wno-builtin-assume-aligned-alignment -Wno-missing-field-initializers -Wno-unused-parameter -Wloop-analysis -Wno-unneeded-internal-declaration -Wenum-compare-conditional -Wno-psabi -Wno-ignored-pragma-optimize -Wshadow -Oz -fdata-sections -ffunction-sections -fno-unique-section-names -fomit-frame-pointer -g1 -gdwarf-aranges -fdebug-info-for-profiling -fvisibility=hidden -Wheader-hygiene -Wstring-conversion -Wtautological-overlap-compare -Wno-implicit-fallthrough -std=c++17 -Wno-trigraphs -fno-aligned-new -fno-exceptions -fno-rtti --sysroot=../../../../../out/rk3568/obj/third_party/musl -fvisibility-inlines-hidden -Wno-deprecated-declarations -c ../../third_party/jsoncpp/source/src/lib_json/json_reader.cpp -o obj/third_party/jsoncpp/jsoncpp/json_reader.o
In file included from ../../third_party/jsoncpp/source/src/lib_json/json_reader.cpp:8:
In file included from ../../third_party/jsoncpp/source/src/lib_json/json_tool.h:10:
In file included from ../../third_party/jsoncpp/source/include/json/config.h:8:
In file included from ../../../../../prebuilts/clang/ohos/linux-x86_64/llvm/bin/../lib/gcc/riscv64-unknown-linux-gnu/12.2.0/../../../../riscv64-unknown-linux-gnu/include/c++/12.2.0/cstddef:49:
In file included from ../../../../../prebuilts/clang/ohos/linux-x86_64/llvm/bin/../lib/gcc/riscv64-unknown-linux-gnu/12.2.0/../../../../riscv64-unknown-linux-gnu/include/c++/12.2.0/riscv64-unknown-linux-gnu/bits/c++config.h:655:
../../../../../prebuilts/clang/ohos/linux-x86_64/llvm/bin/../lib/gcc/riscv64-unknown-linux-gnu/12.2.0/../../../../riscv64-unknown-linux-gnu/include/c++/12.2.0/riscv64-unknown-linux-gnu/bits/os_defines.h:39:10: fatal error: 'features.h' file not found
#include <features.h>
^~~~~~~~~~~~
1 error generated.
跟之前的错误一样,没啥进展。不过至少掌握了riscv-gnu-toolchain的使用方法。
解决:进行中。。。
持续更新中。。。
参考
https://blog.youkuaiyun.com/hshski/article/details/108341137
https://huaweidevelopers.youkuaiyun.com/648c39140fa9cc227b4df2d1.html
https://blog.youkuaiyun.com/yongwn/article/details/120971967
https://blog.youkuaiyun.com/mogoweb/article/details/52125581
https://www.cnblogs.com/interdrp/p/14370646.html
https://blog.youkuaiyun.com/kong_gu_you_lan/article/details/123862868
https://stackoverflow.com/questions/38378914/how-to-fix-git-error-rpc-failed-curl-56-gnutls