From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sourceware.org (Postfix) with ESMTPS id 416863858D38 for ; Wed, 22 Jul 2020 20:38:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 416863858D38 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,383,1589234400"; d="scan'208";a="460892286" Received: from 91-160-117-201.subs.proxad.net (HELO ribbon) ([91.160.117.201]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Jul 2020 22:38:13 +0200 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: gcc-help@gcc.gnu.org Subject: libstdc++ search path while building GCC X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 5 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: Wed, 22 Jul 2020 22:38:12 +0200 Message-ID: <87lfjbgua3.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_H4, 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: Wed, 22 Jul 2020 20:38:15 -0000 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/host/g= cc/include ./configure && make where /path/to/host/gcc points to the GCC used to build GCC. This ensures the host GCC=E2=80=99s C++ headers are found by =E2=80=98xgcc= =E2=80=99 during build. However, during libstdc++ configure, the host GCC=E2=80=99s is not found, leading to misdiagnostics like this (here we=E2=80=99re building GCC 10.1 with GCC 7.5): --8<---------------cut here---------------start------------->8--- configure:19924: checking for float trig functions configure:19948: /tmp/guix-build-gcc-10.1.0.drv-0/build/./gcc/xgcc -shared= -libgcc -B/tmp/guix-build-gcc-10.1.0.drv-0/build/./gcc -nostdinc++ -L/tmp/g= uix-build-gcc-10.1.0.drv-0/build/x86_64-unknown-linux-gnu/libstdc++-v3/src = -L/tmp/guix-build-gcc-10.1.0.drv-0/build/x86_64-unknown-linux-gnu/libstdc++= -v3/src/.libs -L/tmp/guix-build-gcc-10.1.0.drv-0/build/x86_64-unknown-linux= -gnu/libstdc++-v3/libsupc++/.libs -B/gnu/store/jrzxs91zhpf6yr5fxisn3jjj7xai= 8zlk-gcc-10.1.0/x86_64-unknown-linux-gnu/bin/ -B/gnu/store/jrzxs91zhpf6yr5f= xisn3jjj7xai8zlk-gcc-10.1.0/x86_64-unknown-linux-gnu/lib/ -isystem /gnu/sto= re/jrzxs91zhpf6yr5fxisn3jjj7xai8zlk-gcc-10.1.0/x86_64-unknown-linux-gnu/inc= lude -isystem /gnu/store/jrzxs91zhpf6yr5fxisn3jjj7xai8zlk-gcc-10.1.0/x86_64= -unknown-linux-gnu/sys-include -fno-checking -c -fno-builtin -D_GNU_SOURC= E conftest.cpp >&5 In file included from /gnu/store/rn75fm7adgx3pw5j8pg3bczfqq1y17lk-gcc-7.5.0= /include/c++/math.h:36, from conftest.cpp:122: /gnu/store/rn75fm7adgx3pw5j8pg3bczfqq1y17lk-gcc-7.5.0/include/c++/cmath:41:= 10: fatal error: bits/c++config.h: No such file or directory 41 | #include | ^~~~~~~~~~~~~~~~~~ compilation terminated. configure:19948: $? =3D 1 configure: failed program was: [...] | /* end confdefs.h. */ | #include | int | main () | { | acosf (0); asinf (0); atanf (0); cosf (0); sinf (0); tanf (0); coshf (0);= sinhf (0); tanhf (0); | ; | return 0; | } configure:19962: result: no --8<---------------cut here---------------end--------------->8--- =E2=80=98c++config.h=E2=80=99 is not found because it lives in a different = directory that=E2=80=99s not searched, =E2=80=98include/c++/x86_64-unknown-linux-gnu= =E2=80=99. (aka. =E2=80=98GPLUSPLUS_TOOL_INCLUDE_DIR=E2=80=99). So, how=E2=80=99s that supposed to work? I understand this kind of issue is unlikely to show up on an FHS distro, but still, am I missing something? Thanks, Ludo=E2=80=99. =C2=B9 More details at .