我正在使用Yocto Kirkstone为ARMv7定制嵌入式Linux板构建一个系统。我在Yocto meta层中有go-runtime版本1.20。
我试图构建一个简单的例子GoLang 'wails'(https://github.com/wailsapp/wails)应用程序,我能够在我的Mac上为我的目标构建.这需要wails 'cli'安装来构建应用程序.我不知道如何交叉编译这个应用程序与Yocto.我怎么才能完成这一点?谢谢.
此命令在do_compile()中失败:
wails build .
我得到的错误显示在这里:
...
| HASH[link github.com/wailsapp/wails/v2/cmd/wails]: "packagefile internal/lazyregexp=PNiPFusr6BDvpzrFOO2q\n"
| HASH[link github.com/wailsapp/wails/v2/cmd/wails]: 58443e84e42fc0e5254356b82561065095a39a1606a457c34cf63d8dd364173c
| HASH subkey a9f4ce5dc6a5c97cab06b5c8cfec3a64e5db0f7bcc79e02fc0002cafcc719a67 "link-stdout" = 80ee6464b934ca7407296396849147804b0862ee25e2b844a6e9cc98cfa588b3
| qemu-arm: Could not open '/lib/ld-linux-armhf.so.3': No such file or directory
| WARNING: /home/sensonix/poky/build-microchip/tmp/work/cortexa5t2hf-neon-vfpv4-poky-linux-gnueabi/go-example/1.0.0-r0/temp/run.do_compile.87405:178 exit 255 from './bin/linux_arm/wails build .'
| WARNING: Backtrace (BB generated script):
| #1: do_compile, /home/sensonix/poky/build-microchip/tmp/work/cortexa5t2hf-neon-vfpv4-poky-linux-gnueabi/go-example/1.0.0-r0/temp/run.do_compile.87405, line 178
| #2: main, /home/sensonix/poky/build-microchip/tmp/work/cortexa5t2hf-neon-vfpv4-poky-linux-gnueabi/go-example/1.0.0-r0/temp/run.do_compile.87405, line 186
Bitbake配方:
DESCRIPTION = "Wails Example App"
LICENSE = "CLOSED"
LIC_FILES_CHKSUM=""
SRC_URI = "file://wails.json"
SRC_URI += "file://README.md"
SRC_URI += "file://main.go"
SRC_URI += "file://app.go"
SRC_URI += "file://frontend"
GO_IMPORT = "import"
GO_LINKSHARED = ""
PTEST_ENABLED="0"
export GO111MODULE="auto"
CGO_ENABLED = "1"
inherit go goarch
do_compile() {
cd ${WORKDIR}/build
export TMPDIR="${GOTMPDIR}"
${GO} install github.com/wailsapp/wails/v2/cmd/wails@latest
export GOPATH="$GOPATH:${S}/src/import/.gopath"
# Pass the needed cflags/ldflags so that cgo
# can find the needed headers files and libraries
export CGO_CFLAGS="${CFLAGS} --sysroot=${STAGING_DIR_TARGET}"
export CGO_LDFLAGS="${LDFLAGS} --sysroot=${STAGING_DIR_TARGET}"
./bin/linux_arm/wails build .
#${GO} build ${GO_LINKSHARED} ${GOBUILDFLAGS} -o streamerapp
cd ${OLDPWD}
}
do_install() {
cd ${WORKDIR}/build
#install -m <permisions> SRC DEST
mkdir -p ${D}${bindir}
#install -m 0755 ./wailsapp ${D}${bindir}
cd ${OLDPWD}
}
1条答案
按热度按时间fquxozlt1#
我用下面的食谱解决了这个问题。