build: detect and compile arm32 assembly #1751

issue Raimo33 opened 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:

    set(SECP256K1_ASM "AUTO" CACHE STRING "Assembly to use: \"AUTO\", \"OFF\", \"x86_64\" or \"arm32\" (experimental). [default=AUTO]")
    set_property(CACHE SECP256K1_ASM PROPERTY STRINGS "AUTO" "OFF" "x86_64" "arm32")
    check_string_option_value(SECP256K1_ASM)
    if(SECP256K1_ASM STREQUAL "arm32")
      enable_language(ASM)
      include(CheckArm32Assembly)
      check_arm32_assembly()
      if(HAVE_ARM32_ASM)
        add_compile_definitions(USE_EXTERNAL_ASM=1)
      else()
        message(FATAL_ERROR "ARM32 assembly requested but not available.")
      endif()
    elseif(SECP256K1_ASM)
      include(CheckX86_64Assembly)
      check_x86_64_assembly()
      if(HAVE_X86_64_ASM)
        set(SECP256K1_ASM "x86_64")
        add_compile_definitions(USE_ASM_X86_64=1)
      elseif(SECP256K1_ASM STREQUAL "AUTO")
        set(SECP256K1_ASM "OFF")
      else()
        message(FATAL_ERROR "x86_64 assembly requested but not available.")
      endif()
    endif()
    
  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.


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: 2026-04-18 17:15 UTC

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