Thanks Ian! And sorry for my late response… Didn’t find time the last few days to test this. I use a different toolchain () and now I seem to get past this problem :)
But now I end up getting these errors: <SNIP> /var/folders/2k/hxm__dq91bj19r7scpr3mzq80000gn/T/go-build613045906/github.com/google/gousb/_obj/libusb.cgo2.o: In function `_cgo_403ec9e57611_Cfunc_libusb_set_interface_alt_setting': libusb.cgo2.c:(.text+0x15bc): undefined reference to `libusb_set_interface_alt_setting' /var/folders/2k/hxm__dq91bj19r7scpr3mzq80000gn/T/go-build613045906/github.com/google/gousb/_obj/libusb.cgo2.o: In function `_cgo_403ec9e57611_Cfunc_libusb_unref_device': libusb.cgo2.c:(.text+0x16f0): undefined reference to `libusb_unref_device' /var/folders/2k/hxm__dq91bj19r7scpr3mzq80000gn/T/go-build613045906/github.com/google/gousb/_obj/transfer.o: In function `submit': transfer.c:(.text+0x40): undefined reference to `libusb_submit_transfer' collect2: error: ld returned 1 exit status I updated to build command to also include the libusb source: GOOS=linux GOARCH=mipsle CGO_ENABLED=1 CC=mipsel-openwrt-linux-uclibc-gcc-4.8.3 CGO_CFLAGS="-I ./include -I ./libusb-1.0.21/libusb" go build So it seems it doesn’t cross compile libusb first and so is missing those symbols? Guessing a bit here… Any pointers on how to solve this? Sander On 18/07/2017, at 00:11 , Ian Lance Taylor <i...@golang.org> wrote: On Mon, Jul 17, 2017 at 12:53 PM, Sander van Harmelen <san...@xanzy.io> wrote: > > I’m trying to cross compile > https://github.com/google/gousb/tree/master/lsusb from macOS to mipsle using > the following cmd: > >> GOOS=linux GOARCH=mipsle CGO_ENABLED=1 CC=mipsel-openwrt-linux-gcc >> CFLAGS=-I../include/ go build > > But I receive this error: > > # runtime/cgo > /usr/local/go/src/runtime/cgo/gcc_mipsx.S: Assembler messages: > /usr/local/go/src/runtime/cgo/gcc_mipsx.S:30: Error: opcode not supported on > this processor: mips32 (mips32) `sdc1 $f20,40($29)' > /usr/local/go/src/runtime/cgo/gcc_mipsx.S:31: Error: opcode not supported on > this processor: mips32 (mips32) `sdc1 $f22,48($29)' > /usr/local/go/src/runtime/cgo/gcc_mipsx.S:32: Error: opcode not supported on > this processor: mips32 (mips32) `sdc1 $f24,56($29)' > /usr/local/go/src/runtime/cgo/gcc_mipsx.S:33: Error: opcode not supported on > this processor: mips32 (mips32) `sdc1 $f26,64($29)' > /usr/local/go/src/runtime/cgo/gcc_mipsx.S:34: Error: opcode not supported on > this processor: mips32 (mips32) `sdc1 $f28,72($29)' > /usr/local/go/src/runtime/cgo/gcc_mipsx.S:35: Error: opcode not supported on > this processor: mips32 (mips32) `sdc1 $f30,80($29)' > /usr/local/go/src/runtime/cgo/gcc_mipsx.S:52: Error: opcode not supported on > this processor: mips32 (mips32) `ldc1 $f20,40($29)' > /usr/local/go/src/runtime/cgo/gcc_mipsx.S:53: Error: opcode not supported on > this processor: mips32 (mips32) `ldc1 $f22,48($29)' > /usr/local/go/src/runtime/cgo/gcc_mipsx.S:54: Error: opcode not supported on > this processor: mips32 (mips32) `ldc1 $f24,56($29)' > /usr/local/go/src/runtime/cgo/gcc_mipsx.S:55: Error: opcode not supported on > this processor: mips32 (mips32) `ldc1 $f26,64($29)' > /usr/local/go/src/runtime/cgo/gcc_mipsx.S:56: Error: opcode not supported on > this processor: mips32 (mips32) `ldc1 $f28,72($29)' > /usr/local/go/src/runtime/cgo/gcc_mipsx.S:57: Error: opcode not supported on > this processor: mips32 (mips32) `ldc1 $f30,80($29)' > > I’ve build mipsel-openwrt-linux-gcc using the docs written down here: > https://wiki.openwrt.org/doc/howto/build > > Any pointers on how to make this work? Or am I out of luck and did I hit > road block (i.e. it’s not possible/supported)? I don't understand that error, as to the best of my knowledge the mips32 ISA supports the ldc1 and sdc1 instructions. Is it possible that you need to update your GNU binutils? Ian -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.