0

I've got a problem with running iOS application created with RoboVM framework. Probably this is caused by my processor which is not supporting AVX instruction. I found the page: https://www.openssl.org/docs/manmaster/crypto/OPENSSL_ia32cap.html with information that it is possible to disable AVX in OpenSSL using env variables. I don't understand how to calculate proper value to disable all AVX instructions. Could you explain how I have to calculate it?

jww
  • 97,681
  • 90
  • 411
  • 885
Blady214
  • 729
  • 6
  • 19
  • It sounds like you are debugging on a simulator. Is that correct? – jww Oct 17 '16 at 17:23
  • @jww no, simulator is working fine. I've got a problem with debugging on phisical device. – Blady214 Oct 17 '16 at 17:55
  • 1
    Something sounds fishy, but I may be missing something obvious. Is Apple building x86-based phones or tablets now? I'll *hazard* a guess and say RoboVM built a binary for your host OS X machine, which is x86_64. i386 would be fine if it was for the simulator, but you stated its not. You need RoboVM to configure and build OpenSSL for ARMv7 or ARMv8. – jww Oct 17 '16 at 18:15
  • 1
    To answer your question without the distractions of Apple devices and ARM, use `OPENSSL_ia32cap="~0x4000000000000000"`. – jww Oct 17 '16 at 18:31
  • @jww thanks for your help, I will try it ASAP. I am not sure but RoboVM build both for x86 and x64. Here: https://github.com/MobiDevelop/robovm/issues/55 is the issue which I deal with. – Blady214 Oct 17 '16 at 18:35
  • 2
    My bad... I gave you RDRAND and bit 62. You want AVX and bit 60. Use `OPENSSL_ia32cap="~01000000000000000"`. Bits are 0-based. Here is the binary string: `0001 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000`. – jww Oct 17 '16 at 18:51
  • @jww thank you very mauch! Now I understand how to calculate it, but what with bits which are defined as: 64 + 5. They write that I should use : as delimeter. – Blady214 Oct 17 '16 at 21:10
  • I believe bit 64 is `1 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000` (notice the high order 1). The man page tells you to use `:` for it. I believe bit 5 is `... 0001 0000` (notice the low order 1 in the nibble). If I am parsing things correctly, then you use `:0x10`. – jww Oct 17 '16 at 21:26

1 Answers1

0

Configure openssl with 'no-asm'. I believe that this disables the assembler and so AVX

vivek
  • 21
  • 3