r193934 - Default to use libc++ on OS X 10.9+ and iOS 7+.

Timur Iskhodzhanov timurrrr at google.com
Tue Feb 4 14:32:03 PST 2014


2014-02-04 Justin Bogner <mail at justinbogner.com>:
> I'm assuming you have libcxx checked out in projects/ of the LLVM
> repository.

No, I don't think so.
This isn't documented, right?

> Is this clang 3.4 or ToT? The cmake build installed the libc++ headers
> in a different directory (lib/) than clang looked for them in (include/)
> before r194834.

I'm on ToT.

> Timur Iskhodzhanov <timurrrr at google.com> writes:
>> Please see
>> http://llvm.org/bugs/show_bug.cgi?id=17821#c7
>>
>> I don't know what to write in a patch as I can't get a build working for me yet.
>> That means either
>> a) something's broken
>> b) something's not documented well
>> c) I missed some important how-to announcement regarding building on
>> 10.9 with Xcode 5
>>
>> 2014-02-04 Bob Wilson <bob.wilson at apple.com>:
>>> Would you like to contribute a patch to clarify that documentation?
>>> I’m not sure what you’re asking for here.
>>>
>>> On Feb 4, 2014, at 12:20 PM, Timur Iskhodzhanov <timurrrr at google.com> wrote:
>>>
>>>> ping?
>>>>
>>>> I've spent a fair amount of time debugging this yesterday.
>>>>
>>>> 2013-11-05 Nico Weber <thakis at chromium.org>:
>>>>> On Tue, Nov 5, 2013 at 9:44 AM, Bob Wilson <bob.wilson at apple.com> wrote:
>>>>>>
>>>>>> On OS X the libc++ headers are meant to be installed along with clang.  If
>>>>>> you check out the libc++ sources in the LLVM projects directory,
>>>>>> they should
>>>>>> be installed in the right place.
>>>>>
>>>>>
>>>>> Thanks, that makes sense. Should http://clang.llvm.org/get_started.html>>> mention checking out libc++, since it sounds that's now a requirement on OS
>>>>> X?
>>>>>
>>>>>>
>>>>>>
>>>>>> On Nov 5, 2013, at 9:42 AM, Howard Hinnant <hhinnant at apple.com> wrote:
>>>>>>
>>>>>>> When I use tot clang, (and want libc++), I will forbid clang from
>>>>>>> looking the std::headers, and then tell it exactly where the headers are,
>>>>>>> e.g.:
>>>>>>>
>>>>>>> $ clang++ -stdlib=libc++ -std=c++11 -nostdinc++ -I../libcxx/include
>>>>>>> test.cpp
>>>>>>>
>>>>>>> Howard
>>>>>>>
>>>>>>> On Nov 5, 2013, at 12:35 PM, Nico Weber <thakis at chromium.org> wrote:
>>>>>>>
>>>>>>>> In addition to the performance issues, libc++ apparently can't be found
>>>>>>>> by clang: http://llvm.org/bugs/show_bug.cgi?id=17821>>>>>>
>>>>>>>>
>>>>>>>> On Sat, Nov 2, 2013 at 10:35 PM, Bob Wilson <bob.wilson at apple.com>
>>>>>>>> wrote:
>>>>>>>> I’m not familiar with those performance issues, so I’m CC’ing Howard in
>>>>>>>> case he can provide any details on those issues.  In general,
>>>>>>>> we’re in the
>>>>>>>> process of migrating away from libstdc++ on OS X and iOS, so we really do
>>>>>>>> want the default to be libc++ regardless of the language mode.
>>>>>>>> If you have
>>>>>>>> particularly performance sensitive code, you can always choose to use
>>>>>>>> libstdc++.
>>>>>>>>
>>>>>>>> On Nov 2, 2013, at 7:05 PM, Nico Weber <thakis at chromium.org> wrote:
>>>>>>>>
>>>>>>>>> Thanks for upstreaming this!
>>>>>>>>>
>>>>>>>>> Should this only happen in C++11 mode? libc++ seems to be measurably
>>>>>>>>> slower than libstdc++ in C++03 mode (PR17703, PR14554, PR14555).
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> On Sat, Nov 2, 2013 at 4:19 PM, Bob Wilson <bob.wilson at apple.com>
>>>>>>>>> wrote:
>>>>>>>>> Author: bwilson
>>>>>>>>> Date: Sat Nov  2 18:19:53 2013
>>>>>>>>> New Revision: 193934
>>>>>>>>>
>>>>>>>>> URL: http://llvm.org/viewvc/llvm-project?rev=193934&view=rev>>>>>>> Log:
>>>>>>>>> Default to use libc++ on OS X 10.9+ and iOS 7+.
>>>>>>>>>
>>>>>>>>> Modified:
>>>>>>>>>   cfe/trunk/lib/Driver/ToolChains.cpp
>>>>>>>>>   cfe/trunk/test/PCH/cxx-typeid.cpp
>>>>>>>>>
>>>>>>>>> Modified: cfe/trunk/lib/Driver/ToolChains.cpp
>>>>>>>>> URL:
>>>>>>>>> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains.cpp?rev=193934&r1=193933&r2=193934&view=diff>>>>>>>
>>>>>>>>> ==============================================================================
>>>>>>>>> --- cfe/trunk/lib/Driver/ToolChains.cpp (original)
>>>>>>>>> +++ cfe/trunk/lib/Driver/ToolChains.cpp Sat Nov  2 18:19:53 2013
>>>>>>>>> @@ -839,6 +839,12 @@ DerivedArgList *Darwin::TranslateArgs(co
>>>>>>>>>    }
>>>>>>>>>  }
>>>>>>>>>
>>>>>>>>> +  // Default to use libc++ on OS X 10.9+ and iOS 7+.
>>>>>>>>> +  if (((isTargetMacOS() && !isMacosxVersionLT(10, 9)) ||
>>>>>>>>> +       (isTargetIPhoneOS() && !isIPhoneOSVersionLT(7, 0))) &&
>>>>>>>>> +      !Args.getLastArg(options::OPT_stdlib_EQ))
>>>>>>>>> +    DAL->AddJoinedArg(0, Opts.getOption(options::OPT_stdlib_EQ),
>>>>>>>>> "libc++");
>>>>>>>>> +
>>>>>>>>>  // Validate the C++ standard library choice.
>>>>>>>>>  CXXStdlibType Type = GetCXXStdlibType(*DAL);
>>>>>>>>>  if (Type == ToolChain::CST_Libcxx) {
>>>>>>>>>
>>>>>>>>> Modified: cfe/trunk/test/PCH/cxx-typeid.cpp
>>>>>>>>> URL:
>>>>>>>>> http://llvm.org/viewvc/llvm-project/cfe/trunk/test/PCH/cxx-typeid.cpp?rev=193934&r1=193933&r2=193934&view=diff>>>>>>>
>>>>>>>>> ==============================================================================
>>>>>>>>> --- cfe/trunk/test/PCH/cxx-typeid.cpp (original)
>>>>>>>>> +++ cfe/trunk/test/PCH/cxx-typeid.cpp Sat Nov  2 18:19:53 2013
>>>>>>>>> @@ -1,8 +1,8 @@
>>>>>>>>> // Test this without pch.
>>>>>>>>> -// RUN: %clang_cc1 -include %S/cxx-typeid.h -fsyntax-only -verify %s
>>>>>>>>> +// RUN: %clang_cc1 -include %S/cxx-typeid.h -fsyntax-only
>>>>>>>>> -stdlib=libstdc++ -verify %s
>>>>>>>>>
>>>>>>>>> -// RUN: %clang_cc1 -x c++-header -emit-pch -o %t.pch %S/cxx-typeid.h
>>>>>>>>> -// RUN: %clang_cc1 -include-pch %t.pch -fsyntax-only -verify %s
>>>>>>>>> +// RUN: %clang_cc1 -x c++-header -emit-pch -stdlib=libstdc++ -o
>>>>>>>>> %t.pch %S/cxx-typeid.h
>>>>>>>>> +// RUN: %clang_cc1 -include-pch %t.pch -fsyntax-only
>>>>>>>>> -stdlib=libstdc++ -verify %s
>>>>>>>>>
>>>>>>>>> // expected-no-diagnostics
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> _______________________________________________
>>>>>>>>> cfe-commits mailing list
>>>>>>>>> cfe-commits at cs.uiuc.edu
>>>>>>>>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> cfe-commits mailing list
>>>>> cfe-commits at cs.uiuc.edu
>>>>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits>>>
>>>
>>
>> _______________________________________________
>> cfe-commits mailing list
>> cfe-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits




More information about the cfe-commits mailing list