Created
December 1, 2025 04:33
-
-
Save isopen/d21d74da06284ddd5d276d3350a0acb2 to your computer and use it in GitHub Desktop.
TDLib ARM64 Client in ARM64 Assembly (ARMv8)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FROM debian:bullseye | |
| ENV DEBIAN_FRONTEND=noninteractive | |
| RUN dpkg --add-architecture arm64 && \ | |
| apt update && \ | |
| apt install -y --no-install-recommends \ | |
| libc6:arm64 \ | |
| libstdc++6:arm64 \ | |
| ca-certificates \ | |
| build-essential \ | |
| git \ | |
| cmake \ | |
| zlib1g-dev \ | |
| binutils \ | |
| gcc-aarch64-linux-gnu \ | |
| g++-aarch64-linux-gnu \ | |
| wget \ | |
| perl \ | |
| libssl-dev \ | |
| gperf | |
| RUN cd /tmp && \ | |
| wget https://github.com/madler/zlib/releases/download/v1.2.13/zlib-1.2.13.tar.gz && \ | |
| tar -xzf zlib-1.2.13.tar.gz && \ | |
| cd zlib-1.2.13 && \ | |
| CC=aarch64-linux-gnu-gcc ./configure --prefix=/opt/zlib-arm64 --static && \ | |
| make -j8 && \ | |
| make install | |
| RUN cd /tmp && \ | |
| wget https://www.openssl.org/source/openssl-3.2.1.tar.gz && \ | |
| tar -xzf openssl-3.2.1.tar.gz && \ | |
| cd openssl-3.2.1 && \ | |
| ./Configure linux-aarch64 \ | |
| --prefix=/opt/openssl-arm64 \ | |
| --with-zlib-include=/opt/zlib-arm64/include \ | |
| --with-zlib-lib=/opt/zlib-arm64/lib \ | |
| no-shared \ | |
| no-dso \ | |
| no-engine \ | |
| zlib && \ | |
| make -j8 CC=aarch64-linux-gnu-gcc && \ | |
| make install | |
| RUN cd /tmp && \ | |
| git clone https://github.com/tdlib/td.git | |
| RUN cd /tmp/td && \ | |
| mkdir build-x86 && \ | |
| cd build-x86 && \ | |
| cmake -DCMAKE_BUILD_TYPE=Release .. && \ | |
| make -j8 && \ | |
| find . -name "*mime_type_to_extension*" -o -name "*auto*" | head -10 | |
| RUN cd /tmp/td/build-x86 && \ | |
| make generate_mime_types_gperf | |
| RUN cd /tmp/td && \ | |
| find build-x86 -name "*.cpp" -path "*/auto/*" -exec cp {} tdutils/generate/auto/ \; 2>/dev/null || echo "Files not found..." | |
| RUN cd /tmp/td && \ | |
| mkdir build-arm64 && \ | |
| cd build-arm64 && \ | |
| CC=aarch64-linux-gnu-gcc CXX=aarch64-linux-gnu-g++ \ | |
| cmake -DCMAKE_BUILD_TYPE=Release \ | |
| -DCMAKE_SYSTEM_NAME=Linux \ | |
| -DCMAKE_SYSTEM_PROCESSOR=aarch64 \ | |
| -DCMAKE_C_COMPILER=aarch64-linux-gnu-gcc \ | |
| -DCMAKE_CXX_COMPILER=aarch64-linux-gnu-g++ \ | |
| -DOPENSSL_ROOT_DIR=/opt/openssl-arm64 \ | |
| -DOPENSSL_INCLUDE_DIR=/opt/openssl-arm64/include \ | |
| -DOPENSSL_CRYPTO_LIBRARY=/opt/openssl-arm64/lib/libcrypto.a \ | |
| -DOPENSSL_SSL_LIBRARY=/opt/openssl-arm64/lib/libssl.a \ | |
| -DZLIB_ROOT=/opt/zlib-arm64 \ | |
| .. && \ | |
| make -j8 tdjson | |
| RUN cp /tmp/td/build-arm64/libtdjson.so /usr/lib/ && \ | |
| ldconfig | |
| WORKDIR /app | |
| COPY arm64_tdjson_example.s . | |
| RUN aarch64-linux-gnu-as -o arm64_tdjson_example.o arm64_tdjson_example.s | |
| RUN aarch64-linux-gnu-gcc -o arm64_tdjson_example arm64_tdjson_example.o -ldl -L/tmp/td/build-arm64 | |
| CMD ["./arm64_tdjson_example"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment