From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 23 06:32:31 2020 Received: (at 36882) by debbugs.gnu.org; 23 Feb 2020 11:32:31 +0000 Received: from localhost ([127.0.0.1]:50443 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j5pUt-0002UY-Fw for submit@debbugs.gnu.org; Sun, 23 Feb 2020 06:32:31 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44480) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j5pUr-0002UM-MZ for 36882@debbugs.gnu.org; Sun, 23 Feb 2020 06:32:30 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:34998) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1j5pUm-00038K-IY; Sun, 23 Feb 2020 06:32:24 -0500 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=47608 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1j5pUl-0005JW-Gw; Sun, 23 Feb 2020 06:32:24 -0500 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Mathieu Othacehe Subject: Re: Qemu 4.2.0 build for x86_64-linux fails References: <87k14gnqng.fsf@gmail.com> <87mu9b3crd.fsf@gnu.org> <87a75a5taw.fsf@gmail.com> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 5 =?utf-8?Q?Vent=C3=B4se?= an 228 de la =?utf-8?Q?R?= =?utf-8?Q?=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: Sun, 23 Feb 2020 12:32:21 +0100 In-Reply-To: <87a75a5taw.fsf@gmail.com> (Mathieu Othacehe's message of "Sat, 22 Feb 2020 20:13:43 +0100") Message-ID: <87o8tptu7u.fsf@gnu.org> 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-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 36882 Cc: 36882@debbugs.gnu.org, Marius Bakke X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Hi Mathieu, Mathieu Othacehe skribis: > On master, when building qemu, this is the gcc include path (obtained > with "gcc -v -x c -E /dev/null"): > > /gnu/store/adm2cx3ayabn1sp84nnjsk0672m800ip-flex-2.6.4/include > /gnu/store/l86azr7r3p5631wj3kk329jl1y1mpjgy-bzip2-1.0.6/include > ... > /gnu/store/2plcy91lypnbbysb18ymnhaw3zwk8pg1-gcc-7.4.0-lib/lib/gcc/x86_64= -unknown-linux-gnu/7.4.0/include [1] > /gnu/store/2plcy91lypnbbysb18ymnhaw3zwk8pg1-gcc-7.4.0-lib/lib/gcc/x86_64= -unknown-linux-gnu/7.4.0/include-fixed > /gnu/store/ahqgl4h89xqj695lgqvsaf6zh2nhy4pj-glibc-2.29/include [2] > > > We see that glibc comes last. So when building a program with "gcc > -ffreestanding -m16", the first header picked is the one from > gcc (marked [1] above). This header contains: > > #ifndef _GCC_WRAP_STDINT_H > #if __STDC_HOSTED__ <-- Set to 0 because of -ffreestanding option. > # if defined __cplusplus && __cplusplus >=3D 201103L > # undef __STDC_LIMIT_MACROS > # define __STDC_LIMIT_MACROS > # undef __STDC_CONSTANT_MACROS > # define __STDC_CONSTANT_MACROS > # endif > # include_next > #else > # include "stdint-gcc.h" <-- This one gets included. > #endif > #define _GCC_WRAP_STDINT_H > #endif > > > So the from glibc (marked [2] above) is neved included. And > that's good because this header would try to include > that our glibc does not provide. [...] > Now, what's happening on core-updates? Because of CPATH -> > C_INCLUDE_PATH transition, we have a different behaviour. The same > command as above states: > > ignoring duplicate directory "/gnu/store/jsjsczgr8xdnbdminl7lm2v56b7dq7lq= -glibc-2.31/include" > ... > /gnu/store/kyypmcn2miyzllqqmcx28gvj89qnvhpi-flex-2.6.4/include > ... > /gnu/store/jsjsczgr8xdnbdminl7lm2v56b7dq7lq-glibc-2.31/include [1] > ... > /gnu/store/wl7zanqf0s9bfppggmv8qxqan71fjfw8-gcc-7.5.0-lib/lib/gcc/x86_64= -unknown-linux-gnu/7.5.0/include [2] > /gnu/store/wl7zanqf0s9bfppggmv8qxqan71fjfw8-gcc-7.5.0-lib/lib/gcc/x86_64= -unknown-linux-gnu/7.5.0/include-fixed > > The glibc ignored seems to be the hardcoded one. The one from the > C_INCLUDE_PATH is kept. So the included is the one from glibc > (marked [1] above), which triggers inclusion and makes > build fail. Woow, thanks for the analysis. It=E2=80=99s a bug on =E2=80=98core-updates=E2=80=99 that GCC=E2=80=99s hea= ders come after libc=E2=80=99s. This is what should be fixed IMO. So is it expected that C_INCLUDE_PATH comes before the hard-coded GCC include directory? How can we work around that? Thanks! Ludo=E2=80=99.