From c1f6eb283b11662f408e63c3ec0b93a85dd7d04e Mon Sep 17 00:00:00 2001 From: lanruo Date: Fri, 11 Aug 2023 11:44:03 +0800 Subject: [PATCH] add loongarch64 support --- gnulib-68df637-sw.patch | 37 +++++++++++++++++++++++++++++++++++++ gnulib.spec | 13 ++++++++++++- 2 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 gnulib-68df637-sw.patch diff --git a/gnulib-68df637-sw.patch b/gnulib-68df637-sw.patch new file mode 100644 index 0000000..4993272 --- /dev/null +++ b/gnulib-68df637-sw.patch @@ -0,0 +1,37 @@ +diff -Naur gnulib-68df637.org/build-aux/config.guess gnulib-68df637.sw/build-aux/config.guess +--- gnulib-68df637.org/build-aux/config.guess 2022-03-28 02:07:23.081103160 +0000 ++++ gnulib-68df637.sw/build-aux/config.guess 2022-03-28 02:07:26.021103160 +0000 +@@ -913,6 +913,14 @@ + 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 -Naur gnulib-68df637.org/build-aux/config.sub gnulib-68df637.sw/build-aux/config.sub +--- gnulib-68df637.org/build-aux/config.sub 2022-03-28 02:07:23.081103160 +0000 ++++ gnulib-68df637.sw/build-aux/config.sub 2022-03-28 02:07:26.021103160 +0000 +@@ -568,6 +568,7 @@ + # Some are omitted here because they have special meanings below. + 1750a | 580 \ + | a29k \ ++ | sw_64 \ + | aarch64 | aarch64_be \ + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ + | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ +@@ -691,6 +692,7 @@ + # Recognize the basic CPU types with company name. + 580-* \ + | a29k-* \ ++ | sw_64-* \ + | aarch64-* | aarch64_be-* \ + | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ + | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ diff --git a/gnulib.spec b/gnulib.spec index 91102b7..c5e20e3 100644 --- a/gnulib.spec +++ b/gnulib.spec @@ -1,12 +1,14 @@ Name: gnulib Version: 0 -Release: 30.20180720git +Release: 31.20180720git Summary: The GNU Portability Library License: Public Domain and BSD and GPLv2+ and GPLv3 and GPLv3+ and LGPLv2 and LGPLv2+ and LGPLv3+ URL: https://www.gnu.org/software/gnulib Source0: https://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=snapshot;h=68df637;sf=tgz;name=gnulib-68df637.tar.gz#/gnulib-68df637.tar.gz Patch0: CVE-2018-17942.patch +Patch3000: gnulib-68df637-sw.patch BuildRequires: perl-generators texinfo java-1.8.0-openjdk-devel gettext-devel bison gperf libtool help2man git gcc_secure +BuildRequires: perl-Locale-gettext %description Gnulib is a central location for common GNU code, intended to be @@ -38,6 +40,10 @@ This package contains help docs for gnulib. And Provides ChangeLog files. %prep %autosetup -n gnulib-68df637 -p1 -Sgit +%ifarch loongarch64 +%_update_config_guess +%_update_config_sub +%endif toRemove="lib-symbol-visibility havelib .*-obsolete localcharset gettext-h gettext alloca-opt alloca " @@ -61,7 +67,9 @@ cd build-tests %make_build cd - +%ifnarch sw_64 javac -d lib -source 1.3 -target 1.3 lib/javaversion.java +%endif %make_build MODULES.html sed -i -r 's#HREF="(lib|m4|modules)#HREF="%{_datadir}/gnulib/\1#g' MODULES.html sed -i "/^[ ]*gnulib_dir=/s#\`[^\`]*\`#%{_datadir}/gnulib#" gnulib-tool @@ -115,6 +123,9 @@ fi %license doc/COPYINGv2 %changelog +* Sat May 06 2023 yangchenguang - 0-31.20180720git +- add loongarch64 support + * Wed Nov 30 2022 caodongxia - 0-30.20180720git - Add the compilation dependency java-1.8.0-openjdk-devel -- Gitee