Skip to content

Commit b213535

Browse files
committed
Squashed 'src/secp256k1/' changes from 6c527ec..7a49cac
7a49cac Merge dogecoin#410: Add string.h include to ecmult_impl 0bbd5d4 Add string.h include to ecmult_impl c5b32e1 Merge dogecoin#405: Make secp256k1_fe_sqrt constant time 926836a Make secp256k1_fe_sqrt constant time e2a8e92 Merge dogecoin#404: Replace 3M + 4S doubling formula with 2M + 5S one 8ec49d8 Add note about 2M + 5S doubling formula 5a91bd7 Merge dogecoin#400: A couple minor cleanups ac01378 build: add -DSECP256K1_BUILD to benchmark_internal build flags a6c6f99 Remove a bunch of unused stdlib #includes 65285a6 Merge dogecoin#403: configure: add flag to disable OpenSSL tests a9b2a5d configure: add flag to disable OpenSSL tests b340123 Merge dogecoin#402: Add support for testing quadratic residues e6e9805 Add function for testing quadratic residue field/group elements. efd953a Add Jacobi symbol test via GMP fa36a0d Merge dogecoin#401: ecmult_const: unify endomorphism and non-endomorphism skew cases c6191fd ecmult_const: unify endomorphism and non-endomorphism skew cases 0b3e618 Merge dogecoin#378: .gitignore build-aux cleanup 6042217 Merge dogecoin#384: JNI: align shared files copyright/comments to bitcoinj's 24ad20f Merge dogecoin#399: build: verify that the native compiler works for static precomp b3be852 Merge dogecoin#398: Test whether ECDH and Schnorr are enabled for JNI aa0b1fd build: verify that the native compiler works for static precomp eee808d Test whether ECDH and Schnorr are enabled for JNI 7b0fb18 Merge dogecoin#366: ARM assembly implementation of field_10x26 inner (rebase of dogecoin#173) 001f176 ARM assembly implementation of field_10x26 inner 0172be9 Merge dogecoin#397: Small fixes for sha256 3f8b78e Fix undefs in hash_impl.h 2ab4695 Fix state size in sha256 struct 6875b01 Merge dogecoin#386: Add some missing `VERIFY_CHECK(ctx != NULL)` 2c52b5d Merge dogecoin#389: Cast pointers through uintptr_t under JNI 43097a4 Merge dogecoin#390: Update bitcoin-core GitHub links 31c9c12 Merge dogecoin#391: JNI: Only call ecdsa_verify if its inputs parsed correctly 1cb2302 Merge dogecoin#392: Add testcase which hits additional branch in secp256k1_scalar_sqr d2ee340 Merge dogecoin#388: bench_ecdh: fix call to secp256k1_context_create 093a497 Add testcase which hits additional branch in secp256k1_scalar_sqr a40c701 JNI: Only call ecdsa_verify if its inputs parsed correctly faa2a11 Update bitcoin-core GitHub links 47b9e78 Cast pointers through uintptr_t under JNI f36f9c6 bench_ecdh: fix call to secp256k1_context_create bcc4881 Add some missing `VERIFY_CHECK(ctx != NULL)` for functions that use `ARG_CHECK` 6ceea2c align shared files copyright/comments to bitcoinj's 70141a8 Update .gitignore 7b549b1 Merge dogecoin#373: build: fix x86_64 asm detection for some compilers bc7c93c Merge dogecoin#374: Add note about y=0 being possible on one of the sextic twists e457018 Merge dogecoin#364: JNI rebased 86e2d07 JNI library: cleanup, removed unimplemented code 3093576a JNI library bd2895f Merge pull request dogecoin#371 e72e93a Add note about y=0 being possible on one of the sextic twists 3f8fdfb build: fix x86_64 asm detection for some compilers e5a9047 [Trivial] Remove double semicolons c18b869 Merge pull request dogecoin#360 3026daa Merge pull request dogecoin#302 03d4611 Add sage verification script for the group laws a965937 Merge pull request dogecoin#361 83221ec Add experimental features to configure 5d4c5a3 Prevent damage_array in the signature test from going out of bounds. 419bf7f Merge pull request dogecoin#356 03d84a4 Benchmark against OpenSSL verification git-subtree-dir: src/secp256k1 git-subtree-split: 7a49cacd3937311fcb1cb36b6ba3336fca811991
1 parent 5ad5463 commit b213535

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+3905
-195
lines changed

.gitignore

+13-6
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,24 @@ config.status
2525
libtool
2626
.deps/
2727
.dirstamp
28-
build-aux/
2928
*.lo
3029
*.o
3130
*~
3231
src/libsecp256k1-config.h
3332
src/libsecp256k1-config.h.in
3433
src/ecmult_static_context.h
35-
m4/libtool.m4
36-
m4/ltoptions.m4
37-
m4/ltsugar.m4
38-
m4/ltversion.m4
39-
m4/lt~obsolete.m4
34+
build-aux/config.guess
35+
build-aux/config.sub
36+
build-aux/depcomp
37+
build-aux/install-sh
38+
build-aux/ltmain.sh
39+
build-aux/m4/libtool.m4
40+
build-aux/m4/lt~obsolete.m4
41+
build-aux/m4/ltoptions.m4
42+
build-aux/m4/ltsugar.m4
43+
build-aux/m4/ltversion.m4
44+
build-aux/missing
45+
build-aux/compile
46+
build-aux/test-driver
4047
src/stamp-h1
4148
libsecp256k1.pc

.travis.yml

+13-6
Original file line numberDiff line numberDiff line change
@@ -6,26 +6,31 @@ addons:
66
compiler:
77
- clang
88
- gcc
9+
cache:
10+
directories:
11+
- src/java/guava/
912
env:
1013
global:
11-
- FIELD=auto BIGNUM=auto SCALAR=auto ENDOMORPHISM=no STATICPRECOMPUTATION=yes ASM=no BUILD=check EXTRAFLAGS= HOST= ECDH=no schnorr=no RECOVERY=no
14+
- FIELD=auto BIGNUM=auto SCALAR=auto ENDOMORPHISM=no STATICPRECOMPUTATION=yes ASM=no BUILD=check EXTRAFLAGS= HOST= ECDH=no schnorr=no RECOVERY=no EXPERIMENTAL=no
15+
- GUAVA_URL=https://search.maven.org/remotecontent?filepath=com/google/guava/guava/18.0/guava-18.0.jar GUAVA_JAR=src/java/guava/guava-18.0.jar
1216
matrix:
1317
- SCALAR=32bit RECOVERY=yes
14-
- SCALAR=32bit FIELD=32bit ECDH=yes
18+
- SCALAR=32bit FIELD=32bit ECDH=yes EXPERIMENTAL=yes
1519
- SCALAR=64bit
1620
- FIELD=64bit RECOVERY=yes
1721
- FIELD=64bit ENDOMORPHISM=yes
18-
- FIELD=64bit ENDOMORPHISM=yes ECDH=yes
22+
- FIELD=64bit ENDOMORPHISM=yes ECDH=yes EXPERIMENTAL=yes
1923
- FIELD=64bit ASM=x86_64
2024
- FIELD=64bit ENDOMORPHISM=yes ASM=x86_64
21-
- FIELD=32bit SCHNORR=yes
25+
- FIELD=32bit SCHNORR=yes EXPERIMENTAL=yes
2226
- FIELD=32bit ENDOMORPHISM=yes
2327
- BIGNUM=no
24-
- BIGNUM=no ENDOMORPHISM=yes SCHNORR=yes RECOVERY=yes
28+
- BIGNUM=no ENDOMORPHISM=yes SCHNORR=yes RECOVERY=yes EXPERIMENTAL=yes
2529
- BIGNUM=no STATICPRECOMPUTATION=no
2630
- BUILD=distcheck
2731
- EXTRAFLAGS=CPPFLAGS=-DDETERMINISTIC
2832
- EXTRAFLAGS=CFLAGS=-O0
33+
- BUILD=check-java ECDH=yes SCHNORR=yes EXPERIMENTAL=yes
2934
matrix:
3035
fast_finish: true
3136
include:
@@ -55,9 +60,11 @@ matrix:
5560
packages:
5661
- gcc-multilib
5762
- libgmp-dev:i386
63+
before_install: mkdir -p `dirname $GUAVA_JAR`
64+
install: if [ ! -f $GUAVA_JAR ]; then wget $GUAVA_URL -O $GUAVA_JAR; fi
5865
before_script: ./autogen.sh
5966
script:
6067
- if [ -n "$HOST" ]; then export USE_HOST="--host=$HOST"; fi
6168
- if [ "x$HOST" = "xi686-linux-gnu" ]; then export CC="$CC -m32"; fi
62-
- ./configure --enable-endomorphism=$ENDOMORPHISM --with-field=$FIELD --with-bignum=$BIGNUM --with-scalar=$SCALAR --enable-ecmult-static-precomputation=$STATICPRECOMPUTATION --enable-module-ecdh=$ECDH --enable-module-schnorr=$SCHNORR --enable-module-recovery=$RECOVERY $EXTRAFLAGS $USE_HOST && make -j2 $BUILD
69+
- ./configure --enable-experimental=$EXPERIMENTAL --enable-endomorphism=$ENDOMORPHISM --with-field=$FIELD --with-bignum=$BIGNUM --with-scalar=$SCALAR --enable-ecmult-static-precomputation=$STATICPRECOMPUTATION --enable-module-ecdh=$ECDH --enable-module-schnorr=$SCHNORR --enable-module-recovery=$RECOVERY $EXTRAFLAGS $USE_HOST && make -j2 $BUILD
6370
os: linux

