From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lj1-x230.google.com (mail-lj1-x230.google.com [IPv6:2a00:1450:4864:20::230]) by sourceware.org (Postfix) with ESMTPS id 020623858C52 for ; Sat, 2 Apr 2022 16:48:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 020623858C52 Received: by mail-lj1-x230.google.com with SMTP id 17so7744138lji.1 for ; Sat, 02 Apr 2022 09:48:44 -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=w7rnPafgxxZZ5390LHPuM8KcsIBZTJLzsUm2tqtngWQ=; b=g4pFoSF3vz0kzS3nuk6ms2uO0AfF5EzPtZ29kvJPGlYOW2qTNTs2Kuvf362b+C0h/P vKPXrf0gBOtE4vxykfetTgap70om8o2HuNj4I28fmdbFbiW6I3NuoW7dOe0zyAJID0wL NBnG0g3myrzTRLLtgoYECjp4JgZ6y/ERlGOKJfQlGDrgbv1k+uhGuzjETjzHZYnr/ITP LiY5gUiQgu0w7vb9Vubk3k4HnkSQlhfp3Y/KKD4IuAMjRPvFWqku+bn02of2FjlhNlrj Rfi5bJyrQTY5gZxfuUtCWitYGHMROVB9IeTN0WuzsvqSfU0fb9AWySUz/eJ+p8CZx7VN oufw== X-Gm-Message-State: AOAM533hkJO6nolftrods2C8H1TTxGE8pa42XxZBiy1n4aZuZvaemSKY LZYacucI27xQDMJdcMMn3ZEOOKa95Wb7f1QPANs= X-Google-Smtp-Source: ABdhPJyb3IrIaOvFk3d/o81Wy8tm0uoCHi5WR2+iLxPuDnCulnK2h5a5LsF/I6ma6dG+gfjcLNNSUUOUHybpx0OgUbI= X-Received: by 2002:a2e:8914:0:b0:24a:f12b:4c1 with SMTP id d20-20020a2e8914000000b0024af12b04c1mr10406544lji.396.1648918123243; Sat, 02 Apr 2022 09:48:43 -0700 (PDT) MIME-Version: 1.0 References: <32B864C2-AF13-43F3-B56B-10E45EC3E5FA@sandoe.co.uk> In-Reply-To: From: Shivam Gupta Date: Sat, 2 Apr 2022 22:18:01 +0530 Message-ID: Subject: Re: -stdlib=libc++? To: Iain Sandoe Cc: unlvsur unlvsur , GCC Development 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, KAM_SHORT, 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" 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: Sat, 02 Apr 2022 16:48:47 -0000 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 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 wrote: > >> Hi Shivam, >> >> > On 2 Apr 2022, at 06:57, Shivam Gupta 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 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. >> >>