From: Shivam Gupta <shivam98.tkg@gmail.com>
To: Iain Sandoe <iain@sandoe.co.uk>
Cc: GCC Development <gcc@gcc.gnu.org>, unlvsur unlvsur <unlvsur@live.com>
Subject: Re: -stdlib=libc++?
Date: Sun, 3 Apr 2022 13:33:26 +0530 [thread overview]
Message-ID: <CAHX=PX941fMrFPbbpDeOhpjUDiuPMMN7QO756-4DqVYfda-kAA@mail.gmail.com> (raw)
In-Reply-To: <932ABA28-8AE1-4DF2-AAA7-1D95233CF635@sandoe.co.uk>
Hi Iain,
Thank again for the detailed reply, understood now.
Shivam
On Sun, 3 Apr 2022 at 12:23 PM, Iain Sandoe <iain@sandoe.co.uk> wrote:
> Hi Shivam,
>
> > On 2 Apr 2022, at 17:48, Shivam Gupta <shivam98.tkg@gmail.com> wrote:
> >
>
> > May I ask why we need to specify --with-gxx-libcxx-include-dir= at
> compile/configure time of GCC?
>
> The libc++ headers are not part of a base system install (on Darwin they
> are part of either Xcode or Command Line Tools installations). On other
> platforms, they will be an optional install. It seems unhelpful to enable
> an option that will not work (without knowing where to find the headers,
> -stdlib=libc++ cannot work).
>
> For GCC, the default is to use -stdlib=libstdc++, and that is part of the
> compiler’s install so that it can be located without extra configuration,
> and it does not require the -stdlib option to work.
>
> > While in clang equivalent, -stdlib= doesn't require so.
>
> libc++ is the default for clang and is part of the standard compiler
> distribution (so it can be located without additional configuration).
>
> OTOH, I believe that you will find that to make -stdlib=libstdc++ work
> will generally require some cmake values to point to the GCC installation
> (On macOS/Darwin there is a default that points to the old apple-gcc-4.2.1
> installation [for Darwin11-16], but that is not necessarily the GCC version
> you would be using there, either).
>
> In summary, since neither compiler “knows” where to find the other, some
> configuration is required in the general case to find the non-native C++
> runtime.
>
> Iain
>
>
next prev parent reply other threads:[~2022-04-03 8:03 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CAHX=PX-2PEZ8iPrpmneDYoUSBDthPjjuxckEcFnpyXsoSdwO2w@mail.gmail.com>
2022-04-02 9:51 ` -stdlib=libc++? Iain Sandoe
2022-04-02 14:02 ` -stdlib=libc++? Shivam Gupta
2022-04-02 16:48 ` -stdlib=libc++? Shivam Gupta
2022-04-03 6:53 ` -stdlib=libc++? Iain Sandoe
2022-04-03 8:03 ` Shivam Gupta [this message]
2020-03-30 14:19 -stdlib=libc++? unlvsur unlvsur
2020-03-30 14:42 ` -stdlib=libc++? Iain Sandoe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAHX=PX941fMrFPbbpDeOhpjUDiuPMMN7QO756-4DqVYfda-kAA@mail.gmail.com' \
--to=shivam98.tkg@gmail.com \
--cc=gcc@gcc.gnu.org \
--cc=iain@sandoe.co.uk \
--cc=unlvsur@live.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).