[cfe-dev] __attribute__((alias))

Nuno Lopes nunoplopes at sapo.pt
Sat Jul 5 12:24:25 PDT 2008


Hi,

Some time ago I added support for __attribute__((alias)). However it is not 
working when referencing an aliased function from a different file where it 
was defined.
Take a look at this example:

foo.ll:
declare void @zend_error(i32, i8*, ...)
;declare void @zend_error_noreturn(i32, i8*, ...) noreturn
@zend_error_noreturn = alias void (i32, i8*, ...)* @zend_error  ; <void 
(i32, i8*, ...)*> [#uses=0]


bar.ll:
declare void @zend_error_noreturn(i32, i8*, ...) noreturn

linking those files leads to:
llvm-as foo.ll; llvm-as bar.ll
llvm-ld -native -o xpto foo.bc bar.bc

llvm-ld: LinkModules.cpp:425: void ForceRenaming(llvm::GlobalValue*, const 
std::string&): Assertion `ConflictGV->hasInternalLinkage() && "Not 
conflicting with a static global, should link instead!"' failed.

If you uncomment the 2nd line of foo.ll it doesn't trigger that exception. 
Is this a bug in the linker or should clang generate the extra declaration?

Nuno

P.S.: after fixing this problem, PHP should finally compile :-) 




More information about the cfe-dev mailing list