From debbugs-submit-bounces@debbugs.gnu.org Tue May 19 04:52:38 2020 Received: (at 41264) by debbugs.gnu.org; 19 May 2020 08:52:38 +0000 Received: from localhost ([127.0.0.1]:49154 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jaxzK-00065L-0R for submit@debbugs.gnu.org; Tue, 19 May 2020 04:52:38 -0400 Received: from eggs.gnu.org ([209.51.188.92]:46702) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jaxzJ-000656-4c for 41264@debbugs.gnu.org; Tue, 19 May 2020 04:52:37 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:46942) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jaxzD-0004Ru-OY for 41264@debbugs.gnu.org; Tue, 19 May 2020 04:52:31 -0400 Received: from [2a01:e0a:fa:a50:7004:8043:e0bd:6eda] (port=35840 helo=meru) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jaxzD-0005I9-Cv for 41264@debbugs.gnu.org; Tue, 19 May 2020 04:52:31 -0400 From: Mathieu Othacehe To: 41264@debbugs.gnu.org Subject: Re: bug#41264: Bootstrap packages fail to build. References: <87h7wik0kk.fsf@gnu.org> <87v9kxe6tl.fsf@gnu.org> Date: Tue, 19 May 2020 10:52:28 +0200 In-Reply-To: <87v9kxe6tl.fsf@gnu.org> (Mathieu Othacehe's message of "Fri, 15 May 2020 14:11:34 +0200") Message-ID: <87ftbwtigj.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 41264 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: -3.3 (---) Hello, > So stat, lstat, and all other related function will return -EOVERFLOW > unless their 64 bits stat64, lstat64 counterpart is used. > > So I think this means that one cannot build the Guix bootstrap toolchain on an > NVME disk. After further investigations I think that it is needed to patch GNU Mes to fix this bug. We would need to add three new syscalls for x86: --8<---------------cut here---------------start------------->8--- #define SYS_stat64 0xc3 #define SYS_lstat64 0xc4 #define SYS_fstat64 0xc5 --8<---------------cut here---------------end--------------->8--- lib/linux/stat.c should be modified this way: --8<---------------cut here---------------start------------->8--- #if __i386__ #define STAT_SYSCALL SYS_stat64 #else #define STAT_SYSCALL SYS_stat #endif int stat (char const *file_name, struct stat *statbuf) { struct stat64 statbuf64; int ret; ret = _sys_call2 (STAT_SYSCALL, (long) file_name, (long) &statbuf64); #if __i386__ stat64_to_32(&statbuf64, statbuf); #else *statbuf = statbuf64; #endif return ret; } --8<---------------cut here---------------end--------------->8--- Then we would need to create stat64_to_32 which could be inspired from __xstat64_conv from the glibc. Then, lstat and fstat64 would need to be patched the same way. This way, we would replicate the glibc behavior. Thanks, Mathieu