[tbb-commits] [tor-browser-build/master] Bug 30321: Linux changes for Firefox ESR 68

gk at torproject.org gk at torproject.org
Wed Aug 7 20:13:14 UTC 2019


commit c26b8196c90e908a83104c639865a2aca6598efe
Author: Georg Koppen <gk at torproject.org>
Date:   Wed Aug 7 20:12:43 2019 +0000

    Bug 30321: Linux changes for Firefox ESR 68
---
 projects/firefox/build                  | 40 ++++++++++++++++-----------------
 projects/firefox/config                 | 24 +++++++++++---------
 projects/firefox/mozconfig-linux-i686   | 23 +++++++++++--------
 projects/firefox/mozconfig-linux-x86_64 | 12 ++++++++--
 4 files changed, 56 insertions(+), 43 deletions(-)

diff --git a/projects/firefox/build b/projects/firefox/build
index e0870c1..18db7b9 100644
--- a/projects/firefox/build
+++ b/projects/firefox/build
@@ -55,18 +55,20 @@ EOF
 [% IF c("var/linux") %]
   mkdir -p /var/tmp/dist
   tar -C /var/tmp/dist -xf $rootdir/[% c('input_files_by_name/binutils') %]
-  export PATH="/var/tmp/dist/binutils/bin:$PATH"
+  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"
+  # 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') %]
-export PATH="/var/tmp/dist/rust/bin:$PATH"
-
-[% IF c("var/linux") %]
-  # Add llvm so stylo can build
-  tar -C /var/tmp/dist -xf [% c('input_files_by_name/llvm') %]
-  export LLVM_CONFIG="/var/tmp/dist/llvm/bin/llvm-config"
-[% END -%]
+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
 
@@ -135,12 +137,6 @@ fi
   export WIDL_TIME_OVERRIDE="0"
 [% END %]
 
-[% IF c("var/osname") == "linux-i686" -%]
-  export LDFLAGS=-m32
-  export CFLAGS=-m32
-  export CC='gcc -m32'
-[% END -%]
-
 [% IF c("var/windows") %]
   patch -p1 < $rootdir/nsis-uninstall.patch
 [% END -%]
@@ -159,8 +155,10 @@ fi
 rm -f configure
 rm -f js/src/configure
 
-./mach configure --with-tor-browser-version=[% c("var/torbrowser_version") %] --with-distribution-id=org.torproject --enable-update-channel=[% c("var/torbrowser_update_channel") %] --enable-bundled-fonts --with-branding=[% c("var/branding_directory") %]
-./mach build --verbose
+./mach configure --with-distribution-id=org.torproject --enable-bundled-fonts
+# Don't build with --verbose anymore or otherwise Stylo compilation breaks on
+# Linux. See: #30321 for details.
+./mach build
 
 [% IF c("var/android") %]
   # Building a multi-locale .apk
@@ -229,11 +227,11 @@ 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") %]
-  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/
+  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"
   for LIB in $NSS_LIBS $NSPR_LIBS; do
diff --git a/projects/firefox/config b/projects/firefox/config
index 14be6ef..3608a56 100644
--- a/projects/firefox/config
+++ b/projects/firefox/config
@@ -20,7 +20,9 @@ var:
     - zip
     - autoconf2.13
     - yasm
+      # XXX: for mach
     - python
+    - pkg-config
   container:
     use_container: 1
   # this should be updated when the list of gradle dependencies is changed
@@ -78,12 +80,8 @@ targets:
         - hardening-wrapper
         # To pass configure since ESR 31.
         - libpulse-dev
-        # To pass configure since ESR 45.
-        - libgconf2-dev
         # To pass configure since ESR 52
         - libx11-xcb-dev
-        # We built GCC but not the libmpc2, thus we need to install it
-        - libmpc2
 
   linux-i686:
     var:
@@ -94,15 +92,11 @@ targets:
         - libgtk-3-dev:i386
         - libdbus-glib-1-dev:i386
         - libxt-dev:i386
+        - hardening-wrapper
         # To pass configure since ESR 31.
         - libpulse-dev:i386
-        # To pass configure since ESR 45.
-        - libgconf2-dev:i386
         # To pass configure since ESR 52
         - libx11-xcb-dev:i386
-        # We built GCC but not the libmpc2, thus we need to install it
-        - libmpc2
-        - hardening-wrapper
 
   osx-x86_64:
     var:
@@ -148,8 +142,16 @@ input_files:
     enable: '[% c("var/windows") %]'
   - project: rust
     name: rust
-  - project: llvm
-    name: llvm
+  - project: cbindgen
+    name: cbindgen
+  - project: node
+    name: node
+  - project: nasm
+    name: nasm
+  - project: python
+    name: python
+  - project: clang
+    name: clang
     enable: '[% c("var/linux") %]'
   - project: fxc2
     name: fxc2
diff --git a/projects/firefox/mozconfig-linux-i686 b/projects/firefox/mozconfig-linux-i686
index ef952aa..ff65c87 100755
--- a/projects/firefox/mozconfig-linux-i686
+++ b/projects/firefox/mozconfig-linux-i686
@@ -6,15 +6,20 @@ mk_add_options MOZILLA_OFFICIAL=1
 export MOZILLA_OFFICIAL=1
 mk_add_options BUILD_OFFICIAL=1
 
-export CFLAGS=-m32
-export CXXFLAGS=-m32
-export LDFLAGS=-m32
-export XLDOPTS=-m32
-export ASFLAGS=-m32
-export BINDGEN_CFLAGS='-m32 --gcc-toolchain=/var/tmp/dist/gcc'
+# We want to build with clang now and point to the GCC toolchain until #29041 is
+# fixed. We explicitly need to define the host compiler as well as for some
+# reason the gcc-toolchain argument does not get passed along otherwise.
+CC="clang --gcc-toolchain=/var/tmp/dist/gcc"
+CXX="clang++ --gcc-toolchain=/var/tmp/dist/gcc"
+HOST_CC=$CC
+HOST_CXX=$CXX
+
+export BINDGEN_CFLAGS='--gcc-toolchain=/var/tmp/dist/gcc'
 
 ac_add_options --target=i686-linux-gnu
-ac_add_options --host=i686-linux-gnu
+
+# XXX: gold and lld break when linking libxul, resort to bfd
+ac_add_options --enable-linker=bfd
 
 ac_add_options --enable-optimize
 #ac_add_options --disable-optimize
@@ -23,7 +28,7 @@ ac_add_options --enable-official-branding
 # Let's support GTK3 for ESR60
 ac_add_options --enable-default-toolkit=cairo-gtk3
 
-ac_add_options --enable-tor-browser-update
+# XXX: ac_add_options --enable-tor-browser-update
 ac_add_options --enable-signmar
 ac_add_options --enable-verify-mar
 
@@ -31,9 +36,9 @@ ac_add_options --disable-strip
 ac_add_options --disable-install-strip
 ac_add_options --disable-tests
 ac_add_options --disable-debug
-ac_add_options --disable-maintenance-service
 ac_add_options --disable-crashreporter
 ac_add_options --disable-webrtc
 # 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/firefox/mozconfig-linux-x86_64 b/projects/firefox/mozconfig-linux-x86_64
index 75fba50..69dc4ef 100755
--- a/projects/firefox/mozconfig-linux-x86_64
+++ b/projects/firefox/mozconfig-linux-x86_64
@@ -6,6 +6,14 @@ mk_add_options MOZILLA_OFFICIAL=1
 export MOZILLA_OFFICIAL=1
 mk_add_options BUILD_OFFICIAL=1
 
+# We want to build with clang now and point to the GCC toolchain until #29041 is
+# fixed. We explicitly need to define the host compiler as well as for some
+# reason the gcc-toolchain argument does not get passed along otherwise.
+CC="clang --gcc-toolchain=/var/tmp/dist/gcc"
+CXX="clang++ --gcc-toolchain=/var/tmp/dist/gcc"
+HOST_CC=$CC
+HOST_CXX=$CXX
+
 export BINDGEN_CFLAGS='--gcc-toolchain=/var/tmp/dist/gcc'
 
 ac_add_options --enable-optimize
@@ -15,7 +23,7 @@ ac_add_options --enable-official-branding
 # Let's support GTK3 for ESR60
 ac_add_options --enable-default-toolkit=cairo-gtk3
 
-ac_add_options --enable-tor-browser-update
+# XXX: ac_add_options --enable-tor-browser-update
 ac_add_options --enable-signmar
 ac_add_options --enable-verify-mar
 
@@ -23,9 +31,9 @@ ac_add_options --disable-strip
 ac_add_options --disable-install-strip
 ac_add_options --disable-tests
 ac_add_options --disable-debug
-ac_add_options --disable-maintenance-service
 ac_add_options --disable-crashreporter
 ac_add_options --disable-webrtc
 # 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



More information about the tbb-commits mailing list