efivar: fix build for correct cpu
Commit Message
the makefile add --march=native which optimize the code to the
cpu of the buildhost which can result in unsupported instructions on
other machines.
---
lfs/efivar | 3 ++-
.../efivar-38_remove_march=native.patch | 18 ++++++++++++++++++
2 files changed, 20 insertions(+), 1 deletion(-)
create mode 100644 src/patches/efivar-38_remove_march=native.patch
@@ -1,7 +1,7 @@
###############################################################################
# #
# IPFire.org - A linux based firewall #
-# Copyright (C) 2007-2018 IPFire Team <info@ipfire.org> #
+# Copyright (C) 2007-2023 IPFire Team <info@ipfire.org> #
# #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
@@ -73,6 +73,7 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
@rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar axf $(DIR_DL)/$(DL_FILE)
cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/efivar-37-compile-fixes-3.patch
+ cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/efivar-38_remove_march=native.patch
# fix an issue in Makefile causing the package to be rebuilt during installation
# obtained from https://linuxfromscratch.org/blfs/view/11.1/postlfs/efivar.html
new file mode 100644
@@ -0,0 +1,18 @@
+diff -Naur efivar-38.org/src/include/defaults.mk efivar-38/src/include/defaults.mk
+--- efivar-38.org/src/include/defaults.mk 2022-01-14 20:29:35.000000000 +0100
++++ efivar-38/src/include/defaults.mk 2023-02-23 19:38:12.493736490 +0100
+@@ -71,12 +71,8 @@
+ -Wl,--version-script=$(MAP) \
+ $(call family,SOFLAGS)
+
+-HOST_ARCH=$(shell uname -m)
+-ifneq ($(HOST_ARCH),ia64)
+- HOST_MARCH=-march=native
+-else
+- HOST_MARCH=
+-endif
++HOST_MARCH=
++
+ HOST_CPPFLAGS ?= $(CPPFLAGS)
+ override _HOST_CPPFLAGS := $(HOST_CPPFLAGS)
+ override HOST_CPPFLAGS = $(_HOST_CPPFLAGS) \