<div dir="ltr">I've submitted this patch in r212665, thanks!<div><br></div><div class="gmail_extra"><div class="gmail_quote">On Tue, Jul 8, 2014 at 10:38 AM, Justin Bogner <span dir="ltr"><<a href="mailto:mail@justinbogner.com" target="_blank">mail@justinbogner.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="">p2282 <<a href="mailto:ganesh.faq@gmail.com">ganesh.faq@gmail.com</a>> writes:<br>
> Hi all,<br>
><br>
> I am facing following error with "-fprofile-instr-generate".<br>
> Please let me know your inputs to resolve this error<br>
<br>
</div>It looks like compiler-rt's configure + make build isn't set up build<br>
the profile libraries on linux. Taking a look at the FUNCTIONS.profile<br>
variables in make/platform/<a href="http://clang_linux.mk" target="_blank">clang_linux.mk</a> compared to those in<br>
<a href="http://clang_darwin.mk" target="_blank">clang_darwin.mk</a>, I guess that something like the following (untested)<br>
patch would help.<br>
<br>
<br><br>
Alternatively, you can probably get this working by using cmake rather<br>
than configure.<br></blockquote><div><br></div><div>But, yes, please use CMake instead. It's better maintained at the moment.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<br>
> Thanks,<br>
><br>
> *Error:*<br>
> export PATH=/home/user/llvm_install/bin:$PATH<br>
> export LD_LIBRARY_PATH=/home/user/llvm_install/lib<br>
> $ clang++ -O2 -fprofile-instr-generate hello.cpp<br>
> /tmp/hello-58ef5f.o:hello.cpp:function __llvm_profile_init: error: undefined<br>
> reference to '__llvm_profile_register_function'<br>
> /tmp/hello-58ef5f.o:hello.cpp:function __llvm_profile_init: error: undefined<br>
> reference to '__llvm_profile_register_function'<br>
> /tmp/hello-58ef5f.o:hello.cpp:function __llvm_profile_init: error: undefined<br>
> reference to '__llvm_profile_register_function'<br>
> /tmp/hello-58ef5f.o:hello.cpp:function __llvm_profile_init: error: undefined<br>
> reference to '__llvm_profile_register_function'<br>
> /tmp/hello-58ef5f.o:hello.cpp:function __llvm_profile_runtime_user: error:<br>
> undefined reference to '__llvm_profile_runtime'<br>
> clang: error: linker command failed with exit code 1 (use -v to see<br>
> invocation)<br>
><br>
> *Above error says , 'use -v'. Output of -v is as follows*<br>
> --snip start--<br>
> "/usr/local/bin/ld" -z relro --hash-style=gnu --build-id --eh-frame-hdr -m<br>
> elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 -o a.out<br>
> /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/crt1.o<br>
> /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/crti.o<br>
> /usr/lib/gcc/x86_64-linux-gnu/4.8/crtbegin.o<br>
> -L/usr/lib/gcc/x86_64-linux-gnu/4.8<br>
> -L/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu<br>
> -L/lib/x86_64-linux-gnu -L/lib/../lib64 -L/usr/lib/x86_64-linux-gnu<br>
> -L/usr/lib/gcc/x86_64-linux-gnu/4.8/../../.. -L/home/LLVM_install/bin/../lib<br>
> -L/lib -L/usr/lib /tmp/hello-c8552f.o<br>
> */home/LLVM_install/bin/../lib/clang/3.5.0/lib/linux/libclang_rt.profile-x86_64.a*<br>
> -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc<br>
> /usr/lib/gcc/x86_64-linux-gnu/4.8/crtend.o<br>
> /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/crtn.o<br>
> /tmp/hello-c8552f.o:hello.cpp:function __llvm_profile_init: error: undefined<br>
> reference to '__llvm_profile_register_function'<br>
> /tmp/hello-c8552f.o:hello.cpp:function __llvm_profile_init: error: undefined<br>
> reference to '__llvm_profile_register_function'<br>
> /tmp/hello-c8552f.o:hello.cpp:function __llvm_profile_init: error: undefined<br>
> reference to '__llvm_profile_register_function'<br>
> /tmp/hello-c8552f.o:hello.cpp:function __llvm_profile_init: error: undefined<br>
> reference to '__llvm_profile_register_function'<br>
> /tmp/hello-c8552f.o:hello.cpp:function __llvm_profile_runtime_user: error:<br>
> undefined reference to '__llvm_profile_runtime'<br>
> clang: error: linker command failed with exit code 1 (use -v to see<br>
> invocation)<br>
> --snip end--<br>
><br>
><br>
> *Clang version:* clang version 3.5.0 (<a href="http://llvm.org/git/clang.git841710be7cbcd4c5b6d355ffa37d2739b21b2fd8" target="_blank">http://llvm.org/git/clang.git841710be7cbcd4c5b6d355ffa37d2739b21b2fd8</a>) (<a href="http://llvm.org/git/llvm.git682e019983ba91576ecf02a0dd93edfde0d705f3" target="_blank">http://llvm.org/git/llvm.git682e019983ba91576ecf02a0dd93edfde0d705f3</a>)<br>

><br>
> *OS:* Ubuntu 14.04<br>
><br>
> *LD version:*GNU gold (GNU Binutils 2.24.51.20140522) 1.11<br>
><br>
> *LLVM Configure options:* configure --enable-profiling --enable-optimized<br>
> --enable-shared --disable-debug-runtime --enable-targets=all<br>
> --prefix=/home/user/llvm_install<br>
> --with-binutils-include=/gold_linker/binutils/include<br>
<br>_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr">Alexey Samsonov<br><a href="mailto:vonosmas@gmail.com" target="_blank">vonosmas@gmail.com</a></div>
</div></div>