diff --git a/crypto/x86cpuid.pl b/crypto/x86cpuid.pl index 3b6c469d08..e8a75181af 100644 --- a/crypto/x86cpuid.pl +++ b/crypto/x86cpuid.pl @@ -69,6 +69,7 @@ for (@ARGV) { $sse2=1 if (/-DOPENSSL_IA32_SSE2/); } &inc ("esi"); # number of cores &mov ("eax",1); + &xor ("ecx","ecx"); &cpuid (); &bt ("edx",28); &jnc (&label("generic")); @@ -102,6 +103,7 @@ for (@ARGV) { $sse2=1 if (/-DOPENSSL_IA32_SSE2/); } &set_label("nocacheinfo"); &mov ("eax",1); + &xor ("ecx","ecx"); &cpuid (); &and ("edx",0xbfefffff); # force reserved bits #20, #30 to 0 &cmp ("ebp",0); diff --git a/util/mk1mf.pl b/util/mk1mf.pl index e0e8d57243..f12f9ea3fa 100755 --- a/util/mk1mf.pl +++ b/util/mk1mf.pl @@ -875,16 +875,18 @@ sub fix_asm return $asm . ' '; } -$lib_obj{CRYPTO} .= fix_asm($mf_md5_asm, 'crypto/md5'); -$lib_obj{CRYPTO} .= fix_asm($mf_bn_asm, 'crypto/bn'); -# cpuid is included by the crypto dir -#$lib_obj{CRYPTO} .= fix_asm($mf_cpuid_asm, 'crypto'); -# AES asm files end up included by the aes dir itself -#$lib_obj{CRYPTO} .= fix_asm($mf_aes_asm, 'crypto/aes'); -$lib_obj{CRYPTO} .= fix_asm($mf_sha_asm, 'crypto/sha'); -$lib_obj{CRYPTO} .= fix_asm($mf_engines_asm, 'engines'); -$lib_obj{CRYPTO} .= fix_asm($mf_rc4_asm, 'crypto/rc4'); -$lib_obj{CRYPTO} .= fix_asm($mf_modes_asm, 'crypto/modes'); +if ($orig_platform eq 'copy') { + $lib_obj{CRYPTO} .= fix_asm($mf_md5_asm, 'crypto/md5'); + $lib_obj{CRYPTO} .= fix_asm($mf_bn_asm, 'crypto/bn'); + # cpuid is included by the crypto dir + $lib_obj{CRYPTO} .= fix_asm($mf_cpuid_asm, 'crypto'); + # AES asm files end up included by the aes dir itself + #$lib_obj{CRYPTO} .= fix_asm($mf_aes_asm, 'crypto/aes'); + $lib_obj{CRYPTO} .= fix_asm($mf_sha_asm, 'crypto/sha'); + $lib_obj{CRYPTO} .= fix_asm($mf_engines_asm, 'engines'); + $lib_obj{CRYPTO} .= fix_asm($mf_rc4_asm, 'crypto/rc4'); + $lib_obj{CRYPTO} .= fix_asm($mf_modes_asm, 'crypto/modes'); +} foreach (values %lib_nam) {