From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: David Michael Newsgroups: gmane.emacs.devel Subject: Cross-compiling Date: Wed, 05 Feb 2020 10:45:00 -0500 Message-ID: <87r1z9hwcj.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="125552"; mail-complaints-to="usenet@ciao.gmane.io" To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Feb 05 16:47:24 2020 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 1izMtg-000WXd-6O for ged-emacs-devel@m.gmane-mx.org; Wed, 05 Feb 2020 16:47:24 +0100 Original-Received: from localhost ([::1]:51318 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1izMtf-0003Ks-88 for ged-emacs-devel@m.gmane-mx.org; Wed, 05 Feb 2020 10:47:23 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37489) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1izMrR-0002AN-55 for emacs-devel@gnu.org; Wed, 05 Feb 2020 10:45:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1izMrQ-0004UE-0w for emacs-devel@gnu.org; Wed, 05 Feb 2020 10:45:04 -0500 Original-Received: from mail-qk1-x741.google.com ([2607:f8b0:4864:20::741]:46920) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1izMrP-0004Ov-Qt for emacs-devel@gnu.org; Wed, 05 Feb 2020 10:45:03 -0500 Original-Received: by mail-qk1-x741.google.com with SMTP id g195so2206683qke.13 for ; Wed, 05 Feb 2020 07:45:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version; bh=PXmoH2sh/BewnNOQy/L3BeR/sDJRSXQ/vADBoOQxk0o=; b=gO3kmKpwJmKgtUKnWBMixfW8OG0YJX4xMTRUW0HfPofEEfi5yaNkYAW0XMcV5h8+s/ EAqy+U/TXTurlxakoxMnJ32t9HbefQfAf8uLwPkUVcG7mHgziH5AZ7yr1hm0NNc3NS6k t2FRW26kIPtGXs62fvAxiWOElQ1bQrk8MZfjLWhQgzYe5pJ9PAvVRw1DpgxqZgQ4/Z+c bHJYkqNhgJvNvE0UbgMOCuWgDDhejfS+zaECXer4VHBRPd2yMUpK1JQqyp6pD97l06y2 7xfBpFJZL3fDJAEBkQnj7gk+TwYiRza3/Sn/0FOlz9o0xue7HjjXrK7id9DKB5uYEs7T Jy+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version; bh=PXmoH2sh/BewnNOQy/L3BeR/sDJRSXQ/vADBoOQxk0o=; b=nYuDqVoMcuygJVP2G1MRgU0WlrF99Hm76XErO+oG10FsEmBhE5/UZhSiTfQqb2oD9g Lax5YUkdewZdS5AiXR0vPcgpVzr+fvBSLoTbpu9UZf0I24TOQey8VeKUYR4Z7703qnd/ pQpQuHXTTQu/fSgMWZfHOl3K7ej98TmGr/I1fAbMmJ9tErwrYJQCBuTcb9wGOorpzjqc RKyNQkTyqFyp22ObqugvClVGyvkE1qaxAC9HgGxYIApXvqSoC2/O30qX523yTQx7zmzI BbAi0Ulv1xIHbwVkDN/3Sl//GMFuwx/QEh8r/ZXGxej8Y+kgHtZXil1GOFIkDCz5IXg8 OnOA== X-Gm-Message-State: APjAAAXv3Eyd/x7R67vpt7jXZfax8LtUPc+yHBEdZU11CcKeQSIIeamL oFXZeD1mjD0M0sOhcacp5n9Y9XvQ X-Google-Smtp-Source: APXvYqwwQ2JhPZxGmh63wCGn12ClyXulP8C0lI3njp2DHWhiwbrhVTarFDij7cXKsmyMOGYS7DhONQ== X-Received: by 2002:a37:582:: with SMTP id 124mr33876860qkf.257.1580917502535; Wed, 05 Feb 2020 07:45:02 -0800 (PST) Original-Received: from callisto ([2601:986:200:7341:384b:df90:fb2f:c5df]) by smtp.gmail.com with ESMTPSA id h8sm68292qtm.51.2020.02.05.07.45.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Feb 2020 07:45:01 -0800 (PST) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::741 X-Mailman-Approved-At: Wed, 05 Feb 2020 10:46:43 -0500 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:244864 Archived-At: Hi, I briefly looked into cross-compiling Emacs, and it seems more feasible with pdumper now. I'm writing to ask if anyone sees an issue with this process and if it is reasonable to submit patches for any of it. My process for testing is: 1. Configure the source with a native compiler 2. Make the "lisp" and "blessmail" targets 3. Save make-{docfile,fingerprint} and run "make clean" 4. Configure the source for cross-compiling with: --with-dumping=none --with-pdumper 5. Make the "lib" directory 6. Restore and touch the native make-{docfile,fingerprint} 7. Make and install everything normally 8. Symlink the dump file path to /var/cache/emacs/emacs.pdmp 9. Install a service to create a cached dump file on boot[0] I've built a full graphical GTK+ 3 Emacs on a 64-bit little-endian system for a 32-bit big-endian system with this, and it seems to work with no problems. For an upstreamable implementation, I was thinking of these changes: 1. Use the BUILD_CC paradigm to compile make-{docfile,fingerprint} natively since these are only for build-time and not installed. This would have to produce a native libgnu.a version as well. 2. Allow a default search path for dump files, so it can check for a packaged file in /usr, but also try /var for locally generated dump files (which could be useful outside cross-compilation, e.g. to save a custom default dump file when /usr is immutable). 3. Maybe carry a service to create a dump file on boot. This is trivial enough that it could be left to the user. 4. Handle byte-compiling. Produce a minimal native Emacs binary to be executed on the build system. Does anyone familiar with the build process see problems with this? Is it something that would be acceptable upstream? Thanks. David [0] /usr/lib/systemd/system/emacs-pdmp.service: [Unit] Description=Create a cached portable dump file for faster Emacs startup ConditionPathExists=!/var/cache/emacs/emacs.pdmp [Service] CacheDirectory=emacs ExecStart=/usr/bin/emacs --batch --eval='(dump-emacs-portable "/var/cache/emacs/emacs.pdmp")' Type=oneshot [Install] WantedBy=multi-user.target