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

Xinfinity xinfinity_a at yahoo.com
Tue Nov 2 09:56:52 PDT 2010


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
-- 
View this message in context: http://old.nabble.com/%22multiple-definition-of-..-%22--in-clang-2.8-tp30085184p30115556.html
Sent from the LLVM - Dev mailing list archive at Nabble.com.




More information about the llvm-dev mailing list