Make error of latest devel version of llvm and clang

Hi

I am trying to use latest version of llvm and clang, and I have gotten them by svn.

./configure --enable-shared has run successfully, but make REQUIRES_RTTI=1 returns error:
make[2]: Entering directory /home/ryjiao/Downloads/llvm-dev/llvm/tools/llvm-config' make[2]: Nothing to be done for all’.
make[2]: Leaving directory /home/ryjiao/Downloads/llvm-dev/llvm/tools/llvm-config' make[2]: Entering directory /home/ryjiao/Downloads/llvm-dev/llvm/tools/opt’
llvm[2]: Compiling AnalysisWrappers.cpp for Debug+Asserts build
llvm[2]: Compiling GraphPrinters.cpp for Debug+Asserts build
llvm[2]: Compiling PrintSCC.cpp for Debug+Asserts build
llvm[2]: Compiling opt.cpp for Debug+Asserts build
llvm[2]: Linking Debug+Asserts executable opt
/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&)': /home/ryjiao/Downloads/llvm-dev/llvm/include/llvm/Support/CommandLine.h:1200: undefined reference to llvm::cl::opt<std::string, false, llvm::cl::parserstd::string >::done()’
/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': /home/ryjiao/Downloads/llvm-dev/llvm/include/llvm/Support/CommandLine.h:292: undefined reference to llvm::cl::opt<std::string, false, llvm::cl::parserstd::string >::setInitialValue(std::string const&)’
/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&)': /home/ryjiao/Downloads/llvm-dev/llvm/include/llvm/Support/CommandLine.h:1185: undefined reference to llvm::cl::opt<bool, false, llvm::cl::parser >::done()’
/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&)': /home/ryjiao/Downloads/llvm-dev/llvm/include/llvm/Support/CommandLine.h:1185: undefined reference to llvm::cl::opt<bool, false, llvm::cl::parser >::done()’
/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&)': /home/ryjiao/Downloads/llvm-dev/llvm/include/llvm/Support/CommandLine.h:1193: undefined reference to llvm::cl::opt<bool, false, llvm::cl::parser >::done()’
/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&)': /home/ryjiao/Downloads/llvm-dev/llvm/include/llvm/Support/CommandLine.h:1185: undefined reference to llvm::cl::opt<bool, false, llvm::cl::parser >::done()’
/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&)': /home/ryjiao/Downloads/llvm-dev/llvm/include/llvm/Support/CommandLine.h:1193: undefined reference to llvm::cl::opt<bool, false, llvm::cl::parser >::done()’
/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': /home/ryjiao/Downloads/llvm-dev/llvm/include/llvm/Support/CommandLine.h:292: undefined reference to llvm::cl::opt<bool, false, llvm::cl::parser >::setInitialValue(bool const&)’
/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&)': /home/ryjiao/Downloads/llvm-dev/llvm/include/llvm/Support/CommandLine.h:1185: undefined reference to llvm::cl::opt<bool, false, llvm::cl::parser >::done()’
/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&)': /home/ryjiao/Downloads/llvm-dev/llvm/include/llvm/Support/CommandLine.h:1185: undefined reference to llvm::cl::opt<bool, false, llvm::cl::parser >::done()’
/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&)': /home/ryjiao/Downloads/llvm-dev/llvm/include/llvm/Support/CommandLine.h:1185: undefined reference to llvm::cl::opt<bool, false, llvm::cl::parser >::done()’
/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&)': /home/ryjiao/Downloads/llvm-dev/llvm/include/llvm/Support/CommandLine.h:1185: undefined reference to llvm::cl::opt<bool, false, llvm::cl::parser >::done()’
/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&)': /home/ryjiao/Downloads/llvm-dev/llvm/include/llvm/Support/CommandLine.h:1185: undefined reference to llvm::cl::opt<bool, false, llvm::cl::parser >::done()’
/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 /home/ryjiao/Downloads/llvm-dev/llvm/tools/opt/Debug+Asserts/opt.o: In function llvm::cl::opt<std::string, false, llvm::cl::parserstd::string >::opt<char [2], llvm::cl::desc, llvm::cl::value_desc>(char const (&) [2], llvm::cl::desc const&, llvm::cl::value_desc const&)‘:
/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()' /home/ryjiao/Downloads/llvm-dev/llvm/tools/opt/Debug+Asserts/opt.o: In function llvm::cl::opt<std::string, false, llvm::cl::parserstd::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&)’:
/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()' /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::parserstd::string > >(llvm::cl::opt<std::string, false, llvm::cl::parserstd::string >&) const’:
/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&)' clang: error: linker command failed with exit code 1 (use -v to see invocation) make[2]: *** [/home/ryjiao/Downloads/llvm-dev/llvm/Debug+Asserts/bin/opt] Error 1 make[2]: Leaving directory /home/ryjiao/Downloads/llvm-dev/llvm/tools/opt’
make[1]: *** [opt/.makeall] Error 2
make[1]: Leaving directory `/home/ryjiao/Downloads/llvm-dev/llvm/tools’
make: *** [all] Error 1

Is there anyone who has ever encountered this problem?
Thank you!

BR

Jiao Xianjun

Hi Jiao,

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.

I hope this work to you too.

You mean that building llvm withou enable-shared option, and then build llvm again with the llvm-clang tool chain which is built just now?

What’s the last tool you use to build llvm? llvm-gcc? llvm-clang?

I have try kinds of devel revisions of llvm and clang and kinds of method, it doesn’t work.
But I can build released llvm 3.0 smoothly. Anyone has any ideas?

Thanks!