diff --git a/.github/workflows/build-ton-linux-arm64-appimage.yml b/.github/workflows/build-ton-linux-arm64-appimage.yml index cb8a49844..cccebce35 100644 --- a/.github/workflows/build-ton-linux-arm64-appimage.yml +++ b/.github/workflows/build-ton-linux-arm64-appimage.yml @@ -24,13 +24,13 @@ jobs: sudo apt install -y build-essential git cmake ninja-build zlib1g-dev libsecp256k1-dev libmicrohttpd-dev libsodium-dev liblz4-dev ccache libgsl-dev libblas-dev libgslcblas0 mkdir ~/.ccache 3pp - - name: Install clang-16 + - name: Install clang-21 run: | lsb_release -a wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - - echo "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-16 main" | sudo tee /etc/apt/sources.list.d/llvm.list + echo "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-21 main" | sudo tee /etc/apt/sources.list.d/llvm.list sudo apt-get -y update - sudo apt-get install -y clang-16 + sudo apt-get install -y clang-21 - name: Cache 3pp id: cache-3pp diff --git a/.github/workflows/build-ton-linux-arm64-shared.yml b/.github/workflows/build-ton-linux-arm64-shared.yml index 1c5ffae8f..5c5e86d17 100644 --- a/.github/workflows/build-ton-linux-arm64-shared.yml +++ b/.github/workflows/build-ton-linux-arm64-shared.yml @@ -29,13 +29,22 @@ jobs: mkdir ~/.ccache - if: matrix.os != 'ubuntu-24.04-arm' - name: Install llvm-16 + name: Install llvm-21 run: | lsb_release -a wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - - echo "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-16 main" | sudo tee /etc/apt/sources.list.d/llvm.list + echo "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-21 main" | sudo tee /etc/apt/sources.list.d/llvm.list sudo apt-get -y update - sudo apt-get install -y clang-16 + sudo apt-get install -y clang-21 + + - if: matrix.os == 'ubuntu-24.04-arm' + name: Install llvm-21 + run: | + lsb_release -a + wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - + echo "deb http://apt.llvm.org/noble/ llvm-toolchain-noble-21 main" | sudo tee /etc/apt/sources.list.d/llvm.list + sudo apt-get -y update + sudo apt-get install -y clang-21 - name: Cache OpenSSL id: cache-openssl diff --git a/.github/workflows/build-ton-linux-x86-64-appimage.yml b/.github/workflows/build-ton-linux-x86-64-appimage.yml index 0bebcbadc..aa9787cd6 100644 --- a/.github/workflows/build-ton-linux-x86-64-appimage.yml +++ b/.github/workflows/build-ton-linux-x86-64-appimage.yml @@ -24,11 +24,11 @@ jobs: sudo apt install -y build-essential git cmake ninja-build zlib1g-dev libsecp256k1-dev libmicrohttpd-dev libsodium-dev liblz4-dev ccache libgsl-dev libblas-dev libgslcblas0 mkdir ~/.ccache 3pp - - name: Install clang-16 + - name: Install clang-21 run: | wget https://apt.llvm.org/llvm.sh chmod +x llvm.sh - sudo ./llvm.sh 16 clang + sudo ./llvm.sh 21 clang - name: Cache 3pp id: cache-3pp diff --git a/.github/workflows/build-ton-linux-x86-64-shared.yml b/.github/workflows/build-ton-linux-x86-64-shared.yml index 87b9dc15a..bccfab3af 100644 --- a/.github/workflows/build-ton-linux-x86-64-shared.yml +++ b/.github/workflows/build-ton-linux-x86-64-shared.yml @@ -32,7 +32,16 @@ jobs: run: | wget https://apt.llvm.org/llvm.sh chmod +x llvm.sh - sudo ./llvm.sh 16 clang + sudo ./llvm.sh 21 clang + + - if: matrix.os == 'ubuntu-24.04' + name: Install llvm-21 + run: | + lsb_release -a + wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - + echo "deb http://apt.llvm.org/noble/ llvm-toolchain-noble-21 main" | sudo tee /etc/apt/sources.list.d/llvm.list + sudo apt -y update + sudo apt install -y clang-21 - name: Cache OpenSSL id: cache-openssl diff --git a/.github/workflows/build-ton-wasm-emscripten.yml b/.github/workflows/build-ton-wasm-emscripten.yml index ce09f530e..6e575b399 100644 --- a/.github/workflows/build-ton-wasm-emscripten.yml +++ b/.github/workflows/build-ton-wasm-emscripten.yml @@ -18,11 +18,11 @@ jobs: sudo apt-get install -y build-essential git openssl cmake ninja-build zlib1g-dev libssl-dev libsecp256k1-dev libmicrohttpd-dev libsodium-dev liblz4-dev libjemalloc-dev mkdir -p 3pp_emscripten - - name: Install clang-16 + - name: Install clang-21 run: | wget https://apt.llvm.org/llvm.sh chmod +x llvm.sh - sudo ./llvm.sh 16 clang + sudo ./llvm.sh 21 clang - name: Cache OpenSSL id: cache-openssl diff --git a/Dockerfile b/Dockerfile index 7a53500db..6e7668b00 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,11 +11,11 @@ RUN apt-get update && \ RUN wget https://apt.llvm.org/llvm.sh && \ chmod +x llvm.sh && \ - ./llvm.sh 16 all && \ + ./llvm.sh 21 all && \ rm -rf /var/lib/apt/lists/* -ENV CC=/usr/bin/clang-16 -ENV CXX=/usr/bin/clang++-16 +ENV CC=/usr/bin/clang-21 +ENV CXX=/usr/bin/clang++-21 ENV CCACHE_DISABLE=1 WORKDIR / diff --git a/README.md b/README.md index 897ba809a..9833cecd9 100644 --- a/README.md +++ b/README.md @@ -79,7 +79,7 @@ Install additional system libraries wget https://apt.llvm.org/llvm.sh chmod +x llvm.sh - sudo ./llvm.sh 16 all + sudo ./llvm.sh 21 clang ``` Compile TON binaries ```bash @@ -117,7 +117,7 @@ Install additional system libraries on Ubuntu wget https://apt.llvm.org/llvm.sh chmod +x llvm.sh - sudo ./llvm.sh 16 all + sudo ./llvm.sh 21 clang ``` Compile TON binaries with emscripten ```bash diff --git a/assembly/android/build-android-tonlib.sh b/assembly/android/build-android-tonlib.sh index dda74c166..b1bff6c4a 100644 --- a/assembly/android/build-android-tonlib.sh +++ b/assembly/android/build-android-tonlib.sh @@ -8,8 +8,8 @@ while getopts 'a' flag; do esac done -export CC=$(which clang-16) -export CXX=$(which clang++-16) +export CC=$(which clang-21) +export CXX=$(which clang++-21) export CCACHE_DISABLE=1 if [ ! -d android-ndk-r27d ]; then diff --git a/assembly/native/build-macos-portable.sh b/assembly/native/build-macos-portable.sh index a86435a4f..29bb51409 100644 --- a/assembly/native/build-macos-portable.sh +++ b/assembly/native/build-macos-portable.sh @@ -6,6 +6,13 @@ with_ccache=false OSX_TARGET=11.0 +MACOS_MAJOR=0 +if [ "$(uname)" = "Darwin" ]; then + MACOS_MAJOR=$(sw_vers -productVersion | cut -d. -f1) + export SDKROOT="$(xcrun --sdk macosx --show-sdk-path)" + echo "Using SDKROOT=$SDKROOT" +fi + while getopts 'taco:' flag; do case "${flag}" in t) with_tests=true ;; @@ -21,14 +28,26 @@ if [ ! -d "build" ]; then mkdir build cd build else - cd build + cd build || exit rm -rf .ninja* CMakeCache.txt fi export NONINTERACTIVE=1 brew install ninja pkg-config automake libtool autoconf texinfo export PATH=/usr/local/opt/ccache/libexec:$PATH -brew install llvm@16 + +if [ "$(uname)" = "Darwin" ]; then + if [ "$MACOS_MAJOR" -ge 15 ]; then + echo "macOS $MACOS_MAJOR detected -> using AppleClang (Xcode toolchain), NOT llvm@21" + export CC="$(xcrun --find clang)" + export CXX="$(xcrun --find clang++)" + else + echo "macOS $MACOS_MAJOR detected -> using Homebrew llvm@21" + brew install llvm@21 + export CC="$(brew --prefix llvm@21)"/bin/clang + export CXX="$(brew --prefix llvm@21)"/bin/clang++ + fi +fi if [ "$with_ccache" = true ]; then brew install ccache @@ -40,24 +59,15 @@ else export CCACHE_DISABLE=1 fi - -if [ -f /opt/homebrew/opt/llvm@16/bin/clang ]; then - export CC=/opt/homebrew/opt/llvm@16/bin/clang - export CXX=/opt/homebrew/opt/llvm@16/bin/clang++ -else - export CC=/usr/local/opt/llvm@16/bin/clang - export CXX=/usr/local/opt/llvm@16/bin/clang++ -fi - if [ ! -d "../3pp/lz4" ]; then mkdir -p ../3pp git clone https://github.com/lz4/lz4.git ../3pp/lz4 -cd ../3pp/lz4 +cd ../3pp/lz4 || exit lz4Path=`pwd` git checkout v1.9.4 -make -j4 +make -j4 CC="$CC" CFLAGS="--sysroot=$SDKROOT" test $? -eq 0 || { echo "Can't compile lz4"; exit 1; } -cd ../../build +cd ../../build || exit # ./lib/liblz4.a # ./lib else @@ -67,15 +77,15 @@ fi if [ ! -d "../3pp/libsodium-1.0.18" ]; then export LIBSODIUM_FULL_BUILD=1 - cd ../3pp + cd ../3pp || exit curl -LO https://download.libsodium.org/libsodium/releases/libsodium-1.0.18.tar.gz tar -xzf libsodium-1.0.18.tar.gz - cd libsodium-1.0.18 + cd libsodium-1.0.18 || exit sodiumPath=`pwd` ./configure --with-pic --enable-static - make -j4 + make -j4 CC="$CC" CFLAGS="--sysroot=$SDKROOT" test $? -eq 0 || { echo "Can't compile libsodium"; exit 1; } - cd ../../build + cd ../../build || exit else sodiumPath=$(pwd)/../3pp/libsodium-1.0.18 echo "Using compiled libsodium" @@ -83,13 +93,13 @@ fi if [ ! -d "../3pp/openssl_3" ]; then git clone https://github.com/openssl/openssl ../3pp/openssl_3 - cd ../3pp/openssl_3 + cd ../3pp/openssl_3 || exit opensslPath=`pwd` git checkout openssl-3.1.4 ./config - make build_libs -j4 + make build_libs -j4 CC="$CC" CFLAGS="--sysroot=$SDKROOT" test $? -eq 0 || { echo "Can't compile openssl_3"; exit 1; } - cd ../../build + cd ../../build || exit else opensslPath=$(pwd)/../3pp/openssl_3 echo "Using compiled openssl_3" @@ -97,12 +107,12 @@ fi if [ ! -d "../3pp/zlib" ]; then git clone https://github.com/madler/zlib.git ../3pp/zlib - cd ../3pp/zlib + cd ../3pp/zlib || exit zlibPath=`pwd` ./configure --static - make -j4 + make -j4 CC="$CC" CFLAGS="--sysroot=$SDKROOT" test $? -eq 0 || { echo "Can't compile zlib"; exit 1; } - cd ../../build + cd ../../build || exit else zlibPath=$(pwd)/../3pp/zlib echo "Using compiled zlib" @@ -110,12 +120,12 @@ fi if [ ! -d "../3pp/libmicrohttpd" ]; then git clone https://github.com/ton-blockchain/libmicrohttpd.git ../3pp/libmicrohttpd - cd ../3pp/libmicrohttpd + cd ../3pp/libmicrohttpd || exit libmicrohttpdPath=`pwd` ./configure --enable-static --disable-tests --disable-benchmark --disable-shared --disable-https --with-pic - make -j4 + make -j4 CC="$CC" CFLAGS="--sysroot=$SDKROOT" test $? -eq 0 || { echo "Can't compile libmicrohttpd"; exit 1; } - cd ../../build + cd ../../build || exit else libmicrohttpdPath=$(pwd)/../3pp/libmicrohttpd echo "Using compiled libmicrohttpd" @@ -124,8 +134,8 @@ fi cmake -GNinja .. \ -DPORTABLE=1 \ -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=$OSX_TARGET \ --DCMAKE_CXX_FLAGS="-stdlib=libc++" \ --DCMAKE_SYSROOT=$(xcrun --show-sdk-path) \ +-DCMAKE_CXX_FLAGS="-nostdinc++ -isystem ${SDKROOT}/usr/include/c++/v1 -isystem ${SDKROOT}/usr/include" \ +-DCMAKE_SYSROOT="$(xcrun --show-sdk-path)" \ -DCMAKE_BUILD_TYPE=Release \ -DOPENSSL_FOUND=1 \ -DOPENSSL_INCLUDE_DIR=$opensslPath/include \ diff --git a/assembly/native/build-macos-shared.sh b/assembly/native/build-macos-shared.sh index 2d0638c1c..698343d3d 100644 --- a/assembly/native/build-macos-shared.sh +++ b/assembly/native/build-macos-shared.sh @@ -6,6 +6,13 @@ with_ccache=false OSX_TARGET=11.0 +MACOS_MAJOR=0 +if [ "$(uname)" = "Darwin" ]; then + MACOS_MAJOR=$(sw_vers -productVersion | cut -d. -f1) + export SDKROOT="$(xcrun --sdk macosx --show-sdk-path)" + echo "Using SDKROOT=$SDKROOT" +fi + while getopts 'taco:' flag; do case "${flag}" in t) with_tests=true ;; @@ -21,14 +28,26 @@ if [ ! -d "build" ]; then mkdir build cd build else - cd build + cd build || exit rm -rf .ninja* CMakeCache.txt fi export NONINTERACTIVE=1 brew install ninja libsodium libmicrohttpd pkg-config automake libtool autoconf gnutls export PATH=/usr/local/opt/ccache/libexec:$PATH -brew install llvm@16 + +if [ "$(uname)" = "Darwin" ]; then + if [ "$MACOS_MAJOR" -ge 15 ]; then + echo "macOS $MACOS_MAJOR detected -> using AppleClang (Xcode toolchain), NOT llvm@21" + export CC="$(xcrun --find clang)" + export CXX="$(xcrun --find clang++)" + else + echo "macOS $MACOS_MAJOR detected -> using Homebrew llvm@21" + brew install llvm@21 + export CC="$(brew --prefix llvm@21)"/bin/clang + export CXX="$(brew --prefix llvm@21)"/bin/clang++ + fi +fi if [ "$with_ccache" = true ]; then brew install ccache @@ -40,20 +59,12 @@ else export CCACHE_DISABLE=1 fi -if [ -f /opt/homebrew/opt/llvm@16/bin/clang ]; then - export CC=/opt/homebrew/opt/llvm@16/bin/clang - export CXX=/opt/homebrew/opt/llvm@16/bin/clang++ -else - export CC=/usr/local/opt/llvm@16/bin/clang - export CXX=/usr/local/opt/llvm@16/bin/clang++ -fi - if [ ! -d "lz4" ]; then git clone https://github.com/lz4/lz4 - cd lz4 + cd lz4 || exit lz4Path=`pwd` git checkout v1.9.4 - make -j4 + make -j4 CC="$CC" CFLAGS="--sysroot=$SDKROOT" test $? -eq 0 || { echo "Can't compile lz4"; exit 1; } cd .. else @@ -61,26 +72,13 @@ else echo "Using compiled lz4" fi -if [ ! -d "zlib" ]; then - git clone https://github.com/madler/zlib.git - cd zlib - zlibPath=`pwd` - ./configure --static - make -j4 - test $? -eq 0 || { echo "Can't compile zlib"; exit 1; } - cd .. -else - zlibPath=$(pwd)/zlib - echo "Using compiled zlib" -fi - brew unlink openssl@1.1 brew install openssl@3 brew unlink openssl@3 && brew link --overwrite openssl@3 cmake -GNinja -DCMAKE_BUILD_TYPE=Release .. \ --DCMAKE_CXX_FLAGS="-stdlib=libc++" \ --DCMAKE_SYSROOT=$(xcrun --show-sdk-path) \ +-DCMAKE_CXX_FLAGS="-nostdinc++ -isystem ${SDKROOT}/usr/include/c++/v1 -isystem ${SDKROOT}/usr/include" \ +-DCMAKE_SYSROOT="$(xcrun --show-sdk-path)" \ -DLZ4_FOUND=1 \ -DLZ4_LIBRARIES=$lz4Path/lib/liblz4.a \ -DLZ4_INCLUDE_DIRS=$lz4Path/lib \ diff --git a/assembly/native/build-ubuntu-appimages.sh b/assembly/native/build-ubuntu-appimages.sh index ef54f0632..d6ca99f2f 100644 --- a/assembly/native/build-ubuntu-appimages.sh +++ b/assembly/native/build-ubuntu-appimages.sh @@ -27,22 +27,22 @@ if [ ! -d "build" ]; then mkdir build cd build else - cd build + cd build || exit rm -rf .ninja* CMakeCache.txt fi -export CC=$(which clang-16) -export CXX=$(which clang++-16) +export CC=$(which clang-21) +export CXX=$(which clang++-21) if [ ! -d "../openssl_3" ]; then git clone https://github.com/openssl/openssl ../openssl_3 - cd ../openssl_3 + cd ../openssl_3 || exit opensslPath=`pwd` git checkout openssl-3.1.4 ./config make build_libs -j$(nproc) test $? -eq 0 || { echo "Can't compile openssl_3"; exit 1; } - cd ../build + cd ../build || exit else opensslPath=$(pwd)/../openssl_3 echo "Using compiled openssl_3" @@ -110,6 +110,6 @@ if [ "$with_artifacts" = true ]; then fi if [ "$with_tests" = true ]; then - cd build + cd build || exit ctest --output-on-failure --timeout 1800 fi diff --git a/assembly/native/build-ubuntu-portable-libs.sh b/assembly/native/build-ubuntu-portable-libs.sh index cf797cd23..f4dccdea9 100644 --- a/assembly/native/build-ubuntu-portable-libs.sh +++ b/assembly/native/build-ubuntu-portable-libs.sh @@ -28,22 +28,22 @@ if [ ! -d "build" ]; then mkdir build cd build else - cd build + cd build || exit rm -rf .ninja* CMakeCache.txt fi -export CC=$(which clang-16) -export CXX=$(which clang++-16) +export CC=$(which clang-21) +export CXX=$(which clang++-21) if [ ! -d "../3pp/lz4" ]; then mkdir -p ../3pp git clone https://github.com/lz4/lz4.git ../3pp/lz4 -cd ../3pp/lz4 +cd ../3pp/lz4 || exit lz4Path=`pwd` git checkout v1.9.4 CFLAGS="-fPIC" make -j$(nproc) test $? -eq 0 || { echo "Can't compile lz4"; exit 1; } -cd ../../build +cd ../../build || exit else lz4Path=$(pwd)/../3pp/lz4 echo "Using compiled lz4" @@ -53,14 +53,14 @@ if [ ! -d "../3pp/libsodium" ]; then export LIBSODIUM_FULL_BUILD=1 mkdir -p ../3pp/libsodium wget -O ../3pp/libsodium/libsodium-1.0.18.tar.gz https://github.com/jedisct1/libsodium/releases/download/1.0.18-RELEASE/libsodium-1.0.18.tar.gz - cd ../3pp/libsodium + cd ../3pp/libsodium || exit tar xf libsodium-1.0.18.tar.gz - cd libsodium-1.0.18 + cd libsodium-1.0.18 || exit sodiumPath=`pwd` ./configure --with-pic --enable-static make -j$(nproc) test $? -eq 0 || { echo "Can't compile libsodium"; exit 1; } - cd ../../../build + cd ../../../build || exit else sodiumPath=$(pwd)/../3pp/libsodium/libsodium-1.0.18 echo "Using compiled libsodium" @@ -68,13 +68,13 @@ fi if [ ! -d "../3pp/openssl_3" ]; then git clone https://github.com/openssl/openssl ../3pp/openssl_3 - cd ../3pp/openssl_3 + cd ../3pp/openssl_3 || exit opensslPath=`pwd` git checkout openssl-3.1.4 ./config make build_libs -j$(nproc) test $? -eq 0 || { echo "Can't compile openssl_3"; exit 1; } - cd ../../build + cd ../../build || exit else opensslPath=$(pwd)/../3pp/openssl_3 echo "Using compiled openssl_3" @@ -82,12 +82,12 @@ fi if [ ! -d "../3pp/zlib" ]; then git clone https://github.com/madler/zlib.git ../3pp/zlib - cd ../3pp/zlib + cd ../3pp/zlib || exit zlibPath=`pwd` ./configure --static make -j$(nproc) test $? -eq 0 || { echo "Can't compile zlib"; exit 1; } - cd ../../build + cd ../../build || exit else zlibPath=$(pwd)/../3pp/zlib echo "Using compiled zlib" @@ -95,12 +95,12 @@ fi if [ ! -d "../3pp/libmicrohttpd" ]; then git clone https://github.com/ton-blockchain/libmicrohttpd.git ../3pp/libmicrohttpd - cd ../3pp/libmicrohttpd + cd ../3pp/libmicrohttpd || exit libmicrohttpdPath=`pwd` ./configure --enable-static --disable-tests --disable-benchmark --disable-shared --disable-https --with-pic - make -j4 + make -j$(nproc) test $? -eq 0 || { echo "Can't compile libmicrohttpd"; exit 1; } - cd ../../build + cd ../../build || exit else libmicrohttpdPath=$(pwd)/../3pp/libmicrohttpd echo "Using compiled libmicrohttpd" diff --git a/assembly/native/build-ubuntu-portable.sh b/assembly/native/build-ubuntu-portable.sh index 49a0205f6..38b0ddd2b 100644 --- a/assembly/native/build-ubuntu-portable.sh +++ b/assembly/native/build-ubuntu-portable.sh @@ -30,22 +30,22 @@ if [ ! -d "build" ]; then mkdir build cd build else - cd build + cd build || exit rm -rf .ninja* CMakeCache.txt fi -export CC=$(which clang-16) -export CXX=$(which clang++-16) +export CC=$(which clang-21) +export CXX=$(which clang++-21) if [ ! -d "../3pp/lz4" ]; then mkdir -p ../3pp git clone https://github.com/lz4/lz4.git ../3pp/lz4 -cd ../3pp/lz4 +cd ../3pp/lz4 || exit lz4Path=`pwd` git checkout v1.9.4 CFLAGS="-fPIC" make -j$(nproc) test $? -eq 0 || { echo "Can't compile lz4"; exit 1; } -cd ../../build +cd ../../build || exit else lz4Path=$(pwd)/../3pp/lz4 echo "Using compiled lz4" @@ -54,14 +54,14 @@ fi if [ ! -d "../3pp/libsodium" ]; then export LIBSODIUM_FULL_BUILD=1 git clone https://github.com/jedisct1/libsodium.git ../3pp/libsodium - cd ../3pp/libsodium + cd ../3pp/libsodium || exit sodiumPath=`pwd` git checkout 1.0.18 ./autogen.sh ./configure --with-pic --enable-static make -j$(nproc) test $? -eq 0 || { echo "Can't compile libsodium"; exit 1; } - cd ../../build + cd ../../build || exit else sodiumPath=$(pwd)/../3pp/libsodium echo "Using compiled libsodium" @@ -69,13 +69,13 @@ fi if [ ! -d "../3pp/openssl_3" ]; then git clone https://github.com/openssl/openssl ../3pp/openssl_3 - cd ../3pp/openssl_3 + cd ../3pp/openssl_3 || exit opensslPath=`pwd` git checkout openssl-3.1.4 ./config make build_libs -j$(nproc) test $? -eq 0 || { echo "Can't compile openssl_3"; exit 1; } - cd ../../build + cd ../../build || exit else opensslPath=$(pwd)/../3pp/openssl_3 echo "Using compiled openssl_3" @@ -83,12 +83,12 @@ fi if [ ! -d "../3pp/zlib" ]; then git clone https://github.com/madler/zlib.git ../3pp/zlib - cd ../3pp/zlib + cd ../3pp/zlib || exit zlibPath=`pwd` ./configure --static make -j$(nproc) test $? -eq 0 || { echo "Can't compile zlib"; exit 1; } - cd ../../build + cd ../../build || exit else zlibPath=$(pwd)/../3pp/zlib echo "Using compiled zlib" @@ -96,12 +96,12 @@ fi if [ ! -d "../3pp/libmicrohttpd" ]; then git clone https://github.com/ton-blockchain/libmicrohttpd.git ../3pp/libmicrohttpd - cd ../3pp/libmicrohttpd + cd ../3pp/libmicrohttpd || exit libmicrohttpdPath=`pwd` ./configure --enable-static --disable-tests --disable-benchmark --disable-shared --disable-https --with-pic - make -j4 + make -j$(nproc) test $? -eq 0 || { echo "Can't compile libmicrohttpd"; exit 1; } - cd ../../build + cd ../../build || exit else libmicrohttpdPath=$(pwd)/../3pp/libmicrohttpd echo "Using compiled libmicrohttpd" @@ -170,7 +170,7 @@ if [ "$with_artifacts" = true ]; then fi if [ "$with_tests" = true ]; then - cd build + cd build || exit # ctest --output-on-failure -E "test-catchain|test-actors|test-smartcont|test-adnl|test-validator-session-state|test-dht|test-rldp" ctest --output-on-failure -E "test-adnl" fi diff --git a/assembly/native/build-ubuntu-shared.sh b/assembly/native/build-ubuntu-shared.sh index 4db66a11e..5020a5658 100644 --- a/assembly/native/build-ubuntu-shared.sh +++ b/assembly/native/build-ubuntu-shared.sh @@ -30,23 +30,23 @@ if [ ! -d "build" ]; then mkdir build cd build else - cd build + cd build || exit rm -rf .ninja* CMakeCache.txt fi -export CC=$(which clang-16) -export CXX=$(which clang++-16) +export CC=$(which clang-21) +export CXX=$(which clang++-21) if [ ! -d "../openssl_3" ]; then git clone https://github.com/openssl/openssl ../openssl_3 - cd ../openssl_3 + cd ../openssl_3 || exit opensslPath=`pwd` git checkout openssl-3.1.4 ./config make build_libs -j$(nproc) test $? -eq 0 || { echo "Can't compile openssl_3"; exit 1; } - cd ../build + cd ../build || exit else opensslPath=$(pwd)/../openssl_3 echo "Using compiled openssl_3" diff --git a/assembly/wasm/fift-func-wasm-build-ubuntu.sh b/assembly/wasm/fift-func-wasm-build-ubuntu.sh index a99f27392..0c08c8c47 100644 --- a/assembly/wasm/fift-func-wasm-build-ubuntu.sh +++ b/assembly/wasm/fift-func-wasm-build-ubuntu.sh @@ -6,7 +6,7 @@ # wget https://apt.llvm.org/llvm.sh # chmod +x llvm.sh -# sudo ./llvm.sh 16 all +# sudo ./llvm.sh 21 clang with_artifacts=false scratch_new=false @@ -20,8 +20,8 @@ while getopts 'af' flag; do esac done -export CC=$(which clang-16) -export CXX=$(which clang++-16) +export CC=$(which clang-21) +export CXX=$(which clang++-21) export CCACHE_DISABLE=1 echo `pwd` @@ -32,7 +32,7 @@ fi if [ ! -d "openssl_3" ]; then git clone https://github.com/openssl/openssl openssl_3 - cd openssl_3 + cd openssl_3 || exit opensslPath=`pwd` git checkout openssl-3.1.4 ./config @@ -69,7 +69,7 @@ echo echo Using cloned emsdk fi -cd emsdk +cd emsdk || exit ./emsdk install 4.0.17 ./emsdk activate 4.0.17 EMSDK_DIR=`pwd` @@ -84,7 +84,7 @@ cd .. if [ ! -f "3pp_emscripten/openssl_em/openssl_em" ]; then mkdir -p 3pp_emscripten git clone https://github.com/openssl/openssl 3pp_emscripten/openssl_em - cd 3pp_emscripten/openssl_em + cd 3pp_emscripten/openssl_em || exit emconfigure ./Configure linux-generic32 no-shared no-dso no-engine no-unit-test no-tests no-fuzz-afl no-fuzz-libfuzzer sed -i 's/CROSS_COMPILE=.*/CROSS_COMPILE=/g' Makefile sed -i 's/-ldl//g' Makefile @@ -102,7 +102,7 @@ fi if [ ! -d "3pp_emscripten/zlib" ]; then git clone https://github.com/madler/zlib.git 3pp_emscripten/zlib - cd 3pp_emscripten/zlib + cd 3pp_emscripten/zlib || exit git checkout v1.3.1 ZLIB_DIR=`pwd` emconfigure ./configure --static @@ -116,7 +116,7 @@ fi if [ ! -d "3pp_emscripten/lz4" ]; then git clone https://github.com/lz4/lz4.git 3pp_emscripten/lz4 - cd 3pp_emscripten/lz4 + cd 3pp_emscripten/lz4 || exit git checkout v1.9.4 LZ4_DIR=`pwd` emmake make -j$(nproc) @@ -129,7 +129,7 @@ fi if [ ! -d "3pp_emscripten/libsodium" ]; then git clone https://github.com/jedisct1/libsodium 3pp_emscripten/libsodium - cd 3pp_emscripten/libsodium + cd 3pp_emscripten/libsodium || exit git checkout 1.0.18-RELEASE SODIUM_DIR=`pwd` emconfigure ./configure --disable-ssp @@ -141,7 +141,7 @@ else echo Using compiled libsodium with emscripten at $SODIUM_DIR fi -cd build +cd build || exit emcmake cmake -DUSE_EMSCRIPTEN=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \ -DZLIB_FOUND=1 \