all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Nathan Hjelm via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: 44774@debbugs.gnu.org
Subject: bug#44774: 27.1; emacs build fails on M1 Mac
Date: Fri, 20 Nov 2020 23:11:36 -0000	[thread overview]
Message-ID: <3a4fa247-e98d-4f06-9c45-5744733147a9@me.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 4958 bytes --]

This bug report is being generated on a version of emacs built with the
below fix.

emacs 27.1 (and git master) fails to build on any ARM64 Mac. The error
is:

./temacs Killed: 9

This issue is caused by an invalid code signature. ld signs a binary by
default with an ad-hoc signature. This signature is invalidated by the
make-fingerprint program. To restore the binary it is necessary to
re-sign the binary. This can be done by running codesign -s - on the
binary. This will re-sign the binary with an ad-hoc signature. The
following patch does just this but only on ARM64 systems. Legacy Intel
systems do not yet require a code signature to work (though this
wouldn't break them). See the attached patch.

diff --git a/configure.ac b/configure.ac
index 888b415148..6376e5e83e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -5107,6 +5107,11 @@ case $opsys in
     dnl Not DARWIN, because Panther and lower CoreFoundation.h use DARWIN to
     dnl distinguish macOS from pure Darwin.
     AC_DEFINE(DARWIN_OS, [], [Define if the system is Darwin.])
+    case "${canonical}" in
+      arm-* | aarch64-* )
+        AC_CHECK_PROGS(CODESIGN, [codesign], [yes])
+        ;;
+    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=@DUMPING@
 CHECK_STRUCTS = @CHECK_STRUCTS@
 HAVE_PDUMPER = @HAVE_PDUMPER@
 
+CODESIGN = @CODESIGN@
+
 # 'make' verbosity.
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 
@@ -653,6 +655,12 @@ temacs$(EXEEXT): $(LIBXMENU) $(ALLOBJS) $(LIBEGNU_ARCHIVE) $(EMACSRES) \
          $(ALLOBJS) $(LIBEGNU_ARCHIVE) $(W32_RES_LINK) $(LIBES)
 ifeq ($(HAVE_PDUMPER),yes)
        $(AM_V_at)$(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
 endif
        $(AM_V_at)mv $@.tmp $@
        $(MKDIR_P) $(etc)



In GNU Emacs 27.1 (build 1, arm-apple-darwin20.1.0)
 of 2020-11-20 built on Mac-mini.local
System Description:  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
Configured using:
 'configure --disable-silent-rules
 --enable-locallisppath=/opt/homebrew/share/emacs/site-lisp
 --infodir=/opt/homebrew/Cellar/emacs/27.1/share/info/emacs
 --prefix=/opt/homebrew/Cellar/emacs/27.1 --with-gnutls --without-x
 --with-xml2 --without-dbus --with-modules --without-ns
 --without-imagemagick'

Configured features:
NOTIFY KQUEUE ACL GNUTLS LIBXML2 ZLIB XIM MODULES THREADS JSON PDUMPER
GMP

Important settings:
  locale-coding-system: nil

Major mode: Lisp Interaction

Minor modes in effect:
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  electric-indent-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-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Load-path shadows:
None found.

Features:
(shadow regexp-opt sort mail-extr emacsbug message rmc puny dired
dired-loaddefs format-spec rfc822 mml easymenu mml-sec 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 gv 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-mode
prog-mode register page tab-bar menu-bar rfn-eshadow isearch timer
select mouse jit-lock font-lock syntax facemenu font-core
term/tty-colors frame 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 charscript 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 widget hashtable-print-readable
backquote threads kqueue multi-tty make-network-process emacs)

Memory information:
((conses 16 47079 7064)
 (symbols 48 6013 1)
 (strings 32 15896 1743)
 (string-bytes 1 514215)
 (vectors 16 7411)
 (vector-slots 8 79909 4622)
 (floats 8 22 251)
 (intervals 56 178 1)
 (buffers 1000 12))

[-- Attachment #2.1: Type: text/html, Size: 41635 bytes --]

                 reply	other threads:[~2020-11-20 23:11 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3a4fa247-e98d-4f06-9c45-5744733147a9@me.com \
    --to=bug-gnu-emacs@gnu.org \
    --cc=44774@debbugs.gnu.org \
    --cc=hjelmn@me.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.