Topic: Building for OSX 14.4

Hey,

I am trying to build wolfSSL 5.7.0 for OSX 14.4 but running into errors at the make step.

Here is a snippet of my errors:

wolfcrypt/src/sp_int.c:6299:9: error: invalid operand for instruction
        SP_ASM_MUL_ADD_NO(l, h, a->dp[i], d);
        ^
wolfcrypt/src/sp_int.c:1164:9: note: expanded from macro 'SP_ASM_MUL_ADD_NO'
        "umlal  %[l], %[h], %[a], %[b]  \n\t"            \
        ^
<inline asm>:1:8: note: instantiated into assembly here
        umlal   x11, x10, x13, x1   

If anyone can help me out with what could potentially be causing this and if there are any config flags that could help, it would be a huge help!

Running on:
Apple clang version 15.0.0 (clang-1500.3.9.4)
Target: arm64-apple-darwin23.4.0
Thread model: posix

Share

2 (edited by manya 2024-06-17 10:09:14)

Re: Building for OSX 14.4

If someone finds themselves here with a similar problem, these configuration flags fixed it for me:

./configure CFLAGS="-march=armv8-a" --disable-asm

Share

Re: Building for OSX 14.4

Hi manya,

Please share your build config for wolfSSL (./configure line or user_settings.h).  I will have our assembly expert review this.
It would be helpful to know if you see the same issue on wolfSSL master.

Thanks,
Kareem

Share

Re: Building for OSX 14.4

Hi manya,

I just saw your updated post.  Disabling asm will work around the issue, but ideally I would like to get this fixed so you can benefit from our assembly optimizations as well.

Share

Re: Building for OSX 14.4

I have the same (probably) issue.  I ran ./configure with no options and then make.

when I run ./configure I get

./configure flags:

at the end (yes, its empty after the colon)

then make outputs thousands of lines of warnings and errors.

fatal error: too many errors emitted, stopping now [-ferror-limit=]
3371 warnings and 20 errors generated.

the last 5

wolfcrypt/src/sp_int.c:1321:32: error: expected compatible register, symbol or integer in range [0, 4095]
1321 |         "add    %[r], %[r], %[r]\n\t"
      |                                   ^
<inline asm>:15:16: note: instantiated into assembly here
   15 |         sub     x12, x12, r8
      |                           ^
wolfcrypt/src/sp_int.c:1322:30: error: invalid operand for instruction
1322 |         "sub    %[r], %[r], r8\n\t"
      |                                 ^
<inline asm>:16:6: note: instantiated into assembly here
   16 |         and     r8, r8, r5
      |                 ^
wolfcrypt/src/sp_int.c:1323:26: error: invalid operand for instruction
1323 |         "and    r8, r8, r5\n\t"
      |                             ^
<inline asm>:17:7: note: instantiated into assembly here
   17 |         subs    r9, r9, r8
      |                 ^
wolfcrypt/src/sp_int.c:1324:27: error: invalid operand for instruction
1324 |         "subs   r9, r9, r8\n\t"
      |                             ^
<inline asm>:18:6: note: instantiated into assembly here
   18 |         mov     r4, #29
      |                 ^
wolfcrypt/src/sp_int.c:1327:16: error: invalid operand for instruction
1327 |         "\n1:\n\t"
      |                ^
<inline asm>:21:7: note: instantiated into assembly here
   21 |         movs    r6, r6, lsl #1


I'll answer any questions you may have about my build environment.

Share

Re: Building for OSX 14.4

Hi OilProducts,

What version of wolfSSL are you using and which compiler are you using on OS X?  What version is your OS X compiler/toolchain?  If you aren't using our latest release 5.7.6, please give it a try and let me know if it helps.

Thanks,
Kareem

Share

7 (edited by OilProducts 2025-01-09 10:57:53)

Re: Building for OSX 14.4

I'm using wolfSSL 5.7.6 unzipped from the download on https://www.wolfssl.com/download/

% sha256 wolfssl-5.7.6.zip
SHA256 (wolfssl-5.7.6.zip) = cbb9da98a678156b1b294301ffd0139cfae19c60b46dff397418940690291a20


% gcc --version
Apple clang version 16.0.0 (clang-1600.0.26.6)
Target: arm64-apple-darwin24.2.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

This is a pretty default C environment for this machine.  I have not installed gcc specifically so /usr/bin/cc and /usr/bin/gcc are both actually clang (as will be the case for most macOS machines).  Sequoia 15.2.

Any suggestions?

Share