Bug 1478917 - Apply upstream patch fixing ld64 crash with LTO. draft
authorMike Hommey <mh+mozilla@glandium.org>
Fri, 27 Jul 2018 15:14:06 +0900
changeset 823492 94d746686c8a3f1bf9369041525492364333fab5
parent 823333 8f2f847b2f9dc5643eeb9935d603a3b30686f972
child 823495 45d7a7778bd15c42f87f9345c10c6f0e0979f436
push id117699
push userbmo:mh+mozilla@glandium.org
push dateFri, 27 Jul 2018 13:43:07 +0000
bugs1478917
milestone63.0a1
Bug 1478917 - Apply upstream patch fixing ld64 crash with LTO. While fiddling with clang (upgrading it and applying some miscompilation patches), my mac LTO builds started to fail because ld64 would crash during configure. It turns out, it was crashing trying to print a warning it shouldn't even print out, about failure to create a cache path. This, in turn, is due to a pointer not being initialized in the ld64 code. I sent this upstream, and this was promptly fixed: https://github.com/tpoechtrager/cctools-port/pull/57 However, since our last update of cctools-port, upstream landed a change that broke support for tbd files if you don't compile against the new libtapi library. Doing so is more work than I'm ready to put here, so we just cherry-pick the fix.
taskcluster/scripts/misc/build-cctools-port-macosx.sh
taskcluster/scripts/misc/build-cctools-port.sh
--- a/taskcluster/scripts/misc/build-cctools-port-macosx.sh
+++ b/taskcluster/scripts/misc/build-cctools-port-macosx.sh
@@ -21,16 +21,18 @@ MACOSX_SDK_DIR=$WORKSPACE/build/src/MacO
 TARGET_TRIPLE=x86_64-apple-darwin11
 
 # Create our directories
 mkdir -p $CROSSTOOLS_BUILD_DIR
 
 git clone --no-checkout $CROSSTOOL_PORT_REPOSITORY $CROSSTOOLS_SOURCE_DIR
 cd $CROSSTOOLS_SOURCE_DIR
 git checkout $CROSSTOOL_PORT_REV
+# Cherry pick a fix for LTO.
+git cherry-pick -n 82381f5038a340025ae145745ae5b325cd1b749a
 echo "Building from commit hash `git rev-parse $CROSSTOOL_PORT_REV`..."
 
 # Fetch clang from tooltool
 cd $WORKSPACE/build/src
 . taskcluster/scripts/misc/tooltool-download.sh
 
 # Configure crosstools-port
 cd $CROSSTOOLS_CCTOOLS_DIR
--- a/taskcluster/scripts/misc/build-cctools-port.sh
+++ b/taskcluster/scripts/misc/build-cctools-port.sh
@@ -17,16 +17,18 @@ CROSSTOOLS_BUILD_DIR=$WORKSPACE/cctools
 CLANG_DIR=$WORKSPACE/build/src/clang
 
 # Create our directories
 mkdir -p $CROSSTOOLS_BUILD_DIR
 
 git clone --no-checkout $CROSSTOOL_PORT_REPOSITORY $CROSSTOOLS_SOURCE_DIR
 cd $CROSSTOOLS_SOURCE_DIR
 git checkout $CROSSTOOL_PORT_REV
+# Cherry pick a fix for LTO.
+git cherry-pick -n 82381f5038a340025ae145745ae5b325cd1b749a
 echo "Building from commit hash `git rev-parse $CROSSTOOL_PORT_REV`..."
 
 # Fetch clang from tooltool
 cd $WORKSPACE/build/src
 . taskcluster/scripts/misc/tooltool-download.sh
 
 # Configure crosstools-port
 cd $CROSSTOOLS_CCTOOLS_DIR