From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Nathan Hjelm via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#44774: 27.1; emacs build fails on M1 Mac Date: Fri, 20 Nov 2020 23:11:36 -0000 Message-ID: <3a4fa247-e98d-4f06-9c45-5744733147a9@me.com> Reply-To: Nathan Hjelm Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=Apple-Webmail-42--250d3726-0774-48ea-bc52-005f49abc4e0 Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25399"; mail-complaints-to="usenet@ciao.gmane.io" To: 44774@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Nov 21 01:34:15 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 1kgGr1-0006S7-8R for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 21 Nov 2020 01:34:15 +0100 Original-Received: from localhost ([::1]:34562 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kgGqz-0004VN-SW for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 20 Nov 2020 19:34:13 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55892) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kgGqo-0004Ts-Bf for bug-gnu-emacs@gnu.org; Fri, 20 Nov 2020 19:34:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:33018) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kgGqo-0002y3-3c for bug-gnu-emacs@gnu.org; Fri, 20 Nov 2020 19:34:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kgGqn-0005D7-Vz for bug-gnu-emacs@gnu.org; Fri, 20 Nov 2020 19:34:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Nathan Hjelm Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 21 Nov 2020 00:34:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 44774 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.160591878219941 (code B ref -1); Sat, 21 Nov 2020 00:34:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 21 Nov 2020 00:33:02 +0000 Original-Received: from localhost ([127.0.0.1]:44564 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kgGpm-0005BB-QT for submit@debbugs.gnu.org; Fri, 20 Nov 2020 19:33:02 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:44078) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kgFZA-0003C3-LR for submit@debbugs.gnu.org; Fri, 20 Nov 2020 18:11:45 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37198) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kgFZA-0001gL-Gh for bug-gnu-emacs@gnu.org; Fri, 20 Nov 2020 18:11:44 -0500 Original-Received: from mr85p00im-hyfv06021401.me.com ([17.58.23.190]:60675) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kgFZ5-0002TH-Tg for bug-gnu-emacs@gnu.org; Fri, 20 Nov 2020 18:11:44 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=me.com; s=1a1hai; t=1605913896; bh=zGnwG7COnNttEEvn1ObnXi9REFhL3/TMYYgqv7hw6/k=; h=To:From:Subject:Date:Message-id:Content-Type:MIME-Version; b=DBpu+rdCvP/B9hzQYAVaQAJMQiOBB89MZNpdAFVA+kGT514HXw1K5fBvilHEmmizx wH9fD4f0tomNkDjxLipPg6JJSEUHnAVAYm0nIhiYy+c0New/9jf6C0F+5ftqIkuslW mKjFZUYspNHGHG7Gs/5hIqiQLu1IoGoxAMxtomzvRiJros4Z1FMT8I4sc6qBcMDT5r aRzldMFZaq2BS3A36XG/XCv8s9Q+JVEnxHqzf48kIuS0hSFC0Evx8qZ2RVxWe/s8R2 k2vKBQU1iCeSIsG5477UOpc4+uoYLNcARCQkRbE7wI33HTQdFBLrHbBPeiLl4CCgdn XoB14V/w6FE5A== Original-Received: from mr85p00im-hyfv06021401.me.com (mr85p00im-hyfv06021401.me.com [17.58.23.190]) by mr85p00im-hyfv06021401.me.com (Postfix) with ESMTPS id 88C7A9C01D2 for ; Fri, 20 Nov 2020 23:11:36 +0000 (UTC) Original-Received: from localhost (mr90p00im-ztdg07043901.me.com [17.120.17.199]) by mr85p00im-hyfv06021401.me.com (Postfix) with ESMTP id 752229C03DF for ; Fri, 20 Nov 2020 23:11:36 +0000 (UTC) X-Mailer: iCloud MailClient2021Project35 MailServer2022B198.10000-Famine2022-0-096c48a21ae2 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.312, 18.0.737 definitions=2020-11-20_17:2020-11-20, 2020-11-20 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=15 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-2011200152 Received-SPF: pass client-ip=17.58.23.190; envelope-from=hjelmn@me.com; helo=mr85p00im-hyfv06021401.me.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, MIME_QP_LONG_LINE=0.001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Fri, 20 Nov 2020 19:32:57 -0500 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:193804 Archived-At: --Apple-Webmail-42--250d3726-0774-48ea-bc52-005f49abc4e0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8; format=flowed This bug report is being generated on a version of emacs built with the=0A= below fix.=0A=0Aemacs 27.1 (and git master) fails to build on any ARM64 Ma= c. The error=0Ais:=0A=0A./temacs Killed: 9=0A=0AThis issue is caused by an= invalid code signature. ld signs a binary by=0Adefault with an ad-hoc sig= nature. This signature is invalidated by the=0Amake-fingerprint program. T= o restore the binary it is necessary to=0Are-sign the binary. This can be = done by running codesign -s - on the=0Abinary. This will re-sign the binar= y with an ad-hoc signature. The=0Afollowing patch does just this but only = on ARM64 systems. Legacy Intel=0Asystems do not yet require a code signatu= re to work (though this=0Awouldn't break them). See the attached patch.=0A= =0Adiff --git a/configure.ac b/configure.ac=0Aindex 888b415148..6376e5e83e= 100644=0A--- a/configure.ac=0A+++ b/configure.ac=0A@@ -5107,6 +5107,11 @@= case $opsys in=0A=C2=A0=C2=A0 =C2=A0 dnl Not DARWIN, because Panther and = lower CoreFoundation.h use DARWIN to=0A=C2=A0=C2=A0 =C2=A0 dnl distinguish= macOS from pure Darwin.=0A=C2=A0=C2=A0 =C2=A0 AC_DEFINE(DARWIN_OS, [], [D= efine if the system is Darwin.])=0A+=C2=A0 =C2=A0 case "${canonical}" in=0A= +=C2=A0 =C2=A0 =C2=A0 arm-* | aarch64-* )=0A+=C2=A0 =C2=A0 =C2=A0 =C2=A0 A= C_CHECK_PROGS(CODESIGN, [codesign], [yes])=0A+=C2=A0 =C2=A0 =C2=A0 =C2=A0 = ;;=0A+=C2=A0 =C2=A0 esac=0A=C2=A0=C2=A0 =C2=A0 ;;=0A=C2=A0=0A=C2=A0=C2=A0 = gnu-linux | gnu-kfreebsd )=0Adiff --git a/src/Makefile.in b/src/Makefile.i= n=0Aindex c5fb2ea3ab..0874db6489 100644=0A--- a/src/Makefile.in=0A+++ b/sr= c/Makefile.in=0A@@ -336,6 +336,8 @@ DUMPING=3D@DUMPING@=0A=C2=A0CHECK_STRU= CTS =3D @CHECK_STRUCTS@=0A=C2=A0HAVE_PDUMPER =3D @HAVE_PDUMPER@=0A=C2=A0=0A= +CODESIGN =3D @CODESIGN@=0A+=0A=C2=A0# 'make' verbosity.=0A=C2=A0AM_DEFAUL= T_VERBOSITY =3D @AM_DEFAULT_VERBOSITY@=0A=C2=A0=0A@@ -653,6 +655,12 @@ tem= acs$(EXEEXT): $(LIBXMENU) $(ALLOBJS) $(LIBEGNU_ARCHIVE) $(EMACSRES) \=0A=C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 $(ALLOBJS) $(LIBEGNU_ARCHIVE) $(W32_RES_LI= NK) $(LIBES)=0A=C2=A0ifeq ($(HAVE_PDUMPER),yes)=0A=C2=A0 =C2=A0 =C2=A0 =C2= =A0 $(AM_V_at)$(MAKE_PDUMPER_FINGERPRINT) $@.tmp=0A+=0A+=C2=A0 ifneq ($(CO= DESIGN),)=0A+## make-fingerprint breaks the code signature. This code sign= ature must=0A+## be valid for the executable to run on a ARM Mac.=0A+ =C2=A0= =C2=A0 =C2=A0 $(CODESIGN) -s - $@.tmp=0A+=C2=A0 endif=0A=C2=A0endif=0A=C2= =A0 =C2=A0 =C2=A0 =C2=A0 $(AM_V_at)mv $@.tmp $@=0A=C2=A0 =C2=A0 =C2=A0 =C2= =A0 $(MKDIR_P) $(etc)=0A=0A=0A=0AIn GNU Emacs 27.1 (build 1, arm-apple-dar= win20.1.0)=0A=C2=A0of 2020-11-20 built on Mac-mini.local=0ASystem Descript= ion:=C2=A0 macOS 11.0.1=0A=0ARecent messages:=0AFor information about GNU = Emacs and the GNU system, type C-h C-a.=0Anormal-splash-screen: Opening di= rectory: Permission denied, /Users/hjelmn/.emacs.d/auto-save-list=0AConfig= ured using:=0A=C2=A0'configure --disable-silent-rules=0A=C2=A0--enable-loc= allisppath=3D/opt/homebrew/share/emacs/site-lisp=0A=C2=A0--infodir=3D/opt/= homebrew/Cellar/emacs/27.1/share/info/emacs=0A=C2=A0--prefix=3D/opt/homebr= ew/Cellar/emacs/27.1 --with-gnutls --without-x=0A=C2=A0--with-xml2 --witho= ut-dbus --with-modules --without-ns=0A=C2=A0--without-imagemagick'=0A=0ACo= nfigured features:=0ANOTIFY KQUEUE ACL GNUTLS LIBXML2 ZLIB XIM MODULES THR= EADS JSON PDUMPER=0AGMP=0A=0AImportant settings:=0A=C2=A0 locale-coding-sy= stem: nil=0A=0AMajor mode: Lisp Interaction=0A=0AMinor modes in effect:=0A= =C2=A0 tooltip-mode: t=0A=C2=A0 global-eldoc-mode: t=0A=C2=A0 eldoc-mode: = t=0A=C2=A0 electric-indent-mode: t=0A=C2=A0 menu-bar-mode: t=0A=C2=A0 file= -name-shadow-mode: t=0A=C2=A0 global-font-lock-mode: t=0A=C2=A0 font-lock-= mode: t=0A=C2=A0 auto-composition-mode: t=0A=C2=A0 auto-encryption-mode: t= =0A=C2=A0 auto-compression-mode: t=0A=C2=A0 line-number-mode: t=0A=C2=A0 t= ransient-mark-mode: t=0A=0ALoad-path shadows:=0ANone found.=0A=0AFeatures:= =0A(shadow regexp-opt sort mail-extr emacsbug message rmc puny dired=0Adir= ed-loaddefs format-spec rfc822 mml easymenu mml-sec password-cache=0Aepa d= erived epg epg-config gnus-util rmail tool-bar rmail-loaddefs=0Atext-prope= rty-search time-date subr-x seq mm-decode mm-bodies mm-encode=0Amail-parse= rfc2231 mailabbrev gmm-utils mailheader cl-loaddefs cl-lib=0Asendmail rfc= 2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils=0Aterm/xterm xterm b= yte-opt gv bytecomp byte-compile cconv disp-table=0Atooltip eldoc electric= uniquify ediff-hook vc-hooks lisp-float-type=0Atabulated-list replace new= comment text-mode elisp-mode lisp-mode=0Aprog-mode register page tab-bar m= enu-bar rfn-eshadow isearch timer=0Aselect mouse jit-lock font-lock syntax= facemenu font-core=0Aterm/tty-colors frame minibuffer cl-generic cham geo= rgian utf-8-lang=0Amisc-lang vietnamese tibetan thai tai-viet lao korean j= apanese eucjp-ms=0Acp51932 hebrew greek romanian slovak czech european eth= iopic indian=0Acyrillic chinese composite charscript charprop case-table e= pa-hook=0Ajka-cmpr-hook help simple abbrev obarray cl-preloaded nadvice lo= addefs=0Abutton faces cus-face macroexp files text-properties overlay sha1= md5=0Abase64 format env code-pages mule custom widget hashtable-print-rea= dable=0Abackquote threads kqueue multi-tty make-network-process emacs)=0A=0A= Memory information:=0A((conses 16 47079 7064)=0A=C2=A0(symbols 48 6013 1)=0A= =C2=A0(strings 32 15896 1743)=0A=C2=A0(string-bytes 1 514215)=0A=C2=A0(vec= tors 16 7411)=0A=C2=A0(vector-slots 8 79909 4622)=0A=C2=A0(floats 8 22 251= )=0A=C2=A0(intervals 56 178 1)=0A=C2=A0(buffers 1000 12)) --Apple-Webmail-42--250d3726-0774-48ea-bc52-005f49abc4e0 Content-Type: multipart/related; type="text/html"; boundary=Apple-Webmail-86--250d3726-0774-48ea-bc52-005f49abc4e0 --Apple-Webmail-86--250d3726-0774-48ea-bc52-005f49abc4e0 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8;

