Hello! I’m having trouble cross compiling mender client for ARM . When I try to compile mender for ARM from an AMD64 machine , I get the following error
mdb.c: In function ‘mdb_cursor_put’:
mdb.c:6535:9: warning: this statement may fall through [-Wimplicit-fallthrough=]
if (SIZELEFT(fp) < offset) {
^
mdb.c:6540:5: note: here
case MDB_CURRENT:
^~~~
# github.com/mendersoftware/openssl
In file included from /usr/include/openssl/bio.h:13:0,
from ./shim.h:21,
from vendor/github.com/mendersoftware/openssl/bio.go:17:
/usr/include/openssl/e_os2.h:13:11: fatal error: openssl/opensslconf.h: No such file or directory
# include <openssl/opensslconf.h>
^~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
The README in the mender client repository only talks about the liblzma dependency for cross compilation , is there any reference on how to do the same for openssl since libssl-dev is not multi arch compatible.
What do you mean libssl-dev is not multi-arch compatible?
We don’t have it in the README, but in essence it should be pretty much the same as regular compilation, you just have to remember to set your C compiler env.
Here are the steps i’ve followed ( taken from the README of mender client repo ) to cross compile for raspberry pi ( as mentioned as an example in the README )
git clone https://github.com/mendersoftware/mender.git
cd mender/
git clone https://github.com/raspberrypi/tools.git
export PATH="$PATH:$(pwd)/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin"
export CC=arm-linux-gnueabihf-gcc
GOARCH=arm make TAGS="nodbus nolzma"
I get the following error :
go build -ldflags "-X github.com/mendersoftware/mender/conf.Version=fbed1ef" -tags 'nodbus nolzma'
# github.com/mendersoftware/openssl
In file included from /usr/include/openssl/bio.h:13:0,
from ./shim.h:21,
from vendor/github.com/mendersoftware/openssl/bio.go:17:
/usr/include/openssl/e_os2.h:13:11: fatal error: openssl/opensslconf.h: No such file or directory
# include <openssl/opensslconf.h>
^~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Makefile:78: recipe for target 'build' failed
make: *** [build] Error 2
Are the steps wrong? I feel the README should be updated to include openssl cross compilation steps just like the liblzma steps , since you’ve recently introduced code changes under https://github.com/mendersoftware/mender/tree/master/vendor/github.com/mendersoftware/openssl which require this as a basic need for cross compilation to happen