# Cannot make filebeat for aarch64

**URL:** <https://discuss.elastic.co/t/cannot-make-filebeat-for-aarch64/159684>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [December 6, 2018, 8:37am UTC](https://discuss.elastic.co/t/cannot-make-filebeat-for-aarch64/159684 "2018-12-06T08:37:22Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![kmatsuyama](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kmatsuyama/32/31493_2.png) [@kmatsuyama](https://discuss.elastic.co/u/kmatsuyama)\
**Post date:** [December 6, 2018, 8:37am UTC](https://discuss.elastic.co/t/cannot-make-filebeat-for-aarch64/159684/1 "2018-12-06T08:37:23Z")

</div>

I make the filebeat on a linux aarch machine.

My Environment:

```
$ go version
go version go1.11.2 linux/arm64

$ git rev-parse HEAD
79a6ff31aec8e371631661add2e52938f250ceba

```

I get `make` failing with the following error:

```
$ make
go build -i -ldflags "-X github.com/elastic/beats/libbeat/version.buildTime=2018-12-06T08:20:44Z -X github.com/elastic/beats/libbeat/version.commit=79a6ff31aec8e371631661add2e52938f250ceba"
# github.com/elastic/beats/libbeat/common/file
../libbeat/common/file/stderr_other.go:30:9: undefined: syscall.Dup2
make: *** [filebeat] Error 2

```

How can I make this?

---

<div class="post-metadata">

**Author:** ![steffens](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/steffens/32/79630_2.png) [@steffens](https://discuss.elastic.co/u/steffens)\
**Post date:** [December 6, 2018, 1:46pm UTC](https://discuss.elastic.co/t/cannot-make-filebeat-for-aarch64/159684/2 "2018-12-06T13:46:23Z")

</div>

This is weird. Looks like `Dup2` is missing in the stdlib `syscall` package on arm. Can you try to replace `syscall.Dup2` with `unix.Dup2` (package `x/sys/unix`, it's vendored)?

---

<div class="post-metadata">

**Author:** ![kmatsuyama](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kmatsuyama/32/31493_2.png) [@kmatsuyama](https://discuss.elastic.co/u/kmatsuyama)\
**Post date:** [December 7, 2018, 1:20am UTC](https://discuss.elastic.co/t/cannot-make-filebeat-for-aarch64/159684/3 "2018-12-07T01:20:07Z")

</div>

I can make with the following change:

```
diff --git a/libbeat/common/file/stderr_other.go b/libbeat/common/file/stderr_other.go
index 99ad24c..2731322 100644
--- a/libbeat/common/file/stderr_other.go
+++ b/libbeat/common/file/stderr_other.go
@@ -21,11 +21,11 @@ package file

 import (
        "os"
- "syscall"
+ "golang.org/x/sys/unix"
 )

 // RedirectStandardError causes all standard error output to be directed to the
 // given file.
 func RedirectStandardError(toFile *os.File) error {
- return syscall.Dup2(int(toFile.Fd()), 2)
+ return unix.Dup2(int(toFile.Fd()), 2)
 }

```

Thank you!

---

<div class="post-metadata">

**Author:** ![steffens](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/steffens/32/79630_2.png) [@steffens](https://discuss.elastic.co/u/steffens)\
**Post date:** [December 11, 2018, 4:55pm UTC](https://discuss.elastic.co/t/cannot-make-filebeat-for-aarch64/159684/4 "2018-12-11T16:55:10Z")

</div>

Thanks for confirming. Github PR fixing compilation upstream: [https://github.com/elastic/beats/pull/9493](https://github.com/elastic/beats/pull/9493)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [January 8, 2019, 4:55pm UTC](https://discuss.elastic.co/t/cannot-make-filebeat-for-aarch64/159684/5 "2019-01-08T16:55:13Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
