From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Artem Loenko via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#45455: [nextstep]: Emacs master does not compile on Apple Silicon (arm64) Date: Sun, 27 Dec 2020 20:12:52 +0000 Message-ID: References: <4F964265-C862-43DE-A1BB-252C0649167D@mac.com> Reply-To: Artem Loenko Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.40.0.2.32\)) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="16296"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 45455@debbugs.gnu.org To: Philipp Stephani Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Dec 27 21:14:10 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1ktcQb-000449-TX for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 27 Dec 2020 21:14:10 +0100 Original-Received: from localhost ([::1]:52708 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ktcQa-0005B9-Q0 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 27 Dec 2020 15:14:08 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45296) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ktcQU-0005Ap-3A for bug-gnu-emacs@gnu.org; Sun, 27 Dec 2020 15:14:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:50321) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ktcQT-0006Mn-SU for bug-gnu-emacs@gnu.org; Sun, 27 Dec 2020 15:14:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ktcQT-0004kU-No for bug-gnu-emacs@gnu.org; Sun, 27 Dec 2020 15:14:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Artem Loenko Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 27 Dec 2020 20:14:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 45455 X-GNU-PR-Package: emacs Original-Received: via spool by 45455-submit@debbugs.gnu.org id=B45455.160909998218146 (code B ref 45455); Sun, 27 Dec 2020 20:14:01 +0000 Original-Received: (at 45455) by debbugs.gnu.org; 27 Dec 2020 20:13:02 +0000 Original-Received: from localhost ([127.0.0.1]:33624 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ktcPV-0004ib-Sr for submit@debbugs.gnu.org; Sun, 27 Dec 2020 15:13:02 -0500 Original-Received: from st43p00im-zteg10061901.me.com ([17.58.63.168]:36716) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ktcPU-0004i7-6X for 45455@debbugs.gnu.org; Sun, 27 Dec 2020 15:13:01 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mac.com; s=1a1hai; t=1609099974; bh=yYKGn8ubcHY86HscJqrBjLFldju5M1qAmQXOVrUnM+g=; h=Content-Type:Mime-Version:Subject:From:Date:Message-Id:To; b=PJjy8aKKllL7aIGGSiVjGS4vz+Jh/Cov2wPQvycaNFS7vPgYbKYGJptduTW3kiyNv K8C8DSNuHzI1RWVv+VqW5JFc3MhLHQLUVdLyuah/3b/X0ciw9/jcuNMZZGTvthVQgt NTANUqmcgr82WQtIV2lZwv85ZOw5Ah5gB0wUS3yq0T/HBerPqtQFkscHt3ADq9hXub i13km0uxl+zrm8SppGC1/wG/3e6MCatlbmfklPU7B6M5y6+DF5dftpW8yky3zRhoMX xNQoYXtnB7/a4/kqOoH9F63/vrY/z9vQ/G9Myy866xbbP8ywOE2rkr4F3oNAayBrCR g9n9ajgVs0GIg== Original-Received: from [192.168.1.21] (cpc157823-brnt5-2-0-cust20.4-2.cable.virginm.net [86.25.108.21]) by st43p00im-zteg10061901.me.com (Postfix) with ESMTPSA id 1E9048603A1; Sun, 27 Dec 2020 20:12:54 +0000 (UTC) In-Reply-To: X-Mailer: Apple Mail (2.3654.40.0.2.32) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.343, 18.0.737 definitions=2020-12-27_16:2020-12-24, 2020-12-27 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-2006250000 definitions=main-2012270129 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:196825 Archived-At: Looks strange indeed.=20 I see that these changes were introduced in this commit =E2=80=93 = https://git.savannah.gnu.org/cgit/emacs.git/commit/?h=3Demacs-27&id=3Dfda9= b3e83a434706c31ab1bee5c15511c0181d5a So, emacs-27 branch does not = compile on Apple Silicon as well any more. Also, I believe, it should be = at least `arm64-apple-darwin` and not `arm-apple-darwin`. Though, I = tried to compile with `arm64-apple-darwin` but got the same error with = `temacs`. I checked LLVM bundled with Xcode 12.3 and LLVM 11.0.0. Both report = `arm64-apple-darwin` as a target (the same for = `-print-effective-triple`: > ~/Projects/emacs $ /opt/homebrew/opt/llvm/bin/clang --version > clang version 11.0.0 > Target: arm64-apple-darwin20.2.0 > Thread model: posix > InstalledDir: /opt/homebrew/opt/llvm/bin > ~/Projects/emacs $ xcrun clang --version > Apple clang version 12.0.0 (clang-1200.0.32.28) > Target: arm64-apple-darwin20.2.0 > Thread model: posix > InstalledDir: = /Volumes/Extended/Archives/Xcode_12.3.app/Contents/Developer/Toolchains/Xc= odeDefault.xctoolchain/usr/bin Though, during the ./configure, `config.guess` identifies the system as = `aarch64-apple-darwin`: > Running ./configure ... > ./configure > ... > checking build system type... aarch64-apple-darwin20.2.0 > checking host system type... aarch64-apple-darwin20.2.0 > =E2=80=A6 > Configured for 'aarch64-apple-darwin20.2.0=E2=80=99. > ~/Projects/emacs $ ./build-aux/config.guess > aarch64-apple-darwin20.2.0 It seems that `clang` is good with both versions as a target. Anyway, the fact is that `temacs` works fine with `aarch64-apple-darwin` = target and does not with `arm(64)-apple-darwin`. I do not know much = about `temacs` and Emacs internals, if you have any leads or theories to = check =E2=80=93 let me know, I will try my best. So far, my best idea is = that we propagate the target to other tool that does not = =E2=80=9Cunderstand=E2=80=9D `arm64-apple-darwin`. Regards, Artem Loenko > On 27 Dec 2020, at 14:12, Philipp Stephani = wrote: >=20 > Am So., 27. Dez. 2020 um 12:54 Uhr schrieb Artem Loenko via Bug > reports for GNU Emacs, the Swiss army knife of text editors > : >>=20 >> Hello there, >>=20 >> Emacs master (as of 8bc727d0b4 "Fix the recent `length' doc string = addition" commit) does not compile on Apple Silicon (M1) anymore. = Compilation fails with the following error: >>=20 >> ./temacs --batch -l loadup --temacs=3Dpbootstrap >> make[1]: *** [bootstrap-emacs.pdmp] Killed: 9 >> make: *** [src] Error 2 >>=20 >> When you try to run the `temacs` under lldb, it shows the following = problem: >>=20 >> (lldb) process launch >> Process 75320 launched: '/Users/dive/Projects/emacs/src/temacs' = (arm64) >> Loading loadup.el (source)... >> ... >> Eager macro-expansion failure: (void-variable search-slow-speed) >> Eager macro-expansion failure: (void-variable search-slow-speed) >> Symbol=E2=80=99s value as variable is void: search-slow-speed >> Process 75320 exited with status =3D 255 (0x000000ff) >>=20 >> The problem was introduced in the "Merge from origin/emacs-27=E2=80=9D = commit =E2=80=93 = https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=3D90ec81f5b243b6b7b= 3ebe2de394b20e8078ebc96 and I believe it was unintentional revert of = DO_CODESIGN within src/Makefile.in: >>=20 >> diff --git a/src/Makefile.in b/src/Makefile.in >> index 39c0f12fe6..19304cca04 100644 >> --- a/src/Makefile.in >> +++ b/src/Makefile.in >> @@ -338,7 +338,7 @@ HAVE_PDUMPER =3D @HAVE_PDUMPER@ >>=20 >> ## ARM Macs require that all code have a valid signature. Since pump >> ## invalidates the signature, we must re-sign to fix it. >> -DO_CODESIGN=3D$(patsubst aarch64-apple-darwin%,yes,@configuration@) >> +DO_CODESIGN=3D$(patsubst arm-apple-darwin%,yes,@configuration@) >=20 > For some reason the @configuration@ value on my system is occasionally > either arm-... or aarch64-..., without a clear pattern. Should we > maybe accept both? Or can we make sure that aarch64-... is detected > consistently?