Skip to content

Commit

Permalink
parent 10f629e
Browse files Browse the repository at this point in the history
author MarcoFalke <falke.marco@gmail.com> 1649237525 +0200
committer russeree <reese.russell@ymail.com> 1650013843 -0700

parent 10f629e
author MarcoFalke <falke.marco@gmail.com> 1649237525 +0200
committer russeree <reese.russell@ymail.com> 1650013815 -0700

parent 10f629e
author MarcoFalke <falke.marco@gmail.com> 1649237525 +0200
committer russeree <reese.russell@ymail.com> 1650013794 -0700

ci: Build all optional tools in tidy task

lint: remove boost::bind linter

I don't think we need to maintain a linter for reintroducing boost::bind
at this point.

doc: Convert remaining comments to clang-tidy format

[docs] package feerate

[packages/policy] use package feerate in package validation

This allows CPFP within a package prior to submission to mempool.

[validation] try individual validation before package validation

This avoids "parents pay for children" and "siblings pay for siblings"
behavior, since package feerate is calculated with totals and is
topology-unaware.

It also ensures that package validation never causes us to reject a
transaction that we would have otherwise accepted in single-tx
validation.

[unit test] package feerate and package cpfp

[validation] don't package validate if not policy or missing inputs

Package validation policy only differs from individual policy in its
evaluation of feerate. Minimize DoS surface; don't validate all over
again if we know the result will be the same.

lint: remove qt SIGNAL/SLOT lint

I think we are past the point where we need to lint for this, the CPU
can probably be better utilized.

refactor: Remove deduplication of data in rollingbloom bench

lint: codespell 2.1.0

lint: flake8 4.0.1

lint: mypy 0.942

refactor: fixup named args in txpackage tests

Regression in bitcoin#24152.

Put lock logging behind DEBUG_LOCKCONTENTION preprocessor directive

Add DEBUG_LOCKCONTENTION documentation to the developer notes

Squash

Squashed All Previous Commits

RPC: Switch getblockfrompeer back to standard param name blockhash

This commit partially reverts 923312f.

Update RPC argument and field naming guideline in developer notes

Co-authored-by: laanwj <126646+laanwj@users.noreply.github.com>

build: fix MSVC build after subtree update

Co-authored-by: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com>
Co-authored-by: Aaron Clauson <aaron@sipsorcery.com>

build: remove --enable-experimental from libsecp256k1 configure

build: remove some no-longer-needed var unexporting from configure

key: use secp256k1_schnorrsig_sign32 over deprecated secp256k1_schnorrsig_sign

The renaming occured in
bitcoin-core/secp256k1#1089.

Squased lint changes - added features

Squashed to reduce spam - added features

Loading ASN directory from a .tsv file.

Added the use of a GZIP compressed ip -> ASN file.

LINT Fixes - 7 words

Fixed comparison to none using 'is' instead of '=='

Fixed unintended changes to readme.md

whitespace correction

restored generate-seeds.py

restored makeseeds.py

Fixed a missing return type within exception

Removed unused variable and if __main__

Updated to fetch and included legacy failover

LINT fixes

LINT fixes

Squash - Too many commits

Python include dns.resolver

Failover implementation complete

Removed DNS resolver

Revert changes

refactor: Remove deduplication of data in rollingbloom bench

lint: mypy 0.942

refactor: fixup named args in txpackage tests

Regression in bitcoin#24152.

Put lock logging behind DEBUG_LOCKCONTENTION preprocessor directive

Add DEBUG_LOCKCONTENTION documentation to the developer notes

Squash

Squashed All Previous Commits

RPC: Switch getblockfrompeer back to standard param name blockhash

This commit partially reverts 923312f.

Update RPC argument and field naming guideline in developer notes

Co-authored-by: laanwj <126646+laanwj@users.noreply.github.com>

build: fix MSVC build after subtree update

Co-authored-by: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com>
Co-authored-by: Aaron Clauson <aaron@sipsorcery.com>

build: remove --enable-experimental from libsecp256k1 configure

build: remove some no-longer-needed var unexporting from configure

key: use secp256k1_schnorrsig_sign32 over deprecated secp256k1_schnorrsig_sign

The renaming occured in
bitcoin-core/secp256k1#1089.

Squased lint changes - added features

Squashed to reduce spam - added features

Loading ASN directory from a .tsv file.

Added the use of a GZIP compressed ip -> ASN file.

