Last active
January 15, 2020 12:23
-
-
Save HouzuoGuo/098fb7c5398e1941bbb194eae5171999 to your computer and use it in GitHub Desktop.
Cross-compile and build OpenSSL for 32-bit ARM (with hardware floating point) on an Intel/AMD Ubuntu 18.04 computer
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
# Run the commands in a docker container: docker run -it --rm ubuntu:18.04 | |
cat > /etc/apt/sources.list <<EOF | |
deb http://archive.ubuntu.com/ubuntu/ bionic main restricted | |
deb-src http://archive.ubuntu.com/ubuntu/ bionic main restricted | |
deb http://archive.ubuntu.com/ubuntu/ bionic-updates main restricted | |
deb-src http://archive.ubuntu.com/ubuntu/ bionic-updates main restricted | |
deb http://archive.ubuntu.com/ubuntu/ bionic universe | |
deb-src http://archive.ubuntu.com/ubuntu/ bionic universe | |
deb http://archive.ubuntu.com/ubuntu/ bionic-updates universe | |
deb-src http://archive.ubuntu.com/ubuntu/ bionic-updates universe | |
deb http://archive.ubuntu.com/ubuntu/ bionic multiverse | |
deb-src http://archive.ubuntu.com/ubuntu/ bionic multiverse | |
deb http://archive.ubuntu.com/ubuntu/ bionic-updates multiverse | |
deb-src http://archive.ubuntu.com/ubuntu/ bionic-updates multiverse | |
deb http://archive.ubuntu.com/ubuntu/ bionic-backports main restricted universe multiverse | |
deb-src http://archive.ubuntu.com/ubuntu/ bionic-backports main restricted universe multiverse | |
deb http://security.ubuntu.com/ubuntu bionic-security main restricted | |
deb-src http://security.ubuntu.com/ubuntu bionic-security main restricted | |
deb http://security.ubuntu.com/ubuntu bionic-security universe | |
deb-src http://security.ubuntu.com/ubuntu bionic-security universe | |
deb http://security.ubuntu.com/ubuntu bionic-security multiverse | |
deb-src http://security.ubuntu.com/ubuntu bionic-security multiverse | |
EOF | |
apt update | |
apt-get install -y crossbuild-essential-armhf dpkg-dev devscripts | |
apt-get source openssl | |
dpkg --add-architecture armhf | |
apt-get build-dep -y -a armhf openssl | |
cd openssl-1.1.1 | |
# Patch up faulty rules file | |
sed -i "s/dh_shlibdeps.*libssl/env LD_LIBRARY_PATH=\/usr\/arm-linux-gnueabi\/libhf:.\/build_shared dh_shlibdeps -a -L libssl1.1/g" ./debian/rules | |
env DEB_BUILD_OPTIONS=nocheck dpkg-buildpackage -b -aarmhf -uc -us |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment