0

Note: I have also created this as an issue for xgo here, but I thought it might be better suited as an SO question.

I am trying to cross compile my go application and one of the dependencies is the alsa.lib. I cannot get this to sucessfully compile using xgo.

Initially I tried with this command:

xgo --targets=linux/*,windows/*,darwin/* -deps=ftp://ftp.alsa-project.org/pub/lib/alsa-lib-1.1.8.tar.bz2 github.com/Lynges/susimup

And that produced this error:

/deps-build/alsa-lib-1.1.8/src/pcm/pcm_softvol.c:856: undefined reference to 'pow' 
collect2: error: ld returned 1 exit status 
2019/04/11 22:51:27 Failed to cross compile package: exit status 2

So then I added the depsargs to get --with-softfloat and that moved it along to a new error:

/deps-build/alsa-lib-1.1.8/src/pcm/pcm_meter.c:674: undefined reference to `dlsym'
collect2: error: ld returned 1 exit status

And that is where I am stuck now. I have tried adding some more arguments like mentioned in the comment to this answer, but that just gave me a warning:

configure: WARNING: unrecognized options: --disable-alsamixer, --disable-xmto, --disable-nls, --disable-bat

So now I really have no idea what to do. I just want to cross compile my very simple app for arm so that it may be used on a Raspberry pi.

Mathias Nielsen
  • 1,560
  • 1
  • 17
  • 31
  • Which os/arch build is failing? If you just want to compile for linux/arm, why are you targeting linux/*,windows/*,darwin/*? – Adrian Apr 12 '19 at 16:45
  • Anything linux seems to make it fail. Host is linux/amd64 and compiling for just that through xgo fails as well. I can post the entire output from xgo, but it is quite large. – Mathias Nielsen Apr 12 '19 at 16:49
  • Why use xgo at all? If you have one build target `go build` should be sufficient. – Adrian Apr 12 '19 at 18:19
  • The primary thing is getting it compiled for arm-linux, but I would like to have it compiling for at least some platforms beyond that – Mathias Nielsen Apr 12 '19 at 19:09

0 Answers0