build: detect and compile arm32 assembly #1751

issue Raimo33 openend this issue on September 19, 2025
  1. Raimo33 commented at 4:53 pm on September 19, 2025: none

    Currently, arm32 assembly gets only compiled if explicitly set via SECP256K1_ASM=arm32. When SECP256K1_ASM is set to AUTO, then the detection script only checks for x86 assembly. I propose adding check_arm32_assembly() also in the AUTO branch. see https://github.com/bitcoin/bitcoin/issues/32832#issuecomment-3268056766.

    This is the current snippet for reference:

     0set(SECP256K1_ASM "AUTO" CACHE STRING "Assembly to use: \"AUTO\", \"OFF\", \"x86_64\" or \"arm32\" (experimental). [default=AUTO]")
     1set_property(CACHE SECP256K1_ASM PROPERTY STRINGS "AUTO" "OFF" "x86_64" "arm32")
     2check_string_option_value(SECP256K1_ASM)
     3if(SECP256K1_ASM STREQUAL "arm32")
     4  enable_language(ASM)
     5  include(CheckArm32Assembly)
     6  check_arm32_assembly()
     7  if(HAVE_ARM32_ASM)
     8    add_compile_definitions(USE_EXTERNAL_ASM=1)
     9  else()
    10    message(FATAL_ERROR "ARM32 assembly requested but not available.")
    11  endif()
    12elseif(SECP256K1_ASM)
    13  include(CheckX86_64Assembly)
    14  check_x86_64_assembly()
    15  if(HAVE_X86_64_ASM)
    16    set(SECP256K1_ASM "x86_64")
    17    add_compile_definitions(USE_ASM_X86_64=1)
    18  elseif(SECP256K1_ASM STREQUAL "AUTO")
    19    set(SECP256K1_ASM "OFF")
    20  else()
    21    message(FATAL_ERROR "x86_64 assembly requested but not available.")
    22  endif()
    23endif()
    
  2. hebasto commented at 8:25 pm on September 19, 2025: member

    Currently, arm32 assembly gets only compiled if explicitly set via SECP256K1_ASM=arm32. When SECP256K1_ASM is set to AUTO, then the detection script only checks for x86 assembly. I propose adding check_arm32_assembly() also in the AUTO branch. see bitcoin/bitcoin#32832 (comment).

    The comment from @sipa that you’re referring to clearly states:

    because they were … unreviewed @Raimo33

    If this situation has changed and the assembly code has been reviewed, please leave references here. Until then, I don’t see any reason to bring this into Bitcoin Core.

  3. Raimo33 commented at 11:02 pm on September 19, 2025: none
    doesn’t the CI test secp functions? both in Bitcoin core and here.


Raimo33 hebasto


github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin-core/secp256k1. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2025-10-13 19:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me