Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
36d6551c
D
Docs
项目概览
OpenHarmony
/
Docs
大约 2 年 前同步成功
通知
161
Star
293
Fork
28
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
Docs
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
36d6551c
编写于
11月 04, 2022
作者:
O
openharmony_ci
提交者:
Gitee
11月 04, 2022
浏览文件
操作
浏览文件
下载
差异文件
!11253 add arkcompiler subsystem guide
Merge pull request !11253 from Wang Yaofeng/docs_guide
上级
f474d34d
2ff01301
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
83 addition
and
0 deletion
+83
-0
zh-cn/device-dev/subsystems/Readme-CN.md
zh-cn/device-dev/subsystems/Readme-CN.md
+1
-0
zh-cn/device-dev/subsystems/subsys-arkcompiler-guide.md
zh-cn/device-dev/subsystems/subsys-arkcompiler-guide.md
+82
-0
未找到文件。
zh-cn/device-dev/subsystems/Readme-CN.md
浏览文件 @
36d6551c
...
...
@@ -18,6 +18,7 @@
-
[
查看NinjaTrace
](
subsys-build-reference.md#查看ninjatrace
)
-
[
HAP编译构建指导
](
subsys-build-gn-hap-compilation-guide.md
)
-
[
常见问题
](
subsys-build-FAQ.md
)
-
[
ArkCompiler
](
subsys-arkcompiler-guide.md
)
-
[
分布式远程启动
](
subsys-remote-start.md
)
-
图形图像
-
[
图形图像概述
](
subsys-graphics-overview.md
)
...
...
zh-cn/device-dev/subsystems/subsys-arkcompiler-guide.md
0 → 100644
浏览文件 @
36d6551c
# ArkCompiler开发指导
## 概述
ArkCompiler是一种统一编程平台,包含编译器、工具链、运行时等关键部件,支持高级语言在多种芯片的编译与运行,并支撑应用和服务运行在手机、个人电脑、平板、电视、汽车和智能穿戴等多种设备上的需求。
## 编译环境配置
推荐操作系统Ubuntu18.04及以上。
1.
安装依赖工具。
```
shell
sudo
apt-get update
&&
sudo
apt-get
install
python ruby python3-pip git-lfs gcc-multilib g++-multilib zlib1g-dev libc++1 curl nodejs
```
2.
安装repo工具。
```
shell
mkdir
~/bin/
curl https://gitee.com/oschina/repo/raw/fork_flow/repo-py3
>
~/bin/repo
chmod
a+x ~/bin/repo
export
PATH
=
~/bin:
$PATH
pip3
install
-i
https://pypi.tuna.tsinghua.edu.cn/simple requests
```
3.
下载源码。
```
shell
repo init
-u
https://gitee.com/ark-standalone-build/manifest.git
-b
master
repo
sync
-c
-j8
repo forall
-c
'git lfs pull'
```
4.
安装编译器及二进制工具。
```
shell
./prebuilts_download.sh
```
## 开发步骤
1.
生成编译产物ark_js_vm及js2abc。
```
shell
python ark.py x64.release
```
-
ark_js_vm:运行abc文件的可执行程序。
-
js2abc:将ArkTS文件转换生成ArkCompiler字节码文件的工具。
2.
将TypeScript文件转换为abc文件。
```
shell
prebuilts/build-tools/common/nodejs/node-v12.18.4-linux-x64/bin/node
--expose-gc
out/x64.release/clang_x64/obj/arkcompiler/ets_frontend/ts2panda/build/src/index.js helloworld.ts
--opt-level
0
```
TypeScript用例文件helloworld.ts源码。
```
JavaScript
declare function print(arg:any):string;
print("Hello world!");
```
3.
执行生成的abc文件。
```
shell
out/x64.release/clang_x64/arkcompiler/ets_runtime/ark_js_vm helloworld.abc
```
abc文件:ArkCompiler字节码文件。
执行结果:
```
Hello world!
```
## 执行Test262测试套
```
python ark.py x64.release test262
```
## 编译选项
交叉编译可根据目标选择不同平台,如在x64平台构建arm64目标平台,更多平台选择可参考下方获取更多编译说明。
```
python ark.py arm64.release
```
编译模式选择,如在x64平台构建debug版本。
```
python ark.py x64.debug
```
获取更多编译说明。
```
python ark.py --help
```
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录