From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id OEAwG/PCbV8qJAAA0tVLHw (envelope-from ) for ; Fri, 25 Sep 2020 10:14:11 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id 4D4aF/PCbV+pNAAA1q6Kng (envelope-from ) for ; Fri, 25 Sep 2020 10:14:11 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id B2710940717 for ; Fri, 25 Sep 2020 10:14:10 +0000 (UTC) Received: from localhost ([::1]:41122 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kLkjx-0008P4-BZ for larch@yhetil.org; Fri, 25 Sep 2020 06:14:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41944) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kLkjq-0008Nh-I7 for bug-guix@gnu.org; Fri, 25 Sep 2020 06:14:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:59434) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kLkjq-0006vx-7r for bug-guix@gnu.org; Fri, 25 Sep 2020 06:14:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kLkjq-0001ZG-4B for bug-guix@gnu.org; Fri, 25 Sep 2020 06:14:02 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#43513: json-c build failure (on armhf-linux) while trying to build u-boot Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Fri, 25 Sep 2020 10:14:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 43513 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Danny Milosavljevic Received: via spool by 43513-submit@debbugs.gnu.org id=B43513.16010288306002 (code B ref 43513); Fri, 25 Sep 2020 10:14:02 +0000 Received: (at 43513) by debbugs.gnu.org; 25 Sep 2020 10:13:50 +0000 Received: from localhost ([127.0.0.1]:42747 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kLkje-0001Yh-4p for submit@debbugs.gnu.org; Fri, 25 Sep 2020 06:13:50 -0400 Received: from eggs.gnu.org ([209.51.188.92]:35102) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kLkjc-0001YR-L6 for 43513@debbugs.gnu.org; Fri, 25 Sep 2020 06:13:49 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:55029) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kLkjX-0006vH-85; Fri, 25 Sep 2020 06:13:43 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=60840 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kLkjW-0006Xg-M0; Fri, 25 Sep 2020 06:13:43 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <20200919173628.423331da@scratchpost.org> <20200921134855.2ed40eb0@scratchpost.org> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 4 =?UTF-8?Q?Vend=C3=A9miaire?= an 229 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: Fri, 25 Sep 2020 12:13:40 +0200 In-Reply-To: <20200921134855.2ed40eb0@scratchpost.org> (Danny Milosavljevic's message of "Mon, 21 Sep 2020 14:22:26 +0200") Message-ID: <87wo0i17vv.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Spam-Score: -3.3 (---) X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: 43513@debbugs.gnu.org Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of bug-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Spam-Score: -1.51 X-TUID: o3S9YHEoUuVh Hi Danny! Danny Milosavljevic skribis: > I found the underlying cause of the problem with qemu transparent emulati= on: > > * qemu transparent emulator has 64 bit registers > * the thing it's emulating has 32 bit registers > * The glibc in the distro that is running in the emulator is using getden= ts64 > (on 32 bits!) and then (rightfully) checking whether d_off and the inode = number > fit into their own (32 bits/entry) struct, which they don't (the thing th= ey get > from the kernel is 64 bits/entry). Looks very much like the CMake-on-emulated-hardware issue several of us encountered before: https://issues.guix.gnu.org/38454#3 https://issues.guix.gnu.org/42448 Glad you found an explanation! (I see you also posted .) > See also https://lore.kernel.org/lkml/20181229015453.GA6310@bombadil.infr= adead.org/T/ > for an analysis. > > See also https://sourceware.org/bugzilla/show_bug.cgi?id=3D23960 for a di= scussion. Woow. > Least-shitty workaround: Use a 32-bit qemu (yes, a qemu compiled on 32 bi= t) > on a 64 bit machine for transparent emulation of ANOTHER 32-bit machine. > That way, the kernel can know that there's a 32 bit user lurking somewher= e up > the call chain that is calling getdents64 and is not actually able to pro= cess the > result. "The truth? It can't handle the truth." OK. > The right fix: One could also tell all the packages in the emulated > system to use the large file size API (-D_FILE_OFFSET_BITS=3D64 and co). = In this > case cmake is affected--but it could be any number of things. I think th= at that > is the only good fix (we could also add a compile-time check whether > has been included without anyone specifying -D_FILE_OFFSET_BITS=3D64--tha= t would > make finding these problems a LOT easier; if possible, emit that compile-= time > error only if readdir is actually called anywhere). Yes; that user-space should be built with -D_FILE_OFFSET_BITS=3D64 is also the conclusion at . Let=E2=80=99s fix CMake (and JSON-C?) in =E2=80=98core-updates=E2=80=99 or = =E2=80=98staging=E2=80=99 (using a graft for CMake wouldn=E2=80=99t help because CMake is used at build time.) > +(define (closest-cross-compiled-qemu qemu target-bits) > + "Cross-compile QEMU for the given TARGET-BITS platform that is closest= to > +the actual host architecture, if possible. This is in order to prevent > +https://lore.kernel.org/lkml/20181229015453.GA6310@bombadil.infradead.or= g/T/" > + (define (cross-compiled-qemu target) > + (package > + (inherit qemu) > + (arguments > + (substitute-keyword-arguments (package-arguments qemu) > + ((#:configure-flags flags) > + `(cons ,(string-append "--cross-prefix=3D" target "-") > + ,flags)))) > + (native-inputs > + `(("cross-gcc" ,(cross-gcc target)) > + ("cross-binutils" ,(cross-binutils target)) > + ,@(package-native-inputs qemu))))) > + (match target-bits > + (64 qemu) > + (32 (match (register-width (%current-system)) > + (32 qemu) > + (64 (match (%current-system) > + ("x86_64-linux" > + (cross-compiled-qemu (nix-system->gnu-triplet "i686-linux"= ))) > + ("aarch64-linux" > + (cross-compiled-qemu "arm-linux-gnueabihf")) > + (_ (begin > + ;; TODO: Print warning > + qemu)))))))) It doesn=E2=80=99t make sense to cross-compile from x86_64 to i686. Instea= d we should use a native build, but an i686 one: (package/inherit qemu (arguments `(#:system "i686-linux" ,@(package-arguments qemu)))) Likewise for AArch64/ARMv7. How does that sound? Thanks, Ludo=E2=80=99.