Bug 600623 - clang doesn't find C++ Includes
clang doesn't find C++ Includes
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: llvm (Show other bugs)
13
All Linux
low Severity medium
: ---
: ---
Assigned To: Bryan O'Sullivan
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2010-06-05 05:45 EDT by Henry Rust
Modified: 2010-06-21 09:01 EDT (History)
4 users (show)

See Also:
Fixed In Version: llvm-2.7-5.fc12
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2010-06-18 06:16:41 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Henry Rust 2010-06-05 05:45:39 EDT
Description of problem:
If you try to compile a c++ program with clang it fails because clang doesn't find any c++ include files.

Version-Release number of selected component (if applicable):
clang-2.7-1

Steps to Reproduce:
1.try to compile a c++ program with clang
2.
3.
  
Actual results:
clang doesn't find the c++ Includes

Expected results:
clang should find the c++ Includes
Comment 1 Fedora Update System 2010-06-05 10:41:28 EDT
llvm-2.7-4.fc12 has been submitted as an update for Fedora 12.
http://admin.fedoraproject.org/updates/llvm-2.7-4.fc12
Comment 2 Fedora Update System 2010-06-05 10:41:33 EDT
llvm-2.7-4.fc13 has been submitted as an update for Fedora 13.
http://admin.fedoraproject.org/updates/llvm-2.7-4.fc13
Comment 3 Michel Alexandre Salim 2010-06-05 12:15:34 EDT
I took a look, and it turns out that Clang is right now hard-coded with include paths for various Linux distributions, and each compiler version/arch has to be added by hand.

I've added F-12/{x86_64,ppc} and F-13 (i686,x86_64,ppc) to the clang-2.7-4 update that will be out soon; the patch has been sent upstream too.
Comment 4 Fedora Update System 2010-06-10 03:24:23 EDT
llvm-2.7-5.fc13 has been submitted as an update for Fedora 13.
http://admin.fedoraproject.org/updates/llvm-2.7-5.fc13
Comment 5 Fedora Update System 2010-06-10 03:24:27 EDT
llvm-2.7-5.fc12 has been submitted as an update for Fedora 12.
http://admin.fedoraproject.org/updates/llvm-2.7-5.fc12
Comment 6 Fedora Update System 2010-06-10 15:09:48 EDT
llvm-2.7-5.fc13 has been pushed to the Fedora 13 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update llvm'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/llvm-2.7-5.fc13
Comment 7 Fedora Update System 2010-06-10 15:13:52 EDT
llvm-2.7-5.fc12 has been pushed to the Fedora 12 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update llvm'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/llvm-2.7-5.fc12
Comment 8 Henry Rust 2010-06-11 12:20:33 EDT
Just tested the version from the updates-testing repository.
It gives me the following output if I try to compile a Hello World program:

clang helloWorld.cpp -o helloWorld
/tmp/cc-APeGw4.o: In function `__cxx_global_var_init':
helloWorld.cpp:(.text+0x18): undefined reference to `std::ios_base::Init::Init()'
helloWorld.cpp:(.text+0x20): undefined reference to `std::ios_base::Init::~Init()'
/tmp/cc-APeGw4.o: In function `main':
helloWorld.cpp:(.text+0x63): undefined reference to `std::cout'
helloWorld.cpp:(.text+0x76): 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*)'
/tmp/cc-APeGw4.o:(.gnu.linkonce.r._ZTISt9basic_iosIcSt11char_traitsIcEE+0x0): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'
/tmp/cc-APeGw4.o:(.gnu.linkonce.r._ZTISt9basic_iosIcSt11char_traitsIcEE+0x10): undefined reference to `typeinfo for std::ios_base'
/tmp/cc-APeGw4.o:(.gnu.linkonce.r._ZTVSt9basic_iosIcSt11char_traitsIcEE+0x10): undefined reference to `std::basic_ios<char, std::char_traits<char> >::~basic_ios()'
/tmp/cc-APeGw4.o:(.gnu.linkonce.r._ZTVSt9basic_iosIcSt11char_traitsIcEE+0x18): undefined reference to `std::basic_ios<char, std::char_traits<char> >::~basic_ios()'
collect2: ld returned 1 exit status
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Comment 9 Michel Alexandre Salim 2010-06-17 18:10:39 EDT
(In reply to comment #8)
> Just tested the version from the updates-testing repository.
> It gives me the following output if I try to compile a Hello World program:
> 
> clang helloWorld.cpp -o helloWorld

You want to use clang++, not clang.

HTH,

-- 
Michel
Comment 10 Henry Rust 2010-06-18 06:16:41 EDT
Oh, my mistake. Everything works fine when I use clang++ instead clang.
Comment 11 Fedora Update System 2010-06-21 08:59:42 EDT
llvm-2.7-5.fc13 has been pushed to the Fedora 13 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 12 Fedora Update System 2010-06-21 09:00:56 EDT
llvm-2.7-5.fc12 has been pushed to the Fedora 12 stable repository.  If problems still persist, please make note of it in this bug report.

Note You need to log in before you can comment on or make changes to this bug.