Last active
December 28, 2024 17:39
-
-
Save 0neday/2c820af5acbf90e48a8f1f2b9abf01a6 to your computer and use it in GitHub Desktop.
Cross compile statically stunnel for aarch64
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
### just for arm64 | |
```` | |
BASE=`pwd` | |
## cross-compile toolchain | |
git clone https://github.com/0neday/buildroot | |
cd buildroot | |
make menuconfig | |
### select aarch64 and enable ssp , c++ support | |
make -j$(nproc) toolchain | |
cd $BASE | |
## zlib | |
wget -c https://zlib.net/zlib-1.2.13.tar.gz | |
tar -xzvf zlib-1.2.13.tar.gz | |
cd zlib-1.2.13 | |
CC=aarch64-linux-gcc ./configure --prefix=/gl-inet/dists/zlib | |
make -j$(nproc) && make install | |
cd $BASE | |
## openssl, enable threads | |
wget -c https://github.com/openssl/openssl/archive/OpenSSL_1_1_1t.tar.gz | |
tar -xzvf OpenSSL_1_1_1t.tar.gz | |
cd openssl-OpenSSL_1_1_1t | |
CC=aarch64-linux-gcc ./Configure --prefix=/gl-inet/dists/openssl-v1.1.1t linux-aarch64 zlib threads \ | |
--with-zlib-lib=/gl-inet/dists/zlib/lib --with-zlib-include=/gl-inet/dists/zlib/include | |
make -j$(nproc) && make install | |
cd $BASE | |
## stunnel | |
wget -c https://www.stunnel.org/downloads/stunnel-5.69.tar.gz | |
tar -xzvf stunnel-5.69.tar.gz | |
cd stunnel-5.69 | |
# refer here https://github.com/jirutka/stunnel-static/blob/master/build.sh | |
sed -i 's/^stunnel_LDFLAGS = /&-all-static /' src/Makefile.in | |
CC=aarch64-linux-gcc LDFLAGS="-L/gl-inet/dists/zlib/lib/ -lz" CFLAGS="-I/gl-inet/dists/zlib/include" \ | |
./configure --with-threads=pthread --disable-libwrap --disable-fips --host=aarch64-linux \ | |
--prefix=/gl-inet/dists/stunnel --with-ssl=/gl-inet/dists/openssl-v1.1.1t | |
make -j$(nproc) && make install | |
cd $BASE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
just for x86