Hi Jiao,<div><br></div><div>Well, I didn't try to compile with RTTI, but I had some time ago a very similar problem while linking the opt. In my case, I was not being able to create the shared library when enable-shared were passed through the configure script. I just had to realize that my default compiler was not being able to generate the binaries, probably because of its version (it was the stable llvm-gcc 4.1). Therefore, if I had compiled the llvm+clang from svn without the enable-shared flag, and installed it in some temp folder (configured in the PATH), I could use this one to configure and recompile the source with the flag enabled without this linkage error. I guess you could give it a try.</div>

<div><br></div><div>I hope this work to you too.<br clear="all"><br>--<br>Cristianno Martins<br>PhD Student of Computer Science<br>University of Campinas<br><a href="mailto:cmartins@ic.unicamp.br" target="_blank">cmartins@ic.unicamp.br</a><br>

<a href="mailto:cristiannomartins@hotmail.com" target="_blank"></a><br>
<br><br><div class="gmail_quote">On Thu, Apr 12, 2012 at 10:38 PM, Jiao Xianjun <span dir="ltr"><<a href="mailto:putaoshu@gmail.com">putaoshu@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

Hi<br><br>I am trying to use latest version of llvm and clang, and I have gotten them by svn.<br><br>./configure --enable-shared has run successfully, but make REQUIRES_RTTI=1 returns error:<br>make[2]: Entering directory `/home/ryjiao/Downloads/llvm-dev/llvm/tools/llvm-config'<br>


make[2]: Nothing to be done for `all'.<br>make[2]: Leaving directory `/home/ryjiao/Downloads/llvm-dev/llvm/tools/llvm-config'<br>make[2]: Entering directory `/home/ryjiao/Downloads/llvm-dev/llvm/tools/opt'<br>


llvm[2]: Compiling AnalysisWrappers.cpp for Debug+Asserts build<br>llvm[2]: Compiling GraphPrinters.cpp for Debug+Asserts build<br>llvm[2]: Compiling PrintSCC.cpp for Debug+Asserts build<br>llvm[2]: Compiling opt.cpp for Debug+Asserts build<br>


llvm[2]: Linking Debug+Asserts executable opt<br>/home/ryjiao/Downloads/llvm-dev/llvm/tools/opt/Debug+Asserts/opt.o: In function `llvm::cl::opt<std::string, false, llvm::cl::parser<std::string> >::opt<char [20], llvm::cl::desc, llvm::cl::value_desc, llvm::cl::initializer<char [1]> >(char const (&) [20], llvm::cl::desc const&, llvm::cl::value_desc const&, llvm::cl::initializer<char [1]> const&)':<br>


/home/ryjiao/Downloads/llvm-dev/llvm/include/llvm/Support/CommandLine.h:1200: undefined reference to `llvm::cl::opt<std::string, false, llvm::cl::parser<std::string> >::done()'<br>/home/ryjiao/Downloads/llvm-dev/llvm/tools/opt/Debug+Asserts/opt.o: In function `void llvm::cl::initializer<char [1]>::apply<llvm::cl::opt<std::string, false, llvm::cl::parser<std::string> > >(llvm::cl::opt<std::string, false, llvm::cl::parser<std::string> >&) const':<br>


/home/ryjiao/Downloads/llvm-dev/llvm/include/llvm/Support/CommandLine.h:292: undefined reference to `llvm::cl::opt<std::string, false, llvm::cl::parser<std::string> >::setInitialValue(std::string const&)'<br>


/home/ryjiao/Downloads/llvm-dev/llvm/tools/opt/Debug+Asserts/opt.o: In function `llvm::cl::opt<bool, false, llvm::cl::parser<bool> >::opt<char [30], llvm::cl::desc>(char const (&) [30], llvm::cl::desc const&)':<br>


/home/ryjiao/Downloads/llvm-dev/llvm/include/llvm/Support/CommandLine.h:1185: undefined reference to `llvm::cl::opt<bool, false, llvm::cl::parser<bool> >::done()'<br>/home/ryjiao/Downloads/llvm-dev/llvm/tools/opt/Debug+Asserts/opt.o: In function `llvm::cl::opt<bool, false, llvm::cl::parser<bool> >::opt<char [8], llvm::cl::desc>(char const (&) [8], llvm::cl::desc const&)':<br>