Makefile.am

+62-10
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
ACLOCAL_AMFLAGS = -I build-aux/m4
22

33
lib_LTLIBRARIES = libsecp256k1.la
4+
if USE_JNI
5+
JNI_LIB = libsecp256k1_jni.la
6+
noinst_LTLIBRARIES = $(JNI_LIB)
7+
else
8+
JNI_LIB =
9+
endif
410
include_HEADERS = include/secp256k1.h
511
noinst_HEADERS =
612
noinst_HEADERS += src/scalar.h
@@ -32,6 +38,7 @@ noinst_HEADERS += src/field_5x52_impl.h
3238
noinst_HEADERS += src/field_5x52_int128_impl.h
3339
noinst_HEADERS += src/field_5x52_asm_impl.h
3440
noinst_HEADERS += src/java/org_bitcoin_NativeSecp256k1.h
41+
noinst_HEADERS += src/java/org_bitcoin_Secp256k1Context.h
3542
noinst_HEADERS += src/util.h
3643
noinst_HEADERS += src/testrand.h
3744
noinst_HEADERS += src/testrand_impl.h
@@ -45,35 +52,80 @@ noinst_HEADERS += contrib/lax_der_parsing.c
4552
noinst_HEADERS += contrib/lax_der_privatekey_parsing.h
4653
noinst_HEADERS += contrib/lax_der_privatekey_parsing.c
4754

55+
if USE_EXTERNAL_ASM
56+
COMMON_LIB = libsecp256k1_common.la
57+
noinst_LTLIBRARIES = $(COMMON_LIB)
58+
else
59+
COMMON_LIB =
60+
endif
61+
4862
pkgconfigdir = $(libdir)/pkgconfig
4963
pkgconfig_DATA = libsecp256k1.pc
5064

65+
if USE_EXTERNAL_ASM
66+
if USE_ASM_ARM
67+
libsecp256k1_common_la_SOURCES = src/asm/field_10x26_arm.s
68+
endif
69+
endif
70+
5171
libsecp256k1_la_SOURCES = src/secp256k1.c
52-
libsecp256k1_la_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/src $(SECP_INCLUDES)
53-
libsecp256k1_la_LIBADD = $(SECP_LIBS)
72+
libsecp256k1_la_CPPFLAGS = -DSECP256K1_BUILD -I$(top_srcdir)/include -I$(top_srcdir)/src $(SECP_INCLUDES)
73+
libsecp256k1_la_LIBADD = $(JNI_LIB) $(SECP_LIBS) $(COMMON_LIB)
5474

75+
libsecp256k1_jni_la_SOURCES = src/java/org_bitcoin_NativeSecp256k1.c src/java/org_bitcoin_Secp256k1Context.c
76+
libsecp256k1_jni_la_CPPFLAGS = -DSECP256K1_BUILD $(JNI_INCLUDES)
5577

