# Compilation filebeat gccgo solaris /sparc

**URL:** <https://discuss.elastic.co/t/compilation-filebeat-gccgo-solaris-sparc/141170>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [July 23, 2018, 12:19pm UTC](https://discuss.elastic.co/t/compilation-filebeat-gccgo-solaris-sparc/141170 "2018-07-23T12:19:41Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Charaf\_Ahmed](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/charaf_ahmed/32/30467_2.png) [@Charaf\_Ahmed](https://discuss.elastic.co/u/Charaf_Ahmed)\
**Post date:** [July 23, 2018, 12:19pm UTC](https://discuss.elastic.co/t/compilation-filebeat-gccgo-solaris-sparc/141170/1 "2018-07-23T12:19:41Z")

</div>

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](http://ggolang.blogspot.com/2015/05/gccgo-gcc510-cross-compile-for-sparc.html)

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.
COLLECT_GCC=gccgo
COLLECT_LTO_WRAPPER=/opt/cross/libexec/gcc/sparc-sun-solaris2.10/8.1.0/lto-wrapper
Target: sparc-sun-solaris2.10
   elf64_sparc
COLLECT_GCC_OPTIONS='-m64' '-v' '-o' 'hello' '-shared-libgcc'
xxxxxx@ub

```

works very well but,

\*\*Example 2 : \*\*

```
xxxx@ubuntu:~/go/src/github.com/elastic/beats/filebeat$ go build --compiler gccgo --gccgoflags "-v -static-libgo -Wl,-dy -lnsl -lsocket -lrt -lsendfile"
# github.com/elastic/beats/libbeat/plugin
../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)
            ^
# github.com/elastic/beats/vendor/github.com/elastic/go-seccomp-bpf
../vendor/github.com/elastic/go-seccomp-bpf/seccomp_linux.go:59:22: error: reference to undefined identifier ‘syscall.SockFprog’
  program := &syscall.SockFprog{

```

that's where I'm stuck  
THANK YOU

---

<div class="post-metadata">

**Author:** ![kvch](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kvch/32/72058_2.png) [@kvch](https://discuss.elastic.co/u/kvch)\
**Post date:** [July 23, 2018, 4:24pm UTC](https://discuss.elastic.co/t/compilation-filebeat-gccgo-solaris-sparc/141170/2 "2018-07-23T16:24:58Z")

</div>

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. 🙂

---

<div class="post-metadata">

**Author:** ![Charaf\_Ahmed](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/charaf_ahmed/32/30467_2.png) [@Charaf\_Ahmed](https://discuss.elastic.co/u/Charaf_Ahmed)\
**Post date:** [July 24, 2018, 8:47am UTC](https://discuss.elastic.co/t/compilation-filebeat-gccgo-solaris-sparc/141170/3 "2018-07-24T08:47:33Z")

</div>

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

---

<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:** [August 21, 2018, 8:47am UTC](https://discuss.elastic.co/t/compilation-filebeat-gccgo-solaris-sparc/141170/4 "2018-08-21T08:47:34Z")

</div>

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