diff --git a/crypto/CMakeLists.txt b/crypto/CMakeLists.txt index ad47f3dbbd..0e3f3f0d44 100644 --- a/crypto/CMakeLists.txt +++ b/crypto/CMakeLists.txt @@ -38,7 +38,6 @@ if(HOST_ASM_ELF_X86_64) sha/sha1-elf-x86_64.S sha/sha256-elf-x86_64.S sha/sha512-elf-x86_64.S - cpuid-elf-x86_64.S bn/arch/amd64/bignum_add.S bn/arch/amd64/bignum_cmadd.S @@ -66,7 +65,6 @@ if(HOST_ASM_ELF_X86_64) add_definitions(-DSHA256_ASM) add_definitions(-DSHA512_ASM) add_definitions(-DWHIRLPOOL_ASM) - add_definitions(-DOPENSSL_CPUID_OBJ) set(CRYPTO_SRC ${CRYPTO_SRC} ${ASM_X86_64_ELF_SRC}) endif() @@ -86,7 +84,6 @@ if(HOST_ASM_MACOSX_X86_64) sha/sha1-macosx-x86_64.S sha/sha256-macosx-x86_64.S sha/sha512-macosx-x86_64.S - cpuid-macosx-x86_64.S bn/arch/amd64/bignum_add.S bn/arch/amd64/bignum_cmadd.S @@ -114,7 +111,6 @@ if(HOST_ASM_MACOSX_X86_64) add_definitions(-DSHA256_ASM) add_definitions(-DSHA512_ASM) add_definitions(-DWHIRLPOOL_ASM) - add_definitions(-DOPENSSL_CPUID_OBJ) set(CRYPTO_SRC ${CRYPTO_SRC} ${ASM_X86_64_MACOSX_SRC}) set_property(SOURCE ${ASM_X86_64_MACOSX_SRC} PROPERTY XCODE_EXPLICIT_FILE_TYPE "sourcecode.asm") endif() @@ -135,7 +131,6 @@ if(HOST_ASM_MASM_X86_64) sha/sha1-masm-x86_64.S sha/sha256-masm-x86_64.S sha/sha512-masm-x86_64.S - cpuid-masm-x86_64.S ) add_definitions(-Dendbr64=) add_definitions(-DAES_ASM) @@ -151,7 +146,6 @@ if(HOST_ASM_MASM_X86_64) add_definitions(-DSHA256_ASM) add_definitions(-DSHA512_ASM) add_definitions(-DWHIRLPOOL_ASM) - add_definitions(-DOPENSSL_CPUID_OBJ) set(CRYPTO_SRC ${CRYPTO_SRC} ${ASM_X86_64_MASM_SRC}) set_property(SOURCE ${ASM_X86_64_MASM_SRC} PROPERTY LANGUAGE ASM_MASM) endif() @@ -172,7 +166,6 @@ if(HOST_ASM_MINGW64_X86_64) sha/sha1-mingw64-x86_64.S sha/sha256-mingw64-x86_64.S sha/sha512-mingw64-x86_64.S - cpuid-mingw64-x86_64.S ) add_definitions(-Dendbr32=endbr64) add_definitions(-DAES_ASM) @@ -188,10 +181,13 @@ if(HOST_ASM_MINGW64_X86_64) add_definitions(-DSHA256_ASM) add_definitions(-DSHA512_ASM) add_definitions(-DWHIRLPOOL_ASM) - add_definitions(-DOPENSSL_CPUID_OBJ) set(CRYPTO_SRC ${CRYPTO_SRC} ${ASM_X86_64_MINGW64_SRC}) endif() +if(HOST_X86_64) + set(CRYPTO_SRC ${CRYPTO_SRC} arch/amd64/crypto_cpu_caps.c) +endif() + set( CRYPTO_SRC ${CRYPTO_SRC} diff --git a/crypto/Makefile.am b/crypto/Makefile.am index a3888617f9..70365096e5 100644 --- a/crypto/Makefile.am +++ b/crypto/Makefile.am @@ -202,6 +202,10 @@ endif endif endif +if HOST_X86_64 +libcrypto_la_SOURCES += arch/amd64/crypto_cpu_caps.c +endif + libcrypto_la_SOURCES += cpt_err.c libcrypto_la_SOURCES += cryptlib.c libcrypto_la_SOURCES += crypto_ex_data.c diff --git a/crypto/Makefile.am.elf-x86_64 b/crypto/Makefile.am.elf-x86_64 index 990475e04c..c00ce026d3 100644 --- a/crypto/Makefile.am.elf-x86_64 +++ b/crypto/Makefile.am.elf-x86_64 @@ -12,7 +12,6 @@ ASM_X86_64_ELF += rc4/rc4-elf-x86_64.S ASM_X86_64_ELF += sha/sha1-elf-x86_64.S ASM_X86_64_ELF += sha/sha256-elf-x86_64.S ASM_X86_64_ELF += sha/sha512-elf-x86_64.S -ASM_X86_64_ELF += cpuid-elf-x86_64.S ASM_X86_64_ELF += bn/arch/amd64/bignum_add.S ASM_X86_64_ELF += bn/arch/amd64/bignum_cmadd.S @@ -43,6 +42,5 @@ libcrypto_la_CPPFLAGS += -DSHA1_ASM libcrypto_la_CPPFLAGS += -DSHA256_ASM libcrypto_la_CPPFLAGS += -DSHA512_ASM libcrypto_la_CPPFLAGS += -DWHIRLPOOL_ASM -libcrypto_la_CPPFLAGS += -DOPENSSL_CPUID_OBJ libcrypto_la_SOURCES += $(ASM_X86_64_ELF) endif diff --git a/crypto/Makefile.am.macosx-x86_64 b/crypto/Makefile.am.macosx-x86_64 index c380003068..cd88b95832 100644 --- a/crypto/Makefile.am.macosx-x86_64 +++ b/crypto/Makefile.am.macosx-x86_64 @@ -12,7 +12,6 @@ ASM_X86_64_MACOSX += rc4/rc4-macosx-x86_64.S ASM_X86_64_MACOSX += sha/sha1-macosx-x86_64.S ASM_X86_64_MACOSX += sha/sha256-macosx-x86_64.S ASM_X86_64_MACOSX += sha/sha512-macosx-x86_64.S -ASM_X86_64_MACOSX += cpuid-macosx-x86_64.S ASM_X86_64_MACOSX += bn/arch/amd64/bignum_add.S ASM_X86_64_MACOSX += bn/arch/amd64/bignum_cmadd.S @@ -43,6 +42,5 @@ libcrypto_la_CPPFLAGS += -DSHA1_ASM libcrypto_la_CPPFLAGS += -DSHA256_ASM libcrypto_la_CPPFLAGS += -DSHA512_ASM libcrypto_la_CPPFLAGS += -DWHIRLPOOL_ASM -libcrypto_la_CPPFLAGS += -DOPENSSL_CPUID_OBJ libcrypto_la_SOURCES += $(ASM_X86_64_MACOSX) endif diff --git a/crypto/Makefile.am.masm-x86_64 b/crypto/Makefile.am.masm-x86_64 index 437638c1ea..9ecccde837 100644 --- a/crypto/Makefile.am.masm-x86_64 +++ b/crypto/Makefile.am.masm-x86_64 @@ -12,7 +12,6 @@ ASM_X86_64_MASM += rc4/rc4-masm-x86_64.S ASM_X86_64_MASM += sha/sha1-masm-x86_64.S ASM_X86_64_MASM += sha/sha256-masm-x86_64.S ASM_X86_64_MASM += sha/sha512-masm-x86_64.S -ASM_X86_64_MASM += cpuid-masm-x86_64.S EXTRA_DIST += $(ASM_X86_64_MASM) @@ -30,6 +29,5 @@ libcrypto_la_CPPFLAGS += -DSHA1_ASM libcrypto_la_CPPFLAGS += -DSHA256_ASM libcrypto_la_CPPFLAGS += -DSHA512_ASM libcrypto_la_CPPFLAGS += -DWHIRLPOOL_ASM -libcrypto_la_CPPFLAGS += -DOPENSSL_CPUID_OBJ libcrypto_la_SOURCES += $(ASM_X86_64_MASM) endif diff --git a/crypto/Makefile.am.mingw64-x86_64 b/crypto/Makefile.am.mingw64-x86_64 index 2d41c37abf..c2464ab416 100644 --- a/crypto/Makefile.am.mingw64-x86_64 +++ b/crypto/Makefile.am.mingw64-x86_64 @@ -12,7 +12,6 @@ ASM_X86_64_MINGW64 += rc4/rc4-mingw64-x86_64.S ASM_X86_64_MINGW64 += sha/sha1-mingw64-x86_64.S ASM_X86_64_MINGW64 += sha/sha256-mingw64-x86_64.S ASM_X86_64_MINGW64 += sha/sha512-mingw64-x86_64.S -ASM_X86_64_MINGW64 += cpuid-mingw64-x86_64.S EXTRA_DIST += $(ASM_X86_64_MINGW64) @@ -31,6 +30,5 @@ libcrypto_la_CPPFLAGS += -DSHA1_ASM libcrypto_la_CPPFLAGS += -DSHA256_ASM libcrypto_la_CPPFLAGS += -DSHA512_ASM libcrypto_la_CPPFLAGS += -DWHIRLPOOL_ASM -libcrypto_la_CPPFLAGS += -DOPENSSL_CPUID_OBJ libcrypto_la_SOURCES += $(ASM_X86_64_MINGW64) endif diff --git a/update.sh b/update.sh index 2948e0fa88..8fdae9de8a 100755 --- a/update.sh +++ b/update.sh @@ -172,6 +172,10 @@ for i in $libcrypto_src/arch/*; do $CP $libcrypto_src/arch/$arch/opensslconf.h include/arch/$arch/ mkdir -p crypto/arch/$arch $CP $libcrypto_src/arch/$arch/crypto_arch.h crypto/arch/$arch/ + crypto_cpu_caps=$libcrypto_src/arch/$arch/crypto_cpu_caps.c + if [ -f "$crypto_cpu_caps" ]; then + $CP "$crypto_cpu_caps" crypto/arch/$arch/ + fi done for i in $libcrypto_src/bn/arch/*; do @@ -282,7 +286,6 @@ for abi in elf macosx masm mingw64; do gen_asm_stdout $abi sha/asm/sha1-x86_64.pl sha/sha1-$abi-x86_64.S gen_asm $abi sha/asm/sha512-x86_64.pl sha/sha256-$abi-x86_64.S gen_asm $abi sha/asm/sha512-x86_64.pl sha/sha512-$abi-x86_64.S - gen_asm $abi x86_64cpuid.pl cpuid-$abi-x86_64.S done # copy libtls source