5678
noinst_PROGRAMS =
5779
if USE_BENCHMARK
5880
noinst_PROGRAMS += bench_verify bench_sign bench_internal
5981
bench_verify_SOURCES = src/bench_verify.c
60-
bench_verify_LDADD = libsecp256k1.la $(SECP_LIBS)
82+
bench_verify_LDADD = libsecp256k1.la $(SECP_LIBS) $(SECP_TEST_LIBS) $(COMMON_LIB)
6183
bench_sign_SOURCES = src/bench_sign.c
62-
bench_sign_LDADD = libsecp256k1.la $(SECP_LIBS)
84+
bench_sign_LDADD = libsecp256k1.la $(SECP_LIBS) $(SECP_TEST_LIBS) $(COMMON_LIB)
6385
bench_internal_SOURCES = src/bench_internal.c
64-
bench_internal_LDADD = $(SECP_LIBS)
65-
bench_internal_CPPFLAGS = $(SECP_INCLUDES)
86+
bench_internal_LDADD = $(SECP_LIBS) $(COMMON_LIB)
87+
bench_internal_CPPFLAGS = -DSECP256K1_BUILD $(SECP_INCLUDES)
6688
endif
6789

6890
if USE_TESTS
6991
noinst_PROGRAMS += tests
7092
tests_SOURCES = src/tests.c
71-
tests_CPPFLAGS = -DVERIFY -I$(top_srcdir)/src -I$(top_srcdir)/include $(SECP_INCLUDES) $(SECP_TEST_INCLUDES)
72-
tests_LDADD = $(SECP_LIBS) $(SECP_TEST_LIBS)
93+
tests_CPPFLAGS = -DSECP256K1_BUILD -DVERIFY -I$(top_srcdir)/src -I$(top_srcdir)/include $(SECP_INCLUDES) $(SECP_TEST_INCLUDES)
94+
tests_LDADD = $(SECP_LIBS) $(SECP_TEST_LIBS) $(COMMON_LIB)
7395
tests_LDFLAGS = -static
7496
TESTS = tests
7597
endif
7698

99+
JAVAROOT=src/java
100+
JAVAORG=org/bitcoin
101+
JAVA_GUAVA=$(srcdir)/$(JAVAROOT)/guava/guava-18.0.jar
102+
CLASSPATH_ENV=CLASSPATH=$(JAVA_GUAVA)
103+
JAVA_FILES= \
104+
$(JAVAROOT)/$(JAVAORG)/NativeSecp256k1.java \
105+
$(JAVAROOT)/$(JAVAORG)/NativeSecp256k1Test.java \
106+
$(JAVAROOT)/$(JAVAORG)/NativeSecp256k1Util.java \
107+
$(JAVAROOT)/$(JAVAORG)/Secp256k1Context.java
108+
109+
if USE_JNI
110+
111+
$(JAVA_GUAVA):
112+
@echo Guava is missing. Fetch it via: \
113+
wget https://search.maven.org/remotecontent?filepath=com/google/guava/guava/18.0/guava-18.0.jar -O $(@)
114+
@false
115+
116+
.stamp-java: $(JAVA_FILES)
117+
@echo Compiling $^
118+
$(AM_V_at)$(CLASSPATH_ENV) javac $^
119+
@touch $@
120+
121+
if USE_TESTS
122+
123+
check-java: libsecp256k1.la $(JAVA_GUAVA) .stamp-java
124+
$(AM_V_at)java -Djava.library.path="./:./src:./src/.libs:.libs/" -cp "$(JAVA_GUAVA):$(JAVAROOT)" $(JAVAORG)/NativeSecp256k1Test
125+
126+
endif
127+
endif
128+
77129
if USE_ECMULT_STATIC_PRECOMPUTATION
78130
CPPFLAGS_FOR_BUILD +=-I$(top_srcdir)
79131
CFLAGS_FOR_BUILD += -Wall -Wextra -Wno-unused-function
@@ -93,10 +145,10 @@ $(bench_internal_OBJECTS): src/ecmult_static_context.h
93145
src/ecmult_static_context.h: $(gen_context_BIN)
94146
./$(gen_context_BIN)
95147