This bug report is being generated on a version of emacs built with th= e

below fix.


emacs 27.1 (and git master) fails to build on any ARM64 Mac. Th= e error

is:


./temacs Killed: 9

This issue is caused by an invalid code signature. ld sign= s a binary by

default with an ad-hoc signature. This signature is= invalidated by the

make-fingerprint program. To restore the bina= ry it is necessary to

re-sign the binary. This can be done by run= ning codesign -s - on the

binary. This will re-sign the binary wi= th an ad-hoc signature. The

following patch does just this but on= ly on ARM64 systems. Legacy Intel

systems do not yet require a co= de signature to work (though this

wouldn't break them). See the a= ttached patch.

diff --git a/configure.ac b/configure.ac

index 888b415148..63= 76e5e83e 100644

--- a/configure.ac

+++ b/configure.ac

@@ -5107,6 +5107,11 @@ case $opsys in

     dnl Not DARWIN, because Panth= er and lower CoreFoundation.h use DARWIN to

     dnl distinguish macOS from pur= e Darwin.

   &nbs= p; AC_DEFINE(DARWIN_OS, [], [Define if the system is Darwin.])

+    case "${c= anonical}" in

+   = ;   arm-* | aarch64-* )

+        AC_CHECK_PROGS(CODESIGN, [cod= esign], [yes])

