Compilation filebeat gccgo solaris /sparc

I am driving to compile the project filebeat going for solar / SPARC environments. Officially, Elastic tools are not supported by Solaris.

Neamoins, there is circumventenement to this problem / compile via gccgo. I actually prepare my gccgo compiler. I can compile a small project (with a single file hello.go) see below. But as soon as I try to compile the filebeat project, it does not work. can be a problem of dependencies.I do not know too much. if anyone could help me. Thank you

inspiration : inspiration

Commande : go build --compiler gccgo --gccgoflags "-v -static-libgo -Wl,-dy -lnsl -lsocket -lrt -lsendfile"

**Example 1 : **

xxxx@ubuntu:~/Documents/GCC$ cat hello.go
package main

import "fmt"

func main() {
    fmt.Println("hello world")

morosus@ubuntu:~/Documents/GCC$ gccgo -m64 -v -static-libgo -o hello hello.go
-Wl,-dy -lnsl -lsocket -lrt -lsendfile
Using built-in specs.
Target: sparc-sun-solaris2.10
COLLECT_GCC_OPTIONS='-m64' '-v' '-o' 'hello' '-shared-libgcc'

works very well but,

**Example 2 : **

xxxx@ubuntu:~/go/src/$ go build --compiler gccgo --gccgoflags "-v -static-libgo -Wl,-dy -lnsl -lsocket -lrt -lsendfile"
../libbeat/plugin/load.go:25:2: error: import file ‘plugin’ not found
  goplugin "plugin"
../libbeat/plugin/load.go:29:12: error: reference to undefined name ‘goplugin’
  p, err := goplugin.Open(path)
../vendor/ error: reference to undefined identifier ‘syscall.SockFprog’
  program := &syscall.SockFprog{

that's where I'm stuck

I came across the same blogpost and the docker image based on the blogpost. I tried crosscompiling Filebeat for Solaris on SPARC the same way, but I was not successful compiling it. I am glad to share my findings with you. I had the same problems like you.

The package plugin of Golang stdlib is only supported on Linux. The build tag on the file is correctly set to only build it when GOOS is linux. You need to pass GOOS=solaris so the appropiate source files are selected. However, I was not able to pass this variable to the compiler, so couldn't compile it. I also tried GOOS=solaris go build --compiler gccgo and so on, but so far no luck.

My next move would be to try to compile Filebeat on a solaris/sparc machine, if I had access to one. :slight_smile:

1 Like

Thank you for your reply. I hope Elastic will offer an off-the-shelf solution for Solaris / Sparc. I thank you.

1 Like

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