Bug 1694826 - Port bug 1694775: Build linux32/64 libotr with a sysroot. r=justdave
authorRob Lemley <rob@thunderbird.net>
Tue, 02 Mar 2021 18:33:05 +0000
changeset 31825 595f5b337e38469efbc3bae80c9bea6076188bfe
parent 31824 f5fae7e6894900512797576e62d1d1e6386cc440
child 31826 1ee68c8de38b3dc15ae9f401b3fc93fa46063f6e
push id18521
push usergeoff@darktrojan.net
push dateWed, 03 Mar 2021 04:43:16 +0000
treeherdercomm-central@6745aae06040 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjustdave
bugs1694826, 1694775
Bug 1694826 - Port bug 1694775: Build linux32/64 libotr with a sysroot. r=justdave Differential Revision: https://phabricator.services.mozilla.com/D106349
taskcluster/ci/toolchain/libotr.yml
taskcluster/comm_taskgraph/transforms/job/toolchain.py
taskcluster/scripts/build-libotr.sh
--- a/taskcluster/ci/toolchain/libotr.yml
+++ b/taskcluster/ci/toolchain/libotr.yml
@@ -22,32 +22,32 @@ linux32-libotr:
     treeherder:
         symbol: TL(lib32otr)
     run:
         arguments: ['linux32']
     fetches:
         toolchain:
             - linux64-clang
             - linux64-binutils
+            - linux32-sysroot
 
 linux64-libotr:
     treeherder:
         symbol: TL(libotr)
     run:
         arguments: ['linux64']
     fetches:
         toolchain:
             - linux64-clang
             - linux64-binutils
+            - linux64-sysroot
 
 linux-aarch64-libotr:
     treeherder:
         symbol: TL(libotr-aarch64)
-    worker:
-        docker-image: {in-tree: deb10-toolchain-build}
     run:
         arguments: ['linux-aarch64']
     fetches:
         toolchain:
             - linux64-aarch64-sysroot
             - linux64-clang-aarch64-cross
             - linux64-binutils
 
--- a/taskcluster/comm_taskgraph/transforms/job/toolchain.py
+++ b/taskcluster/comm_taskgraph/transforms/job/toolchain.py
@@ -104,17 +104,17 @@ def get_digest_data(config, run, taskdes
 def docker_worker_toolchain(config, job, taskdesc):
     run = job["run"]
     run["comm-checkout"] = True
 
     worker = taskdesc["worker"] = job["worker"]
     worker["chain-of-trust"] = True
 
     # If the task doesn't have a docker-image, set a default
-    worker.setdefault("docker-image", {"in-tree": "deb8-toolchain-build"})
+    worker.setdefault("docker-image", {"in-tree": "deb10-toolchain-build"})
 
     # Allow the job to specify where artifacts come from, but add
     # public/build if it's not there already.
     artifacts = worker.setdefault("artifacts", [])
     if not any(artifact.get("name") == "public/build" for artifact in artifacts):
         docker_worker_add_artifacts(config, job, taskdesc)
 
     # Toolchain checkouts don't live under {workdir}/checkouts
--- a/taskcluster/scripts/build-libotr.sh
+++ b/taskcluster/scripts/build-libotr.sh
@@ -242,17 +242,19 @@ case "${_TARGET_OS}" in
         for _t in clang/bin binutils/bin; do
             PATH="${MOZ_FETCHES_DIR}/${_t}:$PATH"
         done
         export PATH
 
         export _TARGET_TRIPLE="i686-pc-linux"
         export CC="clang"
         export CFLAGS="--target=${_TARGET_TRIPLE} -m32 -march=pentium-m -msse -msse2 -mfpmath=sse"
+        export CFLAGS+=" --sysroot=${MOZ_FETCHES_DIR}/sysroot"
         export CCASFLAGS="--target=${_TARGET_TRIPLE} -m32 -march=pentium-m -msse -msse2 -mfpmath=sse"
+        export CCASFLAGS+=" --sysroot=${MOZ_FETCHES_DIR}/sysroot"
         export LDFLAGS="--target=${_TARGET_TRIPLE} -m32 -march=pentium-m -msse -msse2 -mfpmath=sse"
 
         export AR=llvm-ar
         export RANLIB=llvm-ranlib
         export NM=llvm-nm
         export LD=ld.lld
         export STRIP=llvm-strip
 
@@ -266,16 +268,17 @@ case "${_TARGET_OS}" in
     linux64)
         for _t in clang/bin binutils/bin; do
             PATH="${MOZ_FETCHES_DIR}/${_t}:$PATH"
         done
         export PATH
 
         export _TARGET_TRIPLE="x86_64-pc-linux"
         export CC="clang"
+        export CFLAGS="--sysroot=${MOZ_FETCHES_DIR}/sysroot"
         export AR=llvm-ar
         export RANLIB=llvm-ranlib
         export NM=llvm-nm
         export LD=ld.lld
         export STRIP=llvm-strip
 
         CFLAGS_otr="-Wl,-Bstatic,-L${_PREFIX}/lib,-lgcrypt,-L${_PREFIX}/lib,-lgpg-error,-Bdynamic"
         LDFLAGS_otr="-Wl,-Bstatic,-L${_PREFIX}/lib,-lgcrypt,-L${_PREFIX}/lib,-lgpg-error,-Bdynamic"