2015-07-14 14:02:22 +03:00
|
|
|
# This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
|
|
|
|
MOZ_AUTOMATION_L10N_CHECK=0
|
|
|
|
|
|
|
|
. "$topsrcdir/build/mozconfig.common"
|
|
|
|
|
2018-12-13 08:45:01 +03:00
|
|
|
# cctools for ld, ar, and other related tools ; dsymutil for rust.
|
2019-03-14 00:37:27 +03:00
|
|
|
mk_add_options "export PATH=$topsrcdir/cctools/bin:$topsrcdir/binutils/bin:$topsrcdir/llvm-dsymutil/bin:$PATH"
|
2018-08-23 07:07:36 +03:00
|
|
|
|
2015-07-14 14:02:22 +03:00
|
|
|
# ld needs libLTO.so from llvm
|
|
|
|
mk_add_options "export LD_LIBRARY_PATH=$topsrcdir/clang/lib"
|
|
|
|
|
2016-12-08 02:11:40 +03:00
|
|
|
# This SDK was copied from a local XCode install and uploaded to tooltool.
|
|
|
|
# Generate the tarball by running this command with the proper SDK version:
|
|
|
|
# sdk_path=$(xcrun --sdk macosx10.12 --show-sdk-path)
|
|
|
|
# tar -C $(dirname ${sdk_path}) -cHjf /tmp/$(basename ${sdk_path}).tar.bz2 $(basename ${sdk_path})
|
|
|
|
# Upload the resulting tarball from /tmp to tooltool, and change the entry in
|
|
|
|
# `browser/config/tooltool-manifests/macosx64/cross-releng.manifest`.
|
2017-09-08 22:49:13 +03:00
|
|
|
CROSS_SYSROOT=$topsrcdir/MacOSX10.11.sdk
|
2015-07-14 14:02:22 +03:00
|
|
|
CROSS_PRIVATE_FRAMEWORKS=$CROSS_SYSROOT/System/Library/PrivateFrameworks
|
|
|
|
|
2018-12-13 08:51:07 +03:00
|
|
|
export CC="$topsrcdir/clang/bin/clang"
|
|
|
|
export CXX="$topsrcdir/clang/bin/clang++"
|
2019-01-22 22:27:13 +03:00
|
|
|
export CFLAGS="$CFLAGS -fcrash-diagnostics-dir=${UPLOAD_PATH}"
|
|
|
|
export CXXFLAGS="$CXXFLAGS -fcrash-diagnostics-dir=${UPLOAD_PATH}"
|
2015-07-14 14:02:22 +03:00
|
|
|
export LLVMCONFIG=$topsrcdir/clang/bin/llvm-config
|
2018-12-13 08:51:07 +03:00
|
|
|
export BINDGEN_CFLAGS="-isysroot $CROSS_SYSROOT"
|
2018-01-19 04:20:41 +03:00
|
|
|
export DSYMUTIL=$topsrcdir/build/macosx/llvm-dsymutil
|
2018-08-31 16:25:27 +03:00
|
|
|
mk_add_options "export REAL_DSYMUTIL=$topsrcdir/llvm-dsymutil/bin/dsymutil"
|
2017-01-31 01:32:32 +03:00
|
|
|
export MKFSHFS=$topsrcdir/hfsplus-tools/newfs_hfs
|
2015-09-10 13:44:24 +03:00
|
|
|
export DMG_TOOL=$topsrcdir/dmg/dmg
|
2017-01-31 01:32:32 +03:00
|
|
|
export HFS_TOOL=$topsrcdir/dmg/hfsplus
|
2015-07-14 14:02:22 +03:00
|
|
|
|
2015-09-11 13:48:50 +03:00
|
|
|
export HOST_CFLAGS="-g"
|
|
|
|
export HOST_CXXFLAGS="-g"
|
2015-07-14 14:02:22 +03:00
|
|
|
export HOST_LDFLAGS="-g"
|
|
|
|
|
Bug 1551690 - be more specific about the LLVM target on OS X; r=nalexander
Our current OS X builds use `--target=x86_64-darwin11` (which
corresponds to OS X 10.7). This target is problematic for two reasons:
* We're actually targeting for OS X 10.9 (`MACOSX_DEPLOYMENT_TARGET`);
* It's slightly different from the default Rust target.
Let's address these problems in reverse order: differences from the Rust
target are bad, because the `--target` we provide to `clang` and the
Rust target find their way into LLVM bitcode files and the linker will
refuse to link together bitcode files that have incompatible targets.
Why are the two incompatible? The current `--target` doesn't have a
"vendor" in triple-speak, whereas the Rust one has "apple" as the
vendor (`x86_64-apple-darwin`) We therefore need to change the
`--target` we pass to `clang` to have a vendor of "apple".
This need is behind the {init,toolchain}.configure changes,
but it has ramifications elsewhere, because `clang` looks for
`--target`-prefixed build tools. So we have to change the `--target`
for cctools to get the right tool prefixes and we have to change the
`--target` for building clang ourselves so that *those* builds can find
the newly renamed cctools.
Once we've done, that's really enough; we don't *need to address the
first problem: While the `--target` might be `x86_64-apple-darwin11`,
both `clang` and `rustc` will dynamically choose the target triple that
eventually lands in LLVM bitcode files based on
`MACOSX_DEPLOYMENT_TARGET`, which we set in all builds. But the current
target is slightly misleading, and the cctools don't need to be prefixed
with a particular Darwin version, since they work for all Darwin
targets. Let's just drop the "11" from the `--target` and eliminate a
little bit of confusion.
Differential Revision: https://phabricator.services.mozilla.com/D31128
--HG--
extra : moz-landing-system : lando
2019-05-21 20:53:44 +03:00
|
|
|
ac_add_options --target=x86_64-apple-darwin
|
2018-12-20 21:50:04 +03:00
|
|
|
export MACOS_SDK_DIR=$CROSS_SYSROOT
|
|
|
|
export MACOS_PRIVATE_FRAMEWORKS_DIR=$CROSS_PRIVATE_FRAMEWORKS
|
2015-07-14 14:02:22 +03:00
|
|
|
|
2017-10-26 23:04:54 +03:00
|
|
|
if [ "x$MOZ_PKG_SPECIAL" != "xasan" -a -z "$MOZ_AUTOMATION_ARTIFACT_BUILDS" ]; then
|
2017-02-10 19:10:23 +03:00
|
|
|
# Enable static analysis checks by default on OSX cross builds.
|
|
|
|
# Exception is ASan, where this breaks.
|
2017-10-26 23:04:54 +03:00
|
|
|
# The option is not valid on artifact builds, so don't add it there either.
|
2017-02-10 19:10:23 +03:00
|
|
|
ac_add_options --enable-clang-plugin
|
|
|
|
fi
|
2019-03-14 01:24:20 +03:00
|
|
|
|
|
|
|
unset MOZ_STDCXX_COMPAT
|