mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-22 16:14:50 +01:00
Compare commits
105 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cf3a7e97ee | ||
|
|
aee53d60d3 | ||
|
|
be1a94a740 | ||
|
|
640cc72577 | ||
|
|
ee048cd32b | ||
|
|
9652f4754d | ||
|
|
0e8362760b | ||
|
|
e93b71d450 | ||
|
|
39b935a8d4 | ||
|
|
1d8856dddf | ||
|
|
aef658601d | ||
|
|
a328170e09 | ||
|
|
e0af7bffff | ||
|
|
882166642c | ||
|
|
1fc7b9d260 | ||
|
|
f52ab00f69 | ||
|
|
418bee8f9d | ||
|
|
992c7cad46 | ||
|
|
1e7041a9f3 | ||
|
|
25f150304d | ||
|
|
8588d5bbe0 | ||
|
|
a1db79c31d | ||
|
|
c70bd786f8 | ||
|
|
166fea73eb | ||
|
|
bf03c458e9 | ||
|
|
dd1bf8bc4e | ||
|
|
f42fcf6ad7 | ||
|
|
6c09325757 | ||
|
|
c838ce514f | ||
|
|
882e0d730d | ||
|
|
0cdfb7e45c | ||
|
|
693403bed6 | ||
|
|
c338e43c6f | ||
|
|
84df30927a | ||
|
|
b06c4c6550 | ||
|
|
57de0f5e77 | ||
|
|
ccff378a28 | ||
|
|
500bba0561 | ||
|
|
0cbdc6b380 | ||
|
|
4f23c86364 | ||
|
|
54bb9b0541 | ||
|
|
f22b9ca70c | ||
|
|
05192ba84c | ||
|
|
ab42206652 | ||
|
|
064f214673 | ||
|
|
0933cf53b4 | ||
|
|
fa90989503 | ||
|
|
b6440f20f2 | ||
|
|
b3093eb755 | ||
|
|
6338f92260 | ||
|
|
f34e44616d | ||
|
|
0d524b1484 | ||
|
|
43c40dd808 | ||
|
|
1088a98f5a | ||
|
|
d756a384d2 | ||
|
|
93bb18f1c8 | ||
|
|
fcf1241971 | ||
|
|
f2e05cd2a9 | ||
|
|
ba35920542 | ||
|
|
fccd32efe6 | ||
|
|
22701a4346 | ||
|
|
9e919072bd | ||
|
|
9b4640c4be | ||
|
|
80032d6917 | ||
|
|
423bd6dc68 | ||
|
|
77b2321ca0 | ||
|
|
31adcfa171 | ||
|
|
9cdb9edfb8 | ||
|
|
3c26058da2 | ||
|
|
0ba11cf908 | ||
|
|
dedf319b08 | ||
|
|
d1289a1300 | ||
|
|
c7885ecd77 | ||
|
|
bd5860bc7a | ||
|
|
475aac41fb | ||
|
|
a995902d60 | ||
|
|
0fcceefe22 | ||
|
|
ae9a2ed40a | ||
|
|
a6a59cfebc | ||
|
|
364bf01ff2 | ||
|
|
9277793b4e | ||
|
|
5c097910e0 | ||
|
|
897e5af58a | ||
|
|
602cfd580a | ||
|
|
20e6e8dc80 | ||
|
|
a6862c50c5 | ||
|
|
d82283950f | ||
|
|
910e3e8728 | ||
|
|
2d2a0a369e | ||
|
|
9442ea82da | ||
|
|
fe51aceeca | ||
|
|
bde54b7627 | ||
|
|
753c68dc0f | ||
|
|
c4da61b323 | ||
|
|
b3cd952495 | ||
|
|
a7116c8feb | ||
|
|
05f69b36d1 | ||
|
|
603f0368a5 | ||
|
|
5d381cfb6f | ||
|
|
f4be4d7447 | ||
|
|
c255fcb825 | ||
|
|
b6ff9c530d | ||
|
|
8f1b7e5cf9 | ||
|
|
b4fd211d2c | ||
|
|
7589ce3997 |
54
.cirrus.yml
54
.cirrus.yml
@@ -8,51 +8,27 @@ env: # Global defaults
|
||||
CCACHE_DIR: "/tmp/ccache_dir"
|
||||
CCACHE_NOHASHDIR: "1" # Debug info might contain a stale path if the build dir changes, but this is fine
|
||||
|
||||
# A self-hosted machine(s) can be used via Cirrus CI. It can be configured with
|
||||
# multiple users to run tasks in parallel. No sudo permission is required.
|
||||
#
|
||||
# https://cirrus-ci.org/guide/persistent-workers/
|
||||
#
|
||||
# Generally, a persistent worker must run Ubuntu 23.04+ or Debian 12+.
|
||||
#
|
||||
# The following specific types should exist, with the following requirements:
|
||||
# - small: For an x86_64 machine, recommended to have 2 CPUs and 8 GB of memory.
|
||||
# - medium: For an x86_64 machine, recommended to have 4 CPUs and 16 GB of memory.
|
||||
# - arm64: For an aarch64 machine, recommended to have 2 CPUs and 8 GB of memory.
|
||||
#
|
||||
# CI jobs for the latter configuration can be run on x86_64 hardware
|
||||
# by installing qemu-user-static, which works out of the box with
|
||||
# podman or docker. Background: https://stackoverflow.com/a/72890225/313633
|
||||
#
|
||||
# The above machine types are matched to each task by their label. Refer to the
|
||||
# It is possible to select a specific persistent worker by label. Refer to the
|
||||
# Cirrus CI docs for more details.
|
||||
#
|
||||
# When a contributor maintains a fork of the repo, any pull request they make
|
||||
# to their own fork, or to the main repository, will trigger two CI runs:
|
||||
# one for the branch push and one for the pull request.
|
||||
# This can be avoided by setting SKIP_BRANCH_PUSH=true as a custom env variable
|
||||
# in Cirrus repository settings, accessible from
|
||||
# https://cirrus-ci.com/github/my-organization/my-repository
|
||||
#
|
||||
# On machines that are persisted between CI jobs, RESTART_CI_DOCKER_BEFORE_RUN=1
|
||||
# ensures that previous containers and artifacts are cleared before each run.
|
||||
# This requires installing Podman instead of Docker.
|
||||
#
|
||||
# Futhermore:
|
||||
# Generally, a persistent worker must run Ubuntu 23.04+ or Debian 12+.
|
||||
# Specifically,
|
||||
# - apt-get is required due to PACKAGE_MANAGER_INSTALL
|
||||
# - podman-docker-4.1+ is required due to the bugfix in 4.1
|
||||
# - podman-docker-4.1+ is required due to the use of `podman` when
|
||||
# RESTART_CI_DOCKER_BEFORE_RUN is set and 4.1+ due to the bugfix in 4.1
|
||||
# (https://github.com/bitcoin/bitcoin/pull/21652#issuecomment-1657098200)
|
||||
# - The ./ci/ dependencies (with cirrus-cli) should be installed. One-liner example
|
||||
# for a single user setup with sudo permission:
|
||||
# - The ./ci/ depedencies (with cirrus-cli) should be installed:
|
||||
#
|
||||
# ```
|
||||
# apt update && apt install git screen python3 bash podman-docker curl -y && curl -L -o cirrus "https://github.com/cirruslabs/cirrus-cli/releases/latest/download/cirrus-linux-$(dpkg --print-architecture)" && mv cirrus /usr/local/bin/cirrus && chmod +x /usr/local/bin/cirrus
|
||||
# ```
|
||||
#
|
||||
# - There are no strict requirements on the hardware. Having fewer CPU threads
|
||||
# than recommended merely causes the CI script to run slower.
|
||||
# To avoid rare and intermittent OOM due to short memory usage spikes,
|
||||
# it is recommended to add (and persist) swap:
|
||||
# - There are no strict requirements on the hardware, because having less CPUs
|
||||
# runs the same CI script (maybe slower). To avoid rare and intermittent OOM
|
||||
# due to short memory usage spikes, it is recommended to add (and persist)
|
||||
# swap:
|
||||
#
|
||||
# ```
|
||||
# fallocate -l 16G /swapfile_ci && chmod 600 /swapfile_ci && mkswap /swapfile_ci && swapon /swapfile_ci && ( echo '/swapfile_ci none swap sw 0 0' | tee -a /etc/fstab )
|
||||
@@ -63,13 +39,15 @@ env: # Global defaults
|
||||
# ```
|
||||
# RESTART_CI_DOCKER_BEFORE_RUN=1 screen cirrus worker run --labels type=todo_fill_in_type --token todo_fill_in_token
|
||||
# ```
|
||||
#
|
||||
# The following specific types should exist, with the following requirements:
|
||||
# - small: For an x86_64 machine, recommended to have 2 CPUs and 8 GB of memory.
|
||||
# - medium: For an x86_64 machine, recommended to have 4 CPUs and 16 GB of memory.
|
||||
# - arm64: For an aarch64 machine, recommended to have 2 CPUs and 8 GB of memory.
|
||||
|
||||
# https://cirrus-ci.org/guide/tips-and-tricks/#sharing-configuration-between-tasks
|
||||
filter_template: &FILTER_TEMPLATE
|
||||
# Allow forks to specify SKIP_BRANCH_PUSH=true and skip CI runs when a branch is pushed,
|
||||
# but still run CI when a PR is created.
|
||||
# https://cirrus-ci.org/guide/writing-tasks/#conditional-task-execution
|
||||
skip: $SKIP_BRANCH_PUSH == "true" && $CIRRUS_PR == ""
|
||||
skip: $CIRRUS_REPO_FULL_NAME == "bitcoin-core/gui" && $CIRRUS_PR == "" # No need to run on the read-only mirror, unless it is a PR. https://cirrus-ci.org/guide/writing-tasks/#conditional-task-execution
|
||||
stateful: false # https://cirrus-ci.org/guide/writing-tasks/#stateful-tasks
|
||||
|
||||
base_template: &BASE_TEMPLATE
|
||||
|
||||
52
.github/workflows/ci.yml
vendored
52
.github/workflows/ci.yml
vendored
@@ -24,7 +24,7 @@ env:
|
||||
jobs:
|
||||
test-each-commit:
|
||||
name: 'test each commit'
|
||||
runs-on: ubuntu-24.04
|
||||
runs-on: ubuntu-22.04
|
||||
if: github.event_name == 'pull_request' && github.event.pull_request.commits != 1
|
||||
timeout-minutes: 360 # Use maximum time, see https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idtimeout-minutes. Assuming a worst case time of 1 hour per commit, this leads to a --max-count=6 below.
|
||||
env:
|
||||
@@ -58,21 +58,15 @@ jobs:
|
||||
# and the ^ prefix is used to exclude these parents and all their
|
||||
# ancestors from the rev-list output as described in:
|
||||
# https://git-scm.com/docs/git-rev-list
|
||||
MERGE_BASE=$(git rev-list -n1 --merges HEAD)
|
||||
EXCLUDE_MERGE_BASE_ANCESTORS=
|
||||
# MERGE_BASE can be empty due to limited fetch-depth
|
||||
if test -n "$MERGE_BASE"; then
|
||||
EXCLUDE_MERGE_BASE_ANCESTORS=^${MERGE_BASE}^@
|
||||
fi
|
||||
echo "TEST_BASE=$(git rev-list -n$((${{ env.MAX_COUNT }} + 1)) --reverse HEAD $EXCLUDE_MERGE_BASE_ANCESTORS | head -1)" >> "$GITHUB_ENV"
|
||||
echo "TEST_BASE=$(git rev-list -n$((${{ env.MAX_COUNT }} + 1)) --reverse HEAD ^$(git rev-list -n1 --merges HEAD)^@ | head -1)" >> "$GITHUB_ENV"
|
||||
- run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install clang ccache build-essential libtool autotools-dev automake pkg-config bsdmainutils python3-zmq libevent-dev libboost-dev libsqlite3-dev libdb++-dev systemtap-sdt-dev libminiupnpc-dev libnatpmp-dev qtbase5-dev qttools5-dev qttools5-dev-tools qtwayland5 libqrencode-dev -y
|
||||
sudo apt-get install clang-15 ccache build-essential libtool autotools-dev automake pkg-config bsdmainutils python3-zmq libevent-dev libboost-dev libsqlite3-dev libdb++-dev systemtap-sdt-dev libminiupnpc-dev libnatpmp-dev qtbase5-dev qttools5-dev qttools5-dev-tools qtwayland5 libqrencode-dev -y
|
||||
- name: Compile and run tests
|
||||
run: |
|
||||
# Run tests on commits after the last merge commit and before the PR head commit
|
||||
# Use clang++, because it is a bit faster and uses less memory than g++
|
||||
git rebase --exec "echo Running test-one-commit on \$( git log -1 ) && ./autogen.sh && CC=clang CXX=clang++ ./configure --with-incompatible-bdb && make clean && make -j $(nproc) check && ./test/functional/test_runner.py -j $(( $(nproc) * 2 ))" ${{ env.TEST_BASE }}
|
||||
git rebase --exec "echo Running test-one-commit on \$( git log -1 ) && ./autogen.sh && CC=clang-15 CXX=clang++-15 ./configure && make clean && make -j $(nproc) check && ./test/functional/test_runner.py -j $(( $(nproc) * 2 ))" ${{ env.TEST_BASE }}
|
||||
|
||||
macos-native-x86_64:
|
||||
name: 'macOS 13 native, x86_64, no depends, sqlite only, gui'
|
||||
@@ -104,8 +98,8 @@ jobs:
|
||||
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: 1
|
||||
run: |
|
||||
# A workaround for "The `brew link` step did not complete successfully" error.
|
||||
brew install --quiet python@3 || brew link --overwrite python@3
|
||||
brew install --quiet automake libtool pkg-config gnu-getopt ccache boost libevent miniupnpc libnatpmp zeromq qt@5 qrencode
|
||||
brew install python@3 || brew link --overwrite python@3
|
||||
brew install automake libtool pkg-config gnu-getopt ccache boost libevent miniupnpc libnatpmp zeromq qt@5 qrencode
|
||||
|
||||
- name: Set Ccache directory
|
||||
run: echo "CCACHE_DIR=${RUNNER_TEMP}/ccache_dir" >> "$GITHUB_ENV"
|
||||
@@ -143,7 +137,7 @@ jobs:
|
||||
CI_CCACHE_VERSION: '4.7.5'
|
||||
CI_QT_CONF: '-release -silent -opensource -confirm-license -opengl desktop -static -static-runtime -mp -qt-zlib -qt-pcre -qt-libpng -nomake examples -nomake tests -nomake tools -no-angle -no-dbus -no-gif -no-gtk -no-ico -no-icu -no-libjpeg -no-libudev -no-sql-sqlite -no-sql-odbc -no-sqlite -no-vulkan -skip qt3d -skip qtactiveqt -skip qtandroidextras -skip qtcharts -skip qtconnectivity -skip qtdatavis3d -skip qtdeclarative -skip doc -skip qtdoc -skip qtgamepad -skip qtgraphicaleffects -skip qtimageformats -skip qtlocation -skip qtlottie -skip qtmacextras -skip qtmultimedia -skip qtnetworkauth -skip qtpurchasing -skip qtquick3d -skip qtquickcontrols -skip qtquickcontrols2 -skip qtquicktimeline -skip qtremoteobjects -skip qtscript -skip qtscxml -skip qtsensors -skip qtserialbus -skip qtserialport -skip qtspeech -skip qtsvg -skip qtvirtualkeyboard -skip qtwayland -skip qtwebchannel -skip qtwebengine -skip qtwebglplugin -skip qtwebsockets -skip qtwebview -skip qtx11extras -skip qtxmlpatterns -no-openssl -no-feature-bearermanagement -no-feature-printdialog -no-feature-printer -no-feature-printpreviewdialog -no-feature-printpreviewwidget -no-feature-sql -no-feature-sqlmodel -no-feature-textbrowser -no-feature-textmarkdownwriter -no-feature-textodfwriter -no-feature-xml'
|
||||
CI_QT_DIR: 'qt-everywhere-src-5.15.11'
|
||||
CI_QT_URL: 'https://download.qt.io/official_releases/qt/5.15/5.15.11/single/qt-everywhere-opensource-src-5.15.11.zip'
|
||||
CI_QT_URL: 'https://download.qt.io/archive/qt/5.15/5.15.11/single/qt-everywhere-opensource-src-5.15.11.zip'
|
||||
PYTHONUTF8: 1
|
||||
TEST_RUNNER_TIMEOUT_FACTOR: 40
|
||||
|
||||
@@ -159,12 +153,13 @@ jobs:
|
||||
|
||||
- name: Get tool information
|
||||
run: |
|
||||
msbuild -version | Tee-Object -FilePath "msbuild_version"
|
||||
$env:VCToolsVersion | Tee-Object -FilePath "toolset_version"
|
||||
$env:CI_QT_URL | Out-File -FilePath "qt_url"
|
||||
$env:CI_QT_CONF | Out-File -FilePath "qt_conf"
|
||||
msbuild -version | Out-File -FilePath "$env:GITHUB_WORKSPACE\msbuild_version"
|
||||
Get-Content -Path "$env:GITHUB_WORKSPACE\msbuild_version"
|
||||
$env:VCToolsVersion | Out-File -FilePath "$env:GITHUB_WORKSPACE\toolset_version"
|
||||
Write-Host "VCToolsVersion $(Get-Content -Path "$env:GITHUB_WORKSPACE\toolset_version")"
|
||||
$env:CI_QT_URL | Out-File -FilePath "$env:GITHUB_WORKSPACE\qt_url"
|
||||
$env:CI_QT_CONF | Out-File -FilePath "$env:GITHUB_WORKSPACE\qt_conf"
|
||||
py -3 --version
|
||||
Write-Host "PowerShell version $($PSVersionTable.PSVersion.ToString())"
|
||||
|
||||
- name: Restore static Qt cache
|
||||
id: static-qt-cache
|
||||
@@ -245,8 +240,10 @@ jobs:
|
||||
run: |
|
||||
Set-Location "$env:VCPKG_INSTALLATION_ROOT"
|
||||
Add-Content -Path "triplets\x64-windows-static.cmake" -Value "set(VCPKG_BUILD_TYPE release)"
|
||||
Add-Content -Path "triplets\x64-windows-static.cmake" -Value "set(VCPKG_PLATFORM_TOOLSET_VERSION $env:VCToolsVersion)"
|
||||
.\vcpkg.exe --vcpkg-root "$env:VCPKG_INSTALLATION_ROOT" integrate install
|
||||
git rev-parse HEAD | Tee-Object -FilePath "$env:GITHUB_WORKSPACE\vcpkg_commit"
|
||||
git rev-parse HEAD | Out-File -FilePath "$env:GITHUB_WORKSPACE\vcpkg_commit"
|
||||
Get-Content -Path "$env:GITHUB_WORKSPACE\vcpkg_commit"
|
||||
|
||||
- name: vcpkg tools cache
|
||||
uses: actions/cache@v4
|
||||
@@ -298,19 +295,6 @@ jobs:
|
||||
shell: cmd
|
||||
run: py -3 test\functional\test_runner.py --jobs %NUMBER_OF_PROCESSORS% --ci --quiet --tmpdirprefix=%RUNNER_TEMP% --combinedlogslen=99999999 --timeout-factor=%TEST_RUNNER_TIMEOUT_FACTOR% %TEST_RUNNER_EXTRA%
|
||||
|
||||
- name: Clone fuzz corpus
|
||||
run: |
|
||||
git clone --depth=1 https://github.com/bitcoin-core/qa-assets "$env:RUNNER_TEMP\qa-assets"
|
||||
Set-Location "$env:RUNNER_TEMP\qa-assets"
|
||||
Write-Host "Using qa-assets repo from commit ..."
|
||||
git log -1
|
||||
|
||||
- name: Run fuzz binaries
|
||||
env:
|
||||
BITCOINFUZZ: "${{ github.workspace}}\\src\\fuzz.exe"
|
||||
shell: cmd
|
||||
run: py -3 test\fuzz\test_runner.py --par %NUMBER_OF_PROCESSORS% --loglevel DEBUG %RUNNER_TEMP%\qa-assets\fuzz_seed_corpus
|
||||
|
||||
asan-lsan-ubsan-integer-no-depends-usdt:
|
||||
name: 'ASan + LSan + UBSan + integer, no depends, USDT'
|
||||
runs-on: ubuntu-24.04 # has to match container in ci/test/00_setup_env_native_asan.sh for tracing tools
|
||||
@@ -319,7 +303,6 @@ jobs:
|
||||
timeout-minutes: 120
|
||||
env:
|
||||
FILE_ENV: "./ci/test/00_setup_env_native_asan.sh"
|
||||
DANGER_CI_ON_HOST_CACHE_FOLDERS: 1
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
@@ -327,9 +310,6 @@ jobs:
|
||||
- name: Set Ccache directory
|
||||
run: echo "CCACHE_DIR=${RUNNER_TEMP}/ccache_dir" >> "$GITHUB_ENV"
|
||||
|
||||
- name: Set base root directory
|
||||
run: echo "BASE_ROOT_DIR=${RUNNER_TEMP}" >> "$GITHUB_ENV"
|
||||
|
||||
- name: Restore Ccache cache
|
||||
id: ccache-cache
|
||||
uses: actions/cache/restore@v4
|
||||
|
||||
3
.gitignore
vendored
3
.gitignore
vendored
@@ -130,12 +130,12 @@ win32-build
|
||||
test/config.ini
|
||||
test/cache/*
|
||||
test/.mypy_cache/
|
||||
test/lint/test_runner/target/
|
||||
|
||||
!src/leveldb*/Makefile
|
||||
|
||||
/doc/doxygen/
|
||||
|
||||
libbitcoinconsensus.pc
|
||||
contrib/devtools/split-debug.sh
|
||||
|
||||
# Output from running db4 installation
|
||||
@@ -144,6 +144,7 @@ db4/
|
||||
# clang-check
|
||||
*.plist
|
||||
|
||||
osx_volname
|
||||
dist/
|
||||
|
||||
/guix-build-*
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[main]
|
||||
host = https://www.transifex.com
|
||||
|
||||
[o:bitcoin:p:bitcoin:r:qt-translation-028x]
|
||||
[o:bitcoin:p:bitcoin:r:qt-translation-027x]
|
||||
file_filter = src/qt/locale/bitcoin_<lang>.xlf
|
||||
source_file = src/qt/locale/bitcoin_en.xlf
|
||||
source_lang = en
|
||||
|
||||
@@ -149,7 +149,7 @@ the pull request affects. Valid areas as:
|
||||
- `net` or `p2p` for changes to the peer-to-peer network code
|
||||
- `refactor` for structural changes that do not change behavior
|
||||
- `rpc`, `rest` or `zmq` for changes to the RPC, REST or ZMQ APIs
|
||||
- `contrib` or `cli` for changes to the scripts and tools
|
||||
- `script` for changes to the scripts and tools
|
||||
- `test`, `qa` or `ci` for changes to the unit tests, QA tests or CI code
|
||||
- `util` or `lib` for changes to the utils or libraries
|
||||
- `wallet` for changes to the wallet code
|
||||
@@ -418,8 +418,11 @@ Backporting
|
||||
|
||||
Security and bug fixes can be backported from `master` to release
|
||||
branches.
|
||||
Maintainers will do backports in batches and
|
||||
use the proper `Needs backport (...)` labels
|
||||
If the backport is non-trivial, it may be appropriate to open an
|
||||
additional PR to backport the change, but only after the original PR
|
||||
has been merged.
|
||||
Otherwise, backports will be done in batches and
|
||||
the maintainers will use the proper `Needs backport (...)` labels
|
||||
when needed (the original author does not need to worry about it).
|
||||
|
||||
A backport should contain the following metadata in the commit body:
|
||||
|
||||
28
Makefile.am
28
Makefile.am
@@ -14,6 +14,11 @@ endif
|
||||
.PHONY: deploy FORCE
|
||||
.INTERMEDIATE: $(COVERAGE_INFO)
|
||||
|
||||
if BUILD_BITCOIN_LIBS
|
||||
pkgconfigdir = $(libdir)/pkgconfig
|
||||
pkgconfig_DATA = libbitcoinconsensus.pc
|
||||
endif
|
||||
|
||||
BITCOIND_BIN=$(top_builddir)/src/$(BITCOIN_DAEMON_NAME)$(EXEEXT)
|
||||
BITCOIN_QT_BIN=$(top_builddir)/src/qt/$(BITCOIN_GUI_NAME)$(EXEEXT)
|
||||
BITCOIN_TEST_BIN=$(top_builddir)/src/test/$(BITCOIN_TEST_NAME)$(EXEEXT)
|
||||
@@ -113,6 +118,9 @@ OSX_APP_BUILT=$(OSX_APP)/Contents/PkgInfo $(OSX_APP)/Contents/Resources/empty.lp
|
||||
$(OSX_APP)/Contents/Resources/bitcoin.icns $(OSX_APP)/Contents/Info.plist \
|
||||
$(OSX_APP)/Contents/MacOS/Bitcoin-Qt $(OSX_APP)/Contents/Resources/Base.lproj/InfoPlist.strings
|
||||
|
||||
osx_volname:
|
||||
echo $(OSX_VOLNAME) >$@
|
||||
|
||||
if BUILD_DARWIN
|
||||
$(OSX_ZIP): $(OSX_APP_BUILT) $(OSX_PACKAGING)
|
||||
$(PYTHON) $(OSX_DEPLOY_SCRIPT) $(OSX_APP) $(OSX_VOLNAME) -translations-dir=$(QT_TRANSLATION_DIR) -zip
|
||||
@@ -126,7 +134,7 @@ $(OSX_ZIP): deploydir
|
||||
cd $(APP_DIST_DIR) && find . | sort | $(ZIP) -X@ $@
|
||||
|
||||
$(APP_DIST_DIR)/$(OSX_APP)/Contents/MacOS/Bitcoin-Qt: $(OSX_APP_BUILT) $(OSX_PACKAGING)
|
||||
OBJDUMP=$(OBJDUMP) $(PYTHON) $(OSX_DEPLOY_SCRIPT) $(OSX_APP) $(OSX_VOLNAME) -translations-dir=$(QT_TRANSLATION_DIR)
|
||||
INSTALL_NAME_TOOL=$(INSTALL_NAME_TOOL) OTOOL=$(OTOOL) STRIP=$(STRIP) $(PYTHON) $(OSX_DEPLOY_SCRIPT) $(OSX_APP) $(OSX_VOLNAME) -translations-dir=$(QT_TRANSLATION_DIR)
|
||||
|
||||
deploydir: $(APP_DIST_DIR)/$(OSX_APP)/Contents/MacOS/Bitcoin-Qt
|
||||
endif !BUILD_DARWIN
|
||||
@@ -186,7 +194,7 @@ baseline_filtered.info: baseline.info
|
||||
$(LCOV) -a $@ $(LCOV_OPTS) -o $@
|
||||
|
||||
fuzz.info: baseline_filtered.info
|
||||
@test/fuzz/test_runner.py $(DIR_FUZZ_SEED_CORPUS) -l DEBUG
|
||||
@TIMEOUT=15 test/fuzz/test_runner.py $(DIR_FUZZ_SEED_CORPUS) -l DEBUG
|
||||
$(LCOV) -c $(LCOV_OPTS) -d $(abs_builddir)/src --t fuzz-tests -o $@
|
||||
$(LCOV) -z $(LCOV_OPTS) -d $(abs_builddir)/src
|
||||
|
||||
@@ -204,7 +212,7 @@ test_bitcoin_filtered.info: test_bitcoin.info
|
||||
$(LCOV) -a $@ $(LCOV_OPTS) -o $@
|
||||
|
||||
functional_test.info: test_bitcoin_filtered.info
|
||||
@test/functional/test_runner.py $(EXTENDED_FUNCTIONAL_TESTS)
|
||||
@TIMEOUT=15 test/functional/test_runner.py $(EXTENDED_FUNCTIONAL_TESTS)
|
||||
$(LCOV) -c $(LCOV_OPTS) -d $(abs_builddir)/src --t functional-tests -o $@
|
||||
$(LCOV) -z $(LCOV_OPTS) -d $(abs_builddir)/src
|
||||
|
||||
@@ -330,18 +338,18 @@ clean-docs:
|
||||
clean-local: clean-docs
|
||||
rm -rf coverage_percent.txt test_bitcoin.coverage/ total.coverage/ fuzz.coverage/ test/tmp/ cache/ $(OSX_APP)
|
||||
rm -rf test/functional/__pycache__ test/functional/test_framework/__pycache__ test/cache share/rpcauth/__pycache__
|
||||
rm -rf dist/ test/lint/test_runner/target/ test/lint/__pycache__
|
||||
rm -rf osx_volname dist/
|
||||
|
||||
test-security-check:
|
||||
if TARGET_DARWIN
|
||||
$(AM_V_at) CXX='$(CXX)' CXXFLAGS='$(CXXFLAGS)' CPPFLAGS='$(CPPFLAGS)' LDFLAGS='$(LDFLAGS)' $(PYTHON) $(top_srcdir)/contrib/devtools/test-security-check.py TestSecurityChecks.test_MACHO
|
||||
$(AM_V_at) CXX='$(CXX)' CXXFLAGS='$(CXXFLAGS)' CPPFLAGS='$(CPPFLAGS)' LDFLAGS='$(LDFLAGS)' $(PYTHON) $(top_srcdir)/contrib/devtools/test-symbol-check.py TestSymbolChecks.test_MACHO
|
||||
$(AM_V_at) CC='$(CC)' CFLAGS='$(CFLAGS)' CPPFLAGS='$(CPPFLAGS)' LDFLAGS='$(LDFLAGS)' $(PYTHON) $(top_srcdir)/contrib/devtools/test-security-check.py TestSecurityChecks.test_MACHO
|
||||
$(AM_V_at) CC='$(CC)' CFLAGS='$(CFLAGS)' CPPFLAGS='$(CPPFLAGS)' LDFLAGS='$(LDFLAGS)' $(PYTHON) $(top_srcdir)/contrib/devtools/test-symbol-check.py TestSymbolChecks.test_MACHO
|
||||
endif
|
||||
if TARGET_WINDOWS
|
||||
$(AM_V_at) CXX='$(CXX)' CXXFLAGS='$(CXXFLAGS)' CPPFLAGS='$(CPPFLAGS)' LDFLAGS='$(LDFLAGS)' $(PYTHON) $(top_srcdir)/contrib/devtools/test-security-check.py TestSecurityChecks.test_PE
|
||||
$(AM_V_at) CXX='$(CXX)' CXXFLAGS='$(CXXFLAGS)' CPPFLAGS='$(CPPFLAGS)' LDFLAGS='$(LDFLAGS)' $(PYTHON) $(top_srcdir)/contrib/devtools/test-symbol-check.py TestSymbolChecks.test_PE
|
||||
$(AM_V_at) CC='$(CC)' CFLAGS='$(CFLAGS)' CPPFLAGS='$(CPPFLAGS)' LDFLAGS='$(LDFLAGS)' $(PYTHON) $(top_srcdir)/contrib/devtools/test-security-check.py TestSecurityChecks.test_PE
|
||||
$(AM_V_at) CC='$(CC)' CFLAGS='$(CFLAGS)' CPPFLAGS='$(CPPFLAGS)' LDFLAGS='$(LDFLAGS)' $(PYTHON) $(top_srcdir)/contrib/devtools/test-symbol-check.py TestSymbolChecks.test_PE
|
||||
endif
|
||||
if TARGET_LINUX
|
||||
$(AM_V_at) CXX='$(CXX)' CXXFLAGS='$(CXXFLAGS)' CPPFLAGS='$(CPPFLAGS)' LDFLAGS='$(LDFLAGS)' $(PYTHON) $(top_srcdir)/contrib/devtools/test-security-check.py TestSecurityChecks.test_ELF
|
||||
$(AM_V_at) CXX='$(CXX)' CXXFLAGS='$(CXXFLAGS)' CPPFLAGS='$(CPPFLAGS)' LDFLAGS='$(LDFLAGS)' $(PYTHON) $(top_srcdir)/contrib/devtools/test-symbol-check.py TestSymbolChecks.test_ELF
|
||||
$(AM_V_at) CC='$(CC)' CFLAGS='$(CFLAGS)' CPPFLAGS='$(CPPFLAGS)' LDFLAGS='$(LDFLAGS)' $(PYTHON) $(top_srcdir)/contrib/devtools/test-security-check.py TestSecurityChecks.test_ELF
|
||||
$(AM_V_at) CC='$(CC)' CFLAGS='$(CFLAGS)' CPPFLAGS='$(CPPFLAGS)' LDFLAGS='$(LDFLAGS)' $(PYTHON) $(top_srcdir)/contrib/devtools/test-symbol-check.py TestSymbolChecks.test_ELF
|
||||
endif
|
||||
|
||||
@@ -983,7 +983,7 @@ m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_20], [[
|
||||
|
||||
#error "This is not a C++ compiler"
|
||||
|
||||
#elif __cplusplus < 202002L
|
||||
#elif __cplusplus < 201709L // Temporary patch on top of upstream to allow g++-10
|
||||
|
||||
#error "This is not a C++20 compiler"
|
||||
|
||||
|
||||
@@ -70,6 +70,8 @@ AC_DEFUN([BITCOIN_QT_INIT],[
|
||||
[qt_lib_suffix= ]); bitcoin_qt_want_version=qt5],
|
||||
[qt_lib_suffix= ])
|
||||
|
||||
AS_CASE([$host], [*android*], [qt_lib_suffix=_$ANDROID_ARCH])
|
||||
|
||||
AC_ARG_WITH([qt-incdir],[AS_HELP_STRING([--with-qt-incdir=INC_DIR],[specify qt include path (overridden by pkgconfig)])], [qt_include_path=$withval], [])
|
||||
AC_ARG_WITH([qt-libdir],[AS_HELP_STRING([--with-qt-libdir=LIB_DIR],[specify qt lib path (overridden by pkgconfig)])], [qt_lib_path=$withval], [])
|
||||
AC_ARG_WITH([qt-plugindir],[AS_HELP_STRING([--with-qt-plugindir=PLUGIN_DIR],[specify qt plugin path (overridden by pkgconfig)])], [qt_plugin_path=$withval], [])
|
||||
@@ -78,10 +80,19 @@ AC_DEFUN([BITCOIN_QT_INIT],[
|
||||
|
||||
AC_ARG_WITH([qtdbus],
|
||||
[AS_HELP_STRING([--with-qtdbus],
|
||||
[enable DBus support (default is yes if qt is enabled and QtDBus is found)])],
|
||||
[enable DBus support (default is yes if qt is enabled and QtDBus is found, except on Android)])],
|
||||
[use_dbus=$withval],
|
||||
[use_dbus=auto])
|
||||
|
||||
dnl Android doesn't support D-Bus and certainly doesn't use it for notifications
|
||||
case $host in
|
||||
*android*)
|
||||
if test "$use_dbus" != "yes"; then
|
||||
use_dbus=no
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
AC_SUBST(QT_TRANSLATION_DIR,$qt_translation_path)
|
||||
])
|
||||
|
||||
@@ -121,10 +132,16 @@ AC_DEFUN([BITCOIN_QT_CONFIGURE],[
|
||||
if test -d "$qt_plugin_path/accessible"; then
|
||||
QT_LIBS="$QT_LIBS -L$qt_plugin_path/accessible"
|
||||
fi
|
||||
if test -d "$qt_plugin_path/platforms/android"; then
|
||||
QT_LIBS="$QT_LIBS -L$qt_plugin_path/platforms/android -lqtfreetype -lEGL"
|
||||
fi
|
||||
fi
|
||||
|
||||
_BITCOIN_QT_CHECK_STATIC_PLUGIN([QMinimalIntegrationPlugin], [-lqminimal])
|
||||
AC_DEFINE([QT_QPA_PLATFORM_MINIMAL], [1], [Define this symbol if the minimal qt platform exists])
|
||||
AC_DEFINE([QT_STATICPLUGIN], [1], [Define this symbol if qt plugins are static])
|
||||
if test "$TARGET_OS" != "android"; then
|
||||
_BITCOIN_QT_CHECK_STATIC_PLUGIN([QMinimalIntegrationPlugin], [-lqminimal])
|
||||
AC_DEFINE([QT_QPA_PLATFORM_MINIMAL], [1], [Define this symbol if the minimal qt platform exists])
|
||||
fi
|
||||
if test "$TARGET_OS" = "windows"; then
|
||||
dnl Linking against wtsapi32 is required. See #17749 and
|
||||
dnl https://bugreports.qt.io/browse/QTBUG-27097.
|
||||
@@ -143,6 +160,9 @@ AC_DEFUN([BITCOIN_QT_CONFIGURE],[
|
||||
_BITCOIN_QT_CHECK_STATIC_PLUGIN([QCocoaIntegrationPlugin], [-lqcocoa])
|
||||
_BITCOIN_QT_CHECK_STATIC_PLUGIN([QMacStylePlugin], [-lqmacstyle])
|
||||
AC_DEFINE([QT_QPA_PLATFORM_COCOA], [1], [Define this symbol if the qt platform is cocoa])
|
||||
elif test "$TARGET_OS" = "android"; then
|
||||
QT_LIBS="-Wl,--export-dynamic,--undefined=JNI_OnLoad -lplugins_platforms_qtforandroid${qt_lib_suffix} -ljnigraphics -landroid -lqtfreetype${qt_lib_suffix} $QT_LIBS"
|
||||
AC_DEFINE([QT_QPA_PLATFORM_ANDROID], [1], [Define this symbol if the qt platform is android])
|
||||
fi
|
||||
fi
|
||||
CPPFLAGS=$TEMP_CPPFLAGS
|
||||
@@ -207,7 +227,7 @@ AC_DEFUN([BITCOIN_QT_CONFIGURE],[
|
||||
BITCOIN_QT_PATH_PROGS([LUPDATE], [lupdate-qt5 lupdate5 lupdate],$qt_bin_path, yes)
|
||||
BITCOIN_QT_PATH_PROGS([LCONVERT], [lconvert-qt5 lconvert5 lconvert], $qt_bin_path, yes)
|
||||
|
||||
MOC_DEFS='-I$(srcdir)'
|
||||
MOC_DEFS='-DHAVE_CONFIG_H -I$(srcdir)'
|
||||
case $host in
|
||||
*darwin*)
|
||||
BITCOIN_QT_CHECK([
|
||||
@@ -337,6 +357,9 @@ AC_DEFUN([_BITCOIN_QT_CHECK_STATIC_LIBS], [
|
||||
PKG_CHECK_MODULES([QT_SERVICE], [${qt_lib_prefix}ServiceSupport${qt_lib_suffix}], [QT_LIBS="$QT_SERVICE_LIBS $QT_LIBS"])
|
||||
elif test "$TARGET_OS" = "windows"; then
|
||||
PKG_CHECK_MODULES([QT_WINDOWSUIAUTOMATION], [${qt_lib_prefix}WindowsUIAutomationSupport${qt_lib_suffix}], [QT_LIBS="$QT_WINDOWSUIAUTOMATION_LIBS $QT_LIBS"])
|
||||
elif test "$TARGET_OS" = "android"; then
|
||||
PKG_CHECK_MODULES([QT_EGL], [${qt_lib_prefix}EglSupport${qt_lib_suffix}], [QT_LIBS="$QT_EGL_LIBS $QT_LIBS"])
|
||||
PKG_CHECK_MODULES([QT_SERVICE], [${qt_lib_prefix}ServiceSupport${qt_lib_suffix}], [QT_LIBS="$QT_SERVICE_LIBS $QT_LIBS"])
|
||||
fi
|
||||
])
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ Qt
|
||||
---------------------
|
||||
To build Bitcoin Core with the GUI, a static build of Qt is required.
|
||||
|
||||
1. Download a single ZIP archive of Qt source code from https://download.qt.io/official_releases/qt/ (e.g., [`qt-everywhere-opensource-src-5.15.11.zip`](https://download.qt.io/official_releases/qt/5.15/5.15.11/single/qt-everywhere-opensource-src-5.15.11.zip)), and expand it into a dedicated folder. The following instructions assume that this folder is `C:\dev\qt-source`.
|
||||
1. Download a single ZIP archive of Qt source code from https://download.qt.io/archive/qt/ (e.g., [`qt-everywhere-opensource-src-5.15.11.zip`](https://download.qt.io/archive/qt/5.15/5.15.11/single/qt-everywhere-opensource-src-5.15.11.zip)), and expand it into a dedicated folder. The following instructions assume that this folder is `C:\dev\qt-source`.
|
||||
|
||||
> 💡 **Tip:** If you use the default path with "Extract All" for the Qt source code zip file, and end up with something like `C:\dev\qt-everywhere-opensource-src-5.15.11\qt-everywhere-src-5.15.11`, you are likely to encounter a "path too long" error when building. To fix the problem move the source files to a shorter path such as the recommended `C:\dev\qt-source`.
|
||||
|
||||
|
||||
@@ -10,12 +10,6 @@
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
@SOURCE_FILES@
|
||||
<ClCompile Include="..\..\src\bench\coin_selection.cpp" />
|
||||
<ClCompile Include="..\..\src\bench\wallet_balance.cpp" />
|
||||
<ClCompile Include="..\..\src\bench\wallet_create.cpp" />
|
||||
<ClCompile Include="..\..\src\bench\wallet_create_tx.cpp" />
|
||||
<ClCompile Include="..\..\src\bench\wallet_ismine.cpp" />
|
||||
<ClCompile Include="..\..\src\bench\wallet_loading.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\libbitcoin_consensus\libbitcoin_consensus.vcxproj">
|
||||
|
||||
@@ -62,7 +62,7 @@
|
||||
</Link>
|
||||
<ResourceCompile>
|
||||
<AdditionalIncludeDirectories>..\..\src;</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>HAVE_CONFIG_H;_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ResourceCompile>
|
||||
</ItemDefinitionGroup>
|
||||
|
||||
@@ -75,7 +75,7 @@
|
||||
</Link>
|
||||
<ResourceCompile>
|
||||
<AdditionalIncludeDirectories>..\..\src;</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>HAVE_CONFIG_H;_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ResourceCompile>
|
||||
</ItemDefinitionGroup>
|
||||
|
||||
|
||||
@@ -48,9 +48,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libtest_util", "libtest_uti
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_bitcoin-qt", "test_bitcoin-qt\test_bitcoin-qt.vcxproj", "{51201D5E-D939-4854-AE9D-008F03FF518E}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libminisketch", "libminisketch\libminisketch.vcxproj", "{542007E3-BE0D-4B0D-A6B0-AA8813E2558D}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fuzz", "fuzz\fuzz.vcxproj", "{AFCEE6C1-89FB-49AB-A694-BA580A59E2D8}"
|
||||
Project("{542007E3-BE0D-4B0D-A6B0-AA8813E2558D}") = "libminisketch", "libminisketch\libminisketch.vcxproj", "{542007E3-BE0D-4B0D-A6B0-AA8813E2558D}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
@@ -154,10 +152,6 @@ Global
|
||||
{542007E3-BE0D-4B0D-A6B0-AA8813E2558D}.Debug|x64.Build.0 = Debug|x64
|
||||
{542007E3-BE0D-4B0D-A6B0-AA8813E2558D}.Release|x64.ActiveCfg = Release|x64
|
||||
{542007E3-BE0D-4B0D-A6B0-AA8813E2558D}.Release|x64.Build.0 = Release|x64
|
||||
{AFCEE6C1-89FB-49AB-A694-BA580A59E2D8}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{AFCEE6C1-89FB-49AB-A694-BA580A59E2D8}.Debug|x64.Build.0 = Debug|x64
|
||||
{AFCEE6C1-89FB-49AB-A694-BA580A59E2D8}.Release|x64.ActiveCfg = Release|x64
|
||||
{AFCEE6C1-89FB-49AB-A694-BA580A59E2D8}.Release|x64.Build.0 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
||||
@@ -41,14 +41,77 @@
|
||||
/* Define this symbol to enable ZMQ functions */
|
||||
#define ENABLE_ZMQ 1
|
||||
|
||||
/* Define to 1 if you have the declaration of `be16toh', and to 0 if you
|
||||
don't. */
|
||||
#define HAVE_DECL_BE16TOH 0
|
||||
|
||||
/* Define to 1 if you have the declaration of `be32toh', and to 0 if you
|
||||
don't. */
|
||||
#define HAVE_DECL_BE32TOH 0
|
||||
|
||||
/* Define to 1 if you have the declaration of `be64toh', and to 0 if you
|
||||
don't. */
|
||||
#define HAVE_DECL_BE64TOH 0
|
||||
|
||||
/* Define to 1 if you have the declaration of `bswap_16', and to 0 if you
|
||||
don't. */
|
||||
#define HAVE_DECL_BSWAP_16 0
|
||||
|
||||
/* Define to 1 if you have the declaration of `bswap_32', and to 0 if you
|
||||
don't. */
|
||||
#define HAVE_DECL_BSWAP_32 0
|
||||
|
||||
/* Define to 1 if you have the declaration of `bswap_64', and to 0 if you
|
||||
don't. */
|
||||
#define HAVE_DECL_BSWAP_64 0
|
||||
|
||||
/* Define to 1 if you have the declaration of `fork', and to 0 if you don't.
|
||||
*/
|
||||
#define HAVE_DECL_FORK 0
|
||||
|
||||
/* Define to 1 if you have the declaration of `htobe16', and to 0 if you
|
||||
don't. */
|
||||
#define HAVE_DECL_HTOBE16 0
|
||||
|
||||
/* Define to 1 if you have the declaration of `htobe32', and to 0 if you
|
||||
don't. */
|
||||
#define HAVE_DECL_HTOBE32 0
|
||||
|
||||
/* Define to 1 if you have the declaration of `htobe64', and to 0 if you
|
||||
don't. */
|
||||
#define HAVE_DECL_HTOBE64 0
|
||||
|
||||
/* Define to 1 if you have the declaration of `htole16', and to 0 if you
|
||||
don't. */
|
||||
#define HAVE_DECL_HTOLE16 0
|
||||
|
||||
/* Define to 1 if you have the declaration of `htole32', and to 0 if you
|
||||
don't. */
|
||||
#define HAVE_DECL_HTOLE32 0
|
||||
|
||||
/* Define to 1 if you have the declaration of `htole64', and to 0 if you
|
||||
don't. */
|
||||
#define HAVE_DECL_HTOLE64 0
|
||||
|
||||
/* Define to 1 if you have the declaration of `le16toh', and to 0 if you
|
||||
don't. */
|
||||
#define HAVE_DECL_LE16TOH 0
|
||||
|
||||
/* Define to 1 if you have the declaration of `le32toh', and to 0 if you
|
||||
don't. */
|
||||
#define HAVE_DECL_LE32TOH 0
|
||||
|
||||
/* Define to 1 if you have the declaration of `le64toh', and to 0 if you
|
||||
don't. */
|
||||
#define HAVE_DECL_LE64TOH 0
|
||||
|
||||
/* Define to 1 if you have the declaration of `setsid', and to 0 if you don't.
|
||||
*/
|
||||
#define HAVE_DECL_SETSID 0
|
||||
|
||||
/* Define if the dllexport attribute is supported. */
|
||||
#define HAVE_DLLEXPORT_ATTRIBUTE 1
|
||||
|
||||
/* Define to the address where bug reports for this package should be sent. */
|
||||
#define PACKAGE_BUGREPORT "https://github.com/bitcoin/bitcoin/issues"
|
||||
|
||||
@@ -70,6 +133,9 @@
|
||||
/* Define this symbol if the qt platform is windows */
|
||||
#define QT_QPA_PLATFORM_WINDOWS 1
|
||||
|
||||
/* Define this symbol if qt plugins are static */
|
||||
#define QT_STATICPLUGIN 1
|
||||
|
||||
/* Windows Universal Platform constraints */
|
||||
#if !defined(WINAPI_FAMILY) || (WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP)
|
||||
/* Either a desktop application without API restrictions, or and older system
|
||||
|
||||
@@ -80,7 +80,7 @@
|
||||
<ReplaceInFile FilePath="$(ConfigIniOut)"
|
||||
Replace="@BUILD_BITCOIND_TRUE@" By=""></ReplaceInFile>
|
||||
<ReplaceInFile FilePath="$(ConfigIniOut)"
|
||||
Replace="@ENABLE_FUZZ_BINARY_TRUE@" By=""></ReplaceInFile>
|
||||
Replace="@ENABLE_FUZZ_BINARY_TRUE@" By="#"></ReplaceInFile>
|
||||
<ReplaceInFile FilePath="$(ConfigIniOut)"
|
||||
Replace="@ENABLE_ZMQ_TRUE@" By=""></ReplaceInFile>
|
||||
<ReplaceInFile FilePath="$(ConfigIniOut)"
|
||||
|
||||
@@ -87,10 +87,10 @@
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
<AdditionalOptions>/utf-8 /Zc:preprocessor /Zc:__cplusplus /std:c++20 %(AdditionalOptions)</AdditionalOptions>
|
||||
<AdditionalOptions>/utf-8 /Zc:__cplusplus /std:c++20 %(AdditionalOptions)</AdditionalOptions>
|
||||
<DisableSpecificWarnings>4018;4244;4267;4715;4805</DisableSpecificWarnings>
|
||||
<TreatWarningAsError>true</TreatWarningAsError>
|
||||
<PreprocessorDefinitions>_SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING;SECP256K1_STATIC;ZMQ_STATIC;NOMINMAX;WIN32;_CRT_SECURE_NO_WARNINGS;_CONSOLE;_WIN32_WINNT=0x0601;_WIN32_IE=0x0501;WIN32_LEAN_AND_MEAN;PROVIDE_FUZZ_MAIN_FUNCTION;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>_SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING;SECP256K1_STATIC;ZMQ_STATIC;NOMINMAX;WIN32;HAVE_CONFIG_H;_CRT_SECURE_NO_WARNINGS;_CONSOLE;_WIN32_WINNT=0x0601;_WIN32_IE=0x0501;WIN32_LEAN_AND_MEAN;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>..\..\src;..\..\src\minisketch\include;..\..\src\univalue\include;..\..\src\secp256k1\include;..\..\src\leveldb\include;..\..\src\leveldb\helpers\memenv;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
|
||||
@@ -1,85 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="..\common.init.vcxproj" />
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{AFCEE6C1-89FB-49AB-A694-BA580A59E2D8}</ProjectGuid>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\src\test\fuzz\*.cpp" />
|
||||
<ClCompile Include="..\..\src\test\fuzz\util\descriptor.cpp">
|
||||
<ObjectFileName>$(IntDir)test_fuzz_util_descriptor.obj</ObjectFileName>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\test\fuzz\util\mempool.cpp">
|
||||
<ObjectFileName>$(IntDir)test_fuzz_util_mempool.obj</ObjectFileName>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\test\fuzz\util\net.cpp">
|
||||
<ObjectFileName>$(IntDir)test_fuzz_util_net.obj</ObjectFileName>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\wallet\test\fuzz\coincontrol.cpp">
|
||||
<ObjectFileName>$(IntDir)wallet_test_fuzz_coincontrol.obj</ObjectFileName>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\wallet\test\fuzz\coinselection.cpp">
|
||||
<ObjectFileName>$(IntDir)wallet_test_fuzz_coinselection.obj</ObjectFileName>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\wallet\test\fuzz\fees.cpp">
|
||||
<ObjectFileName>$(IntDir)wallet_test_fuzz_fees.obj</ObjectFileName>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\wallet\test\fuzz\notifications.cpp">
|
||||
<ObjectFileName>$(IntDir)wallet_test_fuzz_notifications.obj</ObjectFileName>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\wallet\test\fuzz\parse_iso8601.cpp">
|
||||
<ObjectFileName>$(IntDir)wallet_test_fuzz_parse_iso8601.obj</ObjectFileName>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\wallet\test\fuzz\scriptpubkeyman.cpp">
|
||||
<ObjectFileName>$(IntDir)wallet_test_fuzz_scriptpubkeyman.obj</ObjectFileName>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\libminisketch\libminisketch.vcxproj">
|
||||
<Project>{542007e3-be0d-4b0d-a6b0-aa8813e2558d}</Project>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\libbitcoin_consensus\libbitcoin_consensus.vcxproj">
|
||||
<Project>{2b384fa8-9ee1-4544-93cb-0d733c25e8ce}</Project>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\libbitcoin_cli\libbitcoin_cli.vcxproj">
|
||||
<Project>{0667528c-d734-4009-adf9-c0d6c4a5a5a6}</Project>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\libbitcoin_common\libbitcoin_common.vcxproj">
|
||||
<Project>{7c87e378-df58-482e-aa2f-1bc129bc19ce}</Project>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\libbitcoin_crypto\libbitcoin_crypto.vcxproj">
|
||||
<Project>{6190199c-6cf4-4dad-bfbd-93fa72a760c1}</Project>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\libbitcoin_node\libbitcoin_node.vcxproj">
|
||||
<Project>{460fee33-1fe1-483f-b3bf-931ff8e969a5}</Project>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\libbitcoin_util\libbitcoin_util.vcxproj">
|
||||
<Project>{b53a5535-ee9d-4c6f-9a26-f79ee3bc3754}</Project>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\libbitcoin_wallet\libbitcoin_wallet.vcxproj">
|
||||
<Project>{93b86837-b543-48a5-a89b-7c87abb77df2}</Project>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\libbitcoin_zmq\libbitcoin_zmq.vcxproj">
|
||||
<Project>{792d487f-f14c-49fc-a9de-3fc150f31c3f}</Project>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\libtest_util\libtest_util.vcxproj">
|
||||
<Project>{1e065f03-3566-47d0-8fa9-daa72b084e7d}</Project>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\libunivalue\libunivalue.vcxproj">
|
||||
<Project>{5724ba7d-a09a-4ba8-800b-c4c1561b3d69}</Project>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\libsecp256k1\libsecp256k1.vcxproj">
|
||||
<Project>{bb493552-3b8c-4a8c-bf69-a6e7a51d2ea6}</Project>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\libleveldb\libleveldb.vcxproj">
|
||||
<Project>{18430fef-6b61-4c53-b396-718e02850f1b}</Project>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<Import Project="..\common.vcxproj" />
|
||||
</Project>
|
||||
@@ -8,6 +8,7 @@
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\src\common\url.cpp" />
|
||||
@SOURCE_FILES@
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
<ClCompile Include="..\..\src\primitives\block.cpp" />
|
||||
<ClCompile Include="..\..\src\primitives\transaction.cpp" />
|
||||
<ClCompile Include="..\..\src\pubkey.cpp" />
|
||||
<ClCompile Include="..\..\src\script\bitcoinconsensus.cpp" />
|
||||
<ClCompile Include="..\..\src\script\interpreter.cpp" />
|
||||
<ClCompile Include="..\..\src\script\script.cpp" />
|
||||
<ClCompile Include="..\..\src\script\script_error.cpp" />
|
||||
|
||||
@@ -59,6 +59,11 @@
|
||||
<Project>{18430fef-6b61-4c53-b396-718e02850f1b}</Project>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemDefinitionGroup>
|
||||
<ClCompile>
|
||||
<DisableSpecificWarnings>4018;4244;4267;4703;4715;4805</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<Target Name="RawBenchHeaderGen" BeforeTargets="PrepareForBuild">
|
||||
<PropertyGroup>
|
||||
<ErrorText>There was an error executing the JSON test header generation task.</ErrorText>
|
||||
|
||||
@@ -1,14 +1,12 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# Copyright (c) 2018-present The Bitcoin Core developers
|
||||
# Copyright (c) 2018-2022 The Bitcoin Core developers
|
||||
# Distributed under the MIT software license, see the accompanying
|
||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
export LC_ALL=C
|
||||
|
||||
export CI_RETRY_EXE="/ci_retry --"
|
||||
|
||||
pushd "/"
|
||||
export PATH=$PWD/ci/retry:$PATH
|
||||
|
||||
${CI_RETRY_EXE} apt-get update
|
||||
# Lint dependencies:
|
||||
@@ -21,7 +19,7 @@ ${CI_RETRY_EXE} apt-get install -y automake pkg-config libtool curl xz-utils git
|
||||
PYTHON_PATH="/python_build"
|
||||
if [ ! -d "${PYTHON_PATH}/bin" ]; then
|
||||
(
|
||||
${CI_RETRY_EXE} git clone --depth=1 https://github.com/pyenv/pyenv.git
|
||||
${CI_RETRY_EXE} git clone https://github.com/pyenv/pyenv.git
|
||||
cd pyenv/plugins/python-build || exit 1
|
||||
./install.sh
|
||||
)
|
||||
@@ -30,7 +28,7 @@ if [ ! -d "${PYTHON_PATH}/bin" ]; then
|
||||
libbz2-dev libreadline-dev libsqlite3-dev curl llvm \
|
||||
libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev \
|
||||
clang
|
||||
env CC=clang python-build "$(cat "/.python-version")" "${PYTHON_PATH}"
|
||||
env CC=clang python-build "$(cat "./.python-version")" "${PYTHON_PATH}"
|
||||
fi
|
||||
export PATH="${PYTHON_PATH}/bin:${PATH}"
|
||||
command -v python3
|
||||
@@ -40,7 +38,7 @@ export LINT_RUNNER_PATH="/lint_test_runner"
|
||||
if [ ! -d "${LINT_RUNNER_PATH}" ]; then
|
||||
${CI_RETRY_EXE} apt-get install -y cargo
|
||||
(
|
||||
cd "/test/lint/test_runner" || exit 1
|
||||
cd ./test/lint/test_runner || exit 1
|
||||
cargo build
|
||||
mkdir -p "${LINT_RUNNER_PATH}"
|
||||
mv target/debug/test_runner "${LINT_RUNNER_PATH}"
|
||||
@@ -48,22 +46,14 @@ if [ ! -d "${LINT_RUNNER_PATH}" ]; then
|
||||
fi
|
||||
|
||||
${CI_RETRY_EXE} pip3 install \
|
||||
codespell==2.2.6 \
|
||||
codespell==2.2.5 \
|
||||
flake8==6.1.0 \
|
||||
lief==0.13.2 \
|
||||
mypy==1.4.1 \
|
||||
pyzmq==25.1.0 \
|
||||
ruff==0.5.5 \
|
||||
vulture==2.6
|
||||
|
||||
SHELLCHECK_VERSION=v0.8.0
|
||||
curl -sL "https://github.com/koalaman/shellcheck/releases/download/${SHELLCHECK_VERSION}/shellcheck-${SHELLCHECK_VERSION}.linux.x86_64.tar.xz" | \
|
||||
tar --xz -xf - --directory /tmp/
|
||||
mv "/tmp/shellcheck-${SHELLCHECK_VERSION}/shellcheck" /usr/bin/
|
||||
|
||||
MLC_VERSION=v0.18.0
|
||||
MLC_BIN=mlc-x86_64-linux
|
||||
curl -sL "https://github.com/becheran/mlc/releases/download/${MLC_VERSION}/${MLC_BIN}" -o "/usr/bin/mlc"
|
||||
chmod +x /usr/bin/mlc
|
||||
|
||||
popd || exit
|
||||
|
||||
@@ -8,24 +8,21 @@ export LC_ALL=C
|
||||
|
||||
set -ex
|
||||
|
||||
if [ -n "$CIRRUS_PR" ]; then
|
||||
if [ -n "$LOCAL_BRANCH" ]; then
|
||||
# To faithfully recreate CI linting locally, specify all commits on the current
|
||||
# branch.
|
||||
COMMIT_RANGE="$(git merge-base HEAD master)..HEAD"
|
||||
elif [ -n "$CIRRUS_PR" ]; then
|
||||
COMMIT_RANGE="HEAD~..HEAD"
|
||||
if [ "$(git rev-list -1 HEAD)" != "$(git rev-list -1 --merges HEAD)" ]; then
|
||||
echo "Error: The top commit must be a merge commit, usually the remote 'pull/${PR_NUMBER}/merge' branch."
|
||||
false
|
||||
fi
|
||||
echo
|
||||
git log --no-merges --oneline "$COMMIT_RANGE"
|
||||
echo
|
||||
test/lint/commit-script-check.sh "$COMMIT_RANGE"
|
||||
else
|
||||
# Otherwise, assume that a merge commit exists. This merge commit is assumed
|
||||
# to be the base, after which linting will be done. If the merge commit is
|
||||
# HEAD, the range will be empty.
|
||||
COMMIT_RANGE="$( git rev-list --max-count=1 --merges HEAD )..HEAD"
|
||||
COMMIT_RANGE="SKIP_EMPTY_NOT_A_PR"
|
||||
fi
|
||||
export COMMIT_RANGE
|
||||
|
||||
echo
|
||||
git log --no-merges --oneline "$COMMIT_RANGE"
|
||||
echo
|
||||
test/lint/commit-script-check.sh "$COMMIT_RANGE"
|
||||
RUST_BACKTRACE=1 "${LINT_RUNNER_PATH}/test_runner"
|
||||
|
||||
if [ "$CIRRUS_REPO_FULL_NAME" = "bitcoin/bitcoin" ] && [ "$CIRRUS_PR" = "" ] ; then
|
||||
|
||||
@@ -14,7 +14,7 @@ export PATH="/python_build/bin:${PATH}"
|
||||
export LINT_RUNNER_PATH="/lint_test_runner"
|
||||
|
||||
if [ -z "$1" ]; then
|
||||
bash -ic "./ci/lint/06_script.sh"
|
||||
LOCAL_BRANCH=1 bash -ic "./ci/lint/06_script.sh"
|
||||
else
|
||||
exec "$@"
|
||||
fi
|
||||
|
||||
@@ -4,12 +4,11 @@
|
||||
|
||||
# See test/lint/README.md for usage.
|
||||
|
||||
FROM docker.io/debian:bookworm
|
||||
FROM debian:bookworm
|
||||
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
ENV LC_ALL=C.UTF-8
|
||||
|
||||
COPY ./ci/retry/retry /ci_retry
|
||||
COPY ./.python-version /.python-version
|
||||
COPY ./ci/lint/container-entrypoint.sh /entrypoint.sh
|
||||
COPY ./ci/lint/04_install.sh /install.sh
|
||||
|
||||
@@ -1,17 +1,12 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# Copyright (c) 2019-present The Bitcoin Core developers
|
||||
# Copyright (c) 2019-2020 The Bitcoin Core developers
|
||||
# Distributed under the MIT software license, see the accompanying
|
||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
export LC_ALL=C.UTF-8
|
||||
|
||||
# Only used in .cirrus.yml. Refer to test/lint/README.md on how to run locally.
|
||||
|
||||
cp "./ci/retry/retry" "/ci_retry"
|
||||
cp "./.python-version" "/.python-version"
|
||||
mkdir --parents "/test/lint"
|
||||
cp --recursive "./test/lint/test_runner" "/test/lint/"
|
||||
set -o errexit; source ./ci/test/00_setup_env.sh
|
||||
set -o errexit; source ./ci/lint/04_install.sh
|
||||
set -o errexit
|
||||
./ci/lint/06_script.sh
|
||||
|
||||
25
ci/test/00_setup_env_android.sh
Executable file
25
ci/test/00_setup_env_android.sh
Executable file
@@ -0,0 +1,25 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# Copyright (c) 2019-present The Bitcoin Core developers
|
||||
# Distributed under the MIT software license, see the accompanying
|
||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
export LC_ALL=C.UTF-8
|
||||
|
||||
export HOST=aarch64-linux-android
|
||||
export PACKAGES="unzip openjdk-8-jdk gradle"
|
||||
export CONTAINER_NAME=ci_android
|
||||
export CI_IMAGE_NAME_TAG="docker.io/amd64/ubuntu:22.04"
|
||||
|
||||
export RUN_UNIT_TESTS=false
|
||||
export RUN_FUNCTIONAL_TESTS=false
|
||||
|
||||
export ANDROID_API_LEVEL=28
|
||||
export ANDROID_BUILD_TOOLS_VERSION=28.0.3
|
||||
export ANDROID_NDK_VERSION=23.2.8568313
|
||||
export ANDROID_TOOLS_URL=https://dl.google.com/android/repository/commandlinetools-linux-8512546_latest.zip
|
||||
export ANDROID_HOME="${DEPENDS_DIR}/SDKs/android"
|
||||
export ANDROID_NDK_HOME="${ANDROID_HOME}/ndk/${ANDROID_NDK_VERSION}"
|
||||
export DEP_OPTS="ANDROID_SDK=${ANDROID_HOME} ANDROID_NDK=${ANDROID_NDK_HOME} ANDROID_API_LEVEL=${ANDROID_API_LEVEL} ANDROID_TOOLCHAIN_BIN=${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin/"
|
||||
|
||||
export BITCOIN_CONFIG="--disable-tests --enable-gui-tests --disable-bench --disable-fuzz-binary --without-utils --without-libs --without-daemon"
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# Copyright (c) 2019-present The Bitcoin Core developers
|
||||
# Copyright (c) 2019-2021 The Bitcoin Core developers
|
||||
# Distributed under the MIT software license, see the accompanying
|
||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
@@ -10,11 +10,11 @@ export HOST=arm-linux-gnueabihf
|
||||
export DPKG_ADD_ARCH="armhf"
|
||||
export PACKAGES="python3-zmq g++-arm-linux-gnueabihf busybox libc6:armhf libstdc++6:armhf libfontconfig1:armhf libxcb1:armhf"
|
||||
export CONTAINER_NAME=ci_arm_linux
|
||||
export CI_IMAGE_NAME_TAG="docker.io/arm64v8/debian:bookworm" # Check that https://packages.debian.org/bookworm/g++-arm-linux-gnueabihf (version 12.2, similar to guix) can cross-compile
|
||||
export CI_IMAGE_NAME_TAG="docker.io/arm64v8/debian:bookworm"
|
||||
export USE_BUSY_BOX=true
|
||||
export RUN_UNIT_TESTS=true
|
||||
export RUN_FUNCTIONAL_TESTS=false
|
||||
export GOAL="install"
|
||||
# -Wno-psabi is to disable ABI warnings: "note: parameter passing for argument of type ... changed in GCC 7.1"
|
||||
# This could be removed once the ABI change warning does not show up by default
|
||||
export BITCOIN_CONFIG="--enable-reduce-exports CXXFLAGS='-Wno-psabi -Wno-error=maybe-uninitialized'"
|
||||
export BITCOIN_CONFIG="--enable-reduce-exports CXXFLAGS=-Wno-psabi"
|
||||
|
||||
@@ -8,11 +8,10 @@ export LC_ALL=C.UTF-8
|
||||
|
||||
export HOST=i686-pc-linux-gnu
|
||||
export CONTAINER_NAME=ci_i686_multiprocess
|
||||
export CI_IMAGE_NAME_TAG="docker.io/amd64/ubuntu:24.04"
|
||||
export CI_IMAGE_NAME_TAG="docker.io/amd64/ubuntu:22.04"
|
||||
export PACKAGES="llvm clang g++-multilib"
|
||||
export DEP_OPTS="DEBUG=1 MULTIPROCESS=1"
|
||||
export GOAL="install"
|
||||
export TEST_RUNNER_EXTRA="--v2transport"
|
||||
export BITCOIN_CONFIG="--enable-debug CC='clang -m32' CXX='clang++ -m32' \
|
||||
CPPFLAGS='-DBOOST_MULTI_INDEX_ENABLE_SAFE_MODE' CXXFLAGS='-Wno-error=documentation'"
|
||||
CPPFLAGS='-DBOOST_MULTI_INDEX_ENABLE_SAFE_MODE'"
|
||||
export BITCOIND=bitcoin-node # Used in functional tests
|
||||
|
||||
@@ -9,9 +9,9 @@ export LC_ALL=C.UTF-8
|
||||
export SDK_URL=${SDK_URL:-https://bitcoincore.org/depends-sources/sdks}
|
||||
|
||||
export CONTAINER_NAME=ci_macos_cross
|
||||
export CI_IMAGE_NAME_TAG="docker.io/ubuntu:24.04"
|
||||
export CI_IMAGE_NAME_TAG="docker.io/ubuntu:22.04"
|
||||
export HOST=x86_64-apple-darwin
|
||||
export PACKAGES="clang lld llvm zip"
|
||||
export PACKAGES="zip"
|
||||
export XCODE_VERSION=15.0
|
||||
export XCODE_BUILD_ID=15A240d
|
||||
export RUN_UNIT_TESTS=false
|
||||
|
||||
@@ -19,11 +19,10 @@ else
|
||||
fi
|
||||
|
||||
export CONTAINER_NAME=ci_native_asan
|
||||
export PACKAGES="systemtap-sdt-dev clang-18 llvm-18 libclang-rt-18-dev python3-zmq qtbase5-dev qttools5-dev qttools5-dev-tools libevent-dev libboost-dev libdb5.3++-dev libminiupnpc-dev libnatpmp-dev libzmq3-dev libqrencode-dev libsqlite3-dev ${BPFCC_PACKAGE}"
|
||||
export PACKAGES="systemtap-sdt-dev clang-17 llvm-17 libclang-rt-17-dev python3-zmq qtbase5-dev qttools5-dev-tools libevent-dev libboost-dev libdb5.3++-dev libminiupnpc-dev libnatpmp-dev libzmq3-dev libqrencode-dev libsqlite3-dev ${BPFCC_PACKAGE}"
|
||||
export NO_DEPENDS=1
|
||||
export GOAL="install"
|
||||
export BITCOIN_CONFIG="--enable-usdt --enable-zmq --with-incompatible-bdb --with-gui=qt5 \
|
||||
export BITCOIN_CONFIG="--enable-c++20 --enable-usdt --enable-zmq --with-incompatible-bdb --with-gui=qt5 \
|
||||
CPPFLAGS='-DARENA_DEBUG -DDEBUG_LOCKORDER' \
|
||||
--with-sanitizers=address,float-divide-by-zero,integer,undefined \
|
||||
CC='clang-18 -ftrivial-auto-var-init=pattern' CXX='clang++-18 -ftrivial-auto-var-init=pattern'"
|
||||
export CCACHE_MAXSIZE=300M
|
||||
CC='clang-17 -ftrivial-auto-var-init=pattern' CXX='clang++-17 -ftrivial-auto-var-init=pattern'"
|
||||
|
||||
@@ -8,7 +8,7 @@ export LC_ALL=C.UTF-8
|
||||
|
||||
export CI_IMAGE_NAME_TAG="docker.io/ubuntu:24.04"
|
||||
export CONTAINER_NAME=ci_native_fuzz
|
||||
export PACKAGES="clang-18 llvm-18 libclang-rt-18-dev libevent-dev libboost-dev libsqlite3-dev"
|
||||
export PACKAGES="clang-17 llvm-17 libclang-rt-17-dev libevent-dev libboost-dev libsqlite3-dev"
|
||||
export NO_DEPENDS=1
|
||||
export RUN_UNIT_TESTS=false
|
||||
export RUN_FUNCTIONAL_TESTS=false
|
||||
@@ -16,6 +16,6 @@ export RUN_FUZZ_TESTS=true
|
||||
export GOAL="install"
|
||||
export CI_CONTAINER_CAP="--cap-add SYS_PTRACE" # If run with (ASan + LSan), the container needs access to ptrace (https://github.com/google/sanitizers/issues/764)
|
||||
export BITCOIN_CONFIG="--enable-fuzz --with-sanitizers=fuzzer,address,undefined,float-divide-by-zero,integer \
|
||||
CC='clang-18 -ftrivial-auto-var-init=pattern' CXX='clang++-18 -ftrivial-auto-var-init=pattern'"
|
||||
CC='clang-17 -ftrivial-auto-var-init=pattern' CXX='clang++-17 -ftrivial-auto-var-init=pattern'"
|
||||
export CCACHE_MAXSIZE=200M
|
||||
export LLVM_SYMBOLIZER_PATH="/usr/bin/llvm-symbolizer-18"
|
||||
export LLVM_SYMBOLIZER_PATH="/usr/bin/llvm-symbolizer-17"
|
||||
|
||||
@@ -17,8 +17,7 @@ export PACKAGES="ninja-build"
|
||||
# BDB generates false-positives and will be removed in future
|
||||
export DEP_OPTS="DEBUG=1 NO_BDB=1 NO_QT=1 CC=clang CXX=clang++ CFLAGS='${MSAN_FLAGS}' CXXFLAGS='${MSAN_AND_LIBCXX_FLAGS}'"
|
||||
export GOAL="install"
|
||||
# _FORTIFY_SOURCE is not compatible with MSAN.
|
||||
export BITCOIN_CONFIG="--enable-fuzz --with-sanitizers=fuzzer,memory CPPFLAGS='-DBOOST_MULTI_INDEX_ENABLE_SAFE_MODE -U_FORTIFY_SOURCE'"
|
||||
export BITCOIN_CONFIG="--enable-fuzz --with-sanitizers=fuzzer,memory --disable-hardening --with-asm=no CFLAGS='${MSAN_FLAGS}' CPPFLAGS='-DBOOST_MULTI_INDEX_ENABLE_SAFE_MODE' CXXFLAGS='${MSAN_AND_LIBCXX_FLAGS}'"
|
||||
export USE_MEMORY_SANITIZER="true"
|
||||
export RUN_UNIT_TESTS="false"
|
||||
export RUN_FUNCTIONAL_TESTS="false"
|
||||
|
||||
@@ -6,14 +6,15 @@
|
||||
|
||||
export LC_ALL=C.UTF-8
|
||||
|
||||
export CI_IMAGE_NAME_TAG="docker.io/ubuntu:24.04"
|
||||
export CI_IMAGE_NAME_TAG="docker.io/debian:bookworm"
|
||||
export CONTAINER_NAME=ci_native_fuzz_valgrind
|
||||
export PACKAGES="clang-16 llvm-16 libclang-rt-16-dev libevent-dev libboost-dev libsqlite3-dev valgrind"
|
||||
export PACKAGES="clang llvm libclang-rt-dev libevent-dev libboost-dev libsqlite3-dev valgrind"
|
||||
export NO_DEPENDS=1
|
||||
export RUN_UNIT_TESTS=false
|
||||
export RUN_FUNCTIONAL_TESTS=false
|
||||
export RUN_FUZZ_TESTS=true
|
||||
export FUZZ_TESTS_CONFIG="--valgrind"
|
||||
export GOAL="install"
|
||||
export BITCOIN_CONFIG="--enable-fuzz --with-sanitizers=fuzzer CC=clang-16 CXX=clang++-16"
|
||||
# Temporarily pin dwarf 4, until using Valgrind 3.20 or later
|
||||
export BITCOIN_CONFIG="--enable-fuzz --with-sanitizers=fuzzer CC=clang CXX=clang++ CFLAGS=-gdwarf-4 CXXFLAGS=-gdwarf-4"
|
||||
export CCACHE_MAXSIZE=200M
|
||||
|
||||
@@ -17,8 +17,7 @@ export PACKAGES="ninja-build"
|
||||
# BDB generates false-positives and will be removed in future
|
||||
export DEP_OPTS="DEBUG=1 NO_BDB=1 NO_QT=1 CC=clang CXX=clang++ CFLAGS='${MSAN_FLAGS}' CXXFLAGS='${MSAN_AND_LIBCXX_FLAGS}'"
|
||||
export GOAL="install"
|
||||
# _FORTIFY_SOURCE is not compatible with MSAN.
|
||||
export BITCOIN_CONFIG="--with-sanitizers=memory CPPFLAGS='-U_FORTIFY_SOURCE'"
|
||||
export BITCOIN_CONFIG="--with-sanitizers=memory --disable-hardening --with-asm=no CFLAGS='${MSAN_FLAGS}' CXXFLAGS='${MSAN_AND_LIBCXX_FLAGS}'"
|
||||
export USE_MEMORY_SANITIZER="true"
|
||||
export RUN_FUNCTIONAL_TESTS="false"
|
||||
export CCACHE_MAXSIZE=250M
|
||||
|
||||
@@ -7,9 +7,9 @@
|
||||
export LC_ALL=C.UTF-8
|
||||
|
||||
export CONTAINER_NAME=ci_native_nowallet_libbitcoinkernel
|
||||
export CI_IMAGE_NAME_TAG="docker.io/debian:bullseye"
|
||||
# Use minimum supported python3.9 and clang-16, see doc/dependencies.md
|
||||
export PACKAGES="python3-zmq clang-16 llvm-16 libc++abi-16-dev libc++-16-dev"
|
||||
export DEP_OPTS="NO_WALLET=1 CC=clang-16 CXX='clang++-16 -stdlib=libc++'"
|
||||
export CI_IMAGE_NAME_TAG="docker.io/ubuntu:22.04"
|
||||
# Use minimum supported python3.9 (or best-effort 3.10) and clang-14, see doc/dependencies.md
|
||||
export PACKAGES="python3-zmq clang-14 llvm-14 libc++abi-14-dev libc++-14-dev"
|
||||
export DEP_OPTS="NO_WALLET=1 CC=clang-14 CXX='clang++-14 -stdlib=libc++'"
|
||||
export GOAL="install"
|
||||
export BITCOIN_CONFIG="--enable-reduce-exports --enable-experimental-util-chainstate --with-experimental-kernel-lib --enable-shared"
|
||||
|
||||
@@ -7,14 +7,14 @@
|
||||
export LC_ALL=C.UTF-8
|
||||
|
||||
export CONTAINER_NAME=ci_native_previous_releases
|
||||
export CI_IMAGE_NAME_TAG="docker.io/ubuntu:22.04"
|
||||
# Use minimum supported python3.9 (or best effort 3.10) and gcc-11, see doc/dependencies.md
|
||||
export PACKAGES="gcc-11 g++-11 python3-zmq"
|
||||
export DEP_OPTS="NO_UPNP=1 NO_NATPMP=1 DEBUG=1 CC=gcc-11 CXX=g++-11"
|
||||
export CI_IMAGE_NAME_TAG="docker.io/debian:bullseye"
|
||||
# Use minimum supported python3.9 and gcc-10, see doc/dependencies.md
|
||||
export PACKAGES="gcc-10 g++-10 python3-zmq"
|
||||
export DEP_OPTS="NO_UPNP=1 NO_NATPMP=1 DEBUG=1 CC=gcc-10 CXX=g++-10"
|
||||
export TEST_RUNNER_EXTRA="--previous-releases --coverage --extended --exclude feature_dbcrash" # Run extended tests so that coverage does not fail, but exclude the very slow dbcrash
|
||||
export RUN_UNIT_TESTS_SEQUENTIAL="true"
|
||||
export RUN_UNIT_TESTS="false"
|
||||
export GOAL="install"
|
||||
export DOWNLOAD_PREVIOUS_RELEASES="true"
|
||||
export BITCOIN_CONFIG="--enable-zmq --with-gui=qt5 --enable-reduce-exports --enable-debug \
|
||||
export BITCOIN_CONFIG="--enable-zmq --with-libs=no --with-gui=qt5 --enable-reduce-exports --enable-debug \
|
||||
CFLAGS=\"-g0 -O2 -funsigned-char\" CPPFLAGS='-DBOOST_MULTI_INDEX_ENABLE_SAFE_MODE' CXXFLAGS=\"-g0 -O2 -funsigned-char\""
|
||||
|
||||
@@ -8,7 +8,7 @@ export LC_ALL=C.UTF-8
|
||||
|
||||
export CI_IMAGE_NAME_TAG="docker.io/ubuntu:24.04"
|
||||
export CONTAINER_NAME=ci_native_tidy
|
||||
export TIDY_LLVM_V="18"
|
||||
export TIDY_LLVM_V="17"
|
||||
export PACKAGES="clang-${TIDY_LLVM_V} libclang-${TIDY_LLVM_V}-dev llvm-${TIDY_LLVM_V}-dev libomp-${TIDY_LLVM_V}-dev clang-tidy-${TIDY_LLVM_V} jq bear libevent-dev libboost-dev libminiupnpc-dev libnatpmp-dev libzmq3-dev systemtap-sdt-dev qtbase5-dev qttools5-dev qttools5-dev-tools libqrencode-dev libsqlite3-dev libdb++-dev"
|
||||
export NO_DEPENDS=1
|
||||
export RUN_UNIT_TESTS=false
|
||||
@@ -16,5 +16,5 @@ export RUN_FUNCTIONAL_TESTS=false
|
||||
export RUN_FUZZ_TESTS=false
|
||||
export RUN_TIDY=true
|
||||
export GOAL="install"
|
||||
export BITCOIN_CONFIG="CC=clang-${TIDY_LLVM_V} CXX=clang++-${TIDY_LLVM_V} --with-incompatible-bdb --disable-hardening CFLAGS='-O0 -g0' CXXFLAGS='-O0 -g0'"
|
||||
export BITCOIN_CONFIG="CC=clang-${TIDY_LLVM_V} CXX=clang++-${TIDY_LLVM_V} --with-incompatible-bdb --disable-hardening CFLAGS='-O0 -g0' CXXFLAGS='-O0 -g0 -I/usr/lib/llvm-${TIDY_LLVM_V}/lib/clang/${TIDY_LLVM_V}/include'"
|
||||
export CCACHE_MAXSIZE=200M
|
||||
|
||||
@@ -8,7 +8,7 @@ export LC_ALL=C.UTF-8
|
||||
|
||||
export CONTAINER_NAME=ci_native_tsan
|
||||
export CI_IMAGE_NAME_TAG="docker.io/ubuntu:24.04"
|
||||
export PACKAGES="clang-18 llvm-18 libclang-rt-18-dev libc++abi-18-dev libc++-18-dev python3-zmq"
|
||||
export DEP_OPTS="CC=clang-18 CXX='clang++-18 -stdlib=libc++'"
|
||||
export PACKAGES="clang-17 llvm-17 libclang-rt-17-dev libc++abi-17-dev libc++-17-dev python3-zmq"
|
||||
export DEP_OPTS="CC=clang-17 CXX='clang++-17 -stdlib=libc++'"
|
||||
export GOAL="install"
|
||||
export BITCOIN_CONFIG="--enable-zmq CPPFLAGS='-DARENA_DEBUG -DDEBUG_LOCKORDER -DDEBUG_LOCKCONTENTION -D_LIBCPP_REMOVE_TRANSITIVE_INCLUDES' --with-sanitizers=thread"
|
||||
export BITCOIN_CONFIG="--enable-zmq CPPFLAGS='-DARENA_DEBUG -DDEBUG_LOCKORDER -DDEBUG_LOCKCONTENTION' CXXFLAGS='-g' --with-sanitizers=thread"
|
||||
|
||||
@@ -6,11 +6,12 @@
|
||||
|
||||
export LC_ALL=C.UTF-8
|
||||
|
||||
export CI_IMAGE_NAME_TAG="docker.io/ubuntu:24.04"
|
||||
export CI_IMAGE_NAME_TAG="docker.io/debian:bookworm"
|
||||
export CONTAINER_NAME=ci_native_valgrind
|
||||
export PACKAGES="valgrind clang-16 llvm-16 libclang-rt-16-dev python3-zmq libevent-dev libboost-dev libdb5.3++-dev libminiupnpc-dev libnatpmp-dev libzmq3-dev libsqlite3-dev"
|
||||
export PACKAGES="valgrind clang llvm libclang-rt-dev python3-zmq libevent-dev libboost-dev libdb5.3++-dev libminiupnpc-dev libnatpmp-dev libzmq3-dev libsqlite3-dev"
|
||||
export USE_VALGRIND=1
|
||||
export NO_DEPENDS=1
|
||||
export TEST_RUNNER_EXTRA="--exclude feature_init,rpc_bind,feature_bind_extra" # feature_init excluded for now, see https://github.com/bitcoin/bitcoin/issues/30011 ; bind tests excluded for now, see https://github.com/bitcoin/bitcoin/issues/17765#issuecomment-602068547
|
||||
export TEST_RUNNER_EXTRA="--exclude feature_init,rpc_bind,feature_bind_extra" # Excluded for now, see https://github.com/bitcoin/bitcoin/issues/17765#issuecomment-602068547
|
||||
export GOAL="install"
|
||||
export BITCOIN_CONFIG="--enable-zmq --with-incompatible-bdb --with-gui=no CC=clang-16 CXX=clang++-16" # TODO enable GUI
|
||||
# Temporarily pin dwarf 4, until using Valgrind 3.20 or later
|
||||
export BITCOIN_CONFIG="--enable-zmq --with-incompatible-bdb --with-gui=no CC=clang CXX=clang++ CFLAGS=-gdwarf-4 CXXFLAGS=-gdwarf-4" # TODO enable GUI
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
export LC_ALL=C.UTF-8
|
||||
|
||||
export CONTAINER_NAME=ci_win64
|
||||
export CI_IMAGE_NAME_TAG="docker.io/amd64/debian:bookworm" # Check that https://packages.debian.org/bookworm/g++-mingw-w64-x86-64-posix (version 12.2, similar to guix) can cross-compile
|
||||
export CI_IMAGE_NAME_TAG="docker.io/amd64/ubuntu:22.04" # Check that Jammy can cross-compile to win64
|
||||
export HOST=x86_64-w64-mingw32
|
||||
export DPKG_ADD_ARCH="i386"
|
||||
export PACKAGES="nsis g++-mingw-w64-x86-64-posix wine-binfmt wine64 wine32 file"
|
||||
@@ -16,4 +16,4 @@ export GOAL="deploy"
|
||||
# Prior to 11.0.0, the mingw-w64 headers were missing noreturn attributes, causing warnings when
|
||||
# cross-compiling for Windows. https://sourceforge.net/p/mingw-w64/bugs/306/
|
||||
# https://github.com/mingw-w64/mingw-w64/commit/1690994f515910a31b9fb7c7bd3a52d4ba987abe
|
||||
export BITCOIN_CONFIG="--enable-reduce-exports --disable-gui-tests CXXFLAGS='-Wno-return-type -Wno-error=maybe-uninitialized -Wno-error=array-bounds'"
|
||||
export BITCOIN_CONFIG="--enable-reduce-exports --disable-gui-tests CXXFLAGS=-Wno-return-type"
|
||||
|
||||
@@ -36,7 +36,7 @@ if [ -n "$PIP_PACKAGES" ]; then
|
||||
fi
|
||||
|
||||
if [[ ${USE_MEMORY_SANITIZER} == "true" ]]; then
|
||||
${CI_RETRY_EXE} git clone --depth=1 https://github.com/llvm/llvm-project -b "llvmorg-18.1.3" /msan/llvm-project
|
||||
${CI_RETRY_EXE} git clone --depth=1 https://github.com/llvm/llvm-project -b "llvmorg-18.1.1" /msan/llvm-project
|
||||
|
||||
cmake -G Ninja -B /msan/clang_build/ \
|
||||
-DLLVM_ENABLE_PROJECTS="clang" \
|
||||
@@ -65,10 +65,6 @@ if [[ ${USE_MEMORY_SANITIZER} == "true" ]]; then
|
||||
-S /msan/llvm-project/runtimes
|
||||
|
||||
ninja -C /msan/cxx_build/ "-j$( nproc )" # Use nproc, because MAKEJOBS is the default in docker image builds
|
||||
|
||||
# Clear no longer needed source folder
|
||||
du -sh /msan/llvm-project
|
||||
rm -rf /msan/llvm-project
|
||||
fi
|
||||
|
||||
if [[ "${RUN_TIDY}" == "true" ]]; then
|
||||
@@ -90,4 +86,14 @@ if [ -n "$XCODE_VERSION" ] && [ ! -d "${DEPENDS_DIR}/SDKs/${OSX_SDK_BASENAME}" ]
|
||||
tar -C "${DEPENDS_DIR}/SDKs" -xf "$OSX_SDK_PATH"
|
||||
fi
|
||||
|
||||
if [ -n "$ANDROID_HOME" ] && [ ! -d "$ANDROID_HOME" ]; then
|
||||
ANDROID_TOOLS_PATH=${DEPENDS_DIR}/sdk-sources/android-tools.zip
|
||||
if [ ! -f "$ANDROID_TOOLS_PATH" ]; then
|
||||
${CI_RETRY_EXE} curl --location --fail "${ANDROID_TOOLS_URL}" -o "$ANDROID_TOOLS_PATH"
|
||||
fi
|
||||
mkdir -p "$ANDROID_HOME"
|
||||
unzip -o "$ANDROID_TOOLS_PATH" -d "$ANDROID_HOME"
|
||||
yes | "${ANDROID_HOME}"/cmdline-tools/bin/sdkmanager --sdk_root="${ANDROID_HOME}" --install "build-tools;${ANDROID_BUILD_TOOLS_VERSION}" "platform-tools" "platforms;android-31" "platforms;android-${ANDROID_API_LEVEL}" "ndk;${ANDROID_NDK_VERSION}"
|
||||
fi
|
||||
|
||||
git config --global ${CFG_DONE} "true"
|
||||
|
||||
@@ -28,26 +28,9 @@ if [ -z "$DANGER_RUN_CI_ON_HOST" ]; then
|
||||
docker volume create "${CONTAINER_NAME}_ccache" || true
|
||||
docker volume create "${CONTAINER_NAME}_depends" || true
|
||||
docker volume create "${CONTAINER_NAME}_depends_sources" || true
|
||||
docker volume create "${CONTAINER_NAME}_depends_SDKs_android" || true
|
||||
docker volume create "${CONTAINER_NAME}_previous_releases" || true
|
||||
|
||||
CI_CCACHE_MOUNT="type=volume,src=${CONTAINER_NAME}_ccache,dst=$CCACHE_DIR"
|
||||
CI_DEPENDS_MOUNT="type=volume,src=${CONTAINER_NAME}_depends,dst=$DEPENDS_DIR/built"
|
||||
CI_DEPENDS_SOURCES_MOUNT="type=volume,src=${CONTAINER_NAME}_depends_sources,dst=$DEPENDS_DIR/sources"
|
||||
CI_PREVIOUS_RELEASES_MOUNT="type=volume,src=${CONTAINER_NAME}_previous_releases,dst=$PREVIOUS_RELEASES_DIR"
|
||||
|
||||
if [ "$DANGER_CI_ON_HOST_CACHE_FOLDERS" ]; then
|
||||
# ensure the directories exist
|
||||
mkdir -p "${CCACHE_DIR}"
|
||||
mkdir -p "${DEPENDS_DIR}/built"
|
||||
mkdir -p "${DEPENDS_DIR}/sources"
|
||||
mkdir -p "${PREVIOUS_RELEASES_DIR}"
|
||||
|
||||
CI_CCACHE_MOUNT="type=bind,src=${CCACHE_DIR},dst=$CCACHE_DIR"
|
||||
CI_DEPENDS_MOUNT="type=bind,src=${DEPENDS_DIR}/built,dst=$DEPENDS_DIR/built"
|
||||
CI_DEPENDS_SOURCES_MOUNT="type=bind,src=${DEPENDS_DIR}/sources,dst=$DEPENDS_DIR/sources"
|
||||
CI_PREVIOUS_RELEASES_MOUNT="type=bind,src=${PREVIOUS_RELEASES_DIR},dst=$PREVIOUS_RELEASES_DIR"
|
||||
fi
|
||||
|
||||
docker network create --ipv6 --subnet 1111:1111::/112 ci-ip6net || true
|
||||
|
||||
if [ -n "${RESTART_CI_DOCKER_BEFORE_RUN}" ] ; then
|
||||
@@ -70,10 +53,11 @@ if [ -z "$DANGER_RUN_CI_ON_HOST" ]; then
|
||||
# shellcheck disable=SC2086
|
||||
CI_CONTAINER_ID=$(docker run --cap-add LINUX_IMMUTABLE $CI_CONTAINER_CAP --rm --interactive --detach --tty \
|
||||
--mount "type=bind,src=$BASE_READ_ONLY_DIR,dst=$BASE_READ_ONLY_DIR,readonly" \
|
||||
--mount "${CI_CCACHE_MOUNT}" \
|
||||
--mount "${CI_DEPENDS_MOUNT}" \
|
||||
--mount "${CI_DEPENDS_SOURCES_MOUNT}" \
|
||||
--mount "${CI_PREVIOUS_RELEASES_MOUNT}" \
|
||||
--mount "type=volume,src=${CONTAINER_NAME}_ccache,dst=$CCACHE_DIR" \
|
||||
--mount "type=volume,src=${CONTAINER_NAME}_depends,dst=$DEPENDS_DIR/built" \
|
||||
--mount "type=volume,src=${CONTAINER_NAME}_depends_sources,dst=$DEPENDS_DIR/sources" \
|
||||
--mount "type=volume,src=${CONTAINER_NAME}_depends_SDKs_android,dst=$DEPENDS_DIR/SDKs/android" \
|
||||
--mount "type=volume,src=${CONTAINER_NAME}_previous_releases,dst=$PREVIOUS_RELEASES_DIR" \
|
||||
--env-file /tmp/env-$USER-$CONTAINER_NAME \
|
||||
--name "$CONTAINER_NAME" \
|
||||
--network ci-ip6net \
|
||||
|
||||
@@ -8,7 +8,7 @@ export LC_ALL=C.UTF-8
|
||||
|
||||
set -ex
|
||||
|
||||
export ASAN_OPTIONS="detect_leaks=1:detect_stack_use_after_return=1:check_initialization_order=1:strict_init_order=1"
|
||||
export ASAN_OPTIONS="detect_stack_use_after_return=1:check_initialization_order=1:strict_init_order=1"
|
||||
export LSAN_OPTIONS="suppressions=${BASE_ROOT_DIR}/test/sanitizer_suppressions/lsan"
|
||||
export TSAN_OPTIONS="suppressions=${BASE_ROOT_DIR}/test/sanitizer_suppressions/tsan:halt_on_error=1"
|
||||
export UBSAN_OPTIONS="suppressions=${BASE_ROOT_DIR}/test/sanitizer_suppressions/ubsan:print_stacktrace=1:halt_on_error=1:report_error_type=1"
|
||||
@@ -110,7 +110,16 @@ fi
|
||||
ccache --zero-stats
|
||||
PRINT_CCACHE_STATISTICS="ccache --version | head -n 1 && ccache --show-stats"
|
||||
|
||||
BITCOIN_CONFIG_ALL="${BITCOIN_CONFIG_ALL} --enable-external-signer --prefix=$BASE_OUTDIR"
|
||||
if [ -n "$ANDROID_TOOLS_URL" ]; then
|
||||
make distclean || true
|
||||
./autogen.sh
|
||||
bash -c "./configure $BITCOIN_CONFIG_ALL $BITCOIN_CONFIG" || ( (cat config.log) && false)
|
||||
make "${MAKEJOBS}" && cd src/qt && ANDROID_HOME=${ANDROID_HOME} ANDROID_NDK_HOME=${ANDROID_NDK_HOME} make apk
|
||||
bash -c "${PRINT_CCACHE_STATISTICS}"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
BITCOIN_CONFIG_ALL="${BITCOIN_CONFIG_ALL} --prefix=$BASE_OUTDIR"
|
||||
|
||||
if [ -n "$CONFIG_SHELL" ]; then
|
||||
"$CONFIG_SHELL" -c "./autogen.sh"
|
||||
@@ -171,11 +180,7 @@ if [ "${RUN_TIDY}" = "true" ]; then
|
||||
|
||||
set -eo pipefail
|
||||
cd "${BASE_BUILD_DIR}/bitcoin-$HOST/src/"
|
||||
if ! ( run-clang-tidy-"${TIDY_LLVM_V}" -quiet -load="/tidy-build/libbitcoin-tidy.so" "${MAKEJOBS}" | tee tmp.tidy-out.txt ); then
|
||||
grep -C5 "error: " tmp.tidy-out.txt
|
||||
echo "^^^ ⚠️ Failure generated from clang-tidy"
|
||||
false
|
||||
fi
|
||||
( run-clang-tidy-"${TIDY_LLVM_V}" -quiet -load="/tidy-build/libbitcoin-tidy.so" "${MAKEJOBS}" ) | grep -C5 "error"
|
||||
# Filter out files by regex here, because regex may not be
|
||||
# accepted in src/.bear-tidy-config
|
||||
# Filter out:
|
||||
|
||||
366
configure.ac
366
configure.ac
@@ -1,8 +1,8 @@
|
||||
AC_PREREQ([2.69])
|
||||
define(_CLIENT_VERSION_MAJOR, 28)
|
||||
define(_CLIENT_VERSION_MINOR, 0)
|
||||
define(_CLIENT_VERSION_MAJOR, 27)
|
||||
define(_CLIENT_VERSION_MINOR, 2)
|
||||
define(_CLIENT_VERSION_BUILD, 0)
|
||||
define(_CLIENT_VERSION_RC, 1)
|
||||
define(_CLIENT_VERSION_RC, 0)
|
||||
define(_CLIENT_VERSION_IS_RELEASE, true)
|
||||
define(_COPYRIGHT_YEAR, 2024)
|
||||
define(_COPYRIGHT_HOLDERS,[The %s developers])
|
||||
@@ -125,7 +125,6 @@ AC_PATH_PROG([GIT], [git])
|
||||
AC_PATH_PROG([CCACHE], [ccache])
|
||||
AC_PATH_PROG([XGETTEXT], [xgettext])
|
||||
AC_PATH_PROG([HEXDUMP], [hexdump])
|
||||
AC_PATH_TOOL([OBJDUMP], [objdump])
|
||||
AC_PATH_TOOL([OBJCOPY], [objcopy])
|
||||
AC_PATH_PROG([DOXYGEN], [doxygen])
|
||||
AM_CONDITIONAL([HAVE_DOXYGEN], [test -n "$DOXYGEN"])
|
||||
@@ -206,9 +205,9 @@ AC_ARG_WITH([qrencode],
|
||||
|
||||
AC_ARG_ENABLE([hardening],
|
||||
[AS_HELP_STRING([--disable-hardening],
|
||||
[do not attempt to harden the resulting executables (default is to harden)])],
|
||||
[do not attempt to harden the resulting executables (default is to harden when possible)])],
|
||||
[use_hardening=$enableval],
|
||||
[use_hardening=yes])
|
||||
[use_hardening=auto])
|
||||
|
||||
AC_ARG_ENABLE([reduce-exports],
|
||||
[AS_HELP_STRING([--enable-reduce-exports],
|
||||
@@ -238,6 +237,18 @@ AC_ARG_ENABLE([lcov],
|
||||
[use_lcov=$enableval],
|
||||
[use_lcov=no])
|
||||
|
||||
AC_ARG_ENABLE([lcov-branch-coverage],
|
||||
[AS_HELP_STRING([--enable-lcov-branch-coverage],
|
||||
[enable lcov testing branch coverage (default is no)])],
|
||||
[use_lcov_branch=yes],
|
||||
[use_lcov_branch=no])
|
||||
|
||||
AC_ARG_ENABLE([threadlocal],
|
||||
[AS_HELP_STRING([--enable-threadlocal],
|
||||
[enable features that depend on the c++ thread_local keyword (currently just thread names in debug logs). (default is to enable if there is platform support)])],
|
||||
[use_thread_local=$enableval],
|
||||
[use_thread_local=auto])
|
||||
|
||||
AC_ARG_ENABLE([zmq],
|
||||
[AS_HELP_STRING([--disable-zmq],
|
||||
[disable ZMQ notifications])],
|
||||
@@ -281,6 +292,13 @@ AC_ARG_WITH([sanitizers],
|
||||
[comma separated list of extra sanitizers to build with (default is none enabled)])],
|
||||
[use_sanitizers=$withval])
|
||||
|
||||
dnl Enable gprof profiling
|
||||
AC_ARG_ENABLE([gprof],
|
||||
[AS_HELP_STRING([--enable-gprof],
|
||||
[use gprof profiling compiler flags (default is no)])],
|
||||
[enable_gprof=$enableval],
|
||||
[enable_gprof=no])
|
||||
|
||||
dnl Turn warnings into errors
|
||||
AC_ARG_ENABLE([werror],
|
||||
[AS_HELP_STRING([--enable-werror],
|
||||
@@ -289,9 +307,9 @@ AC_ARG_ENABLE([werror],
|
||||
[enable_werror=no])
|
||||
|
||||
AC_ARG_ENABLE([external-signer],
|
||||
[AS_HELP_STRING([--enable-external-signer],[compile external signer support (default is yes)])],
|
||||
[AS_HELP_STRING([--enable-external-signer],[compile external signer support (default is auto, requires Boost::Process)])],
|
||||
[use_external_signer=$enableval],
|
||||
[use_external_signer=yes])
|
||||
[use_external_signer=auto])
|
||||
|
||||
AC_LANG_PUSH([C++])
|
||||
|
||||
@@ -383,34 +401,38 @@ if test "$enable_werror" = "yes"; then
|
||||
ERROR_CXXFLAGS=$CXXFLAG_WERROR
|
||||
fi
|
||||
|
||||
AX_CHECK_COMPILE_FLAG([-Wall], [WARN_CXXFLAGS="$WARN_CXXFLAGS -Wall"], [], [$CXXFLAG_WERROR])
|
||||
AX_CHECK_COMPILE_FLAG([-Wextra], [WARN_CXXFLAGS="$WARN_CXXFLAGS -Wextra"], [], [$CXXFLAG_WERROR])
|
||||
AX_CHECK_COMPILE_FLAG([-Wgnu], [WARN_CXXFLAGS="$WARN_CXXFLAGS -Wgnu"], [], [$CXXFLAG_WERROR])
|
||||
dnl some compilers will ignore -Wformat-security without -Wformat, so just combine the two here.
|
||||
AX_CHECK_COMPILE_FLAG([-Wformat -Wformat-security], [WARN_CXXFLAGS="$WARN_CXXFLAGS -Wformat -Wformat-security"], [], [$CXXFLAG_WERROR])
|
||||
AX_CHECK_COMPILE_FLAG([-Wvla], [WARN_CXXFLAGS="$WARN_CXXFLAGS -Wvla"], [], [$CXXFLAG_WERROR])
|
||||
AX_CHECK_COMPILE_FLAG([-Wshadow-field], [WARN_CXXFLAGS="$WARN_CXXFLAGS -Wshadow-field"], [], [$CXXFLAG_WERROR])
|
||||
AX_CHECK_COMPILE_FLAG([-Wthread-safety], [WARN_CXXFLAGS="$WARN_CXXFLAGS -Wthread-safety"], [], [$CXXFLAG_WERROR])
|
||||
AX_CHECK_COMPILE_FLAG([-Wloop-analysis], [WARN_CXXFLAGS="$WARN_CXXFLAGS -Wloop-analysis"], [], [$CXXFLAG_WERROR])
|
||||
AX_CHECK_COMPILE_FLAG([-Wredundant-decls], [WARN_CXXFLAGS="$WARN_CXXFLAGS -Wredundant-decls"], [], [$CXXFLAG_WERROR])
|
||||
AX_CHECK_COMPILE_FLAG([-Wunused-member-function], [WARN_CXXFLAGS="$WARN_CXXFLAGS -Wunused-member-function"], [], [$CXXFLAG_WERROR])
|
||||
AX_CHECK_COMPILE_FLAG([-Wdate-time], [WARN_CXXFLAGS="$WARN_CXXFLAGS -Wdate-time"], [], [$CXXFLAG_WERROR])
|
||||
AX_CHECK_COMPILE_FLAG([-Wconditional-uninitialized], [WARN_CXXFLAGS="$WARN_CXXFLAGS -Wconditional-uninitialized"], [], [$CXXFLAG_WERROR])
|
||||
AX_CHECK_COMPILE_FLAG([-Wduplicated-branches], [WARN_CXXFLAGS="$WARN_CXXFLAGS -Wduplicated-branches"], [], [$CXXFLAG_WERROR])
|
||||
AX_CHECK_COMPILE_FLAG([-Wduplicated-cond], [WARN_CXXFLAGS="$WARN_CXXFLAGS -Wduplicated-cond"], [], [$CXXFLAG_WERROR])
|
||||
AX_CHECK_COMPILE_FLAG([-Wlogical-op], [WARN_CXXFLAGS="$WARN_CXXFLAGS -Wlogical-op"], [], [$CXXFLAG_WERROR])
|
||||
AX_CHECK_COMPILE_FLAG([-Woverloaded-virtual], [WARN_CXXFLAGS="$WARN_CXXFLAGS -Woverloaded-virtual"], [], [$CXXFLAG_WERROR])
|
||||
AX_CHECK_COMPILE_FLAG([-Wsuggest-override], [WARN_CXXFLAGS="$WARN_CXXFLAGS -Wsuggest-override"], [], [$CXXFLAG_WERROR])
|
||||
AX_CHECK_COMPILE_FLAG([-Wimplicit-fallthrough], [WARN_CXXFLAGS="$WARN_CXXFLAGS -Wimplicit-fallthrough"], [], [$CXXFLAG_WERROR])
|
||||
AX_CHECK_COMPILE_FLAG([-Wunreachable-code], [WARN_CXXFLAGS="$WARN_CXXFLAGS -Wunreachable-code"], [], [$CXXFLAG_WERROR])
|
||||
AX_CHECK_COMPILE_FLAG([-Wdocumentation], [WARN_CXXFLAGS="$WARN_CXXFLAGS -Wdocumentation"], [], [$CXXFLAG_WERROR])
|
||||
AX_CHECK_COMPILE_FLAG([-Wself-assign], [WARN_CXXFLAGS="$WARN_CXXFLAGS -Wself-assign"], [], [$CXXFLAG_WERROR])
|
||||
AX_CHECK_COMPILE_FLAG([-Wundef], [WARN_CXXFLAGS="$WARN_CXXFLAGS -Wundef"], [], [$CXXFLAG_WERROR])
|
||||
if test "$CXXFLAGS_overridden" = "no"; then
|
||||
AX_CHECK_COMPILE_FLAG([-Wall], [WARN_CXXFLAGS="$WARN_CXXFLAGS -Wall"], [], [$CXXFLAG_WERROR])
|
||||
AX_CHECK_COMPILE_FLAG([-Wextra], [WARN_CXXFLAGS="$WARN_CXXFLAGS -Wextra"], [], [$CXXFLAG_WERROR])
|
||||
AX_CHECK_COMPILE_FLAG([-Wgnu], [WARN_CXXFLAGS="$WARN_CXXFLAGS -Wgnu"], [], [$CXXFLAG_WERROR])
|
||||
dnl some compilers will ignore -Wformat-security without -Wformat, so just combine the two here.
|
||||
AX_CHECK_COMPILE_FLAG([-Wformat -Wformat-security], [WARN_CXXFLAGS="$WARN_CXXFLAGS -Wformat -Wformat-security"], [], [$CXXFLAG_WERROR])
|
||||
AX_CHECK_COMPILE_FLAG([-Wvla], [WARN_CXXFLAGS="$WARN_CXXFLAGS -Wvla"], [], [$CXXFLAG_WERROR])
|
||||
AX_CHECK_COMPILE_FLAG([-Wshadow-field], [WARN_CXXFLAGS="$WARN_CXXFLAGS -Wshadow-field"], [], [$CXXFLAG_WERROR])
|
||||
AX_CHECK_COMPILE_FLAG([-Wthread-safety], [WARN_CXXFLAGS="$WARN_CXXFLAGS -Wthread-safety"], [], [$CXXFLAG_WERROR])
|
||||
AX_CHECK_COMPILE_FLAG([-Wloop-analysis], [WARN_CXXFLAGS="$WARN_CXXFLAGS -Wloop-analysis"], [], [$CXXFLAG_WERROR])
|
||||
AX_CHECK_COMPILE_FLAG([-Wredundant-decls], [WARN_CXXFLAGS="$WARN_CXXFLAGS -Wredundant-decls"], [], [$CXXFLAG_WERROR])
|
||||
AX_CHECK_COMPILE_FLAG([-Wunused-member-function], [WARN_CXXFLAGS="$WARN_CXXFLAGS -Wunused-member-function"], [], [$CXXFLAG_WERROR])
|
||||
AX_CHECK_COMPILE_FLAG([-Wdate-time], [WARN_CXXFLAGS="$WARN_CXXFLAGS -Wdate-time"], [], [$CXXFLAG_WERROR])
|
||||
AX_CHECK_COMPILE_FLAG([-Wconditional-uninitialized], [WARN_CXXFLAGS="$WARN_CXXFLAGS -Wconditional-uninitialized"], [], [$CXXFLAG_WERROR])
|
||||
AX_CHECK_COMPILE_FLAG([-Wduplicated-branches], [WARN_CXXFLAGS="$WARN_CXXFLAGS -Wduplicated-branches"], [], [$CXXFLAG_WERROR])
|
||||
AX_CHECK_COMPILE_FLAG([-Wduplicated-cond], [WARN_CXXFLAGS="$WARN_CXXFLAGS -Wduplicated-cond"], [], [$CXXFLAG_WERROR])
|
||||
AX_CHECK_COMPILE_FLAG([-Wlogical-op], [WARN_CXXFLAGS="$WARN_CXXFLAGS -Wlogical-op"], [], [$CXXFLAG_WERROR])
|
||||
AX_CHECK_COMPILE_FLAG([-Woverloaded-virtual], [WARN_CXXFLAGS="$WARN_CXXFLAGS -Woverloaded-virtual"], [], [$CXXFLAG_WERROR])
|
||||
AX_CHECK_COMPILE_FLAG([-Wsuggest-override], [WARN_CXXFLAGS="$WARN_CXXFLAGS -Wsuggest-override"], [], [$CXXFLAG_WERROR])
|
||||
AX_CHECK_COMPILE_FLAG([-Wimplicit-fallthrough], [WARN_CXXFLAGS="$WARN_CXXFLAGS -Wimplicit-fallthrough"], [], [$CXXFLAG_WERROR])
|
||||
AX_CHECK_COMPILE_FLAG([-Wunreachable-code], [WARN_CXXFLAGS="$WARN_CXXFLAGS -Wunreachable-code"], [], [$CXXFLAG_WERROR])
|
||||
AX_CHECK_COMPILE_FLAG([-Wdocumentation], [WARN_CXXFLAGS="$WARN_CXXFLAGS -Wdocumentation"], [], [$CXXFLAG_WERROR])
|
||||
|
||||
dnl Some compilers (gcc) ignore unknown -Wno-* options, but warn about all
|
||||
dnl unknown options if any other warning is produced. Test the -Wfoo case, and
|
||||
dnl set the -Wno-foo case if it works.
|
||||
AX_CHECK_COMPILE_FLAG([-Wunused-parameter], [NOWARN_CXXFLAGS="$NOWARN_CXXFLAGS -Wno-unused-parameter"], [], [$CXXFLAG_WERROR])
|
||||
dnl Some compilers (gcc) ignore unknown -Wno-* options, but warn about all
|
||||
dnl unknown options if any other warning is produced. Test the -Wfoo case, and
|
||||
dnl set the -Wno-foo case if it works.
|
||||
AX_CHECK_COMPILE_FLAG([-Wunused-parameter], [NOWARN_CXXFLAGS="$NOWARN_CXXFLAGS -Wno-unused-parameter"], [], [$CXXFLAG_WERROR])
|
||||
AX_CHECK_COMPILE_FLAG([-Wself-assign], [NOWARN_CXXFLAGS="$NOWARN_CXXFLAGS -Wno-self-assign"], [], [$CXXFLAG_WERROR])
|
||||
if test "$suppress_external_warnings" != "yes" ; then
|
||||
AX_CHECK_COMPILE_FLAG([-Wdeprecated-copy], [NOWARN_CXXFLAGS="$NOWARN_CXXFLAGS -Wno-deprecated-copy"], [], [$CXXFLAG_WERROR])
|
||||
fi
|
||||
fi
|
||||
|
||||
dnl Don't allow extended (non-ASCII) symbols in identifiers. This is easier for code review.
|
||||
AX_CHECK_COMPILE_FLAG([-fno-extended-identifiers], [CORE_CXXFLAGS="$CORE_CXXFLAGS -fno-extended-identifiers"], [], [$CXXFLAG_WERROR])
|
||||
@@ -482,12 +504,11 @@ TEMP_CXXFLAGS="$CXXFLAGS"
|
||||
CXXFLAGS="$SSE41_CXXFLAGS $CXXFLAGS"
|
||||
AC_MSG_CHECKING([for SSE4.1 intrinsics])
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
|
||||
#include <stdint.h>
|
||||
#include <immintrin.h>
|
||||
]],[[
|
||||
__m128i a = _mm_set1_epi32(0);
|
||||
__m128i b = _mm_set1_epi32(1);
|
||||
__m128i r = _mm_blend_epi16(a, b, 0xFF);
|
||||
return _mm_extract_epi32(r, 3);
|
||||
__m128i l = _mm_set1_epi32(0);
|
||||
return _mm_extract_epi32(l, 3);
|
||||
]])],
|
||||
[ AC_MSG_RESULT([yes]); enable_sse41=yes; AC_DEFINE([ENABLE_SSE41], [1], [Define this symbol to build code that uses SSE4.1 intrinsics]) ],
|
||||
[ AC_MSG_RESULT([no])]
|
||||
@@ -605,9 +626,15 @@ AC_ARG_ENABLE([experimental-util-chainstate],
|
||||
[build_bitcoin_chainstate=$enableval],
|
||||
[build_bitcoin_chainstate=no])
|
||||
|
||||
AC_ARG_WITH([libs],
|
||||
[AS_HELP_STRING([--with-libs],
|
||||
[build libraries (default=yes)])],
|
||||
[build_bitcoin_libs=$withval],
|
||||
[build_bitcoin_libs=yes])
|
||||
|
||||
AC_ARG_WITH([experimental-kernel-lib],
|
||||
[AS_HELP_STRING([--with-experimental-kernel-lib],
|
||||
[build experimental bitcoinkernel library (default is to build if we're building the experimental build-chainstate executable)])],
|
||||
[build experimental bitcoinkernel library (default is to build if we're building libraries and the experimental build-chainstate executable)])],
|
||||
[build_experimental_kernel_lib=$withval],
|
||||
[build_experimental_kernel_lib=auto])
|
||||
|
||||
@@ -675,9 +702,6 @@ case $host in
|
||||
TARGET_OS=darwin
|
||||
if test $cross_compiling != "yes"; then
|
||||
BUILD_OS=darwin
|
||||
|
||||
AX_CHECK_LINK_FLAG([-Wl,-headerpad_max_install_names], [CORE_LDFLAGS="$CORE_LDFLAGS -Wl,-headerpad_max_install_names"], [], [$LDFLAG_WERROR])
|
||||
|
||||
AC_CHECK_PROG([BREW], [brew], [brew])
|
||||
if test "$BREW" = "brew"; then
|
||||
dnl These Homebrew packages may be keg-only, meaning that they won't be found
|
||||
@@ -741,6 +765,8 @@ case $host in
|
||||
;;
|
||||
*)
|
||||
AC_PATH_TOOL([DSYMUTIL], [dsymutil], [dsymutil])
|
||||
AC_PATH_TOOL([INSTALL_NAME_TOOL], [install_name_tool], [install_name_tool])
|
||||
AC_PATH_TOOL([OTOOL], [otool], [otool])
|
||||
AC_PATH_PROG([ZIP], [zip], [zip])
|
||||
|
||||
dnl libtool will try to strip the static lib, which is a problem for
|
||||
@@ -752,11 +778,25 @@ case $host in
|
||||
esac
|
||||
fi
|
||||
|
||||
AX_CHECK_LINK_FLAG([-Wl,-headerpad_max_install_names], [CORE_LDFLAGS="$CORE_LDFLAGS -Wl,-headerpad_max_install_names"], [], [$LDFLAG_WERROR])
|
||||
CORE_CPPFLAGS="$CORE_CPPFLAGS -DMAC_OSX -DOBJC_OLD_DISPATCH_PROTOTYPES=0"
|
||||
|
||||
dnl ignore deprecated-declarations warnings coming from objcxx code
|
||||
dnl "'NSUserNotificationCenter' is deprecated: first deprecated in macOS 11.0".
|
||||
OBJCXXFLAGS="$CXXFLAGS -Wno-deprecated-declarations"
|
||||
OBJCXXFLAGS="$CXXFLAGS"
|
||||
;;
|
||||
*android*)
|
||||
dnl make sure android stays above linux for hosts like *linux-android*
|
||||
TARGET_OS=android
|
||||
case $host in
|
||||
*x86_64*)
|
||||
ANDROID_ARCH=x86_64
|
||||
;;
|
||||
*aarch64*)
|
||||
ANDROID_ARCH=arm64-v8a
|
||||
;;
|
||||
*armv7a*)
|
||||
ANDROID_ARCH=armeabi-v7a
|
||||
;;
|
||||
*) AC_MSG_ERROR([Could not determine Android arch, or it is unsupported]) ;;
|
||||
esac
|
||||
;;
|
||||
*linux*)
|
||||
TARGET_OS=linux
|
||||
@@ -807,8 +847,10 @@ if test "$use_lcov" = "yes"; then
|
||||
AX_CHECK_COMPILE_FLAG([--coverage],[CORE_CXXFLAGS="$CORE_CXXFLAGS --coverage"],
|
||||
[AC_MSG_ERROR([lcov testing requested but --coverage flag does not work])])
|
||||
CORE_CXXFLAGS="$CORE_CXXFLAGS -Og"
|
||||
fi
|
||||
|
||||
AC_SUBST(LCOV_OPTS)
|
||||
if test "$use_lcov_branch" != "no"; then
|
||||
AC_SUBST(LCOV_OPTS, "$LCOV_OPTS --rc lcov_branch_coverage=1")
|
||||
fi
|
||||
|
||||
dnl Check for endianness
|
||||
@@ -839,12 +881,30 @@ if test "$ac_cv_sys_large_files" != "" &&
|
||||
CORE_CPPFLAGS="$CORE_CPPFLAGS -D_LARGE_FILES=$ac_cv_sys_large_files"
|
||||
fi
|
||||
|
||||
if test "$enable_gprof" = "yes"; then
|
||||
dnl -pg is incompatible with -pie. Since hardening and profiling together doesn't make sense,
|
||||
dnl we simply make them mutually exclusive here. Additionally, hardened toolchains may force
|
||||
dnl -pie by default, in which case it needs to be turned off with -no-pie.
|
||||
|
||||
if test "$use_hardening" = "yes"; then
|
||||
AC_MSG_ERROR([gprof profiling is not compatible with hardening. Reconfigure with --disable-hardening or --disable-gprof])
|
||||
fi
|
||||
use_hardening=no
|
||||
AX_CHECK_COMPILE_FLAG([-pg],[GPROF_CXXFLAGS="-pg"],
|
||||
[AC_MSG_ERROR([gprof profiling requested but not available])], [$CXXFLAG_WERROR])
|
||||
|
||||
AX_CHECK_LINK_FLAG([-no-pie], [GPROF_LDFLAGS="-no-pie"])
|
||||
AX_CHECK_LINK_FLAG([-pg], [GPROF_LDFLAGS="$GPROF_LDFLAGS -pg"],
|
||||
[AC_MSG_ERROR([gprof profiling requested but not available])], [$GPROF_LDFLAGS])
|
||||
fi
|
||||
|
||||
if test "$TARGET_OS" != "windows"; then
|
||||
dnl All windows code is PIC, forcing it on just adds useless compile warnings
|
||||
AX_CHECK_COMPILE_FLAG([-fPIC], [PIC_FLAGS="-fPIC"])
|
||||
fi
|
||||
|
||||
if test "$use_hardening" != "no"; then
|
||||
use_hardening=yes
|
||||
AX_CHECK_COMPILE_FLAG([-Wstack-protector], [HARDENED_CXXFLAGS="$HARDENED_CXXFLAGS -Wstack-protector"])
|
||||
AX_CHECK_COMPILE_FLAG([-fstack-protector-all], [HARDENED_CXXFLAGS="$HARDENED_CXXFLAGS -fstack-protector-all"])
|
||||
|
||||
@@ -898,7 +958,7 @@ if test "$TARGET_OS" = "darwin"; then
|
||||
AX_CHECK_LINK_FLAG([-Wl,-fixup_chains], [HARDENED_LDFLAGS="$HARDENED_LDFLAGS -Wl,-fixup_chains"], [], [$LDFLAG_WERROR])
|
||||
fi
|
||||
|
||||
AC_CHECK_HEADERS([sys/select.h sys/prctl.h vm/vm_param.h sys/vmmeter.h sys/resources.h])
|
||||
AC_CHECK_HEADERS([sys/select.h sys/prctl.h sys/sysctl.h vm/vm_param.h sys/vmmeter.h sys/resources.h])
|
||||
|
||||
AC_CHECK_DECLS([getifaddrs, freeifaddrs],[CHECK_SOCKET],,
|
||||
[#include <sys/types.h>
|
||||
@@ -911,6 +971,24 @@ AC_CHECK_DECLS([setsid])
|
||||
|
||||
AC_CHECK_DECLS([pipe2])
|
||||
|
||||
AC_CHECK_FUNCS([timingsafe_bcmp])
|
||||
|
||||
AC_MSG_CHECKING([for __builtin_clzl])
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[
|
||||
(void) __builtin_clzl(0);
|
||||
]])],
|
||||
[ AC_MSG_RESULT([yes]); have_clzl=yes; AC_DEFINE([HAVE_BUILTIN_CLZL], [1], [Define this symbol if you have __builtin_clzl])],
|
||||
[ AC_MSG_RESULT([no]); have_clzl=no;]
|
||||
)
|
||||
|
||||
AC_MSG_CHECKING([for __builtin_clzll])
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[
|
||||
(void) __builtin_clzll(0);
|
||||
]])],
|
||||
[ AC_MSG_RESULT([yes]); have_clzll=yes; AC_DEFINE([HAVE_BUILTIN_CLZLL], [1], [Define this symbol if you have __builtin_clzll])],
|
||||
[ AC_MSG_RESULT([no]); have_clzll=no;]
|
||||
)
|
||||
|
||||
dnl Check for malloc_info (for memory statistics information in getmemoryinfo)
|
||||
AC_MSG_CHECKING([for getmemoryinfo])
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <malloc.h>]],
|
||||
@@ -943,6 +1021,90 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
|
||||
[ AC_MSG_RESULT([no])]
|
||||
)
|
||||
|
||||
AC_MSG_CHECKING([for default visibility attribute])
|
||||
AC_COMPILE_IFELSE([AC_LANG_SOURCE([
|
||||
int foo(void) __attribute__((visibility("default")));
|
||||
int main(){}
|
||||
])],
|
||||
[
|
||||
AC_DEFINE([HAVE_DEFAULT_VISIBILITY_ATTRIBUTE], [1], [Define if the visibility attribute is supported.])
|
||||
AC_MSG_RESULT([yes])
|
||||
],
|
||||
[
|
||||
AC_MSG_RESULT([no])
|
||||
if test "$use_reduce_exports" = "yes"; then
|
||||
AC_MSG_ERROR([Cannot find a working visibility attribute. Use --disable-reduce-exports.])
|
||||
fi
|
||||
]
|
||||
)
|
||||
|
||||
AC_MSG_CHECKING([for dllexport attribute])
|
||||
AC_COMPILE_IFELSE([AC_LANG_SOURCE([
|
||||
__declspec(dllexport) int foo(void);
|
||||
int main(){}
|
||||
])],
|
||||
[
|
||||
AC_DEFINE([HAVE_DLLEXPORT_ATTRIBUTE], [1], [Define if the dllexport attribute is supported.])
|
||||
AC_MSG_RESULT([yes])
|
||||
],
|
||||
[AC_MSG_RESULT([no])]
|
||||
)
|
||||
|
||||
if test "$use_thread_local" = "yes" || test "$use_thread_local" = "auto"; then
|
||||
TEMP_LDFLAGS="$LDFLAGS"
|
||||
LDFLAGS="$TEMP_LDFLAGS $PTHREAD_CFLAGS"
|
||||
AC_MSG_CHECKING([for thread_local support])
|
||||
AC_LINK_IFELSE([AC_LANG_SOURCE([
|
||||
#include <thread>
|
||||
static thread_local int foo = 0;
|
||||
static void run_thread() { foo++;}
|
||||
int main(){
|
||||
for(int i = 0; i < 10; i++) { std::thread(run_thread).detach();}
|
||||
return foo;
|
||||
}
|
||||
])],
|
||||
[
|
||||
case $host in
|
||||
*mingw*)
|
||||
dnl mingw32's implementation of thread_local has also been shown to behave
|
||||
dnl erroneously under concurrent usage; see:
|
||||
dnl https://gist.github.com/jamesob/fe9a872051a88b2025b1aa37bfa98605
|
||||
AC_MSG_RESULT([no])
|
||||
;;
|
||||
*freebsd*)
|
||||
dnl FreeBSD's implementation of thread_local is also buggy (per
|
||||
dnl https://groups.google.com/d/msg/bsdmailinglist/22ncTZAbDp4/Dii_pII5AwAJ)
|
||||
AC_MSG_RESULT([no])
|
||||
;;
|
||||
*)
|
||||
AC_DEFINE([HAVE_THREAD_LOCAL], [1], [Define if thread_local is supported.])
|
||||
AC_MSG_RESULT([yes])
|
||||
;;
|
||||
esac
|
||||
],
|
||||
[
|
||||
AC_MSG_RESULT([no])
|
||||
]
|
||||
)
|
||||
LDFLAGS="$TEMP_LDFLAGS"
|
||||
fi
|
||||
|
||||
dnl check for gmtime_r(), fallback to gmtime_s() if that is unavailable
|
||||
dnl fail if neither are available.
|
||||
AC_MSG_CHECKING([for gmtime_r])
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <ctime>]],
|
||||
[[ gmtime_r((const time_t *) nullptr, (struct tm *) nullptr); ]])],
|
||||
[ AC_MSG_RESULT([yes]); AC_DEFINE([HAVE_GMTIME_R], [1], [Define this symbol if gmtime_r is available]) ],
|
||||
[ AC_MSG_RESULT([no]);
|
||||
AC_MSG_CHECKING([for gmtime_s]);
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <ctime>]],
|
||||
[[ gmtime_s((struct tm *) nullptr, (const time_t *) nullptr); ]])],
|
||||
[ AC_MSG_RESULT([yes])],
|
||||
[ AC_MSG_RESULT([no]); AC_MSG_ERROR([Both gmtime_r and gmtime_s are unavailable]) ]
|
||||
)
|
||||
]
|
||||
)
|
||||
|
||||
dnl Check for different ways of gathering OS randomness
|
||||
AC_MSG_CHECKING([for Linux getrandom function])
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
|
||||
@@ -1033,23 +1195,10 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
|
||||
]], [[
|
||||
getauxval(AT_HWCAP);
|
||||
]])],
|
||||
[ AC_MSG_RESULT([yes]); HAVE_STRONG_GETAUXVAL=1; AC_DEFINE([HAVE_STRONG_GETAUXVAL], [1], [Define this symbol to build code that uses getauxval]) ],
|
||||
[ AC_MSG_RESULT([yes]); HAVE_STRONG_GETAUXVAL=1; AC_DEFINE([HAVE_STRONG_GETAUXVAL], [1], [Define this symbol to build code that uses getauxval)]) ],
|
||||
[ AC_MSG_RESULT([no]); HAVE_STRONG_GETAUXVAL=0 ]
|
||||
)
|
||||
|
||||
# Check for UNIX sockets
|
||||
AC_MSG_CHECKING(for sockaddr_un)
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
|
||||
#include <sys/socket.h>
|
||||
#include <sys/un.h>
|
||||
]], [[
|
||||
struct sockaddr_un addr;
|
||||
addr.sun_family = AF_UNIX;
|
||||
]])],
|
||||
[ AC_MSG_RESULT([yes]); AC_DEFINE([HAVE_SOCKADDR_UN], [1], [Define this symbol if platform supports unix domain sockets]) ],
|
||||
[ AC_MSG_RESULT([no]); ]
|
||||
)
|
||||
|
||||
have_any_system=no
|
||||
AC_MSG_CHECKING([for std::system])
|
||||
AC_LINK_IFELSE(
|
||||
@@ -1097,6 +1246,7 @@ if test "$enable_fuzz" = "yes"; then
|
||||
build_bitcoin_chainstate=no
|
||||
build_bitcoin_wallet=no
|
||||
build_bitcoind=no
|
||||
build_bitcoin_libs=no
|
||||
bitcoin_enable_qt=no
|
||||
bitcoin_enable_qt_test=no
|
||||
bitcoin_enable_qt_dbus=no
|
||||
@@ -1255,7 +1405,7 @@ if test "$use_boost" = "yes"; then
|
||||
dnl Check for Boost headers
|
||||
AX_BOOST_BASE([1.73.0],[],[AC_MSG_ERROR([Boost is not available!])])
|
||||
if test "$want_boost" = "no"; then
|
||||
AC_MSG_ERROR([Boost is required])
|
||||
AC_MSG_ERROR([only libbitcoinconsensus can be built without Boost])
|
||||
fi
|
||||
|
||||
dnl we don't use multi_index serialization
|
||||
@@ -1273,14 +1423,56 @@ if test "$use_boost" = "yes"; then
|
||||
fi
|
||||
fi
|
||||
|
||||
case $host in
|
||||
dnl Re-enable it after enabling Windows support in cpp-subprocess.
|
||||
*mingw*)
|
||||
use_external_signer="no"
|
||||
;;
|
||||
esac
|
||||
if test "$use_external_signer" = "yes"; then
|
||||
AC_DEFINE([ENABLE_EXTERNAL_SIGNER], [1], [Define if external signer support is enabled])
|
||||
if test "$use_external_signer" != "no"; then
|
||||
AC_MSG_CHECKING([whether Boost.Process can be used])
|
||||
TEMP_CXXFLAGS="$CXXFLAGS"
|
||||
dnl Boost 1.78 requires the following workaround.
|
||||
dnl See: https://github.com/boostorg/process/issues/235
|
||||
CXXFLAGS="$CXXFLAGS -Wno-error=narrowing"
|
||||
TEMP_CPPFLAGS="$CPPFLAGS"
|
||||
CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
|
||||
TEMP_LDFLAGS="$LDFLAGS"
|
||||
dnl Boost 1.73 and older require the following workaround.
|
||||
LDFLAGS="$LDFLAGS $PTHREAD_CFLAGS"
|
||||
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
|
||||
#define BOOST_PROCESS_USE_STD_FS
|
||||
#include <boost/process.hpp>
|
||||
]],[[
|
||||
namespace bp = boost::process;
|
||||
bp::opstream stdin_stream;
|
||||
bp::ipstream stdout_stream;
|
||||
bp::child c("dummy", bp::std_out > stdout_stream, bp::std_err > stdout_stream, bp::std_in < stdin_stream);
|
||||
stdin_stream << std::string{"test"} << std::endl;
|
||||
if (c.running()) c.terminate();
|
||||
c.wait();
|
||||
c.exit_code();
|
||||
]])],
|
||||
[have_boost_process="yes"],
|
||||
[have_boost_process="no"])
|
||||
LDFLAGS="$TEMP_LDFLAGS"
|
||||
CPPFLAGS="$TEMP_CPPFLAGS"
|
||||
CXXFLAGS="$TEMP_CXXFLAGS"
|
||||
AC_MSG_RESULT([$have_boost_process])
|
||||
if test "$have_boost_process" = "yes"; then
|
||||
case $host in
|
||||
dnl Boost Process for Windows uses Boost ASIO. Boost ASIO performs
|
||||
dnl pre-main init of Windows networking libraries, which we do not
|
||||
dnl want.
|
||||
*mingw*)
|
||||
use_external_signer="no"
|
||||
;;
|
||||
*)
|
||||
use_external_signer="yes"
|
||||
AC_DEFINE([ENABLE_EXTERNAL_SIGNER], [1], [Define if external signer support is enabled])
|
||||
AC_DEFINE([BOOST_PROCESS_USE_STD_FS], [1], [Defined to avoid Boost::Process trying to use Boost Filesystem])
|
||||
;;
|
||||
esac
|
||||
else
|
||||
if test "$use_external_signer" = "yes"; then
|
||||
AC_MSG_ERROR([External signing is not supported for this Boost version])
|
||||
fi
|
||||
use_external_signer="no";
|
||||
fi
|
||||
fi
|
||||
AM_CONDITIONAL([ENABLE_EXTERNAL_SIGNER], [test "$use_external_signer" = "yes"])
|
||||
|
||||
@@ -1289,7 +1481,6 @@ if test "$use_reduce_exports" = "yes"; then
|
||||
AX_CHECK_COMPILE_FLAG([-fvisibility=hidden], [CORE_CXXFLAGS="$CORE_CXXFLAGS -fvisibility=hidden"],
|
||||
[AC_MSG_ERROR([Cannot set hidden symbol visibility. Use --disable-reduce-exports.])], [$CXXFLAG_WERROR])
|
||||
AX_CHECK_LINK_FLAG([-Wl,--exclude-libs,ALL], [RELDFLAGS="-Wl,--exclude-libs,ALL"], [], [$LDFLAG_WERROR])
|
||||
AX_CHECK_LINK_FLAG([-Wl,-no_exported_symbols], [LIBTOOL_APP_LDFLAGS="$LIBTOOL_APP_LDFLAGS -Wl,-no_exported_symbols"], [], [$LDFLAG_WERROR])
|
||||
fi
|
||||
|
||||
if test "$use_tests" = "yes"; then
|
||||
@@ -1366,9 +1557,6 @@ if test "$with_libmultiprocess" = "yes" || test "$with_libmultiprocess" = "auto"
|
||||
PKG_CHECK_MODULES([LIBMULTIPROCESS], [libmultiprocess], [
|
||||
libmultiprocess_found=yes;
|
||||
libmultiprocess_prefix=`$PKG_CONFIG --variable=prefix libmultiprocess`;
|
||||
if test "$suppress_external_warnings" != "no" ; then
|
||||
LIBMULTIPROCESS_CFLAGS=SUPPRESS_WARNINGS($LIBMULTIPROCESS_CFLAGS)
|
||||
fi
|
||||
], [true])
|
||||
elif test "$with_libmultiprocess" != "no"; then
|
||||
AC_MSG_ERROR([--with-libmultiprocess=$with_libmultiprocess value is not yes, auto, or no])
|
||||
@@ -1431,8 +1619,18 @@ fi
|
||||
AM_CONDITIONAL([BUILD_BITCOIN_CHAINSTATE], [test $build_bitcoin_chainstate = "yes"])
|
||||
AC_MSG_RESULT($build_bitcoin_chainstate)
|
||||
|
||||
AC_MSG_CHECKING([whether to build libraries])
|
||||
AM_CONDITIONAL([BUILD_BITCOIN_LIBS], [test $build_bitcoin_libs = "yes"])
|
||||
|
||||
if test "$build_bitcoin_libs" = "yes"; then
|
||||
AC_DEFINE([HAVE_CONSENSUS_LIB], [1], [Define this symbol if the consensus lib has been built])
|
||||
AC_CONFIG_FILES([libbitcoinconsensus.pc:libbitcoinconsensus.pc.in])
|
||||
fi
|
||||
|
||||
AM_CONDITIONAL([BUILD_BITCOIN_KERNEL_LIB], [test "$build_experimental_kernel_lib" != "no" && ( test "$build_experimental_kernel_lib" = "yes" || test "$build_bitcoin_chainstate" = "yes" )])
|
||||
|
||||
AC_MSG_RESULT($build_bitcoin_libs)
|
||||
|
||||
AC_LANG_POP
|
||||
|
||||
if test "$use_ccache" != "no"; then
|
||||
@@ -1566,8 +1764,8 @@ else
|
||||
AC_MSG_RESULT([no])
|
||||
fi
|
||||
|
||||
if test "$build_bitcoin_wallet$build_bitcoin_cli$build_bitcoin_tx$build_bitcoin_util$build_bitcoind$bitcoin_enable_qt$enable_fuzz_binary$use_bench$use_tests" = "nonononononononono"; then
|
||||
AC_MSG_ERROR([No targets! Please specify at least one of: --with-utils --with-daemon --with-gui --enable-fuzz(-binary) --enable-bench or --enable-tests])
|
||||
if test "$build_bitcoin_wallet$build_bitcoin_cli$build_bitcoin_tx$build_bitcoin_util$build_bitcoin_libs$build_bitcoind$bitcoin_enable_qt$enable_fuzz_binary$use_bench$use_tests" = "nononononononononono"; then
|
||||
AC_MSG_ERROR([No targets! Please specify at least one of: --with-utils --with-libs --with-daemon --with-gui --enable-fuzz(-binary) --enable-bench or --enable-tests])
|
||||
fi
|
||||
|
||||
AM_CONDITIONAL([TARGET_DARWIN], [test "$TARGET_OS" = "darwin"])
|
||||
@@ -1585,6 +1783,7 @@ AM_CONDITIONAL([ENABLE_QT_TESTS], [test "$BUILD_TEST_QT" = "yes"])
|
||||
AM_CONDITIONAL([ENABLE_BENCH], [test "$use_bench" = "yes"])
|
||||
AM_CONDITIONAL([USE_QRCODE], [test "$use_qr" = "yes"])
|
||||
AM_CONDITIONAL([USE_LCOV], [test "$use_lcov" = "yes"])
|
||||
AM_CONDITIONAL([USE_LIBEVENT], [test "$use_libevent" = "yes"])
|
||||
AM_CONDITIONAL([HARDEN], [test "$use_hardening" = "yes"])
|
||||
AM_CONDITIONAL([ENABLE_SSE42], [test "$enable_sse42" = "yes"])
|
||||
AM_CONDITIONAL([ENABLE_SSE41], [test "$enable_sse41" = "yes"])
|
||||
@@ -1598,6 +1797,7 @@ AM_CONDITIONAL([USE_UPNP], [test "$use_upnp" = "yes"])
|
||||
|
||||
dnl for minisketch
|
||||
AM_CONDITIONAL([ENABLE_CLMUL], [test "$enable_clmul" = "yes"])
|
||||
AM_CONDITIONAL([HAVE_CLZ], [test "$have_clzl$have_clzll" = "yesyes"])
|
||||
|
||||
AC_DEFINE([CLIENT_VERSION_MAJOR], [_CLIENT_VERSION_MAJOR], [Major version])
|
||||
AC_DEFINE([CLIENT_VERSION_MINOR], [_CLIENT_VERSION_MINOR], [Minor version])
|
||||
@@ -1636,6 +1836,8 @@ AC_SUBST(WARN_CXXFLAGS)
|
||||
AC_SUBST(NOWARN_CXXFLAGS)
|
||||
AC_SUBST(DEBUG_CXXFLAGS)
|
||||
AC_SUBST(ERROR_CXXFLAGS)
|
||||
AC_SUBST(GPROF_CXXFLAGS)
|
||||
AC_SUBST(GPROF_LDFLAGS)
|
||||
AC_SUBST(HARDENED_CXXFLAGS)
|
||||
AC_SUBST(HARDENED_CPPFLAGS)
|
||||
AC_SUBST(HARDENED_LDFLAGS)
|
||||
@@ -1661,12 +1863,14 @@ AC_SUBST(MINIUPNPC_CPPFLAGS)
|
||||
AC_SUBST(MINIUPNPC_LIBS)
|
||||
AC_SUBST(NATPMP_CPPFLAGS)
|
||||
AC_SUBST(NATPMP_LIBS)
|
||||
AC_SUBST(HAVE_GMTIME_R)
|
||||
AC_SUBST(HAVE_FDATASYNC)
|
||||
AC_SUBST(HAVE_FULLFSYNC)
|
||||
AC_SUBST(HAVE_O_CLOEXEC)
|
||||
AC_SUBST(HAVE_BUILTIN_PREFETCH)
|
||||
AC_SUBST(HAVE_MM_PREFETCH)
|
||||
AC_SUBST(HAVE_STRONG_GETAUXVAL)
|
||||
AC_SUBST(ANDROID_ARCH)
|
||||
AC_SUBST(HAVE_EVHTTP_CONNECTION_GET_PEER_CONST_CHAR)
|
||||
AC_CONFIG_FILES([Makefile src/Makefile doc/man/Makefile share/setup.nsi share/qt/Info.plist test/config.ini])
|
||||
AC_CONFIG_FILES([contrib/devtools/split-debug.sh],[chmod +x contrib/devtools/split-debug.sh])
|
||||
@@ -1721,6 +1925,7 @@ echo
|
||||
echo "Options used to compile and link:"
|
||||
echo " external signer = $use_external_signer"
|
||||
echo " multiprocess = $build_multiprocess"
|
||||
echo " with libs = $build_bitcoin_libs"
|
||||
echo " with wallet = $enable_wallet"
|
||||
if test "$enable_wallet" != "no"; then
|
||||
echo " with sqlite = $use_sqlite"
|
||||
@@ -1743,6 +1948,7 @@ echo " with natpmp = $use_natpmp"
|
||||
echo " USDT tracing = $use_usdt"
|
||||
echo " sanitizers = $use_sanitizers"
|
||||
echo " debug enabled = $enable_debug"
|
||||
echo " gprof enabled = $enable_gprof"
|
||||
echo " werror = $enable_werror"
|
||||
echo
|
||||
echo " target os = $host_os"
|
||||
@@ -1752,8 +1958,8 @@ echo " CC = $CC"
|
||||
echo " CFLAGS = $PTHREAD_CFLAGS $SANITIZER_CFLAGS $CFLAGS"
|
||||
echo " CPPFLAGS = $DEBUG_CPPFLAGS $HARDENED_CPPFLAGS $CORE_CPPFLAGS $CPPFLAGS"
|
||||
echo " CXX = $CXX"
|
||||
echo " CXXFLAGS = $CORE_CXXFLAGS $DEBUG_CXXFLAGS $HARDENED_CXXFLAGS $WARN_CXXFLAGS $NOWARN_CXXFLAGS $ERROR_CXXFLAGS $SANITIZER_CXXFLAGS $CXXFLAGS"
|
||||
echo " LDFLAGS = $PTHREAD_LIBS $HARDENED_LDFLAGS $SANITIZER_LDFLAGS $CORE_LDFLAGS $LDFLAGS"
|
||||
echo " CXXFLAGS = $CORE_CXXFLAGS $DEBUG_CXXFLAGS $HARDENED_CXXFLAGS $WARN_CXXFLAGS $NOWARN_CXXFLAGS $ERROR_CXXFLAGS $GPROF_CXXFLAGS $SANITIZER_CXXFLAGS $CXXFLAGS"
|
||||
echo " LDFLAGS = $PTHREAD_LIBS $HARDENED_LDFLAGS $GPROF_LDFLAGS $SANITIZER_LDFLAGS $CORE_LDFLAGS $LDFLAGS"
|
||||
echo " AR = $AR"
|
||||
echo " ARFLAGS = $ARFLAGS"
|
||||
echo
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
# ASMap Tool
|
||||
|
||||
Tool for performing various operations on textual and binary asmap files,
|
||||
particularly encoding/compressing the raw data to the binary format that can
|
||||
be used in Bitcoin Core with the `-asmap` option.
|
||||
|
||||
Example usage:
|
||||
```
|
||||
python3 asmap-tool.py encode /path/to/input.file /path/to/output.file
|
||||
python3 asmap-tool.py decode /path/to/input.file /path/to/output.file
|
||||
python3 asmap-tool.py diff /path/to/first.file /path/to/second.file
|
||||
```
|
||||
@@ -1,197 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
# Copyright (c) 2022 Pieter Wuille
|
||||
# Distributed under the MIT software license, see the accompanying
|
||||
# file LICENSE or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
import argparse
|
||||
import sys
|
||||
import ipaddress
|
||||
import json
|
||||
import math
|
||||
from collections import defaultdict
|
||||
|
||||
import asmap
|
||||
|
||||
def load_file(input_file):
|
||||
try:
|
||||
contents = input_file.read()
|
||||
except OSError as err:
|
||||
sys.exit(f"Input file '{input_file.name}' cannot be read: {err.strerror}.")
|
||||
try:
|
||||
bin_asmap = asmap.ASMap.from_binary(contents)
|
||||
except ValueError:
|
||||
bin_asmap = None
|
||||
txt_error = None
|
||||
entries = None
|
||||
try:
|
||||
txt_contents = str(contents, encoding="utf-8")
|
||||
except UnicodeError:
|
||||
txt_error = "invalid UTF-8"
|
||||
txt_contents = None
|
||||
if txt_contents is not None:
|
||||
entries = []
|
||||
for line in txt_contents.split("\n"):
|
||||
idx = line.find('#')
|
||||
if idx >= 0:
|
||||
line = line[:idx]
|
||||
line = line.lstrip(' ').rstrip(' \t\r\n')
|
||||
if len(line) == 0:
|
||||
continue
|
||||
fields = line.split(' ')
|
||||
if len(fields) != 2:
|
||||
txt_error = f"unparseable line '{line}'"
|
||||
entries = None
|
||||
break
|
||||
prefix, asn = fields
|
||||
if len(asn) <= 2 or asn[:2] != "AS" or any(c < '0' or c > '9' for c in asn[2:]):
|
||||
txt_error = f"invalid ASN '{asn}'"
|
||||
entries = None
|
||||
break
|
||||
try:
|
||||
net = ipaddress.ip_network(prefix)
|
||||
except ValueError:
|
||||
txt_error = f"invalid network '{prefix}'"
|
||||
entries = None
|
||||
break
|
||||
entries.append((asmap.net_to_prefix(net), int(asn[2:])))
|
||||
if entries is not None and bin_asmap is not None and len(contents) > 0:
|
||||
sys.exit(f"Input file '{input_file.name}' is ambiguous.")
|
||||
if entries is not None:
|
||||
state = asmap.ASMap()
|
||||
state.update_multi(entries)
|
||||
return state
|
||||
if bin_asmap is not None:
|
||||
return bin_asmap
|
||||
sys.exit(f"Input file '{input_file.name}' is neither a valid binary asmap file nor valid text input ({txt_error}).")
|
||||
|
||||
|
||||
def save_binary(output_file, state, fill):
|
||||
contents = state.to_binary(fill=fill)
|
||||
try:
|
||||
output_file.write(contents)
|
||||
output_file.close()
|
||||
except OSError as err:
|
||||
sys.exit(f"Output file '{output_file.name}' cannot be written to: {err.strerror}.")
|
||||
|
||||
def save_text(output_file, state, fill, overlapping):
|
||||
for prefix, asn in state.to_entries(fill=fill, overlapping=overlapping):
|
||||
net = asmap.prefix_to_net(prefix)
|
||||
try:
|
||||
print(f"{net} AS{asn}", file=output_file)
|
||||
except OSError as err:
|
||||
sys.exit(f"Output file '{output_file.name}' cannot be written to: {err.strerror}.")
|
||||
try:
|
||||
output_file.close()
|
||||
except OSError as err:
|
||||
sys.exit(f"Output file '{output_file.name}' cannot be written to: {err.strerror}.")
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(description="Tool for performing various operations on textual and binary asmap files.")
|
||||
subparsers = parser.add_subparsers(title="valid subcommands", dest="subcommand")
|
||||
|
||||
parser_encode = subparsers.add_parser("encode", help="convert asmap data to binary format")
|
||||
parser_encode.add_argument('-f', '--fill', dest="fill", default=False, action="store_true",
|
||||
help="permit reassigning undefined network ranges arbitrarily to reduce size")
|
||||
parser_encode.add_argument('infile', nargs='?', type=argparse.FileType('rb'), default=sys.stdin.buffer,
|
||||
help="input asmap file (text or binary); default is stdin")
|
||||
parser_encode.add_argument('outfile', nargs='?', type=argparse.FileType('wb'), default=sys.stdout.buffer,
|
||||
help="output binary asmap file; default is stdout")
|
||||
|
||||
parser_decode = subparsers.add_parser("decode", help="convert asmap data to text format")
|
||||
parser_decode.add_argument('-f', '--fill', dest="fill", default=False, action="store_true",
|
||||
help="permit reassigning undefined network ranges arbitrarily to reduce length")
|
||||
parser_decode.add_argument('-n', '--nonoverlapping', dest="overlapping", default=True, action="store_false",
|
||||
help="output strictly non-overall ping network ranges (increases output size)")
|
||||
parser_decode.add_argument('infile', nargs='?', type=argparse.FileType('rb'), default=sys.stdin.buffer,
|
||||
help="input asmap file (text or binary); default is stdin")
|
||||
parser_decode.add_argument('outfile', nargs='?', type=argparse.FileType('w'), default=sys.stdout,
|
||||
help="output text file; default is stdout")
|
||||
|
||||
parser_diff = subparsers.add_parser("diff", help="compute the difference between two asmap files")
|
||||
parser_diff.add_argument('-i', '--ignore-unassigned', dest="ignore_unassigned", default=False, action="store_true",
|
||||
help="ignore unassigned ranges in the first input (useful when second input is filled)")
|
||||
parser_diff.add_argument('infile1', type=argparse.FileType('rb'),
|
||||
help="first file to compare (text or binary)")
|
||||
parser_diff.add_argument('infile2', type=argparse.FileType('rb'),
|
||||
help="second file to compare (text or binary)")
|
||||
|
||||
parser_diff_addrs = subparsers.add_parser("diff_addrs",
|
||||
help="compute difference between two asmap files for a set of addresses")
|
||||
parser_diff_addrs.add_argument('-s', '--show-addresses', dest="show_addresses", default=False, action="store_true",
|
||||
help="include reassigned addresses in the output")
|
||||
parser_diff_addrs.add_argument("infile1", type=argparse.FileType("rb"),
|
||||
help="first file to compare (text or binary)")
|
||||
parser_diff_addrs.add_argument("infile2", type=argparse.FileType("rb"),
|
||||
help="second file to compare (text or binary)")
|
||||
parser_diff_addrs.add_argument("addrs_file", type=argparse.FileType("r"),
|
||||
help="address file containing getnodeaddresses output to use in the comparison "
|
||||
"(make sure to set the count parameter to zero to get all node addresses, "
|
||||
"e.g. 'bitcoin-cli getnodeaddresses 0 > addrs.json')")
|
||||
args = parser.parse_args()
|
||||
if args.subcommand is None:
|
||||
parser.print_help()
|
||||
elif args.subcommand == "encode":
|
||||
state = load_file(args.infile)
|
||||
save_binary(args.outfile, state, fill=args.fill)
|
||||
elif args.subcommand == "decode":
|
||||
state = load_file(args.infile)
|
||||
save_text(args.outfile, state, fill=args.fill, overlapping=args.overlapping)
|
||||
elif args.subcommand == "diff":
|
||||
state1 = load_file(args.infile1)
|
||||
state2 = load_file(args.infile2)
|
||||
ipv4_changed = 0
|
||||
ipv6_changed = 0
|
||||
for prefix, old_asn, new_asn in state1.diff(state2):
|
||||
if args.ignore_unassigned and old_asn == 0:
|
||||
continue
|
||||
net = asmap.prefix_to_net(prefix)
|
||||
if isinstance(net, ipaddress.IPv4Network):
|
||||
ipv4_changed += 1 << (32 - net.prefixlen)
|
||||
elif isinstance(net, ipaddress.IPv6Network):
|
||||
ipv6_changed += 1 << (128 - net.prefixlen)
|
||||
if new_asn == 0:
|
||||
print(f"# {net} was AS{old_asn}")
|
||||
elif old_asn == 0:
|
||||
print(f"{net} AS{new_asn} # was unassigned")
|
||||
else:
|
||||
print(f"{net} AS{new_asn} # was AS{old_asn}")
|
||||
ipv4_change_str = "" if ipv4_changed == 0 else f" (2^{math.log2(ipv4_changed):.2f})"
|
||||
ipv6_change_str = "" if ipv6_changed == 0 else f" (2^{math.log2(ipv6_changed):.2f})"
|
||||
|
||||
print(
|
||||
f"# {ipv4_changed}{ipv4_change_str} IPv4 addresses changed; "
|
||||
f"{ipv6_changed}{ipv6_change_str} IPv6 addresses changed"
|
||||
)
|
||||
elif args.subcommand == "diff_addrs":
|
||||
state1 = load_file(args.infile1)
|
||||
state2 = load_file(args.infile2)
|
||||
address_info = json.load(args.addrs_file)
|
||||
addrs = {a["address"] for a in address_info if a["network"] in ["ipv4", "ipv6"]}
|
||||
reassignments = defaultdict(list)
|
||||
for addr in addrs:
|
||||
net = ipaddress.ip_network(addr)
|
||||
prefix = asmap.net_to_prefix(net)
|
||||
old_asn = state1.lookup(prefix)
|
||||
new_asn = state2.lookup(prefix)
|
||||
if new_asn != old_asn:
|
||||
reassignments[(old_asn, new_asn)].append(addr)
|
||||
reassignments = sorted(reassignments.items(), key=lambda item: len(item[1]), reverse=True)
|
||||
num_reassignment_type = defaultdict(int)
|
||||
for (old_asn, new_asn), reassigned_addrs in reassignments:
|
||||
num_reassigned = len(reassigned_addrs)
|
||||
num_reassignment_type[(bool(old_asn), bool(new_asn))] += num_reassigned
|
||||
old_asn_str = f"AS{old_asn}" if old_asn else "unassigned"
|
||||
new_asn_str = f"AS{new_asn}" if new_asn else "unassigned"
|
||||
opt = ": " + ", ".join(reassigned_addrs) if args.show_addresses else ""
|
||||
print(f"{num_reassigned} address(es) reassigned from {old_asn_str} to {new_asn_str}{opt}")
|
||||
num_reassignments = sum(len(addrs) for _, addrs in reassignments)
|
||||
share = num_reassignments / len(addrs) if len(addrs) > 0 else 0
|
||||
print(f"Summary: {num_reassignments:,} ({share:.2%}) of {len(addrs):,} addresses were reassigned "
|
||||
f"(migrations={num_reassignment_type[True, True]}, assignments={num_reassignment_type[False, True]}, "
|
||||
f"unassignments={num_reassignment_type[True, False]})")
|
||||
else:
|
||||
parser.print_help()
|
||||
sys.exit("No command provided.")
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -9,7 +9,7 @@ _bitcoin_rpc() {
|
||||
local rpcargs=()
|
||||
for i in ${COMP_LINE}; do
|
||||
case "$i" in
|
||||
-conf=*|-datadir=*|-regtest|-rpc*|-testnet|-testnet4)
|
||||
-conf=*|-datadir=*|-regtest|-rpc*|-testnet)
|
||||
rpcargs=( "${rpcargs[@]}" "$i" )
|
||||
;;
|
||||
esac
|
||||
|
||||
@@ -1,31 +1,20 @@
|
||||
cmake_minimum_required(VERSION 3.22)
|
||||
cmake_minimum_required(VERSION 3.9)
|
||||
|
||||
project(bitcoin-tidy
|
||||
VERSION
|
||||
1.0.0
|
||||
DESCRIPTION "clang-tidy checks for Bitcoin Core"
|
||||
LANGUAGES CXX)
|
||||
project(bitcoin-tidy VERSION 1.0.0 DESCRIPTION "clang-tidy checks for Bitcoin Core")
|
||||
|
||||
include(GNUInstallDirs)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 20)
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED True)
|
||||
set(CMAKE_CXX_EXTENSIONS False)
|
||||
|
||||
set(CMAKE_DISABLE_FIND_PACKAGE_CURL ON)
|
||||
set(CMAKE_DISABLE_FIND_PACKAGE_FFI ON)
|
||||
set(CMAKE_DISABLE_FIND_PACKAGE_LibEdit ON)
|
||||
set(CMAKE_DISABLE_FIND_PACKAGE_LibXml2 ON)
|
||||
set(CMAKE_DISABLE_FIND_PACKAGE_Terminfo ON)
|
||||
set(CMAKE_DISABLE_FIND_PACKAGE_ZLIB ON)
|
||||
set(CMAKE_DISABLE_FIND_PACKAGE_zstd ON)
|
||||
|
||||
# TODO: Figure out how to avoid the terminfo check
|
||||
find_package(LLVM REQUIRED CONFIG)
|
||||
find_program(CLANG_TIDY_EXE NAMES "clang-tidy-${LLVM_VERSION_MAJOR}" "clang-tidy" HINTS ${LLVM_TOOLS_BINARY_DIR})
|
||||
message(STATUS "Found LLVM ${LLVM_PACKAGE_VERSION}")
|
||||
message(STATUS "Found clang-tidy: ${CLANG_TIDY_EXE}")
|
||||
|
||||
add_library(bitcoin-tidy MODULE bitcoin-tidy.cpp logprintf.cpp nontrivial-threadlocal.cpp)
|
||||
add_library(bitcoin-tidy MODULE bitcoin-tidy.cpp logprintf.cpp)
|
||||
target_include_directories(bitcoin-tidy SYSTEM PRIVATE ${LLVM_INCLUDE_DIRS})
|
||||
|
||||
# Disable RTTI and exceptions as necessary
|
||||
@@ -58,7 +47,7 @@ else()
|
||||
endif()
|
||||
|
||||
# Create a dummy library that runs clang-tidy tests as a side-effect of building
|
||||
add_library(bitcoin-tidy-tests OBJECT EXCLUDE_FROM_ALL example_logprintf.cpp example_nontrivial-threadlocal.cpp)
|
||||
add_library(bitcoin-tidy-tests OBJECT EXCLUDE_FROM_ALL example_logprintf.cpp)
|
||||
add_dependencies(bitcoin-tidy-tests bitcoin-tidy)
|
||||
|
||||
set_target_properties(bitcoin-tidy-tests PROPERTIES CXX_CLANG_TIDY "${CLANG_TIDY_COMMAND}")
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
#include "logprintf.h"
|
||||
#include "nontrivial-threadlocal.h"
|
||||
|
||||
#include <clang-tidy/ClangTidyModule.h>
|
||||
#include <clang-tidy/ClangTidyModuleRegistry.h>
|
||||
@@ -14,7 +13,6 @@ public:
|
||||
void addCheckFactories(clang::tidy::ClangTidyCheckFactories& CheckFactories) override
|
||||
{
|
||||
CheckFactories.registerCheck<bitcoin::LogPrintfCheck>("bitcoin-unterminated-logprintf");
|
||||
CheckFactories.registerCheck<bitcoin::NonTrivialThreadLocal>("bitcoin-nontrivial-threadlocal");
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
#include <string>
|
||||
thread_local std::string foo;
|
||||
@@ -1,44 +0,0 @@
|
||||
// Copyright (c) 2023 Bitcoin Developers
|
||||
// Distributed under the MIT software license, see the accompanying
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
#include "nontrivial-threadlocal.h"
|
||||
|
||||
#include <clang/AST/ASTContext.h>
|
||||
#include <clang/ASTMatchers/ASTMatchFinder.h>
|
||||
|
||||
|
||||
// Copied from clang-tidy's UnusedRaiiCheck
|
||||
namespace {
|
||||
AST_MATCHER(clang::CXXRecordDecl, hasNonTrivialDestructor) {
|
||||
// TODO: If the dtor is there but empty we don't want to warn either.
|
||||
return Node.hasDefinition() && Node.hasNonTrivialDestructor();
|
||||
}
|
||||
} // namespace
|
||||
|
||||
namespace bitcoin {
|
||||
|
||||
void NonTrivialThreadLocal::registerMatchers(clang::ast_matchers::MatchFinder* finder)
|
||||
{
|
||||
using namespace clang::ast_matchers;
|
||||
|
||||
/*
|
||||
thread_local std::string foo;
|
||||
*/
|
||||
|
||||
finder->addMatcher(
|
||||
varDecl(
|
||||
hasThreadStorageDuration(),
|
||||
hasType(hasCanonicalType(recordType(hasDeclaration(cxxRecordDecl(hasNonTrivialDestructor())))))
|
||||
).bind("nontrivial_threadlocal"),
|
||||
this);
|
||||
}
|
||||
|
||||
void NonTrivialThreadLocal::check(const clang::ast_matchers::MatchFinder::MatchResult& Result)
|
||||
{
|
||||
if (const clang::VarDecl* var = Result.Nodes.getNodeAs<clang::VarDecl>("nontrivial_threadlocal")) {
|
||||
const auto user_diag = diag(var->getBeginLoc(), "Variable with non-trivial destructor cannot be thread_local.");
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace bitcoin
|
||||
@@ -1,29 +0,0 @@
|
||||
// Copyright (c) 2023 Bitcoin Developers
|
||||
// Distributed under the MIT software license, see the accompanying
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
#ifndef NONTRIVIAL_THREADLOCAL_CHECK_H
|
||||
#define NONTRIVIAL_THREADLOCAL_CHECK_H
|
||||
|
||||
#include <clang-tidy/ClangTidyCheck.h>
|
||||
|
||||
namespace bitcoin {
|
||||
|
||||
// Warn about any thread_local variable with a non-trivial destructor.
|
||||
class NonTrivialThreadLocal final : public clang::tidy::ClangTidyCheck
|
||||
{
|
||||
public:
|
||||
NonTrivialThreadLocal(clang::StringRef Name, clang::tidy::ClangTidyContext* Context)
|
||||
: clang::tidy::ClangTidyCheck(Name, Context) {}
|
||||
|
||||
bool isLanguageVersionSupported(const clang::LangOptions& LangOpts) const override
|
||||
{
|
||||
return LangOpts.CPlusPlus;
|
||||
}
|
||||
void registerMatchers(clang::ast_matchers::MatchFinder* Finder) override;
|
||||
void check(const clang::ast_matchers::MatchFinder::MatchResult& Result) override;
|
||||
};
|
||||
|
||||
} // namespace bitcoin
|
||||
|
||||
#endif // NONTRIVIAL_THREADLOCAL_CHECK_H
|
||||
@@ -1,203 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
export LC_ALL=C
|
||||
set -Eeuo pipefail
|
||||
|
||||
# Declare paths to libraries
|
||||
declare -A LIBS
|
||||
LIBS[cli]="libbitcoin_cli.a"
|
||||
LIBS[common]="libbitcoin_common.a"
|
||||
LIBS[consensus]="libbitcoin_consensus.a"
|
||||
LIBS[crypto]="crypto/.libs/libbitcoin_crypto_base.a crypto/.libs/libbitcoin_crypto_x86_shani.a crypto/.libs/libbitcoin_crypto_sse41.a crypto/.libs/libbitcoin_crypto_avx2.a"
|
||||
LIBS[node]="libbitcoin_node.a"
|
||||
LIBS[util]="libbitcoin_util.a"
|
||||
LIBS[wallet]="libbitcoin_wallet.a"
|
||||
LIBS[wallet_tool]="libbitcoin_wallet_tool.a"
|
||||
|
||||
# Declare allowed dependencies "X Y" where X is allowed to depend on Y. This
|
||||
# list is taken from doc/design/libraries.md.
|
||||
ALLOWED_DEPENDENCIES=(
|
||||
"cli common"
|
||||
"cli util"
|
||||
"common consensus"
|
||||
"common crypto"
|
||||
"common util"
|
||||
"consensus crypto"
|
||||
"node common"
|
||||
"node consensus"
|
||||
"node crypto"
|
||||
"node kernel"
|
||||
"node util"
|
||||
"util crypto"
|
||||
"wallet common"
|
||||
"wallet crypto"
|
||||
"wallet util"
|
||||
"wallet_tool util"
|
||||
"wallet_tool wallet"
|
||||
)
|
||||
|
||||
# Add minor dependencies omitted from doc/design/libraries.md to keep the
|
||||
# dependency diagram simple.
|
||||
ALLOWED_DEPENDENCIES+=(
|
||||
"wallet consensus"
|
||||
"wallet_tool common"
|
||||
"wallet_tool crypto"
|
||||
)
|
||||
|
||||
# Declare list of known errors that should be suppressed.
|
||||
declare -A SUPPRESS
|
||||
# init.cpp file currently calls Berkeley DB sanity check function on startup, so
|
||||
# there is an undocumented dependency of the node library on the wallet library.
|
||||
SUPPRESS["libbitcoin_node_a-init.o libbitcoin_wallet_a-bdb.o _ZN6wallet27BerkeleyDatabaseSanityCheckEv"]=1
|
||||
# init/common.cpp file calls InitError and InitWarning from interface_ui which
|
||||
# is currently part of the node library. interface_ui should just be part of the
|
||||
# common library instead, and is moved in
|
||||
# https://github.com/bitcoin/bitcoin/issues/10102
|
||||
SUPPRESS["libbitcoin_common_a-common.o libbitcoin_node_a-interface_ui.o _Z11InitWarningRK13bilingual_str"]=1
|
||||
SUPPRESS["libbitcoin_common_a-common.o libbitcoin_node_a-interface_ui.o _Z9InitErrorRK13bilingual_str"]=1
|
||||
# rpc/external_signer.cpp adds defines node RPC methods but is built as part of the
|
||||
# common library. It should be moved to the node library instead.
|
||||
SUPPRESS["libbitcoin_common_a-external_signer.o libbitcoin_node_a-server.o _ZN9CRPCTable13appendCommandERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPK11CRPCCommand"]=1
|
||||
|
||||
usage() {
|
||||
echo "Usage: $(basename "${BASH_SOURCE[0]}") [BUILD_DIR]"
|
||||
}
|
||||
|
||||
# Output makefile targets, converting library .a paths to libtool .la targets
|
||||
lib_targets() {
|
||||
for lib in "${!LIBS[@]}"; do
|
||||
for lib_path in ${LIBS[$lib]}; do
|
||||
# shellcheck disable=SC2001
|
||||
sed 's:/.libs/\(.*\)\.a$:/\1.la:g' <<<"$lib_path"
|
||||
done
|
||||
done
|
||||
}
|
||||
|
||||
# Extract symbol names and object names and write to text files
|
||||
extract_symbols() {
|
||||
local temp_dir="$1"
|
||||
for lib in "${!LIBS[@]}"; do
|
||||
for lib_path in ${LIBS[$lib]}; do
|
||||
nm -o "$lib_path" | grep ' T ' | awk '{print $3, $1}' >> "${temp_dir}/${lib}_exports.txt"
|
||||
nm -o "$lib_path" | grep ' U ' | awk '{print $3, $1}' >> "${temp_dir}/${lib}_imports.txt"
|
||||
awk '{print $1}' "${temp_dir}/${lib}_exports.txt" | sort -u > "${temp_dir}/${lib}_exported_symbols.txt"
|
||||
awk '{print $1}' "${temp_dir}/${lib}_imports.txt" | sort -u > "${temp_dir}/${lib}_imported_symbols.txt"
|
||||
done
|
||||
done
|
||||
}
|
||||
|
||||
# Lookup object name(s) corresponding to symbol name in text file
|
||||
obj_names() {
|
||||
local symbol="$1"
|
||||
local txt_file="$2"
|
||||
sed -n "s/^$symbol [^:]\\+:\\([^:]\\+\\):[^:]*\$/\\1/p" "$txt_file" | sort -u
|
||||
}
|
||||
|
||||
# Iterate through libraries and find disallowed dependencies
|
||||
check_libraries() {
|
||||
local temp_dir="$1"
|
||||
local result=0
|
||||
for src in "${!LIBS[@]}"; do
|
||||
for dst in "${!LIBS[@]}"; do
|
||||
if [ "$src" != "$dst" ] && ! is_allowed "$src" "$dst"; then
|
||||
if ! check_disallowed "$src" "$dst" "$temp_dir"; then
|
||||
result=1
|
||||
fi
|
||||
fi
|
||||
done
|
||||
done
|
||||
check_not_suppressed
|
||||
return $result
|
||||
}
|
||||
|
||||
# Return whether src library is allowed to depend on dst.
|
||||
is_allowed() {
|
||||
local src="$1"
|
||||
local dst="$2"
|
||||
for allowed in "${ALLOWED_DEPENDENCIES[@]}"; do
|
||||
if [ "$src $dst" = "$allowed" ]; then
|
||||
return 0
|
||||
fi
|
||||
done
|
||||
return 1
|
||||
}
|
||||
|
||||
# Return whether src library imports any symbols from dst, assuming src is not
|
||||
# allowed to depend on dst.
|
||||
check_disallowed() {
|
||||
local src="$1"
|
||||
local dst="$2"
|
||||
local temp_dir="$3"
|
||||
local result=0
|
||||
|
||||
# Loop over symbol names exported by dst and imported by src
|
||||
while read symbol; do
|
||||
local dst_obj
|
||||
dst_obj=$(obj_names "$symbol" "${temp_dir}/${dst}_exports.txt")
|
||||
while read src_obj; do
|
||||
if ! check_suppress "$src_obj" "$dst_obj" "$symbol"; then
|
||||
echo "Error: $src_obj depends on $dst_obj symbol '$(c++filt "$symbol")', can suppess with:"
|
||||
echo " SUPPRESS[\"$src_obj $dst_obj $symbol\"]=1"
|
||||
result=1
|
||||
fi
|
||||
done < <(obj_names "$symbol" "${temp_dir}/${src}_imports.txt")
|
||||
done < <(comm -12 "${temp_dir}/${dst}_exported_symbols.txt" "${temp_dir}/${src}_imported_symbols.txt")
|
||||
return $result
|
||||
}
|
||||
|
||||
# Declare array to track errors which were suppressed.
|
||||
declare -A SUPPRESSED
|
||||
|
||||
# Return whether error should be suppressed and record suppresssion in
|
||||
# SUPPRESSED array.
|
||||
check_suppress() {
|
||||
local src_obj="$1"
|
||||
local dst_obj="$2"
|
||||
local symbol="$3"
|
||||
for suppress in "${!SUPPRESS[@]}"; do
|
||||
read suppress_src suppress_dst suppress_pattern <<<"$suppress"
|
||||
if [[ "$src_obj" == "$suppress_src" && "$dst_obj" == "$suppress_dst" && "$symbol" =~ $suppress_pattern ]]; then
|
||||
SUPPRESSED["$suppress"]=1
|
||||
return 0
|
||||
fi
|
||||
done
|
||||
return 1
|
||||
}
|
||||
|
||||
# Warn about error which were supposed to be suppress, but were not encountered.
|
||||
check_not_suppressed() {
|
||||
for suppress in "${!SUPPRESS[@]}"; do
|
||||
if [[ ! -v SUPPRESSED[$suppress] ]]; then
|
||||
echo >&2 "Warning: suppression '$suppress' was ignored, consider deleting."
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
# Check arguments.
|
||||
if [ "$#" = 0 ]; then
|
||||
BUILD_DIR="$(dirname "${BASH_SOURCE[0]}")/../../src"
|
||||
elif [ "$#" = 1 ]; then
|
||||
BUILD_DIR="$1"
|
||||
else
|
||||
echo >&2 "Error: wrong number of arguments."
|
||||
usage >&2
|
||||
exit 1
|
||||
fi
|
||||
if [ ! -f "$BUILD_DIR/Makefile" ]; then
|
||||
echo >&2 "Error: directory '$BUILD_DIR' does not contain a makefile, please specify path to build directory for library targets."
|
||||
usage >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Build libraries and run checks.
|
||||
cd "$BUILD_DIR"
|
||||
# shellcheck disable=SC2046
|
||||
make -j"$(nproc)" $(lib_targets)
|
||||
TEMP_DIR="$(mktemp -d)"
|
||||
extract_symbols "$TEMP_DIR"
|
||||
if check_libraries "$TEMP_DIR"; then
|
||||
echo "Success! No unexpected dependencies were detected."
|
||||
else
|
||||
echo >&2 "Error: Unexpected dependencies were detected. Check previous output."
|
||||
fi
|
||||
rm -r "$TEMP_DIR"
|
||||
@@ -19,6 +19,7 @@ EXCLUDE = [
|
||||
'src/qt/bitcoinstrings.cpp',
|
||||
'src/chainparamsseeds.h',
|
||||
# other external copyrights:
|
||||
'src/reverse_iterator.h',
|
||||
'src/test/fuzz/FuzzedDataProvider.h',
|
||||
'src/tinyformat.h',
|
||||
'src/bench/nanobench.h',
|
||||
|
||||
@@ -62,10 +62,6 @@ with tempfile.NamedTemporaryFile('w', suffix='.h2m') as footer:
|
||||
# Copyright is the same for all binaries, so just use the first.
|
||||
footer.write('[COPYRIGHT]\n')
|
||||
footer.write('\n'.join(versions[0][2]).strip())
|
||||
# Create SEE ALSO section
|
||||
footer.write('\n[SEE ALSO]\n')
|
||||
footer.write(', '.join(s.rpartition('/')[2] + '(1)' for s in BINARIES))
|
||||
footer.write('\n')
|
||||
footer.flush()
|
||||
|
||||
# Call the binaries through help2man to produce a manual page for each of them.
|
||||
|
||||
4
contrib/devtools/headerssync-params.py
Executable file → Normal file
4
contrib/devtools/headerssync-params.py
Executable file → Normal file
@@ -12,13 +12,13 @@ import random
|
||||
# Parameters:
|
||||
|
||||
# Aim for still working fine at some point in the future. [datetime]
|
||||
TIME = datetime(2027, 4, 1)
|
||||
TIME = datetime(2026, 10, 5)
|
||||
|
||||
# Expected block interval. [timedelta]
|
||||
BLOCK_INTERVAL = timedelta(seconds=600)
|
||||
|
||||
# The number of headers corresponding to the minchainwork parameter. [headers]
|
||||
MINCHAINWORK_HEADERS = 856760
|
||||
MINCHAINWORK_HEADERS = 804000
|
||||
|
||||
# Combined processing bandwidth from all attackers to one victim. [bit/s]
|
||||
# 6 Gbit/s is approximately the speed at which a single thread of a Ryzen 5950X CPU thread can hash
|
||||
|
||||
@@ -38,13 +38,13 @@ def check_ELF_RELRO(binary) -> bool:
|
||||
|
||||
return have_gnu_relro and have_bindnow
|
||||
|
||||
def check_ELF_CANARY(binary) -> bool:
|
||||
def check_ELF_Canary(binary) -> bool:
|
||||
'''
|
||||
Check for use of stack canary
|
||||
'''
|
||||
return binary.has_symbol('__stack_chk_fail')
|
||||
|
||||
def check_ELF_SEPARATE_CODE(binary):
|
||||
def check_ELF_separate_code(binary):
|
||||
'''
|
||||
Check that sections are appropriately separated in virtual memory,
|
||||
based on their permissions. This checks for missing -Wl,-z,separate-code
|
||||
@@ -105,7 +105,7 @@ def check_ELF_SEPARATE_CODE(binary):
|
||||
return False
|
||||
return True
|
||||
|
||||
def check_ELF_CONTROL_FLOW(binary) -> bool:
|
||||
def check_ELF_control_flow(binary) -> bool:
|
||||
'''
|
||||
Check for control flow instrumentation
|
||||
'''
|
||||
@@ -130,7 +130,7 @@ def check_PE_RELOC_SECTION(binary) -> bool:
|
||||
'''Check for a reloc section. This is required for functional ASLR.'''
|
||||
return binary.has_relocations
|
||||
|
||||
def check_PE_CONTROL_FLOW(binary) -> bool:
|
||||
def check_PE_control_flow(binary) -> bool:
|
||||
'''
|
||||
Check for control flow instrumentation
|
||||
'''
|
||||
@@ -145,7 +145,7 @@ def check_PE_CONTROL_FLOW(binary) -> bool:
|
||||
return True
|
||||
return False
|
||||
|
||||
def check_PE_CANARY(binary) -> bool:
|
||||
def check_PE_Canary(binary) -> bool:
|
||||
'''
|
||||
Check for use of stack canary
|
||||
'''
|
||||
@@ -163,7 +163,7 @@ def check_MACHO_FIXUP_CHAINS(binary) -> bool:
|
||||
'''
|
||||
return binary.has_dyld_chained_fixups
|
||||
|
||||
def check_MACHO_CANARY(binary) -> bool:
|
||||
def check_MACHO_Canary(binary) -> bool:
|
||||
'''
|
||||
Check for use of stack canary
|
||||
'''
|
||||
@@ -182,7 +182,7 @@ def check_NX(binary) -> bool:
|
||||
'''
|
||||
return binary.has_nx
|
||||
|
||||
def check_MACHO_CONTROL_FLOW(binary) -> bool:
|
||||
def check_MACHO_control_flow(binary) -> bool:
|
||||
'''
|
||||
Check for control flow instrumentation
|
||||
'''
|
||||
@@ -192,7 +192,7 @@ def check_MACHO_CONTROL_FLOW(binary) -> bool:
|
||||
return True
|
||||
return False
|
||||
|
||||
def check_MACHO_BRANCH_PROTECTION(binary) -> bool:
|
||||
def check_MACHO_branch_protection(binary) -> bool:
|
||||
'''
|
||||
Check for branch protection instrumentation
|
||||
'''
|
||||
@@ -206,8 +206,8 @@ BASE_ELF = [
|
||||
('PIE', check_PIE),
|
||||
('NX', check_NX),
|
||||
('RELRO', check_ELF_RELRO),
|
||||
('CANARY', check_ELF_CANARY),
|
||||
('SEPARATE_CODE', check_ELF_SEPARATE_CODE),
|
||||
('Canary', check_ELF_Canary),
|
||||
('separate_code', check_ELF_separate_code),
|
||||
]
|
||||
|
||||
BASE_PE = [
|
||||
@@ -216,19 +216,19 @@ BASE_PE = [
|
||||
('HIGH_ENTROPY_VA', check_PE_HIGH_ENTROPY_VA),
|
||||
('NX', check_NX),
|
||||
('RELOC_SECTION', check_PE_RELOC_SECTION),
|
||||
('CONTROL_FLOW', check_PE_CONTROL_FLOW),
|
||||
('CANARY', check_PE_CANARY),
|
||||
('CONTROL_FLOW', check_PE_control_flow),
|
||||
('Canary', check_PE_Canary),
|
||||
]
|
||||
|
||||
BASE_MACHO = [
|
||||
('NOUNDEFS', check_MACHO_NOUNDEFS),
|
||||
('CANARY', check_MACHO_CANARY),
|
||||
('Canary', check_MACHO_Canary),
|
||||
('FIXUP_CHAINS', check_MACHO_FIXUP_CHAINS),
|
||||
]
|
||||
|
||||
CHECKS = {
|
||||
lief.EXE_FORMATS.ELF: {
|
||||
lief.ARCHITECTURES.X86: BASE_ELF + [('CONTROL_FLOW', check_ELF_CONTROL_FLOW)],
|
||||
lief.ARCHITECTURES.X86: BASE_ELF + [('CONTROL_FLOW', check_ELF_control_flow)],
|
||||
lief.ARCHITECTURES.ARM: BASE_ELF,
|
||||
lief.ARCHITECTURES.ARM64: BASE_ELF,
|
||||
lief.ARCHITECTURES.PPC: BASE_ELF,
|
||||
@@ -240,24 +240,39 @@ CHECKS = {
|
||||
lief.EXE_FORMATS.MACHO: {
|
||||
lief.ARCHITECTURES.X86: BASE_MACHO + [('PIE', check_PIE),
|
||||
('NX', check_NX),
|
||||
('CONTROL_FLOW', check_MACHO_CONTROL_FLOW)],
|
||||
lief.ARCHITECTURES.ARM64: BASE_MACHO + [('BRANCH_PROTECTION', check_MACHO_BRANCH_PROTECTION)],
|
||||
('CONTROL_FLOW', check_MACHO_control_flow)],
|
||||
lief.ARCHITECTURES.ARM64: BASE_MACHO + [('BRANCH_PROTECTION', check_MACHO_branch_protection)],
|
||||
}
|
||||
}
|
||||
|
||||
if __name__ == '__main__':
|
||||
retval: int = 0
|
||||
for filename in sys.argv[1:]:
|
||||
binary = lief.parse(filename)
|
||||
etype = binary.format
|
||||
arch = binary.abstract.header.architecture
|
||||
binary.concrete
|
||||
try:
|
||||
binary = lief.parse(filename)
|
||||
etype = binary.format
|
||||
arch = binary.abstract.header.architecture
|
||||
binary.concrete
|
||||
|
||||
failed: list[str] = []
|
||||
for (name, func) in CHECKS[etype][arch]:
|
||||
if not func(binary):
|
||||
failed.append(name)
|
||||
if failed:
|
||||
print(f'{filename}: failed {" ".join(failed)}')
|
||||
if etype == lief.EXE_FORMATS.UNKNOWN:
|
||||
print(f'{filename}: unknown executable format')
|
||||
retval = 1
|
||||
continue
|
||||
|
||||
if arch == lief.ARCHITECTURES.NONE:
|
||||
print(f'{filename}: unknown architecture')
|
||||
retval = 1
|
||||
continue
|
||||
|
||||
failed: list[str] = []
|
||||
for (name, func) in CHECKS[etype][arch]:
|
||||
if not func(binary):
|
||||
failed.append(name)
|
||||
if failed:
|
||||
print(f'{filename}: failed {" ".join(failed)}')
|
||||
retval = 1
|
||||
except IOError:
|
||||
print(f'{filename}: cannot open')
|
||||
retval = 1
|
||||
sys.exit(retval)
|
||||
|
||||
|
||||
@@ -14,31 +14,31 @@ import sys
|
||||
|
||||
import lief
|
||||
|
||||
# Debian 11 (Bullseye) EOL: 2026. https://wiki.debian.org/LTS
|
||||
# Debian 10 (Buster) EOL: 2024. https://wiki.debian.org/LTS
|
||||
#
|
||||
# - libgcc version 10.2.1 (https://packages.debian.org/bullseye/libgcc-s1)
|
||||
# - libc version 2.31 (https://packages.debian.org/source/bullseye/glibc)
|
||||
# - libgcc version 8.3.0 (https://packages.debian.org/search?suite=buster&arch=any&searchon=names&keywords=libgcc1)
|
||||
# - libc version 2.28 (https://packages.debian.org/search?suite=buster&arch=any&searchon=names&keywords=libc6)
|
||||
#
|
||||
# Ubuntu 20.04 (Focal) EOL: 2030. https://wiki.ubuntu.com/ReleaseTeam
|
||||
# Ubuntu 18.04 (Bionic) EOL: 2028. https://wiki.ubuntu.com/ReleaseTeam
|
||||
#
|
||||
# - libgcc version 10.5.0 (https://packages.ubuntu.com/focal/libgcc1)
|
||||
# - libc version 2.31 (https://packages.ubuntu.com/focal/libc6)
|
||||
# - libgcc version 8.4.0 (https://packages.ubuntu.com/bionic/libgcc1)
|
||||
# - libc version 2.27 (https://packages.ubuntu.com/bionic/libc6)
|
||||
#
|
||||
# CentOS Stream 9 EOL: 2027. https://www.centos.org/cl-vs-cs/#end-of-life
|
||||
# CentOS Stream 8 EOL: 2024. https://wiki.centos.org/About/Product
|
||||
#
|
||||
# - libgcc version 12.2.1 (https://mirror.stream.centos.org/9-stream/AppStream/x86_64/os/Packages/)
|
||||
# - libc version 2.34 (https://mirror.stream.centos.org/9-stream/AppStream/x86_64/os/Packages/)
|
||||
# - libgcc version 8.5.0 (http://mirror.centos.org/centos/8-stream/AppStream/x86_64/os/Packages/)
|
||||
# - libc version 2.28 (http://mirror.centos.org/centos/8-stream/AppStream/x86_64/os/Packages/)
|
||||
#
|
||||
# See https://gcc.gnu.org/onlinedocs/libstdc++/manual/abi.html for more info.
|
||||
|
||||
MAX_VERSIONS = {
|
||||
'GCC': (4,3,0),
|
||||
'GLIBC': {
|
||||
lief.ELF.ARCH.x86_64: (2,31),
|
||||
lief.ELF.ARCH.ARM: (2,31),
|
||||
lief.ELF.ARCH.AARCH64:(2,31),
|
||||
lief.ELF.ARCH.PPC64: (2,31),
|
||||
lief.ELF.ARCH.RISCV: (2,31),
|
||||
lief.ELF.ARCH.x86_64: (2,27),
|
||||
lief.ELF.ARCH.ARM: (2,27),
|
||||
lief.ELF.ARCH.AARCH64:(2,27),
|
||||
lief.ELF.ARCH.PPC64: (2,27),
|
||||
lief.ELF.ARCH.RISCV: (2,27),
|
||||
},
|
||||
'LIBATOMIC': (1,0),
|
||||
'V': (0,5,0), # xkb (bitcoin-qt only)
|
||||
@@ -212,11 +212,6 @@ def check_exported_symbols(binary) -> bool:
|
||||
ok = False
|
||||
return ok
|
||||
|
||||
def check_RUNPATH(binary) -> bool:
|
||||
assert binary.get(lief.ELF.DYNAMIC_TAGS.RUNPATH) is None
|
||||
assert binary.get(lief.ELF.DYNAMIC_TAGS.RPATH) is None
|
||||
return True
|
||||
|
||||
def check_ELF_libraries(binary) -> bool:
|
||||
ok: bool = True
|
||||
for library in binary.libraries:
|
||||
@@ -244,8 +239,8 @@ def check_MACHO_sdk(binary) -> bool:
|
||||
return True
|
||||
return False
|
||||
|
||||
def check_MACHO_lld(binary) -> bool:
|
||||
if binary.build_version.tools[0].version == [18, 1, 8]:
|
||||
def check_MACHO_ld64(binary) -> bool:
|
||||
if binary.build_version.tools[0].version == [711, 0, 0]:
|
||||
return True
|
||||
return False
|
||||
|
||||
@@ -282,13 +277,12 @@ lief.EXE_FORMATS.ELF: [
|
||||
('LIBRARY_DEPENDENCIES', check_ELF_libraries),
|
||||
('INTERPRETER_NAME', check_ELF_interpreter),
|
||||
('ABI', check_ELF_ABI),
|
||||
('RUNPATH', check_RUNPATH),
|
||||
],
|
||||
lief.EXE_FORMATS.MACHO: [
|
||||
('DYNAMIC_LIBRARIES', check_MACHO_libraries),
|
||||
('MIN_OS', check_MACHO_min_os),
|
||||
('SDK', check_MACHO_sdk),
|
||||
('LLD', check_MACHO_lld),
|
||||
('LD64', check_MACHO_ld64),
|
||||
],
|
||||
lief.EXE_FORMATS.PE: [
|
||||
('DYNAMIC_LIBRARIES', check_PE_libraries),
|
||||
@@ -299,14 +293,22 @@ lief.EXE_FORMATS.PE: [
|
||||
if __name__ == '__main__':
|
||||
retval: int = 0
|
||||
for filename in sys.argv[1:]:
|
||||
binary = lief.parse(filename)
|
||||
etype = binary.format
|
||||
try:
|
||||
binary = lief.parse(filename)
|
||||
etype = binary.format
|
||||
if etype == lief.EXE_FORMATS.UNKNOWN:
|
||||
print(f'{filename}: unknown executable format')
|
||||
retval = 1
|
||||
continue
|
||||
|
||||
failed: list[str] = []
|
||||
for (name, func) in CHECKS[etype]:
|
||||
if not func(binary):
|
||||
failed.append(name)
|
||||
if failed:
|
||||
print(f'{filename}: failed {" ".join(failed)}')
|
||||
failed: list[str] = []
|
||||
for (name, func) in CHECKS[etype]:
|
||||
if not func(binary):
|
||||
failed.append(name)
|
||||
if failed:
|
||||
print(f'{filename}: failed {" ".join(failed)}')
|
||||
retval = 1
|
||||
except IOError:
|
||||
print(f'{filename}: cannot open')
|
||||
retval = 1
|
||||
sys.exit(retval)
|
||||
|
||||
@@ -15,10 +15,10 @@ from utils import determine_wellknown_cmd
|
||||
def write_testcode(filename):
|
||||
with open(filename, 'w', encoding="utf8") as f:
|
||||
f.write('''
|
||||
#include <cstdio>
|
||||
#include <stdio.h>
|
||||
int main()
|
||||
{
|
||||
std::printf("the quick brown fox jumps over the lazy god\\n");
|
||||
printf("the quick brown fox jumps over the lazy god\\n");
|
||||
return 0;
|
||||
}
|
||||
''')
|
||||
@@ -27,24 +27,22 @@ def clean_files(source, executable):
|
||||
os.remove(source)
|
||||
os.remove(executable)
|
||||
|
||||
def env_flags() -> list[str]:
|
||||
def call_security_check(cc: str, source: str, executable: str, options) -> tuple:
|
||||
# This should behave the same as AC_TRY_LINK, so arrange well-known flags
|
||||
# in the same order as autoconf would.
|
||||
#
|
||||
# See the definitions for ac_link in autoconf's lib/autoconf/c.m4 file for
|
||||
# reference.
|
||||
flags: list[str] = []
|
||||
for var in ['CXXFLAGS', 'CPPFLAGS', 'LDFLAGS']:
|
||||
flags += filter(None, os.environ.get(var, '').split(' '))
|
||||
return flags
|
||||
env_flags: list[str] = []
|
||||
for var in ['CFLAGS', 'CPPFLAGS', 'LDFLAGS']:
|
||||
env_flags += filter(None, os.environ.get(var, '').split(' '))
|
||||
|
||||
def call_security_check(cxx: str, source: str, executable: str, options) -> tuple:
|
||||
subprocess.run([*cxx,source,'-o',executable] + env_flags() + options, check=True)
|
||||
subprocess.run([*cc,source,'-o',executable] + env_flags + options, check=True)
|
||||
p = subprocess.run([os.path.join(os.path.dirname(__file__), 'security-check.py'), executable], stdout=subprocess.PIPE, text=True)
|
||||
return (p.returncode, p.stdout.rstrip())
|
||||
|
||||
def get_arch(cxx, source, executable):
|
||||
subprocess.run([*cxx, source, '-o', executable] + env_flags(), check=True)
|
||||
def get_arch(cc, source, executable):
|
||||
subprocess.run([*cc, source, '-o', executable], check=True)
|
||||
binary = lief.parse(executable)
|
||||
arch = binary.abstract.header.architecture
|
||||
os.remove(executable)
|
||||
@@ -52,72 +50,101 @@ def get_arch(cxx, source, executable):
|
||||
|
||||
class TestSecurityChecks(unittest.TestCase):
|
||||
def test_ELF(self):
|
||||
source = 'test1.cpp'
|
||||
source = 'test1.c'
|
||||
executable = 'test1'
|
||||
cxx = determine_wellknown_cmd('CXX', 'g++')
|
||||
cc = determine_wellknown_cmd('CC', 'gcc')
|
||||
write_testcode(source)
|
||||
arch = get_arch(cxx, source, executable)
|
||||
arch = get_arch(cc, source, executable)
|
||||
|
||||
if arch == lief.ARCHITECTURES.X86:
|
||||
pass_flags = ['-Wl,-znoexecstack', '-Wl,-zrelro', '-Wl,-z,now', '-pie', '-fPIE', '-Wl,-z,separate-code', '-fcf-protection=full']
|
||||
self.assertEqual(call_security_check(cxx, source, executable, pass_flags + ['-Wl,-zexecstack']), (1, executable + ': failed NX'))
|
||||
self.assertEqual(call_security_check(cxx, source, executable, pass_flags + ['-no-pie','-fno-PIE']), (1, executable + ': failed PIE'))
|
||||
self.assertEqual(call_security_check(cxx, source, executable, pass_flags + ['-Wl,-znorelro']), (1, executable + ': failed RELRO'))
|
||||
self.assertEqual(call_security_check(cxx, source, executable, pass_flags + ['-Wl,-z,noseparate-code']), (1, executable + ': failed SEPARATE_CODE'))
|
||||
self.assertEqual(call_security_check(cxx, source, executable, pass_flags + ['-fcf-protection=none']), (1, executable + ': failed CONTROL_FLOW'))
|
||||
self.assertEqual(call_security_check(cxx, source, executable, pass_flags), (0, ''))
|
||||
self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-zexecstack','-fno-stack-protector','-Wl,-znorelro','-no-pie','-fno-PIE', '-Wl,-z,separate-code']),
|
||||
(1, executable+': failed PIE NX RELRO Canary CONTROL_FLOW'))
|
||||
self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-znoexecstack','-fno-stack-protector','-Wl,-znorelro','-no-pie','-fno-PIE', '-Wl,-z,separate-code']),
|
||||
(1, executable+': failed PIE RELRO Canary CONTROL_FLOW'))
|
||||
self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-znoexecstack','-fstack-protector-all','-Wl,-znorelro','-no-pie','-fno-PIE', '-Wl,-z,separate-code']),
|
||||
(1, executable+': failed PIE RELRO CONTROL_FLOW'))
|
||||
self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-znoexecstack','-fstack-protector-all','-Wl,-znorelro','-pie','-fPIE', '-Wl,-z,separate-code']),
|
||||
(1, executable+': failed RELRO CONTROL_FLOW'))
|
||||
self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-znoexecstack','-fstack-protector-all','-Wl,-zrelro','-Wl,-z,now','-pie','-fPIE', '-Wl,-z,noseparate-code']),
|
||||
(1, executable+': failed separate_code CONTROL_FLOW'))
|
||||
self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-znoexecstack','-fstack-protector-all','-Wl,-zrelro','-Wl,-z,now','-pie','-fPIE', '-Wl,-z,separate-code']),
|
||||
(1, executable+': failed CONTROL_FLOW'))
|
||||
self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-znoexecstack','-fstack-protector-all','-Wl,-zrelro','-Wl,-z,now','-pie','-fPIE', '-Wl,-z,separate-code', '-fcf-protection=full']),
|
||||
(0, ''))
|
||||
else:
|
||||
pass_flags = ['-Wl,-znoexecstack', '-Wl,-zrelro', '-Wl,-z,now', '-pie', '-fPIE', '-Wl,-z,separate-code']
|
||||
self.assertEqual(call_security_check(cxx, source, executable, pass_flags + ['-Wl,-zexecstack']), (1, executable + ': failed NX'))
|
||||
self.assertEqual(call_security_check(cxx, source, executable, pass_flags + ['-no-pie','-fno-PIE']), (1, executable + ': failed PIE'))
|
||||
self.assertEqual(call_security_check(cxx, source, executable, pass_flags + ['-Wl,-znorelro']), (1, executable + ': failed RELRO'))
|
||||
self.assertEqual(call_security_check(cxx, source, executable, pass_flags + ['-Wl,-z,noseparate-code']), (1, executable + ': failed SEPARATE_CODE'))
|
||||
self.assertEqual(call_security_check(cxx, source, executable, pass_flags), (0, ''))
|
||||
self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-zexecstack','-fno-stack-protector','-Wl,-znorelro','-no-pie','-fno-PIE', '-Wl,-z,separate-code']),
|
||||
(1, executable+': failed PIE NX RELRO Canary'))
|
||||
self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-znoexecstack','-fno-stack-protector','-Wl,-znorelro','-no-pie','-fno-PIE', '-Wl,-z,separate-code']),
|
||||
(1, executable+': failed PIE RELRO Canary'))
|
||||
self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-znoexecstack','-fstack-protector-all','-Wl,-znorelro','-no-pie','-fno-PIE', '-Wl,-z,separate-code']),
|
||||
(1, executable+': failed PIE RELRO'))
|
||||
self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-znoexecstack','-fstack-protector-all','-Wl,-znorelro','-pie','-fPIE', '-Wl,-z,separate-code']),
|
||||
(1, executable+': failed RELRO'))
|
||||
self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-znoexecstack','-fstack-protector-all','-Wl,-zrelro','-Wl,-z,now','-pie','-fPIE', '-Wl,-z,noseparate-code']),
|
||||
(1, executable+': failed separate_code'))
|
||||
self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-znoexecstack','-fstack-protector-all','-Wl,-zrelro','-Wl,-z,now','-pie','-fPIE', '-Wl,-z,separate-code']),
|
||||
(0, ''))
|
||||
|
||||
clean_files(source, executable)
|
||||
|
||||
def test_PE(self):
|
||||
source = 'test1.cpp'
|
||||
source = 'test1.c'
|
||||
executable = 'test1.exe'
|
||||
cxx = determine_wellknown_cmd('CXX', 'x86_64-w64-mingw32-g++')
|
||||
cc = determine_wellknown_cmd('CC', 'x86_64-w64-mingw32-gcc')
|
||||
write_testcode(source)
|
||||
|
||||
pass_flags = ['-Wl,--nxcompat', '-Wl,--enable-reloc-section', '-Wl,--dynamicbase', '-Wl,--high-entropy-va', '-pie', '-fPIE', '-fcf-protection=full', '-fstack-protector-all', '-lssp']
|
||||
|
||||
self.assertEqual(call_security_check(cxx, source, executable, pass_flags + ['-fno-stack-protector']), (1, executable + ': failed CANARY'))
|
||||
# https://github.com/lief-project/LIEF/issues/1076 - in future, we could test this individually.
|
||||
# self.assertEqual(call_security_check(cxx, source, executable, pass_flags + ['-Wl,--disable-reloc-section']), (1, executable + ': failed RELOC_SECTION'))
|
||||
self.assertEqual(call_security_check(cxx, source, executable, pass_flags + ['-Wl,--disable-nxcompat']), (1, executable + ': failed NX'))
|
||||
self.assertEqual(call_security_check(cxx, source, executable, pass_flags + ['-Wl,--disable-dynamicbase']), (1, executable + ': failed PIE DYNAMIC_BASE HIGH_ENTROPY_VA')) # -pie -fPIE does nothing without --dynamicbase
|
||||
self.assertEqual(call_security_check(cxx, source, executable, pass_flags + ['-Wl,--disable-high-entropy-va']), (1, executable + ': failed HIGH_ENTROPY_VA'))
|
||||
self.assertEqual(call_security_check(cxx, source, executable, pass_flags + ['-fcf-protection=none']), (1, executable + ': failed CONTROL_FLOW'))
|
||||
self.assertEqual(call_security_check(cxx, source, executable, pass_flags), (0, ''))
|
||||
self.assertEqual(call_security_check(cc, source, executable, ['-Wl,--disable-nxcompat','-Wl,--disable-reloc-section','-Wl,--disable-dynamicbase','-Wl,--disable-high-entropy-va','-no-pie','-fno-PIE','-fno-stack-protector']),
|
||||
(1, executable+': failed PIE DYNAMIC_BASE HIGH_ENTROPY_VA NX RELOC_SECTION CONTROL_FLOW Canary'))
|
||||
self.assertEqual(call_security_check(cc, source, executable, ['-Wl,--nxcompat','-Wl,--disable-reloc-section','-Wl,--disable-dynamicbase','-Wl,--disable-high-entropy-va','-no-pie','-fno-PIE','-fstack-protector-all', '-lssp']),
|
||||
(1, executable+': failed PIE DYNAMIC_BASE HIGH_ENTROPY_VA RELOC_SECTION CONTROL_FLOW'))
|
||||
self.assertEqual(call_security_check(cc, source, executable, ['-Wl,--nxcompat','-Wl,--enable-reloc-section','-Wl,--disable-dynamicbase','-Wl,--disable-high-entropy-va','-no-pie','-fno-PIE','-fstack-protector-all', '-lssp']),
|
||||
(1, executable+': failed PIE DYNAMIC_BASE HIGH_ENTROPY_VA CONTROL_FLOW'))
|
||||
self.assertEqual(call_security_check(cc, source, executable, ['-Wl,--nxcompat','-Wl,--enable-reloc-section','-Wl,--disable-dynamicbase','-Wl,--disable-high-entropy-va','-pie','-fPIE','-fstack-protector-all', '-lssp']),
|
||||
(1, executable+': failed PIE DYNAMIC_BASE HIGH_ENTROPY_VA CONTROL_FLOW')) # -pie -fPIE does nothing unless --dynamicbase is also supplied
|
||||
self.assertEqual(call_security_check(cc, source, executable, ['-Wl,--nxcompat','-Wl,--enable-reloc-section','-Wl,--dynamicbase','-Wl,--disable-high-entropy-va','-pie','-fPIE','-fstack-protector-all', '-lssp']),
|
||||
(1, executable+': failed HIGH_ENTROPY_VA CONTROL_FLOW'))
|
||||
self.assertEqual(call_security_check(cc, source, executable, ['-Wl,--nxcompat','-Wl,--enable-reloc-section','-Wl,--dynamicbase','-Wl,--high-entropy-va','-pie','-fPIE','-fstack-protector-all', '-lssp']),
|
||||
(1, executable+': failed CONTROL_FLOW'))
|
||||
self.assertEqual(call_security_check(cc, source, executable, ['-Wl,--nxcompat','-Wl,--enable-reloc-section','-Wl,--dynamicbase','-Wl,--high-entropy-va','-pie','-fPIE', '-fcf-protection=full','-fstack-protector-all', '-lssp']),
|
||||
(0, ''))
|
||||
|
||||
clean_files(source, executable)
|
||||
|
||||
def test_MACHO(self):
|
||||
source = 'test1.cpp'
|
||||
source = 'test1.c'
|
||||
executable = 'test1'
|
||||
cxx = determine_wellknown_cmd('CXX', 'clang++')
|
||||
cc = determine_wellknown_cmd('CC', 'clang')
|
||||
write_testcode(source)
|
||||
arch = get_arch(cxx, source, executable)
|
||||
arch = get_arch(cc, source, executable)
|
||||
|
||||
if arch == lief.ARCHITECTURES.X86:
|
||||
pass_flags = ['-Wl,-pie', '-fstack-protector-all', '-fcf-protection=full', '-Wl,-fixup_chains']
|
||||
self.assertEqual(call_security_check(cxx, source, executable, pass_flags + ['-Wl,-no_pie', '-Wl,-no_fixup_chains']), (1, executable+': failed FIXUP_CHAINS PIE')) # -fixup_chains is incompatible with -no_pie
|
||||
self.assertEqual(call_security_check(cxx, source, executable, pass_flags + ['-Wl,-no_fixup_chains']), (1, executable + ': failed FIXUP_CHAINS'))
|
||||
self.assertEqual(call_security_check(cxx, source, executable, pass_flags + ['-fno-stack-protector']), (1, executable + ': failed CANARY'))
|
||||
self.assertEqual(call_security_check(cxx, source, executable, pass_flags + ['-Wl,-flat_namespace']), (1, executable + ': failed NOUNDEFS'))
|
||||
self.assertEqual(call_security_check(cxx, source, executable, pass_flags + ['-fcf-protection=none']), (1, executable + ': failed CONTROL_FLOW'))
|
||||
self.assertEqual(call_security_check(cxx, source, executable, pass_flags), (0, ''))
|
||||
self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-no_pie','-Wl,-flat_namespace','-Wl,-allow_stack_execute','-fno-stack-protector', '-Wl,-no_fixup_chains']),
|
||||
(1, executable+': failed NOUNDEFS Canary FIXUP_CHAINS PIE NX CONTROL_FLOW'))
|
||||
self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-no_pie','-Wl,-flat_namespace','-Wl,-allow_stack_execute','-fno-stack-protector', '-Wl,-fixup_chains']),
|
||||
(1, executable+': failed NOUNDEFS Canary PIE NX CONTROL_FLOW'))
|
||||
self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-no_pie','-Wl,-flat_namespace','-Wl,-allow_stack_execute','-fstack-protector-all', '-Wl,-fixup_chains']),
|
||||
(1, executable+': failed NOUNDEFS PIE NX CONTROL_FLOW'))
|
||||
self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-no_pie','-Wl,-flat_namespace','-fstack-protector-all', '-Wl,-fixup_chains']),
|
||||
(1, executable+': failed NOUNDEFS PIE CONTROL_FLOW'))
|
||||
self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-no_pie','-fstack-protector-all', '-Wl,-fixup_chains']),
|
||||
(1, executable+': failed PIE CONTROL_FLOW'))
|
||||
self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-no_pie','-fstack-protector-all', '-Wl,-fixup_chains']),
|
||||
(1, executable+': failed PIE CONTROL_FLOW'))
|
||||
self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-no_pie','-fstack-protector-all', '-fcf-protection=full', '-Wl,-fixup_chains']),
|
||||
(1, executable+': failed PIE'))
|
||||
self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-pie','-fstack-protector-all', '-fcf-protection=full', '-Wl,-fixup_chains']),
|
||||
(0, ''))
|
||||
else:
|
||||
# arm64 darwin doesn't support non-PIE binaries or executable stacks
|
||||
pass_flags = ['-fstack-protector-all', '-Wl,-fixup_chains', '-mbranch-protection=bti']
|
||||
self.assertEqual(call_security_check(cxx, source, executable, pass_flags + ['-mbranch-protection=none']), (1, executable + ': failed BRANCH_PROTECTION'))
|
||||
self.assertEqual(call_security_check(cxx, source, executable, pass_flags + ['-Wl,-no_fixup_chains']), (1, executable + ': failed FIXUP_CHAINS'))
|
||||
self.assertEqual(call_security_check(cxx, source, executable, pass_flags + ['-fno-stack-protector']), (1, executable + ': failed CANARY'))
|
||||
self.assertEqual(call_security_check(cxx, source, executable, pass_flags + ['-Wl,-flat_namespace']), (1, executable + ': failed NOUNDEFS'))
|
||||
self.assertEqual(call_security_check(cxx, source, executable, pass_flags), (0, ''))
|
||||
# arm64 darwin doesn't support non-PIE binaries, control flow or executable stacks
|
||||
self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-flat_namespace','-fno-stack-protector', '-Wl,-no_fixup_chains']),
|
||||
(1, executable+': failed NOUNDEFS Canary FIXUP_CHAINS BRANCH_PROTECTION'))
|
||||
self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-flat_namespace','-fno-stack-protector', '-Wl,-fixup_chains', '-mbranch-protection=bti']),
|
||||
(1, executable+': failed NOUNDEFS Canary'))
|
||||
self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-flat_namespace','-fstack-protector-all', '-Wl,-fixup_chains', '-mbranch-protection=bti']),
|
||||
(1, executable+': failed NOUNDEFS'))
|
||||
self.assertEqual(call_security_check(cc, source, executable, ['-fstack-protector-all', '-Wl,-fixup_chains', '-mbranch-protection=bti']),
|
||||
(0, ''))
|
||||
|
||||
|
||||
clean_files(source, executable)
|
||||
|
||||
|
||||
@@ -11,31 +11,35 @@ import unittest
|
||||
|
||||
from utils import determine_wellknown_cmd
|
||||
|
||||
def call_symbol_check(cxx: list[str], source, executable, options):
|
||||
def call_symbol_check(cc: list[str], source, executable, options):
|
||||
# This should behave the same as AC_TRY_LINK, so arrange well-known flags
|
||||
# in the same order as autoconf would.
|
||||
#
|
||||
# See the definitions for ac_link in autoconf's lib/autoconf/c.m4 file for
|
||||
# reference.
|
||||
env_flags: list[str] = []
|
||||
for var in ['CXXFLAGS', 'CPPFLAGS', 'LDFLAGS']:
|
||||
for var in ['CFLAGS', 'CPPFLAGS', 'LDFLAGS']:
|
||||
env_flags += filter(None, os.environ.get(var, '').split(' '))
|
||||
|
||||
subprocess.run([*cxx,source,'-o',executable] + env_flags + options, check=True)
|
||||
subprocess.run([*cc,source,'-o',executable] + env_flags + options, check=True)
|
||||
p = subprocess.run([os.path.join(os.path.dirname(__file__), 'symbol-check.py'), executable], stdout=subprocess.PIPE, text=True)
|
||||
os.remove(source)
|
||||
os.remove(executable)
|
||||
return (p.returncode, p.stdout.rstrip())
|
||||
|
||||
def get_machine(cc: list[str]):
|
||||
p = subprocess.run([*cc,'-dumpmachine'], stdout=subprocess.PIPE, text=True)
|
||||
return p.stdout.rstrip()
|
||||
|
||||
class TestSymbolChecks(unittest.TestCase):
|
||||
def test_ELF(self):
|
||||
source = 'test1.cpp'
|
||||
source = 'test1.c'
|
||||
executable = 'test1'
|
||||
cxx = determine_wellknown_cmd('CXX', 'g++')
|
||||
cc = determine_wellknown_cmd('CC', 'gcc')
|
||||
|
||||
# -lutil is part of the libc6 package so a safe bet that it's installed
|
||||
# it's also out of context enough that it's unlikely to ever become a real dependency
|
||||
source = 'test2.cpp'
|
||||
source = 'test2.c'
|
||||
executable = 'test2'
|
||||
with open(source, 'w', encoding="utf8") as f:
|
||||
f.write('''
|
||||
@@ -48,31 +52,31 @@ class TestSymbolChecks(unittest.TestCase):
|
||||
}
|
||||
''')
|
||||
|
||||
self.assertEqual(call_symbol_check(cxx, source, executable, ['-lutil']),
|
||||
self.assertEqual(call_symbol_check(cc, source, executable, ['-lutil']),
|
||||
(1, executable + ': libutil.so.1 is not in ALLOWED_LIBRARIES!\n' +
|
||||
executable + ': failed LIBRARY_DEPENDENCIES'))
|
||||
|
||||
# finally, check a simple conforming binary
|
||||
source = 'test3.cpp'
|
||||
source = 'test3.c'
|
||||
executable = 'test3'
|
||||
with open(source, 'w', encoding="utf8") as f:
|
||||
f.write('''
|
||||
#include <cstdio>
|
||||
#include <stdio.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
std::printf("42");
|
||||
printf("42");
|
||||
return 0;
|
||||
}
|
||||
''')
|
||||
|
||||
self.assertEqual(call_symbol_check(cxx, source, executable, []),
|
||||
self.assertEqual(call_symbol_check(cc, source, executable, []),
|
||||
(0, ''))
|
||||
|
||||
def test_MACHO(self):
|
||||
source = 'test1.cpp'
|
||||
source = 'test1.c'
|
||||
executable = 'test1'
|
||||
cxx = determine_wellknown_cmd('CXX', 'clang++')
|
||||
cc = determine_wellknown_cmd('CC', 'clang')
|
||||
|
||||
with open(source, 'w', encoding="utf8") as f:
|
||||
f.write('''
|
||||
@@ -86,11 +90,11 @@ class TestSymbolChecks(unittest.TestCase):
|
||||
|
||||
''')
|
||||
|
||||
self.assertEqual(call_symbol_check(cxx, source, executable, ['-lexpat', '-Wl,-platform_version','-Wl,macos', '-Wl,11.4', '-Wl,11.4']),
|
||||
self.assertEqual(call_symbol_check(cc, source, executable, ['-lexpat', '-Wl,-platform_version','-Wl,macos', '-Wl,11.4', '-Wl,11.4']),
|
||||
(1, 'libexpat.1.dylib is not in ALLOWED_LIBRARIES!\n' +
|
||||
f'{executable}: failed DYNAMIC_LIBRARIES MIN_OS SDK'))
|
||||
|
||||
source = 'test2.cpp'
|
||||
source = 'test2.c'
|
||||
executable = 'test2'
|
||||
with open(source, 'w', encoding="utf8") as f:
|
||||
f.write('''
|
||||
@@ -103,10 +107,10 @@ class TestSymbolChecks(unittest.TestCase):
|
||||
}
|
||||
''')
|
||||
|
||||
self.assertEqual(call_symbol_check(cxx, source, executable, ['-framework', 'CoreGraphics', '-Wl,-platform_version','-Wl,macos', '-Wl,11.4', '-Wl,11.4']),
|
||||
self.assertEqual(call_symbol_check(cc, source, executable, ['-framework', 'CoreGraphics', '-Wl,-platform_version','-Wl,macos', '-Wl,11.4', '-Wl,11.4']),
|
||||
(1, f'{executable}: failed MIN_OS SDK'))
|
||||
|
||||
source = 'test3.cpp'
|
||||
source = 'test3.c'
|
||||
executable = 'test3'
|
||||
with open(source, 'w', encoding="utf8") as f:
|
||||
f.write('''
|
||||
@@ -116,13 +120,13 @@ class TestSymbolChecks(unittest.TestCase):
|
||||
}
|
||||
''')
|
||||
|
||||
self.assertEqual(call_symbol_check(cxx, source, executable, ['-Wl,-platform_version','-Wl,macos', '-Wl,11.0', '-Wl,11.4']),
|
||||
self.assertEqual(call_symbol_check(cc, source, executable, ['-Wl,-platform_version','-Wl,macos', '-Wl,11.0', '-Wl,11.4']),
|
||||
(1, f'{executable}: failed SDK'))
|
||||
|
||||
def test_PE(self):
|
||||
source = 'test1.cpp'
|
||||
source = 'test1.c'
|
||||
executable = 'test1.exe'
|
||||
cxx = determine_wellknown_cmd('CXX', 'x86_64-w64-mingw32-g++')
|
||||
cc = determine_wellknown_cmd('CC', 'x86_64-w64-mingw32-gcc')
|
||||
|
||||
with open(source, 'w', encoding="utf8") as f:
|
||||
f.write('''
|
||||
@@ -135,11 +139,11 @@ class TestSymbolChecks(unittest.TestCase):
|
||||
}
|
||||
''')
|
||||
|
||||
self.assertEqual(call_symbol_check(cxx, source, executable, ['-lpdh', '-Wl,--major-subsystem-version', '-Wl,6', '-Wl,--minor-subsystem-version', '-Wl,1']),
|
||||
self.assertEqual(call_symbol_check(cc, source, executable, ['-lpdh', '-Wl,--major-subsystem-version', '-Wl,6', '-Wl,--minor-subsystem-version', '-Wl,1']),
|
||||
(1, 'pdh.dll is not in ALLOWED_LIBRARIES!\n' +
|
||||
executable + ': failed DYNAMIC_LIBRARIES'))
|
||||
|
||||
source = 'test2.cpp'
|
||||
source = 'test2.c'
|
||||
executable = 'test2.exe'
|
||||
|
||||
with open(source, 'w', encoding="utf8") as f:
|
||||
@@ -150,10 +154,10 @@ class TestSymbolChecks(unittest.TestCase):
|
||||
}
|
||||
''')
|
||||
|
||||
self.assertEqual(call_symbol_check(cxx, source, executable, ['-Wl,--major-subsystem-version', '-Wl,9', '-Wl,--minor-subsystem-version', '-Wl,9']),
|
||||
self.assertEqual(call_symbol_check(cc, source, executable, ['-Wl,--major-subsystem-version', '-Wl,9', '-Wl,--minor-subsystem-version', '-Wl,9']),
|
||||
(1, executable + ': failed SUBSYSTEM_VERSION'))
|
||||
|
||||
source = 'test3.cpp'
|
||||
source = 'test3.c'
|
||||
executable = 'test3.exe'
|
||||
with open(source, 'w', encoding="utf8") as f:
|
||||
f.write('''
|
||||
@@ -166,7 +170,7 @@ class TestSymbolChecks(unittest.TestCase):
|
||||
}
|
||||
''')
|
||||
|
||||
self.assertEqual(call_symbol_check(cxx, source, executable, ['-lole32', '-Wl,--major-subsystem-version', '-Wl,6', '-Wl,--minor-subsystem-version', '-Wl,1']),
|
||||
self.assertEqual(call_symbol_check(cc, source, executable, ['-lole32', '-Wl,--major-subsystem-version', '-Wl,6', '-Wl,--minor-subsystem-version', '-Wl,1']),
|
||||
(0, ''))
|
||||
|
||||
|
||||
|
||||
@@ -17,21 +17,21 @@ NON_DETERMINISTIC_TESTS=(
|
||||
"blockfilter_index_tests/blockfilter_index_initial_sync" # src/checkqueue.h: In CCheckQueue::Loop(): while (queue.empty()) { ... }
|
||||
"coinselector_tests/knapsack_solver_test" # coinselector_tests.cpp: if (equal_sets(setCoinsRet, setCoinsRet2))
|
||||
"fs_tests/fsbridge_fstream" # deterministic test failure?
|
||||
"miner_tests/CreateNewBlock_validity" # validation.cpp: if (signals.CallbacksPending() > 10)
|
||||
"miner_tests/CreateNewBlock_validity" # validation.cpp: if (GetMainSignals().CallbacksPending() > 10)
|
||||
"scheduler_tests/manythreads" # scheduler.cpp: CScheduler::serviceQueue()
|
||||
"scheduler_tests/singlethreadedscheduler_ordered" # scheduler.cpp: CScheduler::serviceQueue()
|
||||
"txvalidationcache_tests/checkinputs_test" # validation.cpp: if (signals.CallbacksPending() > 10)
|
||||
"txvalidationcache_tests/tx_mempool_block_doublespend" # validation.cpp: if (signals.CallbacksPending() > 10)
|
||||
"txindex_tests/txindex_initial_sync" # validation.cpp: if (signals.CallbacksPending() > 10)
|
||||
"txvalidation_tests/tx_mempool_reject_coinbase" # validation.cpp: if (signals.CallbacksPending() > 10)
|
||||
"validation_block_tests/processnewblock_signals_ordering" # validation.cpp: if (signals.CallbacksPending() > 10)
|
||||
"wallet_tests/coin_mark_dirty_immature_credit" # validation.cpp: if (signals.CallbacksPending() > 10)
|
||||
"wallet_tests/dummy_input_size_test" # validation.cpp: if (signals.CallbacksPending() > 10)
|
||||
"wallet_tests/importmulti_rescan" # validation.cpp: if (signals.CallbacksPending() > 10)
|
||||
"wallet_tests/importwallet_rescan" # validation.cpp: if (signals.CallbacksPending() > 10)
|
||||
"wallet_tests/ListCoins" # validation.cpp: if (signals.CallbacksPending() > 10)
|
||||
"wallet_tests/scan_for_wallet_transactions" # validation.cpp: if (signals.CallbacksPending() > 10)
|
||||
"wallet_tests/wallet_disableprivkeys" # validation.cpp: if (signals.CallbacksPending() > 10)
|
||||
"txvalidationcache_tests/checkinputs_test" # validation.cpp: if (GetMainSignals().CallbacksPending() > 10)
|
||||
"txvalidationcache_tests/tx_mempool_block_doublespend" # validation.cpp: if (GetMainSignals().CallbacksPending() > 10)
|
||||
"txindex_tests/txindex_initial_sync" # validation.cpp: if (GetMainSignals().CallbacksPending() > 10)
|
||||
"txvalidation_tests/tx_mempool_reject_coinbase" # validation.cpp: if (GetMainSignals().CallbacksPending() > 10)
|
||||
"validation_block_tests/processnewblock_signals_ordering" # validation.cpp: if (GetMainSignals().CallbacksPending() > 10)
|
||||
"wallet_tests/coin_mark_dirty_immature_credit" # validation.cpp: if (GetMainSignals().CallbacksPending() > 10)
|
||||
"wallet_tests/dummy_input_size_test" # validation.cpp: if (GetMainSignals().CallbacksPending() > 10)
|
||||
"wallet_tests/importmulti_rescan" # validation.cpp: if (GetMainSignals().CallbacksPending() > 10)
|
||||
"wallet_tests/importwallet_rescan" # validation.cpp: if (GetMainSignals().CallbacksPending() > 10)
|
||||
"wallet_tests/ListCoins" # validation.cpp: if (GetMainSignals().CallbacksPending() > 10)
|
||||
"wallet_tests/scan_for_wallet_transactions" # validation.cpp: if (GetMainSignals().CallbacksPending() > 10)
|
||||
"wallet_tests/wallet_disableprivkeys" # validation.cpp: if (GetMainSignals().CallbacksPending() > 10)
|
||||
)
|
||||
|
||||
TEST_BITCOIN_BINARY="src/test/test_bitcoin"
|
||||
|
||||
@@ -138,7 +138,7 @@ echo
|
||||
echo "-- Now: add the following to CMainParams::m_assumeutxo_data"
|
||||
echo " in src/kernel/chainparams.cpp, and recompile:"
|
||||
echo
|
||||
echo " {.height = ${RPC_BASE_HEIGHT}, .hash_serialized = AssumeutxoHash{uint256{\"${RPC_AU}\"}}, .m_chain_tx_count = ${RPC_NCHAINTX}, .blockhash = consteval_ctor(uint256{\"${RPC_BLOCKHASH}\"})},"
|
||||
echo " {${RPC_BASE_HEIGHT}, AssumeutxoHash{uint256S(\"0x${RPC_AU}\")}, ${RPC_NCHAINTX}, uint256S(\"0x${RPC_BLOCKHASH}\")},"
|
||||
echo
|
||||
echo
|
||||
echo "-- IBDing more blocks to the server node (height=$FINAL_HEIGHT) so there is a diff between snapshot and tip..."
|
||||
|
||||
@@ -36,16 +36,6 @@ if (( GENERATE_AT_HEIGHT < PRUNED )); then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Check current block height to ensure the node has synchronized past the required block
|
||||
CURRENT_BLOCK_HEIGHT=$(${BITCOIN_CLI_CALL} getblockcount)
|
||||
PIVOT_BLOCK_HEIGHT=$(( GENERATE_AT_HEIGHT + 1 ))
|
||||
|
||||
if (( PIVOT_BLOCK_HEIGHT > CURRENT_BLOCK_HEIGHT )); then
|
||||
(>&2 echo "Error: The node has not yet synchronized to block height ${PIVOT_BLOCK_HEIGHT}.")
|
||||
(>&2 echo "Please wait until the node has synchronized past this block height and try again.")
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Early exit if file at OUTPUT_PATH already exists
|
||||
if [[ -e "$OUTPUT_PATH" ]]; then
|
||||
(>&2 echo "Error: $OUTPUT_PATH already exists or is not a valid path.")
|
||||
|
||||
@@ -319,7 +319,7 @@ Source: https://logs.guix.gnu.org/guix/2020-11-12.log#232527
|
||||
Start by cloning Guix:
|
||||
|
||||
```
|
||||
git clone https://git.savannah.gnu.org/git/guix.git
|
||||
git clone https://codeberg.org/guix/guix.git
|
||||
cd guix
|
||||
```
|
||||
|
||||
@@ -607,7 +607,7 @@ checklist.
|
||||
```
|
||||
Generation 38 Feb 22 2021 16:39:31 (current)
|
||||
guix f350df4
|
||||
repository URL: https://git.savannah.gnu.org/git/guix.git
|
||||
repository URL: https://codeberg.org/guix/guix.git
|
||||
branch: version-1.2.0
|
||||
commit: f350df405fbcd5b9e27e6b6aa500da7f101f41e7
|
||||
```
|
||||
@@ -671,8 +671,6 @@ More information: https://github.com/python/cpython/issues/81765
|
||||
OpenSSL includes tests that will fail once some certificate has expired.
|
||||
The workarounds from the GnuTLS section immediately below can be used.
|
||||
|
||||
For openssl-1.1.1l use 2022-05-01 as the date.
|
||||
|
||||
### GnuTLS: test-suite FAIL: status-request-revoked
|
||||
|
||||
*The derivation is likely identified by: `/gnu/store/vhphki5sg9xkdhh2pbc8gi6vhpfzryf0-gnutls-3.6.12.drv`*
|
||||
@@ -707,12 +705,11 @@ authorized.
|
||||
This workaround was described [here](https://issues.guix.gnu.org/44559#5).
|
||||
|
||||
Basically:
|
||||
|
||||
1. Turn off NTP
|
||||
2. Set system time to 2020-10-01
|
||||
3. guix build --no-substitutes /gnu/store/vhphki5sg9xkdhh2pbc8gi6vhpfzryf0-gnutls-3.6.12.drv
|
||||
4. Set system time back to accurate current time
|
||||
5. Turn NTP back on
|
||||
2. Turn off NTP
|
||||
3. Set system time to 2020-10-01
|
||||
4. guix build --no-substitutes /gnu/store/vhphki5sg9xkdhh2pbc8gi6vhpfzryf0-gnutls-3.6.12.drv
|
||||
5. Set system time back to accurate current time
|
||||
6. Turn NTP back on
|
||||
|
||||
For example,
|
||||
|
||||
@@ -760,8 +757,8 @@ Please see the following links for more details:
|
||||
|
||||
- An upstream coreutils bug has been filed: [debbugs#47940](https://debbugs.gnu.org/cgi/bugreport.cgi?bug=47940)
|
||||
- A Guix bug detailing the underlying problem has been filed: [guix-issues#47935](https://issues.guix.gnu.org/47935), [guix-issues#49985](https://issues.guix.gnu.org/49985#5)
|
||||
- A commit to skip this test in Guix has been merged into the core-updates branch:
|
||||
[savannah/guix@6ba1058](https://git.savannah.gnu.org/cgit/guix.git/commit/?id=6ba1058df0c4ce5611c2367531ae5c3cdc729ab4)
|
||||
- A commit to skip this test is included since Guix 1.4.0:
|
||||
[codeberg/guix@6ba1058](https://codeberg.org/guix/guix/commit/6ba1058df0c4ce5611c2367531ae5c3cdc729ab4)
|
||||
|
||||
|
||||
[install-script]: #options-1-and-2-using-the-official-shell-installer-script-or-binary-tarball
|
||||
|
||||
@@ -74,8 +74,7 @@ mkdir -p "$VERSION_BASE"
|
||||
################
|
||||
|
||||
# Default to building for all supported HOSTs (overridable by environment)
|
||||
# powerpc64le-linux-gnu currently disabled due non-determinism issues across build arches.
|
||||
export HOSTS="${HOSTS:-x86_64-linux-gnu arm-linux-gnueabihf aarch64-linux-gnu riscv64-linux-gnu powerpc64-linux-gnu
|
||||
export HOSTS="${HOSTS:-x86_64-linux-gnu arm-linux-gnueabihf aarch64-linux-gnu riscv64-linux-gnu powerpc64-linux-gnu powerpc64le-linux-gnu
|
||||
x86_64-w64-mingw32
|
||||
x86_64-apple-darwin arm64-apple-darwin}"
|
||||
|
||||
@@ -361,10 +360,6 @@ INFO: Building ${VERSION:?not set} for platform triple ${HOST:?not set}:
|
||||
...bind-mounted in container to: '$(DISTSRC_BASE=/distsrc-base && distsrc_for_host "$HOST")'
|
||||
...outputting in: '$(outdir_for_host "$HOST")'
|
||||
...bind-mounted in container to: '$(OUTDIR_BASE=/outdir-base && outdir_for_host "$HOST")'
|
||||
ADDITIONAL FLAGS (if set)
|
||||
ADDITIONAL_GUIX_COMMON_FLAGS: ${ADDITIONAL_GUIX_COMMON_FLAGS}
|
||||
ADDITIONAL_GUIX_ENVIRONMENT_FLAGS: ${ADDITIONAL_GUIX_ENVIRONMENT_FLAGS}
|
||||
ADDITIONAL_GUIX_TIMEMACHINE_FLAGS: ${ADDITIONAL_GUIX_TIMEMACHINE_FLAGS}
|
||||
EOF
|
||||
|
||||
# Run the build script 'contrib/guix/libexec/build.sh' in the build
|
||||
|
||||
@@ -61,6 +61,7 @@ store_path() {
|
||||
# Set environment variables to point the NATIVE toolchain to the right
|
||||
# includes/libs
|
||||
NATIVE_GCC="$(store_path gcc-toolchain)"
|
||||
NATIVE_GCC_STATIC="$(store_path gcc-toolchain static)"
|
||||
|
||||
unset LIBRARY_PATH
|
||||
unset CPATH
|
||||
@@ -69,17 +70,11 @@ unset CPLUS_INCLUDE_PATH
|
||||
unset OBJC_INCLUDE_PATH
|
||||
unset OBJCPLUS_INCLUDE_PATH
|
||||
|
||||
export LIBRARY_PATH="${NATIVE_GCC}/lib:${NATIVE_GCC_STATIC}/lib"
|
||||
export C_INCLUDE_PATH="${NATIVE_GCC}/include"
|
||||
export CPLUS_INCLUDE_PATH="${NATIVE_GCC}/include/c++:${NATIVE_GCC}/include"
|
||||
|
||||
case "$HOST" in
|
||||
*darwin*) export LIBRARY_PATH="${NATIVE_GCC}/lib" ;; # Required for qt/qmake
|
||||
*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"
|
||||
;;
|
||||
esac
|
||||
export OBJC_INCLUDE_PATH="${NATIVE_GCC}/include"
|
||||
export OBJCPLUS_INCLUDE_PATH="${NATIVE_GCC}/include/c++:${NATIVE_GCC}/include"
|
||||
|
||||
# Set environment variables to point the CROSS toolchain to the right
|
||||
# includes/libs for $HOST
|
||||
@@ -131,7 +126,18 @@ for p in "${PATHS[@]}"; do
|
||||
done
|
||||
|
||||
# Disable Guix ld auto-rpath behavior
|
||||
export GUIX_LD_WRAPPER_DISABLE_RPATH=yes
|
||||
case "$HOST" in
|
||||
*darwin*)
|
||||
# The auto-rpath behavior is necessary for darwin builds as some native
|
||||
# tools built by depends refer to and depend on Guix-built native
|
||||
# libraries
|
||||
#
|
||||
# After the native packages in depends are built, the ld wrapper should
|
||||
# no longer affect our build, as clang would instead reach for
|
||||
# x86_64-apple-darwin-ld from cctools
|
||||
;;
|
||||
*) export GUIX_LD_WRAPPER_DISABLE_RPATH=yes ;;
|
||||
esac
|
||||
|
||||
# Make /usr/bin if it doesn't exist
|
||||
[ -e /usr/bin ] || mkdir -p /usr/bin
|
||||
@@ -160,6 +166,16 @@ esac
|
||||
# Environment variables for determinism
|
||||
export TAR_OPTIONS="--owner=0 --group=0 --numeric-owner --mtime='@${SOURCE_DATE_EPOCH}' --sort=name"
|
||||
export TZ="UTC"
|
||||
case "$HOST" in
|
||||
*darwin*)
|
||||
# cctools AR, unlike GNU binutils AR, does not have a deterministic mode
|
||||
# or a configure flag to enable determinism by default, it only
|
||||
# understands if this env-var is set or not. See:
|
||||
#
|
||||
# https://github.com/tpoechtrager/cctools-port/blob/55562e4073dea0fbfd0b20e0bf69ffe6390c7f97/cctools/ar/archive.c#L334
|
||||
export ZERO_AR_DATE=yes
|
||||
;;
|
||||
esac
|
||||
|
||||
####################
|
||||
# Depends Building #
|
||||
@@ -176,16 +192,9 @@ make -C depends --jobs="$JOBS" HOST="$HOST" \
|
||||
x86_64_linux_AR=x86_64-linux-gnu-gcc-ar \
|
||||
x86_64_linux_RANLIB=x86_64-linux-gnu-gcc-ranlib \
|
||||
x86_64_linux_NM=x86_64-linux-gnu-gcc-nm \
|
||||
x86_64_linux_STRIP=x86_64-linux-gnu-strip
|
||||
x86_64_linux_STRIP=x86_64-linux-gnu-strip \
|
||||
FORCE_USE_SYSTEM_CLANG=1
|
||||
|
||||
case "$HOST" in
|
||||
*darwin*)
|
||||
# Unset now that Qt is built
|
||||
unset C_INCLUDE_PATH
|
||||
unset CPLUS_INCLUDE_PATH
|
||||
unset LIBRARY_PATH
|
||||
;;
|
||||
esac
|
||||
|
||||
###########################
|
||||
# Source Tarball Building #
|
||||
@@ -291,9 +300,11 @@ mkdir -p "$DISTSRC"
|
||||
|
||||
case "$HOST" in
|
||||
*darwin*)
|
||||
make osx_volname ${V:+V=1}
|
||||
make deploydir ${V:+V=1}
|
||||
mkdir -p "unsigned-app-${HOST}"
|
||||
cp --target-directory="unsigned-app-${HOST}" \
|
||||
osx_volname \
|
||||
contrib/macdeploy/detached-sig-create.sh
|
||||
mv --target-directory="unsigned-app-${HOST}" dist
|
||||
(
|
||||
@@ -310,16 +321,26 @@ mkdir -p "$DISTSRC"
|
||||
(
|
||||
cd installed
|
||||
|
||||
case "$HOST" in
|
||||
*mingw*)
|
||||
mv --target-directory="$DISTNAME"/lib/ "$DISTNAME"/bin/*.dll
|
||||
;;
|
||||
esac
|
||||
|
||||
# Prune libtool and object archives
|
||||
find . -name "lib*.la" -delete
|
||||
find . -name "lib*.a" -delete
|
||||
|
||||
# Prune pkg-config files
|
||||
rm -rf "${DISTNAME}/lib/pkgconfig"
|
||||
|
||||
case "$HOST" in
|
||||
*darwin*) ;;
|
||||
*)
|
||||
# Split binaries from their debug symbols
|
||||
# Split binaries and libraries from their debug symbols
|
||||
{
|
||||
find "${DISTNAME}/bin" -type f -executable -print0
|
||||
find "${DISTNAME}/lib" -type f -print0
|
||||
} | xargs -0 -P"$JOBS" -I{} "${DISTSRC}/contrib/devtools/split-debug.sh" {} {} {}.dbg
|
||||
;;
|
||||
esac
|
||||
|
||||
@@ -50,8 +50,8 @@ fi
|
||||
# across time.
|
||||
time-machine() {
|
||||
# shellcheck disable=SC2086
|
||||
guix time-machine --url=https://git.savannah.gnu.org/git/guix.git \
|
||||
--commit=7bf1d7aeaffba15c4f680f93ae88fbef25427252 \
|
||||
guix time-machine --url=https://codeberg.org/guix/guix.git \
|
||||
--commit=d5ca4d4fd713a9f7e17e074a1e37dda99bbb09fc \
|
||||
--cores="$JOBS" \
|
||||
--keep-failed \
|
||||
--fallback \
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
(guix build-system gnu)
|
||||
(guix build-system python)
|
||||
(guix build-system trivial)
|
||||
(guix download)
|
||||
(guix gexp)
|
||||
(guix git-download)
|
||||
((guix licenses) #:prefix license:)
|
||||
@@ -92,25 +91,14 @@ chain for " target " development."))
|
||||
(home-page (package-home-page xgcc))
|
||||
(license (package-license xgcc)))))
|
||||
|
||||
(define base-gcc
|
||||
(package
|
||||
(inherit gcc-12) ;; 12.3.0
|
||||
(version "12.4.0")
|
||||
(source (origin
|
||||
(method url-fetch)
|
||||
(uri (string-append "mirror://gnu/gcc/gcc-"
|
||||
version "/gcc-" version ".tar.xz"))
|
||||
(sha256
|
||||
(base32
|
||||
"0xcida8l2wykvvzvpcrcn649gj0ijn64gwxbplacpg6c0hk6akvh"))))))
|
||||
|
||||
(define base-gcc gcc-10)
|
||||
(define base-linux-kernel-headers linux-libre-headers-6.1)
|
||||
|
||||
(define* (make-bitcoin-cross-toolchain target
|
||||
#:key
|
||||
(base-gcc-for-libc linux-base-gcc)
|
||||
(base-kernel-headers base-linux-kernel-headers)
|
||||
(base-libc glibc-2.31)
|
||||
(base-libc glibc-2.27)
|
||||
(base-gcc linux-base-gcc))
|
||||
"Convenience wrapper around MAKE-CROSS-TOOLCHAIN with default values
|
||||
desirable for building Bitcoin Core release binaries."
|
||||
@@ -122,23 +110,13 @@ 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")))
|
||||
|
||||
(define (binutils-mingw-patches binutils)
|
||||
(package-with-extra-patches binutils
|
||||
(search-our-patches "binutils-unaligned-default.patch")))
|
||||
|
||||
(define (winpthreads-patches mingw-w64-x86_64-winpthreads)
|
||||
(package-with-extra-patches mingw-w64-x86_64-winpthreads
|
||||
(search-our-patches "winpthreads-remap-guix-store.patch")))
|
||||
(search-our-patches "gcc-remap-guix-store.patch"
|
||||
"vmov-alignment.patch")))
|
||||
|
||||
(define (make-mingw-pthreads-cross-toolchain target)
|
||||
"Create a cross-compilation toolchain package for TARGET"
|
||||
(let* ((xbinutils (binutils-mingw-patches (cross-binutils target)))
|
||||
(machine (substring target 0 (string-index target #\-)))
|
||||
(pthreads-xlibc (winpthreads-patches (make-mingw-w64 machine
|
||||
#:xgcc (cross-gcc target #:xgcc (gcc-mingw-patches base-gcc))
|
||||
#:with-winpthreads? #t)))
|
||||
(let* ((xbinutils (cross-binutils target))
|
||||
(pthreads-xlibc mingw-w64-x86_64-winpthreads)
|
||||
(pthreads-xgcc (cross-gcc target
|
||||
#:xgcc (gcc-mingw-patches mingw-w64-base-gcc)
|
||||
#:xbinutils xbinutils
|
||||
@@ -445,7 +423,6 @@ inspecting signatures in Mach-O binaries.")
|
||||
(list "--enable-initfini-array=yes",
|
||||
"--enable-default-ssp=yes",
|
||||
"--enable-default-pie=yes",
|
||||
"--enable-standard-branch-protection=yes",
|
||||
building-on)))
|
||||
((#:phases phases)
|
||||
`(modify-phases ,phases
|
||||
@@ -459,21 +436,24 @@ inspecting signatures in Mach-O binaries.")
|
||||
(("-rpath=") "-rpath-link="))
|
||||
#t))))))))
|
||||
|
||||
(define-public glibc-2.31
|
||||
(let ((commit "8e30f03744837a85e33d84ccd34ed3abe30d37c3"))
|
||||
(define-public glibc-2.27
|
||||
(package
|
||||
(inherit glibc) ;; 2.35
|
||||
(version "2.31")
|
||||
(inherit glibc-2.31)
|
||||
(version "2.27")
|
||||
(source (origin
|
||||
(method git-fetch)
|
||||
(uri (git-reference
|
||||
(url "https://sourceware.org/git/glibc.git")
|
||||
(commit commit)))
|
||||
(file-name (git-file-name "glibc" commit))
|
||||
(commit "73886db6218e613bd6d4edf529f11e008a6c2fa6")))
|
||||
(file-name (git-file-name "glibc" "73886db6218e613bd6d4edf529f11e008a6c2fa6"))
|
||||
(sha256
|
||||
(base32
|
||||
"1zi0s9yy5zkisw823vivn7zlj8w6g9p3mm7lmlqiixcxdkz4dbn6"))
|
||||
(patches (search-our-patches "glibc-guix-prefix.patch"))))
|
||||
"0azpb9cvnbv25zg8019rqz48h8i2257ngyjg566dlnp74ivrs9vq"))
|
||||
(patches (search-our-patches "glibc-2.27-riscv64-Use-__has_include-to-include-asm-syscalls.h.patch"
|
||||
"glibc-2.27-fcommon.patch"
|
||||
"glibc-2.27-guix-prefix.patch"
|
||||
"glibc-2.27-no-librt.patch"
|
||||
"glibc-2.27-powerpc-ldbrx.patch"))))
|
||||
(arguments
|
||||
(substitute-keyword-arguments (package-arguments glibc)
|
||||
((#:configure-flags flags)
|
||||
@@ -489,13 +469,12 @@ inspecting signatures in Mach-O binaries.")
|
||||
(lambda* (#:key outputs #:allow-other-keys)
|
||||
;; Install the rpc data base file under `$out/etc/rpc'.
|
||||
;; Otherwise build will fail with "Permission denied."
|
||||
;; Can be removed when we are building 2.32 or later.
|
||||
(let ((out (assoc-ref outputs "out")))
|
||||
(substitute* "sunrpc/Makefile"
|
||||
(("^\\$\\(inst_sysconfdir\\)/rpc(.*)$" _ suffix)
|
||||
(string-append out "/etc/rpc" suffix "\n"))
|
||||
(("^install-others =.*$")
|
||||
(string-append "install-others = " out "/etc/rpc\n")))))))))))))
|
||||
(string-append "install-others = " out "/etc/rpc\n"))))))))))))
|
||||
|
||||
(packages->manifest
|
||||
(append
|
||||
@@ -516,16 +495,19 @@ inspecting signatures in Mach-O binaries.")
|
||||
moreutils
|
||||
;; Compression and archiving
|
||||
tar
|
||||
bzip2
|
||||
gzip
|
||||
xz
|
||||
;; Build tools
|
||||
gcc-toolchain-12
|
||||
cmake-minimal
|
||||
gnu-make
|
||||
libtool
|
||||
autoconf-2.71
|
||||
automake
|
||||
pkg-config
|
||||
bison
|
||||
;; Native GCC 10 toolchain
|
||||
gcc-toolchain-10
|
||||
(list gcc-toolchain-10 "static")
|
||||
;; Scripting
|
||||
python-minimal ;; (3.10)
|
||||
;; Git
|
||||
@@ -534,19 +516,14 @@ inspecting signatures in Mach-O binaries.")
|
||||
python-lief)
|
||||
(let ((target (getenv "HOST")))
|
||||
(cond ((string-suffix? "-mingw32" target)
|
||||
;; Windows
|
||||
(list zip
|
||||
(make-mingw-pthreads-cross-toolchain "x86_64-w64-mingw32")
|
||||
nsis-x86_64
|
||||
nss-certs
|
||||
osslsigncode))
|
||||
((string-contains target "-linux-")
|
||||
(list bison
|
||||
(list gcc-toolchain-12 "static")
|
||||
(make-bitcoin-cross-toolchain target)))
|
||||
(list (make-bitcoin-cross-toolchain target)))
|
||||
((string-contains target "darwin")
|
||||
(list clang-toolchain-18
|
||||
lld-18
|
||||
(make-lld-wrapper lld-18 #:lld-as-ld? #t)
|
||||
python-signapple
|
||||
zip))
|
||||
(list clang-toolchain-17 binutils cmake-minimal python-signapple zip))
|
||||
(else '())))))
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
commit 6537181f59ed186a341db621812a6bc35e22eaf6
|
||||
Author: fanquake <fanquake@gmail.com>
|
||||
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
|
||||
@@ -1,9 +1,14 @@
|
||||
Without ffile-prefix-map, the debug symbols will contain paths for the
|
||||
guix store which will include the hashes of each package. However, the
|
||||
hash for the same package will differ when on different architectures.
|
||||
In order to be reproducible regardless of the architecture used to build
|
||||
the package, map all guix store prefixes to something fixed, e.g. /usr.
|
||||
From aad25427e74f387412e8bc9a9d7bbc6c496c792f Mon Sep 17 00:00:00 2001
|
||||
From: Andrew Chow <achow101-github@achow101.com>
|
||||
Date: Wed, 6 Jul 2022 16:49:41 -0400
|
||||
Subject: [PATCH] guix: remap guix store paths to /usr
|
||||
|
||||
---
|
||||
libgcc/Makefile.in | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/libgcc/Makefile.in b/libgcc/Makefile.in
|
||||
index 851e7657d07..476c2becd1c 100644
|
||||
--- a/libgcc/Makefile.in
|
||||
+++ b/libgcc/Makefile.in
|
||||
@@ -854,7 +854,7 @@ endif
|
||||
|
||||
34
contrib/guix/patches/glibc-2.27-fcommon.patch
Normal file
34
contrib/guix/patches/glibc-2.27-fcommon.patch
Normal file
@@ -0,0 +1,34 @@
|
||||
commit 264a4a0dbe1f4369db315080034b500bed66016c
|
||||
Author: fanquake <fanquake@gmail.com>
|
||||
Date: Fri May 6 11:03:04 2022 +0100
|
||||
|
||||
build: use -fcommon to retain legacy behaviour with GCC 10
|
||||
|
||||
GCC 10 started using -fno-common by default, which causes issues with
|
||||
the powerpc builds using gibc 2.27. A patch was commited to glibc to fix
|
||||
the issue, 18363b4f010da9ba459b13310b113ac0647c2fcc but is non-trvial
|
||||
to backport, and was broken in at least one way, see the followup in
|
||||
commit 7650321ce037302bfc2f026aa19e0213b8d02fe6.
|
||||
|
||||
For now, retain the legacy GCC behaviour by passing -fcommon when
|
||||
building glibc.
|
||||
|
||||
https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html.
|
||||
https://sourceware.org/git/?p=glibc.git;a=commit;h=18363b4f010da9ba459b13310b113ac0647c2fcc
|
||||
https://sourceware.org/git/?p=glibc.git;a=commit;h=7650321ce037302bfc2f026aa19e0213b8d02fe6
|
||||
|
||||
This patch can be dropped when we are building with glibc 2.31+.
|
||||
|
||||
diff --git a/Makeconfig b/Makeconfig
|
||||
index 86a71e5802..aa2166be60 100644
|
||||
--- a/Makeconfig
|
||||
+++ b/Makeconfig
|
||||
@@ -896,7 +896,7 @@ ifeq "$(strip $(+cflags))" ""
|
||||
endif # $(+cflags) == ""
|
||||
|
||||
+cflags += $(cflags-cpu) $(+gccwarn) $(+merge-constants) $(+math-flags) \
|
||||
- $(+stack-protector)
|
||||
+ $(+stack-protector) -fcommon
|
||||
+gcc-nowarn := -w
|
||||
|
||||
# Don't duplicate options if we inherited variables from the parent.
|
||||
@@ -4,13 +4,19 @@ hash for the same package will differ when on different architectures.
|
||||
In order to be reproducible regardless of the architecture used to build
|
||||
the package, map all guix store prefixes to something fixed, e.g. /usr.
|
||||
|
||||
We might be able to drop this in favour of using --with-nonshared-cflags
|
||||
when we begin using newer versions of glibc.
|
||||
|
||||
--- a/Makeconfig
|
||||
+++ b/Makeconfig
|
||||
@@ -1007,6 +1007,7 @@ object-suffixes :=
|
||||
@@ -992,6 +992,10 @@ object-suffixes :=
|
||||
CPPFLAGS-.o = $(pic-default)
|
||||
# libc.a must be compiled with -fPIE/-fpie for static PIE.
|
||||
CFLAGS-.o = $(filter %frame-pointer,$(+cflags)) $(pie-default)
|
||||
+
|
||||
+# Map Guix store paths to /usr
|
||||
+CFLAGS-.o += `find /gnu/store -maxdepth 1 -mindepth 1 -type d -exec echo -n " -ffile-prefix-map={}=/usr" \;`
|
||||
+
|
||||
libtype.o := lib%.a
|
||||
object-suffixes += .o
|
||||
ifeq (yes,$(build-shared))
|
||||
53
contrib/guix/patches/glibc-2.27-no-librt.patch
Normal file
53
contrib/guix/patches/glibc-2.27-no-librt.patch
Normal file
@@ -0,0 +1,53 @@
|
||||
This patch can be dropped when we are building with glibc 2.30+.
|
||||
|
||||
commit 6e41ef56c9baab719a02f1377b1e7ce7bff61e73
|
||||
Author: Florian Weimer <fweimer@redhat.com>
|
||||
Date: Fri Feb 8 10:21:56 2019 +0100
|
||||
|
||||
rt: Turn forwards from librt to libc into compat symbols [BZ #24194]
|
||||
|
||||
As the result of commit 6e6249d0b461b952d0f544792372663feb6d792a
|
||||
("BZ#14743: Move clock_* symbols from librt to libc."), in glibc 2.17,
|
||||
clock_gettime, clock_getres, clock_settime, clock_getcpuclockid,
|
||||
clock_nanosleep were added to libc, and the file rt/clock-compat.c
|
||||
was added with forwarders to the actual implementations in libc.
|
||||
These forwarders were wrapped in
|
||||
|
||||
#if SHLIB_COMPAT (librt, GLIBC_2_2, GLIBC_2_17)
|
||||
|
||||
so that they are not present for newer architectures (such as
|
||||
powerpc64le) with a 2.17 or later ABI baseline. But the forwarders
|
||||
were not marked as compatibility symbols. As a result, on older
|
||||
architectures, historic configure checks such as
|
||||
|
||||
AC_CHECK_LIB(rt, clock_gettime)
|
||||
|
||||
still cause linking against librt, even though this is completely
|
||||
unnecessary. It also creates a needless porting hazard because
|
||||
architectures behave differently when it comes to symbol availability.
|
||||
|
||||
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
|
||||
|
||||
diff --git a/rt/clock-compat.c b/rt/clock-compat.c
|
||||
index f816973c05..11e71aa890 100644
|
||||
--- a/rt/clock-compat.c
|
||||
+++ b/rt/clock-compat.c
|
||||
@@ -30,14 +30,16 @@
|
||||
#if HAVE_IFUNC
|
||||
# undef INIT_ARCH
|
||||
# define INIT_ARCH()
|
||||
-# define COMPAT_REDIRECT(name, proto, arglist) libc_ifunc (name, &__##name)
|
||||
+# define COMPAT_REDIRECT(name, proto, arglist) libc_ifunc (name, &__##name) \
|
||||
+ compat_symbol (librt, name, name, GLIBC_2_2);
|
||||
#else
|
||||
# define COMPAT_REDIRECT(name, proto, arglist) \
|
||||
int \
|
||||
name proto \
|
||||
{ \
|
||||
return __##name arglist; \
|
||||
- }
|
||||
+ } \
|
||||
+ compat_symbol (librt, name, name, GLIBC_2_2);
|
||||
#endif
|
||||
|
||||
COMPAT_REDIRECT (clock_getres,
|
||||
245
contrib/guix/patches/glibc-2.27-powerpc-ldbrx.patch
Normal file
245
contrib/guix/patches/glibc-2.27-powerpc-ldbrx.patch
Normal file
@@ -0,0 +1,245 @@
|
||||
From 50b0b3c9ff71ffd7ebbd74ae46844c3566478123 Mon Sep 17 00:00:00 2001
|
||||
From: "Gabriel F. T. Gomes" <gabrielftg@linux.ibm.com>
|
||||
Date: Mon, 27 May 2019 15:21:22 -0300
|
||||
Subject: [PATCH] powerpc: Fix build failures with current GCC
|
||||
|
||||
Since GCC commit 271500 (svn), also known as the following commit on the
|
||||
git mirror:
|
||||
|
||||
commit e154242724b084380e3221df7c08fcdbd8460674
|
||||
Author: amodra <amodra@138bc75d-0d04-0410-961f-82ee72b054a4>
|
||||
Date: Wed May 22 04:34:26 2019 +0000
|
||||
|
||||
[RS6000] Don't pass -many to the assembler
|
||||
|
||||
glibc builds are failing when an assembly implementation does not
|
||||
declare the correct '.machine' directive, or when no such directive is
|
||||
declared at all. For example, when a POWER6 instruction is used, but
|
||||
'.machine power6' is not declared, the assembler will fail with an error
|
||||
similar to the following:
|
||||
|
||||
../sysdeps/powerpc/powerpc64/power8/strcmp.S: Assembler messages:
|
||||
24 ../sysdeps/powerpc/powerpc64/power8/strcmp.S:55: Error: unrecognized opcode: `cmpb'
|
||||
|
||||
This patch adds '.machine powerN' directives where none existed, as well
|
||||
as it updates '.machine power7' directives on POWER8 files, because the
|
||||
minimum binutils version required to build glibc (binutils 2.25) now
|
||||
provides this machine version. It also adds '-many' to the assembler
|
||||
command used to build tst-set_ppr.c.
|
||||
|
||||
Tested for powerpc, powerpc64, and powerpc64le, as well as with
|
||||
build-many-glibcs.py for powerpc targets.
|
||||
|
||||
Reviewed-by: Tulio Magno Quites Machado Filho <tuliom@linux.ibm.com>
|
||||
---
|
||||
sysdeps/powerpc/Makefile | 5 +++
|
||||
sysdeps/powerpc/powerpc64/power4/memcmp.S | 7 ++++
|
||||
sysdeps/powerpc/powerpc64/power7/strncmp.S | 1 +
|
||||
.../powerpc/powerpc64/power8/fpu/s_llround.S | 1 +
|
||||
sysdeps/powerpc/powerpc64/power8/strcasecmp.S | 36 ++++++-------------
|
||||
sysdeps/powerpc/powerpc64/power8/strcasestr.S | 14 ++------
|
||||
sysdeps/powerpc/powerpc64/power8/strcmp.S | 1 +
|
||||
7 files changed, 28 insertions(+), 37 deletions(-)
|
||||
|
||||
diff --git a/sysdeps/powerpc/Makefile b/sysdeps/powerpc/Makefile
|
||||
index 6aa683b03f..23126147df 100644
|
||||
--- a/sysdeps/powerpc/Makefile
|
||||
+++ b/sysdeps/powerpc/Makefile
|
||||
@@ -45,6 +45,11 @@ ifeq ($(subdir),misc)
|
||||
sysdep_headers += sys/platform/ppc.h
|
||||
tests += test-gettimebase
|
||||
tests += tst-set_ppr
|
||||
+
|
||||
+# This test is expected to run and exit with EXIT_UNSUPPORTED on
|
||||
+# processors that do not implement the Power ISA 2.06 or greater.
|
||||
+# But the test makes use of instructions from Power ISA 2.06 and 2.07.
|
||||
+CFLAGS-tst-set_ppr.c += -Wa,-many
|
||||
endif
|
||||
|
||||
ifneq (,$(filter %le,$(config-machine)))
|
||||
diff --git a/sysdeps/powerpc/powerpc64/power4/memcmp.S b/sysdeps/powerpc/powerpc64/power4/memcmp.S
|
||||
index e5319f101f..38dcf4c9a1 100644
|
||||
--- a/sysdeps/powerpc/powerpc64/power4/memcmp.S
|
||||
+++ b/sysdeps/powerpc/powerpc64/power4/memcmp.S
|
||||
@@ -26,7 +26,14 @@
|
||||
# define MEMCMP memcmp
|
||||
#endif
|
||||
|
||||
+#ifndef __LITTLE_ENDIAN__
|
||||
.machine power4
|
||||
+#else
|
||||
+/* Little endian is only available since POWER8, so it's safe to
|
||||
+ specify .machine as power8 (or older), even though this is a POWER4
|
||||
+ file. Since the little-endian code uses 'ldbrx', power7 is enough. */
|
||||
+ .machine power7
|
||||
+#endif
|
||||
ENTRY_TOCLESS (MEMCMP, 4)
|
||||
CALL_MCOUNT 3
|
||||
|
||||
diff --git a/sysdeps/powerpc/powerpc64/power7/strncmp.S b/sysdeps/powerpc/powerpc64/power7/strncmp.S
|
||||
index 0c7429d19f..10f898c5a3 100644
|
||||
--- a/sysdeps/powerpc/powerpc64/power7/strncmp.S
|
||||
+++ b/sysdeps/powerpc/powerpc64/power7/strncmp.S
|
||||
@@ -28,6 +28,7 @@
|
||||
const char *s2 [r4],
|
||||
size_t size [r5]) */
|
||||
|
||||
+ .machine power7
|
||||
ENTRY_TOCLESS (STRNCMP, 5)
|
||||
CALL_MCOUNT 3
|
||||
|
||||
diff --git a/sysdeps/powerpc/powerpc64/power8/fpu/s_llround.S b/sysdeps/powerpc/powerpc64/power8/fpu/s_llround.S
|
||||
index a22fc63bb3..84c76ba0f9 100644
|
||||
--- a/sysdeps/powerpc/powerpc64/power8/fpu/s_llround.S
|
||||
+++ b/sysdeps/powerpc/powerpc64/power8/fpu/s_llround.S
|
||||
@@ -26,6 +26,7 @@
|
||||
|
||||
/* long long [r3] llround (float x [fp1]) */
|
||||
|
||||
+ .machine power8
|
||||
ENTRY_TOCLESS (__llround)
|
||||
CALL_MCOUNT 0
|
||||
frin fp1,fp1 /* Round to nearest +-0.5. */
|
||||
diff --git a/sysdeps/powerpc/powerpc64/power8/strcasecmp.S b/sysdeps/powerpc/powerpc64/power8/strcasecmp.S
|
||||
index 3a2efe2a64..eeacd40c7f 100644
|
||||
--- a/sysdeps/powerpc/powerpc64/power8/strcasecmp.S
|
||||
+++ b/sysdeps/powerpc/powerpc64/power8/strcasecmp.S
|
||||
@@ -91,21 +91,7 @@
|
||||
3: \
|
||||
TOLOWER()
|
||||
|
||||
-#ifdef _ARCH_PWR8
|
||||
-# define VCLZD_V8_v7 vclzd v8, v7;
|
||||
-# define MFVRD_R3_V1 mfvrd r3, v1;
|
||||
-# define VSUBUDM_V9_V8 vsubudm v9, v9, v8;
|
||||
-# define VPOPCNTD_V8_V8 vpopcntd v8, v8;
|
||||
-# define VADDUQM_V7_V8 vadduqm v9, v7, v8;
|
||||
-#else
|
||||
-# define VCLZD_V8_v7 .long 0x11003fc2
|
||||
-# define MFVRD_R3_V1 .long 0x7c230067
|
||||
-# define VSUBUDM_V9_V8 .long 0x112944c0
|
||||
-# define VPOPCNTD_V8_V8 .long 0x110047c3
|
||||
-# define VADDUQM_V7_V8 .long 0x11274100
|
||||
-#endif
|
||||
-
|
||||
- .machine power7
|
||||
+ .machine power8
|
||||
|
||||
ENTRY (__STRCASECMP)
|
||||
#ifdef USE_AS_STRNCASECMP
|
||||
@@ -265,15 +251,15 @@ L(different):
|
||||
#ifdef __LITTLE_ENDIAN__
|
||||
/* Count trailing zero. */
|
||||
vspltisb v8, -1
|
||||
- VADDUQM_V7_V8
|
||||
+ vadduqm v9, v7, v8
|
||||
vandc v8, v9, v7
|
||||
- VPOPCNTD_V8_V8
|
||||
+ vpopcntd v8, v8
|
||||
vspltb v6, v8, 15
|
||||
vcmpequb. v6, v6, v1
|
||||
blt cr6, L(shift8)
|
||||
#else
|
||||
/* Count leading zero. */
|
||||
- VCLZD_V8_v7
|
||||
+ vclzd v8, v7
|
||||
vspltb v6, v8, 7
|
||||
vcmpequb. v6, v6, v1
|
||||
blt cr6, L(shift8)
|
||||
@@ -291,7 +277,7 @@ L(skipsum):
|
||||
/* Merge and move to GPR. */
|
||||
vmrglb v6, v6, v7
|
||||
vslo v1, v6, v1
|
||||
- MFVRD_R3_V1
|
||||
+ mfvrd r3, v1
|
||||
/* Place the characters that are different in first position. */
|
||||
sldi rSTR2, rRTN, 56
|
||||
srdi rSTR2, rSTR2, 56
|
||||
@@ -301,7 +287,7 @@ L(skipsum):
|
||||
vslo v6, v5, v8
|
||||
vslo v7, v4, v8
|
||||
vmrghb v1, v6, v7
|
||||
- MFVRD_R3_V1
|
||||
+ mfvrd r3, v1
|
||||
srdi rSTR2, rRTN, 48
|
||||
sldi rSTR2, rSTR2, 56
|
||||
srdi rSTR2, rSTR2, 56
|
||||
@@ -320,15 +306,15 @@ L(null_found):
|
||||
#ifdef __LITTLE_ENDIAN__
|
||||
/* Count trailing zero. */
|
||||
vspltisb v8, -1
|
||||
- VADDUQM_V7_V8
|
||||
+ vadduqm v9, v7, v8
|
||||
vandc v8, v9, v7
|
||||
- VPOPCNTD_V8_V8
|
||||
+ vpopcntd v8, v8
|
||||
vspltb v6, v8, 15
|
||||
vcmpequb. v6, v6, v10
|
||||
blt cr6, L(shift_8)
|
||||
#else
|
||||
/* Count leading zero. */
|
||||
- VCLZD_V8_v7
|
||||
+ vclzd v8, v7
|
||||
vspltb v6, v8, 7
|
||||
vcmpequb. v6, v6, v10
|
||||
blt cr6, L(shift_8)
|
||||
@@ -343,10 +329,10 @@ L(skipsum1):
|
||||
vspltisb v10, 7
|
||||
vslb v10, v10, v10
|
||||
vsldoi v9, v0, v10, 1
|
||||
- VSUBUDM_V9_V8
|
||||
+ vsubudm v9, v9, v8
|
||||
vspltisb v8, 8
|
||||
vsldoi v8, v0, v8, 1
|
||||
- VSUBUDM_V9_V8
|
||||
+ vsubudm v9, v9, v8
|
||||
/* Shift and remove junk after null character. */
|
||||
#ifdef __LITTLE_ENDIAN__
|
||||
vslo v5, v5, v9
|
||||
diff --git a/sysdeps/powerpc/powerpc64/power8/strcasestr.S b/sysdeps/powerpc/powerpc64/power8/strcasestr.S
|
||||
index 9fc24c29f9..e10f06fd86 100644
|
||||
--- a/sysdeps/powerpc/powerpc64/power8/strcasestr.S
|
||||
+++ b/sysdeps/powerpc/powerpc64/power8/strcasestr.S
|
||||
@@ -73,18 +73,8 @@
|
||||
vor reg, v8, reg; \
|
||||
vcmpequb. v6, reg, v4;
|
||||
|
||||
-/* TODO: change these to the actual instructions when the minimum required
|
||||
- binutils allows it. */
|
||||
-#ifdef _ARCH_PWR8
|
||||
-#define VCLZD_V8_v7 vclzd v8, v7;
|
||||
-#else
|
||||
-#define VCLZD_V8_v7 .long 0x11003fc2
|
||||
-#endif
|
||||
-
|
||||
#define FRAMESIZE (FRAME_MIN_SIZE+48)
|
||||
-/* TODO: change this to .machine power8 when the minimum required binutils
|
||||
- allows it. */
|
||||
- .machine power7
|
||||
+ .machine power8
|
||||
ENTRY (STRCASESTR, 4)
|
||||
CALL_MCOUNT 2
|
||||
mflr r0 /* Load link register LR to r0. */
|
||||
@@ -291,7 +281,7 @@ L(nullchk1):
|
||||
vcmpequb. v6, v0, v7
|
||||
/* Shift r3 by 16 bytes and proceed. */
|
||||
blt cr6, L(shift16)
|
||||
- VCLZD_V8_v7
|
||||
+ vclzd v8, v7
|
||||
#ifdef __LITTLE_ENDIAN__
|
||||
vspltb v6, v8, 15
|
||||
#else
|
||||
diff --git a/sysdeps/powerpc/powerpc64/power8/strcmp.S b/sysdeps/powerpc/powerpc64/power8/strcmp.S
|
||||
index 15e7351d1b..d592266d1d 100644
|
||||
--- a/sysdeps/powerpc/powerpc64/power8/strcmp.S
|
||||
+++ b/sysdeps/powerpc/powerpc64/power8/strcmp.S
|
||||
@@ -31,6 +31,7 @@
|
||||
64K as default, the page cross handling assumes minimum page size of
|
||||
4k. */
|
||||
|
||||
+ .machine power8
|
||||
ENTRY_TOCLESS (STRCMP, 4)
|
||||
li r0,0
|
||||
|
||||
--
|
||||
2.41.0
|
||||
@@ -0,0 +1,78 @@
|
||||
Note that this has been modified from the original commit, to use __has_include
|
||||
instead of __has_include__, as the later was causing build failures with GCC 10.
|
||||
See also: http://lists.busybox.net/pipermail/buildroot/2020-July/590376.html.
|
||||
|
||||
https://sourceware.org/git/?p=glibc.git;a=commit;h=0b9c84906f653978fb8768c7ebd0ee14a47e662e
|
||||
|
||||
This patch can be dropped when we are building with glibc 2.28+.
|
||||
|
||||
From 562c52cc81a4e456a62e6455feb32732049e9070 Mon Sep 17 00:00:00 2001
|
||||
From: "H.J. Lu" <hjl.tools@gmail.com>
|
||||
Date: Mon, 31 Dec 2018 09:26:42 -0800
|
||||
Subject: [PATCH] riscv: Use __has_include__ to include <asm/syscalls.h> [BZ
|
||||
#24022]
|
||||
|
||||
<asm/syscalls.h> has been removed by
|
||||
|
||||
commit 27f8899d6002e11a6e2d995e29b8deab5aa9cc25
|
||||
Author: David Abdurachmanov <david.abdurachmanov@gmail.com>
|
||||
Date: Thu Nov 8 20:02:39 2018 +0100
|
||||
|
||||
riscv: add asm/unistd.h UAPI header
|
||||
|
||||
Marcin Juszkiewicz reported issues while generating syscall table for riscv
|
||||
using 4.20-rc1. The patch refactors our unistd.h files to match some other
|
||||
architectures.
|
||||
|
||||
- Add asm/unistd.h UAPI header, which has __ARCH_WANT_NEW_STAT only for 64-bit
|
||||
- Remove asm/syscalls.h UAPI header and merge to asm/unistd.h
|
||||
- Adjust kernel asm/unistd.h
|
||||
|
||||
So now asm/unistd.h UAPI header should show all syscalls for riscv.
|
||||
|
||||
<asm/syscalls.h> may be restored by
|
||||
|
||||
Subject: [PATCH] riscv: restore asm/syscalls.h UAPI header
|
||||
Date: Tue, 11 Dec 2018 09:09:35 +0100
|
||||
|
||||
UAPI header asm/syscalls.h was merged into UAPI asm/unistd.h header,
|
||||
which did resolve issue with missing syscalls macros resulting in
|
||||
glibc (2.28) build failure. It also broke glibc in a different way:
|
||||
asm/syscalls.h is being used by glibc. I noticed this while doing
|
||||
Fedora 30/Rawhide mass rebuild.
|
||||
|
||||
The patch returns asm/syscalls.h header and incl. it into asm/unistd.h.
|
||||
I plan to send a patch to glibc to use asm/unistd.h instead of
|
||||
asm/syscalls.h
|
||||
|
||||
In the meantime, we use __has_include__, which was added to GCC 5, to
|
||||
check if <asm/syscalls.h> exists before including it. Tested with
|
||||
build-many-glibcs.py for riscv against kernel 4.19.12 and 4.20-rc7.
|
||||
|
||||
[BZ #24022]
|
||||
* sysdeps/unix/sysv/linux/riscv/flush-icache.c: Check if
|
||||
<asm/syscalls.h> exists with __has_include__ before including it.
|
||||
---
|
||||
sysdeps/unix/sysv/linux/riscv/flush-icache.c | 6 +++++-
|
||||
1 file changed, 5 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/sysdeps/unix/sysv/linux/riscv/flush-icache.c b/sysdeps/unix/sysv/linux/riscv/flush-icache.c
|
||||
index d612ef4c6c..0b2042620b 100644
|
||||
--- a/sysdeps/unix/sysv/linux/riscv/flush-icache.c
|
||||
+++ b/sysdeps/unix/sysv/linux/riscv/flush-icache.c
|
||||
@@ -21,7 +21,11 @@
|
||||
#include <stdlib.h>
|
||||
#include <atomic.h>
|
||||
#include <sys/cachectl.h>
|
||||
-#include <asm/syscalls.h>
|
||||
+#if __has_include (<asm/syscalls.h>)
|
||||
+# include <asm/syscalls.h>
|
||||
+#else
|
||||
+# include <asm/unistd.h>
|
||||
+#endif
|
||||
|
||||
typedef int (*func_type) (void *, void *, unsigned long int);
|
||||
|
||||
--
|
||||
2.31.1
|
||||
|
||||
268
contrib/guix/patches/vmov-alignment.patch
Normal file
268
contrib/guix/patches/vmov-alignment.patch
Normal file
@@ -0,0 +1,268 @@
|
||||
Description: Use unaligned VMOV instructions
|
||||
Author: Stephen Kitt <skitt@debian.org>
|
||||
Bug-Debian: https://bugs.debian.org/939559
|
||||
See also: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54412
|
||||
|
||||
Based on a patch originally by Claude Heiland-Allen <claude@mathr.co.uk>
|
||||
|
||||
--- a/gcc/config/i386/sse.md
|
||||
+++ b/gcc/config/i386/sse.md
|
||||
@@ -1058,17 +1058,11 @@
|
||||
{
|
||||
if (FLOAT_MODE_P (GET_MODE_INNER (<MODE>mode)))
|
||||
{
|
||||
- if (misaligned_operand (operands[1], <MODE>mode))
|
||||
- return "vmovu<ssemodesuffix>\t{%1, %0%{%3%}%N2|%0%{%3%}%N2, %1}";
|
||||
- else
|
||||
- return "vmova<ssemodesuffix>\t{%1, %0%{%3%}%N2|%0%{%3%}%N2, %1}";
|
||||
+ return "vmovu<ssemodesuffix>\t{%1, %0%{%3%}%N2|%0%{%3%}%N2, %1}";
|
||||
}
|
||||
else
|
||||
{
|
||||
- if (misaligned_operand (operands[1], <MODE>mode))
|
||||
- return "vmovdqu<ssescalarsize>\t{%1, %0%{%3%}%N2|%0%{%3%}%N2, %1}";
|
||||
- else
|
||||
- return "vmovdqa<ssescalarsize>\t{%1, %0%{%3%}%N2|%0%{%3%}%N2, %1}";
|
||||
+ return "vmovdqu<ssescalarsize>\t{%1, %0%{%3%}%N2|%0%{%3%}%N2, %1}";
|
||||
}
|
||||
}
|
||||
[(set_attr "type" "ssemov")
|
||||
@@ -1184,17 +1178,11 @@
|
||||
{
|
||||
if (FLOAT_MODE_P (GET_MODE_INNER (<MODE>mode)))
|
||||
{
|
||||
- if (misaligned_operand (operands[0], <MODE>mode))
|
||||
- return "vmovu<ssemodesuffix>\t{%1, %0%{%2%}|%0%{%2%}, %1}";
|
||||
- else
|
||||
- return "vmova<ssemodesuffix>\t{%1, %0%{%2%}|%0%{%2%}, %1}";
|
||||
+ return "vmovu<ssemodesuffix>\t{%1, %0%{%2%}|%0%{%2%}, %1}";
|
||||
}
|
||||
else
|
||||
{
|
||||
- if (misaligned_operand (operands[0], <MODE>mode))
|
||||
- return "vmovdqu<ssescalarsize>\t{%1, %0%{%2%}|%0%{%2%}, %1}";
|
||||
- else
|
||||
- return "vmovdqa<ssescalarsize>\t{%1, %0%{%2%}|%0%{%2%}, %1}";
|
||||
+ return "vmovdqu<ssescalarsize>\t{%1, %0%{%2%}|%0%{%2%}, %1}";
|
||||
}
|
||||
}
|
||||
[(set_attr "type" "ssemov")
|
||||
@@ -7806,7 +7794,7 @@
|
||||
"TARGET_SSE && !(MEM_P (operands[0]) && MEM_P (operands[1]))"
|
||||
"@
|
||||
%vmovlps\t{%1, %0|%q0, %1}
|
||||
- %vmovaps\t{%1, %0|%0, %1}
|
||||
+ %vmovups\t{%1, %0|%0, %1}
|
||||
%vmovlps\t{%1, %d0|%d0, %q1}"
|
||||
[(set_attr "type" "ssemov")
|
||||
(set_attr "prefix" "maybe_vex")
|
||||
@@ -13997,29 +13985,15 @@
|
||||
switch (<MODE>mode)
|
||||
{
|
||||
case E_V8DFmode:
|
||||
- if (misaligned_operand (operands[2], <ssequartermode>mode))
|
||||
- return "vmovupd\t{%2, %x0|%x0, %2}";
|
||||
- else
|
||||
- return "vmovapd\t{%2, %x0|%x0, %2}";
|
||||
+ return "vmovupd\t{%2, %x0|%x0, %2}";
|
||||
case E_V16SFmode:
|
||||
- if (misaligned_operand (operands[2], <ssequartermode>mode))
|
||||
- return "vmovups\t{%2, %x0|%x0, %2}";
|
||||
- else
|
||||
- return "vmovaps\t{%2, %x0|%x0, %2}";
|
||||
+ return "vmovups\t{%2, %x0|%x0, %2}";
|
||||
case E_V8DImode:
|
||||
- if (misaligned_operand (operands[2], <ssequartermode>mode))
|
||||
- return which_alternative == 2 ? "vmovdqu64\t{%2, %x0|%x0, %2}"
|
||||
+ return which_alternative == 2 ? "vmovdqu64\t{%2, %x0|%x0, %2}"
|
||||
: "vmovdqu\t{%2, %x0|%x0, %2}";
|
||||
- else
|
||||
- return which_alternative == 2 ? "vmovdqa64\t{%2, %x0|%x0, %2}"
|
||||
- : "vmovdqa\t{%2, %x0|%x0, %2}";
|
||||
case E_V16SImode:
|
||||
- if (misaligned_operand (operands[2], <ssequartermode>mode))
|
||||
- return which_alternative == 2 ? "vmovdqu32\t{%2, %x0|%x0, %2}"
|
||||
+ return which_alternative == 2 ? "vmovdqu32\t{%2, %x0|%x0, %2}"
|
||||
: "vmovdqu\t{%2, %x0|%x0, %2}";
|
||||
- else
|
||||
- return which_alternative == 2 ? "vmovdqa32\t{%2, %x0|%x0, %2}"
|
||||
- : "vmovdqa\t{%2, %x0|%x0, %2}";
|
||||
default:
|
||||
gcc_unreachable ();
|
||||
}
|
||||
@@ -21225,63 +21199,27 @@
|
||||
switch (get_attr_mode (insn))
|
||||
{
|
||||
case MODE_V16SF:
|
||||
- if (misaligned_operand (operands[1], <ssehalfvecmode>mode))
|
||||
- return "vmovups\t{%1, %t0|%t0, %1}";
|
||||
- else
|
||||
- return "vmovaps\t{%1, %t0|%t0, %1}";
|
||||
+ return "vmovups\t{%1, %t0|%t0, %1}";
|
||||
case MODE_V8DF:
|
||||
- if (misaligned_operand (operands[1], <ssehalfvecmode>mode))
|
||||
- return "vmovupd\t{%1, %t0|%t0, %1}";
|
||||
- else
|
||||
- return "vmovapd\t{%1, %t0|%t0, %1}";
|
||||
+ return "vmovupd\t{%1, %t0|%t0, %1}";
|
||||
case MODE_V8SF:
|
||||
- if (misaligned_operand (operands[1], <ssehalfvecmode>mode))
|
||||
- return "vmovups\t{%1, %x0|%x0, %1}";
|
||||
- else
|
||||
- return "vmovaps\t{%1, %x0|%x0, %1}";
|
||||
+ return "vmovups\t{%1, %x0|%x0, %1}";
|
||||
case MODE_V4DF:
|
||||
- if (misaligned_operand (operands[1], <ssehalfvecmode>mode))
|
||||
- return "vmovupd\t{%1, %x0|%x0, %1}";
|
||||
- else
|
||||
- return "vmovapd\t{%1, %x0|%x0, %1}";
|
||||
+ return "vmovupd\t{%1, %x0|%x0, %1}";
|
||||
case MODE_XI:
|
||||
- if (misaligned_operand (operands[1], <ssehalfvecmode>mode))
|
||||
- {
|
||||
- if (which_alternative == 2)
|
||||
- return "vmovdqu\t{%1, %t0|%t0, %1}";
|
||||
- else if (GET_MODE_SIZE (<ssescalarmode>mode) == 8)
|
||||
- return "vmovdqu64\t{%1, %t0|%t0, %1}";
|
||||
- else
|
||||
- return "vmovdqu32\t{%1, %t0|%t0, %1}";
|
||||
- }
|
||||
+ if (which_alternative == 2)
|
||||
+ return "vmovdqu\t{%1, %t0|%t0, %1}";
|
||||
+ else if (GET_MODE_SIZE (<ssescalarmode>mode) == 8)
|
||||
+ return "vmovdqu64\t{%1, %t0|%t0, %1}";
|
||||
else
|
||||
- {
|
||||
- if (which_alternative == 2)
|
||||
- return "vmovdqa\t{%1, %t0|%t0, %1}";
|
||||
- else if (GET_MODE_SIZE (<ssescalarmode>mode) == 8)
|
||||
- return "vmovdqa64\t{%1, %t0|%t0, %1}";
|
||||
- else
|
||||
- return "vmovdqa32\t{%1, %t0|%t0, %1}";
|
||||
- }
|
||||
+ return "vmovdqu32\t{%1, %t0|%t0, %1}";
|
||||
case MODE_OI:
|
||||
- if (misaligned_operand (operands[1], <ssehalfvecmode>mode))
|
||||
- {
|
||||
- if (which_alternative == 2)
|
||||
- return "vmovdqu\t{%1, %x0|%x0, %1}";
|
||||
- else if (GET_MODE_SIZE (<ssescalarmode>mode) == 8)
|
||||
- return "vmovdqu64\t{%1, %x0|%x0, %1}";
|
||||
- else
|
||||
- return "vmovdqu32\t{%1, %x0|%x0, %1}";
|
||||
- }
|
||||
+ if (which_alternative == 2)
|
||||
+ return "vmovdqu\t{%1, %x0|%x0, %1}";
|
||||
+ else if (GET_MODE_SIZE (<ssescalarmode>mode) == 8)
|
||||
+ return "vmovdqu64\t{%1, %x0|%x0, %1}";
|
||||
else
|
||||
- {
|
||||
- if (which_alternative == 2)
|
||||
- return "vmovdqa\t{%1, %x0|%x0, %1}";
|
||||
- else if (GET_MODE_SIZE (<ssescalarmode>mode) == 8)
|
||||
- return "vmovdqa64\t{%1, %x0|%x0, %1}";
|
||||
- else
|
||||
- return "vmovdqa32\t{%1, %x0|%x0, %1}";
|
||||
- }
|
||||
+ return "vmovdqu32\t{%1, %x0|%x0, %1}";
|
||||
default:
|
||||
gcc_unreachable ();
|
||||
}
|
||||
--- a/gcc/config/i386/i386.c
|
||||
+++ b/gcc/config/i386/i386.c
|
||||
@@ -4981,13 +4981,13 @@
|
||||
switch (type)
|
||||
{
|
||||
case opcode_int:
|
||||
- opcode = misaligned_p ? "vmovdqu32" : "vmovdqa32";
|
||||
+ opcode = "vmovdqu32";
|
||||
break;
|
||||
case opcode_float:
|
||||
- opcode = misaligned_p ? "vmovups" : "vmovaps";
|
||||
+ opcode = "vmovups";
|
||||
break;
|
||||
case opcode_double:
|
||||
- opcode = misaligned_p ? "vmovupd" : "vmovapd";
|
||||
+ opcode = "vmovupd";
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -4996,16 +4996,16 @@
|
||||
switch (scalar_mode)
|
||||
{
|
||||
case E_SFmode:
|
||||
- opcode = misaligned_p ? "%vmovups" : "%vmovaps";
|
||||
+ opcode = "%vmovups";
|
||||
break;
|
||||
case E_DFmode:
|
||||
- opcode = misaligned_p ? "%vmovupd" : "%vmovapd";
|
||||
+ opcode = "%vmovupd";
|
||||
break;
|
||||
case E_TFmode:
|
||||
if (evex_reg_p)
|
||||
- opcode = misaligned_p ? "vmovdqu64" : "vmovdqa64";
|
||||
+ opcode = "vmovdqu64";
|
||||
else
|
||||
- opcode = misaligned_p ? "%vmovdqu" : "%vmovdqa";
|
||||
+ opcode = "%vmovdqu";
|
||||
break;
|
||||
default:
|
||||
gcc_unreachable ();
|
||||
@@ -5017,48 +5017,32 @@
|
||||
{
|
||||
case E_QImode:
|
||||
if (evex_reg_p)
|
||||
- opcode = (misaligned_p
|
||||
- ? (TARGET_AVX512BW
|
||||
- ? "vmovdqu8"
|
||||
- : "vmovdqu64")
|
||||
- : "vmovdqa64");
|
||||
+ opcode = TARGET_AVX512BW ? "vmovdqu8" : "vmovdqu64";
|
||||
else
|
||||
- opcode = (misaligned_p
|
||||
- ? (TARGET_AVX512BW
|
||||
- ? "vmovdqu8"
|
||||
- : "%vmovdqu")
|
||||
- : "%vmovdqa");
|
||||
+ opcode = TARGET_AVX512BW ? "vmovdqu8" : "%vmovdqu";
|
||||
break;
|
||||
case E_HImode:
|
||||
if (evex_reg_p)
|
||||
- opcode = (misaligned_p
|
||||
- ? (TARGET_AVX512BW
|
||||
- ? "vmovdqu16"
|
||||
- : "vmovdqu64")
|
||||
- : "vmovdqa64");
|
||||
+ opcode = TARGET_AVX512BW ? "vmovdqu16" : "vmovdqu64";
|
||||
else
|
||||
- opcode = (misaligned_p
|
||||
- ? (TARGET_AVX512BW
|
||||
- ? "vmovdqu16"
|
||||
- : "%vmovdqu")
|
||||
- : "%vmovdqa");
|
||||
+ opcode = TARGET_AVX512BW ? "vmovdqu16" : "%vmovdqu";
|
||||
break;
|
||||
case E_SImode:
|
||||
if (evex_reg_p)
|
||||
- opcode = misaligned_p ? "vmovdqu32" : "vmovdqa32";
|
||||
+ opcode = "vmovdqu32";
|
||||
else
|
||||
- opcode = misaligned_p ? "%vmovdqu" : "%vmovdqa";
|
||||
+ opcode = "%vmovdqu";
|
||||
break;
|
||||
case E_DImode:
|
||||
case E_TImode:
|
||||
case E_OImode:
|
||||
if (evex_reg_p)
|
||||
- opcode = misaligned_p ? "vmovdqu64" : "vmovdqa64";
|
||||
+ opcode = "vmovdqu64";
|
||||
else
|
||||
- opcode = misaligned_p ? "%vmovdqu" : "%vmovdqa";
|
||||
+ opcode = "%vmovdqu";
|
||||
break;
|
||||
case E_XImode:
|
||||
- opcode = misaligned_p ? "vmovdqu64" : "vmovdqa64";
|
||||
+ opcode = "vmovdqu64";
|
||||
break;
|
||||
default:
|
||||
gcc_unreachable ();
|
||||
@@ -1,17 +0,0 @@
|
||||
Without ffile-prefix-map, the debug symbols will contain paths for the
|
||||
guix store which will include the hashes of each package. However, the
|
||||
hash for the same package will differ when on different architectures.
|
||||
In order to be reproducible regardless of the architecture used to build
|
||||
the package, map all guix store prefixes to something fixed, e.g. /usr.
|
||||
|
||||
--- a/mingw-w64-libraries/winpthreads/Makefile.in
|
||||
+++ b/mingw-w64-libraries/winpthreads/Makefile.in
|
||||
@@ -478,7 +478,7 @@ top_build_prefix = @top_build_prefix@
|
||||
top_builddir = @top_builddir@
|
||||
top_srcdir = @top_srcdir@
|
||||
SUBDIRS = . tests
|
||||
-AM_CFLAGS = -Wall -DWIN32_LEAN_AND_MEAN $(am__append_1)
|
||||
+AM_CFLAGS = -Wall -DWIN32_LEAN_AND_MEAN $(am__append_1) $(shell find /gnu/store -maxdepth 1 -mindepth 1 -type d -exec echo -n " -ffile-prefix-map={}=/usr" \;)
|
||||
ACLOCAL_AMFLAGS = -I m4
|
||||
lib_LTLIBRARIES = libwinpthread.la
|
||||
include_HEADERS = include/pthread.h include/sched.h include/semaphore.h include/pthread_unistd.h include/pthread_time.h include/pthread_compat.h include/pthread_signal.h
|
||||
@@ -81,8 +81,5 @@ 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
|
||||
|
||||
@@ -76,16 +76,6 @@ def getFirstBlockFileId(block_dir_path):
|
||||
blkId = int(firstBlkFn[3:8])
|
||||
return blkId
|
||||
|
||||
def read_xor_key(blocks_path):
|
||||
NUM_XOR_BYTES = 8 # From InitBlocksdirXorKey::xor_key.size()
|
||||
try:
|
||||
xor_filename = os.path.join(blocks_path, "xor.dat")
|
||||
with open(xor_filename, "rb") as xor_file:
|
||||
return xor_file.read(NUM_XOR_BYTES)
|
||||
# support also blockdirs created with pre-v28 versions, where no xor key exists yet
|
||||
except FileNotFoundError:
|
||||
return bytes([0] * NUM_XOR_BYTES)
|
||||
|
||||
# Block header and extent on disk
|
||||
BlockExtent = namedtuple('BlockExtent', ['fn', 'offset', 'inhdr', 'blkhdr', 'size'])
|
||||
|
||||
@@ -105,7 +95,6 @@ class BlockDataCopier:
|
||||
self.outFname = None
|
||||
self.blkCountIn = 0
|
||||
self.blkCountOut = 0
|
||||
self.xor_key = read_xor_key(self.settings['input'])
|
||||
|
||||
self.lastDate = datetime.datetime(2000, 1, 1)
|
||||
self.highTS = 1408893517 - 315360000
|
||||
@@ -124,13 +113,6 @@ class BlockDataCopier:
|
||||
self.outOfOrderData = {}
|
||||
self.outOfOrderSize = 0 # running total size for items in outOfOrderData
|
||||
|
||||
def read_xored(self, f, size):
|
||||
offset = f.tell()
|
||||
data = bytearray(f.read(size))
|
||||
for i in range(len(data)):
|
||||
data[i] ^= self.xor_key[(i + offset) % len(self.xor_key)]
|
||||
return bytes(data)
|
||||
|
||||
def writeBlock(self, inhdr, blk_hdr, rawblock):
|
||||
blockSizeOnDisk = len(inhdr) + len(blk_hdr) + len(rawblock)
|
||||
if not self.fileOutput and ((self.outsz + blockSizeOnDisk) > self.maxOutSz):
|
||||
@@ -183,7 +165,7 @@ class BlockDataCopier:
|
||||
'''Fetch block contents from disk given extents'''
|
||||
with open(self.inFileName(extent.fn), "rb") as f:
|
||||
f.seek(extent.offset)
|
||||
return self.read_xored(f, extent.size)
|
||||
return f.read(extent.size)
|
||||
|
||||
def copyOneBlock(self):
|
||||
'''Find the next block to be written in the input, and copy it to the output.'''
|
||||
@@ -208,7 +190,7 @@ class BlockDataCopier:
|
||||
print("Premature end of block data")
|
||||
return
|
||||
|
||||
inhdr = self.read_xored(self.inF, 8)
|
||||
inhdr = self.inF.read(8)
|
||||
if (not inhdr or (inhdr[0] == "\0")):
|
||||
self.inF.close()
|
||||
self.inF = None
|
||||
@@ -225,7 +207,7 @@ class BlockDataCopier:
|
||||
inLenLE = inhdr[4:]
|
||||
su = struct.unpack("<I", inLenLE)
|
||||
inLen = su[0] - 80 # length without header
|
||||
blk_hdr = self.read_xored(self.inF, 80)
|
||||
blk_hdr = self.inF.read(80)
|
||||
inExtent = BlockExtent(self.inFn, self.inF.tell(), inhdr, blk_hdr, inLen)
|
||||
|
||||
self.hash_str = calc_hash_str(blk_hdr)
|
||||
@@ -242,7 +224,7 @@ class BlockDataCopier:
|
||||
|
||||
if self.blkCountOut == blkHeight:
|
||||
# If in-order block, just copy
|
||||
rawblock = self.read_xored(self.inF, inLen)
|
||||
rawblock = self.inF.read(inLen)
|
||||
self.writeBlock(inhdr, blk_hdr, rawblock)
|
||||
|
||||
# See if we can catch up to prior out-of-order blocks
|
||||
@@ -255,7 +237,7 @@ class BlockDataCopier:
|
||||
# If there is space in the cache, read the data
|
||||
# Reading the data in file sequence instead of seeking and fetching it later is preferred,
|
||||
# but we don't want to fill up memory
|
||||
self.outOfOrderData[blkHeight] = self.read_xored(self.inF, inLen)
|
||||
self.outOfOrderData[blkHeight] = self.inF.read(inLen)
|
||||
self.outOfOrderSize += inLen
|
||||
else: # If no space in cache, seek forward
|
||||
self.inF.seek(inLen, os.SEEK_CUR)
|
||||
|
||||
@@ -56,22 +56,46 @@ The `sha256sum` should be `c0c2e7bb92c1fee0c4e9f3a485e4530786732d6c6dd9e9f418c28
|
||||
|
||||
## Deterministic macOS App Notes
|
||||
|
||||
macOS Applications are created on Linux using a recent LLVM.
|
||||
macOS Applications are created in Linux by combining a recent `clang` and the Apple
|
||||
`binutils` (`ld`, `ar`, etc).
|
||||
|
||||
All builds must target an Apple SDK. These SDKs are free to download, but not redistributable.
|
||||
See the SDK Extraction notes above for how to obtain it.
|
||||
Apple uses `clang` extensively for development and has upstreamed the necessary
|
||||
functionality so that a vanilla clang can take advantage. It supports the use of `-F`,
|
||||
`-target`, `-mmacosx-version-min`, and `-isysroot`, which are all necessary when
|
||||
building for macOS.
|
||||
|
||||
The Guix build process has been designed to avoid including the SDK's files in Guix's outputs.
|
||||
All interim tarballs are fully deterministic and may be freely redistributed.
|
||||
Apple's version of `binutils` (called `cctools`) contains lots of functionality missing in the
|
||||
FSF's `binutils`. In addition to extra linker options for frameworks and sysroots, several
|
||||
other tools are needed as well such as `install_name_tool`, `lipo`, and `nmedit`. These
|
||||
do not build under Linux, so they have been patched to do so. The work here was used as
|
||||
a starting point: [mingwandroid/toolchain4](https://github.com/mingwandroid/toolchain4).
|
||||
|
||||
Using an Apple-blessed key to sign binaries is a requirement to produce (distributable) macOS
|
||||
binaries. Because this private key cannot be shared, we'll have to be a bit creative in order
|
||||
for the build process to remain somewhat deterministic. Here's how it works:
|
||||
In order to build a working toolchain, the following source packages are needed from
|
||||
Apple: `cctools`, `dyld`, and `ld64`.
|
||||
|
||||
These tools inject timestamps by default, which produce non-deterministic binaries. The
|
||||
`ZERO_AR_DATE` environment variable is used to disable that.
|
||||
|
||||
This version of `cctools` has been patched to use the current version of `clang`'s headers
|
||||
and its `libLTO.so` rather than those from `llvmgcc`, as it was originally done in `toolchain4`.
|
||||
|
||||
To complicate things further, all builds must target an Apple SDK. These SDKs are free to
|
||||
download, but not redistributable. See the SDK Extraction notes above for how to obtain it.
|
||||
|
||||
The Guix process builds 2 sets of files: Linux tools, then Apple binaries which are
|
||||
created using these tools. The build process has been designed to avoid including the
|
||||
SDK's files in Guix's outputs. All interim tarballs are fully deterministic and may be freely
|
||||
redistributed.
|
||||
|
||||
As of OS X 10.9 Mavericks, using an Apple-blessed key to sign binaries is a requirement in
|
||||
order to satisfy the new Gatekeeper requirements. Because this private key cannot be
|
||||
shared, we'll have to be a bit creative in order for the build process to remain somewhat
|
||||
deterministic. Here's how it works:
|
||||
|
||||
- Builders use Guix to create an unsigned release. This outputs an unsigned ZIP which
|
||||
users may choose to bless, self-codesign, and run. It also outputs an unsigned app structure
|
||||
in the form of a tarball.
|
||||
users may choose to bless and run. It also outputs an unsigned app structure in the form
|
||||
of a tarball.
|
||||
- The Apple keyholder uses this unsigned app to create a detached signature, using the
|
||||
included script. Detached signatures are available from this [repository](https://github.com/bitcoin-core/bitcoin-detached-sigs).
|
||||
- Builders feed the unsigned app + detached signature back into Guix, which combines the
|
||||
pieces into a deterministic ZIP.
|
||||
script that is also included there. Detached signatures are available from this [repository](https://github.com/bitcoin-core/bitcoin-detached-sigs).
|
||||
- Builders feed the unsigned app + detached signature back into Guix. It uses the
|
||||
pre-built tools to recombine the pieces into a deterministic ZIP.
|
||||
|
||||
@@ -8,6 +8,21 @@ import gzip
|
||||
import os
|
||||
import contextlib
|
||||
|
||||
# monkey-patch Python 3.8 and older to fix wrong TAR header handling
|
||||
# see https://github.com/bitcoin/bitcoin/pull/24534
|
||||
# and https://github.com/python/cpython/pull/18080 for more info
|
||||
if sys.version_info < (3, 9):
|
||||
_old_create_header = tarfile.TarInfo._create_header
|
||||
def _create_header(info, format, encoding, errors):
|
||||
buf = _old_create_header(info, format, encoding, errors)
|
||||
# replace devmajor/devminor with binary zeroes
|
||||
buf = buf[:329] + bytes(16) + buf[345:]
|
||||
# recompute checksum
|
||||
chksum = tarfile.calc_chksums(buf)[0]
|
||||
buf = buf[:-364] + bytes("%06o\0" % chksum, "ascii") + buf[-357:]
|
||||
return buf
|
||||
tarfile.TarInfo._create_header = staticmethod(_create_header)
|
||||
|
||||
@contextlib.contextmanager
|
||||
def cd(path):
|
||||
"""Context manager that restores PWD even if an exception was raised."""
|
||||
|
||||
@@ -77,7 +77,7 @@ class FrameworkInfo(object):
|
||||
bundleBinaryDirectory = "Contents/MacOS"
|
||||
|
||||
@classmethod
|
||||
def fromLibraryLine(cls, line: str) -> Optional['FrameworkInfo']:
|
||||
def fromOtoolLibraryLine(cls, line: str) -> Optional['FrameworkInfo']:
|
||||
# Note: line must be trimmed
|
||||
if line == "":
|
||||
return None
|
||||
@@ -88,7 +88,7 @@ class FrameworkInfo(object):
|
||||
|
||||
m = cls.reOLine.match(line)
|
||||
if m is None:
|
||||
raise RuntimeError(f"Line could not be parsed: {line}")
|
||||
raise RuntimeError(f"otool line could not be parsed: {line}")
|
||||
|
||||
path = m.group(1)
|
||||
|
||||
@@ -120,7 +120,7 @@ class FrameworkInfo(object):
|
||||
break
|
||||
i += 1
|
||||
if i == len(parts):
|
||||
raise RuntimeError(f"Could not find .framework or .dylib in line: {line}")
|
||||
raise RuntimeError(f"Could not find .framework or .dylib in otool line: {line}")
|
||||
|
||||
info.frameworkName = parts[i]
|
||||
info.frameworkDirectory = "/".join(parts[:i])
|
||||
@@ -182,24 +182,24 @@ class DeploymentInfo(object):
|
||||
return False
|
||||
|
||||
def getFrameworks(binaryPath: str, verbose: int) -> list[FrameworkInfo]:
|
||||
objdump = os.getenv("OBJDUMP", "objdump")
|
||||
if verbose:
|
||||
print(f"Inspecting with {objdump}: {binaryPath}")
|
||||
output = run([objdump, "--macho", "--dylibs-used", binaryPath], stdout=PIPE, stderr=PIPE, text=True)
|
||||
if output.returncode != 0:
|
||||
sys.stderr.write(output.stderr)
|
||||
print(f"Inspecting with otool: {binaryPath}")
|
||||
otoolbin=os.getenv("OTOOL", "otool")
|
||||
otool = run([otoolbin, "-L", binaryPath], stdout=PIPE, stderr=PIPE, text=True)
|
||||
if otool.returncode != 0:
|
||||
sys.stderr.write(otool.stderr)
|
||||
sys.stderr.flush()
|
||||
raise RuntimeError(f"{objdump} failed with return code {output.returncode}")
|
||||
raise RuntimeError(f"otool failed with return code {otool.returncode}")
|
||||
|
||||
lines = output.stdout.split("\n")
|
||||
lines.pop(0) # First line is the inspected binary
|
||||
otoolLines = otool.stdout.split("\n")
|
||||
otoolLines.pop(0) # First line is the inspected binary
|
||||
if ".framework" in binaryPath or binaryPath.endswith(".dylib"):
|
||||
lines.pop(0) # Frameworks and dylibs list themselves as a dependency.
|
||||
otoolLines.pop(0) # Frameworks and dylibs list themselves as a dependency.
|
||||
|
||||
libraries = []
|
||||
for line in lines:
|
||||
for line in otoolLines:
|
||||
line = line.replace("@loader_path", os.path.dirname(binaryPath))
|
||||
info = FrameworkInfo.fromLibraryLine(line.strip())
|
||||
info = FrameworkInfo.fromOtoolLibraryLine(line.strip())
|
||||
if info is not None:
|
||||
if verbose:
|
||||
print("Found framework:")
|
||||
|
||||
1
contrib/seeds/.gitignore
vendored
1
contrib/seeds/.gitignore
vendored
@@ -1,3 +1,2 @@
|
||||
seeds_main.txt
|
||||
seeds_test.txt
|
||||
asmap-filled.dat
|
||||
|
||||
@@ -8,20 +8,13 @@ and remove old versions as necessary (at a minimum when SeedsServiceFlags()
|
||||
changes its default return value, as those are the services which seeds are added
|
||||
to addrman with).
|
||||
|
||||
The seeds compiled into the release are created from sipa's, achow101's and luke-jr's
|
||||
DNS seed, virtu's crawler, and fjahr's community AS map data. Run the following commands
|
||||
from the `/contrib/seeds` directory:
|
||||
The seeds compiled into the release are created from sipa's DNS seed and AS map
|
||||
data. Run the following commands from the `/contrib/seeds` directory:
|
||||
|
||||
```
|
||||
curl https://bitcoin.sipa.be/seeds.txt.gz | gzip -dc > seeds_main.txt
|
||||
curl https://mainnet.achownodes.xyz/seeds.txt.gz | gzip -dc >> seeds_main.txt
|
||||
curl https://21.ninja/seeds.txt.gz | gzip -dc >> seeds_main.txt
|
||||
curl https://luke.dashjr.org/programs/bitcoin/files/charts/seeds.txt >> seeds_main.txt
|
||||
curl https://testnet.achownodes.xyz/seeds.txt.gz | gzip -dc > seeds_test.txt
|
||||
curl https://raw.githubusercontent.com/fjahr/asmap-data/main/latest_asmap.dat > asmap-filled.dat
|
||||
curl https://bitcoin.sipa.be/asmap-filled.dat > asmap-filled.dat
|
||||
python3 makeseeds.py -a asmap-filled.dat -s seeds_main.txt > nodes_main.txt
|
||||
python3 makeseeds.py -a asmap-filled.dat -s seeds_test.txt > nodes_test.txt
|
||||
# TODO: Uncomment when a seeder publishes seeds.txt.gz for testnet4
|
||||
# python3 makeseeds.py -a asmap-filled.dat -s seeds_testnet4.txt -m 30000 > nodes_testnet4.txt
|
||||
cat nodes_main_manual.txt >> nodes_main.txt
|
||||
python3 generate-seeds.py . > ../../src/chainparamsseeds.h
|
||||
```
|
||||
|
||||
@@ -489,14 +489,12 @@ class ASMap:
|
||||
if ctx not in ret or cand.size < ret[ctx].size:
|
||||
ret[ctx] = cand
|
||||
|
||||
union = set(left) | set(right)
|
||||
sorted_union = sorted(union, key=lambda x: (x is None, x))
|
||||
for ctx in sorted_union:
|
||||
for ctx in set(left) | set(right):
|
||||
candidate(ctx, left.get(ctx), right.get(ctx), _BinNode.make_branch)
|
||||
candidate(ctx, left.get(None), right.get(ctx), _BinNode.make_branch)
|
||||
candidate(ctx, left.get(ctx), right.get(None), _BinNode.make_branch)
|
||||
if not hole:
|
||||
for ctx in sorted(set(ret) - set([None])):
|
||||
for ctx in set(ret) - set([None]):
|
||||
candidate(None, ctx, ret[ctx], _BinNode.make_default)
|
||||
if None in ret:
|
||||
ret = {ctx:enc for ctx, enc in ret.items()
|
||||
@@ -5,12 +5,11 @@
|
||||
'''
|
||||
Script to generate list of seed nodes for kernel/chainparams.cpp.
|
||||
|
||||
This script expects three text files in the directory that is passed as an
|
||||
This script expects two text files in the directory that is passed as an
|
||||
argument:
|
||||
|
||||
nodes_main.txt
|
||||
nodes_test.txt
|
||||
nodes_testnet4.txt
|
||||
|
||||
These files must consist of lines in the format
|
||||
|
||||
@@ -30,6 +29,7 @@ These should be pasted into `src/chainparamsseeds.h`.
|
||||
|
||||
from base64 import b32decode
|
||||
from enum import Enum
|
||||
import struct
|
||||
import sys
|
||||
import os
|
||||
import re
|
||||
@@ -115,13 +115,13 @@ def parse_spec(s):
|
||||
def ser_compact_size(l):
|
||||
r = b""
|
||||
if l < 253:
|
||||
r = l.to_bytes(1, "little")
|
||||
r = struct.pack("B", l)
|
||||
elif l < 0x10000:
|
||||
r = (253).to_bytes(1, "little") + l.to_bytes(2, "little")
|
||||
r = struct.pack("<BH", 253, l)
|
||||
elif l < 0x100000000:
|
||||
r = (254).to_bytes(1, "little") + l.to_bytes(4, "little")
|
||||
r = struct.pack("<BI", 254, l)
|
||||
else:
|
||||
r = (255).to_bytes(1, "little") + l.to_bytes(8, "little")
|
||||
r = struct.pack("<BQ", 255, l)
|
||||
return r
|
||||
|
||||
def bip155_serialize(spec):
|
||||
@@ -129,10 +129,10 @@ def bip155_serialize(spec):
|
||||
Serialize (networkID, addr, port) tuple to BIP155 binary format.
|
||||
'''
|
||||
r = b""
|
||||
r += spec[0].value.to_bytes(1, "little")
|
||||
r += struct.pack('B', spec[0].value)
|
||||
r += ser_compact_size(len(spec[1]))
|
||||
r += spec[1]
|
||||
r += spec[2].to_bytes(2, "big")
|
||||
r += struct.pack('>H', spec[2])
|
||||
return r
|
||||
|
||||
def process_nodes(g, f, structname):
|
||||
@@ -172,9 +172,6 @@ def main():
|
||||
g.write('\n')
|
||||
with open(os.path.join(indir,'nodes_test.txt'), 'r', encoding="utf8") as f:
|
||||
process_nodes(g, f, 'chainparams_seed_test')
|
||||
g.write('\n')
|
||||
with open(os.path.join(indir,'nodes_testnet4.txt'), 'r', encoding="utf8") as f:
|
||||
process_nodes(g, f, 'chainparams_seed_testnet4')
|
||||
g.write('#endif // BITCOIN_CHAINPARAMSSEEDS_H\n')
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
@@ -9,15 +9,11 @@
|
||||
import argparse
|
||||
import collections
|
||||
import ipaddress
|
||||
from pathlib import Path
|
||||
import random
|
||||
import re
|
||||
import sys
|
||||
from typing import Union
|
||||
|
||||
asmap_dir = Path(__file__).parent.parent / "asmap"
|
||||
sys.path.append(str(asmap_dir))
|
||||
from asmap import ASMap, net_to_prefix # noqa: E402
|
||||
from asmap import ASMap, net_to_prefix
|
||||
|
||||
NSEEDS=512
|
||||
|
||||
@@ -26,7 +22,7 @@ MAX_SEEDS_PER_ASN = {
|
||||
'ipv6': 10,
|
||||
}
|
||||
|
||||
MIN_BLOCKS = 840000
|
||||
MIN_BLOCKS = 730000
|
||||
|
||||
PATTERN_IPV4 = re.compile(r"^((\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})):(\d+)$")
|
||||
PATTERN_IPV6 = re.compile(r"^\[([0-9a-z:]+)\]:(\d+)$")
|
||||
@@ -42,13 +38,11 @@ PATTERN_AGENT = re.compile(
|
||||
r"0.19.(0|1|2|99)|"
|
||||
r"0.20.(0|1|2|99)|"
|
||||
r"0.21.(0|1|2|99)|"
|
||||
r"22.(0|1|99).0|"
|
||||
r"23.(0|1|99).0|"
|
||||
r"24.(0|1|2|99).(0|1)|"
|
||||
r"25.(0|1|2|99).0|"
|
||||
r"26.(0|1|99).0|"
|
||||
r"27.(0|1|99).0|"
|
||||
r"28.(0|99).0|"
|
||||
r"22.(0|1|99)|"
|
||||
r"23.(0|1|99)|"
|
||||
r"24.(0|1|99)|"
|
||||
r"25.(0|1|99)|"
|
||||
r"26.(0|99)|"
|
||||
r")")
|
||||
|
||||
def parseline(line: str) -> Union[dict, None]:
|
||||
@@ -89,8 +83,6 @@ def parseline(line: str) -> Union[dict, None]:
|
||||
if m.group(1) in ['::']: # Not interested in localhost
|
||||
return None
|
||||
ipstr = m.group(1)
|
||||
if ipstr.startswith("fc"): # cjdns looks like ipv6 but always begins with fc
|
||||
net = "cjdns"
|
||||
sortkey = ipstr # XXX parse IPv6 into number, could use name_to_ipv6 from generate-seeds
|
||||
port = int(m.group(2))
|
||||
else:
|
||||
@@ -157,7 +149,6 @@ def filterbyasn(asmap: ASMap, ips: list[dict], max_per_asn: dict, max_per_net: i
|
||||
ips_ipv46 = [ip for ip in ips if ip['net'] in ['ipv4', 'ipv6']]
|
||||
ips_onion = [ip for ip in ips if ip['net'] == 'onion']
|
||||
ips_i2p = [ip for ip in ips if ip['net'] == 'i2p']
|
||||
ips_cjdns = [ip for ip in ips if ip["net"] == "cjdns"]
|
||||
|
||||
# Filter IPv46 by ASN, and limit to max_per_net per network
|
||||
result = []
|
||||
@@ -182,7 +173,6 @@ def filterbyasn(asmap: ASMap, ips: list[dict], max_per_asn: dict, max_per_net: i
|
||||
# Add back Onions (up to max_per_net)
|
||||
result.extend(ips_onion[0:max_per_net])
|
||||
result.extend(ips_i2p[0:max_per_net])
|
||||
result.extend(ips_cjdns[0:max_per_net])
|
||||
return result
|
||||
|
||||
def ip_stats(ips: list[dict]) -> str:
|
||||
@@ -192,13 +182,12 @@ def ip_stats(ips: list[dict]) -> str:
|
||||
if ip is not None:
|
||||
hist[ip['net']] += 1
|
||||
|
||||
return f"{hist['ipv4']:6d} {hist['ipv6']:6d} {hist['onion']:6d} {hist['i2p']:6d} {hist['cjdns']:6d}"
|
||||
return f"{hist['ipv4']:6d} {hist['ipv6']:6d} {hist['onion']:6d} {hist['i2p']:6d}"
|
||||
|
||||
def parse_args():
|
||||
argparser = argparse.ArgumentParser(description='Generate a list of bitcoin node seed ip addresses.')
|
||||
argparser.add_argument("-a","--asmap", help='the location of the asmap asn database file (required)', required=True)
|
||||
argparser.add_argument("-s","--seeds", help='the location of the DNS seeds file (required)', required=True)
|
||||
argparser.add_argument("-m", "--minblocks", help="The minimum number of blocks each node must have", default=MIN_BLOCKS, type=int)
|
||||
return argparser.parse_args()
|
||||
|
||||
def main():
|
||||
@@ -213,10 +202,9 @@ def main():
|
||||
with open(args.seeds, 'r', encoding='utf8') as f:
|
||||
lines = f.readlines()
|
||||
ips = [parseline(line) for line in lines]
|
||||
random.shuffle(ips)
|
||||
print('Done.', file=sys.stderr)
|
||||
|
||||
print('\x1b[7m IPv4 IPv6 Onion I2P CJDNS Pass \x1b[0m', file=sys.stderr)
|
||||
print('\x1b[7m IPv4 IPv6 Onion I2P Pass \x1b[0m', file=sys.stderr)
|
||||
print(f'{ip_stats(ips):s} Initial', file=sys.stderr)
|
||||
# Skip entries with invalid address.
|
||||
ips = [ip for ip in ips if ip is not None]
|
||||
@@ -225,18 +213,17 @@ def main():
|
||||
ips = dedup(ips)
|
||||
print(f'{ip_stats(ips):s} After removing duplicates', file=sys.stderr)
|
||||
# Enforce minimal number of blocks.
|
||||
ips = [ip for ip in ips if ip['blocks'] >= args.minblocks]
|
||||
ips = [ip for ip in ips if ip['blocks'] >= MIN_BLOCKS]
|
||||
print(f'{ip_stats(ips):s} Enforce minimal number of blocks', file=sys.stderr)
|
||||
# Require service bit 1.
|
||||
ips = [ip for ip in ips if (ip['service'] & 1) == 1]
|
||||
print(f'{ip_stats(ips):s} Require service bit 1', file=sys.stderr)
|
||||
# Require at least 50% 30-day uptime for clearnet, onion and i2p; 10% for cjdns
|
||||
# Require at least 50% 30-day uptime for clearnet, 10% for onion and i2p.
|
||||
req_uptime = {
|
||||
'ipv4': 50,
|
||||
'ipv6': 50,
|
||||
'onion': 50,
|
||||
'i2p': 50,
|
||||
'cjdns': 10,
|
||||
'onion': 10,
|
||||
'i2p' : 10,
|
||||
}
|
||||
ips = [ip for ip in ips if ip['uptime'] > req_uptime[ip['net']]]
|
||||
print(f'{ip_stats(ips):s} Require minimum uptime', file=sys.stderr)
|
||||
@@ -254,7 +241,7 @@ def main():
|
||||
# Sort the results by IP address (for deterministic output).
|
||||
ips.sort(key=lambda x: (x['net'], x['sortkey']))
|
||||
for ip in ips:
|
||||
if ip['net'] == 'ipv6' or ip["net"] == "cjdns":
|
||||
if ip['net'] == 'ipv6':
|
||||
print(f"[{ip['ip']}]:{ip['port']}", end="")
|
||||
else:
|
||||
print(f"{ip['ip']}:{ip['port']}", end="")
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
1029
contrib/seeds/nodes_main_manual.txt
Normal file
1029
contrib/seeds/nodes_main_manual.txt
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,311 +1,29 @@
|
||||
[fccb:248:11a6:1042:bca:1218:f7ce:7d3d]:18333
|
||||
2.87.72.235:18333 # AS6799
|
||||
3.253.163.14:18333 # AS16509
|
||||
5.182.4.106:18333 # AS49505
|
||||
5.188.119.196:18333 # AS49505
|
||||
5.189.175.92:18333 # AS51167
|
||||
5.252.21.232:18333 # AS50673
|
||||
5.255.97.91:18333 # AS60404
|
||||
5.255.99.130:18333 # AS60404
|
||||
8.222.228.217:18333 # AS45102
|
||||
18.143.108.213:18333 # AS16509
|
||||
23.93.89.199:18333 # AS46375
|
||||
23.94.96.134:18333 # AS23352
|
||||
23.137.57.100:18333 # AS16904
|
||||
31.220.99.65:18333 # AS12430
|
||||
35.192.191.229:18333 # AS396982
|
||||
35.200.201.79:18333 # AS15169
|
||||
35.233.152.219:18333 # AS15169
|
||||
37.27.58.134:18333 # AS3209
|
||||
37.27.116.87:18333 # AS3209
|
||||
40.118.228.187:18333 # AS8075
|
||||
43.247.184.50:18333 # AS4134
|
||||
45.77.25.14:18333 # AS20473
|
||||
45.129.182.59:18333 # AS47147
|
||||
47.254.127.252:18333 # AS45102
|
||||
51.77.42.234:18333 # AS16276
|
||||
51.79.82.75:18333 # AS16276
|
||||
51.250.75.48:18333 # AS200350
|
||||
52.174.187.17:18333 # AS8075
|
||||
62.72.27.212:18333 # AS32641
|
||||
62.168.65.42:18333 # AS5578
|
||||
62.210.207.63:18333 # AS12876
|
||||
62.210.222.73:18333 # AS12876
|
||||
65.108.39.171:18333 # AS24940
|
||||
66.85.145.134:18333 # AS12189
|
||||
66.135.29.243:18333 # AS20473
|
||||
66.183.0.205:18333 # AS395570
|
||||
67.4.82.9:18333 # AS209
|
||||
68.197.203.181:18333 # AS6128
|
||||
69.59.18.23:18333 # AS397444
|
||||
69.61.32.242:18333 # AS141518
|
||||
69.197.185.106:18333 # AS32097
|
||||
71.8.29.12:18333 # AS20115
|
||||
71.13.92.62:18333 # AS20115
|
||||
71.171.123.161:18333 # AS701
|
||||
72.46.129.50:18333 # AS53340
|
||||
73.22.9.231:18333 # AS7922
|
||||
73.53.42.105:18333 # AS7922
|
||||
74.213.175.99:18333 # AS21949
|
||||
77.163.221.171:18333 # AS1136
|
||||
79.192.39.105:18333 # AS3320
|
||||
80.79.4.249:18333 # AS49981
|
||||
80.93.179.252:18333 # AS50340
|
||||
80.241.194.147:18333 # AS12964
|
||||
81.17.102.136:18333 # AS15598
|
||||
83.231.240.3:18333 # AS2914
|
||||
84.24.77.191:18333 # AS6830
|
||||
84.155.113.177:18333 # AS3320
|
||||
84.247.164.103:18333 # AS49788
|
||||
85.203.53.89:18333 # AS39351
|
||||
85.203.53.149:18333 # AS39351
|
||||
85.208.69.12:18333 # AS25091
|
||||
85.208.69.13:18333 # AS25091
|
||||
88.80.148.215:18333 # AS44901
|
||||
89.117.19.191:18333 # AS7029
|
||||
89.153.161.16:18333 # AS2860
|
||||
89.155.239.107:18333 # AS2860
|
||||
91.123.182.164:18333 # AS51648
|
||||
91.148.141.210:18333 # AS203380
|
||||
101.100.139.249:18333 # AS133579
|
||||
104.237.131.138:18333 # AS63949
|
||||
109.233.109.26:18333 # AS41798
|
||||
122.208.117.197:18333 # AS2519
|
||||
124.236.16.91:18333 # AS4134
|
||||
129.226.198.211:18333 # AS132203
|
||||
129.226.198.246:18333 # AS132203
|
||||
131.188.40.47:18333 # AS680
|
||||
132.226.61.215:18333 # AS31898
|
||||
135.84.136.157:18333 # AS174
|
||||
137.184.2.124:18333 # AS14061
|
||||
138.2.100.114:18333 # AS31898
|
||||
141.98.219.142:18333 # AS20326
|
||||
141.98.219.199:18333 # AS20326
|
||||
149.50.101.27:18333 # AS174
|
||||
149.154.176.47:18333 # AS3257
|
||||
152.53.17.53:18333 # AS81
|
||||
152.53.18.109:18333 # AS81
|
||||
158.178.228.41:18333 # AS39550
|
||||
160.80.11.66:18333 # AS137
|
||||
162.0.208.90:18333 # AS22612
|
||||
162.244.80.218:18333 # AS19624
|
||||
164.92.140.21:18333 # AS14061
|
||||
169.155.45.180:18333 # AS3356
|
||||
169.155.171.252:18333 # AS3356
|
||||
172.172.62.86:18333 # AS7018
|
||||
175.209.228.141:18333 # AS4766
|
||||
176.108.193.97:18333 # AS47914
|
||||
178.21.118.82:18333 # AS49544
|
||||
178.21.118.96:18333 # AS49544
|
||||
178.63.87.163:18333 # AS24940
|
||||
184.74.240.157:18333 # AS7843
|
||||
185.28.96.16:18333 # AS8220
|
||||
185.70.43.192:18333 # AS19905
|
||||
185.107.68.135:18333 # AS43350
|
||||
185.132.177.104:18333 # AS49981
|
||||
185.186.208.124:18333 # AS206428
|
||||
185.190.24.72:18333 # AS9002
|
||||
185.209.223.195:18333 # AS51167
|
||||
185.210.125.33:18333 # AS205671
|
||||
185.232.70.226:18333 # AS47147
|
||||
186.154.207.228:18333 # AS19429
|
||||
188.117.132.82:18333 # AS31242
|
||||
188.213.90.149:18333 # AS43414
|
||||
188.246.168.144:18333 # AS8595
|
||||
192.198.81.243:18333 # AS31863
|
||||
193.198.34.24:18333 # AS2108
|
||||
194.95.66.129:18333 # AS680
|
||||
194.110.169.133:18333 # AS9121
|
||||
194.233.91.153:18333 # AS141995
|
||||
195.123.244.121:18333 # AS24971
|
||||
195.179.230.180:18333 # AS12874
|
||||
198.58.102.18:18333 # AS63949
|
||||
203.132.94.196:18333 # AS38195
|
||||
205.209.119.150:18333 # AS19318
|
||||
206.204.104.7:18333 # AS6939
|
||||
[2001:19f0:4400:63c7:5400:4ff:fecc:fc1e]:18333 # AS20473
|
||||
[2001:41d0:303:2dbe::]:18333 # AS16276
|
||||
[2001:41d0:303:87b9::]:18333 # AS16276
|
||||
[2001:41d0:601:2000::1f70]:18333 # AS16276
|
||||
[2001:41d0:602:2dea::]:18333 # AS16276
|
||||
[2001:41d0:700:544c::]:18333 # AS16276
|
||||
[2001:41d0:800:1d55::]:18333 # AS16276
|
||||
[2001:41d0:800:3d4c::]:18333 # AS16276
|
||||
[2001:470:1f05:4e5::2020]:18333 # AS6939
|
||||
[2001:470:1f07:6f2:1671:5a1c:2433:b517]:18333 # AS6939
|
||||
[2001:470:1f07:6f2:2e58:b9ff:fe18:e093]:18333 # AS6939
|
||||
[2001:470:1f07:6f2:4dfe:d8fe:3dc7:63f]:18333 # AS6939
|
||||
[2001:470:1f07:6f2:6a34:c61d:97b1:c98c]:18333 # AS6939
|
||||
[2001:638:a000:4140::ffff:47]:18333 # AS680
|
||||
[2001:728:1000:402:546e:98ff:fe16:68c6]:18333 # AS2914
|
||||
[2001:bc8:1201:409:1618:77ff:fe5f:b12]:18333 # AS12876
|
||||
[2401:c080:1000:4cb2:3eec:efff:feb9:8604]:18333 # AS20473
|
||||
[2401:d002:3902:700:8708:37c4:e231:d3d8]:18333 # AS38195
|
||||
[2402:1f00:8101:713::]:18333 # AS16276
|
||||
[2600:3c00::f03c:91ff:fe5b:4cf3]:18333 # AS63949
|
||||
[2600:3c00::f03c:91ff:fe9e:7f03]:18333 # AS63949
|
||||
[2601:603:5300:83b7:0:ff:fe00:420a]:18333 # AS7922
|
||||
[2604:1380:4531:1700::5]:18333 # AS54825
|
||||
[2604:a880:2:d0::65:c001]:18333 # AS14061
|
||||
[2605:a143:2162:7067::1]:18333 # AS174
|
||||
[2607:5300:203:540a::]:18333 # AS16276
|
||||
[2607:5300:60:85a9::]:18333 # AS16276
|
||||
[2620:6e:a000:1:43:43:43:43]:18333 # AS397444
|
||||
[2804:431:e038:cd01:aaa1:59ff:fe0d:44b8]:18333 # AS27699
|
||||
[2806:2f0:90a0:45fe:dd25:f6df:4741:4a3f]:18333 # AS3356
|
||||
[2a00:1298:8001::6542]:18333 # AS5578
|
||||
[2a01:4f8:173:230a::2]:18333 # AS24940
|
||||
[2a01:4f8:190:4026::2]:18333 # AS24940
|
||||
[2a01:4f8:231:1eaa::2]:18333 # AS24940
|
||||
[2a01:4f8:242:4c1b::2]:18333 # AS24940
|
||||
[2a01:4f9:1a:97e8::2]:18333 # AS24940
|
||||
[2a01:4f9:1a:9a57::2]:18333 # AS24940
|
||||
[2a01:4f9:2a:2ddd::2]:18333 # AS24940
|
||||
[2a01:4f9:3070:266e::2]:18333 # AS24940
|
||||
[2a01:4f9:3071:219d::2]:18333 # AS24940
|
||||
[2a01:4f9:3080:358c::2]:18333 # AS24940
|
||||
[2a01:e0a:3b3:1420:7ca0:3a9a:5cc3:b644]:18333 # AS12322
|
||||
[2a02:4780:10:402f::1]:18333 # AS47583
|
||||
[2a02:c202:2189:3702::1]:18333 # AS51167
|
||||
[2a02:c206:2075:3352::1]:18333 # AS51167
|
||||
[2a02:c206:2196:799::1]:18333 # AS51167
|
||||
[2a03:4000:2a:514::]:18333 # AS47147
|
||||
[2a03:cfc0:8000:2a::9532:651b]:18333 # AS201814
|
||||
[2a04:52c0:102:2219::1]:18333 # AS60404
|
||||
[2a04:52c0:102:49af::1]:18333 # AS60404
|
||||
[2a04:52c0:104:160c::1]:18333 # AS60404
|
||||
[2a05:d01c:392:c900:78ea:ba95:334c:1d7c]:18333 # AS16509
|
||||
2lsncqdflwk272dhydrxf7ikfy23ppnmm54dnynyxiym6lqf3wowrmqd.onion:18333
|
||||
36fwktckggarkclbpu2pumsdpck46ahe6cwpozd2gm6q7kgdqljclmad.onion:18333
|
||||
3rlrfxaj4sphzedozs27qrefuw6u3v2cqu2ctbrbvhsc3wn34iezxjad.onion:18333
|
||||
3tao6wnydihsqndjw5pqbko25rxk23wb53gtyv7vmbmc2j7vw74cr2ad.onion:18333
|
||||
44sgcv5dvpplt32enlneddyl4gd4z3tbezl2scedwccndyzrrp6lcgyd.onion:18333
|
||||
4w3f2mxe4ftodocermsazs3qlpo37igkdgne6ka2p6wnnrgwpzqw65yd.onion:18333
|
||||
67l6l2k7mqbl2btyvo5h5lki3kxcrgbunlk7brcloyaoaftbs5mnsuad.onion:18333
|
||||
6m7khktveimc35yjusgeprndw43grjexs5bpruwkogbh5lovv47drlid.onion:18333
|
||||
6rnqpqqcpllqhjoa4gwrtq5yi6fdch6uqzapdee2gq67gxgsl73v4uqd.onion:18333
|
||||
2yq4xcwzvb2ktyci5lpmb2q3nl6qqywb7nrf6fkcthha7l3tle2q.b32.i2p:0
|
||||
4g5uvbkvi5fvyditekvzajldtzgurorqjupuwtmymrjloq6cjm5q.b32.i2p:0
|
||||
f3w7soepsy7jqwf7dlo4ro2qkyapg2lrb2dkkvwfwuymgaqvljqa.b32.i2p:0
|
||||
nr7nozlb54xv3ozg4ksvcr3ofzfwfeud2n7xijywvt22ixzal7qa.b32.i2p:0
|
||||
o6j3b33bv26vthoqzjy3h7a3qsuqbtbe3ulajmjzsl43vaqyieyq.b32.i2p:0
|
||||
ocqipbbxx4paopgkkbnj234ie7opzrtca5gtiwr6oda3h32rzgsa.b32.i2p:0
|
||||
r2zdpkcslf7e4t2fmglu45xhfw5zgupthdh5pcewdo6jajumveda.b32.i2p:0
|
||||
xgctj4seo3ofstiymoyeuzq74bvddrbr6jtia6erodlf5va3cz5a.b32.i2p:0
|
||||
y5e6aqz4jkjjoeipoxwurzc2jrfv6ilvfbdqmjqk574maba5uara.b32.i2p:0
|
||||
ye3ajv2tgpq7jvvzzn5wxbtmd3txev3axsdla5bkpobeiwccyjjq.b32.i2p:0
|
||||
7ph7mrc24te57mvppajfkfj4mk7zuz4teukymt3wgpdpw6vpndeivtyd.onion:18333
|
||||
7poqajl6svz4vr3aqi7vdtar2t56crbrtj6yi75ydrt3ighyx7q6qvyd.onion:18333
|
||||
7zlqrihb5do5ebbmjwgspxigqfdmkfslkqtg2ngdc6ypsunzb4iootqd.onion:18333
|
||||
adjnsxivlsb5m4e4bfthvvccjfv7zkpyjyebvatlhyqycykd7ibjyoqd.onion:18333
|
||||
adstabjz7ec2y3jt4w2dvummowzv7g6m2f3kajeejffuaz7ojwj6epqd.onion:18333
|
||||
aesy6tfufadkut6flu2bsqgnw2422ur2ynjalguxlzuzuktg3zehttqd.onion:18333
|
||||
ailib3qk4brh4z2nvmmadoi6gbsw7fihfxtr7rnm4z5d6qcspr7ky2qd.onion:18333
|
||||
ayx35r2mhwydczzoqu7b6dl3sup4oht74sgnlrjkxybzh2hmfnaix3qd.onion:18333
|
||||
bek652lfs7mje46zauhfxtdh2zohe2jpbsmlhulusuzao27uwpwd76ad.onion:18333
|
||||
bkzo7mpxuar7rhsbiwdaxqcymixarcbdmb3sdaqtv6yb2svqttz2s6ad.onion:18333
|
||||
bwyudvl3if3r7ese2caymfnbxqztc3mgr2i5hurjttlabhl3dfgyzead.onion:18333
|
||||
bzn63lsmsuvzlg4uqadyylxaggdcrzkb56muw2b43ft5qkynvzfopbyd.onion:18333
|
||||
c7zrq2yqt6rtn5dxkczp5bv62k2jncv3mscoo24c24rljbplr2dvhsid.onion:18333
|
||||
cqhut2deas6savhop2yue7vebu77fd3einx36tlgxr7bb6vlef3lb2yd.onion:18333
|
||||
cv5z3izcu7fmtby4hyjliphp6bh2a3zmm27tfendycu34tw2tka72syd.onion:18333
|
||||
cyl7eujkxl3s3cbuhmouhkxt4cdfplpbha2z6j5adacdaq2rjj2dlzyd.onion:18333
|
||||
d63vf45ta4chrewnruyvypm7ybfxtut327crtq6qfyrvcwx434rli5qd.onion:18333
|
||||
ddsxs3zdkspqkcszmx74rkw7gqjgpz2ufb4qqh4dz5iaysoe3fvtpdyd.onion:18333
|
||||
duuwdfnlrudonwgdvvaud3i52zdxg2bjey7jmzskgcauiyejyffrh5qd.onion:18333
|
||||
dwb47cmqa2tjpmvjaear7gdcars2lez6niefhi4qf22qehtyta6577qd.onion:18333
|
||||
e27nbjkou2mkquoytjil27g5h34wkgjtrwupn3muc2c2b76dfdkvkiyd.onion:18333
|
||||
e7tkrf54ng3q5vcn5gn77zwjwm74lkfav4mwdux3pvon6yvqg3tf46qd.onion:18333
|
||||
eev3vuh55dymhn3z4lmhargcy2xzm6l4yyd5b4bgfstx2sf75ms6mdid.onion:18333
|
||||
eyjahrgj7qadzcotanxfbhshsjm7yj3p6tssiupiub7k5s55nxc5xwad.onion:18333
|
||||
f6awicobzr3x4fz3dnxbroarbuleq26jzltnl6wknkph2luxruwijiqd.onion:18333
|
||||
fbimesnyhzubbzqc3uaufzkbyfmnkxvypoxaveaub7rzpzh2foxrn2yd.onion:18333
|
||||
fjcr55gg3vv7qik64sxnihheuvkfytpvzm5jmgz55cp6427yvyjsotid.onion:18333
|
||||
fpzycmcz4drh46fhcfdkgibnp7qgioo3upquxyjwk6zegirbcd4xqcid.onion:18333
|
||||
fqls7cvum7lpawad7n5zrvmrqwrd76quc5r7pblndaod3wqjlpfzxgid.onion:18333
|
||||
fwswqt2rbdbstx5kza4gb7aok3gezazfgtokadqeiwgkgdkwwdmmidyd.onion:18333
|
||||
fx7erwmkuhj7p2eiuisjwg3g3a3aw6uglepa47gwc76dlrwpc3nn5uid.onion:18333
|
||||
ghqbqp3dirya7espnj3m3kh6mhalqxjv75muum4seukopedtwysxc2qd.onion:18333
|
||||
gpvbbdsv673zfg2mpbzxexnmv3oqakgqooyvyzrlhu6mucylfob4whid.onion:18333
|
||||
gri2j4tudvoxaz26jbzmn4kloo5z7qsi3vfi3c5ok5tunm3yzmfgwyqd.onion:18333
|
||||
gsw6sn27quwf6u3swgra6o7lrp5qau6kt3ymuyoxgkth6wntzm2bjwyd.onion:18333
|
||||
efqfw6vjq7gpgyhosu3qf24hsshxpbhay426ccsgz54key4cvwund6yd.onion:18333
|
||||
gy6nih4pmp5esyvvnhlj6qvk7zkbjuoswkxffyiip3dbkvsfxwz5zcqd.onion:18333
|
||||
h4xr7yovy3kgrohdlb5zljtyweelyctfgf5q24nlhyoxbmjmbl7bfjyd.onion:18333
|
||||
h4yusgljraifanij4pxkw4qks4iilqbq35absi24cinuvuym56ge55ad.onion:18333
|
||||
hba3mphxhpuy4x5gjqyq64bwtlzlfuscxc7n5lh4k4oiwrgcz5ujwtid.onion:18333
|
||||
hj2txlxajdlh7jsfwqxtp3cltlptsr33ctjkbxhbzbyirkmcpfhsnyad.onion:18333
|
||||
hmtbnymouaimhnxazujw7i5b7hqdixrlibdyn3td4bdw4sj7sbnb7fqd.onion:18333
|
||||
htkiqaqoql7pjstenmw6v4blm6l57d6hl6mewxkmfi3qumozflx3gzyd.onion:18333
|
||||
hvbmmzvqrpgps2x5u4ip4ksf3e5m2fneac754gtnhjn2rsevni6cz3ad.onion:18333
|
||||
hvtxymvdb55u7lhdw6775akqy46inunl3uup27gnsxm2bqmv55wbacqd.onion:18333
|
||||
i5fjp7ggx62zlfkibzn7s6glpjp3h2ypfom3lmqixig7qbdgej35wfyd.onion:18333
|
||||
hwipziotclxg3ledn5yj5j6n6pkrgnmlksozzlrtlnlpguvixox7naqd.onion:18333
|
||||
i5gphw2d224tniqkjebxdwz5ygbbo5gcushoyevv7x7o454b6qlrzeid.onion:18333
|
||||
ihalgm3hs54h7aq37hbryaxcdlowmlms54i4cz6hqbz4n2qjjiw5uwid.onion:18333
|
||||
ipbzs2lbe7lab2xaikvkdkwxian6t3nakaoltwbshpevbszdvoyyjiad.onion:18333
|
||||
iysx2dl4tpojiclh32iyhel6z7h227c7o7buzk5wuqw6qhuytvsu66yd.onion:18333
|
||||
jbgve7zi4vx5l7654ih4nzutspu36dvs66xlegciur2cpym4gdjigbyd.onion:18333
|
||||
jjfuyj7krgzkmpxvn3b2j2hwlzkmze3ezy3ifwk7dnswwawgmzqhjrqd.onion:18333
|
||||
jnphftehkfstwbko34idxlpo5fdw6lromkmeukxh3xclthlstehpg4ad.onion:18333
|
||||
jpujgmcr2ftklxrr7uwxh3jg43uqatys7wgosfbpfbx5txw2nz7wgnid.onion:18333
|
||||
jsc4frvvnl2d3bhzyofsc72xpztgm23nl4fnb4dwkzsxr6fhij2q5iyd.onion:18333
|
||||
jrhpwqahjrj75gtb7gt23eve65x7bbawy7j4edhmgbo5nj2mkaeghbyd.onion:18333
|
||||
jun6gdmbgasr57bhr4zs3dfhc6pzpaw27nqb4dadbai7yrbq55zskeid.onion:18333
|
||||
kamanho5clcpn5l3sc6ih3vb4skmfhgxw3h2mgs7e5idfezu5dw5oxyd.onion:18333
|
||||
kejyzttreyd7nj2sxx25nk4qwgxtuqybylxuqrjroe5mbhlr532dplad.onion:18333
|
||||
knkkqbxhdit4xilksb5ys3qnqv63tah5uvu3n2imu4bycipu354ambyd.onion:18333
|
||||
kpsy7bbqxiotk55aacjt2hiaj6h5pxjjvsb63hgos4ayfzwrmnsqgsad.onion:18333
|
||||
kwjxlauwjtecjfsiwopbl5pvn5n6z5rz76uk6osmlurd3uyuymcw7aid.onion:18333
|
||||
m27hd27n7dmnygddnp5bnf6vl5uks77jrq2uhtxxvgewclzjwsixz3ad.onion:18333
|
||||
m33zm5qtzgaf65ahaxbom75zoehyzr3lbqf2obtpzzzjebv7yd73fsyd.onion:18333
|
||||
mjs6pdnd5h4ycmsgruww4crsesqzdw3femdinsi6oghmjld7loycomid.onion:18333
|
||||
n23anw4zb7f3paroac626oc2sqy3yn5kjfpcqvb3lvdyx7dzzpovd3id.onion:18333
|
||||
n4e6fp6xoyo2glsafjwbaq3wirhldpjw4mskn5lzkm4o5lhh5n5k7uqd.onion:18333
|
||||
noyzwtpfqybyhemrmxzd7nf4il5mhsolupp7xtmrjosat7qdmq4xgrad.onion:18333
|
||||
oln7ybci53wk4g5n42nipyixvyjxbludsbrfsmhnirb6tk7ovlikd5id.onion:18333
|
||||
oobwtn5csi4auevb2ns2b5rrjnxmhlzdmay4zxtzvkj7tayrgwfddiqd.onion:18333
|
||||
oond3qmndkbdg76ryyjztbmsmvoj43u64gjhr2nvqriujyteeu43irqd.onion:18333
|
||||
oqxivxpit74wsoptsb6kr3k2xeqpzfdozvw4m2wvvujrflxo4ykmzmqd.onion:18333
|
||||
oxkyujnjbl6k7kcxactyf4akp3ejtftnbmztk6utxt4zy4fhhtk3x5qd.onion:18333
|
||||
p2oitystyas5pxeo262mox6aof4tukybnl7cj7fcwoshqesvfk2yzhad.onion:18333
|
||||
pj2rxq2sfbwtsqqcbnfnwkg36d72yce56qmp2sjjmb7hvzpzai3ndead.onion:18333
|
||||
pu3zcecujzbsdaogf4qgo3ue67livoza62awlffjnqnribgmvyqfoxad.onion:18333
|
||||
q5qox756id5nfdu6ht4dghc35jezls4bgjcdnrds3pwndvdx32zmwlad.onion:18333
|
||||
qe2jbe447he6panfvpyqhyntf7346gmuf55bxrmdzggmgwyjsyknhxyd.onion:18333
|
||||
qf2taqwtz3pstt73hgbrfvtilgecsc556lizkzk2cisdqi7lrnst5byd.onion:18333
|
||||
qiep4hvuovedbbc36hl7nwslwi6ah6uw4nnseyjdtc73cc5rfdauvnad.onion:18333
|
||||
qqzemertqrw5qdfakjoay35weu6qshr2l5h4smlnqafi3zqfztx2mhyd.onion:18333
|
||||
qzx5f2ig2rk2ssrbopz2zlljq5mkeh3izhhx3t3cepse5qnhvpo2tzid.onion:18333
|
||||
r2bdfkchj2z6nrb56alubzmb4twzdncckbcxsvkszjc6mrinibakj3ad.onion:18333
|
||||
rfi2hdpjhhknalltbwdvyuhskh5yjs66rqzpy6ley7xtu4kvbeob6fqd.onion:18333
|
||||
rra7q7x3euc3ozyealiv3tsywrz34l466faxohmttwtf5dts73musjid.onion:18333
|
||||
sf2fkr6hgfezefxaqfqqn5rengrlkvwytrzepsavwotehp2lkvuys6id.onion:18333
|
||||
shph2uqcvbe2hc25q3ln73qsche5ddqb4u5tkmgqv73aicrmmkkj4kid.onion:18333
|
||||
slpigm5ep4zan3a65bybne67phjiyesbuk5s3bodefuhnx2cfdtit6qd.onion:18333
|
||||
sxm6kwrdp6f2ggaozhrl47xuy3es3sgm3ivppmh4xm3hfmetvwbyrcad.onion:18333
|
||||
t3z7sscjdbnsydohxcs5nmoxfi35p6zv4jv5jsltsl4datztkefumbid.onion:18333
|
||||
tdnctk4lx7jnklojisdczp6h4b4ejtuetyh5cbemzmcno7vvo7whvaad.onion:18333
|
||||
trxouvgcwrc3rkewpzvkxbfvpltfwmgl37woiujj4vn63zwhvk4xwbid.onion:18333
|
||||
tyo6jvqjh34r2b7i477xlcrwt7rq2fwuwpax5s3nw3tfbtwbox7aakyd.onion:18333
|
||||
u3znfxh6yjvclu3l646zzmgclqkmmrrrwtb5urtr4wd6svhrhdgrdxid.onion:18333
|
||||
uc25t5mdmnpxn52qib3cps4qyc4ghbntitetzia2vkqaawivyqzdhkad.onion:18333
|
||||
ud55gevhzhhcjsaghfzqq7wywxmw7n6syhwsds2uw4j7oj2oh5zxb6qd.onion:18333
|
||||
ueyykmnyqk2bnmbgvmqrb4jfbjvpgeew6cuq4gaqe7v2oiyxaubkx4qd.onion:18333
|
||||
uw7if6wybpzzwrawp6rdtkcript7vmuo4bptlg4den7t2o733j4hwrid.onion:18333
|
||||
vctlwaqgmu53eutz2hewuakcipfgtyljsd7czut4dd62xr3rp6fqezad.onion:18333
|
||||
vqnkdmpmecc5kondj32jwbemmruhmd5gkmfngkscetibzozryp4elkad.onion:18333
|
||||
w2nnsjp3o5ndh4reorwsudmkjvy3bou5gt7fmusvp3ne2fojgypapmyd.onion:18333
|
||||
wnxgjgjgplv5iu4mssyuunycvku4qnqr5t4q6cfdt47k7uwrfifuirad.onion:18333
|
||||
wou7tjvuqmql27mqmxbtsrrdxn4dqbti3jbpnklkruqjrztty2jmj4qd.onion:18333
|
||||
wpsahjbejxehpz772kzxonj777pejol2akcicduqov2r7ktm2b6l5pid.onion:18333
|
||||
wui5m2y5b7cms36ai6shzyqsg6qteejwmxsf26nyms6vcykxbvmh4uad.onion:18333
|
||||
wve6wksecq6eeu62phkkrjo5vydreenazzp5c6gttto5ynuyqjevddad.onion:18333
|
||||
x4wvxqotarjnii6ue4tfvqt5rxlc27p2c5imkipsu27oprfxstmdjgyd.onion:18333
|
||||
xafcyh6mxwebvcsgw4wcbuw7n4v7vbqhcznhwqcpqcu6dww2mjuw4nad.onion:18333
|
||||
xmzegggz4kmjmyip2dogvhj3a2m3s4mkimdjdqkwql5n3crqetddabid.onion:18333
|
||||
xr4vm6rxolszjw7m73mii35ppnyt7aqp7w53yyg7smcpbo2mg3fazpqd.onion:18333
|
||||
xr6damsupgddwwziixaeaogj67hnjdpjtey5bcnhs5ydppul4w5hnjyd.onion:18333
|
||||
o52y7fadtubr4tuqhix6ymrin3qzn7ubh5tewuuehw5wxcbnfj6yaoad.onion:18333
|
||||
rigfm3joif5lsl7b7yr6d6cvddukawykm7kgguzfwi6dplckyz6x7gad.onion:18333
|
||||
t6d6epb5ccbo4e66iaanukraxpjmqiqsz6poj5uvxu2ownnhcguygdyd.onion:18333
|
||||
test2vozlxfznmfyxzkulf3l6qe6dti5hqfjsxar5lml45cjnyeusmyd.onion:18333
|
||||
uxtmtmpkfaxc6zcxaxgydrukyd5jdrcp2m5oubpimijy44rnjuywijad.onion:18333
|
||||
xuhmq42du7dckfophyr2rmf75aqkp3bk6y3wyyc6jxw7jmpp66zlm3id.onion:18333
|
||||
y4eud6iabao4666vcq3qch6kvg6lg5q5hazzetk4jnwr6vcdyjdv2yyd.onion:18333
|
||||
y5h652jz6sgmb4bkcfnfxnj24gnczqf7lhd5lqbvdhf5mpll4gye5kid.onion:18333
|
||||
ya6s7ov7myixz3ql23u45hty7moxo3r4d26qainw55z656vtau676xid.onion:18333
|
||||
yda7kwpii33j2qpq32ftf6lp22znknswipjwaccvsqj7l337jvfesnid.onion:18333
|
||||
ykaknq35wnwbobp4hgsxdd3ve575bsflst6xppo5b4wc44fp3xpqavad.onion:18333
|
||||
yqlk3ooxjpjd6u7b4kabe3gidclf25yuqbcpbkwnedmljrmxm3smqrid.onion:18333
|
||||
zcsn3j6aswnrf56xj2n5jn4tlwmyoq4benjn5ujcgz46co2y5tm642id.onion:18333
|
||||
zefnna2a3ga4ez2nutvypma7my35prw3ycinbqwva7v4pf3aurqhjcyd.onion:18333
|
||||
zevf5zwmkq2mvwuwyfavq62hjapkcdfslewiyi7mlrbx7vzidtij3xad.onion:18333
|
||||
zhiju2obxifqpjbcm6xtlgjdbof7jhoctvw3x57vhiftstb5hi3gmsqd.onion:18333
|
||||
zii3p3plpqt34xxd4mr7ofvvixnipt7ikohgvi3gtjlnzofjj37byiid.onion:18333
|
||||
zkqddzui5pkrqvjj2zwsf5kln7stlbmw5pmn6ut46fobvzyv2sn2ryid.onion:18333
|
||||
zmvizz7fd5hdue6wt3lwqumd6qwt4ijymmmotfzh75curq3mzjm53hyd.onion:18333
|
||||
zmxlrzoxg4fmso6l2xuq5tdxmlyakdqellzujh3a23iuzg4zlatnogqd.onion:18333
|
||||
zv5egkfmdpunhdm3whdaxgzpiapbkerfqd24juq647hmzhec7q7uxlid.onion:18333
|
||||
zcep44k7unwjm2wxty4ijh2e4fv5zgbrvwlctzyaqnrqhltjfzrtodad.onion:18333
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
18.189.156.102:48333 # AS16509
|
||||
18.201.207.55:48333 # AS16509
|
||||
51.158.248.8:48333 # AS12876
|
||||
57.128.176.163:48333 # AS8220
|
||||
82.67.102.15:48333 # AS12322
|
||||
88.99.248.50:48333 # AS24940
|
||||
95.217.73.162:48333 # AS24940
|
||||
103.99.171.212:48333 # AS54415
|
||||
103.165.192.210:48333 # AS54415
|
||||
@@ -52,20 +52,20 @@ def signet_txs(block, challenge):
|
||||
mroot = block.get_merkle_root(hashes)
|
||||
|
||||
sd = b""
|
||||
sd += block.nVersion.to_bytes(4, "little", signed=True)
|
||||
sd += struct.pack("<i", block.nVersion)
|
||||
sd += ser_uint256(block.hashPrevBlock)
|
||||
sd += ser_uint256(mroot)
|
||||
sd += block.nTime.to_bytes(4, "little")
|
||||
sd += struct.pack("<I", block.nTime)
|
||||
|
||||
to_spend = CTransaction()
|
||||
to_spend.version = 0
|
||||
to_spend.nVersion = 0
|
||||
to_spend.nLockTime = 0
|
||||
to_spend.vin = [CTxIn(COutPoint(0, 0xFFFFFFFF), b"\x00" + CScriptOp.encode_op_pushdata(sd), 0)]
|
||||
to_spend.vout = [CTxOut(0, challenge)]
|
||||
to_spend.rehash()
|
||||
|
||||
spend = CTransaction()
|
||||
spend.version = 0
|
||||
spend.nVersion = 0
|
||||
spend.nLockTime = 0
|
||||
spend.vin = [CTxIn(COutPoint(to_spend.sha256, 0), b"", 0)]
|
||||
spend.vout = [CTxOut(0, b"\x6a")]
|
||||
|
||||
@@ -41,7 +41,8 @@ from bcc import BPF, USDT
|
||||
program = """
|
||||
#include <uapi/linux/ptrace.h>
|
||||
|
||||
#define MIN(a,b) ({ __typeof__ (a) _a = (a); __typeof__ (b) _b = (b); _a < _b ? _a : _b; })
|
||||
// A min() macro. Prefixed with _TRACEPOINT_TEST to avoid collision with other MIN macros.
|
||||
#define _TRACEPOINT_TEST_MIN(a,b) ({ __typeof__ (a) _a = (a); __typeof__ (b) _b = (b); _a < _b ? _a : _b; })
|
||||
|
||||
// Maximum possible allocation size
|
||||
// from include/linux/percpu.h in the Linux kernel
|
||||
@@ -88,7 +89,7 @@ int trace_inbound_message(struct pt_regs *ctx) {
|
||||
bpf_usdt_readarg_p(3, ctx, &msg->peer_conn_type, MAX_PEER_CONN_TYPE_LENGTH);
|
||||
bpf_usdt_readarg_p(4, ctx, &msg->msg_type, MAX_MSG_TYPE_LENGTH);
|
||||
bpf_usdt_readarg(5, ctx, &msg->msg_size);
|
||||
bpf_usdt_readarg_p(6, ctx, &msg->msg, MIN(msg->msg_size, MAX_MSG_DATA_LENGTH));
|
||||
bpf_usdt_readarg_p(6, ctx, &msg->msg, _TRACEPOINT_TEST_MIN(msg->msg_size, MAX_MSG_DATA_LENGTH));
|
||||
|
||||
inbound_messages.perf_submit(ctx, msg, sizeof(*msg));
|
||||
return 0;
|
||||
@@ -108,7 +109,7 @@ int trace_outbound_message(struct pt_regs *ctx) {
|
||||
bpf_usdt_readarg_p(3, ctx, &msg->peer_conn_type, MAX_PEER_CONN_TYPE_LENGTH);
|
||||
bpf_usdt_readarg_p(4, ctx, &msg->msg_type, MAX_MSG_TYPE_LENGTH);
|
||||
bpf_usdt_readarg(5, ctx, &msg->msg_size);
|
||||
bpf_usdt_readarg_p(6, ctx, &msg->msg, MIN(msg->msg_size, MAX_MSG_DATA_LENGTH));
|
||||
bpf_usdt_readarg_p(6, ctx, &msg->msg, _TRACEPOINT_TEST_MIN(msg->msg_size, MAX_MSG_DATA_LENGTH));
|
||||
|
||||
outbound_messages.perf_submit(ctx, msg, sizeof(*msg));
|
||||
return 0;
|
||||
|
||||
@@ -13,8 +13,8 @@
|
||||
#
|
||||
# Note that suppressions may depend on OS and/or library versions.
|
||||
# Tested on:
|
||||
# * aarch64 (Ubuntu Noble system libs, clang, without gui)
|
||||
# * x86_64 (Ubuntu Noble system libs, clang, without gui)
|
||||
# * aarch64 (Debian Bookworm system libs, clang, without gui)
|
||||
# * x86_64 (Debian Bookworm system libs, clang, without gui)
|
||||
{
|
||||
Suppress libdb warning - https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=662917
|
||||
Memcheck:Cond
|
||||
|
||||
@@ -50,7 +50,6 @@ Get JSON output and don't prompt for user input (no auto key import):
|
||||
|
||||
```sh
|
||||
./contrib/verify-binaries/verify.py --json pub 22.0-x86
|
||||
./contrib/verify-binaries/verify.py --json pub 23.0-rc5-linux-gnu
|
||||
```
|
||||
|
||||
Rely only on local GPG state and manually specified keys, while requiring a
|
||||
@@ -58,15 +57,14 @@ threshold of at least 10 trusted signatures:
|
||||
```sh
|
||||
./contrib/verify-binaries/verify.py \
|
||||
--trusted-keys 74E2DEF5D77260B98BC19438099BAD163C70FBFA,9D3CC86A72F8494342EA5FD10A41BDC3F4FAFF1C \
|
||||
--min-good-sigs 10 pub 22.0-linux
|
||||
--min-good-sigs 10 pub 22.0-x86
|
||||
```
|
||||
|
||||
If you only want to download the binaries for a certain architecture and/or platform, add the corresponding suffix, e.g.:
|
||||
If you only want to download the binaries for a certain platform, add the corresponding suffix, e.g.:
|
||||
|
||||
```sh
|
||||
./contrib/verify-binaries/verify.py pub 25.2-x86_64-linux
|
||||
./contrib/verify-binaries/verify.py pub 24.1-rc1-darwin
|
||||
./contrib/verify-binaries/verify.py pub 27.0-win64-setup.exe
|
||||
./contrib/verify-binaries/verify.py pub 24.0.1-darwin
|
||||
./contrib/verify-binaries/verify.py pub 23.1-rc1-win64
|
||||
```
|
||||
|
||||
If you do not want to keep the downloaded binaries, specify the cleanup option.
|
||||
|
||||
@@ -12,21 +12,6 @@ def main():
|
||||
expect_code(run_verify("", "pub", '0.32.awefa.12f9h'), 11, "Malformed version should fail")
|
||||
expect_code(run_verify('--min-good-sigs 20', "pub", "22.0"), 9, "--min-good-sigs 20 should fail")
|
||||
|
||||
print("- testing verification (22.0-x86_64-linux-gnu.tar.gz)", flush=True)
|
||||
_220_x86_64_linux_gnu = run_verify("--json", "pub", "22.0-x86_64-linux-gnu.tar.gz")
|
||||
try:
|
||||
result = json.loads(_220_x86_64_linux_gnu.stdout.decode())
|
||||
except Exception:
|
||||
print("failed on 22.0-x86_64-linux-gnu.tar.gz --json:")
|
||||
print_process_failure(_220_x86_64_linux_gnu)
|
||||
raise
|
||||
|
||||
expect_code(_220_x86_64_linux_gnu, 0, "22.0-x86_64-linux-gnu.tar.gz should succeed")
|
||||
v = result['verified_binaries']
|
||||
assert result['good_trusted_sigs']
|
||||
assert len(v) == 1
|
||||
assert v['bitcoin-22.0-x86_64-linux-gnu.tar.gz'] == '59ebd25dd82a51638b7a6bb914586201e67db67b919b2a1ff08925a7936d1b16'
|
||||
|
||||
print("- testing verification (22.0)", flush=True)
|
||||
_220 = run_verify("--json", "pub", "22.0")
|
||||
try:
|
||||
|
||||
@@ -97,17 +97,23 @@ def bool_from_env(key, default=False) -> bool:
|
||||
|
||||
|
||||
VERSION_FORMAT = "<major>.<minor>[.<patch>][-rc[0-9]][-platform]"
|
||||
VERSION_EXAMPLE = "22.0 or 23.1-rc1-darwin.dmg or 27.0-x86_64-linux-gnu"
|
||||
VERSION_EXAMPLE = "22.0-x86_64 or 23.1-rc1-darwin"
|
||||
|
||||
def parse_version_string(version_str):
|
||||
# "<version>[-rcN][-platform]"
|
||||
version_base, _, platform = version_str.partition('-')
|
||||
rc = ""
|
||||
if platform.startswith("rc"): # "<version>-rcN[-platform]"
|
||||
rc, _, platform = platform.partition('-')
|
||||
# else "<version>" or "<version>-platform"
|
||||
parts = version_str.split('-')
|
||||
version_base = parts[0]
|
||||
version_rc = ""
|
||||
version_os = ""
|
||||
if len(parts) == 2: # "<version>-rcN" or "version-platform"
|
||||
if "rc" in parts[1]:
|
||||
version_rc = parts[1]
|
||||
else:
|
||||
version_os = parts[1]
|
||||
elif len(parts) == 3: # "<version>-rcN-platform"
|
||||
version_rc = parts[1]
|
||||
version_os = parts[2]
|
||||
|
||||
return version_base, rc, platform
|
||||
return version_base, version_rc, version_os
|
||||
|
||||
|
||||
def download_with_wget(remote_file, local_file):
|
||||
@@ -508,9 +514,7 @@ def verify_published_handler(args: argparse.Namespace) -> ReturnCode:
|
||||
# Extract hashes and filenames
|
||||
hashes_to_verify = parse_sums_file(SUMS_FILENAME, [os_filter])
|
||||
if not hashes_to_verify:
|
||||
available_versions = ["-".join(line[1].split("-")[2:]) for line in parse_sums_file(SUMS_FILENAME, [])]
|
||||
closest_match = difflib.get_close_matches(os_filter, available_versions, cutoff=0, n=1)[0]
|
||||
log.error(f"No files matched the platform specified. Did you mean: {closest_match}")
|
||||
log.error("no files matched the platform specified")
|
||||
return ReturnCode.NO_BINARIES_MATCH
|
||||
|
||||
# remove binaries that are known not to be hosted by bitcoincore.org
|
||||
|
||||
@@ -101,6 +101,10 @@ host_os+=$(findstring netbsd,$(full_host_os))
|
||||
host_os+=$(findstring openbsd,$(full_host_os))
|
||||
host_os+=$(findstring mingw32,$(full_host_os))
|
||||
|
||||
ifeq (android,$(findstring android,$(full_host_os)))
|
||||
host_os:=android
|
||||
endif
|
||||
|
||||
host_os:=$(strip $(host_os))
|
||||
ifeq ($(host_os),)
|
||||
host_os=$(full_host_os)
|
||||
@@ -143,7 +147,7 @@ include packages/packages.mk
|
||||
# 2. Before including packages/*.mk (excluding packages/packages.mk), since
|
||||
# they rely on the build_id variables
|
||||
#
|
||||
build_id:=$(shell env CC='$(build_CC)' C_STANDARD='$(C_STANDARD)' CXX='$(build_CXX)' CXX_STANDARD='$(CXX_STANDARD)' AR='$(build_AR) 'NM='$(build_NM)' RANLIB='$(build_RANLIB)' STRIP='$(build_STRIP)' SHA256SUM='$(build_SHA256SUM)' DEBUG='$(DEBUG)' LTO='$(LTO)' NO_HARDEN='$(NO_HARDEN)' ./gen_id '$(BUILD_ID_SALT)' 'GUIX_ENVIRONMENT=$(realpath $(GUIX_ENVIRONMENT))')
|
||||
build_id:=$(shell env CC='$(build_CC)' C_STANDARD='$(C_STANDARD)' CXX='$(build_CXX)' CXX_STANDARD='$(CXX_STANDARD)' AR='$(build_AR)' NM='$(build_NM)' RANLIB='$(build_RANLIB)' STRIP='$(build_STRIP)' SHA256SUM='$(build_SHA256SUM)' DEBUG='$(DEBUG)' LTO='$(LTO)' NO_HARDEN='$(NO_HARDEN)' ./gen_id '$(BUILD_ID_SALT)' 'GUIX_ENVIRONMENT=$(realpath $(GUIX_ENVIRONMENT))')
|
||||
$(host_arch)_$(host_os)_id:=$(shell env CC='$(host_CC)' C_STANDARD='$(C_STANDARD)' CXX='$(host_CXX)' CXX_STANDARD='$(CXX_STANDARD)' AR='$(host_AR)' NM='$(host_NM)' RANLIB='$(host_RANLIB)' STRIP='$(host_STRIP)' SHA256SUM='$(build_SHA256SUM)' DEBUG='$(DEBUG)' LTO='$(LTO)' NO_HARDEN='$(NO_HARDEN)' ./gen_id '$(HOST_ID_SALT)' 'GUIX_ENVIRONMENT=$(realpath $(GUIX_ENVIRONMENT))')
|
||||
|
||||
boost_packages_$(NO_BOOST) = $(boost_packages)
|
||||
@@ -181,6 +185,9 @@ all_packages = $(packages) $(native_packages)
|
||||
|
||||
meta_depends = Makefile config.guess config.sub funcs.mk builders/default.mk hosts/default.mk hosts/$(host_os).mk builders/$(build_os).mk
|
||||
|
||||
$(host_arch)_$(host_os)_native_binutils?=$($(host_os)_native_binutils)
|
||||
$(host_arch)_$(host_os)_native_toolchain?=$($(host_os)_native_toolchain)
|
||||
|
||||
include funcs.mk
|
||||
|
||||
final_build_id_long+=$(shell $(build_SHA256SUM) config.site.in)
|
||||
@@ -210,8 +217,9 @@ $(host_prefix)/.stamp_$(final_build_id): $(native_packages) $(packages)
|
||||
# tool needs to be available in $PATH at all times.
|
||||
#
|
||||
# 2. If the tool is _**not**_ expected to be available in $PATH at all times
|
||||
# it needs to be referred to by its absolute path, such as would be output
|
||||
# by the AC_PATH_{PROG,TOOL} macros.
|
||||
# (such as is the case for our native_cctools binutils tools), it needs to
|
||||
# be referred to by its absolute path, such as would be output by the
|
||||
# AC_PATH_{PROG,TOOL} macros.
|
||||
#
|
||||
# Minor note: it is also okay to refer to tools by their absolute path even if
|
||||
# we expect them to be available in $PATH at all times, more specificity does
|
||||
@@ -225,7 +233,8 @@ $(host_prefix)/share/config.site : config.site.in $(host_prefix)/.stamp_$(final_
|
||||
-e 's|@RANLIB@|$(host_RANLIB)|' \
|
||||
-e 's|@NM@|$(host_NM)|' \
|
||||
-e 's|@STRIP@|$(host_STRIP)|' \
|
||||
-e 's|@OBJDUMP@|$(host_OBJDUMP)|' \
|
||||
-e 's|@OTOOL@|$(host_OTOOL)|' \
|
||||
-e 's|@INSTALL_NAME_TOOL@|$(host_INSTALL_NAME_TOOL)|' \
|
||||
-e 's|@DSYMUTIL@|$(host_DSYMUTIL)|' \
|
||||
-e 's|@build_os@|$(build_os)|' \
|
||||
-e 's|@host_os@|$(host_os)|' \
|
||||
|
||||
@@ -38,22 +38,21 @@ Common `host-platform-triplet`s for cross compilation are:
|
||||
- `riscv32-linux-gnu` for Linux RISC-V 32 bit
|
||||
- `riscv64-linux-gnu` for Linux RISC-V 64 bit
|
||||
- `s390x-linux-gnu` for Linux S390X
|
||||
- `armv7a-linux-android` for Android ARM 32 bit
|
||||
- `aarch64-linux-android` for Android ARM 64 bit
|
||||
- `x86_64-linux-android` for Android x86 64 bit
|
||||
|
||||
The paths are automatically configured and no other options are needed.
|
||||
The paths are automatically configured and no other options are needed unless targeting [Android](../doc/build-android.md).
|
||||
|
||||
### Install the required dependencies: Ubuntu & Debian
|
||||
|
||||
#### Common
|
||||
|
||||
apt install automake bison cmake curl libtool make patch pkg-config python3 xz-utils
|
||||
|
||||
#### For macOS cross compilation
|
||||
|
||||
apt install clang lld llvm g++ zip
|
||||
sudo apt-get install curl bsdmainutils cmake zip
|
||||
|
||||
Clang 18 or later is required. You must also obtain the macOS SDK before
|
||||
proceeding with a cross-compile. Under the depends directory, create a
|
||||
subdirectory named `SDKs`. Then, place the extracted SDK under this new directory.
|
||||
Note: You must obtain the macOS SDK before proceeding with a cross-compile.
|
||||
Under the depends directory, create a subdirectory named `SDKs`.
|
||||
Then, place the extracted SDK under this new directory.
|
||||
For more information, see [SDK Extraction](../contrib/macdeploy/README.md#sdk-extraction).
|
||||
|
||||
#### For Win64 cross compilation
|
||||
@@ -64,7 +63,7 @@ For more information, see [SDK Extraction](../contrib/macdeploy/README.md#sdk-ex
|
||||
|
||||
Common linux dependencies:
|
||||
|
||||
sudo apt-get install g++-multilib binutils
|
||||
sudo apt-get install make automake cmake curl g++-multilib libtool binutils bsdmainutils pkg-config python3 patch bison
|
||||
|
||||
For linux ARM cross compilation:
|
||||
|
||||
@@ -86,10 +85,6 @@ For linux S390X cross compilation:
|
||||
|
||||
sudo apt-get install g++-s390x-linux-gnu binutils-s390x-linux-gnu
|
||||
|
||||
### Install the required dependencies: FreeBSD
|
||||
|
||||
pkg install bash
|
||||
|
||||
### Install the required dependencies: OpenBSD
|
||||
|
||||
pkg_add bash gtar
|
||||
@@ -119,6 +114,9 @@ The following can be set when running make: `make FOO=bar`
|
||||
- `DEBUG`: Disable some optimizations and enable more runtime checking
|
||||
- `HOST_ID_SALT`: Optional salt to use when generating host package ids
|
||||
- `BUILD_ID_SALT`: Optional salt to use when generating build package ids
|
||||
- `FORCE_USE_SYSTEM_CLANG`: (EXPERTS ONLY) When cross-compiling for macOS, use Clang found in the
|
||||
system's `$PATH` rather than the default prebuilt release of Clang
|
||||
from llvm.org. Clang 8 or later is required
|
||||
- `LOG`: Use file-based logging for individual packages. During a package build its log file
|
||||
resides in the `depends` directory, and the log file is printed out automatically in case
|
||||
of build error. After successful build log files are moved along with package archives
|
||||
|
||||
@@ -3,8 +3,9 @@ build_darwin_CXX:=$(shell xcrun -f clang++) -isysroot$(shell xcrun --show-sdk-pa
|
||||
build_darwin_AR:=$(shell xcrun -f ar)
|
||||
build_darwin_RANLIB:=$(shell xcrun -f ranlib)
|
||||
build_darwin_STRIP:=$(shell xcrun -f strip)
|
||||
build_darwin_OBJDUMP:=$(shell xcrun -f objdump)
|
||||
build_darwin_OTOOL:=$(shell xcrun -f otool)
|
||||
build_darwin_NM:=$(shell xcrun -f nm)
|
||||
build_darwin_INSTALL_NAME_TOOL:=$(shell xcrun -f install_name_tool)
|
||||
build_darwin_DSYMUTIL:=$(shell xcrun -f dsymutil)
|
||||
build_darwin_SHA256SUM=shasum -a 256
|
||||
build_darwin_DOWNLOAD=curl --location --fail --connect-timeout $(DOWNLOAD_CONNECT_TIMEOUT) --retry $(DOWNLOAD_RETRIES) -o
|
||||
@@ -15,9 +16,12 @@ darwin_CXX:=$(shell xcrun -f clang++) -stdlib=libc++ -isysroot$(shell xcrun --sh
|
||||
darwin_AR:=$(shell xcrun -f ar)
|
||||
darwin_RANLIB:=$(shell xcrun -f ranlib)
|
||||
darwin_STRIP:=$(shell xcrun -f strip)
|
||||
darwin_OBJDUMP:=$(shell xcrun -f objdump)
|
||||
darwin_OTOOL:=$(shell xcrun -f otool)
|
||||
darwin_NM:=$(shell xcrun -f nm)
|
||||
darwin_INSTALL_NAME_TOOL:=$(shell xcrun -f install_name_tool)
|
||||
darwin_DSYMUTIL:=$(shell xcrun -f dsymutil)
|
||||
darwin_native_binutils=
|
||||
darwin_native_toolchain=
|
||||
|
||||
x86_64_darwin_CFLAGS += -arch x86_64
|
||||
x86_64_darwin_CXXFLAGS += -arch x86_64
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user