Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Native and depends build (Ubuntu/Fedora/OpenSuse) #53

Open
maflcko opened this issue Jun 16, 2021 · 1 comment
Open

Native and depends build (Ubuntu/Fedora/OpenSuse) #53

maflcko opened this issue Jun 16, 2021 · 1 comment
Labels

Comments

@maflcko
Copy link
Owner

maflcko commented Jun 16, 2021

native apt

export DEBIAN_FRONTEND=noninteractive && apt update && apt install curl wget htop git vim ccache -y && git clone https://github.com/bitcoin/bitcoin.git  --depth=1 ./b-c && cd b-c && apt install build-essential cmake pkg-config  python3-zmq libzmq3-dev libevent-dev libboost-dev libsqlite3-dev  libdb++-dev clang llvm  -y   &&  cmake -B ./bld-cmake -DCMAKE_C_COMPILER='clang' -DCMAKE_CXX_COMPILER='clang++' -DBUILD_GUI=ON -DBUILD_FUZZ_BINARY=ON -DBUILD_BENCH=ON -DWITH_ZMQ=ON                             && cmake --build ./bld-cmake --parallel  $(nproc)

depends native apt

export DEBIAN_FRONTEND=noninteractive && apt update && apt install curl wget htop git vim ccache -y && git clone https://github.com/bitcoin/bitcoin.git  --depth=1 ./b-c && cd b-c && apt install build-essential libtool autotools-dev automake pkg-config bsdmainutils python3-zmq      make automake cmake curl g++-multilib libtool binutils bsdmainutils pkg-config python3 patch bison        -y  && cd depends && make DEBUG=1 NO_QT=1 NO_WALLET=1 NO_ZMQ=1 NO_UPNP=1 NO_NATPMP=1 -j $(nproc) && cd .. &&  ./autogen.sh && CONFIG_SITE="$PWD/depends/x86_64-pc-linux-gnu/share/config.site" ./configure && make -j $(nproc)

depends native apt libc++

export DEBIAN_FRONTEND=noninteractive && apt update && apt install curl wget htop git vim ccache -y && git clone https://github.com/bitcoin/bitcoin.git  --depth=1 ./b-c && cd b-c && apt install libc++abi-dev libc++-dev clang llvm build-essential libtool autotools-dev automake pkg-config bsdmainutils python3-zmq      make automake cmake curl g++-multilib libtool binutils bsdmainutils pkg-config python3 patch bison        -y  && ( cd depends && make CC=clang CXX="clang++ -stdlib=libc++" DEBUG=1 NO_QT=1 NO_WALLET=1 NO_ZMQ=1 NO_UPNP=1 NO_NATPMP=1 -j $(nproc) ) &&  ./autogen.sh && CONFIG_SITE="$PWD/depends/x86_64-pc-linux-gnu/share/config.site" ./configure  && make -j $(nproc)

depends native dnf

dnf install gcc-c++ libtool make autoconf automake python3 clang llvm screen libcxx-devel libcxxabi-devel lbzip2 patch xz cmake     curl wget htop git vim ccache   -y && git clone https://github.com/bitcoin/bitcoin.git  --depth=1 ./b-c && cd b-c && ( cd depends && make CC=clang CXX=clang++ DEBUG=1 NO_QT=1 NO_WALLET=1 NO_ZMQ=1 NO_UPNP=1 NO_NATPMP=1 -j $(nproc) ) &&  ./autogen.sh && CONFIG_SITE="$PWD/depends/x86_64-pc-linux-gnu/share/config.site" ./configure  && make -j $(nproc)

native dnf

dnf install gcc-c++ libtool make autoconf automake python3 clang llvm screen libcxx-devel libcxxabi-devel lbzip2 patch xz cmake     curl wget htop git vim ccache libevent-devel boost-devel qt5-qttools-devel qt5-qtbase-devel sqlite-devel   -y && git clone https://github.com/bitcoin/bitcoin.git  --depth=1 ./b-c && cd b-c &&  ./autogen.sh &&   ./configure CC=clang CXX=clang++ && make -j $(nproc)

depends native zypper

zypper in -y find bison gcc-c++ libtool make autoconf automake python3 clang llvm lbzip2 patch xz      curl wget htop git vim ccache  && git clone https://github.com/bitcoin/bitcoin.git  --depth=1 ./b-c && cd b-c && ( cd depends && make CC=clang CXX=clang++ DEBUG=1 NO_QT=1 NO_WALLET=1 NO_ZMQ=1 NO_UPNP=1 NO_NATPMP=1 -j $(nproc) ) &&  ./autogen.sh && CONFIG_SITE="$PWD/depends/x86_64-pc-linux-gnu/share/config.site" ./configure   --disable-tests --disable-bench && make -j $(nproc)

native zypper

zypper in -y libevent-devel boost-devel sqlite3-devel libqt5-qttools-devel libqt5-qtbase-devel libdb-4_8-devel      find bison gcc-c++ libtool make autoconf automake python3 clang llvm lbzip2 patch xz      curl wget htop git vim ccache  && git clone https://github.com/bitcoin/bitcoin.git  --depth=1 ./b-c && cd b-c &&    ./autogen.sh &&  ./configure CC=clang CXX=clang++ --disable-tests --disable-bench && make -j $(nproc)

depends cross

hosts: https://github.com/bitcoin/bitcoin/tree/master/depends

export HOST=arm-linux-gnueabihf && export MAKEJOBS="$(nproc)"
apt update && apt install git vim htop  -y && git clone https://github.com/bitcoin/bitcoin.git  --depth=1 ./b-c && cd b-c && apt install -y bzip2  make automake cmake curl g++-multilib libtool binutils bsdmainutils pkg-config python3 patch bison  && apt install -y     g++-arm-linux-gnueabihf binutils-arm-linux-gnueabihf   g++-aarch64-linux-gnu binutils-aarch64-linux-gnu    g++-powerpc64-linux-gnu binutils-powerpc64-linux-gnu g++-powerpc64le-linux-gnu binutils-powerpc64le-linux-gnu    g++-riscv64-linux-gnu binutils-riscv64-linux-gnu    g++-s390x-linux-gnu binutils-s390x-linux-gnu    && ( cd depends && make NO_QT=1 "-j${MAKEJOBS}" ) && ./autogen.sh && CONFIG_SITE=$PWD/depends/$HOST/share/config.site ./configure && make "-j${MAKEJOBS}"
export HOST_ARCH=armhf
dpkg --add-architecture armhf && apt update && apt install libc6:armhf libstdc++6:armhf libfontconfig1:armhf libxcb1:armhf python3-zmq
...
make check

native/libc++/libfuzzer

export DEBIAN_FRONTEND=noninteractive && apt update && apt install curl wget htop git vim ccache -y && git clone https://github.com/bitcoin/bitcoin.git  --depth=1 b-c && cd b-c && apt install build-essential libtool autotools-dev automake pkg-config bsdmainutils python3-zmq     libevent-dev libboost-dev  libsqlite3-dev  libdb++-dev clang llvm libc++-dev libc++abi-dev  -y   &&  ./autogen.sh && ./configure CC=clang CXX='clang++ -stdlib=libc++'   --enable-fuzz --with-sanitizers=fuzzer && make -j$(nproc)

mkdir temp_pms

FUZZ=process_messages ./src/test/fuzz/fuzz -workers=9 -jobs=9 ./temp_pms

32-bit (depends) libfuzzer

export DEBIAN_FRONTEND=noninteractive && apt update && apt install curl wget htop git vim ccache -y && git clone https://github.com/bitcoin/bitcoin.git  --depth=1 b-c && cd b-c && apt install build-essential libtool autotools-dev automake pkg-config bsdmainutils python3-zmq make automake cmake curl clang llvm g++-multilib libtool binutils bsdmainutils pkg-config python3 patch bison -y  && ( cd depends && make DEBUG=1 CC='clang -m32' CXX='clang++ -m32' HOST=i686-pc-linux-gnu NO_QT=1 NO_WALLET=1 NO_ZMQ=1 NO_UPNP=1 NO_NATPMP=1 -j $(nproc) ) && ./autogen.sh && CONFIG_SITE="$PWD/depends/i686-pc-linux-gnu/share/config.site" ./configure  --enable-fuzz --with-sanitizers=fuzzer && make  -j $(nproc)

32-bit libc++ (depends) (focal only?) libfuzzer

export V=12 && dpkg --add-architecture i386 && export DEBIAN_FRONTEND=noninteractive && apt update && apt install curl wget htop git vim ccache -y && git clone https://github.com/bitcoin/bitcoin.git  --depth=1 ./b-c && cd b-c && apt install libc++abi-$V-dev:i386 libc++-$V-dev:i386 clang-$V:i386 llvm-$V:i386        make automake cmake curl libtool  bsdmainutils pkg-config patch bison        -y  && ( cd depends && make CC="clang-$V -m32 -O1 -fno-omit-frame-pointer -gline-tables-only -fsanitize=address -fsanitize-address-use-after-scope -fsanitize=fuzzer-no-link" CXX="clang++-$V -m32 -g -O1 -fno-omit-frame-pointer -gline-tables-only -fsanitize=address -fsanitize-address-use-after-scope -fsanitize=fuzzer-no-link -stdlib=libc++" DEBUG=1 NO_QT=1 NO_WALLET=1 NO_ZMQ=1 NO_UPNP=1 NO_NATPMP=1 -j $(nproc) ) && ./autogen.sh && CONFIG_SITE="$PWD/depends/x86_64-pc-linux-gnu/share/config.site" ./configure   --with-sanitizers=fuzzer,address --enable-fuzz --with-seccomp=no --enable-fuzz  && make -j $(nproc)

