[tbb-commits] [tor-browser-build/master] Bug 30384: Use 64bit containers to build 32bit Windows Tor Browser

gk at torproject.org gk at torproject.org
Fri Sep 6 06:54:53 UTC 2019


commit 34626bda99acdcc94d45e7095313d6d3882cdd32
Author: Nicolas Vigier <boklm at torproject.org>
Date:   Fri Aug 30 18:45:23 2019 +0200

    Bug 30384: Use 64bit containers to build 32bit Windows Tor Browser
---
 projects/cbindgen/build                 |  9 ++-------
 projects/debootstrap-image/config       |  7 -------
 projects/firefox/build                  |  5 +----
 projects/firefox/config                 |  6 +++++-
 projects/firefox/mozconfig-windows-i686 |  3 ---
 projects/gcc/build                      |  1 -
 projects/gcc/config                     |  1 -
 projects/go/build                       |  1 -
 projects/go/config                      |  1 -
 projects/mingw-w64-clang/build          |  4 +---
 projects/mingw-w64/config               |  1 -
 projects/rust/build                     |  3 +--
 projects/rust/config                    |  5 +----
 projects/webrtc/build                   |  1 -
 rbm.conf                                | 14 ++------------
 15 files changed, 13 insertions(+), 49 deletions(-)

diff --git a/projects/cbindgen/build b/projects/cbindgen/build
index 402a216..429f567 100644
--- a/projects/cbindgen/build
+++ b/projects/cbindgen/build
@@ -22,13 +22,8 @@ replace-with = "vendored-sources"
 directory = "/var/tmp/build/cbindgen/vendor"
 EOF
 
