http://llvm.org/bugs/show_bug.cgi?id=2926
Summary: Assertions fail when linking symbol aliases
Product: new-bugs
Version: unspecified
Platform: PC
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P2
Component: new bugs
AssignedTo: [EMAIL PROTECTED]
ReportedBy: [EMAIL PROTECTED]
CC: [email protected]
Created an attachment (id=2115)
--> (http://llvm.org/bugs/attachment.cgi?id=2115)
Source for one.bc
I saw two cases of assertion failures when linking modules with slightly
different symbol aliases (same name, but different aliasee types). As several
other cases are reported as errors in the code, I think these two cases should
also be reported as errors.
The system is an AMD64 Debian lenny, LLVM is built from the 2.4 release branch,
llvm-gcc is built from the 2.3 sources (I wasn't able to build it from 2.4).
Here is what fails (one.ll, two.ll, three.ll are attached).
llvm-ld -link-as-library -internalize -o foo.bc one.bc three.bc
llvm-ld:
/home/staff/torvald/STM/stm/code/cpp/llvm-2.4/include/llvm/Support/Casting.h:199:
typename llvm::cast_retty<To, From>::ret_type llvm::cast(const Y&) [with X =
llvm::GlobalValue, Y = llvm::Value*]: Assertion `isa<X>(Val) && "cast<Ty>()
argument of incompatible type!"' failed.
llvm-ld[0x8ca3d7]
llvm-ld[0x8ca4f8]
/lib/libc.so.6[0x7f2cbbdf8f60]
/lib/libc.so.6(gsignal+0x35)[0x7f2cbbdf8ed5]
/lib/libc.so.6(abort+0x183)[0x7f2cbbdfa3f3]
/lib/libc.so.6(__assert_fail+0xe9)[0x7f2cbbdf1dc9]
llvm-ld(_ZN4llvm12cast_or_nullINS_11GlobalValueENS_5ValueEEENS_10cast_rettyIT_PT0_E8ret_typeES6_+0x0)[0x68e11b]
llvm-ld[0x688c90]
llvm-ld(_ZN4llvm6Linker11LinkModulesEPNS_6ModuleES2_PSs+0x639)[0x68abdf]
llvm-ld(_ZN4llvm6Linker12LinkInModuleEPNS_6ModuleEPSs+0x28)[0x68593a]
llvm-ld(_ZN4llvm6Linker10LinkInFileERKNS_3sys4PathERb+0x4d4)[0x684fe4]
llvm-ld(_ZN4llvm6Linker11LinkInFilesERKSt6vectorINS_3sys4PathESaIS3_EE+0x36)[0x68514a]
llvm-ld(main+0x359)[0x6628c9]
/lib/libc.so.6(__libc_start_main+0xe6)[0x7f2cbbde51a6]
llvm-ld(_ZNSt8ios_base4InitD1Ev+0x39)[0x65a0b9]
Aborted
llvm-ld -link-as-library -internalize -o foo.bc two.bc three.bc
llvm-ld:
/home/staff/torvald/STM/stm/code/cpp/llvm-2.4/lib/VMCore/Globals.cpp:193:
llvm::GlobalAlias::GlobalAlias(const llvm::Type*,
llvm::GlobalValue::LinkageTypes, const std::string&, llvm::Constant*,
llvm::Module*): Assertion `aliasee->getType() == Ty && "Alias and aliasee types
should match!"' failed.
llvm-ld[0x8ca3d7]
llvm-ld[0x8ca4f8]
/lib/libc.so.6[0x7f537d344f60]
/lib/libc.so.6(gsignal+0x35)[0x7f537d344ed5]
/lib/libc.so.6(abort+0x183)[0x7f537d3463f3]
/lib/libc.so.6(__assert_fail+0xe9)[0x7f537d33ddc9]
llvm-ld(_ZN4llvm11GlobalAliasC1EPKNS_4TypeENS_11GlobalValue12LinkageTypesERKSsPNS_8ConstantEPNS_6ModuleE+0xa2)[0x839fd2]
llvm-ld[0x6895a1]
llvm-ld(_ZN4llvm6Linker11LinkModulesEPNS_6ModuleES2_PSs+0x639)[0x68abdf]
llvm-ld(_ZN4llvm6Linker12LinkInModuleEPNS_6ModuleEPSs+0x28)[0x68593a]
llvm-ld(_ZN4llvm6Linker10LinkInFileERKNS_3sys4PathERb+0x4d4)[0x684fe4]
llvm-ld(_ZN4llvm6Linker11LinkInFilesERKSt6vectorINS_3sys4PathESaIS3_EE+0x36)[0x68514a]
llvm-ld(main+0x359)[0x6628c9]
/lib/libc.so.6(__libc_start_main+0xe6)[0x7f537d3311a6]
llvm-ld(_ZNSt8ios_base4InitD1Ev+0x39)[0x65a0b9]
Aborted
--
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs