Cannot make filebeat for aarch64

I make the filebeat on a linux aarch machine.

My Environment:

$ go version
go version go1.11.2 linux/arm64

$ git rev-parse HEAD

I get make failing with the following error:

$ make
go build -i -ldflags "-X -X"
../libbeat/common/file/stderr_other.go:30:9: undefined: syscall.Dup2
make: *** [filebeat] Error 2

How can I make this?

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)?

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 (
-       "syscall"
+       ""

 // 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!

Thanks for confirming. Github PR fixing compilation upstream:

1 Like

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