Skip to content

Commit

Permalink
Merge branch 'bitcoin' into particl_dev
Browse files Browse the repository at this point in the history
  • Loading branch information
tecnovert committed Apr 22, 2024
2 parents 24b0ed6 + 3310a96 commit 68e2d24
Show file tree
Hide file tree
Showing 30 changed files with 446 additions and 361 deletions.
7 changes: 5 additions & 2 deletions build-aux/m4/l_atomic.m4
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ dnl warranty.
# Clang, when building for 32-bit,
# and linking against libstdc++, requires linking with
# -latomic if using the C++ atomic library.
# Can be tested with: clang++ test.cpp -m32
# Can be tested with: clang++ -std=c++20 test.cpp -m32
#
# Sourced from http://bugs.debian.org/797228

Expand All @@ -27,8 +27,11 @@ m4_define([_CHECK_ATOMIC_testbody], [[
auto t1 = t.load();
t.compare_exchange_strong(t1, 3s);
std::atomic<int64_t> a{};
std::atomic<double> d{};
d.store(3.14);
auto d1 = d.load();
std::atomic<int64_t> a{};
int64_t v = 5;
int64_t r = a.fetch_add(v);
return static_cast<int>(r);
Expand Down
5 changes: 2 additions & 3 deletions contrib/guix/libexec/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,8 @@ export OBJC_INCLUDE_PATH="${NATIVE_GCC}/include"
export OBJCPLUS_INCLUDE_PATH="${NATIVE_GCC}/include/c++:${NATIVE_GCC}/include"

case "$HOST" in
*darwin*)
export LIBRARY_PATH="${NATIVE_GCC}/lib"
;;
*darwin*) export LIBRARY_PATH="${NATIVE_GCC}/lib" ;;
*mingw*) export LIBRARY_PATH="${NATIVE_GCC}/lib" ;;
*)
NATIVE_GCC_STATIC="$(store_path gcc-toolchain static)"
export LIBRARY_PATH="${NATIVE_GCC}/lib:${NATIVE_GCC_STATIC}/lib"
Expand Down
10 changes: 6 additions & 4 deletions contrib/guix/manifest.scm
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,15 @@ desirable for building Bitcoin Core release binaries."

(define (gcc-mingw-patches gcc)
(package-with-extra-patches gcc
(search-our-patches "gcc-remap-guix-store.patch"
"vmov-alignment.patch")))
(search-our-patches "gcc-remap-guix-store.patch")))

(define (binutils-mingw-patches binutils)
(package-with-extra-patches binutils
(search-our-patches "binutils-unaligned-default.patch")))

(define (make-mingw-pthreads-cross-toolchain target)
"Create a cross-compilation toolchain package for TARGET"
(let* ((xbinutils (cross-binutils target))
(let* ((xbinutils (binutils-mingw-patches (cross-binutils target)))
(pthreads-xlibc (cond ((string-contains target "x86_64") mingw-w64-x86_64-winpthreads) (else mingw-w64-i686-winpthreads)))
(pthreads-xgcc (cross-gcc target
#:xgcc (gcc-mingw-patches mingw-w64-base-gcc)
Expand Down Expand Up @@ -519,7 +522,6 @@ inspecting signatures in Mach-O binaries.")
(cond ((string-suffix? "x86_64-w64-mingw32" target)
(list ;; Native GCC 12 toolchain
gcc-toolchain-12
(list gcc-toolchain-12 "static")
zip
(make-mingw-pthreads-cross-toolchain "x86_64-w64-mingw32")
nsis-x86_64
Expand Down
22 changes: 22 additions & 0 deletions contrib/guix/patches/binutils-unaligned-default.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
commit 6537181f59ed186a341db621812a6bc35e22eaf6
Author: fanquake <[email protected]>
Date: Wed Apr 10 12:15:52 2024 +0200

build: turn on -muse-unaligned-vector-move by default

This allows us to avoid (more invasively) patching GCC, to avoid
unaligned instruction use.

diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c
index e0632681477..14a9653abdf 100644
--- a/gas/config/tc-i386.c
+++ b/gas/config/tc-i386.c
@@ -801,7 +801,7 @@ static unsigned int no_cond_jump_promotion = 0;
static unsigned int sse2avx;

/* Encode aligned vector move as unaligned vector move. */
-static unsigned int use_unaligned_vector_move;
+static unsigned int use_unaligned_vector_move = 1;

/* Encode scalar AVX instructions with specific vector length. */
static enum
288 changes: 0 additions & 288 deletions contrib/guix/patches/vmov-alignment.patch

This file was deleted.

3 changes: 3 additions & 0 deletions contrib/init/bitcoind.service
Original file line number Diff line number Diff line change
Expand Up @@ -81,5 +81,8 @@ PrivateDevices=true
# Deny the creation of writable and executable memory mappings.
MemoryDenyWriteExecute=true

# Restrict ABIs to help ensure MemoryDenyWriteExecute is enforced
SystemCallArchitectures=native

[Install]
WantedBy=multi-user.target
2 changes: 1 addition & 1 deletion depends/packages.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ From the [Gentoo Wiki entry](https://wiki.gentoo.org/wiki/Project:Quality_Assura
> creates. This leads to massive overlinking, which is toxic to the Gentoo
> ecosystem, as it leads to a massive number of unnecessary rebuilds.
Where possible, packages are built with Position Independant Code. Either using
Where possible, packages are built with Position Independent Code. Either using
the Autotools `--with-pic` flag, or `CMAKE_POSITION_INDEPENDENT_CODE` with CMake.

## Secondary dependencies:
Expand Down
Loading

0 comments on commit 68e2d24

Please sign in to comment.