Bug 1183613 - Cross compile universal OSX builds in Taskcluster; r=froydnj,ted

MozReview-Commit-ID: HNTqiVF9gov

--HG--
extra : rebase_source : 3e02cd433e45f4bb5759f093aaccade2d49745c3
This commit is contained in:
Mike Shal 2016-10-21 13:54:10 -04:00
parent 64d13141fe
commit ad4478f15e
14 changed files with 57 additions and 17 deletions

View File

@ -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

View File

@ -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", :)

View File

@ -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

View File

@ -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<typename T>
class AutoReleased
{
public:
AutoReleased(T aTypeRef) : mTypeRef(aTypeRef)
MOZ_IMPLICIT AutoReleased(T aTypeRef) : mTypeRef(aTypeRef)
{
}
~AutoReleased()

View File

@ -507,7 +507,7 @@ class CodeOffsetJump
return jumpTableIndex_;
}
#else
CodeOffsetJump(size_t offset) : offset_(offset) {}
explicit CodeOffsetJump(size_t offset) : offset_(offset) {}
#endif
CodeOffsetJump() {

View File

@ -71,7 +71,7 @@ class RelocationIterator
uint32_t offset_;
public:
RelocationIterator(CompactBufferReader& reader)
explicit RelocationIterator(CompactBufferReader& reader)
: reader_(reader)
{ }

View File

@ -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))
{ }
};

View File

@ -736,7 +736,7 @@ class OutOfLineTruncate : public OutOfLineCodeBase<CodeGeneratorX86>
LTruncateDToInt32* ins_;
public:
OutOfLineTruncate(LTruncateDToInt32* ins)
explicit OutOfLineTruncate(LTruncateDToInt32* ins)
: ins_(ins)
{ }
@ -753,7 +753,7 @@ class OutOfLineTruncateFloat32 : public OutOfLineCodeBase<CodeGeneratorX86>
LTruncateFToInt32* ins_;
public:
OutOfLineTruncateFloat32(LTruncateFToInt32* ins)
explicit OutOfLineTruncateFloat32(LTruncateFToInt32* ins)
: ins_(ins)
{ }

View File

@ -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

View File

@ -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)

View File

@ -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

View File

@ -0,0 +1,4 @@
config = {
'objdir': 'obj-firefox/x86_64',
'src_mozconfig': 'browser/config/mozconfigs/macosx-universal/nightly',
}

View File

@ -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',

View File

@ -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')