From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mathieu Othacehe Subject: bug#36882: Qemu 4.2.0 build for x86_64-linux fails Date: Tue, 25 Feb 2020 15:46:15 +0100 Message-ID: <874kveafns.fsf@gmail.com> References: <87k14gnqng.fsf@gmail.com> <87mu9b3crd.fsf@gnu.org> <87a75a5taw.fsf@gmail.com> <87o8tptu7u.fsf@gnu.org> <87ftf0nx7n.fsf@gmail.com> <87tv3gm59r.fsf@gnu.org> <875zfuag6v.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:51637) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j6bUG-0003Jr-0L for bug-guix@gnu.org; Tue, 25 Feb 2020 09:47:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j6bUE-0003UD-5j for bug-guix@gnu.org; Tue, 25 Feb 2020 09:47:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:48635) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j6bUE-0003U4-09 for bug-guix@gnu.org; Tue, 25 Feb 2020 09:47:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1j6bUD-0003A8-Uu for bug-guix@gnu.org; Tue, 25 Feb 2020 09:47:01 -0500 Sender: "Debbugs-submit" Resent-Message-ID: In-reply-to: <875zfuag6v.fsf@gmail.com> List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane-mx.org@gnu.org Sender: "bug-Guix" To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 36882@debbugs.gnu.org Oops wrong shortcut, sorry! > I=E2=80=99d rather go for #2. To do that, we could modify the =E2=80=98s= et-paths=E2=80=99 phase > to manually remove glibc from C_INCLUDE_PATH (fragile), or we could > modify GCC (perhaps removing the =E2=80=98remove_duplicates=E2=80=99 call= for SYSTEM). > > Either way, this wouldn=E2=80=99t work well with =E2=80=98guix environmen= t=E2=80=99, where glibc > ends up in /gnu/store/=E2=80=A6-profile, so it does not appear as duplica= te to > GCC. [...] > Looking at =E2=80=98cppdefault.c=E2=80=99 in GCC, I don=E2=80=99t see whe= re glibc-2.31/include > comes from; it seems that =E2=80=98INCLUDE_DEFAULTS=E2=80=99 is undefined= on glibc > systems. It's indeed undefined and glibc comes from NATIVE_SYSTEM_HEADER_DIR at the end of the file you mentioned. It is a consequence of passing --with-native-system-header-dir=3Dglibc in (gnu packages gcc). About the environment issue, we have the same problem on master. You can run the following command: --8<---------------cut here---------------start------------->8--- ./pre-inst-env guix environment -C -e '(@@ (gnu packages commencement) coreutils-final)' -- echo -e '#include \n int main() {return 0;}' > test.c && gcc -m16 -ffreestanding test.c --8<---------------cut here---------------end--------------->8--- and see that in takes stdint.h from the profile glibc header: --8<---------------cut here---------------start------------->8--- In file included from /gnu/store/nl6zndkx4115laq50qmqcvnzinfz5rk0-profile/i= nclude/features.h:474:0, from /gnu/store/nl6zndkx4115laq50qmqcvnzinfz5rk0-profile/i= nclude/bits/libc-header-start.h:33, from /gnu/store/nl6zndkx4115laq50qmqcvnzinfz5rk0-profile/i= nclude/stdint.h:26, from test.c:1: /gnu/store/nl6zndkx4115laq50qmqcvnzinfz5rk0-profile/include/gnu/stubs.h:7:1= 1: fatal error: gnu/stubs-32.h: No such file or directory # include ^~~~~~~~~~~~~~~~ --8<---------------cut here---------------end--------------->8--- So if it's ok for you, I'll try to implement a GCC hack so that we can keep using C_INCLUDE_PATH on core-updates and have QEMU building, as you proposed. About the environment use-case, it's getting really tricky, but as it is not a regression, we can maybe postpone the resolution. > Incidentally, do we have problems building anything other than QEMU? I don't know, but potentially any program building with -m and -ffreestanding fails on core-updates. Thanks for your help :), Mathieu