96-
CLEANFILES = $(gen_context_BIN) src/ecmult_static_context.h
148+
CLEANFILES = $(gen_context_BIN) src/ecmult_static_context.h $(JAVAROOT)/$(JAVAORG)/*.class .stamp-java
97149
endif
98150

99-
EXTRA_DIST = autogen.sh src/gen_context.c src/basic-config.h
151+
EXTRA_DIST = autogen.sh src/gen_context.c src/basic-config.h $(JAVA_FILES)
100152

101153
if ENABLE_MODULE_ECDH
102154
include src/modules/ecdh/Makefile.am.include

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
libsecp256k1
22
============
33

4-
[![Build Status](https://travis-ci.org/bitcoin/secp256k1.svg?branch=master)](https://travis-ci.org/bitcoin/secp256k1)
4+
[![Build Status](https://travis-ci.org/bitcoin-core/secp256k1.svg?branch=master)](https://travis-ci.org/bitcoin-core/secp256k1)
55

66
Optimized C library for EC operations on curve secp256k1.
77

build-aux/m4/ax_jni_include_dir.m4

+140
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
# ===========================================================================
2+
# http://www.gnu.org/software/autoconf-archive/ax_jni_include_dir.html
3+
# ===========================================================================
4+
#
5+
# SYNOPSIS
6+
#
7+
# AX_JNI_INCLUDE_DIR
8+
#
9+
# DESCRIPTION
10+
#
11+
# AX_JNI_INCLUDE_DIR finds include directories needed for compiling
12+
# programs using the JNI interface.
13+
#
14+
# JNI include directories are usually in the Java distribution. This is
15+
# deduced from the value of $JAVA_HOME, $JAVAC, or the path to "javac", in
16+
# that order. When this macro completes, a list of directories is left in
17+
# the variable JNI_INCLUDE_DIRS.
18+
#
19+
# Example usage follows:
20+
#
21+
# AX_JNI_INCLUDE_DIR
22+
#
23+
# for JNI_INCLUDE_DIR in $JNI_INCLUDE_DIRS
24+
# do
25+
# CPPFLAGS="$CPPFLAGS -I$JNI_INCLUDE_DIR"
26+
# done
27+
#
28+
# If you want to force a specific compiler:
29+
#
30+
# - at the configure.in level, set JAVAC=yourcompiler before calling
31+
# AX_JNI_INCLUDE_DIR
32+
#
33+
# - at the configure level, setenv JAVAC
34+
#
35+
# Note: This macro can work with the autoconf M4 macros for Java programs.
36+
# This particular macro is not part of the original set of macros.
37+
#
38+
# LICENSE
39+
#
40+
# Copyright (c) 2008 Don Anderson <[email protected]>
41+
#
42+
# Copying and distribution of this file, with or without modification, are
43+
# permitted in any medium without royalty provided the copyright notice
44+
# and this notice are preserved. This file is offered as-is, without any
45+
# warranty.
46+
47+
#serial 10
48+
49+
AU_ALIAS([AC_JNI_INCLUDE_DIR], [AX_JNI_INCLUDE_DIR])
50+
AC_DEFUN([AX_JNI_INCLUDE_DIR],[
51+
52+
JNI_INCLUDE_DIRS=""
53+
54+
if test "x$JAVA_HOME" != x; then
55+
_JTOPDIR="$JAVA_HOME"
56+
else
57+
if test "x$JAVAC" = x; then
58+
JAVAC=javac
59+
fi
60+
AC_PATH_PROG([_ACJNI_JAVAC], [$JAVAC], [no])
61+
if test "x$_ACJNI_JAVAC" = xno; then
62+
AC_MSG_WARN([cannot find JDK; try setting \$JAVAC or \$JAVA_HOME])
63+
fi
64+
_ACJNI_FOLLOW_SYMLINKS("$_ACJNI_JAVAC")
65+
_JTOPDIR=`echo "$_ACJNI_FOLLOWED" | sed -e 's://*:/:g' -e 's:/[[^/]]*$::'`
66+
fi
67+
68+
case "$host_os" in
69+
darwin*) _JTOPDIR=`echo "$_JTOPDIR" | sed -e 's:/[[^/]]*$::'`
70+
_JINC="$_JTOPDIR/Headers";;
71+
*) _JINC="$_JTOPDIR/include";;
72+
esac
73+
_AS_ECHO_LOG([_JTOPDIR=$_JTOPDIR])
74+
_AS_ECHO_LOG([_JINC=$_JINC])
75+
76+
# On Mac OS X 10.6.4, jni.h is a symlink:
77+
# /System/Library/Frameworks/JavaVM.framework/Versions/Current/Headers/jni.h
78+
# -> ../../CurrentJDK/Headers/jni.h.
79+
80+
AC_CACHE_CHECK(jni headers, ac_cv_jni_header_path,
81+
[
82+
if test -f "$_JINC/jni.h"; then
83+
ac_cv_jni_header_path="$_JINC"
84+
JNI_INCLUDE_DIRS="$JNI_INCLUDE_DIRS $ac_cv_jni_header_path"
85+
else
86+
_JTOPDIR=`echo "$_JTOPDIR" | sed -e 's:/[[^/]]*$::'`
87+
if test -f "$_JTOPDIR/include/jni.h"; then
88+
ac_cv_jni_header_path="$_JTOPDIR/include"
89+
JNI_INCLUDE_DIRS="$JNI_INCLUDE_DIRS $ac_cv_jni_header_path"
90+
else
91+
ac_cv_jni_header_path=none
92+
fi
93+
fi
94+
])
95+
96+
97+
98+
# get the likely subdirectories for system specific java includes
99+
case "$host_os" in
100+
bsdi*) _JNI_INC_SUBDIRS="bsdos";;
101+
darwin*) _JNI_INC_SUBDIRS="darwin";;
102+
freebsd*) _JNI_INC_SUBDIRS="freebsd";;
103+
linux*) _JNI_INC_SUBDIRS="linux genunix";;
104+
osf*) _JNI_INC_SUBDIRS="alpha";;
105+
solaris*) _JNI_INC_SUBDIRS="solaris";;
106+
mingw*) _JNI_INC_SUBDIRS="win32";;
107+
cygwin*) _JNI_INC_SUBDIRS="win32";;
108+
*) _JNI_INC_SUBDIRS="genunix";;
109+
esac
110+
111+
if test "x$ac_cv_jni_header_path" != "xnone"; then
112+
# add any subdirectories that are present
113+
for JINCSUBDIR in $_JNI_INC_SUBDIRS
114+
do
115+
if test -d "$_JTOPDIR/include/$JINCSUBDIR"; then
116+
JNI_INCLUDE_DIRS="$JNI_INCLUDE_DIRS $_JTOPDIR/include/$JINCSUBDIR"
117+
fi
118+
done
119+
fi
120+
])
121+
122+
# _ACJNI_FOLLOW_SYMLINKS <path>
123+
# Follows symbolic links on <path>,
124+
# finally setting variable _ACJNI_FOLLOWED
125+
# ----------------------------------------
126+
AC_DEFUN([_ACJNI_FOLLOW_SYMLINKS],[
127+
# find the include directory relative to the javac executable
128+
_cur="$1"
129+
while ls -ld "$_cur" 2>/dev/null | grep " -> " >/dev/null; do
130+
AC_MSG_CHECKING([symlink for $_cur])
131+
_slink=`ls -ld "$_cur" | sed 's/.* -> //'`
132+
case "$_slink" in
133+
/*) _cur="$_slink";;
134+
# 'X' avoids triggering unwanted echo options.
135+
*) _cur=`echo "X$_cur" | sed -e 's/^X//' -e 's:[[^/]]*$::'`"$_slink";;
136+
esac
137+
AC_MSG_RESULT([$_cur])
138+
done
139+
_ACJNI_FOLLOWED="$_cur"
140+
])# _ACJNI

build-aux/m4/bitcoin_secp.m4

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ AC_DEFUN([SECP_INT128_CHECK],[
33
has_int128=$ac_cv_type___int128
44
])
55

6-
dnl
6+
dnl escape "$0x" below using the m4 quadrigaph @S|@, and escape it again with a \ for the shell.
77
AC_DEFUN([SECP_64BIT_ASM_CHECK],[
88
AC_MSG_CHECKING(for x86_64 assembly availability)
99
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1010
#include <stdint.h>]],[[
1111
uint64_t a = 11, tmp;
12-
__asm__ __volatile__("movq $0x100000000,%1; mulq %%rsi" : "+a"(a) : "S"(tmp) : "cc", "%rdx");
12+
__asm__ __volatile__("movq \@S|@0x100000000,%1; mulq %%rsi" : "+a"(a) : "S"(tmp) : "cc", "%rdx");
1313
]])],[has_64bit_asm=yes],[has_64bit_asm=no])
1414
AC_MSG_RESULT([$has_64bit_asm])
1515
])

0 commit comments

Comments
 (0)