Skip to content

Question: is --enable-sp-asm supported for x86_64-w64-mingw32 autotools builds? #10690

@somes

Description

@somes

Version

5.9.1

Description

I am trying to cross-compile wolfSSL/wolfCrypt with wolfSM enabled for Windows x64 using MinGW-w64 from Linux.

Configure command:

./configure \
  --enable-sm2 \
  --enable-sm3 \
  --enable-sm4-ecb --enable-sm4-cbc --enable-sm4-ctr --enable-sm4-gcm --enable-sm4-ccm \
  --enable-sp --enable-sp-asm \
  --enable-cryptonly \
  --enable-static --disable-shared \
  --host=x86_64-w64-mingw32

With --enable-sp-asm, the generated configuration contains:

$ grep -R "WOLFSSL_SP_X86_64_ASM" -n wolfssl/options.h

227:#undef  WOLFSSL_SP_X86_64_ASM
228:#define WOLFSSL_SP_X86_64_ASM
$ grep -R "src_libwolfssl_la-sp_x86_64_asm.lo:" -n Makefile

6718:wolfcrypt/src/src_libwolfssl_la-sp_x86_64_asm.lo:  \
8348:wolfcrypt/src/src_libwolfssl_la-sp_x86_64_asm.lo: wolfcrypt/src/sp_x86_64_asm.S

The build then fails while assembling that file:

wolfcrypt/src/sp_x86_64_asm.S: Assembler messages:
wolfcrypt/src/sp_x86_64_asm.S:64: Warning: .type pseudo-op used outside of .def/.endef: ignored.
wolfcrypt/src/sp_x86_64_asm.S:64: Error: junk at end of line, first unrecognized character is `s'

If I remove --enable-sp-asm, the same MinGW-w64 cross build succeeds.

It looks like the autotools build is selecting the Unix/ELF-style sp_x86_64_asm.S for the x86_64-w64-mingw32 host. Could you clarify whether x86_64 SP assembly is expected to be supported for MinGW-w64 autotools cross builds?

Specifically:

  1. Is --enable-sp-asm supported for --host=x86_64-w64-mingw32?
  2. If yes, is there an additional configure option needed to select a Windows-compatible x86_64 SP assembly backend?
  3. If not, should configure reject or disable --enable-sp-asm for this host instead of generating a Makefile that later fails in the assembler?

I have attached wolfssl/options.h, config.log, and Makefile generated by this configure command.

options.h.txt

config.log

Makefile.txt

Metadata

Metadata

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions