From 11d8914a3ed12d03f0ce65d9338c13b68a8a8bbc410cf829eef80bd3a2bb6d09 Mon Sep 17 00:00:00 2001 From: Martin Pluskal Date: Tue, 6 Dec 2022 10:53:30 +0000 Subject: [PATCH] Accepting request 1039612 from home:dspinella - Enable ASM to increase performance in compression and decompression bsc#1202197 OBS-URL: https://build.opensuse.org/request/show/1039612 OBS-URL: https://build.opensuse.org/package/show/Archiving/7zip?expand=0&rev=15 --- 7zip.changes | 6 ++++++ 7zip.spec | 30 ++++++++++++++++++++++++++---- 2 files changed, 32 insertions(+), 4 deletions(-) diff --git a/7zip.changes b/7zip.changes index 7944f83..a612999 100644 --- a/7zip.changes +++ b/7zip.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed Nov 30 10:47:14 UTC 2022 - Danilo Spinella + +- Enable ASM to increase performance in compression and decompression + bsc#1202197 + ------------------------------------------------------------------- Fri Jul 22 21:16:09 UTC 2022 - Dirk Müller diff --git a/7zip.spec b/7zip.spec index 4128c19..15c786c 100644 --- a/7zip.spec +++ b/7zip.spec @@ -33,6 +33,9 @@ Patch0: fix-compatib-with-p7zip.patch BuildRequires: dos2unix BuildRequires: gcc BuildRequires: gcc-c++ +%ifarch x86_64 %ix86 +BuildRequires: uasm +%endif Conflicts: p7zip Conflicts: p7zip-full Provides: p7zip = %{version} @@ -59,14 +62,33 @@ sed -i -e 's/-Waddress-of-packed-member//' -e 's/-Wcast-align=strict//' C/warn_g %endif # Inject CFLAGS sed -i 's/^ -fPIC/ -fPIC %{optflags}/' CPP/7zip/7zip_gcc.mak +sed -i 's/LFLAGS_ALL = -s/LFLAGS_ALL =/' CPP/7zip/7zip_gcc.mak +%ifarch x86_64 %ix86 +sed -i 's/$(CXX) -o $(PROGPATH)/$(CXX) -Wl,-z,noexecstack -o $(PROGPATH)/' CPP/7zip/7zip_gcc.mak +%endif %build -cd CPP/7zip//Bundles/Alone2 -%make_build -f ../../cmpl_gcc.mak DISABLE_RAR_COMPRESS=1 +cd CPP/7zip/Bundles/Alone2 +%ifarch x86_64 +%make_build -f ../../cmpl_gcc_x64.mak MY_ASM=uasm +%else +%ifarch %ix86 +%make_build -f ../../cmpl_gcc_x86.mak MY_ASM=uasm +%else +%make_build -f ../../cmpl_gcc.mak +%endif +%endif %install -install -d -m 755 %{buildroot}%{_bindir} -install -Dt %{buildroot}%{_bindir} CPP/7zip/Bundles/Alone2/b/g/7zz +%ifarch x86_64 +install -Dm 755 CPP/7zip/Bundles/Alone2/b/g_x64/7zz %{buildroot}%{_bindir}/7zz +%else +%ifarch %ix86 +install -Dm 755 CPP/7zip/Bundles/Alone2/b/g_x86/7zz %{buildroot}%{_bindir}/7zz +%else +install -Dm 755 CPP/7zip/Bundles/Alone2/b/g/7zz %{buildroot}%{_bindir}/7zz +%endif +%endif # Create links the executables provided by p7zip ln -s %{_bindir}/7zz %{buildroot}%{_bindir}/7z ln -s %{_bindir}/7z %{buildroot}%{_bindir}/7za