From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Make cross-compiling temacs easier: drop gnulib for build intermediates, or use recursive autoconf? Date: Sat, 26 Jun 2021 09:26:22 +0300 Message-ID: <83r1gpqgz5.fsf@gnu.org> References: Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="20075"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: James Luke Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Jun 26 08:26:59 2021 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lx1mN-00051P-2V for ged-emacs-devel@m.gmane-mx.org; Sat, 26 Jun 2021 08:26:59 +0200 Original-Received: from localhost ([::1]:40010 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lx1mM-0008Ei-4e for ged-emacs-devel@m.gmane-mx.org; Sat, 26 Jun 2021 02:26:58 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50920) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lx1ls-0007Z6-K5 for emacs-devel@gnu.org; Sat, 26 Jun 2021 02:26:28 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:51524) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lx1ls-0008Qu-4K; Sat, 26 Jun 2021 02:26:28 -0400 Original-Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:1906 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lx1lr-0002xp-M5; Sat, 26 Jun 2021 02:26:27 -0400 In-Reply-To: (message from James Luke on Fri, 25 Jun 2021 19:22:10 -0700) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:271020 Archived-At: > From: James Luke > Date: Fri, 25 Jun 2021 19:22:10 -0700 > > I'm interested in making cross-compilation of emacs easier. Or rather, making cross-compilation of temacs > easier, such that one can run temacs on the host machine to finish the build. This would make it easier to > create reproducible builds (particularly with Guix/NixOS as the build machine), and means one doesn't need > a C compiler on the host. Right now the problem I'm running into is caused by build intermediates that must > be built then run on the builder: the programs "lib-src/make-docfile.c" and "lib-src/make-fingerprint.c". Please tell more about the idea. Is the intent to run part of the build on the "build" system, producing temacs, and then continue on the "host(=target)" system by running the built temacs there? If so, I don't understand the "doesn't need a C compiler on the host" part, given that we now have native-compilation in Emacs. Also, which system(s) would you like to target that require cross-compilation? > These intermediates both use gnulib (with #include etc), but configure.ac only configures gnulib > for the host machine. So the headers, #defines, and library are all wrong for the build machine and > compilation fails. To fix this, I'd like to rewrite make-fingerprint.c and make-docfile.c to avoid non-portable > constructs and thus the dependency on gnulib I don't think this is a good idea: it's a lot of work, and basically you will end up with the same portability shims, just incorporated into the sources. Why not modify the build process such that it configures Gnulib twice: once for the build system and another one for the host/target system? We already compile Gnulib twice in the unexec configuration (which will probably be removed in the future version, but we still have it meanwhile). Building Gnulib twice doesn't sound like such a bad situation, especially given that we already do so in some cases.