Unable to link net library when crosscompiling for ARM

Hi everyone,

I’ve run into a roadblock when cross compiling my app for ARM, and works perfectly for MIPS and x86.
Problem isn’t compiling actually but linking. I get following errors:

command-line-arguments

loadelf: /home/build/iopsyswrt/tmp/go-build/da/da457e3b0405a90730032b92d7e3a72e3f753a3bf6736d198e49a434f7283add-d(_x001.o): 117022: sym#29: ignoring symbol in section 1 (type 0)
loadelf: /home/build/iopsyswrt/tmp/go-build/da/da457e3b0405a90730032b92d7e3a72e3f753a3bf6736d198e49a434f7283add-d(_x002.o): 117026: sym#39: ignoring symbol in section 1 (type 0)
loadelf: /home/build/iopsyswrt/tmp/go-build/da/da457e3b0405a90730032b92d7e3a72e3f753a3bf6736d198e49a434f7283add-d(_x003.o): 117030: sym#51: ignoring symbol in section 1 (type 0)
loadelf: /home/build/iopsyswrt/tmp/go-build/da/da457e3b0405a90730032b92d7e3a72e3f753a3bf6736d198e49a434f7283add-d(_x004.o): 117034: sym#47: ignoring symbol in section 1 (type 0)
loadelf: /home/build/iopsyswrt/tmp/go-build/da/da457e3b0405a90730032b92d7e3a72e3f753a3bf6736d198e49a434f7283add-d(_x005.o): 117038: sym#57: ignoring symbol in section 1 (type 0)
loadelf: /home/build/iopsyswrt/tmp/go-build/43/4379d79a211b4d22d6aa20ce7478f83cf7e6aa5eae89a3e33fe91d2e12589829-d(_x001.o): 117042: sym#29: ignoring symbol in section 1 (type 0)
loadelf: /home/build/iopsyswrt/tmp/go-build/43/4379d79a211b4d22d6aa20ce7478f83cf7e6aa5eae89a3e33fe91d2e12589829-d(_x002.o): 117046: sym#27: ignoring symbol in section 1 (type 0)
loadelf: /home/build/iopsyswrt/tmp/go-build/43/4379d79a211b4d22d6aa20ce7478f83cf7e6aa5eae89a3e33fe91d2e12589829-d(_x003.o): 117050: sym#39: ignoring symbol in section 1 (type 0)
loadelf: /home/build/iopsyswrt/tmp/go-build/43/4379d79a211b4d22d6aa20ce7478f83cf7e6aa5eae89a3e33fe91d2e12589829-d(_x004.o): 117056: sym#44: ignoring symbol in section 1 (type 0)
loadelf: /home/build/iopsyswrt/tmp/go-build/43/4379d79a211b4d22d6aa20ce7478f83cf7e6aa5eae89a3e33fe91d2e12589829-d(_x005.o): 117066: sym#71: ignoring symbol in section 1 (type 0)
loadelf: /home/build/iopsyswrt/tmp/go-build/43/4379d79a211b4d22d6aa20ce7478f83cf7e6aa5eae89a3e33fe91d2e12589829-d(_x006.o): 117074: sym#68: ignoring symbol in section 1 (type 0)
loadelf: /home/build/iopsyswrt/tmp/go-build/43/4379d79a211b4d22d6aa20ce7478f83cf7e6aa5eae89a3e33fe91d2e12589829-d(_x007.o): 117078: sym#39: ignoring symbol in section 1 (type 0)
loadelf: /home/build/iopsyswrt/tmp/go-build/43/4379d79a211b4d22d6aa20ce7478f83cf7e6aa5eae89a3e33fe91d2e12589829-d(_x008.o): 117082: sym#39: ignoring symbol in section 1 (type 0)
loadelf: /home/build/iopsyswrt/tmp/go-build/43/4379d79a211b4d22d6aa20ce7478f83cf7e6aa5eae89a3e33fe91d2e12589829-d(_x009.o): 117089: sym#44: ignoring symbol in section 1 (type 0)
_cgo_init: relocation target x_cgo_init not defined
_cgo_notify_runtime_init_done: relocation target x_cgo_notify_runtime_init_done not defined
_cgo_thread_start: relocation target x_cgo_thread_start not defined
net._cgo_26061493d47f_C2func_getaddrinfo: relocation target _cgo_26061493d47f_C2func_getaddrinfo not defined
net._cgo_26061493d47f_Cfunc_freeaddrinfo: relocation target _cgo_26061493d47f_Cfunc_freeaddrinfo not defined
net._cgo_26061493d47f_Cfunc_gai_strerror: relocation target _cgo_26061493d47f_Cfunc_gai_strerror not defined
runtime._cgo_setenv: relocation target x_cgo_setenv not defined
/home/build/iopsyswrt/staging_dir/hostpkg/lib/go-cross/pkg/tool/linux_amd64/link: too many errors

So app was working fine for ARM until I’ve introduced web socket snippet to my code:
package communicator

import (
“bufio”
“fmt”
“log”
“net”
“os”
“time”
)

const (
gwDeviceHandle = “gateway”
rxBufferSize = 10240 // buffer size in bytes for receiving socket connection messages
minPollCycle = 100 * time.Millisecond
socket_address = “/hc/data/var/scg/ipc.sock”
connHost = “localhost”
connPort = “8080”
connType = “tcp”
connServAddr = “192.168.2.167”
)

var Wizard_chan = make(chan string)

func Report_communicator() {
fmt.Println(“communicator module reporting in !”)
}

func StartNodeSocketHandler() {
fmt.Println(“Starting " + connType + " server on " + connHost + “:” + connPort)
l, err := net.Listen(connType, connHost+”:"+connPort)
if err != nil {
fmt.Println(“Error listening:”, err.Error())
os.Exit(1)
}
defer l.Close()

for {

	c, err := l.Accept()
	if err != nil {
		fmt.Println("Error connecting:", err.Error())
		return
	}
	fmt.Println("Client connected.")

	fmt.Println("Client " + c.RemoteAddr().String() + " connected.")

	go handleConnection(c)
}

}

Please help !
Thank you and kindest regards!
Nikola

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