aboutsummaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-support/emacs/files/avoid-running-host-binaries-for-sanity.patch
blob: 719ee4bce92f82ca0ce9803fa2878d162f9949ca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
Upstream-Status: Inappropriate  [OE-Specific]

Emacs introduced a sanity-check for the build artifacts, where it
runs the newly built emacs to perform some checks.

This is not going to work for us since we are cross-compiling,
we need to avoid running target binaries on the host

Signed-off-by: Alejandro Hernandez Samaniego <alejandro@enedino.org>

Index: emacs-29.1/Makefile.in
===================================================================
--- emacs-29.1.orig/Makefile.in
+++ emacs-29.1/Makefile.in
@@ -416,19 +416,10 @@ advice-on-failure:
 	@exit ${exit-status}
 
 sanity-check:
-	@[ -f .no-advice-on-failure ] && exit 0; true
-	@v=$$(src/emacs${EXEEXT} --batch --eval \
-	  '(progn (defun f (n) (if (= 0 n) 1 (* n (f (- n 1))))) (princ (f 10)))' \
-	  2> /dev/null); \
-	[ "X$$v" = "X3628800" ] && exit 0; \
-	echo >&2 '***'; \
-	echo >&2 '*** '"\"make ${make-target}\" succeeded, but Emacs is not functional."; \
-	echo >&2 '***'; \
-	cat Makefile | \
-	  sed -n '/^# ADVICE-ON-FAILURE-BEGIN:${make-target}/,$${p;/^# ADVICE-ON-FAILURE-END:${make-target}/q;};' | \
-	  sed 's/^# /*** /' | grep -v '^\*\*\* ADVICE-ON-FAILURE-' >&2; \
-	echo >&2 '***'; \
-	exit 1
+# The Makefile will try to call the newly built emacs to perform some checks
+# this is not going to work since it was (probably) built for a different architecture.
+# Avoid calling target binaries from the host and simply assume our build artifacts work.
+	exit 0
 
 .PHONY: all ${SUBDIR} blessmail epaths-force epaths-force-w32 epaths-force-ns-self-contained etc-emacsver