diff --git a/browser/config/mozconfigs/macosx-universal/nightly b/browser/config/mozconfigs/macosx-universal/nightly index 801ace4d49ab..1928d79afd1a 100644 --- a/browser/config/mozconfigs/macosx-universal/nightly +++ b/browser/config/mozconfigs/macosx-universal/nightly @@ -4,7 +4,11 @@ ac_add_options --disable-install-strip ac_add_options --enable-verify-mar ac_add_options --enable-profiling ac_add_options --enable-instruments -ac_add_options --enable-dtrace + +# Cross-universal builds fail when dtrace is enabled +if test `uname -s` != Linux; then + ac_add_options --enable-dtrace +fi if test "${MOZ_UPDATE_CHANNEL}" = "nightly"; then ac_add_options --with-macbundlename-prefix=Firefox diff --git a/build/autoconf/toolchain.m4 b/build/autoconf/toolchain.m4 index cdb86a671622..3109f5dfcfde 100644 --- a/build/autoconf/toolchain.m4 +++ b/build/autoconf/toolchain.m4 @@ -83,6 +83,7 @@ AC_CHECK_PROGS(RANLIB, "${TOOLCHAIN_PREFIX}ranlib", :) AC_CHECK_PROGS(AR, "${TOOLCHAIN_PREFIX}ar", :) AC_CHECK_PROGS(AS, "${TOOLCHAIN_PREFIX}as", :) AC_CHECK_PROGS(LD, "${TOOLCHAIN_PREFIX}ld", :) +AC_CHECK_PROGS(LIPO, "${TOOLCHAIN_PREFIX}lipo", :) AC_CHECK_PROGS(STRIP, "${TOOLCHAIN_PREFIX}strip", :) AC_CHECK_PROGS(WINDRES, "${TOOLCHAIN_PREFIX}windres", :) AC_CHECK_PROGS(OTOOL, "${TOOLCHAIN_PREFIX}otool", :) diff --git a/build/macosx/universal/mozconfig.common b/build/macosx/universal/mozconfig.common index 64e28015e26e..fbb60e4d23ac 100644 --- a/build/macosx/universal/mozconfig.common +++ b/build/macosx/universal/mozconfig.common @@ -4,13 +4,16 @@ mk_add_options MOZ_UNIFY_BDATE=1 -DARWIN_VERSION=`uname -r` +DARWIN_VERSION=10 ac_add_app_options i386 --target=i386-apple-darwin$DARWIN_VERSION ac_add_app_options x86_64 --target=x86_64-apple-darwin$DARWIN_VERSION ac_add_app_options i386 --with-unify-dist=../x86_64/dist ac_add_app_options x86_64 --with-unify-dist=../i386/dist -ac_add_options --with-macos-sdk=/Developer/SDKs/MacOSX10.7.sdk +if ! test `uname -s` = Linux; then + # Cross-universal builds already do the equivalent of this by setting -isysroot directly + ac_add_options --with-macos-sdk=/Developer/SDKs/MacOSX10.7.sdk +fi . $topsrcdir/build/macosx/mozconfig.common @@ -35,12 +38,12 @@ if test "$MOZ_BUILD_APP" = "i386" -o "$MOZ_BUILD_APP" = "x86_64"; then CXX="$CXX -arch $TARGET_CPU" # These must be set for cross builds, and don't hurt straight builds. - RANLIB=ranlib - AR=ar + RANLIB="${TOOLCHAIN_PREFIX}ranlib" + AR="${TOOLCHAIN_PREFIX}ar" AS=$CC LD=ld STRIP="strip" - OTOOL="otool" + OTOOL="${TOOLCHAIN_PREFIX}otool" # Each per-CPU build should be entirely oblivious to the fact that a # universal binary will be produced. The exception is packager.mk, which diff --git a/js/src/devtools/Instruments.cpp b/js/src/devtools/Instruments.cpp index 649d69424902..7a69cac07463 100644 --- a/js/src/devtools/Instruments.cpp +++ b/js/src/devtools/Instruments.cpp @@ -3,6 +3,7 @@ * You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "Instruments.h" +#include "mozilla/Attributes.h" #ifdef __APPLE__ @@ -42,7 +43,7 @@ template class AutoReleased { public: - AutoReleased(T aTypeRef) : mTypeRef(aTypeRef) + MOZ_IMPLICIT AutoReleased(T aTypeRef) : mTypeRef(aTypeRef) { } ~AutoReleased() diff --git a/js/src/jit/shared/Assembler-shared.h b/js/src/jit/shared/Assembler-shared.h index f1d538d174a6..aac9687b80ac 100644 --- a/js/src/jit/shared/Assembler-shared.h +++ b/js/src/jit/shared/Assembler-shared.h @@ -507,7 +507,7 @@ class CodeOffsetJump return jumpTableIndex_; } #else - CodeOffsetJump(size_t offset) : offset_(offset) {} + explicit CodeOffsetJump(size_t offset) : offset_(offset) {} #endif CodeOffsetJump() { diff --git a/js/src/jit/x86/Assembler-x86.cpp b/js/src/jit/x86/Assembler-x86.cpp index 24bec9476267..7fca29434cc7 100644 --- a/js/src/jit/x86/Assembler-x86.cpp +++ b/js/src/jit/x86/Assembler-x86.cpp @@ -71,7 +71,7 @@ class RelocationIterator uint32_t offset_; public: - RelocationIterator(CompactBufferReader& reader) + explicit RelocationIterator(CompactBufferReader& reader) : reader_(reader) { } diff --git a/js/src/jit/x86/Assembler-x86.h b/js/src/jit/x86/Assembler-x86.h index 29b8e6c31914..3fb5efaffd10 100644 --- a/js/src/jit/x86/Assembler-x86.h +++ b/js/src/jit/x86/Assembler-x86.h @@ -160,14 +160,14 @@ static const uint32_t WasmStackAlignment = SimdMemoryAlignment; struct ImmTag : public Imm32 { - ImmTag(JSValueTag mask) + explicit ImmTag(JSValueTag mask) : Imm32(int32_t(mask)) { } }; struct ImmType : public ImmTag { - ImmType(JSValueType type) + explicit ImmType(JSValueType type) : ImmTag(JSVAL_TYPE_TO_TAG(type)) { } }; diff --git a/js/src/jit/x86/CodeGenerator-x86.cpp b/js/src/jit/x86/CodeGenerator-x86.cpp index 75e1fef0cd96..8719b0a59a34 100644 --- a/js/src/jit/x86/CodeGenerator-x86.cpp +++ b/js/src/jit/x86/CodeGenerator-x86.cpp @@ -736,7 +736,7 @@ class OutOfLineTruncate : public OutOfLineCodeBase LTruncateDToInt32* ins_; public: - OutOfLineTruncate(LTruncateDToInt32* ins) + explicit OutOfLineTruncate(LTruncateDToInt32* ins) : ins_(ins) { } @@ -753,7 +753,7 @@ class OutOfLineTruncateFloat32 : public OutOfLineCodeBase LTruncateFToInt32* ins_; public: - OutOfLineTruncateFloat32(LTruncateFToInt32* ins) + explicit OutOfLineTruncateFloat32(LTruncateFToInt32* ins) : ins_(ins) { } diff --git a/js/src/wasm/WasmBaselineCompile.cpp b/js/src/wasm/WasmBaselineCompile.cpp index 03897e1d4fe0..08afc564d3ae 100644 --- a/js/src/wasm/WasmBaselineCompile.cpp +++ b/js/src/wasm/WasmBaselineCompile.cpp @@ -254,7 +254,7 @@ class BaseCompiler # ifdef DEBUG BaseCompiler& bc; public: - ScratchI32(BaseCompiler& bc) : bc(bc) { + explicit ScratchI32(BaseCompiler& bc) : bc(bc) { MOZ_ASSERT(!bc.scratchRegisterTaken()); bc.setScratchRegisterTaken(true); } @@ -264,7 +264,7 @@ class BaseCompiler } # else public: - ScratchI32(BaseCompiler& bc) {} + explicit ScratchI32(BaseCompiler& bc) {} # endif operator Register() const { # ifdef JS_CODEGEN_X86 diff --git a/python/mozbuild/mozpack/unify.py b/python/mozbuild/mozpack/unify.py index 2519beb9ce11..3c8a8d6057eb 100644 --- a/python/mozbuild/mozpack/unify.py +++ b/python/mozbuild/mozpack/unify.py @@ -22,6 +22,7 @@ import struct import os import re import subprocess +import buildconfig from collections import OrderedDict # Regular expressions for unifying install.rdf @@ -80,7 +81,8 @@ class UnifiedExecutableFile(BaseFile): os.close(fd) tmpfiles.append(f) e.copy(f, skip_if_older=False) - subprocess.call(['lipo', '-create'] + tmpfiles + ['-output', dest]) + lipo = buildconfig.substs.get('LIPO') or 'lipo' + subprocess.call([lipo, '-create'] + tmpfiles + ['-output', dest]) finally: for f in tmpfiles: os.unlink(f) diff --git a/taskcluster/ci/build/macosx.yml b/taskcluster/ci/build/macosx.yml index 7e7fb79d420e..72e563cd0a5d 100644 --- a/taskcluster/ci/build/macosx.yml +++ b/taskcluster/ci/build/macosx.yml @@ -44,3 +44,27 @@ macosx64/opt: script: "mozharness/scripts/fx_desktop_build.py" secrets: true tooltool-downloads: internal + +macosx64-universal/opt: + description: "MacOS X Universal Cross-compile" + index: + product: firefox + job-name: macosx64-opt + treeherder: + platform: osx-10-7/opt + symbol: tc(Bu) + tier: 2 + worker-type: aws-provisioner-v1/gecko-{level}-b-macosx64 + worker: + implementation: docker-worker + max-run-time: 36000 + run: + using: mozharness + actions: [get-secrets build generate-build-stats update] + config: + - builds/releng_base_mac_64_cross_builds.py + - balrog/production.py + script: "mozharness/scripts/fx_desktop_build.py" + secrets: true + custom-build-variant-cfg: cross-universal + tooltool-downloads: internal diff --git a/testing/mozharness/configs/builds/releng_sub_mac_configs/64_cross_universal.py b/testing/mozharness/configs/builds/releng_sub_mac_configs/64_cross_universal.py new file mode 100644 index 000000000000..c399b4f4d594 --- /dev/null +++ b/testing/mozharness/configs/builds/releng_sub_mac_configs/64_cross_universal.py @@ -0,0 +1,4 @@ +config = { + 'objdir': 'obj-firefox/x86_64', + 'src_mozconfig': 'browser/config/mozconfigs/macosx-universal/nightly', +} diff --git a/testing/mozharness/mozharness/mozilla/building/buildbase.py b/testing/mozharness/mozharness/mozilla/building/buildbase.py index 127603c60d7b..a40cd81a7c03 100755 --- a/testing/mozharness/mozharness/mozilla/building/buildbase.py +++ b/testing/mozharness/mozharness/mozilla/building/buildbase.py @@ -349,6 +349,7 @@ class BuildOptionParser(object): 'tsan': 'builds/releng_sub_%s_configs/%s_tsan.py', 'cross-debug': 'builds/releng_sub_%s_configs/%s_cross_debug.py', 'cross-opt': 'builds/releng_sub_%s_configs/%s_cross_opt.py', + 'cross-universal': 'builds/releng_sub_%s_configs/%s_cross_universal.py', 'debug': 'builds/releng_sub_%s_configs/%s_debug.py', 'asan-and-debug': 'builds/releng_sub_%s_configs/%s_asan_and_debug.py', 'asan-tc-and-debug': 'builds/releng_sub_%s_configs/%s_asan_tc_and_debug.py', diff --git a/toolkit/mozapps/installer/packager.py b/toolkit/mozapps/installer/packager.py index d61475eb8833..f2dc3fac661e 100644 --- a/toolkit/mozapps/installer/packager.py +++ b/toolkit/mozapps/installer/packager.py @@ -325,7 +325,7 @@ def main(): # native architecture. args.source, args.unify = sorted([args.source, args.unify], key=is_native, reverse=True) - if is_native(args.source): + if is_native(args.source) and not buildconfig.substs['CROSS_COMPILE']: launcher.tooldir = args.source elif not buildconfig.substs['CROSS_COMPILE']: launcher.tooldir = mozpath.join(buildconfig.topobjdir, 'dist')