[tor-commits] [tor-browser-build/master] Bug 20302: Fix FTE compilation for Windows with GCC 6.4.0

gk at torproject.org gk at torproject.org
Wed Apr 11 08:26:34 UTC 2018


commit 8e21b3462302b724aabae24f32b1a7329a32b06a
Author: Nicolas Vigier <boklm at torproject.org>
Date:   Fri Apr 6 14:27:23 2018 +0200

    Bug 20302: Fix FTE compilation for Windows with GCC 6.4.0
---
 projects/libfte/bug20302.patch | 36 ++++++++++++++++++++++++++++++++++++
 projects/libfte/build          |  1 +
 projects/libfte/config         |  2 ++
 3 files changed, 39 insertions(+)

diff --git a/projects/libfte/bug20302.patch b/projects/libfte/bug20302.patch
new file mode 100644
index 0000000..a190e1d
--- /dev/null
+++ b/projects/libfte/bug20302.patch
@@ -0,0 +1,36 @@
+From a2cee5aaf51df9660de6df98ada6706546739d13 Mon Sep 17 00:00:00 2001
+From: Georg Koppen <gk at torproject.org>
+Date: Fri, 7 Oct 2016 09:10:41 +0000
+Subject: [PATCH] Compiling with GCC 6.4.0 based mingw-w64 is broken
+
+Due to a bug in Python (https://bugs.python.org/issue11566) compiling
+with a GCC 6.4.0 based mingw-w64 is broken. This patch adds a workaround
+for this issue.
+
+diff --git a/setup.py b/setup.py
+index f546f1f..721b113 100644
+--- a/setup.py
++++ b/setup.py
+@@ -11,16 +11,16 @@ import os
+
+ if os.name == 'nt':
+     libraries = ['gmp.dll']
++    extra_compile_args=['-O3', '-fPIC', '-D_hypot=hypot']
+ else:
+     libraries = ['gmp']
++    extra_compile_args=['-O3', '-fPIC']
+
+ fte_cDFA = Extension('fte.cDFA',
+                      include_dirs=['fte',
+                                    'thirdparty/gmp/include',
+                                    ],
+-                     extra_compile_args=['-O3',
+-                                         '-fPIC',
+-                                         ],
++                     extra_compile_args=extra_compile_args,
+                      library_dirs=['thirdparty/gmp/bin',
+                                    'thirdparty/gmp/lib',
+                                    ],
+--
+2.9.3
+
diff --git a/projects/libfte/build b/projects/libfte/build
index 9493f30..4f3455f 100644
--- a/projects/libfte/build
+++ b/projects/libfte/build
@@ -13,6 +13,7 @@ ln -s /var/tmp/dist/gmp thirdparty/gmp
 mkdir -p $distdir
 tar -C $distdir -xf $rootdir/[% c('input_files_by_name/obfsproxy') %]
 [% IF c("var/windows") -%]
+  patch -p1 < $rootdir/bug20302.patch
   pydir=$distdir/python
   export FAKETIME="[% USE date; GET date.format(c('timestamp'), format = '%Y-%m-%d %H:%M:%S') %]"
   export LD_PRELOAD=
diff --git a/projects/libfte/config b/projects/libfte/config
index 3b33cf6..2079040 100644
--- a/projects/libfte/config
+++ b/projects/libfte/config
@@ -29,3 +29,5 @@ input_files:
     name: gmp
   - project: obfsproxy
     name: obfsproxy
+  - filename: bug20302.patch
+    enable: '[% c("var/windows") %]'



More information about the tor-commits mailing list