fix sw_64 build error

(cherry picked from commit ec323a26f7c0d81f441cc8970cf7b569d6afd6c9)
This commit is contained in:
lanruo 2023-08-28 14:02:55 +08:00 committed by openeuler-sync-bot
parent 795368cd0e
commit fbd34bdecd
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> 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

View File

@ -1,12 +1,12 @@
Name: efivar Name: efivar
Version: 38 Version: 38
Release: 1 Release: 2
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
@ -72,6 +72,11 @@ install -m 0644 src/abignore %{buildroot}%{_includedir}/efivar/.abignore
%{_mandir}/man3/* %{_mandir}/man3/*
%changelog %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 * Mon Nov 07 2022 zhouyihang <zhouyihang3@h-partners.com> - 38-1
- Type:requirements - Type:requirements
- ID:NA - ID:NA