gohttplib
gohttplib copied to clipboard
examples/python: Link against c-archive?
We got our example working with go build -buildmode=c-shared but haven't been able to get it working with the file produced by go build -buildmode=c-archive. Would be nice to link against the same thing from both the C and Python examples.
Or at least figure out why it's not working.
My guess was that we needed to use extra_link_args=["gohttplib.a"] (or maybe -static go httplib.a) to get c-archive mode to work.
My guess was that we needed to use
extra_link_args=["gohttplib.a"]to getc-archivemode to work.
Then this happens:
ld: illegal text-relocation to 'type..eq.[0]string' in ../../build/gohttplib.a(go.o) from 'runtime.rodata' in ../../build/gohttplib.a(go.o) for architecture x86_64
clang: error: linker command failed with exit code 1
I think the problem might be that cffi runs the compile with -dynamic and this would need -static?
Mmm… and if you run the compile "by hand" without -dynamic does that work?
Hmm will need to strace the command and try it. Though reading up more, getting the sense c-shared mode should be sufficient if/when #6 is done.