gecko-dev/build/macosx/cross-mozconfig.common

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

52 строки
2.2 KiB
Plaintext
Исходник Обычный вид История

# 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"
# cctools for ld, ar, and other related tools ; dsymutil for rust.
mk_add_options "export PATH=$topsrcdir/cctools/bin:$topsrcdir/binutils/bin:$topsrcdir/llvm-dsymutil/bin:$PATH"
# ld needs libLTO.so from llvm
mk_add_options "export LD_LIBRARY_PATH=$topsrcdir/clang/lib"
# 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`.
CROSS_SYSROOT=$topsrcdir/MacOSX10.11.sdk
CROSS_PRIVATE_FRAMEWORKS=$CROSS_SYSROOT/System/Library/PrivateFrameworks
export CC="$topsrcdir/clang/bin/clang"
export CXX="$topsrcdir/clang/bin/clang++"
export CFLAGS="$CFLAGS -fcrash-diagnostics-dir=${UPLOAD_PATH}"
export CXXFLAGS="$CXXFLAGS -fcrash-diagnostics-dir=${UPLOAD_PATH}"
export LLVMCONFIG=$topsrcdir/clang/bin/llvm-config
export BINDGEN_CFLAGS="-isysroot $CROSS_SYSROOT"
export DSYMUTIL=$topsrcdir/build/macosx/llvm-dsymutil
mk_add_options "export REAL_DSYMUTIL=$topsrcdir/llvm-dsymutil/bin/dsymutil"
export MKFSHFS=$topsrcdir/hfsplus-tools/newfs_hfs
export DMG_TOOL=$topsrcdir/dmg/dmg
export HFS_TOOL=$topsrcdir/dmg/hfsplus
export HOST_CFLAGS="-g"
export HOST_CXXFLAGS="-g"
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
export MACOS_SDK_DIR=$CROSS_SYSROOT
export MACOS_PRIVATE_FRAMEWORKS_DIR=$CROSS_PRIVATE_FRAMEWORKS
if [ "x$MOZ_PKG_SPECIAL" != "xasan" -a -z "$MOZ_AUTOMATION_ARTIFACT_BUILDS" ]; then
# Enable static analysis checks by default on OSX cross builds.
# Exception is ASan, where this breaks.
# The option is not valid on artifact builds, so don't add it there either.
ac_add_options --enable-clang-plugin
fi
unset MOZ_STDCXX_COMPAT