From 3437e1877bce2e0aad9cb8c05a451cabeb6175ff Mon Sep 17 00:00:00 2001 From: wxiat Date: Tue, 20 Jun 2023 14:24:31 +0800 Subject: [PATCH] cherry-pick `add sw patch #349896d0a48b80b530cfa5cc2bd1fc4ceff68e42`. Signed-off-by: wxiat Signed-off-by: Weisson --- 1001-emacs-add-sw.patch | 86 +++++++++++++++++++++++++++++++++++++++++ emacs.spec | 14 ++++++- 2 files changed, 99 insertions(+), 1 deletion(-) create mode 100644 1001-emacs-add-sw.patch diff --git a/1001-emacs-add-sw.patch b/1001-emacs-add-sw.patch new file mode 100644 index 0000000..bafdfa1 --- /dev/null +++ b/1001-emacs-add-sw.patch @@ -0,0 +1,86 @@ +From f0cc006e3b7f490ece36996dfbef46712cdaf36f Mon Sep 17 00:00:00 2001 +From: wxiat +Date: Tue, 20 Jun 2023 14:20:50 +0800 +Subject: [PATCH] add sw + +Signed-off-by: wxiat +--- + build-aux/config.guess | 8 ++++++++ + build-aux/config.sub | 1 + + configure.ac | 2 +- + src/unexelf.c | 8 +++++++- + 4 files changed, 17 insertions(+), 2 deletions(-) + +diff --git a/build-aux/config.guess b/build-aux/config.guess +index 457a63a..827cd81 100755 +--- a/build-aux/config.guess ++++ b/build-aux/config.guess +@@ -926,6 +926,14 @@ EOF + UNAME_MACHINE=aarch64_be + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; ++ sw_64:Linux:*:*) ++ case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in ++ sw) UNAME_MACHINE=sw_64 ;; ++ esac ++ objdump --private-headers /bin/sh | grep -q ld.so.1 ++ if test "$?" = 0 ; then LIBC=gnulibc1 ; fi ++ echo "$UNAME_MACHINE"-sunway-linux-"$LIBC" ++ exit ;; + alpha:Linux:*:*) + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in + EV5) UNAME_MACHINE=alphaev5 ;; +diff --git a/build-aux/config.sub b/build-aux/config.sub +index 90f19bb..eb9e11d 100755 +--- a/build-aux/config.sub ++++ b/build-aux/config.sub +@@ -1159,6 +1159,7 @@ case $cpu-$vendor in + | aarch64 | aarch64_be \ + | loongarch32 | loongarch64 | loongarchx32 \ + | abacus \ ++ | sw_64 \ + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] \ + | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] \ + | alphapca5[67] | alpha64pca5[67] \ +diff --git a/configure.ac b/configure.ac +index 0b34532..d4d637c 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -703,7 +703,7 @@ case "${canonical}" in + *-apple-darwin* ) + case "${canonical}" in + *-apple-darwin[0-9].*) unported=yes ;; +- i[3456]86-* | x86_64-* | arm-* | aarch64-* ) ;; ++ i[3456]86-* | x86_64-* | arm-* | aarch64-* | sw_64-* ) ;; + * ) unported=yes ;; + esac + opsys=darwin +diff --git a/src/unexelf.c b/src/unexelf.c +index b5cded5..6c1e121 100644 +--- a/src/unexelf.c ++++ b/src/unexelf.c +@@ -120,7 +120,7 @@ typedef struct { + /* + * NetBSD does not have normal-looking user-land ELF support. + */ +-# if defined __alpha__ || defined __sparc_v9__ || defined _LP64 ++# if defined __alpha__ || defined __sparc_v9__ || defined _LP64 || defined __sw_64__ + # define ELFSIZE 64 + # else + # define ELFSIZE 32 +@@ -150,6 +150,12 @@ typedef struct { + # define pHDRR HDRR * + # endif /* __alpha__ */ + ++# ifdef __sw_64__ ++# include ++# define HDRR struct ecoff_symhdr ++# define pHDRR HDRR * ++# endif /* __sw_64__ */ ++ + #ifdef __mips__ /* was in pkgsrc patches for 20.7 */ + # define SHT_MIPS_DEBUG DT_MIPS_FLAGS + # define HDRR struct Elf_Shdr +-- +2.31.1 + diff --git a/emacs.spec b/emacs.spec index d53debc..d3b4e85 100644 --- a/emacs.spec +++ b/emacs.spec @@ -1,5 +1,5 @@ %global _hardened_build 1 -%define anolis_release .0.1 +%define anolis_release .0.2 # This file is encoded in UTF-8. -*- coding: utf-8 -*- Summary: GNU Emacs text editor @@ -35,6 +35,10 @@ Patch7: emacs-htmlfontify-command-injection-vulnerability.patch Patch8: emacs-ruby-mode-local-command-injection-vulnerability.patch Patch9: emacs-ob-latex-command-injection-vulnerability.patch BuildRequires: gcc +# Add by Anolis +Patch1001: 1001-emacs-add-sw.patch +# End of Anolis + BuildRequires: atk-devel BuildRequires: cairo-devel BuildRequires: freetype-devel @@ -261,6 +265,11 @@ ln -s ../../%{name}/%{version}/etc/NEWS doc %build +%ifarch sw_64 +%_update_config_sub +%_update_config_guess +%endif + export CFLAGS="-DMAIL_USE_LOCKF %{build_cflags}" %set_build_flags @@ -510,6 +519,9 @@ rm %{buildroot}%{_datadir}/icons/hicolor/scalable/mimetypes/emacs-document23.svg %doc doc/NEWS BUGS README %changelog +* Tue Mar 19 2024 wxiat - 1:27.2-9.0.2 +- cherry-pick `add sw patch #349896d0a48b80b530cfa5cc2bd1fc4ceff68e42`. + * Wed Dec 06 2023 Xiaoping Liu - 1:27.2-9.0.1 - Add doc sub package - update config.sub and config.guess for loongarch64 (Jingyun Hua) -- Gitee