Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

examples/python: Link against c-archive? #4

Open
shazow opened this issue Jun 24, 2015 · 4 comments
Open

examples/python: Link against c-archive? #4

shazow opened this issue Jun 24, 2015 · 4 comments

Comments

@shazow
Copy link
Owner

shazow commented Jun 24, 2015

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.

@wolever
Copy link

wolever commented Jun 24, 2015

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.

@shazow
Copy link
Owner Author

shazow commented Jun 24, 2015

My guess was that we needed to use extra_link_args=["gohttplib.a"] to get c-archive mode 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?

@wolever
Copy link

wolever commented Jun 24, 2015

Mmm… and if you run the compile "by hand" without -dynamic does that work?

@shazow
Copy link
Owner Author

shazow commented Jun 24, 2015

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants