# Go error occurred by attempting to build mender master branch via cross compiling

**URL:** <https://hub.mender.io/t/go-error-occurred-by-attempting-to-build-mender-master-branch-via-cross-compiling/1849>\
**Category:** General Discussions\
**Tags:** mender\
**Created:** [April 27, 2020, 2:12pm UTC](https://hub.mender.io/t/go-error-occurred-by-attempting-to-build-mender-master-branch-via-cross-compiling/1849 "2020-04-27T14:12:22Z")\
**Posts on this page:** 1\
**Showing post:** 20

<div class="post-metadata">

**Author:** ![mirzak](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/mirzak/32/2056_2.png) [@mirzak](https://hub.mender.io/u/mirzak)\
**Post date:** [May 5, 2020, 9:23am UTC](https://hub.mender.io/t/go-error-occurred-by-attempting-to-build-mender-master-branch-via-cross-compiling/1849/20 "2020-05-05T09:23:43Z")

</div>

Then `GOARCH=arm` is needed.

I also think that you have passed the wrong sysroot as argument, host instead of target. It should be something like this:

```auto
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

```

---

_[View the full topic](https://hub.mender.io/t/go-error-occurred-by-attempting-to-build-mender-master-branch-via-cross-compiling/1849)._
