Hi Iain,

May I ask why we need to specify  --with-gxx-libcxx-include-dir= at
compile/configure time of GCC? While in clang equivalent, -stdlib= doesn't
require so.

thanks,
Shivam

On Sat, Apr 2, 2022 at 7:32 PM Shivam Gupta <shivam98....@gmail.com> wrote:

> Hi Iain,
>
> Thank you for the quick response and the effort to make that feature
> available.
>
> When I reconfigured/build GCC
> with --with-gxx-libcxx-include-dir=/usr/include/c++/v1/ , -stdlib= option
> is now available to take libc++.
>
> thanks,
> Shivam.
>
> On Sat, Apr 2, 2022 at 3:21 PM Iain Sandoe <i...@sandoe.co.uk> wrote:
>
>> Hi Shivam,
>>
>> > On 2 Apr 2022, at 06:57, Shivam Gupta <shivam98....@gmail.com> wrote:
>> >
>> > I saw your last year's mail for the same topic on the GCC mailing list -
>> https://gcc.gnu.org/pipermail/gcc/2020-March/000230.html.
>>
>> The patch was applied to GCC-11 (so is available one GCC-11 branch and
>> will be on GCC-12 when that is released).
>> >
>> > I tried today but this option is still not available.
>>
>> The option has to be configured when the compiler is built, that also
>> means that you have to install (and point the configure to) a suitable set
>> of libc++ headers from the LLVM project  (e.g. there is a set here:
>> https://github.com/iains/llvm-project/tree/9.0.1-gcc-stdlib).
>>
>> Generally, GCC is very compatible with the libc++ headers (the changes I
>> made on that branch were mostly to deal with <coroutine> being in std:: for
>> GCC and std::experimental:: for LLVM-9).  For LLVM libc++ earlier than 9
>> there is a missing symbol that GCC uses - but that can be worked around too.
>>
>> There have been some changes in more recent (in particular, LLVM-14/main)
>> libc++ that should make it more compatible.
>>
>> Of course, you should pick a version of the libc++ headers than matches
>> the version used on your system (9 was used for quite a long time, but
>> recent xcode headers are newer).
>>
>> Given that this involves cross-project sources and choosing a suitable
>> set, probably it is a job for the distributions (e.g. homebrew, macports
>> etc) to arrange or, for self-built compilers, following in the general
>> comments above.
>>
>> FWIW, I have used this to build quite a few OSS projects on a number of
>> Darwin versions (hence the comment about GCC being very compatible with
>> libc++).
>>
>> thanks,
>> Iain.
>>
>>

Reply via email to