]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Add 32-bit cross-compiled CI jobs on Debian Buster
authorMichal Nowak <mnowak@isc.org>
Thu, 17 Dec 2020 10:31:05 +0000 (11:31 +0100)
committerMichal Nowak <mnowak@isc.org>
Wed, 21 Jul 2021 08:03:12 +0000 (10:03 +0200)
Since the forced removal of gcc:sid:i386 in 0aacabc6, we lacked a 32-bit
environment to build and test BIND 9 in the CI. gcc:buster:amd64cross32
adds an environment to cross-compile BIND 9 to 32-bits on Debian Buster
amd64 image with 32-bit BIND 9 dependencies. Commit also adds sanity
checks to ensure that compiled objects are not of the build platform
triplet type.

.gitlab-ci.yml

index 3e55f4fd1f1272015dab7ef7b5f8d491a36095bc..4f99f2d3d556b170ae32718a79620b47f48869ce 100644 (file)
@@ -120,6 +120,10 @@ stages:
   image: "$CI_REGISTRY_IMAGE:debian-buster-amd64"
   <<: *linux_amd64
 
+.debian-buster-amd64cross32: &debian_buster_amd64cross32_image
+  image: "$CI_REGISTRY_IMAGE:debian-buster-amd64cross32"
+  <<: *linux_amd64
+
 .debian-sid-amd64: &debian_sid_amd64_image
   image: "$CI_REGISTRY_IMAGE:debian-sid-amd64"
   <<: *linux_amd64
@@ -265,6 +269,9 @@ stages:
     - test -z "${RUN_MAKE_INSTALL}" || make DESTDIR="${INSTALL_PATH}" install
     - test -z "${RUN_MAKE_INSTALL}" || DESTDIR="${INSTALL_PATH}" sh util/check-make-install
     - if [[ "${CFLAGS}" == *"-fsanitize=address"* ]]; then ( ! grep -F AddressSanitizer config.log ); fi
+    - test -z "${CROSS_COMPILATION}" || grep -F -A 1 "checking whether we are cross compiling" config.log | grep -q "result.*yes"
+    - test -z "${CROSS_COMPILATION}" || file lib/dns/gen | grep -F -q "ELF 64-bit LSB"
+    - test -z "${CROSS_COMPILATION}" || ( ! git ls-files -z --others --exclude lib/dns/gen | xargs -0 file | grep "ELF 64-bit LSB" )
     - if test -z "${OUT_OF_TREE_WORKSPACE}" && test "$(git status --porcelain | grep -Ev '\?\?' | wc -l)" -gt "0"; then git status --short; exit 1; fi
   after_script:
     - *save_out_of_tree_workspace
@@ -652,6 +659,31 @@ unit:gcc:buster:amd64:
     - job: gcc:buster:amd64
       artifacts: true
 
+# Jobs for cross-compiled GCC builds on Debian 10 "buster" (amd64) with
+# 32-bit libraries
+
+gcc:buster:amd64cross32:
+  variables:
+    CFLAGS: "${CFLAGS_COMMON}"
+    CROSS_COMPILATION: 1
+    EXTRA_CONFIGURE: "--build=x86_64-linux-gnu --host=i686-linux-gnu --with-libidn2 ${WITH_READLINE_LIBEDIT}"
+  <<: *debian_buster_amd64cross32_image
+  <<: *build_job
+
+system:gcc:buster:amd64cross32:
+  <<: *debian_buster_amd64cross32_image
+  <<: *system_test_job
+  needs:
+    - job: gcc:buster:amd64cross32
+      artifacts: true
+
+unit:gcc:buster:amd64cross32:
+  <<: *debian_buster_amd64cross32_image
+  <<: *unit_test_job
+  needs:
+    - job: gcc:buster:amd64cross32
+      artifacts: true
+
 # Jobs for scan-build builds on Debian 10 "buster" (amd64)
 
 .scan_build: &scan_build