+  &nbs= p;     ;;

+    esac

=      ;;

 

   gnu-linux | gnu-kfreebsd= )

diff --git a/src/Makefile.in b/src/Makefile.in

index = c5fb2ea3ab..0874db6489 100644

--- a/src/Makefile.in

+++ b/= src/Makefile.in

@@ -336,6 +336,8 @@ DUMPING=3D@DUMPING@

=  CHECK_STRUCTS =3D @CHEC= K_STRUCTS@

 HAV= E_PDUMPER =3D @HAVE_PDUMPER@

 

+CODESIGN= =3D @CODESIGN@

+

=  # 'make' verbosity.

 AM_DEFAULT_VERBOSITY =3D @AM_DEFAULT_VERBOSITY@<= /p>

 

@@ -653,6 +655,12 @@ temacs$(EXEEXT): $(LIBXM= ENU) $(ALLOBJS) $(LIBEGNU_ARCHIVE) $(EMACSRES) \

          $(ALLOBJS)= $(LIBEGNU_ARCHIVE) $(W32_RES_LINK) $(LIBES)

 ifeq ($(HAVE_PDUMPER),yes)

        $(AM_V_a= t)$(MAKE_PDUMPER_FINGERPRINT) $@.tmp

+

+  ifneq ($(CODESIGN),)

