Re: Openssl fails build on Mac OS X 10.11

Scott Hannahs via Fink-users <[email protected]>
Newsgroups gmane.os.apple.fink.general
Message-ID <[email protected]>

> On Oct 2, 2021, at 6:42 PM, Hanspeter Niederstrasser <[email protected]> wrote:
> 
> On 10/1/21 6:51 AM, Scott Hannahs via Fink-users wrote:
>> This is the second of a few build failures.  Attempt to try to update openssl.  This is OpenSSL 3.0, I think and different from the version 110 libraries of my previous message.  This has LOTS of errors of this type.
>> cc -fPIC -arch x86_64 -O3 -Wall -DL_ENDIAN -DOPENSSL_PIC -DOPENSSLDIR="\"/sw/etc/ssl\"" -DENGINESDIR="\"/sw/lib/engines-3\"" -DMODULESDIR="\"/sw/lib/ossl-modules\"" -D_REENTRANT -DOPENSSL_BUILDING_OPENSSL -DZLIB -DZLIB_SHARED -DNDEBUG -I/sw/include -c -o crypto/bn/libcrypto-lib-rsaz-avx512.o crypto/bn/rsaz-avx512.s
>> crypto/bn/rsaz-avx512.s:36:2: error: instruction requires: AVX-512 ISA AVX-512 VL ISA
>>  vpxord %ymm0,%ymm0,%ymm0
>>  ^
>> crypto/bn/rsaz-avx512.s:37:2: error: instruction requires: AVX-512 ISA AVX-512 VL ISA
>>  vmovdqa64 %ymm0,%ymm1
>>  ^
>> and this type:
>> crypto/bn/rsaz-avx512.s:76:2: error: invalid instruction mnemonic 'vpmadd52luq'
>>  vpmadd52luq 0(%rsi),%ymm3,%ymm1
>>  ^~~~~~~~~~~
>> crypto/bn/rsaz-avx512.s:77:2: error: invalid instruction mnemonic 'vpmadd52luq'
>>  vpmadd52luq 32(%rsi),%ymm3,%ymm16
>>  ^~~~~~~~~~~
> 
> 
> See https://github.com/fink/fink-distributions/issues/858 <https://github.com/fink/fink-distributions/issues/858>
> 
> Hanspeter

I see home-brew has run into the same problem.  This seems to be a problem on 
OS 10.14		Xcode 9
OS 10.13		Xcode 10
OS 10.11		Xcode 8.2.1

But works on 
OS 10.14		Xcode 10
And more recent?

I did just now find an interesting comment with a workaround requiring an external assembler.

https://giters.com/openssl/openssl/issues/14668 <https://giters.com/openssl/openssl/issues/14668>

Sorry for that. The reason is that clang-6 does not enable proper -march flags by default for assembly modules (this file requires avx512ifma, avx512dq, avx512vl, avx512f). This is not true for newer versions - clang-7 and further work ok.

Seems like currently in OpenSSL it is not encouraged to set specific flags for specific archs with file based granularity, so probably the best solution would be to increase minimum required clang version for this file to 7.0. I'll make a PR with it.

For older clang versions users who want to get such optimization, we have a note in the OPENSSL_ia32cap <https://www.openssl.org/docs/manmaster/man3/OPENSSL_ia32cap.html> with the workaround - use a wrapper that forces to use external assembler.

Please let me know if you have any concerns about the proposed fix.

_______________________________________________
Fink-users mailing list
[email protected]
List archive:
https://sourceforge.net/p/fink/mailman/fink-users/
Subscription management:
https://lists.sourceforge.net/lists/listinfo/fink-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.