I am writing a Go package that calls C code. I need to invoke the host linker, but unfortunately adding the -hostobj
flag gives me following error:
gcc: error: unrecognized option ‘-h’
Operating system is Linux, architecture amd64.
Here are all the flags:
// #cgo CFLAGS: -I. -fPIC
// #cgo LDFLAGS: -lstdc++ -w -hostobj -L. libsomething.a
// #include "something.h"
// #include <stdlib.h>
What am I doing wrong?