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

gclang fails on simple shared library #27

Closed
orinatic opened this issue Jan 16, 2019 · 2 comments
Closed

gclang fails on simple shared library #27

orinatic opened this issue Jan 16, 2019 · 2 comments

Comments

@orinatic
Copy link

orinatic commented Jan 16, 2019

I have a simple toy shared library. I am trying to compile it with gllvm.

Specifically, the commands I'm running are:
gclang libtest.c -c -fpic libtest.c
gclang -shared -o libtest.so libtest.o

When I run the first line, I get the following output:
objcopy:stWlkp2z: can't add section '.llvm_bc': File in wrong format

The strange thing is that it does seem to work -- if I run

get-bc libtest.so
llvm-dis libtest.so.bc

then libtest.so.ll does contain what looks like the correct code

So I guess my issue is that there's either a spurious error message or else there's something wrong and my test case is just coincidentally working

I've attached a zip of the .c file and the final .ll file

Thanks!

I'm on ubuntu 16.04, if that's relevant

libtest.zip

@ianamason
Copy link
Member

ianamason commented Jan 16, 2019

I seem to recall there being a bug in a recent version of objcopy (issue #75 over in whole-program-llvm) but it was slightly different.

I need a copy of :

libtest.h

from @orinatic to duplicate ...

@ianamason
Copy link
Member

@orinatic can I close this?

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