+## make= -fingerprint breaks the code signature. This code signature must

= +## be valid for the executable to run on a ARM Mac.

+       $(CODESIGN) -s - $= @.tmp

+  endif<= /span>

 endif

        = $(AM_V_at)mv $@.tmp $@

&nbs= p;       $(MKDIR_P) $(etc)




<= p style=3D"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #00= 0000;" data-mce-style=3D"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Men= lo; color: #000000;">In= GNU Emacs 27.1 (build 1, arm-apple-darwin20.1.0)

 of 2020-11-20 built on Mac-mini.local<= /span>

System Description:  <= /span>macOS 11.0.1


Recent messages:

For information about GNU Emacs and the = GNU system, type C-h C-a.

normal-splash-screen: Opening directory= : Permission denied, /Users/hjelmn/.emacs.d/auto-save-list

Config= ured using:

 'c= onfigure --disable-silent-rules

 --enable-locallisppath=3D/opt/homebrew/share/emacs/site-= lisp

 --infodir= =3D/opt/homebrew/Cellar/emacs/27.1/share/info/emacs

 --prefix=3D/opt/homebrew/Cellar/emacs= /27.1 --with-gnutls --without-x

 --with-xml2 --without-dbus --with-modules --without-ns

 --without-image= magick'


Con= figured features:

