• Lv0
    粉丝1

积分0 / 贡献0

提问1答案被采纳0文章0

作者动态

    交叉编译生成用于3568板子上OpenHarmony系统的jdk问题

    wayne4662 显示全部楼层 发表于 2024-3-4 15:57:38

    如题,我在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可以正常编译

    您尚未登录,无法参与评论,登录后可以:
    参与开源共建问题交流
    认同或收藏高质量问答
    获取积分成为开源共建先驱

    精彩评论2

    s_hao

    沙发 发表于 2024-3-18 14:42:17
    编译OpenHarmony设备上可用的三方库参考如下文档:
    https://gitee.com/openharmony-si ... nfigure_portting.md
    你反馈的问题,configure配置的参数 --openjdk-target应当指定为 aarch64-linux

    欢乐马

    5# 发表于 2024-6-15 17:32:27

    交叉编译生成用于3568板子上OpenHarmony系统的jdk问题

    请问这个问题你搞定了吗?

    Copyright   ©2023  OpenHarmony开发者论坛  京ICP备2020036654号-3 |技术支持 Discuz!

    返回顶部