Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
e469753
clang-21 wip
neodix42 Nov 29, 2025
72e42a1
adjust build scripts
neodix42 Dec 1, 2025
0e82485
use bundled libc++ on macos
neodix42 Dec 1, 2025
8909add
force new llvm usage on macos
neodix42 Dec 1, 2025
dc88344
revert force new llvm usage on macos, clear gh cache
neodix42 Dec 1, 2025
a50668e
stop using homebrew libc++ headers and force it to use Apple’s
neodix42 Dec 1, 2025
6ad6049
fetch libmicrohttpd from github instead of ftpmirror.gnu.org
neodix42 Dec 1, 2025
6fe7bbd
for macos >=15 use AppleClang, otherwise homebrew's
neodix42 Dec 1, 2025
39c7a0d
compile 3pp with sdk, macos-14 still fails (ok)
neodix42 Dec 1, 2025
b120dda
try clang-20 for macos
neodix42 Dec 1, 2025
bb90f0a
Revert "try clang-20 for macos"
neodix42 Dec 1, 2025
f961f25
stop using homebrew libc++ headers and force it to use Apple’s
neodix42 Dec 1, 2025
98b3aa3
update blst to v0.3.15
neodix42 Dec 1, 2025
e2bf45f
update blst to v0.3.15
neodix42 Dec 1, 2025
e66d86a
Merge branch 'blst-0.3.15' into clang-21
neodix42 Dec 1, 2025
89ff4d7
remove redundant submodule entry
neodix42 Dec 1, 2025
d788a52
Merge branch 'blst-0.3.15' into clang-21
neodix42 Dec 1, 2025
fa3ee20
remove redundant snippet
neodix42 Dec 1, 2025
ce845a6
remove redundant snippet
neodix42 Dec 2, 2025
d744af0
remove redundant snippet
neodix42 Dec 2, 2025
afff466
Merge branch 'libmicrohttpd' into clang-21
neodix42 Dec 2, 2025
3507bcb
minor
neodix42 Dec 2, 2025
a02e2d3
minor
neodix42 Dec 2, 2025
2bac84d
use libmicrohttpd repo out of ton-blockchain org
neodix42 Dec 2, 2025
622a181
Merge branch 'libmicrohttpd' into clang-21
neodix42 Dec 3, 2025
1d5e502
minor
neodix42 Dec 3, 2025
46d51d4
clear gh cache and rerun
neodix42 Dec 3, 2025
0e1e7f1
Merge branch 'testnet' into clang-21
neodix42 Dec 4, 2025
f7f0c90
Merge pull request #1946 from ton-blockchain/testnet
EmelyanenkoK Dec 11, 2025
29fff82
Merge branch 'ton-blockchain:master' into clang-21
neodix42 Dec 12, 2025
8c2d112
review fixes
neodix42 Dec 22, 2025
680939e
review fixes
neodix42 Dec 22, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/build-ton-linux-arm64-appimage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
15 changes: 12 additions & 3 deletions .github/workflows/build-ton-linux-arm64-shared.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build-ton-linux-x86-64-appimage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 10 additions & 1 deletion .github/workflows/build-ton-linux-x86-64-shared.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build-ton-wasm-emscripten.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 /
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions assembly/android/build-android-tonlib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
68 changes: 39 additions & 29 deletions assembly/native/build-macos-portable.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 ;;
Expand All @@ -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
Expand All @@ -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
Expand All @@ -67,55 +77,55 @@ 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"
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"
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"
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"
Expand All @@ -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 \
Expand Down
52 changes: 25 additions & 27 deletions assembly/native/build-macos-shared.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 ;;
Expand All @@ -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
Expand All @@ -40,47 +59,26 @@ 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
lz4Path=$(pwd)/lz4
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 [email protected]
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 \
Expand Down
Loading
Loading