[LLVMdev] "multiple definition of .. " in clang 2.8

Dale Johannesen dalej at apple.com
Wed Nov 3 13:13:46 PDT 2010


It appears you filed PR 8538 about this, but didn't cc yourself.  You should look at it; I don't think this is a clang problem.
> It seems that the problem occurs from the optimization level. In the 2.7
> version I was using -O0 and in 2.8 I tested the same benchmarks with -O3.
> 
> clang -O0 works fine, while clang -O3 makes redefinitions (probably it is
> related to inlining) of the functions from stdlib.h, math.h and some other
> libraries. To give one example, function atoi is defined in the generated
> *.ll file: 
> 
> define i32 @atoi(i8* %__nptr) nounwind inlinehint {
> entry:
>   %call = tail call i64 @strtol(i8* nocapture %__nptr, i8** null, i32 10)
> nounwind readonly
>   %conv = trunc i64 %call to i32
>   ret i32 %conv
> }
> 
> although it is not defined in the original C file.
> 
> And clang redefines it in all the *.ll files it generates, from each C file
> in the perlbench (SPEC CPU 2006).
> 
> Similarly for all the other functions, which appear in the end to be
> redefined and give errors.
> 
> Am I on the right track with this errors? I need to use the -O3 optimization
> level in my tests, so how can I avoid this problem?
> 
> Alexandra
> -- 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20101103/aa0f644c/attachment.html>


More information about the llvm-dev mailing list