[cfe-users] Trouble building clang trunk from source

Larry Evans cppljevans at suddenlink.net
Tue Jul 2 08:11:23 PDT 2013


On 07/02/13 09:52, Larry Evans wrote:
> On 06/18/13 16:16, Nathan Ridge wrote:
>> The 3.3 release works fine, by the way. Will use that for now.
>>
>> Thanks,
>> Nate 		 	   		  
>>
> Hi Nate,
> 
> I was also able to build using those same instructions:
> 
> http://clang.llvm.org/get_started.html
> 
> However, when using the newly built clang to compile,
> it worked OK; however, the link did not:
> 
> make -f simple.mk test
> /home/evansl/dwnlds/llvm/releases/3.3/out/Release+Asserts/build/Release+Asserts/bin/clang
> -c test.cpp
> /home/evansl/dwnlds/llvm/releases/3.3/out/Release+Asserts/build/Release+Asserts/bin/clang
> test.o -o test.exe
> test.o: In function `main':
> test.cpp:(.text+0xc): undefined reference to `std::cout'
> test.cpp:(.text+0x20): undefined reference to `std::basic_ostream<char,
> std::char_traits<char> >& std::operator<< <std::char_traits<char>
>> (std::basic_ostream<char, std::char_traits<char> >&, char const*)'
> test.o: In function `__cxx_global_var_init':
> test.cpp:(.text.startup+0x11): undefined reference to
> `std::ios_base::Init::Init()'
> test.cpp:(.text.startup+0x19): undefined reference to
> `std::ios_base::Init::~Init()'
> clang: error: linker command failed with exit code 1 (use -v to see
> invocation)
> make: *** [test] Error 1
> 
> Compilation exited abnormally with code 2 at Tue Jul  2 07:46:49
> 
> Anyone have any ideas whats missing.  Should I also run install as
> indicated here:
> 
> http://www.domaigne.com/blog/computing/install-latest-llvmclang-on-fedora/
> 
> ?
> 
Apparently running `make install` doesn't result in a usable clang
either:
--------------------------------

~/dwnlds/llvm/releases/3.3/out/Release+Asserts/build $ make install
llvm[0]: Installing include files
llvm[0]: Making install directory
/home/evansl/dwnlds/llvm/releases/3.3/out/Release+Asserts/build/../install/include/./llvm-c
llvm[0]: Making install directory
/home/evansl/dwnlds/llvm/releases/3.3/out/Release+Asserts/build/../install/include/./llvm-c/Transforms
llvm[0]: Making install directory
/home/evansl/dwnlds/llvm/releases/3.3/out/Release+Asserts/build/../install/in
.
.
.
make[2]: Leaving directory
`/home/evansl/dwnlds/llvm/releases/3.3/out/Release+Asserts/build/bindings/ocaml'
make[1]: Leaving directory
`/home/evansl/dwnlds/llvm/releases/3.3/out/Release+Asserts/build/bindings'
~/dwnlds/llvm/releases/3.3/out/Release+Asserts/build $ ls ../install
bin  docs  include  lib  share
~/dwnlds/llvm/releases/3.3/out/Release+Asserts/build $

----------------------------------
after which:
----------------------------------
make -f simple.mk test
/home/evansl/dwnlds/llvm/releases/3.3/out/Release+Asserts/install/bin/clang
-c test.cpp
/home/evansl/dwnlds/llvm/releases/3.3/out/Release+Asserts/install/bin/clang
test.o -o test.exe
test.o: In function `main':
test.cpp:(.text+0xc): undefined reference to `std::cout'
test.cpp:(.text+0x20): undefined reference to `std::basic_ostream<char,
std::char_traits<char> >& std::operator<< <std::char_traits<char>
>(std::basic_ostream<char, std::char_traits<char> >&, char const*)'
test.o: In function `__cxx_global_var_init':
test.cpp:(.text.startup+0x11): undefined reference to
`std::ios_base::Init::Init()'
test.cpp:(.text.startup+0x19): undefined reference to
`std::ios_base::Init::~Init()'
clang: error: linker command failed with exit code 1 (use -v to see
invocation)
make: *** [test] Error 1

Compilation exited abnormally with code 2 at Tue Jul  2 10:04:11
---------------------------------

Any clues as to what one should do to get a usable clang?

-regards,
Larry





More information about the cfe-users mailing list