[tbb-commits] [tor-browser-bundle/master] Bug 21753: Replace our old GCC toolchain in PT descriptor
gk at torproject.org
gk at torproject.org
Wed Apr 5 09:05:42 UTC 2017
commit 2fe7170ac1f07b051fa69183b7dc852a62d4f9be
Author: Georg Koppen <gk at torproject.org>
Date: Thu Mar 16 18:05:06 2017 +0000
Bug 21753: Replace our old GCC toolchain in PT descriptor
The GCC toolchain is pretty old and it is risky relying on it. We replace
it with our clang/cctools-based one which is already used almost
everywhere when cross-compiling for macOS.
---
.../mac/gitian-pluggable-transports.yml | 27 +++++++++++++---------
1 file changed, 16 insertions(+), 11 deletions(-)
diff --git a/gitian/descriptors/mac/gitian-pluggable-transports.yml b/gitian/descriptors/mac/gitian-pluggable-transports.yml
index 5f47b47..c6846cc 100644
--- a/gitian/descriptors/mac/gitian-pluggable-transports.yml
+++ b/gitian/descriptors/mac/gitian-pluggable-transports.yml
@@ -4,7 +4,7 @@ distro: "debian"
suites:
- "wheezy"
architectures:
-- "i386"
+- "amd64"
packages:
- "unzip"
- "zip"
@@ -28,8 +28,9 @@ files:
- "versions"
- "go14.tar.gz"
- "go.tar.gz"
+- "clang-linux64-wheezy-utils.zip"
+- "cctools.tar.gz"
- "MacOSX10.7.sdk.tar.gz"
-- "multiarch-darwin11-cctools127.2-gcc42-5666.3-llvmgcc42-2336.1-Linux-120724.tar.xz"
- "dzip.sh"
script: |
INSTDIR="$HOME/install"
@@ -44,7 +45,6 @@ script: |
DOCSDIR="$TBDIR/TorBrowser/Docs"
TORBINDIR="$TBDIR/TorBrowser/Tor"
fi
- export LIBRARY_PATH="$INSTDIR/lib"
export REFERENCE_DATETIME
export TZ=UTC
export LC_ALL=C
@@ -53,14 +53,19 @@ script: |
mkdir -p $PTDIR/
mkdir -p $OUTDIR/
#
- tar xaf multiarch-darwin*tar.xz
+ tar xaf cctools.tar.gz
+ unzip clang-linux64-wheezy-utils.zip
# The 10.7 SDK is needed for Go: https://bugs.torproject.org/20023#comment:6
tar xaf MacOSX10.7.sdk.tar.gz
- export PATH="$PATH:$HOME/build/apple-osx/bin/"
- #
- export AR=$HOME/build/apple-osx/bin/i686-apple-darwin11-ar
- export CC=$HOME/build/apple-osx/bin/i686-apple-darwin11-gcc
- export CXX=$HOME/build/apple-osx/bin/i686-apple-darwin11-g++
+ # Preparing clang for cross-compilation, setting the proper flags and
+ # variables
+ # ld needs libLTO.so from llvm
+ export LD_LIBRARY_PATH="$HOME/build/clang/lib"
+ export PATH="$HOME/build/cctools/bin:$PATH"
+ CROSS_CCTOOLS_PATH="$HOME/build/cctools"
+ CROSS_SYSROOT="$HOME/build/MacOSX10.7.sdk"
+ FLAGS="-target x86_64-apple-darwin10 -mlinker-version=136 -B $CROSS_CCTOOLS_PATH/bin -isysroot $CROSS_SYSROOT"
+ export CC="$HOME/build/clang/bin/clang $FLAGS"
# Building go 1.4.x
# This is needed to bootstrap the go that we actually use
@@ -80,12 +85,12 @@ script: |
# https://github.com/golang/go/issues/15457
CC_FOR_TARGET="$(pwd)/cc-for-target"
echo "#!/bin/sh" > "$CC_FOR_TARGET"
- echo "exec $CC $CFLAGS $LDFLAGS -isysroot $HOME/build/MacOSX10.7.sdk -std=gnu99 \"\$@\"" >> "$CC_FOR_TARGET"
+ echo "exec $CC $CFLAGS $LDFLAGS \"\$@\"" >> "$CC_FOR_TARGET"
chmod +x "$CC_FOR_TARGET"
# http://golang.org/doc/install/source#environment
export GOPATH="$HOME/go"
export GOOS=darwin
- export GOARCH=386
+ export GOARCH=amd64
tar xvf go.tar.gz
cd go/src
# Remove a preprocessor directive that causes problems when building with the 10.7 SDK.
More information about the tbb-commits
mailing list