/home/ryjiao/Downloads/llvm-dev/llvm/include/llvm/Support/CommandLine.h:1185: undefined reference to `llvm::cl::opt<bool, false, llvm::cl::parser<bool> >::done()'<br>/home/ryjiao/Downloads/llvm-dev/llvm/tools/opt/Debug+Asserts/opt.o: In function `llvm::cl::opt<bool, false, llvm::cl::parser<bool> >::opt<char [2], llvm::cl::desc, llvm::cl::OptionHidden>(char const (&) [2], llvm::cl::desc const&, llvm::cl::OptionHidden const&)':<br>


/home/ryjiao/Downloads/llvm-dev/llvm/include/llvm/Support/CommandLine.h:1193: undefined reference to `llvm::cl::opt<bool, false, llvm::cl::parser<bool> >::done()'<br>/home/ryjiao/Downloads/llvm-dev/llvm/tools/opt/Debug+Asserts/opt.o: In function `llvm::cl::opt<bool, false, llvm::cl::parser<bool> >::opt<char [26], llvm::cl::desc>(char const (&) [26], llvm::cl::desc const&)':<br>


/home/ryjiao/Downloads/llvm-dev/llvm/include/llvm/Support/CommandLine.h:1185: undefined reference to `llvm::cl::opt<bool, false, llvm::cl::parser<bool> >::done()'<br>/home/ryjiao/Downloads/llvm-dev/llvm/tools/opt/Debug+Asserts/opt.o: In function `llvm::cl::opt<bool, false, llvm::cl::parser<bool> >::opt<char [16], llvm::cl::desc, llvm::cl::initializer<bool> >(char const (&) [16], llvm::cl::desc const&, llvm::cl::initializer<bool> const&)':<br>


/home/ryjiao/Downloads/llvm-dev/llvm/include/llvm/Support/CommandLine.h:1193: undefined reference to `llvm::cl::opt<bool, false, llvm::cl::parser<bool> >::done()'<br>/home/ryjiao/Downloads/llvm-dev/llvm/tools/opt/Debug+Asserts/opt.o: In function `void llvm::cl::initializer<bool>::apply<llvm::cl::opt<bool, false, llvm::cl::parser<bool> > >(llvm::cl::opt<bool, false, llvm::cl::parser<bool> >&) const':<br>


/home/ryjiao/Downloads/llvm-dev/llvm/include/llvm/Support/CommandLine.h:292: undefined reference to `llvm::cl::opt<bool, false, llvm::cl::parser<bool> >::setInitialValue(bool const&)'<br>/home/ryjiao/Downloads/llvm-dev/llvm/tools/opt/Debug+Asserts/opt.o: In function `llvm::cl::opt<bool, false, llvm::cl::parser<bool> >::opt<char [3], llvm::cl::desc>(char const (&) [3], llvm::cl::desc const&)':<br>


/home/ryjiao/Downloads/llvm-dev/llvm/include/llvm/Support/CommandLine.h:1185: undefined reference to `llvm::cl::opt<bool, false, llvm::cl::parser<bool> >::done()'<br>/home/ryjiao/Downloads/llvm-dev/llvm/tools/opt/Debug+Asserts/opt.o: In function `llvm::cl::opt<bool, false, llvm::cl::parser<bool> >::opt<char [14], llvm::cl::desc>(char const (&) [14], llvm::cl::desc const&)':<br>


/home/ryjiao/Downloads/llvm-dev/llvm/include/llvm/Support/CommandLine.h:1185: undefined reference to `llvm::cl::opt<bool, false, llvm::cl::parser<bool> >::done()'<br>/home/ryjiao/Downloads/llvm-dev/llvm/tools/opt/Debug+Asserts/opt.o: In function `llvm::cl::opt<bool, false, llvm::cl::parser<bool> >::opt<char [20], llvm::cl::desc>(char const (&) [20], llvm::cl::desc const&)':<br>


