Compare commits
10 Commits
795368cd0e
...
5ad8a4e313
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5ad8a4e313 | ||
|
|
08ab9250f7 | ||
|
|
27c0485de1 | ||
|
|
d05a38f5bf | ||
|
|
9468b250b2 | ||
|
|
e1d56b13ac | ||
|
|
eccf277852 | ||
|
|
9e73a25472 | ||
|
|
78ca0de243 | ||
|
|
fbd34bdecd |
@ -1,7 +1,8 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
From ee3a1a046da9fd3f14965876340886167121057b Mon Sep 17 00:00:00 2001
|
||||||
From: Wei Fu <wefu@redhat.com>
|
From: Wei Fu <wefu@redhat.com>
|
||||||
Date: Sat, 2 Apr 2022 22:53:36 +0800
|
#From: panchenbo <panchenbo@kylinsec.com.cn>
|
||||||
Subject: [PATCH] Fix the -march issue for riscv64
|
Date: Wed, 26 Apr 2023 17:47:25 +0800
|
||||||
|
Subject: [PATCH] Fix the -march issue for riscv64 sw_64
|
||||||
|
|
||||||
There is an issue on riscv64 system when compiling it natively:
|
There is an issue on riscv64 system when compiling it natively:
|
||||||
gcc: error: '-march=native': ISA string must begin with rv32 or rv64
|
gcc: error: '-march=native': ISA string must begin with rv32 or rv64
|
||||||
@ -10,26 +11,33 @@ This patch set HOST_MARCH= like ia64 to resolve the issue.
|
|||||||
|
|
||||||
Signed-off-by: Wei Fu <wefu@redhat.com>
|
Signed-off-by: Wei Fu <wefu@redhat.com>
|
||||||
(cherry picked from commit aab4e9b10ac9e98588a1b19771cf6f4c8c0a3096)
|
(cherry picked from commit aab4e9b10ac9e98588a1b19771cf6f4c8c0a3096)
|
||||||
|
|
||||||
---
|
---
|
||||||
src/include/defaults.mk | 4 ++++
|
src/include/defaults.mk | 10 +++++++---
|
||||||
1 file changed, 4 insertions(+)
|
1 file changed, 7 insertions(+), 3 deletions(-)
|
||||||
|
|
||||||
diff --git a/src/include/defaults.mk b/src/include/defaults.mk
|
diff --git a/src/include/defaults.mk b/src/include/defaults.mk
|
||||||
index 632b155..b8cc590 100644
|
index 632b155..a25458f 100644
|
||||||
--- a/src/include/defaults.mk
|
--- a/src/include/defaults.mk
|
||||||
+++ b/src/include/defaults.mk
|
+++ b/src/include/defaults.mk
|
||||||
@@ -73,10 +73,14 @@ override SOFLAGS = $(_SOFLAGS) \
|
@@ -72,10 +72,14 @@ override SOFLAGS = $(_SOFLAGS) \
|
||||||
|
$(call family,SOFLAGS)
|
||||||
|
|
||||||
HOST_ARCH=$(shell uname -m)
|
HOST_ARCH=$(shell uname -m)
|
||||||
ifneq ($(HOST_ARCH),ia64)
|
-ifneq ($(HOST_ARCH),ia64)
|
||||||
+ifneq ($(HOST_ARCH),riscv64)
|
- HOST_MARCH=-march=native
|
||||||
HOST_MARCH=-march=native
|
-else
|
||||||
else
|
+ifeq ($(HOST_ARCH),ia64)
|
||||||
HOST_MARCH=
|
|
||||||
endif
|
|
||||||
+else
|
|
||||||
+ HOST_MARCH=
|
+ HOST_MARCH=
|
||||||
+endif
|
+else ifeq ($(HOST_ARCH),riscv64)
|
||||||
|
HOST_MARCH=
|
||||||
|
+else ifeq ($(HOST_ARCH),sw_64)
|
||||||
|
+ HOST_MARCH=
|
||||||
|
+else
|
||||||
|
+ HOST_MARCH=-march=native
|
||||||
|
endif
|
||||||
HOST_CPPFLAGS ?= $(CPPFLAGS)
|
HOST_CPPFLAGS ?= $(CPPFLAGS)
|
||||||
override _HOST_CPPFLAGS := $(HOST_CPPFLAGS)
|
override _HOST_CPPFLAGS := $(HOST_CPPFLAGS)
|
||||||
override HOST_CPPFLAGS = $(_HOST_CPPFLAGS) \
|
--
|
||||||
|
2.27.0
|
||||||
|
|
||||||
25
add-loongarch64-support-for-efivar.patch
Normal file
25
add-loongarch64-support-for-efivar.patch
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
From 036df2e0e107529acaf86df751aa21ff581d7203 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Wenlong Zhang <zhangwenlong@loongson.cn>
|
||||||
|
Date: Tue, 26 Mar 2024 08:40:05 +0000
|
||||||
|
Subject: [PATCH] add loongarch64 support for efivar
|
||||||
|
|
||||||
|
---
|
||||||
|
src/include/defaults.mk | 2 ++
|
||||||
|
1 file changed, 2 insertions(+)
|
||||||
|
|
||||||
|
diff --git a/src/include/defaults.mk b/src/include/defaults.mk
|
||||||
|
index a25458f..c0f812a 100644
|
||||||
|
--- a/src/include/defaults.mk
|
||||||
|
+++ b/src/include/defaults.mk
|
||||||
|
@@ -78,6 +78,8 @@ else ifeq ($(HOST_ARCH),riscv64)
|
||||||
|
HOST_MARCH=
|
||||||
|
else ifeq ($(HOST_ARCH),sw_64)
|
||||||
|
HOST_MARCH=
|
||||||
|
+else ifeq ($(HOST_ARCH),loongarch64)
|
||||||
|
+ HOST_MARCH=
|
||||||
|
else
|
||||||
|
HOST_MARCH=-march=native
|
||||||
|
endif
|
||||||
|
--
|
||||||
|
2.43.0
|
||||||
|
|
||||||
29
backport-Fix-invalid-free-in-main.patch
Normal file
29
backport-Fix-invalid-free-in-main.patch
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
From 6be2cb1c0139ac177e754b0767abf1ca1533847f Mon Sep 17 00:00:00 2001
|
||||||
|
From: Robbie Harwood <rharwood@redhat.com>
|
||||||
|
Date: Mon, 18 Apr 2022 13:08:18 -0400
|
||||||
|
Subject: [PATCH] Fix invalid free in main()
|
||||||
|
|
||||||
|
data is allocated by mmap() in prepare_data().
|
||||||
|
|
||||||
|
Resolves: #173
|
||||||
|
Signed-off-by: Robbie Harwood <rharwood@redhat.com>
|
||||||
|
|
||||||
|
Conflict:NA
|
||||||
|
Reference:https://github.com/rhboot/efivar/commit/6be2cb1c0139ac177e754b0767abf1ca1533847f
|
||||||
|
---
|
||||||
|
src/efivar.c | 2 +-
|
||||||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/src/efivar.c b/src/efivar.c
|
||||||
|
index 5cd1eb2b..09f85edd 100644
|
||||||
|
--- a/src/efivar.c
|
||||||
|
+++ b/src/efivar.c
|
||||||
|
@@ -633,7 +633,7 @@ int main(int argc, char *argv[])
|
||||||
|
if (sz < 0)
|
||||||
|
err(1, "Could not import data from \"%s\"", infile);
|
||||||
|
|
||||||
|
- free(data);
|
||||||
|
+ munmap(data, data_size);
|
||||||
|
data = NULL;
|
||||||
|
data_size = 0;
|
||||||
|
|
||||||
26
dp_h-check-_ucs2size-in-format_ucs2.patch
Normal file
26
dp_h-check-_ucs2size-in-format_ucs2.patch
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
From 3f233dd9c8cbb267b2cf931c6191e650e8ab8a5f Mon Sep 17 00:00:00 2001
|
||||||
|
From: Qiumiao Zhang <zhangqiumiao1@huawei.com>
|
||||||
|
Date: Sat, 26 Aug 2023 14:36:24 +0800
|
||||||
|
Subject: [PATCH] dp.h: check _ucs2size in format_ucs2()
|
||||||
|
|
||||||
|
Signed-off-by: Qiumiao Zhang <zhangqiumiao1@huawei.com>
|
||||||
|
---
|
||||||
|
src/dp.h | 2 +-
|
||||||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/src/dp.h b/src/dp.h
|
||||||
|
index 8290cc1..27f7650 100644
|
||||||
|
--- a/src/dp.h
|
||||||
|
+++ b/src/dp.h
|
||||||
|
@@ -123,7 +123,7 @@ format_vendor_helper(unsigned char *buf, size_t size, char *label,
|
||||||
|
uint16_t *_ucs2buf; \
|
||||||
|
uint32_t _ucs2size = sizeof(uint16_t) * len; \
|
||||||
|
_ucs2buf = alloca(_ucs2size); \
|
||||||
|
- if (_ucs2buf == NULL) \
|
||||||
|
+ if (_ucs2buf == NULL || _ucs2size < sizeof(uint16_t)) \
|
||||||
|
return -1; \
|
||||||
|
memset(_ucs2buf, '\0', _ucs2size); \
|
||||||
|
memcpy(_ucs2buf, str, _ucs2size - sizeof(uint16_t)); \
|
||||||
|
--
|
||||||
|
2.23.0
|
||||||
|
|
||||||
41
efivar.spec
41
efivar.spec
@ -1,16 +1,19 @@
|
|||||||
Name: efivar
|
Name: efivar
|
||||||
Version: 38
|
Version: 38
|
||||||
Release: 1
|
Release: 6
|
||||||
Summary: Tools and libraries to work with EFI variables
|
Summary: Tools and libraries to work with EFI variables
|
||||||
License: LGPL-2.1-only
|
License: LGPL-2.1-only
|
||||||
URL: https://github.com/rhboot/%{name}
|
URL: https://github.com/rhboot/%{name}
|
||||||
Source0: https://github.com/rhboot/%{name}/releases/download/%{version}/%{name}-%{version}.tar.bz2
|
Source0: https://github.com/rhboot/%{name}/releases/download/%{version}/%{name}-%{version}.tar.bz2
|
||||||
|
|
||||||
Patch0001: 0001-Fix-the-march-issue-for-riscv64.patch
|
Patch0001: 0001-Fix-the-march-issue-for-riscv64-and-sw_64.patch
|
||||||
Patch0002: 0002-Fix-glibc-2.36-build-mount.h-conflicts.patch
|
Patch0002: 0002-Fix-glibc-2.36-build-mount.h-conflicts.patch
|
||||||
%ifarch sw_64
|
%ifarch sw_64
|
||||||
Patch0003: efivar-37-sw.patch
|
Patch0003: efivar-37-sw.patch
|
||||||
%endif
|
%endif
|
||||||
|
Patch9000: dp_h-check-_ucs2size-in-format_ucs2.patch
|
||||||
|
Patch9001: backport-Fix-invalid-free-in-main.patch
|
||||||
|
Patch9002: add-loongarch64-support-for-efivar.patch
|
||||||
|
|
||||||
BuildRequires: popt-devel glibc-static
|
BuildRequires: popt-devel glibc-static
|
||||||
BuildRequires: gcc mandoc
|
BuildRequires: gcc mandoc
|
||||||
@ -39,7 +42,10 @@ Development titles to use libefivar must be included.
|
|||||||
|
|
||||||
%build
|
%build
|
||||||
export LDFLAGS="-flto-partition=none"
|
export LDFLAGS="-flto-partition=none"
|
||||||
%make_build
|
%if "%{?toolchain}" == "clang"
|
||||||
|
%global make_opts CC=clang CXX=clang++
|
||||||
|
%endif
|
||||||
|
%make_build %{?make_opts}
|
||||||
|
|
||||||
%install
|
%install
|
||||||
%make_install
|
%make_install
|
||||||
@ -72,6 +78,35 @@ install -m 0644 src/abignore %{buildroot}%{_includedir}/efivar/.abignore
|
|||||||
%{_mandir}/man3/*
|
%{_mandir}/man3/*
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Mon Apr 8 2024 Wenlong Zhang <zhangwenlong@loongson.cn> - 38-6
|
||||||
|
- Type:bugfix
|
||||||
|
- ID:NA
|
||||||
|
- SUG:NA
|
||||||
|
- DESC:add loongarch64 support for efivar
|
||||||
|
|
||||||
|
* Mon Apr 1 2024 luofeng13 <luofeng13@huawei.com> - 38-5
|
||||||
|
- Type:enhancement
|
||||||
|
- ID:NA
|
||||||
|
- SUG:NA
|
||||||
|
- DESC:support clang build
|
||||||
|
|
||||||
|
* Wed Mar 13 2024 zhouyihang <zhouyihang3@h-partners.com> - 38-4
|
||||||
|
- Type:bugfix
|
||||||
|
- ID:NA
|
||||||
|
- SUG:NA
|
||||||
|
- DESC:Fix invalid free in main()
|
||||||
|
|
||||||
|
* Tue Sep 12 2023 zhangqiumiao <zhangqiumiao1@huawei.com> - 38-3
|
||||||
|
- Type:bugfix
|
||||||
|
- ID:NA
|
||||||
|
- SUG:NA
|
||||||
|
- DESC:dp.h: check _ucs2size in format_ucs2()
|
||||||
|
|
||||||
|
* Wed Apr 26 2023 panchenbo <panchenbo@kylinsec.com.cn> - 38-2
|
||||||
|
- ID:NA
|
||||||
|
- SUG:NA
|
||||||
|
- DESC:fix sw_64 build error
|
||||||
|
|
||||||
* Mon Nov 07 2022 zhouyihang <zhouyihang3@h-partners.com> - 38-1
|
* Mon Nov 07 2022 zhouyihang <zhouyihang3@h-partners.com> - 38-1
|
||||||
- Type:requirements
|
- Type:requirements
|
||||||
- ID:NA
|
- ID:NA
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user