OpenHarmony开发者论坛

标题: 交叉编译生成用于3568板子上OpenHarmony系统的jdk问题 [打印本页]

作者: wayne4662    时间: 2024-3-4 15:57
标题: 交叉编译生成用于3568板子上OpenHarmony系统的jdk问题
[md]如题,我在OpenHarmony官方镜像生成的容器内进行交叉编译,完整命令为:

```
./configure --with-boot-jdk=/usr/lib/jvm/java-11-openjdk-amd64/ --with-sysroot=/opt/rk3568/out/rk3568/obj/third_party/musl --with-debug-level=slowdebug --openjdk-target=aarch64-linux-ohos  CC=/opt/rk3568/prebuilts/clang/ohos/linux-x86_64/llvm/bin/clang CXX=/opt/rk3568/prebuilts/clang/ohos/linux-x86_64/llvm/bin/clang++
```

但是会报错:

```
checking host system type... Invalid configuration 'aarch64-linux-ohos': OS 'ohos' not recognized
configure: error: /usr/bin/bash /opt/openjdk11/make/autoconf/build-aux/config.sub aarch64-linux-ohos failed
```

如果去掉 --openjdk-target参数,就会提示以下错误,根据网上提示,也找不到generated-configure.sh这个文件

```
configure: The C compiler (located as /opt/rk3568/prebuilts/clang/ohos/linux-x86_64/llvm/bin/clang) does not seem to be the required gcc compiler.
configure: The result from running with --version was: ""
configure: error: A gcc compiler is required. Try setting --with-tools-dir.
```

另外使用命令中的交叉编译链已成功编译c程序并在板子上运行,另外单独 .configure可以正常编译
[/md]
作者: s_hao    时间: 2024-3-18 14:42
编译OpenHarmony设备上可用的三方库参考如下文档:
https://gitee.com/openharmony-si ... nfigure_portting.md
你反馈的问题,configure配置的参数 --openjdk-target应当指定为 aarch64-linux
作者: 欢乐马    时间: 2024-6-15 17:32
标题: 交叉编译生成用于3568板子上OpenHarmony系统的jdk问题
[md]请问这个问题你搞定了吗?
[/md]




欢迎光临 OpenHarmony开发者论坛 (https://forums.openharmony.cn/) Powered by Discuz! X3.5