a plea to change the default std lib clang adds if none is specified on the build line

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

a plea to change the default std lib clang adds if none is specified on the build line

Ken Cunningham
1 minute summary, no gobbledygook:


When clang sees a build line, if there is no -stdlib=Something specified, it adds -stdlib=libstdc++ on systems up to 10.8, and -stdlib=libc++ on 10.9 and above.

If the older OS is set up to use -stdlib=libc++, then all these ports break, and need painful manual shenanigans.


All this is rendered extinct if clang just defaults to add -stdlib=libc++ on all systems, if there is no -stdlib specified on the build line.


The fix that is needed in clang to accomplish this miraculous feat is literally one single character change.

<https://github.com/kencu/SnowLeopardPorts/blob/master/lang/llvm-5.0/files/9999-patch-clang-5.0-Toolchains-default-always-libcxx.diff>


Think of the tickets that might never need to be dealt with.

I would ask that we consider doing this once we default to libc++ on all clang-based systems.

Ken
Reply | Threaded
Open this post in threaded view
|

Re: a plea to change the default std lib clang adds if none is specified on the build line

Mojca Miklavec-2
On 12 March 2018 at 00:08, Kenneth F. Cunningham wrote:

> 1 minute summary, no gobbledygook:
>
> When clang sees a build line, if there is no -stdlib=Something specified, it adds -stdlib=libstdc++ on systems up to 10.8, and -stdlib=libc++ on 10.9 and above.
>
> If the older OS is set up to use -stdlib=libc++, then all these ports break, and need painful manual shenanigans.
>
>
> All this is rendered extinct if clang just defaults to add -stdlib=libc++ on all systems, if there is no -stdlib specified on the build line.
>
>
> The fix that is needed in clang to accomplish this miraculous feat is literally one single character change.
>
> <https://github.com/kencu/SnowLeopardPorts/blob/master/lang/llvm-5.0/files/9999-patch-clang-5.0-Toolchains-default-always-libcxx.diff>
>
>
> Think of the tickets that might never need to be dealt with.
>
> I would ask that we consider doing this once we default to libc++ on all clang-based systems.

I suggest that you put this patch under

    if this is 10.8 or lower
        if libc++ is set in configuration
            then use this patch

and submit a PR.

This is pretty similar to https://trac.macports.org/ticket/53634
except that I don't have a patch for that.

Mojca
Reply | Threaded
Open this post in threaded view
|

Re: a plea to change the default std lib clang adds if none is specified on the build line

Ken Cunningham

On 2018-03-11, at 5:39 PM, Mojca Miklavec wrote:

>
> This is pretty similar to https://trac.macports.org/ticket/53634
> except that I don't have a patch for that.
>
> Mojca

I think the clang'ers have taken care of that for you. They skipped making the default c++11 and jumped to c++14, though.

<https://reviews.llvm.org/D40948>

This is committed to trunk. I'm not sure if this made it into clang-6.0 or not, but there was a lot of talk about making sure it did.

Ken
Reply | Threaded
Open this post in threaded view
|

Re: a plea to change the default std lib clang adds if none is specified on the build line

Ken Cunningham

On 2018-03-11, at 8:07 PM, Kenneth F. Cunningham wrote:


> <https://reviews.llvm.org/D40948>
>
> This is committed to trunk. I'm not sure if this made it into clang-6.0 or not, but there was a lot of talk about making sure it did.
>

Must be.

That commit was r320250 and the current clang-6 svn is at r321774

Ken