-[% IF ! c("var/windows-i686") -%]
-  target=x86_64
-[% ELSE -%]
-  target=i686
-[% END -%]
-cargo build --release --frozen --target $target-unknown-linux-gnu
-mv target/$target-unknown-linux-gnu/release/cbindgen $distdir/[% project %]
+cargo build --release --frozen --target x86_64-unknown-linux-gnu
+mv target/x86_64-unknown-linux-gnu/release/cbindgen $distdir/[% project %]
 
 cd $distdir
 [% c('tar', {
diff --git a/projects/debootstrap-image/config b/projects/debootstrap-image/config
index cad9c77..a50cbf1 100644
--- a/projects/debootstrap-image/config
+++ b/projects/debootstrap-image/config
@@ -65,13 +65,6 @@ targets:
         suite: stretch
         arch: amd64
 
-  stretch-i386:
-    var:
-      minimal_apt_version: 1.4.9
-      container:
-        suite: stretch
-        arch: i386
-
 input_files:
   - URL: 'http://cdimage.ubuntu.com/ubuntu-base/releases/[% c("var/ubuntu_version") %]/release/ubuntu-base-[% c("var/ubuntu_version") %]-base-amd64.tar.gz'
     filename: 'container-image_ubuntu-base-[% c("var/ubuntu_version") %]-base-amd64.tar.gz'
diff --git a/projects/firefox/build b/projects/firefox/build
index 1450576..87f8532 100644
--- a/projects/firefox/build
+++ b/projects/firefox/build
@@ -1,5 +1,4 @@
 #!/bin/bash
-[% c("var/setarch") -%]
 [% c("var/set_default_env") -%]
 [% pc(c('var/compiler'), 'var/setup', { compiler_tarfile => c('input_files_by_name/' _ c('var/compiler')) }) %]
 distdir=/var/tmp/dist/[% project %]
@@ -11,9 +10,7 @@ mkdir -p [% dest_dir _ '/' _ c('filename') %]
   tar -C /var/tmp/dist -xf [% c('input_files_by_name/fxc2') %]
   export PATH="/var/tmp/dist/fxc2/bin:$PATH"
   # fxc2 requires Wine.
-  [% IF c("var/windows-x86_64") %]
-    export WINEARCH=win64
-  [% END %]
+  export WINEARCH=[% IF c("var/windows-x86_64") %]win64[% ELSE %]win32[% END %]
   export HOME=/var/tmp/home
   mkdir -p $HOME
   WINEROOT=$HOME/.wine/drive_c
diff --git a/projects/firefox/config b/projects/firefox/config
index b13635c..334a1a8 100644
--- a/projects/firefox/config
+++ b/projects/firefox/config
@@ -111,11 +111,15 @@ targets:
       arch_deps:
         - wine
       pre_pkginst: |
+        [% IF c("var/windows-i686") -%]
+          # We need this to install wine32
+          dpkg --add-architecture i386
+        [% END -%]
         echo 'deb http://ftp.debian.org/debian stretch-backports main' >> /etc/apt/sources.list
       post_pkginst: |
         # We need to have at least 3.0.3 which Mozilla is using in the
         # mingw-w64/clang build process
-        apt-get -y -t stretch-backports install wine
+        apt-get -y -t stretch-backports install wine[% IF c("var/windows-i686") %]32[% END %]
       compiler: mingw-w64-clang
 
   windows-i686:
diff --git a/projects/firefox/mozconfig-windows-i686 b/projects/firefox/mozconfig-windows-i686
index 5538bc1..eaa704f 100644
--- a/projects/firefox/mozconfig-windows-i686
+++ b/projects/firefox/mozconfig-windows-i686
@@ -24,9 +24,6 @@ export MOZILLA_OFFICIAL=1
 mk_add_options BUILD_OFFICIAL=1
 
 ac_add_options --disable-debug
-# Until we build on a 64bit host we need to hack around linker errors due to
-# memory constraints
-ac_add_options --disable-debug-symbols
 ac_add_options --enable-optimize
 ac_add_options --enable-strip
 ac_add_options --enable-official-branding
diff --git a/projects/gcc/build b/projects/gcc/build
index 1d055b4..bd7e837 100644
--- a/projects/gcc/build
+++ b/projects/gcc/build
@@ -1,6 +1,5 @@
 #!/bin/sh
 [% c("var/set_default_env") -%]
-[% c("var/setarch") -%]
 [% IF c("var/linux") -%]
   # Config options for hardening-wrapper
   export DEB_BUILD_HARDENING=1
diff --git a/projects/gcc/config b/projects/gcc/config
index 9fef3c4..d776a2c 100644
--- a/projects/gcc/config
+++ b/projects/gcc/config
@@ -8,7 +8,6 @@ var:
     - build-essential
     - libmpc-dev
   setup: |
-    [% c("var/setarch") -%]
     mkdir -p /var/tmp/dist
     tar -C /var/tmp/dist -xf $rootdir/[% c("compiler_tarfile") %]
     export PATH="/var/tmp/dist/gcc/bin:$PATH"
diff --git a/projects/go/build b/projects/go/build
index b9057a5..4945c88 100644
--- a/projects/go/build
+++ b/projects/go/build
@@ -1,6 +1,5 @@
 #!/bin/bash
 [% c("var/set_default_env") -%]
-[% c("var/setarch") -%]
 distdir=/var/tmp/dist/[% project %]
 mkdir -p /var/tmp/dist
 
diff --git a/projects/go/config b/projects/go/config
index fd96bb6..ffe07ea 100644
--- a/projects/go/config
+++ b/projects/go/config
@@ -8,7 +8,6 @@ var:
     use_container: 1
 
   setup: |
-    [% c("var/setarch") -%]
     mkdir -p /var/tmp/dist
     tar -C /var/tmp/dist -xf $rootdir/[% c("go_tarfile") %]
     export GOOS=[% c("var/GOOS") %]
diff --git a/projects/mingw-w64-clang/build b/projects/mingw-w64-clang/build
index 820346d..b63a87f 100644
--- a/projects/mingw-w64-clang/build
+++ b/projects/mingw-w64-clang/build
@@ -24,9 +24,7 @@ tar -xf $rootdir/[% c('input_files_by_name/llvm-mingw') %]
 # Adding the wrappers and symlinks we need
 cd $distdir/bin
 exception_flags=""
-target=""
 [% IF c("var/windows-i686") %]
-  target="--target=i686-linux-gnu"
   exception_flags="-fsjlj-exceptions"
 [% END -%]
 compiler_flags="--sysroot \$DIR/../[% c("arch") %]-w64-mingw32 -rtlib=compiler-rt -stdlib=libc++ -fuse-ld=lld $exception_flags -fuse-cxa-atexit -Qunused-arguments"
@@ -49,7 +47,7 @@ ln -s llvm-nm [% c("arch") %]-w64-mingw32-nm
 ln -s llvm-strip [% c("arch") %]-w64-mingw32-strip
 ln -s llvm-readobj [% c("arch") %]-w64-mingw32-readobj
 ln -s llvm-objcopy [% c("arch") %]-w64-mingw32-objcopy
-./clang $builddir/llvm-mingw/wrappers/windres-wrapper.c $target -O2 -Wl,-s -o [% c("arch") %]-w64-mingw32-windres
+./clang $builddir/llvm-mingw/wrappers/windres-wrapper.c -O2 -Wl,-s -o [% c("arch") %]-w64-mingw32-windres
 
 # Building mingw-w64
 export PATH="$distdir/bin:/var/tmp/dist/cmake/bin:$PATH"
diff --git a/projects/mingw-w64/config b/projects/mingw-w64/config
index 3bb1dda..658c83d 100644
--- a/projects/mingw-w64/config
+++ b/projects/mingw-w64/config
@@ -12,7 +12,6 @@ var:
     - build-essential
     - libmpc-dev
   setup: |
-    [% c("var/setarch") -%]
     mkdir -p /var/tmp/dist
     tar -C /var/tmp/dist -xf $rootdir/[% c("compiler_tarfile") %]
     export PATH="/var/tmp/dist/mingw-w64/bin:$PATH"
diff --git a/projects/rust/build b/projects/rust/build
index ce039ea..9a6b54a 100644
--- a/projects/rust/build
+++ b/projects/rust/build
@@ -1,12 +1,11 @@
 #!/bin/bash
-[% c('var/setarch') %]
 [% c("var/set_default_env") -%]
 distdir=/var/tmp/dist/[% project %]
 mkdir -p $distdir
 tar -C /var/tmp/dist -xf [% c('input_files_by_name/cmake') %]
 export PATH="/var/tmp/dist/cmake/bin:$PATH"
 tar -C /var/tmp/dist -xf [% c('input_files_by_name/prev_rust') %]
-cd /var/tmp/dist/rust-[% c('var/prev_version') %]-[% c('var/rust_arch') %]-unknown-linux-gnu
+cd /var/tmp/dist/rust-[% c('var/prev_version') %]-x86_64-unknown-linux-gnu
 ./install.sh --prefix=$distdir-rust-old
 export PATH="$distdir-rust-old/bin:$PATH"
 
diff --git a/projects/rust/config b/projects/rust/config
index 106c709..dbde815 100644
--- a/projects/rust/config
+++ b/projects/rust/config
@@ -4,14 +4,12 @@ version: 1.34.2
 
 var:
   prev_version: 1.33.0
-  rust_arch: '[% c("arch") %]'
   container:
     use_container: 1
 
 targets:
   android:
     var:
-      rust_arch: x86_64
       arch_deps:
         - libssl-dev
         - pkg-config
@@ -30,7 +28,6 @@ targets:
 
   linux:
     var:
-      rust_arch: x86_64
       deps:
         - libc6-dev-i386
         - lib32stdc++6
@@ -98,7 +95,7 @@ input_files:
     sig_ext: asc
     file_gpg_id: 1
     gpg_keyring: rust.gpg
-  - URL: 'https://static.rust-lang.org/dist/rust-[% c("var/prev_version") %]-[% c("var/rust_arch") %]-unknown-linux-gnu.tar.xz'
+  - URL: 'https://static.rust-lang.org/dist/rust-[% c("var/prev_version") %]-x86_64-unknown-linux-gnu.tar.xz'
     name: prev_rust
     sig_ext: asc
     file_gpg_id: 1
diff --git a/projects/webrtc/build b/projects/webrtc/build
index 77d4026..2ede64b 100644
--- a/projects/webrtc/build
+++ b/projects/webrtc/build
@@ -1,7 +1,6 @@
 #!/bin/bash
 set -e
 [% c("var/set_default_env") -%]
-[% c("var/setarch") -%]
 distdir=/var/tmp/dist/[% project %]
 [% pc(c('var/compiler'), 'var/setup', { compiler_tarfile => c('input_files_by_name/' _ c('var/compiler')) }) %]
 
diff --git a/rbm.conf b/rbm.conf
index 967eb08..581bd0e 100644
--- a/rbm.conf
+++ b/rbm.conf
@@ -280,9 +280,6 @@ targets:
     var:
       windows-x86_64: 1
       osname: windows-x86_64
-      container:
-        arch: amd64
-      faketime_path: /usr/lib/x86_64-linux-gnu/faketime/libfaketime.so.1
       # HEASLR is 64 bit only (see bug 12968)
       flag_HEASLR: '-Wl,--high-entropy-va'
   windows-i686:
@@ -290,25 +287,18 @@ targets:
     var:
       windows-i686: 1
       osname: windows-i686
-      container:
-        arch: i386
-      faketime_path: /usr/lib/i386-linux-gnu/faketime/libfaketime.so.1
-      setarch: |
-        if test -z "$RBM_SETARCH"
-        then
-           export RBM_SETARCH=1
-           exec setarch i686 ./build
-        fi
   windows:
     var:
       windows: 1
       container:
         suite: stretch
+        arch: amd64
       configure_opt: '--host=[% c("arch") %]-w64-mingw32 CFLAGS="[% c("var/CFLAGS") %]" LDFLAGS="[% c("var/LDFLAGS") %]"'
       CFLAGS: '-fstack-protector-strong -fno-strict-overflow -Wno-missing-field-initializers -Wformat -Wformat-security [% c("var/flag_mwindows") %]'
       LDFLAGS: '-Wl,--dynamicbase -Wl,--nxcompat -Wl,--enable-reloc-section -Wl,--no-insert-timestamp -lssp -L$gcclibs [% c("var/flag_HEASLR") %] [% c("var/flag_mwindows") %]'
       flag_mwindows: '-mwindows'
       compiler: mingw-w64
+      faketime_path: /usr/lib/x86_64-linux-gnu/faketime/libfaketime.so.1
       deps:
         - build-essential
         - python



More information about the tbb-commits mailing list