[tbb-commits] [tor-browser-build/master] Bug 30323: Adapt macOS toolchain for esr68

boklm at torproject.org boklm at torproject.org
Wed Aug 21 09:05:43 UTC 2019


commit 1877dbbdf499e51beb6dd5be2d53e74f57428130
Author: Georg Koppen <gk at torproject.org>
Date:   Mon Aug 19 18:18:22 2019 +0000

    Bug 30323: Adapt macOS toolchain for esr68
    
    There are already included some simplifications as done in
    https://bugzilla.mozilla.org/show_bug.cgi?id=1513798 but not all of them
    as some break our current setup. This needs to get investigated in a
    different bug.
---
 projects/firefox/build                | 48 +++++++++++++++--------------------
 projects/firefox/config               |  1 -
 projects/firefox/mozconfig-osx-x86_64 | 15 +++++------
 projects/macosx-toolchain/build       |  7 ++---
 projects/macosx-toolchain/config      |  4 +--
 5 files changed, 31 insertions(+), 44 deletions(-)

diff --git a/projects/firefox/build b/projects/firefox/build
index 18db7b9..5d4d2a3 100644
--- a/projects/firefox/build
+++ b/projects/firefox/build
@@ -52,24 +52,23 @@ EOF
   wine wineboot -i
 [% END -%]
 
+mkdir -p /var/tmp/dist
+tar -C /var/tmp/dist -xf [% c('input_files_by_name/rust') %]
+tar -C /var/tmp/dist -xf [% c('input_files_by_name/cbindgen') %]
+tar -C /var/tmp/dist -xf [% c('input_files_by_name/nasm') %]
+tar -C /var/tmp/dist -xf [% c('input_files_by_name/python') %]
+tar -C /var/tmp/dist -xf [% c('input_files_by_name/node') %]
+export PATH="/var/tmp/dist/rust/bin:/var/tmp/dist/cbindgen:/var/tmp/dist/nasm/bin:/var/tmp/dist/python/bin:/var/tmp/dist/node/bin:$PATH"
+tar -C /var/tmp/dist -xf [% c('input_files_by_name/clang') %]
+export LLVM_CONFIG="/var/tmp/dist/clang/bin/llvm-config"
+
 [% IF c("var/linux") %]
-  mkdir -p /var/tmp/dist
   tar -C /var/tmp/dist -xf $rootdir/[% c('input_files_by_name/binutils') %]
-  tar -C /var/tmp/dist -xf $rootdir/[% c('input_files_by_name/python') %]
-  tar -C /var/tmp/dist -xf $rootdir/[% c('input_files_by_name/node') %]
-  export PATH="/var/tmp/dist/binutils/bin:/var/tmp/dist/python/bin:/var/tmp/dist/node/bin:$PATH"
+  export PATH="/var/tmp/dist/binutils/bin:$PATH"
   # Use clang for everything on Linux now.
-  tar -C /var/tmp/dist -xf [% c('input_files_by_name/clang') %]
-  export LLVM_CONFIG="/var/tmp/dist/clang/bin/llvm-config"
   export PATH="/var/tmp/dist/clang/bin:$PATH"
 [% END -%]
 
-mkdir -p /var/tmp/dist
-tar -C /var/tmp/dist -xf [% c('input_files_by_name/rust') %]
-tar -C /var/tmp/dist -xf [% c('input_files_by_name/cbindgen') %]
-tar -C /var/tmp/dist -xf [% c('input_files_by_name/nasm') %]
-export PATH="/var/tmp/dist/rust/bin:/var/tmp/dist/cbindgen:/var/tmp/dist/nasm/bin:$PATH"
-
 tar -C /var/tmp/build -xf [% project %]-[% c('version') %].tar.gz
 
 [% IF c("var/osx") %]
@@ -226,27 +225,22 @@ cp -p config/createprecomplete.py $MARTOOLS/
 cp -p tools/update-packaging/*.sh $MARTOOLS/
 cp -p obj-*/dist/host/bin/mar $MARTOOLS/
 cp -p obj-*/dist/host/bin/mbsdiff $MARTOOLS/
