From 9303ce340f212ba92c00bdfd2f7c1380f1d069d7 Mon Sep 17 00:00:00 2001 From: Brett Jia Date: Mon, 17 Jul 2023 03:37:06 -0400 Subject: [PATCH] Cross-compile armv7l binaries for 32-bit Raspberry Pi's (#167) Build arm binaries for 32-bit architecture. Use patch based on https://github.com/curl/curl/pull/9054. --- .github/workflows/build-and-test-make.yml | 15 ++++++++++----- Makefile.in | 1 + chrome/patches/curl-impersonate.patch | 14 ++++++++++++++ firefox/patches/curl-impersonate.patch | 17 ++++++++++++++++- 4 files changed, 41 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-and-test-make.yml b/.github/workflows/build-and-test-make.yml index 7bda8eb..80dc1a1 100644 --- a/.github/workflows/build-and-test-make.yml +++ b/.github/workflows/build-and-test-make.yml @@ -33,6 +33,11 @@ jobs: host: aarch64-linux-gnu capture_interface: eth0 make: make + - os: ubuntu-20.04 + arch: arm + host: arm-linux-gnueabihf + capture_interface: eth0 + make: make - os: macos-11 arch: x86_64 host: x86_64-macos @@ -55,10 +60,10 @@ jobs: # More dependencies for the tests sudo apt-get install tcpdump nghttp2-server libnss3 - - name: Install Ubuntu dependencies (aarch64) - if: matrix.arch == 'aarch64' + - name: Install Ubuntu cross-compile dependencies (${{ matrix.arch }}) + if: matrix.os == 'ubuntu-20.04' && matrix.arch != 'x86_64' run: | - sudo apt-get install gcc-aarch64-linux-gnu g++-aarch64-linux-gnu + sudo apt-get install gcc-${{ matrix.host }} g++-${{ matrix.host }} - name: Install macOS dependencies if: matrix.os == 'macos-11' @@ -177,7 +182,7 @@ jobs: ${{ matrix.make }} firefox-build ${{ matrix.make }} firefox-checkbuild ${{ matrix.make }} firefox-install - + - name: Prepare the tests if: matrix.arch == 'x86_64' run: | @@ -250,4 +255,4 @@ jobs: with: files: | ${{ env.release_file_lib }} - ${{ env.release_file_bin }} + ${{ env.release_file_bin }} \ No newline at end of file diff --git a/Makefile.in b/Makefile.in index 203b281..d54f34f 100644 --- a/Makefile.in +++ b/Makefile.in @@ -225,6 +225,7 @@ else ;; \ *) \ use_64="0"; \ + nspr_configure_flags=""; \ ;; \ esac diff --git a/chrome/patches/curl-impersonate.patch b/chrome/patches/curl-impersonate.patch index fd3bbf1..1c5bdb5 100644 --- a/chrome/patches/curl-impersonate.patch +++ b/chrome/patches/curl-impersonate.patch @@ -2485,3 +2485,17 @@ index 5ff86c7f5..be26f91ea 100644 NV1(CURLOPT_TCP_NODELAY, 1), NV1(CURLOPT_PROXY_SSL_VERIFYPEER, 1), NV1(CURLOPT_PROXY_SSL_VERIFYHOST, 1), +diff --git a/lib/easy_lock.h b/lib/easy_lock.h +index 819f50ce8..1f54289ce 100644 +--- a/lib/easy_lock.h ++++ b/lib/easy_lock.h +@@ -36,6 +36,9 @@ + + #elif defined (HAVE_ATOMIC) + #include ++#if defined(HAVE_SCHED_YIELD) ++#include ++#endif + + #define curl_simple_lock atomic_bool + #define CURL_SIMPLE_LOCK_INIT false diff --git a/firefox/patches/curl-impersonate.patch b/firefox/patches/curl-impersonate.patch index e382475..444f1e0 100644 --- a/firefox/patches/curl-impersonate.patch +++ b/firefox/patches/curl-impersonate.patch @@ -1354,7 +1354,7 @@ index cb162755d..13ee571aa 100644 + + case $host_cpu in + arm) -+ addlib="$addlib -larmv8_c_lib" ++ addlib="$addlib -larmv8_c_lib -l:libgcm-aes-arm32-neon_c_lib.a" + ;; + aarch64) + addlib="$addlib -larmv8_c_lib -lgcm-aes-aarch64_c_lib" @@ -1498,3 +1498,18 @@ index 706f0aac3..0ad94622e 100644 endif # if unit tests are enabled, build a static library to link them with +diff --git a/lib/easy_lock.h b/lib/easy_lock.h +index 819f50ce8..1f54289ce 100644 +--- a/lib/easy_lock.h ++++ b/lib/easy_lock.h +@@ -36,6 +36,9 @@ + + #elif defined (HAVE_ATOMIC) + #include ++#if defined(HAVE_SCHED_YIELD) ++#include ++#endif + + #define curl_simple_lock atomic_bool + #define CURL_SIMPLE_LOCK_INIT false +