afl

export DEBIAN_FRONTEND=noninteractive && apt update && apt install curl wget htop git vim ccache -y && git clone https://github.com/bitcoin/bitcoin.git  --depth=1 ./b-c && cd b-c && git checkout master && apt install build-essential libtool autotools-dev automake pkg-config bsdmainutils python3-zmq     libevent-dev libboost-dev  clang llvm   -y   &&  ./autogen.sh && apt-get install -y build-essential python3-dev automake git flex bison libglib2.0-dev libpixman-1-dev python3-setuptools  lld llvm llvm-dev clang && apt-get install -y gcc-$(gcc --version|head -n1|sed 's/.* //'|sed 's/\..*//')-plugin-dev libstdc++-$(gcc --version|head -n1|sed 's/.* //'|sed 's/\..*//')-dev && git clone https://github.com/AFLplusplus/AFLplusplus  --depth=1 && make -C AFLplusplus/ source-only && CC=$(pwd)/AFLplusplus/afl-clang-lto CXX=$(pwd)/AFLplusplus/afl-clang-lto++ ./configure --enable-fuzz --with-sanitizers=integer,undefined && make -j $( nproc ) && git clone https://github.com/bitcoin-core/qa-assets --depth=1 && mkdir outdir

FUZZ=process_message AFLplusplus/afl-fuzz -i qa-assets/fuzz_seed_corpus/process_message -o ./outdir -m 500 -t 30000 -- src/test/fuzz/fuzz
AFL_NO_UI=1 AFL_DEBUG=1 FUZZ=process_message AFLplusplus/afl-fuzz -i - -o ./outdir2 -t 10000 -- src/test/fuzz/fuzz

Angora (WIP)

podman run -it --rm --privileged debian:bullseye

apt update && apt install curl -y && ( curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh ) && apt install git vim htop -y && git clone https://github.com/AngoraFuzzer/Angora && cd Angora/ && apt install llvm clang cmake zlib1g-dev python-is-python3 -y && source "$HOME/.cargo/env" && ./build/build.sh && cd && export DEBIAN_FRONTEND=noninteractive && apt update && apt install curl wget htop git vim ccache -y && git clone https://github.com/bitcoin/bitcoin.git  --depth=1 ./b-c && cd b-c && apt install build-essential libtool autotools-dev automake pkg-config bsdmainutils python3-zmq     libevent-dev libboost-dev libsqlite3-dev libc++abi-dev libc++-dev    -y   &&  ./autogen.sh && ./configure CC='/Angora/bin/angora-clang' CXX='/Angora/bin/angora-clang++'  --enable-fuzz --disable-asm --with-asm=no && make -j 6 && USE_TRACK=1 make -j 6 && mv src/test/fuzz/fuzz src/test/fuzz/fuzz_track && make clean && ccache --clear && mv src/test/fuzz/fuzz src/test/fuzz/fuzz_fast
@maflcko maflcko added the blog label Jun 16, 2021
@maflcko maflcko changed the title Focal native and Focal depends Native and depends build Oct 11, 2021
@maflcko maflcko changed the title Native and depends build Native and depends build (Ubuntu/Fedora) Oct 11, 2021
@maflcko maflcko changed the title Native and depends build (Ubuntu/Fedora) Native and depends build (Ubuntu/Fedora/OpenSuse) Jun 2, 2022
@maflcko
Copy link
Owner Author

maflcko commented Jan 26, 2023

IPV6

git clone https://gitlab.com/ipv6-mirror/bitcoin-core.git --depth=1 ./bitcoin-core

diff --git a/depends/Makefile b/depends/Makefile
index 27bf804..768db6b 100644
--- a/depends/Makefile
+++ b/depends/Makefile
@@ -45,7 +45,7 @@ NO_USDT ?=
 NO_NATPMP ?=
 MULTIPROCESS ?=
 LTO ?=
-FALLBACK_DOWNLOAD_PATH ?= https://bitcoincore.org/depends-sources
+FALLBACK_DOWNLOAD_PATH ?= https://drahtbot.space/depends_download_fallback
 
 C_STANDARD ?= c11
 CXX_STANDARD ?= c++17

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant