!32 [sync] PR-29: fix sw_64 build error

From: @openeuler-sync-bot 
Reviewed-by: @t_feng 
Signed-off-by: @t_feng
This commit is contained in:
openeuler-ci-bot 2023-09-11 09:14:27 +00:00 committed by Gitee
commit 78ca0de243
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 31 additions and 18 deletions

View File

@ -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>
Date: Sat, 2 Apr 2022 22:53:36 +0800
Subject: [PATCH] Fix the -march issue for riscv64
#From: panchenbo <panchenbo@kylinsec.com.cn>
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:
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>
(cherry picked from commit aab4e9b10ac9e98588a1b19771cf6f4c8c0a3096)
---
src/include/defaults.mk | 4 ++++
1 file changed, 4 insertions(+)
src/include/defaults.mk | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
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
+++ 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)
ifneq ($(HOST_ARCH),ia64)
+ifneq ($(HOST_ARCH),riscv64)
HOST_MARCH=-march=native
else
HOST_MARCH=
endif
+else
-ifneq ($(HOST_ARCH),ia64)
- HOST_MARCH=-march=native
-else
+ifeq ($(HOST_ARCH),ia64)
+ 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)
override _HOST_CPPFLAGS := $(HOST_CPPFLAGS)
override HOST_CPPFLAGS = $(_HOST_CPPFLAGS) \
--
2.27.0

View File

@ -1,12 +1,12 @@
Name: efivar
Version: 38
Release: 1
Release: 2
Summary: Tools and libraries to work with EFI variables
License: LGPL-2.1-only
URL: https://github.com/rhboot/%{name}
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
%ifarch sw_64
Patch0003: efivar-37-sw.patch
@ -72,6 +72,11 @@ install -m 0644 src/abignore %{buildroot}%{_includedir}/efivar/.abignore
%{_mandir}/man3/*
%changelog
* 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
- Type:requirements
- ID:NA