From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sourceware.org (Postfix) with ESMTPS id 3A5B83842430 for ; Tue, 28 Jul 2020 14:15:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 3A5B83842430 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=inria.fr Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=ludovic.courtes@inria.fr X-IronPort-AV: E=Sophos;i="5.75,406,1589234400"; d="scan'208";a="355490747" Received: from unknown (HELO ribbon) ([193.50.110.108]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 Jul 2020 16:15:41 +0200 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Jonathan Wakely Cc: gcc-help Subject: Re: libstdc++ search path while building GCC References: <87lfjbgua3.fsf@inria.fr> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 11 Thermidor an 228 de la =?utf-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Tue, 28 Jul 2020 16:15:40 +0200 In-Reply-To: (Jonathan Wakely's message of "Mon, 27 Jul 2020 17:32:10 +0100") Message-ID: <87eeovu3n7.fsf@inria.fr> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-help@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-help mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jul 2020 14:15:43 -0000 Hi, Jonathan Wakely skribis: > On Wed, 22 Jul 2020 at 21:39, Ludovic Court=C3=A8s wrote: >> >> Hello, >> >> While building GCC on a non-FHS distro, we do something like=C2=B9: >> >> export CPLUS_INCLUDE_PATH=3D/path/to/host/gcc/include/c++:/path/to/hos= t/gcc/include > > That looks wrong. Why are you doing this? Doesn't your host GCC > already know where its headers are? It does. With Guix, CPLUS_INCLUDE_PATH is automatically populated with all the include/ and include/c++/ directories of dependencies, which includes GCC=E2=80=99s own libstdc++. We could override that, but I=E2=80= =99m trying to understand what=E2=80=99s going on. >> This ensures the host GCC=E2=80=99s C++ headers are found by =E2=80=98xg= cc=E2=80=99 during >> build. > > Why do you want that to happen? > > It's wrong in general, but it's specifically wrong in your case > because the host compiler is a different version to the one you're > trying to build. There is absolutely no guarantee that GCC 10.1 can > compile the libstdc++ headers from GCC 7.5, and trying to do so is not > supported. Is it wrong? I=E2=80=99m talking about the first time where =E2=80=98libstdc++-v3/configure=E2=80=99 runs, which itself checks for C++ = features. It=E2=80=99s checking for C++ features of the host compiler/C++ library, is= n=E2=80=99t it? Thanks for your feedback! Ludo=E2=80=99.