Posted: Fri Jun 21, 2019 10:26 Post subject: Building curl with HTTP2 for dd-wrt
Finally, I got it working after a lot of trial and error.
I'm posting what I've done in case anyone else find it useful.
The error I've faced of "version `GLIBC_2.27' not found" was due to old version of Ubuntu (16.04). Once I upgraded to Ubuntu 18.04 this error was solved.
All the steps below are done on my Ubuntu 18.04 using the dd-wrt toolchains.
In a nutshell, the steps are:
1. I've created a new directory that will serve as root folder for all files in this process. In my case, I created the folder: "/media/mydoc/dm_build_curl/"
2. Build OpenSSL.
3. Build nghttp2.
4. Build curl (statically) using the artifacts of the OpenSSL & nghttp2 artifacts.
5. Copy the newly built curl to my dd-wrt WRT1200ACv2 router.
Prerequisites:
Quote:
mkdir /media/mydoc/dm_build_curl/
install toolchain in "/media/mydoc/dm_build_curl/toolchains/toolchain-arm_cortex-a9+vfpv3_gcc-8.2.0_musl_eabi/"
Add to ~/.profile: "PATH="/media/mydoc/dm_build_curl/toolchains/toolchain-arm_cortex-a9+vfpv3_gcc-8.2.0_musl_eabi/bin:$PATH""
sudo apt-get -y install build-essential pkg-config
reboot Ubuntu
Building OpenSSL
Quote:
cd /media/mydoc/dm_build_curl
mkdir usr_local_ssl
wget https://www.openssl.org/source/openssl-1.1.1b.tar.gz
tar xvf openssl-1.1.1b.tar.gz
cd /media/mydoc/dm_build_curl/openssl-1.1.1b
export CROSS_COMPILE=arm-openwrt-linux-muslgnueabi-
./Configure linux-generic32 -DL_ENDIAN no-shared no-ssl2 --prefix=/media/mydoc/dm_build_curl/usr_local_ssl --openssldir=/media/mydoc/dm_build_curl/usr_local_ssl
make install
Building nghttp2
Quote:
cd /media/mydoc/dm_build_curl
mkdir usr_local_nghttp2
wget https://github.com/nghttp2/nghttp2/releases/download/v1.38.0/nghttp2-1.38.0.tar.xz
tar xvf nghttp2-1.38.0.tar.xz
cd /media/mydoc/dm_build_curl/nghttp2-1.38.0
./configure --host=arm-openwrt-linux-muslgnueabi --prefix=/media/mydoc/dm_build_curl/usr_local_nghttp2 --enable-lib-only
make
make install
Building curl
Quote:
cd /media/mydoc/dm_build_curl
mkdir dm_final
wget https://curl.haxx.se/download/curl-7.64.1.tar.gz
tar xvf curl-7.64.1.tar.gz
cd /media/mydoc/dm_build_curl/curl-7.64.1
./configure --host=arm-openwrt-linux-muslgnueabi --prefix=/media/mydoc/dm_build_curl/dm_final --with-ssl=/media/mydoc/dm_build_curl/usr_local_ssl --disable-shared --with-nghttp2=/media/mydoc/dm_build_curl/usr_local_nghttp2
make
make install
After copying curl to my router, I was able to use http2.
Small correction to the nghttp2 build in order to make curl fully static linked (adding --enable-shared=no):
Code:
cd /media/mydoc/dm_build_curl
mkdir usr_local_nghttp2
wget https://github.com/nghttp2/nghttp2/releases/download/v1.38.0/nghttp2-1.38.0.tar.xz
tar xvf nghttp2-1.38.0.tar.xz
cd /media/mydoc/dm_build_curl/nghttp2-1.38.0
./configure --host=arm-openwrt-linux-muslgnueabi --prefix=/media/mydoc/dm_build_curl/usr_local_nghttp2 --enable-lib-only --enable-shared=no
make
make install