LINT Fixes - 7 words

Fixed comparison to none using 'is' instead of '=='

Fixed unintended changes to readme.md

whitespace correction

restored generate-seeds.py

restored makeseeds.py

Fixed a missing return type within exception

Removed unused variable and if __main__

Updated to fetch and included legacy failover

LINT fixes

LINT fixes

Squash - Too many commits

Python include dns.resolver

Failover implementation complete

Removed DNS resolver

Revert changes

Put lock logging behind DEBUG_LOCKCONTENTION preprocessor directive

Add DEBUG_LOCKCONTENTION documentation to the developer notes

Squash

Squashed All Previous Commits

RPC: Switch getblockfrompeer back to standard param name blockhash

This commit partially reverts 923312f.

Update RPC argument and field naming guideline in developer notes

Co-authored-by: laanwj <126646+laanwj@users.noreply.github.com>

build: fix MSVC build after subtree update

Co-authored-by: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com>
Co-authored-by: Aaron Clauson <aaron@sipsorcery.com>

build: remove --enable-experimental from libsecp256k1 configure

build: remove some no-longer-needed var unexporting from configure

key: use secp256k1_schnorrsig_sign32 over deprecated secp256k1_schnorrsig_sign

The renaming occured in
bitcoin-core/secp256k1#1089.

Squased lint changes - added features

Squashed to reduce spam - added features

Loading ASN directory from a .tsv file.

Added the use of a GZIP compressed ip -> ASN file.

LINT Fixes - 7 words

Fixed comparison to none using 'is' instead of '=='

Fixed unintended changes to readme.md

whitespace correction

restored generate-seeds.py

restored makeseeds.py

Fixed a missing return type within exception

Removed unused variable and if __main__

Updated to fetch and included legacy failover

LINT fixes

LINT fixes

Squash - Too many commits

Python include dns.resolver

Failover implementation complete

Removed DNS resolver

Revert changes

RPC: Switch getblockfrompeer back to standard param name blockhash

This commit partially reverts 923312f.

Update RPC argument and field naming guideline in developer notes

Co-authored-by: laanwj <126646+laanwj@users.noreply.github.com>

build: fix MSVC build after subtree update

Co-authored-by: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com>
Co-authored-by: Aaron Clauson <aaron@sipsorcery.com>

build: remove --enable-experimental from libsecp256k1 configure

build: remove some no-longer-needed var unexporting from configure

key: use secp256k1_schnorrsig_sign32 over deprecated secp256k1_schnorrsig_sign

The renaming occured in
bitcoin-core/secp256k1#1089.

test: compare `/chaininfo` response with `getblockchaininfo` RPC

test: use MiniWallet for feature_fee_estimation.py

This test can now be run even with the Bitcoin Core wallet disabled.

Converted lint-python-mutable-default-parameters.sh to python

Change permission

Change argument so that it's compatiable with python 3.6

Change comment to docstring

Remove .split, .append, .extend calls. Remove 'output' variable assignment

build: Do not define `PROVIDE_FUZZ_MAIN_FUNCTION` macro unconditionally

builder-keys: Add will8clark

gui: add FormatPeerAge() utility helper

Co-authored-by: randymcmillan <randy.lee.mcmillan@gmail.com>

gui: add Age column to peers tab

Co-authored-by: Jon Atack <jon@atack.com>

gui: peersWidget - ResizeToContents Age and IP/Netmask columns

Co-authored-by: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com>

gui: add test runner summary

gui: count test failures in test runner summary

gui, refactor: rename fInvalid to num_test_failures in test_main.cpp

qt: Fix headers

This change is preparation for Qt 6, and it fixes an experimental build
with Qt 6.2.4.

qt: Use `|` instead of `+` for key modifiers

This change is preparation for Qt 6 where `+` has been deprecated, and
it fixes an experimental build with Qt 6.2.4.

qt: Update deprecated enum value

This change is preparation for Qt 6, and it fixes an experimental build
with Qt 6.2.4.
The `Qt::ItemIsTristate` value has been deprecated since 5.6.0 (see
ae8406d82f541f6d9112bdac192e5e4e114d56aa upstream commit).

print `(none)` if no warnings in -getinfo

build, refactor: Drop useless `call` Make function

util, refactor: Add UNIQUE_NAME helper macro

This change replaces repetitive code with a helper macro.

Replace uint256 specific implementations of base_uint::GetHex() and base_uint::SetHex() with proper ones that don't depend on uint256 and replace template methods instantiations of base_uint with template class instantiation

guix: fix GCC 10.3.0 + mingw-w64 setjmp/longjmp issues

This commit backports a patch to the GCC 10.3.0 we build for Windows
cross-compilation in Guix. The commit has been backported to the GCC
releases/gcc-10 branch, but hasn't yet made it into a release.

The patch corrects a regression from an earlier GCC commit, see:
https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=357c4350680bf29f0c7a115424e3da11c53b5582
and
https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=074226d5aa86cd3de517014acfe34c7f69a2ccc7,
related to the way newer versions of mingw-w64 implement setjmp/longjmp.

Ultimately this was causing a crash for us when Windows users were
viewing the network traffic tab inside the GUI. After some period, long
enough that a buffer would need reallocating, a call into FreeTypes
gray_record_cell() would result in a call to ft_longjmp (longjmp), which
would then trigger a crash.

Fixes: bitcoin-core/gui#582.

See also:
https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=e8d1ca7d2c344a411779892616c423e157f4aea8.
https://bugreports.qt.io/browse/QTBUG-93476.

doc: Remove fee delta TODO from txmempool.cpp

net: remove non-blocking bool from interface

lint: Convert lint-logs.sh to Python

test: determine path to `bitcoin-util` in test framework

The path is stored in `self.options.bitcoinutil`, points to
`src/bitcoin-util` by default and can be overrided with the
`BITCOINUTIL` environment variable.

test: add `is_bitcoin_util_compiled` helper

test: add test for signet miner script

depends: Add file-based logging for individual packages

ci: Make log verbose in error case only

This change silences depends build using LOG=1.

doc: Add pre-splitoff translation update to release-process.md
  • Loading branch information
MarcoFalke authored and russeree committed Apr 15, 2022
1 parent 10f629e commit ac83524
Show file tree
Hide file tree
Showing 73 changed files with 1,069 additions and 408 deletions.
3 changes: 2 additions & 1 deletion Makefile.am
Expand Up @@ -47,7 +47,8 @@ DIST_CONTRIB = \
$(top_srcdir)/test/sanitizer_suppressions/tsan \
$(top_srcdir)/test/sanitizer_suppressions/ubsan \
$(top_srcdir)/contrib/linearize/linearize-data.py \
$(top_srcdir)/contrib/linearize/linearize-hashes.py
$(top_srcdir)/contrib/linearize/linearize-hashes.py \
$(top_srcdir)/contrib/signet/miner

DIST_SHARE = \
$(top_srcdir)/share/genbuild.sh \
Expand Down
2 changes: 2 additions & 0 deletions build_msvc/libsecp256k1/libsecp256k1.vcxproj
Expand Up @@ -8,6 +8,8 @@
<ConfigurationType>StaticLibrary</ConfigurationType>
</PropertyGroup>
<ItemGroup>
<ClCompile Include="..\..\src\secp256k1\src\precomputed_ecmult.c" />
<ClCompile Include="..\..\src\secp256k1\src\precomputed_ecmult_gen.c" />
<ClCompile Include="..\..\src\secp256k1\src\secp256k1.c" />
</ItemGroup>
<ItemDefinitionGroup>
Expand Down
6 changes: 3 additions & 3 deletions ci/lint/04_install.sh
Expand Up @@ -11,9 +11,9 @@ ${CI_RETRY_EXE} apt-get install -y clang-format-9 python3-pip curl git gawk jq
update-alternatives --install /usr/bin/clang-format clang-format "$(which clang-format-9 )" 100
update-alternatives --install /usr/bin/clang-format-diff clang-format-diff "$(which clang-format-diff-9)" 100

${CI_RETRY_EXE} pip3 install codespell==2.0.0
${CI_RETRY_EXE} pip3 install flake8==3.8.3
${CI_RETRY_EXE} pip3 install mypy==0.910
${CI_RETRY_EXE} pip3 install codespell==2.1.0
${CI_RETRY_EXE} pip3 install flake8==4.0.1
${CI_RETRY_EXE} pip3 install mypy==0.942
${CI_RETRY_EXE} pip3 install pyzmq==22.3.0
${CI_RETRY_EXE} pip3 install vulture==2.3

Expand Down
4 changes: 2 additions & 2 deletions ci/test/00_setup_env_native_tidy.sh
Expand Up @@ -8,12 +8,12 @@ export LC_ALL=C.UTF-8

export DOCKER_NAME_TAG="ubuntu:22.04"
export CONTAINER_NAME=ci_native_tidy
export PACKAGES="clang llvm clang-tidy bear libevent-dev libboost-dev"
export PACKAGES="clang llvm clang-tidy bear libevent-dev libboost-dev libminiupnpc-dev libnatpmp-dev libzmq3-dev systemtap-sdt-dev libqt5gui5 libqt5core5a libqt5dbus5 qttools5-dev qttools5-dev-tools libqrencode-dev libsqlite3-dev libdb++-dev"
export NO_DEPENDS=1
export RUN_UNIT_TESTS=false
export RUN_FUNCTIONAL_TESTS=false
export RUN_FUZZ_TESTS=false
export RUN_TIDY=true
export GOAL="install"
export BITCOIN_CONFIG="CC=clang CXX=clang++ --disable-hardening CFLAGS='-O0 -g0' CXXFLAGS='-O0 -g0'"
export BITCOIN_CONFIG="CC=clang CXX=clang++ --with-incompatible-bdb --disable-hardening CFLAGS='-O0 -g0' CXXFLAGS='-O0 -g0'"
export CCACHE_SIZE=200M
2 changes: 1 addition & 1 deletion ci/test/05_before_script.sh
Expand Up @@ -45,7 +45,7 @@ if [ -z "$NO_DEPENDS" ]; then
else
SHELL_OPTS="CONFIG_SHELL="
fi
CI_EXEC "$SHELL_OPTS" make "$MAKEJOBS" -C depends HOST="$HOST" "$DEP_OPTS"
CI_EXEC "$SHELL_OPTS" make "$MAKEJOBS" -C depends HOST="$HOST" "$DEP_OPTS" LOG=1
fi
if [ -n "$PREVIOUS_RELEASES_TO_DOWNLOAD" ]; then
CI_EXEC test/get_previous_releases.py -b -t "$PREVIOUS_RELEASES_DIR" "${PREVIOUS_RELEASES_TO_DOWNLOAD}"
Expand Down
52 changes: 21 additions & 31 deletions configure.ac
Expand Up @@ -361,7 +361,7 @@ case $host in
esac

if test "$enable_debug" = "yes"; then
dnl If debugging is enabled, and the user hasn't overriden CXXFLAGS, clear
dnl If debugging is enabled, and the user hasn't overridden CXXFLAGS, clear
dnl them, to prevent autoconfs "-g -O2" being added. Otherwise we'd end up
dnl with "-O0 -g3 -g -O2".
if test "$CXXFLAGS_overridden" = "no"; then
Expand Down Expand Up @@ -857,7 +857,7 @@ if test "$use_lcov" = "yes"; then
[AC_MSG_ERROR([lcov testing requested but --coverage linker flag does not work])])
AX_CHECK_COMPILE_FLAG([--coverage],[CORE_CXXFLAGS="$CORE_CXXFLAGS --coverage"],
[AC_MSG_ERROR([lcov testing requested but --coverage flag does not work])])
dnl If coverage is enabled, and the user hasn't overriden CXXFLAGS, clear
dnl If coverage is enabled, and the user hasn't overridden CXXFLAGS, clear
dnl them, to prevent autoconfs "-g -O2" being added. Otherwise we'd end up
dnl with "--coverage -Og -O0 -g -O2".
if test "$CXXFLAGS_overridden" = "no"; then
Expand Down Expand Up @@ -1300,21 +1300,6 @@ if test "$enable_fuzz" = "yes"; then
enable_fuzz_binary=yes

AX_CHECK_PREPROC_FLAG([-DABORT_ON_FAILED_ASSUME], [DEBUG_CPPFLAGS="$DEBUG_CPPFLAGS -DABORT_ON_FAILED_ASSUME"], [], [$CXXFLAG_WERROR])

AC_MSG_CHECKING([whether main function is needed for fuzz binary])
AX_CHECK_LINK_FLAG(
[-fsanitize=$use_sanitizers],
[AC_MSG_RESULT([no])],
[AC_MSG_RESULT([yes]); CORE_CPPFLAGS="$CORE_CPPFLAGS -DPROVIDE_FUZZ_MAIN_FUNCTION"],
[],
[AC_LANG_PROGRAM([[
#include <cstdint>
#include <cstddef>
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { return 0; }
/* comment to remove the main function ...
]],[[
*/ int not_main() {
]])])
else
BITCOIN_QT_INIT

Expand All @@ -1328,8 +1313,25 @@ else
QT_DBUS_INCLUDES=SUPPRESS_WARNINGS($QT_DBUS_INCLUDES)
QT_TEST_INCLUDES=SUPPRESS_WARNINGS($QT_TEST_INCLUDES)
fi
fi

if test "$enable_fuzz_binary" = "yes"; then
AC_MSG_CHECKING([whether main function is needed for fuzz binary])
AX_CHECK_LINK_FLAG(
[],
[AC_MSG_RESULT([no])],
[AC_MSG_RESULT([yes]); CORE_CPPFLAGS="$CORE_CPPFLAGS -DPROVIDE_FUZZ_MAIN_FUNCTION"],
[$SANITIZER_LDFLAGS],
[AC_LANG_PROGRAM([[
#include <cstdint>
#include <cstddef>
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { return 0; }
/* comment to remove the main function ...
]],[[
*/ int not_main() {
]])])

CORE_CPPFLAGS="$CORE_CPPFLAGS -DPROVIDE_FUZZ_MAIN_FUNCTION"
CHECK_RUNTIME_LIB
fi

if test "$enable_wallet" != "no"; then
Expand Down Expand Up @@ -1819,10 +1821,6 @@ if test "$build_bitcoin_wallet$build_bitcoin_cli$build_bitcoin_tx$build_bitcoin_
AC_MSG_ERROR([No targets! Please specify at least one of: --with-utils --with-libs --with-daemon --with-gui --enable-bench or --enable-tests])
fi

if test "$enable_fuzz_binary" = "yes"; then
CHECK_RUNTIME_LIB
fi

AM_CONDITIONAL([TARGET_DARWIN], [test "$TARGET_OS" = "darwin"])
AM_CONDITIONAL([BUILD_DARWIN], [test "$BUILD_OS" = "darwin"])
AM_CONDITIONAL([TARGET_LINUX], [test "$TARGET_OS" = "linux"])
Expand Down Expand Up @@ -1959,15 +1957,7 @@ LIBS_TEMP="$LIBS"
unset LIBS
LIBS="$LIBS_TEMP"

PKGCONFIG_PATH_TEMP="$PKG_CONFIG_PATH"
unset PKG_CONFIG_PATH
PKG_CONFIG_PATH="$PKGCONFIG_PATH_TEMP"

PKGCONFIG_LIBDIR_TEMP="$PKG_CONFIG_LIBDIR"
unset PKG_CONFIG_LIBDIR
PKG_CONFIG_LIBDIR="$PKGCONFIG_LIBDIR_TEMP"

ac_configure_args="${ac_configure_args} --disable-shared --with-pic --enable-benchmark=no --enable-module-recovery --enable-module-schnorrsig --enable-experimental"
ac_configure_args="${ac_configure_args} --disable-shared --with-pic --enable-benchmark=no --enable-module-recovery --enable-module-schnorrsig"
AC_CONFIG_SUBDIRS([src/secp256k1])

AC_OUTPUT
Expand Down
1 change: 1 addition & 0 deletions contrib/builder-keys/keys.txt
Expand Up @@ -51,5 +51,6 @@ ED9BDF7AD6A55E232E84524257FF9BDBCC301009 Sjors Provoost (sjors)
9EDAFF80E080659604F4A76B2EBB056FD847F8A7 Stephan Oeste (Emzy)
6DEEF79B050C4072509B743F8C275BC595448867 Tomas Kanocz (KanoczTomas)
AEC1884398647C47413C1C3FB1179EB7347DC10D Warren Togami (wtogami)
74E2DEF5D77260B98BC19438099BAD163C70FBFA Will Clark (will8clark)
79D00BAC68B56D422F945A8F8E3A8F3247DBCBBF Willy Ko (willyko)
71A3B16735405025D447E8F274810B012346C9A6 Wladimir J. van der Laan (laanwj)
7 changes: 4 additions & 3 deletions contrib/guix/manifest.scm
Expand Up @@ -162,17 +162,18 @@ desirable for building Bitcoin Core release binaries."
(define (make-gcc-with-pthreads gcc)
(package-with-extra-configure-variable gcc "--enable-threads" "posix"))

(define (make-mingw-w64-cross-gcc-vmov-alignment cross-gcc)
(define (make-mingw-w64-cross-gcc cross-gcc)
(package-with-extra-patches cross-gcc
(search-our-patches "vmov-alignment.patch")))
(search-our-patches "vmov-alignment.patch"
"gcc-broken-longjmp.patch")))

(define (make-mingw-pthreads-cross-toolchain target)
"Create a cross-compilation toolchain package for TARGET"
(let* ((xbinutils (cross-binutils target))
(pthreads-xlibc mingw-w64-x86_64-winpthreads)
(pthreads-xgcc (make-gcc-with-pthreads
(cross-gcc target
#:xgcc (make-ssp-fixed-gcc (make-mingw-w64-cross-gcc-vmov-alignment base-gcc))
#:xgcc (make-ssp-fixed-gcc (make-mingw-w64-cross-gcc base-gcc))
#:xbinutils xbinutils
#:libc pthreads-xlibc))))
;; Define a meta-package that propagates the resulting XBINUTILS, XLIBC, and
Expand Down
68 changes: 68 additions & 0 deletions contrib/guix/patches/gcc-broken-longjmp.patch
@@ -0,0 +1,68 @@
commit eb5698897c52702498938592d7f76e67d126451f
Author: Eric Botcazou <ebotcazou@adacore.com>
Date: Wed May 5 22:48:51 2021 +0200

Fix PR target/100402

This is a regression for 64-bit Windows present from mainline down to the 9
branch and introduced by the fix for PR target/99234. Again SEH, but with
a twist related to the way MinGW implements setjmp/longjmp, which turns out
to be piggybacked on SEH with recent versions of MinGW, i.e. the longjmp
performs a bona-fide unwinding of the stack, because it calls RtlUnwindEx
with the second argument initially passed to setjmp, which is the result of
__builtin_frame_address (0) in the MinGW header file:

define setjmp(BUF) _setjmp((BUF), __builtin_frame_address (0))

This means that we directly expose the frame pointer to the SEH machinery
here (unlike with regular exception handling where we use an intermediate
CFA) and thus that we cannot do whatever we want with it. The old code
would leave it unaligned, i.e. not multiple of 16, whereas the new code
aligns it, but this breaks for some reason; at least it appears that a
.seh_setframe directive with 0 as second argument always works, so the
fix aligns it this way.

gcc/
PR target/100402
* config/i386/i386.c (ix86_compute_frame_layout): For a SEH target,
always return the establisher frame for __builtin_frame_address (0).
gcc/testsuite/
* gcc.c-torture/execute/20210505-1.c: New test.

diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 2f838840e96..06ad1b2274e 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -6356,12 +6356,29 @@ ix86_compute_frame_layout (void)
area, see the SEH code in config/i386/winnt.c for the rationale. */
frame->hard_frame_pointer_offset = frame->sse_reg_save_offset;

- /* If we can leave the frame pointer where it is, do so. Also, return
+ /* If we can leave the frame pointer where it is, do so; however return
the establisher frame for __builtin_frame_address (0) or else if the
- frame overflows the SEH maximum frame size. */
+ frame overflows the SEH maximum frame size.
+
+ Note that the value returned by __builtin_frame_address (0) is quite
+ constrained, because setjmp is piggybacked on the SEH machinery with
+ recent versions of MinGW:
+
+ # elif defined(__SEH__)
+ # if defined(__aarch64__) || defined(_ARM64_)
+ # define setjmp(BUF) _setjmp((BUF), __builtin_sponentry())
+ # elif (__MINGW_GCC_VERSION < 40702)
+ # define setjmp(BUF) _setjmp((BUF), mingw_getsp())
+ # else
+ # define setjmp(BUF) _setjmp((BUF), __builtin_frame_address (0))
+ # endif
+
+ and the second argument passed to _setjmp, if not null, is forwarded
+ to the TargetFrame parameter of RtlUnwindEx by longjmp (after it has
+ built an ExceptionRecord on the fly describing the setjmp buffer). */
const HOST_WIDE_INT diff
= frame->stack_pointer_offset - frame->hard_frame_pointer_offset;
- if (diff <= 255)
+ if (diff <= 255 && !crtl->accesses_prior_frames)
{
/* The resulting diff will be a multiple of 16 lower than 255,
i.e. at most 240 as required by the unwind data structure. */

0 comments on commit ac83524

Please sign in to comment.