From acd9fdba6274acdcd17f62d61a1fd7f04cf19b30 Mon Sep 17 00:00:00 2001 From: Wu Zixuan Date: Wed, 30 Nov 2022 16:11:03 +0800 Subject: [PATCH] Add sw64 architecture Signed-off-by: Wu Zixuan --- mstflint-4.10.0-sw.patch | 63 ++++++++++++++++++++++++++++++++++++++++ mstflint.spec | 13 +++++++-- 2 files changed, 74 insertions(+), 2 deletions(-) create mode 100755 mstflint-4.10.0-sw.patch diff --git a/mstflint-4.10.0-sw.patch b/mstflint-4.10.0-sw.patch new file mode 100755 index 0000000..687118f --- /dev/null +++ b/mstflint-4.10.0-sw.patch @@ -0,0 +1,63 @@ +diff -Naur mstflint-4.10.0.org/common/compatibility.h mstflint-4.10.0.sw/common/compatibility.h +--- mstflint-4.10.0.org/common/compatibility.h 2022-05-27 11:07:58.390000000 +0000 ++++ mstflint-4.10.0.sw/common/compatibility.h 2022-05-27 11:20:13.920000000 +0000 +@@ -40,7 +40,7 @@ + + #include + +-#if defined(__ia64__) || defined(__x86_64__) || defined(__PPC64__) || defined(__arm__) ++#if defined(__ia64__) || defined(__x86_64__) || defined(__PPC64__) || defined(__arm__) || defined(__sw_64__) + #define U64L "l" + #else + #define U64L "ll" +@@ -63,6 +63,8 @@ + # define ARCH_arm64 + # elif defined(__arm__) + # define ARCH_arm6l ++# elif defined(__sw_64__) ++# define ARCH_sw_64 + # else + # error Unknown CPU architecture using the linux OS + # endif +@@ -109,7 +111,7 @@ + # define U48H_FMT "0x%012llx" + # define U64D_FMT_GEN "llu" + # endif +-#elif defined(ARCH_ia64) || defined(ARCH_x86_64) || defined(ARCH_ppc64) || defined(ARCH_arm64) ++#elif defined(ARCH_ia64) || defined(ARCH_x86_64) || defined(ARCH_ppc64) || defined(ARCH_arm64) || defined(ARCH_sw_64) + # define U64D_FMT "%lu" + # define U64H_FMT "0x%016lx" + # define U48H_FMT "0x%012lx" +diff -Naur mstflint-4.10.0.org/mtcr_ul/packets_common.h mstflint-4.10.0.sw/mtcr_ul/packets_common.h +--- mstflint-4.10.0.org/mtcr_ul/packets_common.h 2022-05-27 11:07:58.400000000 +0000 ++++ mstflint-4.10.0.sw/mtcr_ul/packets_common.h 2022-05-27 11:10:09.880000000 +0000 +@@ -152,6 +152,8 @@ + # define ARCH_arm64 + # elif defined(__arm__) + # define ARCH_arm6l ++# elif defined(__sw_64__) ++# define ARCH_sw_64 + # else + # error Unknown CPU architecture using the linux OS + # endif +diff -Naur mstflint-4.10.0.org/tools_layouts/adb_to_c_utils.h mstflint-4.10.0.sw/tools_layouts/adb_to_c_utils.h +--- mstflint-4.10.0.org/tools_layouts/adb_to_c_utils.h 2022-05-27 11:07:58.500000000 +0000 ++++ mstflint-4.10.0.sw/tools_layouts/adb_to_c_utils.h 2022-05-27 11:09:31.900000000 +0000 +@@ -137,6 +137,8 @@ + # define ARCH_arm64 + # elif defined(__arm__) + # define ARCH_arm6l ++# elif defined(__sw_64__) ++# define ARCH_sw_64 + # else + # error Unknown CPU architecture using the linux OS + # endif +@@ -180,7 +182,7 @@ + # define U64H_FMT "0x%016llx" + # define U48H_FMT "0x%012llx" + # endif +-#elif defined (ARCH_ia64) || defined(ARCH_x86_64) || defined(ARCH_ppc64) || defined(ARCH_arm64) ++#elif defined (ARCH_ia64) || defined(ARCH_x86_64) || defined(ARCH_ppc64) || defined(ARCH_arm64) || defined(ARCH_sw_64) + # define U64D_FMT "%lu" + # define U64H_FMT "0x%016lx" + # define U48H_FMT "0x%012lx" diff --git a/mstflint.spec b/mstflint.spec index ec65f52..3760e9d 100644 --- a/mstflint.spec +++ b/mstflint.spec @@ -1,12 +1,13 @@ Name: mstflint Summary: Firmware Burning and Diagnostics Tools Version: 4.10.0 -Release: 8 +Release: 9 License: GPLv2+ or BSD Url: https://github.com/Mellanox/mstflint Source: https://github.com/Mellanox/%{name}/releases/download/v4.10.0-1/%{name}-%{version}.tar.gz Patch0000: 0001-Fix-compile-errors.patch Patch0001: fix-return-local-addr.patch +Patch0002: mstflint-4.10.0-sw.patch BuildRequires: libstdc++-devel zlib-devel rdma-core-devel gcc-c++ gcc BuildRequires: libcurl-devel boost-devel libxml2-devel openssl-devel @@ -20,7 +21,12 @@ code. Please see the file LICENSE for licensing details. %package_help %prep -%autosetup -p1 +%setup +%patch0 -p1 +%patch1 -p1 +%ifarch sw_64 +%patch2 -p1 +%endif %build export CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS" @@ -44,6 +50,9 @@ export CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS" %{_mandir}/man1/* %changelog +* Tue Nov 29 2022 wuzx - 4.10.0-9 +- Add sw64 architecture + * Thu Nov 10 2022 liyanan - 4.10.0-8 - Change source