Merge remote-tracking branch 'origin/danger' into dev
Conflicts: util/build.sh
This commit is contained in:
@@ -10,15 +10,15 @@ linux_debug_CXXFLAGS=$(linux_debug_CFLAGS)
|
||||
linux_debug_CPPFLAGS=-D_GLIBCXX_DEBUG -D_GLIBCXX_DEBUG_PEDANTIC
|
||||
|
||||
ifeq (86,$(findstring 86,$(build_arch)))
|
||||
i686_linux_CC=gcc -m32
|
||||
i686_linux_CXX=g++ -m32
|
||||
i686_linux_CC=$(CC) -m32
|
||||
i686_linux_CXX=$(CXX) -m32
|
||||
i686_linux_AR=ar
|
||||
i686_linux_RANLIB=ranlib
|
||||
i686_linux_NM=nm
|
||||
i686_linux_STRIP=strip
|
||||
|
||||
x86_64_linux_CC=gcc -m64
|
||||
x86_64_linux_CXX=g++ -m64
|
||||
x86_64_linux_CC=$(CC) -m64
|
||||
x86_64_linux_CXX=$(CXX) -m64
|
||||
x86_64_linux_AR=ar
|
||||
x86_64_linux_RANLIB=ranlib
|
||||
x86_64_linux_NM=nm
|
||||
|
||||
@@ -14,7 +14,8 @@ ifneq ($(build_os),darwin)
|
||||
$(package)_config_opts_darwin=--disable-atomicsupport
|
||||
endif
|
||||
$(package)_config_opts_aarch64=--disable-atomicsupport
|
||||
$(package)_cxxflags+=-std=c++11
|
||||
$(package)_cxxflags+=-std=c++11 -fPIE
|
||||
$(package)_cflags+=-std=gnu17 -fPIE
|
||||
endef
|
||||
|
||||
define $(package)_preprocess_cmds
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package=libgmp
|
||||
|
||||
|
||||
ifeq ($(host_os),mingw32)
|
||||
$(package)_download_path=https://github.com/radix42/$(package)/archive
|
||||
$(package)_file_name=$(package)-$($(package)_git_commit).tar.gz
|
||||
@@ -16,6 +17,7 @@ $(package)_file_name=d613c855-cd92-4efb-b893-658496852019
|
||||
$(package)_download_file=d613c855-cd92-4efb-b893-658496852019
|
||||
$(package)_sha256_hash=a8109865f2893f1373b0a8ed5ff7429de8db696fc451b1036bd7bdf95bbeffd6
|
||||
$(package)_config_opts=--enable-cxx --disable-shared
|
||||
$(package)_patches=gcc-15.patch
|
||||
endif
|
||||
|
||||
#else
|
||||
@@ -27,6 +29,10 @@ endif
|
||||
#$(package)_config_opts=--enable-cxx --disable-shared
|
||||
#endif
|
||||
|
||||
define $(package)_preprocess_cmds
|
||||
patch -p1 < $($(package)_patch_dir)/gcc-15.patch
|
||||
endef
|
||||
|
||||
define $(package)_config_cmds
|
||||
$($(package)_autoconf) --host=$(host) --build=$(build)
|
||||
endef
|
||||
|
||||
@@ -6,6 +6,8 @@ $(package)_download_file=0d9f589e-a9f9-4ddb-acaa-0f1b423b32eb
|
||||
$(package)_sha256_hash=6f504490b342a4f8a4c4a02fc9b866cbef8622d5df4e5452b46be121e46636c1
|
||||
$(package)_dependencies=
|
||||
$(package)_config_opts=
|
||||
$(package)_cflags=-std=gnu17
|
||||
|
||||
ifeq ($(build_os),darwin)
|
||||
define $(package)_set_vars
|
||||
$(package)_build_env=MACOSX_DEPLOYMENT_TARGET="10.11"
|
||||
|
||||
@@ -39,8 +39,8 @@ native_packages := native_ccache
|
||||
wallet_packages=bdb
|
||||
|
||||
ifeq ($(host_os),linux)
|
||||
packages := boost wolfssl libevent $(zcash_packages) googletest libcurl #googlemock
|
||||
packages := boost wolfssl libevent $(zcash_packages) libcurl #googlemock googletest
|
||||
else
|
||||
packages := boost wolfssl libevent $(zcash_packages) libcurl googletest #googlemock
|
||||
packages := boost wolfssl libevent $(zcash_packages) libcurl #googlemock googletest
|
||||
endif
|
||||
|
||||
|
||||
@@ -20,6 +20,7 @@ $(package)_download_path=https://github.com/wolfSSL/wolfssl/archive
|
||||
$(package)_download_file=v$($(package)_version)-stable.tar.gz
|
||||
|
||||
define $(package)_set_vars
|
||||
$(package)_cflags+=-std=gnu17
|
||||
$(package)_config_env=AR="$($(package)_ar)" RANLIB="$($(package)_ranlib)" CC="$($(package)_cc)"
|
||||
$(package)_config_opts=--prefix=$(host_prefix)
|
||||
$(package)_config_opts+=--host=$(host)
|
||||
@@ -64,7 +65,7 @@ endef
|
||||
#endef
|
||||
|
||||
define $(package)_build_cmds
|
||||
$(MAKE) CPPFLAGS='-fPIC' -j1 src/libwolfssl.la
|
||||
$(MAKE) CPPFLAGS='-fPIC' -j$(nproc) src/libwolfssl.la
|
||||
endef
|
||||
|
||||
define $(package)_stage_cmds
|
||||
|
||||
105
depends/patches/libgmp/gcc-15.patch
Normal file
105
depends/patches/libgmp/gcc-15.patch
Normal file
@@ -0,0 +1,105 @@
|
||||
diff --git a/acinclude.m4 b/acinclude.m4
|
||||
index bcc6f52..53705e1 100644
|
||||
--- a/acinclude.m4
|
||||
+++ b/acinclude.m4
|
||||
@@ -602,24 +602,6 @@ int f ()
|
||||
}
|
||||
])
|
||||
|
||||
-GMP_PROG_CC_WORKS_PART([$1], [long long reliability test 1],
|
||||
-[/* The following provokes a segfault in the compiler on powerpc-apple-darwin.
|
||||
- Extracted from tests/mpn/t-iord_u.c. Causes Apple's gcc 3.3 build 1640 and
|
||||
- 1666 to segfault with e.g., -O2 -mpowerpc64. */
|
||||
-
|
||||
-#if defined (__GNUC__) && ! defined (__cplusplus)
|
||||
-typedef unsigned long long t1;typedef t1*t2;
|
||||
-void g(){}
|
||||
-void h(){}
|
||||
-static __inline__ t1 e(t2 rp,t2 up,int n,t1 v0)
|
||||
-{t1 c,x,r;int i;if(v0){c=1;for(i=1;i<n;i++){x=up[i];r=x+1;rp[i]=r;}}return c;}
|
||||
-void f(){static const struct{t1 n;t1 src[9];t1 want[9];}d[]={{1,{0},{1}},};t1 got[9];int i;
|
||||
-for(i=0;i<1;i++){if(e(got,got,9,d[i].n)==0)h();g(i,d[i].src,d[i].n,got,d[i].want,9);if(d[i].n)h();}}
|
||||
-#else
|
||||
-int dummy;
|
||||
-#endif
|
||||
-])
|
||||
-
|
||||
GMP_PROG_CC_WORKS_PART([$1], [long long reliability test 2],
|
||||
[/* The following provokes an internal compiler error on powerpc-apple-darwin.
|
||||
Extracted from mpz/cfdiv_q_2exp.c. Causes Apple's gcc 3.3 build 1640 and
|
||||
diff --git a/configure b/configure
|
||||
index b9abc1b..04ba451 100755
|
||||
--- a/configure
|
||||
+++ b/configure
|
||||
@@ -6382,71 +6382,6 @@ fi
|
||||
|
||||
|
||||
|
||||
-if test "$gmp_prog_cc_works" = yes; then
|
||||
- # remove anything that might look like compiler output to our "||" expression
|
||||
- rm -f conftest* a.out b.out a.exe a_out.exe
|
||||
- cat >conftest.c <<EOF
|
||||
-/* The following provokes a segfault in the compiler on powerpc-apple-darwin.
|
||||
- Extracted from tests/mpn/t-iord_u.c. Causes Apple's gcc 3.3 build 1640 and
|
||||
- 1666 to segfault with e.g., -O2 -mpowerpc64. */
|
||||
-
|
||||
-#if defined (__GNUC__) && ! defined (__cplusplus)
|
||||
-typedef unsigned long long t1;typedef t1*t2;
|
||||
-void g(){}
|
||||
-void h(){}
|
||||
-static __inline__ t1 e(t2 rp,t2 up,int n,t1 v0)
|
||||
-{t1 c,x,r;int i;if(v0){c=1;for(i=1;i<n;i++){x=up[i];r=x+1;rp[i]=r;}}return c;}
|
||||
-void f(){static const struct{t1 n;t1 src[9];t1 want[9];}d[]={{1,{0},{1}},};t1 got[9];int i;
|
||||
-for(i=0;i<1;i++){if(e(got,got,9,d[i].n)==0)h();g(i,d[i].src,d[i].n,got,d[i].want,9);if(d[i].n)h();}}
|
||||
-#else
|
||||
-int dummy;
|
||||
-#endif
|
||||
-
|
||||
-int main () { return 0; }
|
||||
-EOF
|
||||
- echo "Test compile: long long reliability test 1" >&5
|
||||
- gmp_compile="$cc $cflags $cppflags conftest.c >&5"
|
||||
- if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$gmp_compile\""; } >&5
|
||||
- (eval $gmp_compile) 2>&5
|
||||
- ac_status=$?
|
||||
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
|
||||
- test $ac_status = 0; }; then
|
||||
- cc_works_part=yes
|
||||
- if test "$cross_compiling" = no; then
|
||||
- if { ac_try='./a.out || ./b.out || ./a.exe || ./a_out.exe || ./conftest'
|
||||
- { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
|
||||
- (eval $ac_try) 2>&5
|
||||
- ac_status=$?
|
||||
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
|
||||
- test $ac_status = 0; }; }; then :;
|
||||
- else
|
||||
- cc_works_part=norun
|
||||
- fi
|
||||
- fi
|
||||
- else
|
||||
- cc_works_part=no
|
||||
- fi
|
||||
- if test "$cc_works_part" != yes; then
|
||||
- echo "failed program was:" >&5
|
||||
- cat conftest.c >&5
|
||||
- fi
|
||||
- rm -f conftest* a.out b.out a.exe a_out.exe
|
||||
- case $cc_works_part in
|
||||
- yes)
|
||||
-
|
||||
- ;;
|
||||
- no)
|
||||
- gmp_prog_cc_works="no, long long reliability test 1"
|
||||
- ;;
|
||||
- norun)
|
||||
- gmp_prog_cc_works="no, long long reliability test 1, program does not run"
|
||||
- ;;
|
||||
- esac
|
||||
-fi
|
||||
-
|
||||
-
|
||||
-
|
||||
-
|
||||
if test "$gmp_prog_cc_works" = yes; then
|
||||
# remove anything that might look like compiler output to our "||" expression
|
||||
rm -f conftest* a.out b.out a.exe a_out.exe
|
||||
@@ -5,7 +5,7 @@
|
||||
DIST_SUBDIRS = secp256k1 univalue
|
||||
|
||||
AM_LDFLAGS = $(PTHREAD_CFLAGS) $(LIBTOOL_LDFLAGS) $(SAN_LDFLAGS) $(HARDENED_LDFLAGS)
|
||||
AM_CXXFLAGS = $(SAN_CXXFLAGS) $(HARDENED_CXXFLAGS) $(ERROR_CXXFLAGS)
|
||||
AM_CXXFLAGS = $(SAN_CXXFLAGS) $(HARDENED_CXXFLAGS) $(ERROR_CXXFLAGS) -std=c++17
|
||||
AM_CPPFLAGS = $(HARDENED_CPPFLAGS)
|
||||
EXTRA_LIBRARIES =
|
||||
|
||||
@@ -594,7 +594,7 @@ libzcash_a_CPPFLAGS = -DMULTICORE -fopenmp -fPIC -DBOOST_SPIRIT_THREADSAFE -DHAV
|
||||
#libzcash_a_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)
|
||||
#libzcash_a_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) -DMONTGOMERY_OUTPUT
|
||||
|
||||
libzcash_a_CXXFLAGS = $(SAN_CXXFLAGS) $(HARDENED_CXXFLAGS) -fwrapv -fno-strict-aliasing
|
||||
libzcash_a_CXXFLAGS = $(SAN_CXXFLAGS) $(HARDENED_CXXFLAGS) -fwrapv -fno-strict-aliasing -std=gnu17
|
||||
libzcash_a_LDFLAGS = $(SAN_LDFLAGS) $(HARDENED_LDFLAGS)
|
||||
libzcash_a_CPPFLAGS += -DMONTGOMERY_OUTPUT
|
||||
|
||||
@@ -636,7 +636,7 @@ libhush_a_SOURCES = \
|
||||
|
||||
libhush_a_CPPFLAGS = -DMULTICORE -fopenmp -fPIC -DBINARY_OUTPUT -DCURVE_ALT_BN128 -DBOOST_SPIRIT_THREADSAFE -DHAVE_BUILD_INFO -D__STDC_FORMAT_MACROS $(HARDENED_CPPFLAGS) -pipe -O1 -g -Wstack-protector -fstack-protector-all -fPIE -fvisibility=hidden -DSTATIC $(BITCOIN_INCLUDES)
|
||||
|
||||
libhush_a_CXXFLAGS = $(HARDENED_CXXFLAGS) -fwrapv -fno-strict-aliasing
|
||||
libhush_a_CXXFLAGS = $(HARDENED_CXXFLAGS) -fwrapv -fno-strict-aliasing -std=gnu17
|
||||
|
||||
libhush_a_LDFLAGS = $(HARDENED_LDFLAGS)
|
||||
|
||||
|
||||
@@ -301,7 +301,7 @@ WOLFSSL_CTX* TLSManager::initCtx(TLSContextType ctxType)
|
||||
bool bInitialized = false;
|
||||
WOLFSSL_CTX* tlsCtx = NULL;
|
||||
|
||||
byte *pem;
|
||||
unsigned char *pem;
|
||||
int plen = 0;
|
||||
|
||||
if ((tlsCtx = wolfSSL_CTX_new(ctxType == SERVER_CONTEXT ? wolfTLSv1_3_server_method() : wolfTLSv1_3_client_method()))) {
|
||||
|
||||
@@ -51,7 +51,9 @@
|
||||
#undef TFM_TIMING_RESISTANT
|
||||
#define ECC_TIMING_RESISTANT 420
|
||||
#define TFM_TIMING_RESISTANT 420
|
||||
#define byte unsigned char
|
||||
#include <wolfssl/ssl.h>
|
||||
#undef byte
|
||||
|
||||
class CAddrMan;
|
||||
class CBlockIndex;
|
||||
|
||||
@@ -131,14 +131,13 @@ HOST="$HOST" BUILD="$BUILD" "$MAKE" "$@" -C ./depends/ V=1
|
||||
|
||||
time ./autogen.sh
|
||||
|
||||
# Default to gcc and g++ if not specified and use those compilers in config
|
||||
CC="${CC:-gcc}" CXX="${CXX:-g++}" CONFIG_SITE="$PWD/depends/$HOST/share/config.site" ./configure "$HARDENING_ARG" "$LCOV_ARG" "$TEST_ARG" "$MINING_ARG" $CONFIGURE_FLAGS "CC=$CC" "CXX=$CXX" CXXFLAGS='-g'
|
||||
CONFIG_SITE="$PWD/depends/$HOST/share/config.site" ./configure "$HARDENING_ARG" "$LCOV_ARG" "$TEST_ARG" "$MINING_ARG" $CONFIGURE_FLAGS CXXFLAGS='-g' CFLAGS='-std=gnu17'
|
||||
|
||||
# Build CryptoConditions stuff
|
||||
WD=$PWD
|
||||
cd src/cc
|
||||
echo $PWD
|
||||
CC=${CC:-gcc} ./makecustom
|
||||
CFLAGS=-std=gnu17 CC=${CC:-gcc} ./makecustom
|
||||
cd $WD
|
||||
|
||||
# Build RandomX
|
||||
|
||||
Reference in New Issue
Block a user