/home/ryjiao/Downloads/llvm-dev/llvm/include/llvm/Support/CommandLine.h:1185: undefined reference to `llvm::cl::opt<bool, false, llvm::cl::parser<bool> >::done()'<br>/home/ryjiao/Downloads/llvm-dev/llvm/tools/opt/Debug+Asserts/opt.o: In function `llvm::cl::opt<bool, false, llvm::cl::parser<bool> >::opt<char [17], llvm::cl::desc>(char const (&) [17], llvm::cl::desc const&)':<br>


/home/ryjiao/Downloads/llvm-dev/llvm/include/llvm/Support/CommandLine.h:1185: undefined reference to `llvm::cl::opt<bool, false, llvm::cl::parser<bool> >::done()'<br>/home/ryjiao/Downloads/llvm-dev/llvm/tools/opt/Debug+Asserts/opt.o: In function `llvm::cl::opt<bool, false, llvm::cl::parser<bool> >::opt<char [12], llvm::cl::desc>(char const (&) [12], llvm::cl::desc const&)':<br>


/home/ryjiao/Downloads/llvm-dev/llvm/include/llvm/Support/CommandLine.h:1185: undefined reference to `llvm::cl::opt<bool, false, llvm::cl::parser<bool> >::done()'<br>/home/ryjiao/Downloads/llvm-dev/llvm/tools/opt/Debug+Asserts/opt.o:/home/ryjiao/Downloads/llvm-dev/llvm/include/llvm/Support/CommandLine.h:1193: more undefined references to `llvm::cl::opt<bool, false, llvm::cl::parser<bool> >::done()' follow<br>


/home/ryjiao/Downloads/llvm-dev/llvm/tools/opt/Debug+Asserts/opt.o: In function `llvm::cl::opt<std::string, false, llvm::cl::parser<std::string> >::opt<char [2], llvm::cl::desc, llvm::cl::value_desc>(char const (&) [2], llvm::cl::desc const&, llvm::cl::value_desc const&)':<br>


/home/ryjiao/Downloads/llvm-dev/llvm/include/llvm/Support/CommandLine.h:1193: undefined reference to `llvm::cl::opt<std::string, false, llvm::cl::parser<std::string> >::done()'<br>/home/ryjiao/Downloads/llvm-dev/llvm/tools/opt/Debug+Asserts/opt.o: In function `llvm::cl::opt<std::string, false, llvm::cl::parser<std::string> >::opt<llvm::cl::FormattingFlags, llvm::cl::desc, llvm::cl::initializer<char [2]>, llvm::cl::value_desc>(llvm::cl::FormattingFlags const&, llvm::cl::desc const&, llvm::cl::initializer<char [2]> const&, llvm::cl::value_desc const&)':<br>


/home/ryjiao/Downloads/llvm-dev/llvm/include/llvm/Support/CommandLine.h:1200: undefined reference to `llvm::cl::opt<std::string, false, llvm::cl::parser<std::string> >::done()'<br>/home/ryjiao/Downloads/llvm-dev/llvm/tools/opt/Debug+Asserts/opt.o: In function `void llvm::cl::initializer<char [2]>::apply<llvm::cl::opt<std::string, false, llvm::cl::parser<std::string> > >(llvm::cl::opt<std::string, false, llvm::cl::parser<std::string> >&) const':<br>


/home/ryjiao/Downloads/llvm-dev/llvm/include/llvm/Support/CommandLine.h:292: undefined reference to `llvm::cl::opt<std::string, false, llvm::cl::parser<std::string> >::setInitialValue(std::string const&)'<br>


clang: error: linker command failed with exit code 1 (use -v to see invocation)<br>make[2]: *** [/home/ryjiao/Downloads/llvm-dev/llvm/Debug+Asserts/bin/opt] Error 1<br>make[2]: Leaving directory `/home/ryjiao/Downloads/llvm-dev/llvm/tools/opt'<br>


make[1]: *** [opt/.makeall] Error 2<br>make[1]: Leaving directory `/home/ryjiao/Downloads/llvm-dev/llvm/tools'<br>make: *** [all] Error 1<br><br>Is there anyone who has ever encountered this problem?<br>Thank you!<br>


<br>BR<span class="HOEnZb"><font color="#888888"><br><br>Jiao Xianjun<br><br>
</font></span><br>_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
<br></blockquote></div><br></div>