commit 67cf5ed57e2186a5baace53191450d0be2628ae6 Author: Sukhbir Singh sukhbir@torproject.org Date: Thu Aug 31 20:27:50 2017 -0400
Improve Windows builds (update instantbird/build)
Changes borrowed from tor-browser-buid.git/projects/firefox/build and modified for TM builds. This fixes the Windows XP bug (#17469) as well as other unreported issues which prevented Tor Messenger from starting on Windows during our testing of the transition to Firefox 52. --- projects/instantbird/build | 24 ++++++++++++++++++++++++ projects/instantbird/mozconfig-windows-i686 | 2 ++ projects/tor-messenger/build | 5 +++++ projects/tor-messenger/config | 3 +++ 4 files changed, 34 insertions(+)
diff --git a/projects/instantbird/build b/projects/instantbird/build index a963d19..7813fe2 100644 --- a/projects/instantbird/build +++ b/projects/instantbird/build @@ -61,6 +61,24 @@ then fi
[% IF c("var/windows") %] + # FIXME + # Ideally, using LDFLAGS (and e.g. DLLFLAGS for NSS) would be enough to get + # all Firefox libraries linked against msvcr100. Alas, this does not hold for + # NSPR. Without patching it we get a "missing entry points for _strcmpi in + # msvcr100.dll". Now, this should be fixed in rev>=6179 as the def file there + # contains a proper patch according to the mingw-w64 developers. + # However, even with this patch the _strcmpi issue is still popping up, + # probably due to a bug in our current linking setup. The small patch below + # is therefore just a workaround which should get fixed but is at least + # justified as the signature of _strcmpi and _stricmp is the same, see: + # http://msdn.microsoft.com/en-us/library/k59z8dwe.aspx. + sed 's/strcmpi/stricmp/' -i mozilla/nsprpub/pr/src/linking/prlink.c + export HOST_LDFLAGS=" " + export LDFLAGS="-specs=/var/tmp/dist/mingw-w64/msvcr100.spec" + # Our flags don't get passed to NSS. We need to do that manually using an + # obscure one. + export DLLFLAGS="-specs=/var/tmp/dist/mingw-w64/msvcr100.spec" + # Make sure widl is not inserting random timestamps, see #21837. export WIDL_TIME_OVERRIDE="0" [% END %] @@ -78,8 +96,13 @@ echo ac_add_options --with-tor-browser-version='[% c("var/tormessenger_version") ./mozilla/mach package
mkdir -p [% dest_dir _ '/' _ c('filename') %] + mv obj-*/dist/instantbird-*.[% c('var/archive_suffix') %] [% dest_dir _ '/' _ c('filename') %]/instantbird.[% c('var/archive_suffix') %]
+[% IF c("var/windows") %] + cp -a $gcclibs/libssp-0.dll [% dest_dir _ '/' _ c('filename') %]/ +[% END %] + MARTOOLS=/var/tmp/dist/mar-tools mkdir -p $MARTOOLS cp -p mozilla/config/createprecomplete.py $MARTOOLS/ @@ -97,6 +120,7 @@ cp -p obj-*/dist/host/bin/mbsdiff $MARTOOLS/ [% END -%]
cd /var/tmp/dist + [% c('zip', { zip_src => [ 'mar-tools' ], zip_args => dest_dir _ '/' _ c('filename') _ '/' _ c('var/martools_filename'), diff --git a/projects/instantbird/mozconfig-windows-i686 b/projects/instantbird/mozconfig-windows-i686 index b6c46ad..f8e335d 100644 --- a/projects/instantbird/mozconfig-windows-i686 +++ b/projects/instantbird/mozconfig-windows-i686 @@ -1,5 +1,7 @@ export CROSS_COMPILE=1
+mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/obj-mingw + ac_add_options --target=i686-w64-mingw32 ac_add_options --with-toolchain-prefix=i686-w64-mingw32-
diff --git a/projects/tor-messenger/build b/projects/tor-messenger/build index 338af34..1c11ce7 100755 --- a/projects/tor-messenger/build +++ b/projects/tor-messenger/build @@ -16,6 +16,10 @@ mkdir bundle [% IF c("var/windows") -%] 7z x -y -obundle [% c('input_files_by_name/instantbird') %]/instantbird.zip mv bundle/instantbird bundle/Browser + +cp -a $rootdir/msvcr100.dll bundle/Browser +cp -a [% c('input_files_by_name/instantbird') %]/libssp-0.dll bundle/Browser + [% ELSE -%] mkdir bundle/Browser tar xf [% c('input_files_by_name/instantbird') %]/instantbird.tar.bz2 -C bundle/Browser --strip 1 @@ -122,6 +126,7 @@ python pe_checksum_fix.py mv tor-messenger-install-tmp2.exe tor-messenger-install.exe rm tor-messenger-install-tmp.exe mv tor-messenger-install.exe $OUTDIR/[% c('var/bundle_filename') %] + [% ELSE -%] [% c('tar', { tar_src => [ 'tor-messenger' ], diff --git a/projects/tor-messenger/config b/projects/tor-messenger/config index d3f15e1..56f1854 100644 --- a/projects/tor-messenger/config +++ b/projects/tor-messenger/config @@ -39,6 +39,9 @@ input_files: - project: nsis name: nsis enable: '[% c("var/windows") %]' + - URL: https://people.torproject.org/~mikeperry/mirrors/sources/msvcr100.dll + sha256sum: 1221a09484964a6f38af5e34ee292b9afefccb3dc6e55435fd3aaf7c235d9067 + enable: '[% c("var/windows") %]' - project: container-image
var: