i watched a video of gopher-os and looked through it's github repository for ways to extract the object files needed and tried his command as follows, but i'm getting these errors which i can't resolve:
GOARCH=386 GOOS=linux go build -n 2>&1 | sed -e "1s|^|set -e\n|" -e "1s|^|export GOOS=linux\n|" -e "1s|^|export GOARCH=386\n|" -e "1s|^|export CGO_ENABLED=0\n|" -e "1s|^|WORK='./build'\n|" -e "1s|^|alias pack='go tool pack'\n|" -e "/^mv/d" -e "s|-extld|-tmpdir='./build' -linkmode=external -extldflags='-nostdlib' -extld|g" | sh 2>&1 | sed -e "s/^/ | /g"
Errors/Warnings:
| loadinternal: cannot find runtime/cgo
| /usr/bin/ld: warning: cannot find entry symbol _start; defaulting to 0000000008049000
The above command is able to produce an object file in the ./build directory i specified, i can link it without any errors, but when i try to run the executable it doesn't work.
i know there is nothing wrong with the linker script because i have created object files using the gccgo cross-compiler, and they work.
i wish to use the extra set of features the 'go build' cross-compiler is able to provide that gccgo cross-compiler cannot.