-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Assertion failed in llvm-ld when linking a library #1806
Comments
assigned to @lattner |
This is confirmed. I can replicate the behavior. |
The debugger is not being friendly on this one. There is a use of a linked |
This is also a problem on the release 2.0 branch so its been around for at least |
This build is OK: "2007-05-04 7:00". |
Thanks Zhiru, that helps. Perhaps I can find it by comparing changes since then. |
I've tracked it down to being just a problem with archives. The only difference |
This is a serious regression from 2.0. Fixed, patch here: Testcase here: test/Linker/link-archive.ll Many thanks to Reid for helping put the pieces together and create the testcase. -Chris |
Extended Description
My llvm-ld crashed (assertion failure) when I tried to link a bc library.
Will attached the test files later.
What I did is:
llvm-gcc -c -O0 -emit-llvm libfoo.c -o libfoo.bc
llvm-ar cru libfoo.a libfoo.bc
llvm-ranlib libfoo.a
llvm-gcc -c -O0 -emit-llvm foo.c -o foo.bc
llvm-ld foo.bc libfoo.a -o all.bc
(and llvm-ld foo.bc -lfoo -o all.bc)
Both produce the following error:
==========================================================================
llvm-ld: /home/llvm/lib/VMCore/Value.cpp:57: virtual llvm::Value::~Value():
Assertion `use_begin() == use_end() && "Uses remain when a value is
destroyed!"' failed.
llvm-ld((anonymous namespace)::PrintStackTrace()+0x1a)[0x84e61b6]
llvm-ld((anonymous namespace)::SignalHandler(int)+0x110)[0x84e64de]
/lib/tls/libc.so.6[0x683898]
/lib/tls/libc.so.6(abort+0xe9)[0x685209]
/lib/tls/libc.so.6(__assert_fail+0x101)[0x67cd91]
llvm-ld(llvm::Value::~Value()+0x1c4)[0x84a2dd6]
llvm-ld(llvm::User::~User()+0x1b)[0x82ee97f]
llvm-ld(llvm::Constant::~Constant()+0x1b)[0x82eeab7]
llvm-ld(llvm::GlobalValue::~GlobalValue()+0x34)[0x845921e]
llvm-ld(llvm::Function::~Function()+0x9d)[0x8454cdb]
llvm-ld(llvm::iplist<llvm::Function, llvm::ilist_traitsllvm::Function
The text was updated successfully, but these errors were encountered: