From: Wayne Davison Date: Sat, 20 Jun 2020 15:44:04 +0000 (-0700) Subject: Fix conditional directives in the asm file X-Git-Tag: v3.2.1pre1~39 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9467c1f9b9b581e3abe78e00cc71de06fc175887;p=thirdparty%2Frsync.git Fix conditional directives in the asm file - Switch .s -> .S to enable the preprocessor. - Move some defines from mdigest.h to md-defines.h. - Tweak the asm file to use md-defines.h. - Add a couple missing .h dependencies in the Makefile. --- diff --git a/Makefile.in b/Makefile.in index 5fe567a8..7b37b710 100644 --- a/Makefile.in +++ b/Makefile.in @@ -37,7 +37,7 @@ SIMD_x86_64=simd-checksum-x86_64.o lib/md5-asm-x86_64.o GENFILES=configure.sh aclocal.m4 config.h.in proto.h proto.h-tstamp rsync.1 rsync.1.html \ rsync-ssl.1 rsync-ssl.1.html rsyncd.conf.5 rsyncd.conf.5.html HEADERS=byteorder.h config.h errcode.h proto.h rsync.h ifuncs.h itypes.h inums.h \ - lib/pool_alloc.h + lib/pool_alloc.h lib/mdigest.h lib/md-defines.h LIBOBJ=lib/wildmatch.o lib/compat.o lib/snprintf.o lib/mdfour.o lib/md5.o \ lib/permstring.o lib/pool_alloc.o lib/sysacls.o lib/sysxattrs.o @LIBOBJS@ zlib_OBJS=zlib/deflate.o zlib/inffast.o zlib/inflate.o zlib/inftrees.o \ @@ -134,8 +134,8 @@ rounding.h: rounding.c rsync.h proto.h simd-checksum-x86_64.o: simd-checksum-x86_64.cpp $(CXX) -I. $(CXXFLAGS) $(CPPFLAGS) -c -o $@ $(srcdir)/simd-checksum-x86_64.cpp -lib/md5-asm-x86_64.o: lib/md5-asm-x86_64.s - $(CC) -I. -c -o $@ $(srcdir)/lib/md5-asm-x86_64.s +lib/md5-asm-x86_64.o: lib/md5-asm-x86_64.S config.h lib/md-defines.h + $(CC) -I. -c -o $@ $(srcdir)/lib/md5-asm-x86_64.S tls$(EXEEXT): $(TLS_OBJ) $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(TLS_OBJ) $(LIBS) diff --git a/lib/md-defines.h b/lib/md-defines.h new file mode 100644 index 00000000..b92e8c07 --- /dev/null +++ b/lib/md-defines.h @@ -0,0 +1,15 @@ +/* Keep this simple so both C and ASM can use it */ + +#define MD4_DIGEST_LEN 16 +#define MD5_DIGEST_LEN 16 +#define MAX_DIGEST_LEN MD5_DIGEST_LEN + +#define CSUM_CHUNK 64 + +#define CSUM_NONE 0 +#define CSUM_MD4_ARCHAIC 1 +#define CSUM_MD4_BUSTED 2 +#define CSUM_MD4_OLD 3 +#define CSUM_MD4 4 +#define CSUM_MD5 5 +#define CSUM_XXH64 6 diff --git a/lib/md5-asm-x86_64.s b/lib/md5-asm-x86_64.S similarity index 99% rename from lib/md5-asm-x86_64.s rename to lib/md5-asm-x86_64.S index 29e2cc82..4eb884ed 100644 --- a/lib/md5-asm-x86_64.s +++ b/lib/md5-asm-x86_64.S @@ -25,8 +25,9 @@ */ #include "config.h" +#include "md-defines.h" -#ifndef USE_OPENSSL +#if !defined USE_OPENSSL && CSUM_CHUNK == 64 .text .align 16 @@ -705,4 +706,4 @@ _md5_process_asm: L_md5_process_asm_end: #endif -#endif /* !USE_OPENSSL */ +#endif /* !USE_OPENSSL ... */ diff --git a/lib/mdigest.h b/lib/mdigest.h index c3d22baa..db174017 100644 --- a/lib/mdigest.h +++ b/lib/mdigest.h @@ -4,20 +4,7 @@ #include "openssl/md4.h" #include "openssl/md5.h" #endif - -#define MD4_DIGEST_LEN 16 -#define MD5_DIGEST_LEN 16 -#define MAX_DIGEST_LEN MD5_DIGEST_LEN - -#define CSUM_CHUNK 64 - -#define CSUM_NONE 0 -#define CSUM_MD4_ARCHAIC 1 -#define CSUM_MD4_BUSTED 2 -#define CSUM_MD4_OLD 3 -#define CSUM_MD4 4 -#define CSUM_MD5 5 -#define CSUM_XXH64 6 +#include "md-defines.h" typedef struct { uint32 A, B, C, D;