NOTIFY KQUEUE ACL GNUTLS LIBXML2 ZLIB XIM MODUL= ES THREADS JSON PDUMPER

GMP


Important settings:

  locale-coding-system: nil



Minor modes in effect:=

  tooltip-mode: t

  global-eldoc-mode: t

  eldoc-mode: t

  electric-in= dent-mode: t

  menu-bar-mode: t

  file-name-shadow-mode: t

  global-font= -lock-mode: t

  font-lock-mode: t

  auto-composition-mode: t

  auto-enc= ryption-mode: t

  auto-compression-mode: t

  line-number-mode: t

  tran= sient-mark-mode: t


Load-path shadows:

None found.


Features:

(shadow regexp-opt sort mail-extr emacsbug message rmc puny dired

<= p style=3D"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #00= 0000;" data-mce-style=3D"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Men= lo; color: #000000;">dired-loaddefs format-spec rfc822 mml easymenu mml-se= c password-cache

epa derived epg epg-config gnus-= util rmail tool-bar rmail-loaddefs

text-property-= search time-date subr-x seq mm-decode mm-bodies mm-encode

mail-parse rfc2231 mailabbrev gmm-utils mailheader cl-loaddefs cl= -lib

sendmail rfc2047 rfc2045 ietf-drums mm-util = mail-prsvr mail-utils

term/xterm xterm byte-opt g= v bytecomp byte-compile cconv disp-table

tooltip = eldoc electric uniquify ediff-hook vc-hooks lisp-float-type

tabulated-list replace newcomment text-mode elisp-mode lisp-mod= e

prog-mode register page tab-bar menu-bar rfn-es= hadow isearch timer

select mouse jit-lock font-lo= ck syntax facemenu font-core

term/tty-colors fram= e minibuffer cl-generic cham georgian utf-8-lang

= misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms

cp51932 hebrew greek romanian slovak czech european= ethiopic indian

cyrillic chinese composite chars= cript charprop case-table epa-hook

jka-cmpr-hook = help simple abbrev obarray cl-preloaded nadvice loaddefs

button faces cus-face macroexp files text-properties overlay sha1 = md5

base64 format env code-pages mule custom widg= et hashtable-print-readable

backquote threads kqu= eue multi-tty make-network-process emacs)


Memory info= rmation:

((conses 16 47079 7064)

 (symbols 48 60= 13 1)

 = ;(strings 32 15896 1743)

 (string-bytes 1 514215)

 (vectors 16 74= 11)

 <= /span>(vector-slots 8 79909 4622)

 (floats 8 22 251)

 (intervals 56 178 = 1)

 (buffers 1000 12))

--Apple-Webmail-86--250d3726-0774-48ea-bc52-005f49abc4e0-- --Apple-Webmail-42--250d3726-0774-48ea-bc52-005f49abc4e0--