update unzip-6.0-crc-builtin.patch.

reason: this patch is created for performance optimization in crc calculation only  suitable for openeuler of aarch64 architecture。
you can patch it to the source code of unzip software package and install the unzip software as usual。
effect: with this patch, the unzip software can speed up nearly 100% when running than before。
This commit is contained in:
hanzhelii 2021-05-17 19:48:21 +08:00 committed by Gitee
parent 0d5dd347b4
commit 68a26bf6cb

View File

@ -1,7 +1,20 @@
diff -Nabur unzip60/crc32.c unzip604/crc32.c
--- unzip60/crc32.c 2007-01-22 13:34:38.000000000 +0800
+++ unzip604/crc32.c 2021-05-12 15:08:34.409893493 +0800
@@ -675,7 +675,32 @@
From 1ae8eea237f05a590d8da38528dceab8a7b4290b Mon Sep 17 00:00:00 2001
From: Euler Hanzh <18221254@bjtu.edu.cn>
Date: Mon, 17 May 2021 19:28:18 +0800
Subject: [PATCH] This patch is created for performance optimization in crc calculation only suitable for openeuler of aarch64 architecture.
The speed of unzip software when running can be accelerate by nearly 100% than before.
---
unzip60/crc32.c | 28 ++++++++++++++++++++++++++++
unzip60/crc32.h | 4 ++++
unzip60/unix/Makefile | 19 ++++++++++++++-----
3 files changed, 46 insertions(+), 5 deletions(-)
diff --git a/unzip60/crc32.c b/unzip60/crc32.c
index 02f504d..fa73a3e 100644
--- a/unzip60/crc32.c
+++ b/unzip60/crc32.c
@@ -675,7 +675,32 @@ void free_crc_table()
#endif /* (IZ_CRC_BE_OPTIMIZ || IZ_CRC_LE_OPTIMIZ) */
@ -34,7 +47,7 @@ diff -Nabur unzip60/crc32.c unzip604/crc32.c
/* ========================================================================= */
ulg crc32(crc, buf, len)
ulg crc; /* crc shift register */
@@ -726,6 +751,9 @@
@@ -726,6 +751,9 @@ ulg crc32(crc, buf, len)
return REV_BE(c) ^ 0xffffffffL; /* (instead of ~c for 64-bit machines) */
}
@ -44,9 +57,10 @@ diff -Nabur unzip60/crc32.c unzip604/crc32.c
#endif /* !ASM_CRC */
#endif /* !CRC_TABLE_ONLY */
#endif /* !USE_ZLIB */
diff -Nabur unzip60/crc32.h unzip604/crc32.h
--- unzip60/crc32.h 2008-03-09 02:40:20.000000000 +0800
+++ unzip604/crc32.h 2021-05-12 15:08:34.409893493 +0800
diff --git a/unzip60/crc32.h b/unzip60/crc32.h
index 83af240..b5e386a 100644
--- a/unzip60/crc32.h
+++ b/unzip60/crc32.h
@@ -36,7 +36,11 @@
# undef IZ_CRC_BE_OPTIMIZ
# endif
@ -59,9 +73,10 @@ diff -Nabur unzip60/crc32.h unzip604/crc32.h
#endif /* ?(USE_ZLIB || CRC_TABLE_ONLY) */
#ifndef CRC_32_TAB
diff -Nabur unzip60/unix/Makefile unzip604/unix/Makefile
--- unzip60/unix/Makefile 2009-01-19 06:41:18.000000000 +0800
+++ unzip604/unix/Makefile 2021-05-12 15:09:05.698385219 +0800
diff --git a/unzip60/unix/Makefile b/unzip60/unix/Makefile
index ab32270..39b2263 100644
--- a/unzip60/unix/Makefile
+++ b/unzip60/unix/Makefile
@@ -40,7 +40,8 @@
# Defaults most systems use (use LOCAL_UNZIP in environment to add flags,
@ -72,7 +87,7 @@ diff -Nabur unzip60/unix/Makefile unzip604/unix/Makefile
# UnZip flags
CC = cc# try using "gcc" target rather than changing this (CC and LD
LD = $(CC)# must match, else "unresolved symbol: ___main" is possible)
@@ -54,6 +55,12 @@
@@ -54,6 +55,12 @@ LFLAGS1 =
LF = -o unzip$E $(LFLAGS1)
LF2 = -s
@ -85,7 +100,7 @@ diff -Nabur unzip60/unix/Makefile unzip604/unix/Makefile
# UnZipSFX flags
SL = -o unzipsfx$E $(LFLAGS1)
SL2 = $(LF2)
@@ -77,6 +84,8 @@
@@ -77,6 +84,8 @@ M = unix
SHELL = /bin/sh
MAKEF = -f unix/Makefile
@ -94,7 +109,7 @@ diff -Nabur unzip60/unix/Makefile unzip604/unix/Makefile
# Version info for unix/unix.c
HOST_VERSINFO=-DIZ_CC_NAME='\"\$$(CC) \"' -DIZ_OS_NAME='\"`uname -a`\"'
@@ -231,13 +240,13 @@
@@ -231,13 +240,13 @@ generic_msg:
# yes, we should be able to use the $O macro to combine these two, but it
# fails on some brain-damaged makes (e.g., AIX's)...no big deal
.c.o:
@ -111,7 +126,7 @@ diff -Nabur unzip60/unix/Makefile unzip604/unix/Makefile
# this doesn't work...directories are always a pain with implicit rules
#.1.txt: man/$<
@@ -329,7 +338,7 @@
@@ -329,7 +338,7 @@ unzipsfx$O: unzip.c $(UNZIP_H) crypt.h unzvers.h consts.h
$(CC) -c $(CF) -DSFX -o $@ unzip.c
crc32_$O: crc32.c $(UNZIP_H) zip.h crc32.h
@ -120,3 +135,7 @@ diff -Nabur unzip60/unix/Makefile unzip604/unix/Makefile
crypt_$O: crypt.c $(UNZIP_H) zip.h crypt.h crc32.h ttyio.h
$(CC) -c $(CF) -DSFX -o $@ crypt.c
--
2.23.0