[cfe-users] Building llvm/clang with another version of clang

David Blaikie dblaikie at gmail.com
Sat Jan 5 16:30:34 PST 2013


On Sat, Jan 5, 2013 at 3:08 PM, Edward Diener
<eldlistmailingz at tropicsoft.com> wrote:
> On 01/05/2013 01:18 PM, Dmitri Gribenko wrote:
>>
>> On Sat, Jan 5, 2013 at 7:58 PM, Edward Diener
>> <eldlistmailingz at tropicsoft.com>  wrote:
>>>
>>> On 01/05/2013 09:16 AM, Dmitri Gribenko wrote:
>>>>
>>>> On Sat, Jan 5, 2013 at 7:31 AM, Edward Diener
>>>> <eldlistmailingz at tropicsoft.com>  wrote:
>>>>>
>>>>> Is it possible to build llvm/clang with a previous version of clang
>>>>> installed as a binary ? If so, how do I get llvm/configure to use the
>>>>> binary
>>>>> version of clang rather than gcc to build the latest version of
>>>>> llvm/clang ?
>>>>
>>>>
>>>> configure (but not CMake) will check for 'clang' in PATH and prefer to
>>>> use it instead of 'gcc' or 'cc'.  So just ensure that the previous
>>>> version of clang is in your PATH.
>>>
>>>
>>> Yes, I discovered this. This contradicts what LLVM has in its own
>>> getting started page at
>>> http://llvm.org/docs/GettingStarted.html#local-llvm-configuration.
>>
>>
>> I have updated docs now.
>
>
> Thanks !
>
>
>>
>>> Doesn't the clang 3.0 binaries ship with its own version of the C++ and
>>> C header files ?
>>
>>
>> No, clang does not include a complete standard library.  It does
>> include a few system headers
>> (clang-installation-dir/lib/clang/3.3/include), but that is not a
>> complete standard library.
>
>
> That is really a shame. Relying on some version of clang, whether built or
> distributed as a binary, working with whatever headers and libraries are
> used with the version of gcc installed does not seem a good way to do things
> to me. I sincerely hope that clang changes this.
>
> I know it is a ton of work for clang to develop its own headers/libraries
> but I believe that each clang version should at least be distributed and/or
> built with a version of gcc's header/libraries with which it is guaranteed
> to work and that running clang will always use those correct
> headers/libraries no matter what headers/libraries a particular version of
> gcc comes with.

Note that GCC doesn't do this either: you'll see that your system has
separate packages for g++ and for libstdc++.



More information about the cfe-users mailing list