From 01f6be8b095b41db30dc17c730aec05144226988 Mon Sep 17 00:00:00 2001 From: "Alex Xu (Hello71)" Date: Fri, 13 May 2022 12:33:42 -0400 Subject: app-arch/7-zip: fix aes asm, add -fno-strict-aliasing --- app-arch/7-zip/7-zip-21.07-r1.ebuild | 56 ----------------------------- app-arch/7-zip/7-zip-21.07-r2.ebuild | 59 +++++++++++++++++++++++++++++++ app-arch/7-zip/files/7-zip-less-asm.patch | 41 +++++++++++++++++++++ 3 files changed, 100 insertions(+), 56 deletions(-) delete mode 100644 app-arch/7-zip/7-zip-21.07-r1.ebuild create mode 100644 app-arch/7-zip/7-zip-21.07-r2.ebuild create mode 100644 app-arch/7-zip/files/7-zip-less-asm.patch (limited to 'app-arch') diff --git a/app-arch/7-zip/7-zip-21.07-r1.ebuild b/app-arch/7-zip/7-zip-21.07-r1.ebuild deleted file mode 100644 index 7154c6c..0000000 --- a/app-arch/7-zip/7-zip-21.07-r1.ebuild +++ /dev/null @@ -1,56 +0,0 @@ -# Copyright 2021 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -inherit toolchain-funcs - -MY_PV=${PV%%_*} -MY_PV=${MY_PV//./} - -DESCRIPTION="File archiver with a high compression ratio" -HOMEPAGE="https://7-zip.org/" -SRC_URI="https://7-zip.org/a/7z${MY_PV}-src.tar.xz" - -LICENSE="LGPL-2.1+ BSD rar? ( unRAR )" -SLOT="0" -KEYWORDS="~amd64 ~x86" -IUSE="+asm rar" - -BDEPEND=" - asm? ( dev-lang/jwasm ) -" -RDEPEND="!app-arch/p7zip" - -S=${WORKDIR} - -PATCHES=( ${FILESDIR}/7-zip-flags.patch ) - -src_compile() { - cd CPP/7zip/Bundles/Alone2 || die - local myemakeargs=( - CC="$(tc-getCC) ${CFLAGS} ${LDFLAGS}" - CXX="$(tc-getCXX) ${CXXFLAGS} ${LDFLAGS}" - ) - if use asm; then - myemakeargs+=(USE_ASM=1 USE_JWASM=1) - if use amd64; then - myemakeargs+=(IS_X64=1) - elif use arm64; then - myemakeargs+=(IS_ARM64=1) - elif use x86; then - myemakeargs+=(IS_X86=1) - else - einfo "asm is not supported on this arch, ignoring" - fi - fi - use rar || myemakeargs+=(DISABLE_RAR=1) - mkdir -p b/g || die - emake -f ../../cmpl_gcc.mak "${myemakeargs[@]}" -} - -src_install() { - dobin CPP/7zip/Bundles/Alone2/b/g/7zz - dosym 7zz /usr/bin/7z - dodoc DOC/* -} diff --git a/app-arch/7-zip/7-zip-21.07-r2.ebuild b/app-arch/7-zip/7-zip-21.07-r2.ebuild new file mode 100644 index 0000000..81229fc --- /dev/null +++ b/app-arch/7-zip/7-zip-21.07-r2.ebuild @@ -0,0 +1,59 @@ +# Copyright 2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit toolchain-funcs + +MY_PV=${PV%%_*} +MY_PV=${MY_PV//./} + +DESCRIPTION="File archiver with a high compression ratio" +HOMEPAGE="https://7-zip.org/" +SRC_URI="https://7-zip.org/a/7z${MY_PV}-src.tar.xz" + +LICENSE="LGPL-2.1+ BSD rar? ( unRAR )" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="+asm rar" + +BDEPEND=" + asm? ( dev-lang/jwasm ) +" +RDEPEND="!app-arch/p7zip" + +S=${WORKDIR} + +PATCHES=( + "${FILESDIR}/7-zip-flags.patch" + "${FILESDIR}/7-zip-less-asm.patch" +) + +src_compile() { + cd CPP/7zip/Bundles/Alone2 || die + local myemakeargs=( + CC="$(tc-getCC) ${CFLAGS} -fno-strict-aliasing ${LDFLAGS}" + CXX="$(tc-getCXX) ${CXXFLAGS} -fno-strict-aliasing ${LDFLAGS}" + ) + if use asm; then + myemakeargs+=(USE_ASM=1 USE_JWASM=1) + if use amd64; then + myemakeargs+=(IS_X64=1) + elif use arm64; then + myemakeargs+=(IS_ARM64=1) + elif use x86; then + myemakeargs+=(IS_X86=1) + else + einfo "asm is not supported on this arch, ignoring" + fi + fi + use rar || myemakeargs+=(DISABLE_RAR=1) + mkdir -p b/g || die + emake -f ../../cmpl_gcc.mak "${myemakeargs[@]}" +} + +src_install() { + dobin CPP/7zip/Bundles/Alone2/b/g/7zz + dosym 7zz /usr/bin/7z + dodoc DOC/* +} diff --git a/app-arch/7-zip/files/7-zip-less-asm.patch b/app-arch/7-zip/files/7-zip-less-asm.patch new file mode 100644 index 0000000..040b445 --- /dev/null +++ b/app-arch/7-zip/files/7-zip-less-asm.patch @@ -0,0 +1,41 @@ +--- a/CPP/7zip/7zip_gcc.mak 2021-12-25 09:00:00.000000000 -0500 ++++ b/CPP/7zip/7zip_gcc.mak 2022-05-13 12:20:17.539629635 -0400 +@@ -1127,21 +1127,6 @@ + endif + endif + +-ifdef USE_X86_ASM +-$O/7zCrcOpt.o: ../../../../Asm/x86/7zCrcOpt.asm +- $(MY_ASM) $(AFLAGS) $< +-$O/XzCrc64Opt.o: ../../../../Asm/x86/XzCrc64Opt.asm +- $(MY_ASM) $(AFLAGS) $< +-$O/Sha1Opt.o: ../../../../Asm/x86/Sha1Opt.asm +- $(MY_ASM) $(AFLAGS) $< +-$O/Sha256Opt.o: ../../../../Asm/x86/Sha256Opt.asm +- $(MY_ASM) $(AFLAGS) $< +- +-ifndef USE_JWASM +-USE_X86_ASM_AES=1 +-endif +- +-else + $O/7zCrcOpt.o: ../../../../C/7zCrcOpt.c + $(CC) $(CFLAGS) $< + $O/XzCrc64Opt.o: ../../../../C/XzCrc64Opt.c +@@ -1150,16 +1135,10 @@ + $(CC) $(CFLAGS) $< + $O/Sha256Opt.o: ../../../../C/Sha256Opt.c + $(CC) $(CFLAGS) $< +-endif + + +-ifdef USE_X86_ASM_AES +-$O/AesOpt.o: ../../../../Asm/x86/AesOpt.asm +- $(MY_ASM) $(AFLAGS) $< +-else + $O/AesOpt.o: ../../../../C/AesOpt.c + $(CC) $(CFLAGS) $< +-endif + + + ifdef USE_X64_ASM -- cgit v1.2.3-70-g09d2