[llvm-dev] Assertion `GV->use_empty() && "program cannot use initializer list"' failed

Peter Collingbourne via llvm-dev llvm-dev at lists.llvm.org
Mon Nov 23 16:49:27 PST 2015


Hi Mike,

Looks like this can happen when the linker upgrades IR that uses the old
@llvm.global_{c,d}tors format with 2 elements per struct.

I would check to see if any of your input files contain a
@llvm.global_{c,d}tors array with 2 elements per struct. It looks like
you're using ASan; it may be that ASan is creating these arrays. If so it
should probably be modified to use the new format with 3 elements per struct.

But then again that would be hiding the real problem, which is that the
upgrade isn't being done correctly (something is still holding a reference
to @llvm.global_{c,d}tors). We should find out what that is and make sure
the reference is removed by the time the linker runs.

Peter

On Mon, Nov 23, 2015 at 03:49:33PM -0800, Mike Aizatsky via llvm-dev wrote:
> I'm trying to build some chromium tests with LTO and I'm getting following
> crypting assertion from the gold plugin:
> 
> FAILED: ../../third_party/llvm-build/Release+Asserts/bin/clang++
> -Wl,--fatal-warnings -fPIC -Wl,-z,noexecstack -Wl,-z,now -Wl,-z,relro
> -B../../third_party/binutils/Linux_x64/Release/bin -fuse-ld=gold -flto
> -Wl,-plugin=LLVMgold.so -pthread -m64 -Wl,-O1 -Wl,--gc-sections
> -Wl,-rpath=\$ORIGIN/ -Wl,-rpath-link= -Wl,--disable-new-dtags
> -Wl,-u_sanitizer_options_link_helper -fsanitize=address -L. -o "./re2c"
> -Wl,--start-group @"./re2c.rsp"  -Wl,--end-group  -ldl -lc -lgcc_s -lm
> -lpthread -lrt
> ld.gold:
> 
> /usr/local/google/home/aizatsky/src/chrome/src/third_party/llvm/lib/Linker/LinkModules.cpp:1258:
> void upgradeGlobalArray(llvm::GlobalVariable*): Assertion `GV->use_empty()
> && "program cannot use initializer list"' failed.
> clang-3.8: error: unable to execute command: Aborted (core dumped)
> 
> What does this assertion mean? I believe I'm use tip-of-the-tree clang and
> "GNU gold (GNU Binutils 2.25) 1.11" gold plugin.

> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev


-- 
Peter


More information about the llvm-dev mailing list