From 44c74a19f9cc1e65cfa5ac51c660e50847b41127 Mon Sep 17 00:00:00 2001 From: lijing22222 Date: Fri, 1 Mar 2024 14:29:12 +0800 Subject: [PATCH 1/5] Add Hygon Support --- glibc-Add-Hygon-Support.patch | 28 ++++++++++++++++++++++++++++ glibc.spec | 7 +++++-- 2 files changed, 33 insertions(+), 2 deletions(-) create mode 100644 glibc-Add-Hygon-Support.patch diff --git a/glibc-Add-Hygon-Support.patch b/glibc-Add-Hygon-Support.patch new file mode 100644 index 0000000..c0db837 --- /dev/null +++ b/glibc-Add-Hygon-Support.patch @@ -0,0 +1,28 @@ +From 76748aa5bc937b5e750d9335b7a28d0a05127ac4 Mon Sep 17 00:00:00 2001 +From: lijing22222 +Date: Fri, 1 Mar 2024 13:01:40 +0800 +Subject: [PATCH] Add Hygon Support + +--- + glibc-2.28/sysdeps/x86/cpu-features.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/glibc-2.28/sysdeps/x86/cpu-features.c b/glibc-2.28/sysdeps/x86/cpu-features.c +index ea0b64fd..9e3787ef 100644 +--- a/glibc-2.28/sysdeps/x86/cpu-features.c ++++ b/glibc-2.28/sysdeps/x86/cpu-features.c +@@ -344,8 +344,9 @@ init_cpu_features (struct cpu_features *cpu_features) + cpu_features->feature[index_arch_Prefer_No_AVX512] + |= bit_arch_Prefer_No_AVX512; + } +- /* This spells out "AuthenticAMD". */ +- else if (ebx == 0x68747541 && ecx == 0x444d4163 && edx == 0x69746e65) ++ /* This spells out "AuthenticAMD" or "HygonGenuine". */ ++ else if ((ebx == 0x68747541 && ecx == 0x444d4163 && edx == 0x69746e65)||(ebx == 0x6f677948 && ecx == 0x656e6975 && edx == 0x6e65476e)) ++ + { + unsigned int extended_model, stepping; + +-- +2.17.1 + diff --git a/glibc.spec b/glibc.spec index 33b9795..f2b7207 100644 --- a/glibc.spec +++ b/glibc.spec @@ -1,4 +1,4 @@ -%global anolis_release .0.1 +%global anolis_release .8 %define glibcsrcdir glibc-2.28 %define glibcversion 2.28 %define glibcrelease 236%{anolis_release}%{?dist} @@ -1068,7 +1068,7 @@ Patch2005: glibc-elf-Fix-tst-align3.patch Patch2006: glibc-Sync-to-lnd-35-for-LoongArch.patch Patch2007: Fix-tst-cancel21.c-to-suit-kernel-struct-sigcontext-.patch Patch2008: glibc-aarch64-Increase-small-and-medium-cases-for-__memcpy.patch - +Patch2009: glibc-Add-Hygon-Support.patch ############################################################################## # Continued list of core "glibc" package information: ############################################################################## @@ -2903,6 +2903,9 @@ fi %files -f compat-libpthread-nonshared.filelist -n compat-libpthread-nonshared %changelog +* Wed Mar 01 2024 Jing Li - 2.28-236.8 +- Add Hygon Support + * Mon Dec 11 2023 Rongwei Wang - 2.28-236.0.1.7 - elf: Properly align PT_LOAD segments - Sync loongarch64 code to lnd.35. (lixing@loongson.cn) From b74d233625809978dd7339820a29748f3c3c6da6 Mon Sep 17 00:00:00 2001 From: lijing22222 Date: Fri, 1 Mar 2024 06:56:07 +0000 Subject: [PATCH 2/5] update glibc.spec. Signed-off-by: lijing22222 --- glibc.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/glibc.spec b/glibc.spec index f2b7207..f16202b 100644 --- a/glibc.spec +++ b/glibc.spec @@ -2903,7 +2903,7 @@ fi %files -f compat-libpthread-nonshared.filelist -n compat-libpthread-nonshared %changelog -* Wed Mar 01 2024 Jing Li - 2.28-236.8 +* Fri Mar 01 2024 Jing Li - 2.28-236.8 - Add Hygon Support * Mon Dec 11 2023 Rongwei Wang - 2.28-236.0.1.7 From de46f06819cd6271c49286e658b0985cfa372e4b Mon Sep 17 00:00:00 2001 From: lijing22222 Date: Fri, 1 Mar 2024 16:04:49 +0800 Subject: [PATCH 3/5] Add Hygon Support --- glibc-Add-Hygon-Support.patch | 20 ++++++++++---------- glibc.spec | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/glibc-Add-Hygon-Support.patch b/glibc-Add-Hygon-Support.patch index c0db837..c108f84 100644 --- a/glibc-Add-Hygon-Support.patch +++ b/glibc-Add-Hygon-Support.patch @@ -1,18 +1,18 @@ -From 76748aa5bc937b5e750d9335b7a28d0a05127ac4 Mon Sep 17 00:00:00 2001 +From ed64d30125f855e25ac6f12d8863857dfd3e2cbe Mon Sep 17 00:00:00 2001 From: lijing22222 -Date: Fri, 1 Mar 2024 13:01:40 +0800 +Date: Fri, 1 Mar 2024 16:00:15 +0800 Subject: [PATCH] Add Hygon Support --- - glibc-2.28/sysdeps/x86/cpu-features.c | 5 +++-- + sysdeps/x86/cpu-features.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) -diff --git a/glibc-2.28/sysdeps/x86/cpu-features.c b/glibc-2.28/sysdeps/x86/cpu-features.c -index ea0b64fd..9e3787ef 100644 ---- a/glibc-2.28/sysdeps/x86/cpu-features.c -+++ b/glibc-2.28/sysdeps/x86/cpu-features.c -@@ -344,8 +344,9 @@ init_cpu_features (struct cpu_features *cpu_features) - cpu_features->feature[index_arch_Prefer_No_AVX512] +diff --git a/sysdeps/x86/cpu-features.c b/sysdeps/x86/cpu-features.c +index 91042505..0ce37a9a 100644 +--- a/sysdeps/x86/cpu-features.c ++++ b/sysdeps/x86/cpu-features.c +@@ -527,8 +527,9 @@ init_cpu_features (struct cpu_features *cpu_features) + cpu_features->preferred[index_arch_Prefer_No_AVX512] |= bit_arch_Prefer_No_AVX512; } - /* This spells out "AuthenticAMD". */ @@ -21,7 +21,7 @@ index ea0b64fd..9e3787ef 100644 + else if ((ebx == 0x68747541 && ecx == 0x444d4163 && edx == 0x69746e65)||(ebx == 0x6f677948 && ecx == 0x656e6975 && edx == 0x6e65476e)) + { - unsigned int extended_model, stepping; + unsigned int extended_model; -- 2.17.1 diff --git a/glibc.spec b/glibc.spec index f2b7207..f16202b 100644 --- a/glibc.spec +++ b/glibc.spec @@ -2903,7 +2903,7 @@ fi %files -f compat-libpthread-nonshared.filelist -n compat-libpthread-nonshared %changelog -* Wed Mar 01 2024 Jing Li - 2.28-236.8 +* Fri Mar 01 2024 Jing Li - 2.28-236.8 - Add Hygon Support * Mon Dec 11 2023 Rongwei Wang - 2.28-236.0.1.7 From e832e5bbfd32633b03e7b4db15d1e2633ce98674 Mon Sep 17 00:00:00 2001 From: lijing22222 Date: Fri, 1 Mar 2024 10:10:26 +0000 Subject: [PATCH 4/5] update glibc.spec. Signed-off-by: lijing22222 --- glibc.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/glibc.spec b/glibc.spec index f16202b..3639dc1 100644 --- a/glibc.spec +++ b/glibc.spec @@ -1,4 +1,4 @@ -%global anolis_release .8 +%global anolis_release .0.1 %define glibcsrcdir glibc-2.28 %define glibcversion 2.28 %define glibcrelease 236%{anolis_release}%{?dist} @@ -133,7 +133,7 @@ end \ Summary: The GNU libc libraries Name: glibc Version: %{glibcversion} -Release: %{glibcrelease}.7 +Release: %{glibcrelease}.8 # In general, GPLv2+ is used by programs, LGPLv2+ is used for # libraries. From b9a1f803b94ec11275ce6592351b9d5c070df4e1 Mon Sep 17 00:00:00 2001 From: lijing22222 Date: Fri, 1 Mar 2024 10:13:57 +0000 Subject: [PATCH 5/5] update glibc.spec. Signed-off-by: lijing22222 --- glibc.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/glibc.spec b/glibc.spec index 3639dc1..613b9a6 100644 --- a/glibc.spec +++ b/glibc.spec @@ -2903,7 +2903,7 @@ fi %files -f compat-libpthread-nonshared.filelist -n compat-libpthread-nonshared %changelog -* Fri Mar 01 2024 Jing Li - 2.28-236.8 +* Fri Mar 01 2024 Jing Li - 2.28-236.0.1.8 - Add Hygon Support * Mon Dec 11 2023 Rongwei Wang - 2.28-236.0.1.7