-[% IF c("var/linux") %]
+[% IF c("var/linux") || c("var/osx") %]
   cp -p obj-*/dist/bin/signmar $MARTOOLS/
   cp -p obj-*/dist/bin/certutil $MARTOOLS/
   cp -p obj-*/dist/bin/modutil $MARTOOLS/
   cp -p obj-*/dist/bin/pk12util $MARTOOLS/
   cp -p obj-*/dist/bin/shlibsign $MARTOOLS/
-  NSS_LIBS="libfreeblpriv3.so libmozsqlite3.so libnss3.so libnssckbi.so libnssdbm3.so libnssutil3.so libsmime3.so libsoftokn3.so libssl3.so"
-  NSPR_LIBS="libnspr4.so libplc4.so libplds4.so"
+  [% IF c("var/linux") %]
+    NSS_LIBS="libfreeblpriv3.so libmozsqlite3.so libnss3.so libnssckbi.so libnssdbm3.so libnssutil3.so libsmime3.so libsoftokn3.so libssl3.so"
+    NSPR_LIBS="libnspr4.so libplc4.so libplds4.so"
+  [% ELSE %]
+    NSS_LIBS="libfreebl3.dylib libmozglue.dylib libnss3.dylib libnssckbi.dylib libnssdbm3.dylib libsoftokn3.dylib"
+    # No NSPR_LIBS for macOS
+    NSPR_LIBS=""
+  [% END %]
   for LIB in $NSS_LIBS $NSPR_LIBS; do
-      cp -p obj-*/dist/bin/$LIB $MARTOOLS/
-  done
-[% END %]
-[% IF c("var/osx") %]
-  cp -p obj-*/modules/libmar/tool/signmar $MARTOOLS/
-  cp -p obj-*/security/nss/cmd/certutil/certutil_certutil/certutil $MARTOOLS/
-  cp -p obj-*/security/nss/cmd/modutil/modutil_modutil/modutil $MARTOOLS/
-  cp -p obj-*/security/nss/cmd/pk12util/pk12util_pk12util/pk12util $MARTOOLS/
-  cp -p obj-*/security/nss/cmd/shlibsign/shlibsign_shlibsign/shlibsign $MARTOOLS/
-  NSS_LIBS="libfreebl3.dylib libmozglue.dylib libnss3.dylib libnssckbi.dylib libnssdbm3.dylib libsoftokn3.dylib"
-  for LIB in $NSS_LIBS; do
-      cp -p obj-*/dist/bin/$LIB $MARTOOLS/
+    cp -p obj-*/dist/bin/$LIB $MARTOOLS/
   done
 [% END %]
 [% IF c("var/windows") %]
diff --git a/projects/firefox/config b/projects/firefox/config
index a481815..a1073d5 100644
--- a/projects/firefox/config
+++ b/projects/firefox/config
@@ -152,7 +152,6 @@ input_files:
     name: python
   - project: clang
     name: clang
-    enable: '[% c("var/linux") %]'
   - project: fxc2
     name: fxc2
     enable: '[% c("var/windows") %]'
diff --git a/projects/firefox/mozconfig-osx-x86_64 b/projects/firefox/mozconfig-osx-x86_64
index a87bf35..5d82d12 100644
--- a/projects/firefox/mozconfig-osx-x86_64
+++ b/projects/firefox/mozconfig-osx-x86_64
@@ -11,21 +11,18 @@ FLAGS="-target x86_64-apple-darwin11 -B $CROSS_CCTOOLS_PATH/bin -isysroot $CROSS
 
 export CC="$TOOLCHAIN_DIR/clang/bin/clang $FLAGS"
 export CXX="$TOOLCHAIN_DIR/clang/bin/clang++ $FLAGS"
