From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lj1-x22b.google.com (mail-lj1-x22b.google.com [IPv6:2a00:1450:4864:20::22b]) by sourceware.org (Postfix) with ESMTPS id 713BC3858D37 for ; Sun, 3 Apr 2022 08:03:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 713BC3858D37 Received: by mail-lj1-x22b.google.com with SMTP id bx37so5447051ljb.4 for ; Sun, 03 Apr 2022 01:03:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=lhw7xNIK+HBR+k5HwK24hH/d8P8zmsycYj8sFTpBR3M=; b=ggXOBU9Xo+9xuLfAnmLisR9s3NbQZBKQC0B09NGbNNDpsPi6txRMYJrmnu3TBOYHpQ 4eCCPhkmyR9ozo+NwT/nQnVumX2l2LvQ4Y90S0XIqNk9KDywVzu5vgEu5OrABKucZCay vtHMFirbQ9WATHWHpVro+qOzLlckaHAx5jBnWlNcuL8ew4HfOpSPNwDwseq56aU9F1jW b8V5e41ZWc4T9q7iK4FjxU3A8LuYWaQwuJtO6J+okbOpuvE+h4/2/sR3sGmJzV84QCGf iiVz9sK/hsyhEYXAX6sbYzbFwOJfpNUYQb+JsTVGy7Xvna0ELavzqayPGOk1TLcH6ABk MvRg== X-Gm-Message-State: AOAM533vN5rjpdtNf1PCA9ii9QKTZquapM0HNhXMn/0XBgrMFfnkTerz xoef65FM+DmWbPsVS7YVo6CJVrMp6IWiJRsc4Ak= X-Google-Smtp-Source: ABdhPJzn/goiZWN1d07swlD8coSG11oh1w/46a63mAtYyY74BuhSd2bbq3zML7Iax99RnJzxBp94P34T4foO8WoowJs= X-Received: by 2002:a2e:a784:0:b0:249:8b4f:f228 with SMTP id c4-20020a2ea784000000b002498b4ff228mr18548222ljf.450.1648973017570; Sun, 03 Apr 2022 01:03:37 -0700 (PDT) MIME-Version: 1.0 References: <32B864C2-AF13-43F3-B56B-10E45EC3E5FA@sandoe.co.uk> <932ABA28-8AE1-4DF2-AAA7-1D95233CF635@sandoe.co.uk> In-Reply-To: <932ABA28-8AE1-4DF2-AAA7-1D95233CF635@sandoe.co.uk> From: Shivam Gupta Date: Sun, 3 Apr 2022 13:33:26 +0530 Message-ID: Subject: Re: -stdlib=libc++? To: Iain Sandoe Cc: GCC Development , unlvsur unlvsur X-Spam-Status: No, score=0.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, HTML_MESSAGE, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: gcc@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Apr 2022 08:03:41 -0000 Hi Iain, Thank again for the detailed reply, understood now. Shivam On Sun, 3 Apr 2022 at 12:23 PM, Iain Sandoe wrote: > Hi Shivam, > > > On 2 Apr 2022, at 17:48, Shivam Gupta wrote: > > > > > May I ask why we need to specify --with-gxx-libcxx-include-dir=3D 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 enabl= e > an option that will not work (without knowing where to find the headers, > -stdlib=3Dlibc++ cannot work). > > For GCC, the default is to use -stdlib=3Dlibstdc++, and that is part of t= he > compiler=E2=80=99s install so that it can be located without extra config= uration, > and it does not require the -stdlib option to work. > > > While in clang equivalent, -stdlib=3D 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=3Dlibstdc++ 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 versi= on > you would be using there, either). > > In summary, since neither compiler =E2=80=9Cknows=E2=80=9D where to find = the other, some > configuration is required in the general case to find the non-native C++ > runtime. > > Iain > >