aboutsummaryrefslogtreecommitdiff
path: root/gnu/packages/patches/flashrom-fix-building-on-aarch64.patch
diff options
context:
space:
mode:
authorEfraim Flashner <efraim@flashner.co.il>2023-01-30 11:33:18 +0200
committerEfraim Flashner <efraim@flashner.co.il>2023-01-30 12:39:40 +0200
commit4cf1acc7f3033b50b0bf19e02c9f522d522d338c (patch)
tree9fd64956ee60304c15387eb394cd649e49f01467 /gnu/packages/patches/flashrom-fix-building-on-aarch64.patch
parentedb8c09addd186d9538d43b12af74d6c7aeea082 (diff)
parent595b53b74e3ef57a1c0c96108ba86d38a170a241 (diff)
downloadguix-4cf1acc7f3033b50b0bf19e02c9f522d522d338c.tar
guix-4cf1acc7f3033b50b0bf19e02c9f522d522d338c.tar.gz
Merge remote-tracking branch 'origin/master' into core-updates
Conflicts: doc/guix.texi gnu/local.mk gnu/packages/admin.scm gnu/packages/base.scm gnu/packages/chromium.scm gnu/packages/compression.scm gnu/packages/databases.scm gnu/packages/diffoscope.scm gnu/packages/freedesktop.scm gnu/packages/gnome.scm gnu/packages/gnupg.scm gnu/packages/guile.scm gnu/packages/inkscape.scm gnu/packages/llvm.scm gnu/packages/openldap.scm gnu/packages/pciutils.scm gnu/packages/ruby.scm gnu/packages/samba.scm gnu/packages/sqlite.scm gnu/packages/statistics.scm gnu/packages/syndication.scm gnu/packages/tex.scm gnu/packages/tls.scm gnu/packages/version-control.scm gnu/packages/xml.scm guix/build-system/copy.scm guix/scripts/home.scm
Diffstat (limited to 'gnu/packages/patches/flashrom-fix-building-on-aarch64.patch')
-rw-r--r--gnu/packages/patches/flashrom-fix-building-on-aarch64.patch89
1 files changed, 89 insertions, 0 deletions
diff --git a/gnu/packages/patches/flashrom-fix-building-on-aarch64.patch b/gnu/packages/patches/flashrom-fix-building-on-aarch64.patch
new file mode 100644
index 0000000000..9f54305b47
--- /dev/null
+++ b/gnu/packages/patches/flashrom-fix-building-on-aarch64.patch
@@ -0,0 +1,89 @@
+commit da6b3b70cb852dd8e9f9e21aef95fa83e7f7ab0d
+Author: Pyry Kontio <pyry.kontio@drasa.eu>
+Date: Mon Jul 6 12:57:35 2020 +0900
+
+ Makefile: Fix building on AArch64 NixOS
+
+ The parsing of the output of archtest.c produced an unexpected
+ value on AArch64 NixOS. For example, the make variable ARCH was set to:
+
+ ```
+ bit outside of fd_set selected
+ arm
+ ```
+
+ This made the arch and OS checks fail.
+
+ This commit simplifies the parsing, making it more robust.
+
+ The C files archtest.c, endiantest.c and os.h used to set the
+ TARGET_OS, ARCH and ENDIAN variables, respectively, output
+ the result of the test as the final line, so just extracting
+ the final line and removing double quoting is enough.
+
+ This commit also fixes a bug with debug_shell lacking escaping
+ single quotes, which prevented using the single quote in the
+ debug_shell calls. It used to work by accident before this fix;
+ the line in the call happened to contain a balanced pair of double
+ quotes and lacked other characters that needed escaping, which
+ didn't break the debug_shell, but this was accidental and very
+ brittle.
+
+ Signed-off-by: Pyry Kontio <pyry.kontio@drasa.eu>
+ Change-Id: Iaa4477a71e758cf9ecad2c22f3b77bc6508a3510
+ Reviewed-on: https://review.coreboot.org/c/flashrom/+/43140
+ Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
+ Reviewed-by: Angel Pons <th3fanbus@gmail.com>
+
+diff --git a/Makefile b/Makefile
+index f3f7717e..e475cbdb 100644
+--- a/Makefile
++++ b/Makefile
+@@ -83,7 +83,8 @@ dummy_for_make_3_80:=$(shell printf "Build started on %s\n\n" "$$(date)" >$(BUIL
+
+ # Provide an easy way to execute a command, print its output to stdout and capture any error message on stderr
+ # in the build details file together with the original stdout output.
+-debug_shell = $(shell export LC_ALL=C ; { echo 'exec: export LC_ALL=C ; { $(1) ; }' >&2; { $(1) ; } | tee -a $(BUILD_DETAILS_FILE) ; echo >&2 ; } 2>>$(BUILD_DETAILS_FILE))
++debug_shell = $(shell export LC_ALL=C ; { echo 'exec: export LC_ALL=C ; { $(subst ','\'',$(1)) ; }' >&2; \
++ { $(1) ; } | tee -a $(BUILD_DETAILS_FILE) ; echo >&2 ; } 2>>$(BUILD_DETAILS_FILE))
+
+ ###############################################################################
+ # General OS-specific settings.
+@@ -106,7 +107,8 @@ endif
+ # IMPORTANT: The following line must be placed before TARGET_OS is ever used
+ # (of course), but should come after any lines setting CC because the line
+ # below uses CC itself.
+-override TARGET_OS := $(strip $(call debug_shell,$(CC) $(CPPFLAGS) -E os.h 2>/dev/null | grep -v '^\#' | grep '"' | cut -f 2 -d'"'))
++override TARGET_OS := $(strip $(call debug_shell,$(CC) $(CPPFLAGS) -E os.h 2>/dev/null \
++ | tail -1 | cut -f 2 -d'"'))
+
+ ifeq ($(TARGET_OS), Darwin)
+ override CPPFLAGS += -I/opt/local/include -I/usr/local/include
+@@ -490,8 +492,10 @@ endif
+ # IMPORTANT: The following line must be placed before ARCH is ever used
+ # (of course), but should come after any lines setting CC because the line
+ # below uses CC itself.
+-override ARCH := $(strip $(call debug_shell,$(CC) $(CPPFLAGS) -E archtest.c 2>/dev/null | grep -v '^\#' | grep '"' | cut -f 2 -d'"'))
+-override ENDIAN := $(strip $(call debug_shell,$(CC) $(CPPFLAGS) -E endiantest.c 2>/dev/null | grep -v '^\#'))
++override ARCH := $(strip $(call debug_shell,$(CC) $(CPPFLAGS) -E archtest.c 2>/dev/null \
++ | tail -1 | cut -f 2 -d'"'))
++override ENDIAN := $(strip $(call debug_shell,$(CC) $(CPPFLAGS) -E endiantest.c 2>/dev/null \
++ | tail -1))
+
+ # Disable the internal programmer on unsupported architectures (everything but x86 and mipsel)
+ ifneq ($(ARCH)-little, $(filter $(ARCH),x86 mips)-$(ENDIAN))
+@@ -1299,12 +1303,12 @@ compiler: featuresavailable
+ @printf "Target arch is "
+ @# FreeBSD wc will output extraneous whitespace.
+ @echo $(ARCH)|wc -w|grep -q '^[[:blank:]]*1[[:blank:]]*$$' || \
+- ( echo "unknown. Aborting."; exit 1)
++ ( echo "unknown (\"$(ARCH)\"). Aborting."; exit 1)
+ @printf "%s\n" '$(ARCH)'
+ @printf "Target OS is "
+ @# FreeBSD wc will output extraneous whitespace.
+ @echo $(TARGET_OS)|wc -w|grep -q '^[[:blank:]]*1[[:blank:]]*$$' || \
+- ( echo "unknown. Aborting."; exit 1)
++ ( echo "unknown (\"$(TARGET_OS)\"). Aborting."; exit 1)
+ @printf "%s\n" '$(TARGET_OS)'
+ ifeq ($(TARGET_OS), libpayload)
+ @$(CC) --version 2>&1 | grep -q coreboot || \