Bug 600623 - clang doesn't find C++ Includes
Summary: clang doesn't find C++ Includes
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: llvm   
(Show other bugs)
Version: 13
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Bryan O'Sullivan
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-06-05 09:45 UTC by Henry Rust
Modified: 2010-06-21 13:01 UTC (History)
4 users (show)

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


Attachments (Terms of Use)

Description Henry Rust 2010-06-05 09:45:39 UTC
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 14:41:28 UTC
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 14:41:33 UTC
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 16:15:34 UTC
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 07:24:23 UTC
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 07:24:27 UTC
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 19:09:48 UTC
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 19:13:52 UTC
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 16:20:33 UTC
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 22:10:39 UTC
(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 10:16:41 UTC
Oh, my mistake. Everything works fine when I use clang++ instead clang.

Comment 11 Fedora Update System 2010-06-21 12:59:42 UTC
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 13:00:56 UTC
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.