2019-08-06 06:32
浏览 342

如何将Go-cross添加到Yocto SDK? 还是在其他计算机上编译Go for Yocto?

I have been using the Yocto SDK to compile C and C++ code for Yocto so that every machine does not need the 150GB+ Bitbake environment. Yocto version is 2.4 (Rocko)

Now I would like to have the same functionality for Golang, but I can't figure out how to do it.

If I'm on the Bitbake machine, I can call the binary arm-arch-gnueabi-go binary found under the directory tmp/work/x86_64-linux/go-cross-arm/ to compile code. But if I copy those binaries to another machine, it links to libraries with hard-coded paths on the Bitbake machine so that won't work.

Is there a way to include arm-arch-gnueabi-go in the SDK when I run populate_sdk on the image? Or is there another easy way to compile Go for the target on other machines?

图片转代码服务由CSDN问答提供 功能建议

我一直在使用Yocto SDK为Yocto编译C和C ++代码,因此每台机器都不需要150GB + Bitbake环境。 Yocto版本是2.4(Rocko)


如果我在Bitbake机器上,则可以调用目录tmp / work / x86_64-linux / go-cross-arm /下的二进制arm-arch-gnueabi-go二进制文件来编译代码。 但是,如果我将这些二进制文件复制到另一台计算机上,它将链接到Bitbake计算机上具有硬编码路径的库,因此将无法正常工作。

是否可以包含arm-arch 在图像上运行populate_sdk时,SDK中的-gnueabi-go吗? 还是有另一种简便的方法可以在其他计算机上为目标编译Go?

  • 写回答
  • 好问题 提建议
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • dongmaopan5738 2019-08-06 08:46

    You can add the following lines in local.conf file or image recipe:

    TOOLCHAIN_HOST_TASK_append = " \
        packagegroup-go-cross-canadian-${MACHINE} \
    TOOLCHAIN_TARGET_TASK_append = " \
        ${@multilib_pkg_extend(d, 'packagegroup-go-sdk-target')} \
    解决 无用
    打赏 举报

相关推荐 更多相似问题