-export CPP="$TOOLCHAIN_DIR/clang/bin/clang $FLAGS -E"
 export LLVMCONFIG=$TOOLCHAIN_DIR/clang/bin/llvm-config
-export LDFLAGS="-Wl,-syslibroot,$CROSS_SYSROOT -Wl,-dead_strip -Wl,-pie"
+export LDFLAGS="-Wl,-syslibroot,$CROSS_SYSROOT -Wl,-pie"
 export BINDGEN_CFLAGS="$FLAGS"
 export TOOLCHAIN_PREFIX=$CROSS_CCTOOLS_PATH/bin/x86_64-apple-darwin11-
-export DSYMUTIL="$TOOLCHAIN_DIR/clang/bin/llvm-dsymutil"
+export DSYMUTIL="$TOOLCHAIN_DIR/clang/bin/dsymutil"
 
-export HOST_CC="$TOOLCHAIN_DIR/clang/bin/clang"
-export HOST_CXX="$TOOLCHAIN_DIR/clang/bin/clang++"
-export HOST_CPP="$TOOLCHAIN_DIR/clang/bin/clang -E"
 export HOST_CFLAGS="-g"
 export HOST_CXXFLAGS="-g"
 export HOST_LDFLAGS="-g"
 
-ac_add_options --target=x86_64-apple-darwin
+ac_add_options --target=x86_64-apple-darwin11
+ac_add_options --with-macos-sdk=$CROSS_SYSROOT
 ac_add_options --with-macos-private-frameworks=$CROSS_PRIVATE_FRAMEWORKS
 
 mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/obj-macos
@@ -41,14 +38,14 @@ ac_add_options --enable-optimize
 ac_add_options --disable-debug
 
 ac_add_options --enable-tor-browser-data-outside-app-dir
-ac_add_options --enable-tor-browser-update
+#ac_add_options --enable-tor-browser-update
 ac_add_options --enable-signmar
 ac_add_options --enable-verify-mar
 
 ac_add_options --disable-crashreporter
-ac_add_options --disable-maintenance-service
 ac_add_options --disable-webrtc
 ac_add_options --disable-tests
 # Let's make sure no preference is enabling either Adobe's or Google's CDM.
 ac_add_options --disable-eme
+ac_add_options --enable-proxy-bypass-protection
 # ac_add_options --disable-ctypes
diff --git a/projects/macosx-toolchain/build b/projects/macosx-toolchain/build
index d1d8c34..c9cd282 100644
--- a/projects/macosx-toolchain/build
+++ b/projects/macosx-toolchain/build
@@ -4,15 +4,12 @@ distdir="/var/tmp/dist/[% project %]"
 mkdir -p "$distdir"
 tar xjf [% c('input_files_by_name/SDK') %]
 mv MacOSX10.11.sdk "$distdir/SDK"
-tar xf [% c('input_files_by_name/llvm') %]
-mv llvm "$distdir/clang"
+tar xf [% c('input_files_by_name/clang') %]
+mv clang "$distdir/clang"
 tar -C $distdir -xf [% c('input_files_by_name/cctools') %]
 cd $distdir/cctools/bin
 ln -s ../../clang/bin/clang x86_64-apple-darwin11-clang
 ln -s ../../clang/bin/clang++ x86_64-apple-darwin11-clang++
-# "go link", libevent, and the jemalloc cross-compilation during the Rust build
-# expect to find a program called "dsymutil" exactly.
-ln -s ../../clang/bin/llvm-dsymutil dsymutil
 
 cd "/var/tmp/dist"
 [% c('tar', {
diff --git a/projects/macosx-toolchain/config b/projects/macosx-toolchain/config
index 8502f57..57e471f 100644
--- a/projects/macosx-toolchain/config
+++ b/projects/macosx-toolchain/config
@@ -17,8 +17,8 @@ var:
 
 input_files:
   - project: container-image
-  - name: llvm
-    project: llvm
+  - name: clang
+    project: clang
   - name: cctools
     project: cctools
   - name: SDK



More information about the tbb-commits mailing list