Bug 1513798 - Use x86_64-darwin11 as a prefix for cctools-port, rather than x86_64-apple-darwin11. r=nalexander

This matches more closely cross toolchains prefixes (as can be seen in
e.g. media/libvpx/libvpx/README for x86_64-darwin*-gcc), and leaves it
to the build system to figure out the right --target to pass to clang on
its own.

Differential Revision: https://phabricator.services.mozilla.com/D14376
This commit is contained in:
Mike Hommey 2018-12-13 14:29:29 +09:00
parent 76a8b9932a
commit b0360b6b16
9 changed files with 19 additions and 19 deletions

View File

@ -247,7 +247,7 @@ def build_one_stage(cc, cxx, asm, ld, ar, ranlib, libtool,
"-DCMAKE_OSX_ARCHITECTURES=x86_64",
"-DDARWIN_osx_ARCHS=x86_64",
"-DDARWIN_osx_SYSROOT=%s" % slashify_path(os.getenv("CROSS_SYSROOT")),
"-DLLVM_DEFAULT_TARGET_TRIPLE=x86_64-apple-darwin11"
"-DLLVM_DEFAULT_TARGET_TRIPLE=x86_64-darwin11"
]
return cmake_args
@ -704,7 +704,7 @@ if __name__ == "__main__":
extra_cxxflags = ["-stdlib=libc++"]
extra_cxxflags2 = ["-stdlib=libc++"]
extra_flags = ["-target", "x86_64-apple-darwin11", "-mlinker-version=137",
extra_flags = ["-target", "x86_64-darwin11", "-mlinker-version=137",
"-B", "%s/bin" % os.getenv("CROSS_CCTOOLS_PATH"),
"-isysroot", os.getenv("CROSS_SYSROOT"),
# technically the sysroot flag there should be enough to deduce this,

View File

@ -16,9 +16,9 @@
"cc": "/builds/worker/workspace/build/src/clang/bin/clang",
"cxx": "/builds/worker/workspace/build/src/clang/bin/clang++",
"as": "/builds/worker/workspace/build/src/clang/bin/clang",
"ar": "/builds/worker/workspace/build/src/cctools/bin/x86_64-apple-darwin11-ar",
"ranlib": "/builds/worker/workspace/build/src/cctools/bin/x86_64-apple-darwin11-ranlib",
"libtool": "/builds/worker/workspace/build/src/cctools/bin/x86_64-apple-darwin11-libtool",
"ar": "/builds/worker/workspace/build/src/cctools/bin/x86_64-darwin11-ar",
"ranlib": "/builds/worker/workspace/build/src/cctools/bin/x86_64-darwin11-ranlib",
"libtool": "/builds/worker/workspace/build/src/cctools/bin/x86_64-darwin11-libtool",
"ld": "/builds/worker/workspace/build/src/clang/bin/clang",
"patches": [
"static-llvm-symbolizer.patch",

View File

@ -16,9 +16,9 @@
"cc": "/builds/worker/workspace/build/src/clang/bin/clang",
"cxx": "/builds/worker/workspace/build/src/clang/bin/clang++",
"as": "/builds/worker/workspace/build/src/clang/bin/clang",
"ar": "/builds/worker/workspace/build/src/cctools/bin/x86_64-apple-darwin11-ar",
"ranlib": "/builds/worker/workspace/build/src/cctools/bin/x86_64-apple-darwin11-ranlib",
"libtool": "/builds/worker/workspace/build/src/cctools/bin/x86_64-apple-darwin11-libtool",
"ar": "/builds/worker/workspace/build/src/cctools/bin/x86_64-darwin11-ar",
"ranlib": "/builds/worker/workspace/build/src/cctools/bin/x86_64-darwin11-ranlib",
"libtool": "/builds/worker/workspace/build/src/cctools/bin/x86_64-darwin11-libtool",
"ld": "/builds/worker/workspace/build/src/clang/bin/clang",
"patches": [
]

View File

@ -1,4 +1,4 @@
Add `-target x86_64-apple-darwin11' to the compiler-rt overridden CFLAGS
Add `-target x86_64-darwin11' to the compiler-rt overridden CFLAGS
diff --git a/compiler-rt/cmake/Modules/CompilerRTDarwinUtils.cmake b/compiler-rt/cmake/Modules/CompilerRTDarwinUtils.cmake
index 28d398672..aac68bf36 100644
@ -9,7 +9,7 @@ index 28d398672..aac68bf36 100644
set(DARWIN_EXCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/Darwin-excludes)
- set(CFLAGS "-fPIC -O3 -fvisibility=hidden -DVISIBILITY_HIDDEN -Wall -fomit-frame-pointer")
+ set(CFLAGS "-fPIC -O3 -fvisibility=hidden -DVISIBILITY_HIDDEN -Wall -fomit-frame-pointer -target x86_64-apple-darwin11 -isysroot ${CMAKE_OSX_SYSROOT} -I${CMAKE_OSX_SYSROOT}/usr/include")
+ set(CFLAGS "-fPIC -O3 -fvisibility=hidden -DVISIBILITY_HIDDEN -Wall -fomit-frame-pointer -target x86_64-darwin11 -isysroot ${CMAKE_OSX_SYSROOT} -I${CMAKE_OSX_SYSROOT}/usr/include")
set(CMAKE_C_FLAGS "")
set(CMAKE_CXX_FLAGS "")
set(CMAKE_ASM_FLAGS "")

View File

@ -21,7 +21,7 @@ CROSS_CCTOOLS_PATH=$topsrcdir/cctools
# `browser/config/tooltool-manifests/macosx64/cross-releng.manifest`.
CROSS_SYSROOT=$topsrcdir/MacOSX10.11.sdk
CROSS_PRIVATE_FRAMEWORKS=$CROSS_SYSROOT/System/Library/PrivateFrameworks
FLAGS="-target x86_64-apple-darwin11 -B $CROSS_CCTOOLS_PATH/bin -isysroot $CROSS_SYSROOT"
FLAGS="-B $CROSS_CCTOOLS_PATH/bin -isysroot $CROSS_SYSROOT"
export CC="$topsrcdir/clang/bin/clang $FLAGS"
export CXX="$topsrcdir/clang/bin/clang++ $FLAGS"
@ -29,7 +29,7 @@ export CPP="$topsrcdir/clang/bin/clang $FLAGS -E"
export LLVMCONFIG=$topsrcdir/clang/bin/llvm-config
export LDFLAGS="-Wl,-syslibroot,$CROSS_SYSROOT"
export BINDGEN_CFLAGS="$FLAGS"
export TOOLCHAIN_PREFIX=$CROSS_CCTOOLS_PATH/bin/x86_64-apple-darwin11-
export TOOLCHAIN_PREFIX=$CROSS_CCTOOLS_PATH/bin/x86_64-darwin11-
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

View File

@ -36,7 +36,7 @@ if [ "$TARGET" == "x86_64-apple-darwin" ]; then
export PATH="$PWD/cctools/bin:$PATH"
cat >cross-linker <<EOF
exec $PWD/clang/bin/clang -v \
-fuse-ld=$PWD/cctools/bin/x86_64-apple-darwin11-ld \
-fuse-ld=$PWD/cctools/bin/x86_64-darwin11-ld \
-mmacosx-version-min=10.11 \
-target $TARGET \
-B $PWD/cctools/bin \

View File

@ -23,7 +23,7 @@ CLANG_DIR=$WORKSPACE/build/src/clang
CCTOOLS_DIR=$WORKSPACE/build/src/cctools
MACOSX_SDK_DIR=$WORKSPACE/build/src/MacOSX10.11.sdk
TARGET_TRIPLE=x86_64-apple-darwin11
TARGET_TRIPLE=x86_64-darwin11
# Create our directories
mkdir -p $CROSSTOOLS_BUILD_DIR

View File

@ -42,15 +42,15 @@ export CC=$CLANG_DIR/bin/clang
export CXX=$CLANG_DIR/bin/clang++
export LDFLAGS="-lpthread -Wl,-rpath-link,$CLANG_DIR/lib"
./autogen.sh
./configure --prefix=$CROSSTOOLS_BUILD_DIR --target=x86_64-apple-darwin11 --with-llvm-config=$CLANG_DIR/bin/llvm-config
./configure --prefix=$CROSSTOOLS_BUILD_DIR --target=x86_64-darwin11 --with-llvm-config=$CLANG_DIR/bin/llvm-config
# Build cctools
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/dsymutil $CROSSTOOLS_BUILD_DIR/bin/x86_64-apple-darwin11-dsymutil
cp $CLANG_DIR/bin/dsymutil $CROSSTOOLS_BUILD_DIR/bin/x86_64-darwin11-dsymutil
# various build scripts based on cmake want to find `lipo` without a prefix
cp $CROSSTOOLS_BUILD_DIR/bin/x86_64-apple-darwin11-lipo $CROSSTOOLS_BUILD_DIR/bin/lipo
cp $CROSSTOOLS_BUILD_DIR/bin/x86_64-darwin11-lipo $CROSSTOOLS_BUILD_DIR/bin/lipo
# Put a tarball in the artifacts dir
mkdir -p $UPLOAD_DIR

View File

@ -14,7 +14,7 @@ export LD_LIBRARY_PATH=$WORKSPACE/build/src/clang/lib
export CC=$WORKSPACE/build/src/clang/bin/clang
export CXX=$WORKSPACE/build/src/clang/bin/clang++
export AR=$WORKSPACE/build/src/clang/bin/clang
export CFLAGS="-target x86_64-apple-darwin11 -mlinker-version=137 -B ${CROSS_CCTOOLS_PATH}/bin -isysroot ${CROSS_SYSROOT} -I${CROSS_SYSROOT}/usr/include -iframework ${CROSS_SYSROOT}/System/Library/Frameworks"
export CFLAGS="-target x86_64-darwin11 -mlinker-version=137 -B ${CROSS_CCTOOLS_PATH}/bin -isysroot ${CROSS_SYSROOT} -I${CROSS_SYSROOT}/usr/include -iframework ${CROSS_SYSROOT}/System/Library/Frameworks"
export CXXFLAGS="-stdlib=libc++ ${CFLAGS}"
export LDFLAGS="${CXXFLAGS} -Wl,-syslibroot,${CROSS_SYSROOT} -Wl,-dead_strip"
@ -34,7 +34,7 @@ cd $WORKSPACE/build/src
# The ninja templates used to bootstrap gn have hard-coded references to
# 'libtool', make sure we find the right one.
ln -s $CROSS_CCTOOLS_PATH/bin/x86_64-apple-darwin11-libtool $CROSS_CCTOOLS_PATH/bin/libtool
ln -s $CROSS_CCTOOLS_PATH/bin/x86_64-darwin11-libtool $CROSS_CCTOOLS_PATH/bin/libtool
export PATH=$CROSS_CCTOOLS_PATH/bin:$PATH
. taskcluster/scripts/misc/build-gn-common.sh