that was ambiguous! shall i use native sysroot or target sysroot?
nevertheless i tried both. both threw different errors. it seems target sysroot threw more errors like it didn’t agree with gnu. and native sysroot seems only can not find stdlib.
so with command with target sysroot like this:
make CGO_CFLAGS="–sysroot=SDKTARGETSYSROOT -I{LIBLZMA_INSTALL_PATH}/include" CGO_LDFLAGS="–sysroot=SDKTARGETSYSROOT -L{LIBLZMA_INSTALL_PATH}/lib" CGO_ENABLED=1 GOOS=linux GOARCH=arm
it appears following error:
go build -ldflags “-X github.com/mendersoftware/mender/conf.Version=412268f”
github.com/mendersoftware/mender/vendor/github.com/remyoudompheng/go-liblzma
In file included from /usr/local/oecore-x86_64/sysroots/armv7at2hf-neon-angstrom-linux-gnueabi/usr/include/gnu/stubs.h:55:0,
from /usr/local/oecore-x86_64/sysroots/armv7at2hf-neon-angstrom-linux-gnueabi/usr/include/features.h:447,
from /usr/local/oecore-x86_64/sysroots/armv7at2hf-neon-angstrom-linux-gnueabi/usr/include/inttypes.h:25,
from /home/rui/go/src/github.com/mendersoftware/mender/xz-5.2.4/install/include/lzma.h:124,
from vendor/github.com/remyoudompheng/go-liblzma/reader.go:9:
/usr/local/oecore-x86_64/sysroots/armv7at2hf-neon-angstrom-linux-gnueabi/usr/include/gnu/stubs-32.h:7:11: fatal error: gnu/stubs-soft.h: No such file or directory
include <gnu/stubs-soft.h>
^~~~~~~~~~~~~~~~~~
compilation terminated.
os/user
In file included from /usr/local/oecore-x86_64/sysroots/armv7at2hf-neon-angstrom-linux-gnueabi/usr/include/gnu/stubs.h:55:0,
from /usr/local/oecore-x86_64/sysroots/armv7at2hf-neon-angstrom-linux-gnueabi/usr/include/features.h:447,
from /usr/local/oecore-x86_64/sysroots/armv7at2hf-neon-angstrom-linux-gnueabi/usr/include/unistd.h:25,
from /usr/local/go/src/os/user/cgo_lookup_unix.go:20:
/usr/local/oecore-x86_64/sysroots/armv7at2hf-neon-angstrom-linux-gnueabi/usr/include/gnu/stubs-32.h:7:11: fatal error: gnu/stubs-soft.h: No such file or directory
include <gnu/stubs-soft.h>
^~~~~~~~~~~~~~~~~~
compilation terminated.
net
In file included from /usr/local/oecore-x86_64/sysroots/armv7at2hf-neon-angstrom-linux-gnueabi/usr/include/gnu/stubs.h:55:0,
from /usr/local/oecore-x86_64/sysroots/armv7at2hf-neon-angstrom-linux-gnueabi/usr/include/features.h:447,
from /usr/local/oecore-x86_64/sysroots/armv7at2hf-neon-angstrom-linux-gnueabi/usr/include/netdb.h:25,
from /usr/local/go/src/net/cgo_linux.go:10:
/usr/local/oecore-x86_64/sysroots/armv7at2hf-neon-angstrom-linux-gnueabi/usr/include/gnu/stubs-32.h:7:11: fatal error: gnu/stubs-soft.h: No such file or directory
include <gnu/stubs-soft.h>
^~~~~~~~~~~~~~~~~~
compilation terminated.
github.com/mendersoftware/mender/vendor/github.com/bmatsuo/lmdb-go/lmdb
In file included from /usr/local/oecore-x86_64/sysroots/armv7at2hf-neon-angstrom-linux-gnueabi/usr/include/gnu/stubs.h:55:0,
from /usr/local/oecore-x86_64/sysroots/armv7at2hf-neon-angstrom-linux-gnueabi/usr/include/features.h:447,
from /usr/local/oecore-x86_64/sysroots/armv7at2hf-neon-angstrom-linux-gnueabi/usr/include/bits/libc-header-start.h:33,
from /usr/local/oecore-x86_64/sysroots/armv7at2hf-neon-angstrom-linux-gnueabi/usr/include/stdlib.h:25,
from vendor/github.com/bmatsuo/lmdb-go/lmdb/cursor.go:4:
/usr/local/oecore-x86_64/sysroots/armv7at2hf-neon-angstrom-linux-gnueabi/usr/include/gnu/stubs-32.h:7:11: fatal error: gnu/stubs-soft.h: No such file or directory
include <gnu/stubs-soft.h>
^~~~~~~~~~~~~~~~~~
compilation terminated.
Makefile:75: recipe for target ‘mender’ failed
make: *** [mender] Error 2
but with command with native sysroot like this:
make CGO_CFLAGS="–sysroot=/usr/local/oecore-x86_64/sysroots/x86_64-angstromsdk-linux -I${LIBLZMA_INSTALL_PATH}/include" CGO_LDFLAGS="–sysroot=/usr/local/oecore-x86_64/sysroots/x86_64-angstromsdk-linux -L${LIBLZMA_INSTALL_PATH}/lib" CGO_ENABLED=1 GOOS=linux GOARCH=arm
it occurs less error report only this:
go build -ldflags “-X github.com/mendersoftware/mender/conf.Version=412268f”
runtime/cgo
_cgo_export.c:3:10: fatal error: stdlib.h: No such file or directory
#include <stdlib.h>
^~~~~~~~~~
compilation terminated.
Makefile:75: recipe for target ‘mender’ failed
make: *** [mender] Error 2