What configure options should I use to build clang with clang?

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

What configure options should I use to build clang with clang?

crazygamealexs
I having a hard time try to get it to build itself so can anyone help me here?

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: What configure options should I use to build clang with clang?

Zhongxing Xu
./configure CXX=clang++

On Tue, Sep 7, 2010 at 9:32 AM, <[hidden email]> wrote:
I having a hard time try to get it to build itself so can anyone help me here?

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev



_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: What configure options should I use to build clang with clang?

crazygamealexs
 

Sent: Tuesday, September 07, 2010 12:00 AM
Subject: Re: [cfe-dev] What configure options should I use to build clang with clang?

./configure CXX=clang++

On Tue, Sep 7, 2010 at 9:32 AM, <[hidden email]> wrote:
I having a hard time try to get it to build itself so can anyone help me here?

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev

I already try that. it didn't work because it fails to configure. (configure can't find header files, I try it with gcc headers and it didn't work ether)

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: What configure options should I use to build clang with clang?

Eric Christopher-2

On Sep 7, 2010, at 3:11 PM, [hidden email] wrote:

>  
>
> From: Zhongxing Xu
> Sent: Tuesday, September 07, 2010 12:00 AM
> To: [hidden email]
> Cc: [hidden email]
> Subject: Re: [cfe-dev] What configure options should I use to build clang with clang?
>
> ./configure CXX=clang++
>
> On Tue, Sep 7, 2010 at 9:32 AM, <[hidden email]> wrote:
> I having a hard time try to get it to build itself so can anyone help me here?
>
> _______________________________________________
> cfe-dev mailing list
> [hidden email]
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
> I already try that. it didn't work because it fails to configure. (configure can't find header files, I try it with gcc headers and it didn't work ether)

Can you compile hello world?

-eric


_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: What configure options should I use to build clang with clang?

crazygamealexs
In reply to this post by crazygamealexs


--------------------------------------------------
From: "Dave Yost" <[hidden email]>
Sent: Tuesday, September 07, 2010 11:18 AM
To: <[hidden email]>
Subject: Re: [cfe-dev] What configure options should I use to build clang
with clang?

> Hi.
>
> Please let me know if you like the attached script.
>
> Dave
1. I not running a mac I running on windows with a cygwin environment.
2. It doesn't dictated an existing llvm folder.

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: What configure options should I use to build clang with clang?

crazygamealexs
In reply to this post by Eric Christopher-2


--------------------------------------------------
From: "Eric Christopher" <[hidden email]>
Sent: Tuesday, September 07, 2010 6:04 PM
To: <[hidden email]>
Subject: Re: [cfe-dev] What configure options should I use to build clangwithclang?

>>>
>> Can't.... here is the source
>> #include <iostream>
>> using namespace std;
>>
>> int main ()
>> {
>> cout << "Hello World!";
>> return 0;
>> }
>> and here is the error message
>> $ clang++ -I /usr/lib/gcc/i686-pc-cygwin/4.3.4/include/c++ -I
>> /usr/lib/gcc/i686
>> -pc-cygwin/4.3.4/include/c++/i686-pc-cygwin -I
>> /usr/lib/gcc/i686-pc-cygwin/4.3.
>> 4/include/c++/backward -I /usr/lib/gcc/i686-pc-cygwin/4.3.4/include -I
>> /usr/lib
>> /gcc/i686-pc-cygwin/4.3.4/include-fixed -I
>> /usr/lib/gcc/i686-pc-cygwin/4.3.4/..
>> /../../../include/w32api new.cpp
>> /usr/lib/gcc/i686-pc-cygwin/4.3.4/../../../../i686-pc-cygwin/bin/ld:
>> Warning: ty
>> pe of symbol `_main' changed from 32 to 512 in /tmp/cc-U9uwEP.o
>> /tmp/cc-U9uwEP.o:fake:(.text+0x14): undefined reference to
>> `___dso_handle'
>> /tmp/cc-U9uwEP.o:fake:(.text+0x3e): undefined reference to
>> `___cxa_atexit'
>> collect2: ld returned 1 exit status
>> clang: error: linker (via gcc) command failed with exit code 1 (use -v to
>> see in
>> vocation)
>
> Your obvious need for all of those -I command line options means that
> there is something incorrect in the search paths to find the header files
> on your host.
>
> You need a compiler that will just work like:
>
> clang++ hello.cc -o hello
>
> and have that just work.
>
> Until then it doesn't matter what you pass to configure - you won't be
> able to compile clang with clang.
>
> -eric
Your not helping at all. Your just restating the problem that I'm having.
Yes clang doesn't include the headers by default, but what I can do about
it?  I just recently try rebuilding it with --with-cxx-include-root
configure on and it still doesn't search for the header files by default. On
the"getting started" one of the solutions is so vague when it says "changes
the lines below to include that path". What changes exactly? Any examples?

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: What configure options should I use to build clang with clang?

Eric Christopher-2
>>>
>>
>> Your obvious need for all of those -I command line options means that there is something incorrect in the search paths to find the header files on your host.
>>
>> You need a compiler that will just work like:
>>
>> clang++ hello.cc -o hello
>>
>> and have that just work.
>>
>> Until then it doesn't matter what you pass to configure - you won't be able to compile clang with clang.
>>
>> -eric
> Your not helping at all. Your just restating the problem that I'm having. Yes clang doesn't include the headers by default, but what I can do about it?  I just recently try rebuilding it with --with-cxx-include-root configure on and it still doesn't search for the header files by default. On the"getting started" one of the solutions is so vague when it says "changes the lines below to include that path". What changes exactly? Any examples?

You will likely need to modify clang to use the headers on your system.  Take a look your sources for areas that look like the header paths you're including.  I don't have a cygwin system handy so I don't know what those are.  You may need to modify lib/Frontend/InitHeaderSearch.cpp to contain the correct values.

Otherwise you haven't included any commands you may have used to configure so I don't know what you've done wrong if anything.

You also need to likely specify a link path if the system g++ doesn't know how to link against the installed libstdc++ - the error that you have seems to indicate that your c++ library was compiled without cxa_atexit while your compiler thinks that you have it.  I don't know what to do about that offhand, you'll probably need to debug the process yourself some.

Good luck.

-eric



_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: What configure options should I use to build clang with clang?

Bill Wendling
In reply to this post by crazygamealexs
On Sep 7, 2010, at 6:03 PM, [hidden email] wrote:

Your not helping at all. Your just restating the problem that I'm having.
Yes clang doesn't include the headers by default, but what I can do about
it?  I just recently try rebuilding it with --with-cxx-include-root
configure on and it still doesn't search for the header files by default. On
the"getting started" one of the solutions is so vague when it says "changes
the lines below to include that path". What changes exactly? Any examples?

Read the message again. It's telling you to modify the clang sources and implement a "hack" by changing the lines to include the path to the correct C++ header files. The command in the first sub-bullet tells you how to get the paths to put in that file.

You realize of course that you'll have to first build clang++ again with your system compiler before you can build clang with clang.

-bw

  1. If you intend to work on Clang C++ support, you may need to tell it how to find your C++ standard library headers. If Clang cannot find your system libstdc++ headers, please follow these instructions:
    • 'gcc -v -x c++ /dev/null -fsyntax-only' to get the path.
    • Look for the comment "FIXME: temporary hack: hard-coded paths" inclang/lib/Frontend/InitHeaderSearch.cpp and change the lines below to include that path.


_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev