From 970cee7912b0942bbea6d76cbe93c5c0ebc4980c Mon Sep 17 00:00:00 2001 From: Mike Hommey Date: Thu, 27 Sep 2018 15:33:42 +0000 Subject: [PATCH] Bug 1492663 - Upgrade most CI builds to clang 7 r=froydnj The cctools-port linker links against libraries from clang (for LTO), which have different SONAMEs depending on the clang version. Which means the linker needs to be used along the same version of clang it was built against. Thus we also make it depend on linux64-clang-7. But changing the dependency is not enough, cf. bug 1471905, so also touch its build script, which it turns out, we need to do anyways because llvm-dsymutil was renamed to dsymutil. Relatedly, all toolchains that are built using cctools-port need to use linux64-clang-7 too. Building compiler-rt 7 with the OSX 10.11 SDK fails because of some newer APIs being used in compiler-rt for xray, but this is not a feature we use, so disable that. Differential Revision: https://phabricator.services.mozilla.com/D6766 --- build/build-clang/build-clang.py | 2 ++ ...-6-macosx64.json => clang-7-macosx64.json} | 19 ++++++++----------- .../build-clang/compiler-rt-no-codesign.patch | 6 +++--- taskcluster/ci/toolchain/linux.yml | 16 ++++++++-------- taskcluster/ci/toolchain/macosx.yml | 10 +++++----- .../scripts/misc/build-cctools-port.sh | 2 +- ...sh => build-clang-7-linux-macosx-cross.sh} | 2 +- .../scripts/misc/build-clang-macosx.sh | 2 +- 8 files changed, 29 insertions(+), 30 deletions(-) rename build/build-clang/{clang-6-macosx64.json => clang-7-macosx64.json} (82%) rename taskcluster/scripts/misc/{build-clang-6-linux-macosx-cross.sh => build-clang-7-linux-macosx-cross.sh} (95%) diff --git a/build/build-clang/build-clang.py b/build/build-clang/build-clang.py index 810757188227..1bab30fb641a 100755 --- a/build/build-clang/build-clang.py +++ b/build/build-clang/build-clang.py @@ -235,6 +235,8 @@ def build_one_stage(cc, cxx, asm, ld, ar, ranlib, libtool, "-DCMAKE_SYSTEM_NAME=Darwin", "-DCMAKE_SYSTEM_VERSION=10.10", "-DLLVM_ENABLE_THREADS=OFF", + # Xray requires a OSX 10.12 SDK (https://bugs.llvm.org/show_bug.cgi?id=38959) + "-DCOMPILER_RT_BUILD_XRAY=OFF", "-DLIBCXXABI_LIBCXX_INCLUDES=%s" % libcxx_include_dir, "-DCMAKE_OSX_SYSROOT=%s" % slashify_path(os.getenv("CROSS_SYSROOT")), "-DCMAKE_FIND_ROOT_PATH=%s" % slashify_path(os.getenv("CROSS_CCTOOLS_PATH")), # noqa diff --git a/build/build-clang/clang-6-macosx64.json b/build/build-clang/clang-7-macosx64.json similarity index 82% rename from build/build-clang/clang-6-macosx64.json rename to build/build-clang/clang-7-macosx64.json index ddbed23dd8c3..1470a1d2a8e4 100644 --- a/build/build-clang/clang-6-macosx64.json +++ b/build/build-clang/clang-7-macosx64.json @@ -1,16 +1,16 @@ { - "llvm_revision": "335538", + "llvm_revision": "342383", "stages": "1", "build_libcxx": true, "build_type": "Release", "assertions": false, "osx_cross_compile": true, - "llvm_repo": "https://llvm.org/svn/llvm-project/llvm/tags/RELEASE_601/final", - "clang_repo": "https://llvm.org/svn/llvm-project/cfe/tags/RELEASE_601/final", - "lld_repo": "https://llvm.org/svn/llvm-project/lld/tags/RELEASE_601/final", - "compiler_repo": "https://llvm.org/svn/llvm-project/compiler-rt/tags/RELEASE_601/final", - "libcxx_repo": "https://llvm.org/svn/llvm-project/libcxx/tags/RELEASE_601/final", - "libcxxabi_repo": "https://llvm.org/svn/llvm-project/libcxxabi/tags/RELEASE_601/final", + "llvm_repo": "https://llvm.org/svn/llvm-project/llvm/tags/RELEASE_700/final", + "clang_repo": "https://llvm.org/svn/llvm-project/cfe/tags/RELEASE_700/final", + "lld_repo": "https://llvm.org/svn/llvm-project/lld/tags/RELEASE_700/final", + "compiler_repo": "https://llvm.org/svn/llvm-project/compiler-rt/tags/RELEASE_700/final", + "libcxx_repo": "https://llvm.org/svn/llvm-project/libcxx/tags/RELEASE_700/final", + "libcxxabi_repo": "https://llvm.org/svn/llvm-project/libcxxabi/tags/RELEASE_700/final", "python_path": "/usr/bin/python2.7", "gcc_dir": "/builds/worker/workspace/build/src/gcc", "cc": "/builds/worker/workspace/build/src/clang/bin/clang", @@ -23,9 +23,6 @@ "patches": [ "static-llvm-symbolizer.patch", "compiler-rt-cross-compile.patch", - "compiler-rt-no-codesign.patch", - "r322401.patch", - "r325356.patch", - "r339636.patch" + "compiler-rt-no-codesign.patch" ] } diff --git a/build/build-clang/compiler-rt-no-codesign.patch b/build/build-clang/compiler-rt-no-codesign.patch index f1a769cbfc4c..92a584de917d 100644 --- a/build/build-clang/compiler-rt-no-codesign.patch +++ b/build/build-clang/compiler-rt-no-codesign.patch @@ -2,9 +2,9 @@ Disable codesign for macosx cross-compile toolchain. Codesign only works on OSX. Index: cmake/Modules/AddCompilerRT.cmake =================================================================== ---- a/compiler-rt/cmake/Modules/AddCompilerRT.cmake (revision 312553) +--- a/compiler-rt/cmake/Modules/AddCompilerRT.cmake (revision 342374) +++ b/compiler-rt/cmake/Modules/AddCompilerRT.cmake (working copy) -@@ -224,14 +224,6 @@ +@@ -290,14 +290,6 @@ set_target_properties(${libname} PROPERTIES IMPORT_PREFIX "") set_target_properties(${libname} PROPERTIES IMPORT_SUFFIX ".lib") endif() @@ -18,4 +18,4 @@ Index: cmake/Modules/AddCompilerRT.cmake - endif() endif() install(TARGETS ${libname} - ARCHIVE DESTINATION ${COMPILER_RT_LIBRARY_INSTALL_DIR} + ARCHIVE DESTINATION ${install_dir_${libname}} diff --git a/taskcluster/ci/toolchain/linux.yml b/taskcluster/ci/toolchain/linux.yml index e56274180370..071d36eaaa25 100755 --- a/taskcluster/ci/toolchain/linux.yml +++ b/taskcluster/ci/toolchain/linux.yml @@ -44,7 +44,6 @@ linux64-clang-6: - 'build/build-clang/build-clang.py' - 'build/build-clang/clang-6-linux64.json' - 'taskcluster/scripts/misc/tooltool-download.sh' - toolchain-alias: linux64-clang toolchain-artifact: public/build/clang.tar.xz toolchains: - linux64-gcc-4.9 @@ -66,6 +65,7 @@ linux64-clang-7: - 'build/build-clang/build-clang.py' - 'build/build-clang/clang-7-linux64.json' - 'taskcluster/scripts/misc/tooltool-download.sh' + toolchain-alias: linux64-clang toolchain-artifact: public/build/clang.tar.xz toolchains: - linux64-gcc-4.9 @@ -118,12 +118,12 @@ linux64-clang-7-mingw-x64: toolchains: - linux64-gcc-4.9 -linux64-clang-6-macosx-cross: - description: "Clang 6 toolchain build with MacOS Compiler RT libs" +linux64-clang-7-macosx-cross: + description: "Clang 7 toolchain build with MacOS Compiler RT libs" treeherder: kind: build platform: toolchains/opt - symbol: TL(clang6-macosx-cross) + symbol: TL(clang7-macosx-cross) tier: 1 worker-type: aws-provisioner-v1/gecko-{level}-b-linux worker: @@ -132,17 +132,17 @@ linux64-clang-6-macosx-cross: TOOLTOOL_MANIFEST: "browser/config/tooltool-manifests/macosx64/cross-clang.manifest" run: using: toolchain-script - script: build-clang-6-linux-macosx-cross.sh + script: build-clang-7-linux-macosx-cross.sh resources: - 'build/build-clang/build-clang.py' - - 'build/build-clang/clang-6-macosx64.json' + - 'build/build-clang/clang-7-macosx64.json' - 'taskcluster/scripts/misc/tooltool-download.sh' toolchain-alias: linux64-clang-macosx-cross toolchain-artifact: public/build/clang.tar.xz tooltool-downloads: internal toolchains: - linux64-cctools-port - - linux64-clang-6 + - linux64-clang-7 - linux64-gcc-4.9 linux64-clang-tidy: @@ -354,7 +354,7 @@ linux64-cctools-port: - 'taskcluster/scripts/misc/tooltool-download.sh' toolchain-artifact: public/build/cctools.tar.xz toolchains: - - linux64-clang-6 + - linux64-clang-7 linux64-hfsplus: description: "hfsplus toolchain build" diff --git a/taskcluster/ci/toolchain/macosx.yml b/taskcluster/ci/toolchain/macosx.yml index 26c971697960..cb674c9e2db5 100644 --- a/taskcluster/ci/toolchain/macosx.yml +++ b/taskcluster/ci/toolchain/macosx.yml @@ -27,12 +27,12 @@ macosx64-clang: tooltool-downloads: internal resources: - 'build/build-clang/build-clang.py' - - 'build/build-clang/clang-6-macosx64.json' + - 'build/build-clang/clang-7-macosx64.json' - 'taskcluster/scripts/misc/tooltool-download.sh' toolchain-artifact: public/build/clang.tar.xz toolchains: - linux64-cctools-port - - linux64-clang-6 + - linux64-clang-7 - linux64-gcc-4.9 - linux64-node @@ -63,7 +63,7 @@ macosx64-clang-tidy: toolchain-artifact: public/build/clang-tidy.tar.xz toolchains: - linux64-cctools-port - - linux64-clang-6 + - linux64-clang-7 - linux64-gcc-4.9 - linux64-node @@ -88,7 +88,7 @@ macosx64-cctools-port: toolchain-artifact: public/build/cctools.tar.bz2 toolchains: - linux64-cctools-port - - linux64-clang-6 + - linux64-clang-7 - linux64-node macosx64-gn: @@ -113,7 +113,7 @@ macosx64-gn: toolchain-artifact: public/build/gn.tar.xz toolchains: - linux64-cctools-port - - linux64-clang-6 + - linux64-clang-7 - linux64-node macosx64-node: diff --git a/taskcluster/scripts/misc/build-cctools-port.sh b/taskcluster/scripts/misc/build-cctools-port.sh index 1392764cba47..d26f0cdbdd77 100755 --- a/taskcluster/scripts/misc/build-cctools-port.sh +++ b/taskcluster/scripts/misc/build-cctools-port.sh @@ -48,7 +48,7 @@ export LDFLAGS="-lpthread -Wl,-rpath-link,$CLANG_DIR/lib" make -j `nproc --all` install strip $CROSSTOOLS_BUILD_DIR/bin/* # cctools-port doesn't include dsymutil but clang will need to find it. -cp $CLANG_DIR/bin/llvm-dsymutil $CROSSTOOLS_BUILD_DIR/bin/x86_64-apple-darwin11-dsymutil +cp $CLANG_DIR/bin/dsymutil $CROSSTOOLS_BUILD_DIR/bin/x86_64-apple-darwin11-dsymutil # Put a tarball in the artifacts dir mkdir -p $UPLOAD_DIR diff --git a/taskcluster/scripts/misc/build-clang-6-linux-macosx-cross.sh b/taskcluster/scripts/misc/build-clang-7-linux-macosx-cross.sh similarity index 95% rename from taskcluster/scripts/misc/build-clang-6-linux-macosx-cross.sh rename to taskcluster/scripts/misc/build-clang-7-linux-macosx-cross.sh index 2f5d3653e771..e009deb7da2c 100755 --- a/taskcluster/scripts/misc/build-clang-6-linux-macosx-cross.sh +++ b/taskcluster/scripts/misc/build-clang-7-linux-macosx-cross.sh @@ -25,7 +25,7 @@ set +x cd build/build-clang # |mach python| sets up a virtualenv for us! -../../mach python ./build-clang.py -c clang-6-macosx64.json --skip-tar +../../mach python ./build-clang.py -c clang-7-macosx64.json --skip-tar # We now have a native macosx64 toolchain. # What we want is a native linux64 toolchain which can target macosx64 and use the sanitizer dylibs. diff --git a/taskcluster/scripts/misc/build-clang-macosx.sh b/taskcluster/scripts/misc/build-clang-macosx.sh index 1e7d8c2bc3fc..b26d608841c6 100755 --- a/taskcluster/scripts/misc/build-clang-macosx.sh +++ b/taskcluster/scripts/misc/build-clang-macosx.sh @@ -24,7 +24,7 @@ set +x cd build/build-clang # |mach python| sets up a virtualenv for us! -../../mach python ./build-clang.py -c clang-6-macosx64.json +../../mach python ./build-clang.py -c clang-7-macosx64.json set -x