[tbb-commits] [tor-browser-build/master] Build go for OSX using the clang based toolchain

boklm at torproject.org boklm at torproject.org
Thu Apr 6 13:43:01 UTC 2017


commit a8d3b0b4e1dbbaffea0139eb1f128d2429eecc02
Author: Nicolas Vigier <boklm at torproject.org>
Date:   Mon Apr 3 15:56:36 2017 +0200

    Build go for OSX using the clang based toolchain
    
    Doing the changes corresponding to #21753.
---
 projects/go/build  | 7 +++++--
 projects/go/config | 8 +-------
 2 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/projects/go/build b/projects/go/build
index 72117f6..2f87bf5 100644
--- a/projects/go/build
+++ b/projects/go/build
@@ -38,16 +38,19 @@ cd /var/tmp/dist/go/src
 [% IF c("var/linux") -%]
   ./make.bash
 [% ELSIF c("var/osx") -%]
+  unset LDFLAGS
+  rm -Rf $clangdir/helpers
+  export CC="$clangdir/bin/clang [% c("var/FLAGS") %]"
   # Create a cc-for-target script that closes over CC, CFLAGS, and LDFLAGS.
   # Go's CC_FOR_TARGET only allows a command name, not a command with arguments.
   # 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 -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 GOOS=darwin
-  export GOARCH=386
+  export GOARCH=amd64
   # Remove a preprocessor directive that causes problems when building with the 10.7 SDK.
   # https://github.com/golang/go/issues/17732
   sed -i -e '/^#cgo CFLAGS:/s/-D__MAC_OS_X_VERSION_MAX_ALLOWED=1060//' crypto/x509/root_cgo_darwin.go
diff --git a/projects/go/config b/projects/go/config
index 870dc50..dbd7aab 100644
--- a/projects/go/config
+++ b/projects/go/config
@@ -56,14 +56,8 @@ targets:
       GOARCH: 386
   osx-x86_64:
     var:
-      arch_deps:
-        - libc6-i386
-        - libstdc++6:i386
-      pre_pkginst: dpkg --add-architecture i386
-      compiler: macosx-toolchain-gcc
-      10_7_SDK: 1
       GOOS: darwin
-      GOARCH: 386
+      GOARCH: amd64
   linux:
     var:
       GOOS: linux





More information about the tbb-commits mailing list