Closes #1034.
Solves one item in #1235.
8@@ -9,6 +9,25 @@ AC_LINK_IFELSE([AC_LANG_PROGRAM([[
9 AC_MSG_RESULT([$has_64bit_asm])
10 ])
11
12+AC_DEFUN([SECP_ARM32_ASM_CHECK], [
13+ AC_MSG_CHECKING(for ARM32 assembly availability)
14+ SECP_ARM32_ASM_CHECK_CFLAGS_saved_CFLAGS="$CFLAGS"
15+ CFLAGS="-x assembler"
16+ AC_COMPILE_IFELSE([[
utACK d1831a23c0c3b40f784c0fbbf31297564ece569a
Ideally, someone would test this on ARM32. But I think it’s not a strict requirement because it seems to work on CI.
Perhaps that PR is a good opportunity to rename check_64bit_assembly
into check_x86_64_assembly
(and same for related variables and functions)
Perhaps that PR is a good opportunity to rename
check_64bit_assembly
intocheck_x86_64_assembly
(and same for related variables and functions)
Done.
Ideally, someone would test this on ARM32.
FWIW, here are my logs on a machine with
0$ uname -m
1armv7l
0$ ./configure --with-asm=arm32 --enable-experimental
1checking build system type... armv7l-unknown-linux-gnueabihf
2checking host system type... armv7l-unknown-linux-gnueabihf
3checking for a BSD-compatible install... /usr/bin/install -c
4checking whether build environment is sane... yes
5checking for a race-free mkdir -p... /usr/bin/mkdir -p
6checking for gawk... no
7checking for mawk... mawk
8checking whether make sets $(MAKE)... yes
9checking whether make supports nested variables... yes
10checking whether make supports nested variables... (cached) yes
11checking for gcc... gcc
12checking whether the C compiler works... yes
13checking for C compiler default output file name... a.out
14checking for suffix of executables...
15checking whether we are cross compiling... no
16checking for suffix of object files... o
17checking whether the compiler supports GNU C... yes
18checking whether gcc accepts -g... yes
19checking for gcc option to enable C11 features... none needed
20checking whether gcc understands -c and -o together... yes
21checking whether make supports the include directive... yes (GNU style)
22checking dependency style of gcc... gcc3
23checking dependency style of gcc... gcc3
24checking for ar... ar
25checking the archiver (ar) interface... ar
26checking how to print strings... printf
27checking for a sed that does not truncate output... /usr/bin/sed
28checking for grep that handles long lines and -e... /usr/bin/grep
29checking for egrep... /usr/bin/grep -E
30checking for fgrep... /usr/bin/grep -F
31checking for ld used by gcc... /usr/bin/ld
32checking if the linker (/usr/bin/ld) is GNU ld... yes
33checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
34checking the name lister (/usr/bin/nm -B) interface... BSD nm
35checking whether ln -s works... yes
36checking the maximum length of command line arguments... 1572864
37checking how to convert armv7l-unknown-linux-gnueabihf file names to armv7l-unknown-linux-gnueabihf format... func_convert_file_noop
38checking how to convert armv7l-unknown-linux-gnueabihf file names to toolchain format... func_convert_file_noop
39checking for /usr/bin/ld option to reload object files... -r
40checking for objdump... objdump
41checking how to recognize dependent libraries... pass_all
42checking for dlltool... no
43checking how to associate runtime and link libraries... printf %s\n
44checking for archiver [@FILE](/bitcoin-core-secp256k1/contributor/file/) support... @
45checking for strip... strip
46checking for ranlib... ranlib
47checking command to parse /usr/bin/nm -B output from gcc object... ok
48checking for sysroot... no
49checking for a working dd... /usr/bin/dd
50checking how to truncate binary pipes... /usr/bin/dd bs=4096 count=1
51checking for mt... mt
52checking if mt is a manifest tool... no
53checking for stdio.h... yes
54checking for stdlib.h... yes
55checking for string.h... yes
56checking for inttypes.h... yes
57checking for stdint.h... yes
58checking for strings.h... yes
59checking for sys/stat.h... yes
60checking for sys/types.h... yes
61checking for unistd.h... yes
62checking for dlfcn.h... yes
63checking for objdir... .libs
64checking if gcc supports -fno-rtti -fno-exceptions... no
65checking for gcc option to produce PIC... -fPIC -DPIC
66checking if gcc PIC flag -fPIC -DPIC works... yes
67checking if gcc static flag -static works... yes
68checking if gcc supports -c -o file.o... yes
69checking if gcc supports -c -o file.o... (cached) yes
70checking whether the gcc linker (/usr/bin/ld) supports shared libraries... yes
71checking whether -lc should be explicitly linked in... no
72checking dynamic linker characteristics... GNU/Linux ld.so
73checking how to hardcode library paths into programs... immediate
74checking whether stripping libraries is possible... yes
75checking if libtool supports shared libraries... yes
76checking whether to build shared libraries... yes
77checking whether to build static libraries... yes
78checking if gcc supports -Werror... yes
79checking if gcc supports -std=c89 -pedantic -Wno-long-long -Wnested-externs -Wshadow -Wstrict-prototypes -Wundef... yes
80checking if gcc supports -Wno-overlength-strings... yes
81checking if gcc supports -Wall... yes
82checking if gcc supports -Wno-unused-function... yes
83checking if gcc supports -Wextra... yes
84checking if gcc supports -Wcast-align... yes
85checking if gcc supports -Wcast-align=strict... yes
86checking if gcc supports -Wconditional-uninitialized... no
87checking if gcc supports -Wreserved-identifier... no
88checking if gcc supports -fvisibility=hidden... yes
89checking for valgrind support...
90checking for ARM32 assembly availability... yes
91configure: ******
92configure: WARNING: experimental build
93configure: Experimental features do not have stable APIs or properties, and may not be safe for production use.
94configure: ******
95checking that generated files are newer than configure... done
96configure: creating ./config.status
97config.status: creating Makefile
98config.status: creating libsecp256k1.pc
99config.status: executing depfiles commands
100config.status: executing libtool commands
101
102Build Options:
103 with external callbacks = no
104 with benchmarks = yes
105 with tests = yes
106 with ctime tests = no
107 with coverage = no
108 with examples = no
109 module ecdh = yes
110 module recovery = no
111 module extrakeys = yes
112 module schnorrsig = yes
113
114 asm = arm32
115 ecmult window size = 15
116 ecmult gen prec. bits = 4
117
118 valgrind = no
119 CC = gcc
120 CPPFLAGS =
121 SECP_CFLAGS = -O2 -std=c89 -pedantic -Wno-long-long -Wnested-externs -Wshadow -Wstrict-prototypes -Wundef -Wno-overlength-strings -Wall -Wno-unused-function -Wextra -Wcast-align -Wcast-align=strict -fvisibility=hidden
122 CFLAGS = -g -O2
123 LDFLAGS =
0$ cmake -S . -B build -DSECP256K1_ASM=arm32 -DSECP256K1_EXPERIMENTAL=ON
1-- The C compiler identification is GNU 11.3.0
2-- Detecting C compiler ABI info
3-- Detecting C compiler ABI info - done
4-- Check for working C compiler: /usr/bin/cc - skipped
5-- Detecting C compile features
6-- Detecting C compile features - done
7-- The ASM compiler identification is GNU
8-- Found assembler: /usr/bin/cc
9-- Could NOT find Valgrind (missing: Valgrind_INCLUDE_DIR Valgrind_WORKS)
10-- Setting build type to "RelWithDebInfo" as none was specified
11-- Performing Test C_SUPPORTS__PEDANTIC
12-- Performing Test C_SUPPORTS__PEDANTIC - Success
13-- Performing Test C_SUPPORTS__WALL
14-- Performing Test C_SUPPORTS__WALL - Success
15-- Performing Test C_SUPPORTS__WCAST_ALIGN
16-- Performing Test C_SUPPORTS__WCAST_ALIGN - Success
17-- Performing Test C_SUPPORTS__WCAST_ALIGN_STRICT
18-- Performing Test C_SUPPORTS__WCAST_ALIGN_STRICT - Success
19-- Performing Test C_SUPPORTS__WCONDITIONAL_UNINITIALIZED
20-- Performing Test C_SUPPORTS__WCONDITIONAL_UNINITIALIZED - Failed
21-- Performing Test C_SUPPORTS__WEXTRA
22-- Performing Test C_SUPPORTS__WEXTRA - Success
23-- Performing Test C_SUPPORTS__WNESTED_EXTERNS
24-- Performing Test C_SUPPORTS__WNESTED_EXTERNS - Success
25-- Performing Test C_SUPPORTS__WNO_LONG_LONG
26-- Performing Test C_SUPPORTS__WNO_LONG_LONG - Success
27-- Performing Test C_SUPPORTS__WNO_OVERLENGTH_STRINGS
28-- Performing Test C_SUPPORTS__WNO_OVERLENGTH_STRINGS - Success
29-- Performing Test C_SUPPORTS__WNO_UNUSED_FUNCTION
30-- Performing Test C_SUPPORTS__WNO_UNUSED_FUNCTION - Success
31-- Performing Test C_SUPPORTS__WRESERVED_IDENTIFIER
32-- Performing Test C_SUPPORTS__WRESERVED_IDENTIFIER - Failed
33-- Performing Test C_SUPPORTS__WSHADOW
34-- Performing Test C_SUPPORTS__WSHADOW - Success
35-- Performing Test C_SUPPORTS__WSTRICT_PROTOTYPES
36-- Performing Test C_SUPPORTS__WSTRICT_PROTOTYPES - Success
37-- Performing Test C_SUPPORTS__WUNDEF
38-- Performing Test C_SUPPORTS__WUNDEF - Success
39
40
41secp256k1 configure summary
42===========================
43Build artifacts:
44 library type ........................ Shared
45Optional modules:
46 ECDH ................................ ON
47 ECDSA pubkey recovery ............... OFF
48 extrakeys ........................... ON
49 schnorrsig .......................... ON
50Parameters:
51 ecmult window size .................. 15
52 ecmult gen precision bits ........... 4
53Optional features:
54 assembly optimization ............... arm32
55 external callbacks .................. OFF
56Optional binaries:
57 benchmark ........................... ON
58 noverify_tests ...................... ON
59 tests ............................... ON
60 exhaustive tests .................... ON
61 ctime_tests ......................... OFF
62 examples ............................ OFF
63
64Cross compiling ....................... FALSE
65Valgrind .............................. OFF
66Preprocessor defined macros ........... ENABLE_MODULE_ECDH=1 ENABLE_MODULE_SCHNORRSIG=1 ENABLE_MODULE_EXTRAKEYS=1 ECMULT_WINDOW_SIZE=15 ECMULT_GEN_PREC_BITS=4 USE_EXTERNAL_ASM=1
67C compiler ............................ /usr/bin/cc
68CFLAGS ................................
69Compile options ....................... -pedantic -Wall -Wcast-align -Wcast-align=strict -Wextra -Wnested-externs -Wno-long-long -Wno-overlength-strings -Wno-unused-function -Wshadow -Wstrict-prototypes -Wundef
70Build type:
71 - CMAKE_BUILD_TYPE ................... RelWithDebInfo
72 - CFLAGS ............................. -O2 -g
73 - LDFLAGS for executables ............
74 - LDFLAGS for shared libraries .......
75
76
77 ******
78 WARNING: experimental build
79 Experimental features do not have stable APIs or properties, and may not be safe for production use.
80 ******
81
82-- Configuring done
83-- Generating done
84-- Build files have been written to: /home/hebasto/secp256k1/build
FWIW, this PR can also be tested using cross compiling:
0$ ./configure --host=arm-linux-gnueabihf --with-asm=arm32 --enable-experimental
or
0$ cmake -S . -B build -DCMAKE_TOOLCHAIN_FILE=cmake/arm-linux-gnueabihf.toolchain.cmake -DSECP256K1_ASM=arm32 -DSECP256K1_EXPERIMENTAL=ON
UPD. It must fail for --host=aarch64-linux-gnu
.
Labels
build